From 73c516041bc6e1d971f6f266f0685d66188d8b6a Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 24 Aug 2026 09:24:53 +0200 Subject: [PATCH 01/10] feat(auth-rbac): implement isomorphic RBAC security engine with FLS, M2M agent guards and tarpitting (closes #24) --- packages/auth-rbac/HOWTO.md | 139 ++++++++ packages/auth-rbac/README.md | 85 +++++ packages/auth-rbac/jest.config.ts | 8 + packages/auth-rbac/package.json | 46 +++ .../src/engine/RbacPolicyEngine.test.ts | 216 ++++++++++++ .../auth-rbac/src/engine/RbacPolicyEngine.ts | 318 ++++++++++++++++++ .../src/engine/TarpitManager.test.ts | 89 +++++ .../auth-rbac/src/engine/TarpitManager.ts | 100 ++++++ packages/auth-rbac/src/index.ts | 17 + .../src/middlewares/AbstractRbacMiddleware.ts | 70 ++++ .../middlewares/AstroRbacMiddleware.test.ts | 95 ++++++ .../src/middlewares/AstroRbacMiddleware.ts | 146 ++++++++ .../middlewares/ExpressRbacMiddleware.test.ts | 96 ++++++ .../src/middlewares/ExpressRbacMiddleware.ts | 137 ++++++++ packages/auth-rbac/src/types/RbacTypes.ts | 143 ++++++++ packages/auth-rbac/src/types/index.ts | 1 + packages/auth-rbac/tsconfig.json | 15 + yarn.lock | 19 ++ 18 files changed, 1740 insertions(+) create mode 100644 packages/auth-rbac/HOWTO.md create mode 100644 packages/auth-rbac/README.md create mode 100644 packages/auth-rbac/jest.config.ts create mode 100644 packages/auth-rbac/package.json create mode 100644 packages/auth-rbac/src/engine/RbacPolicyEngine.test.ts create mode 100644 packages/auth-rbac/src/engine/RbacPolicyEngine.ts create mode 100644 packages/auth-rbac/src/engine/TarpitManager.test.ts create mode 100644 packages/auth-rbac/src/engine/TarpitManager.ts create mode 100644 packages/auth-rbac/src/index.ts create mode 100644 packages/auth-rbac/src/middlewares/AbstractRbacMiddleware.ts create mode 100644 packages/auth-rbac/src/middlewares/AstroRbacMiddleware.test.ts create mode 100644 packages/auth-rbac/src/middlewares/AstroRbacMiddleware.ts create mode 100644 packages/auth-rbac/src/middlewares/ExpressRbacMiddleware.test.ts create mode 100644 packages/auth-rbac/src/middlewares/ExpressRbacMiddleware.ts create mode 100644 packages/auth-rbac/src/types/RbacTypes.ts create mode 100644 packages/auth-rbac/src/types/index.ts create mode 100644 packages/auth-rbac/tsconfig.json diff --git a/packages/auth-rbac/HOWTO.md b/packages/auth-rbac/HOWTO.md new file mode 100644 index 00000000..f1d98d41 --- /dev/null +++ b/packages/auth-rbac/HOWTO.md @@ -0,0 +1,139 @@ +# How-To & Integration Guide : @quatrain/auth-rbac + +This guide demonstrates common integration scenarios using `@quatrain/auth-rbac` across Astro, Express, and headless controllers. + +--- + +## 1. Defining Roles & Tarpit Policies + +Declare role hierarchies, entity field rules, and M2M agent tarpit limits: + +```typescript +import { RbacPolicyEngine, type RoleDefinition } from '@quatrain/auth-rbac' + +export const appRoles: RoleDefinition[] = [ + { + id: 'reader', + name: 'Reader', + routes: [ + { pattern: '/api/curate', methods: ['GET'], access: 'allow' }, + { pattern: '/public/**', methods: ['*'], access: 'allow' }, + { pattern: '/**', methods: ['*'], access: 'deny' } + ], + entities: { + 'okf-document': { + defaultMode: 'readonly', + fields: { + internalNotes: 'hidden', + rawLogs: 'hidden' + } + } + } + }, + { + id: 'curator', + name: 'Curator', + inherits: ['reader'], + routes: [ + { pattern: '/api/curate', methods: ['POST', 'PUT'], access: 'allow' }, + { pattern: '/api/upload', methods: ['POST'], access: 'allow' } + ], + entities: { + 'okf-document': { + defaultMode: 'readwrite', + fields: { + soa: 'readonly', + revision: 'readonly', + internalNotes: 'hidden' + } + } + } + }, + { + id: 'ai-agent', + name: 'AI Agent Service', + subjectTypes: ['agent', 'service'], + routes: [ + { pattern: '/api/agent/**', methods: ['POST'], access: 'allow' } + ], + tarpit: { + enabled: true, + burst: 5, + maxRequestsPerMinute: 30, + delayMs: 500, + blockDurationMs: 60000 // 1 minute temporary lock on abuse + } + } +] + +export const rbacEngine = new RbacPolicyEngine(appRoles) +``` + +--- + +## 2. Using with Astro (SSR & API Middlewares) + +In `src/middleware.ts` of your Astro application: + +```typescript +import { sequence } from 'astro:middleware' +import { AstroRbacMiddleware } from '@quatrain/auth-rbac' +import { rbacEngine } from './lib/rbac' + +const rbacMiddleware = new AstroRbacMiddleware(rbacEngine, { + loginRedirectPath: '/login', + forbiddenRedirectPath: '/403', + enableTarpitSleep: true +}) + +export const onRequest = sequence( + // Your auth session middleware setting context.locals.user ... + rbacMiddleware.handler() +) +``` + +Inside an Astro API endpoint (`src/pages/api/curate.ts`): + +```typescript +import type { APIRoute } from 'astro' + +export const POST: APIRoute = async ({ request, locals }) => { + const rbac = locals.rbac // Injected automatically + const body = await request.json() + + // 1. Sanitize incoming write payload against curator role + const safeData = rbac.sanitizeWrite('okf-document', body) + + // 2. Persist to storage / database + const savedItem = await documentService.save(safeData) + + // 3. Sanitize outgoing read payload + const clientResponse = rbac.sanitizeRead('okf-document', savedItem) + + return new Response(JSON.stringify(clientResponse), { + headers: { 'Content-Type': 'application/json' } + }) +} +``` + +--- + +## 3. Using with Express + +```typescript +import express from 'express' +import { ExpressRbacMiddleware } from '@quatrain/auth-rbac' +import { rbacEngine } from './lib/rbac' + +const app = express() +const rbacMiddleware = new ExpressRbacMiddleware(rbacEngine) + +app.use(express.json()) +app.use(rbacMiddleware.handler()) + +app.post('/api/curate', (req, res) => { + const safeInput = req.rbac.sanitizeWrite('okf-document', req.body) + // ... process safeInput + res.json(req.rbac.sanitizeRead('okf-document', safeInput)) +}) +``` diff --git a/packages/auth-rbac/README.md b/packages/auth-rbac/README.md new file mode 100644 index 00000000..7de1dcca --- /dev/null +++ b/packages/auth-rbac/README.md @@ -0,0 +1,85 @@ +# @quatrain/auth-rbac + +> **License**: AGPL-3.0-only +> **Isomorphic Role-Based Access Control, Field-Level Security, M2M Agent Guards & Tarpitting for Quatrain** + +`@quatrain/auth-rbac` is an isomorphic, cloud-native authorization engine designed for the Quatrain ecosystem. It provides unified, declarative access control spanning: +- **Macro-Security**: Route and endpoint protection (URI patterns + HTTP methods). +- **Micro-Security (FLS)**: Field-Level Security calculating `hidden`, `readonly`, and `readwrite` modes per entity property. +- **Automated Payload Sanitization**: `sanitizeRead()` and `sanitizeWrite()` eliminating schema duplication. +- **M2M & AI Agent Defense**: Subject-type separation (`human`, `agent`, `service`) with built-in **tarpitting** (progressive latency injection and request throttling for automated scraping and runaway agent loops). +- **Isomorphic Middlewares**: Abstract base class with concrete adapters for **Express** and **Astro SSR/API**. + +--- + +## Installation + +Within the Quatrain monorepo: + +```json +{ + "dependencies": { + "@quatrain/auth-rbac": "workspace:*" + } +} +``` + +--- + +## Core Architecture + +``` +@quatrain/auth-rbac + ├── engine/ + │ ├── RbacPolicyEngine # Resolves role inheritance, route matching, FLS and payload sanitization + │ └── TarpitManager # Manages sliding-window request throttling and progressive latency injection + ├── middlewares/ + │ ├── AbstractRbacMiddleware # Agnostic middleware foundation + │ ├── ExpressRbacMiddleware # Standard Express (req, res, next) guard + │ └── AstroRbacMiddleware # Unified Astro SSR and API guard + └── types/ # Strongly typed interfaces and contracts +``` + +--- + +## Quick Example + +```typescript +import { RbacPolicyEngine } from '@quatrain/auth-rbac' + +const engine = new RbacPolicyEngine([ + { + id: 'curator', + name: 'Agronomy Curator', + routes: [ + { pattern: '/api/curate', methods: ['GET', 'POST'], access: 'allow' }, + { pattern: '/**', methods: ['*'], access: 'deny' } + ], + entities: { + 'okf-document': { + defaultMode: 'readwrite', + fields: { + soa: 'readonly', + internalReviewerNotes: 'hidden' + } + } + } + } +]) + +const user = { id: 'u1', roles: ['curator'], subjectType: 'human' } + +// 1. Route check +engine.canAccessRoute(user, '/api/curate', 'POST') // true + +// 2. Field mode check +engine.getFieldAccess(user, 'okf-document', 'soa') // 'readonly' +engine.getFieldAccess(user, 'okf-document', 'internalReviewerNotes') // 'hidden' + +// 3. Payload sanitization +const cleanPayload = engine.sanitizeWrite(user, 'okf-document', { + title: 'Soil Guide', + soa: 'malicious/soa', // Stripped automatically + internalReviewerNotes: 'Secret' // Stripped automatically +}) +``` diff --git a/packages/auth-rbac/jest.config.ts b/packages/auth-rbac/jest.config.ts new file mode 100644 index 00000000..c8f3403b --- /dev/null +++ b/packages/auth-rbac/jest.config.ts @@ -0,0 +1,8 @@ +export default { + coverageProvider: 'v8', + setupFiles: ['trace-unhandled/register'], + transform: { + '\\.(ts)$': 'ts-jest', + }, + testMatch: ['**/?(*.)+(spec|test).ts'], +} diff --git a/packages/auth-rbac/package.json b/packages/auth-rbac/package.json new file mode 100644 index 00000000..79c627d5 --- /dev/null +++ b/packages/auth-rbac/package.json @@ -0,0 +1,46 @@ +{ + "name": "@quatrain/auth-rbac", + "version": "1.0.0", + "license": "AGPL-3.0-only", + "description": "Isomorphic Role-Based Access Control, Field-Level Security, M2M Agent Guards & Tarpitting for Quatrain", + "main": "dist/index.js", + "types": "dist/index.d.ts", + "bun": "src/index.ts", + "files": [ + "LICENSE.md", + "src/", + "dist/", + "README.md", + "HOWTO.md", + "NOTICE.md" + ], + "repository": { + "type": "git", + "url": "git+https://github.com/Quatrain/Core.git", + "directory": "packages/auth-rbac" + }, + "author": "Quatrain Développement SAS ", + "dependencies": { + "@quatrain/api": "workspace:*", + "@quatrain/http": "workspace:*" + }, + "devDependencies": { + "@tsconfig/recommended": "^1.0.1", + "@types/jest": "^29.5.12", + "@types/node": "^22.10.1", + "jest": "^29.7.0", + "jest-node-exports-resolver": "^1.1.6", + "jest-serial-runner": "^1.2.1", + "trace-unhandled": "^2.0.1", + "ts-jest": "^29.4.6", + "ts-node": "^10.9.1", + "typescript": "^5.1.5" + }, + "scripts": { + "test-ci": "jest --runInBand", + "test": "jest", + "build": "tsc", + "wbuild": "tsc --watch", + "bump-to": "yarn version" + } +} diff --git a/packages/auth-rbac/src/engine/RbacPolicyEngine.test.ts b/packages/auth-rbac/src/engine/RbacPolicyEngine.test.ts new file mode 100644 index 00000000..84b7263c --- /dev/null +++ b/packages/auth-rbac/src/engine/RbacPolicyEngine.test.ts @@ -0,0 +1,216 @@ +import { RbacPolicyEngine } from './RbacPolicyEngine' +import type { RoleDefinition, RbacUserContext } from '../types' + +describe('RbacPolicyEngine', () => { + const roles: RoleDefinition[] = [ + { + id: 'reader', + name: 'Reader', + routes: [ + { pattern: '/api/curate', methods: ['GET'], access: 'allow' }, + { pattern: '/api/taxonomies', methods: ['GET'], access: 'allow' }, + { pattern: '/public/**', methods: ['*'], access: 'allow' }, + { pattern: '/**', methods: ['*'], access: 'deny' } + ], + entities: { + 'okf-document': { + defaultMode: 'readonly', + fields: { + internalReviewerNotes: 'hidden', + telemetryWeights: 'hidden', + title: 'readonly', + soa: 'readonly' + } + } + } + }, + { + id: 'curator', + name: 'Curator', + inherits: ['reader'], + routes: [ + { pattern: '/api/curate', methods: ['POST', 'PUT'], access: 'allow' }, + { pattern: '/api/upload', methods: ['POST'], access: 'allow' } + ], + entities: { + 'okf-document': { + defaultMode: 'readwrite', + fields: { + soa: 'readonly', + revision: 'readonly', + internalReviewerNotes: 'hidden' + } + } + } + }, + { + id: 'admin', + name: 'Administrator', + inherits: ['curator'], + routes: [{ pattern: '/**', methods: ['*'], access: 'allow' }], + entities: { + 'okf-document': { + defaultMode: 'readwrite', + fields: { + soa: 'readwrite', + revision: 'readwrite', + internalReviewerNotes: 'readwrite' + } + } + } + }, + { + id: 'ai-agent', + name: 'AI Agent Bot', + subjectTypes: ['agent'], + routes: [{ pattern: '/api/agent/**', methods: ['POST'], access: 'allow' }], + tarpit: { + enabled: true, + burst: 2, + maxRequestsPerMinute: 5, + delayMs: 100 + } + } + ] + + let engine: RbacPolicyEngine + + beforeEach(() => { + engine = new RbacPolicyEngine(roles) + }) + + describe('Route Access Control', () => { + const readerUser: RbacUserContext = { id: 'u1', roles: ['reader'], subjectType: 'human' } + const curatorUser: RbacUserContext = { id: 'u2', roles: ['curator'], subjectType: 'human' } + const adminUser: RbacUserContext = { id: 'u3', roles: ['admin'], subjectType: 'human' } + + it('allows reader to GET /api/curate but denies POST /api/curate', () => { + expect(engine.canAccessRoute(readerUser, '/api/curate', 'GET')).toBe(true) + expect(engine.canAccessRoute(readerUser, '/api/curate', 'POST')).toBe(false) + }) + + it('allows curator to GET and POST /api/curate via inherited permissions', () => { + expect(engine.canAccessRoute(curatorUser, '/api/curate', 'GET')).toBe(true) + expect(engine.canAccessRoute(curatorUser, '/api/curate', 'POST')).toBe(true) + expect(engine.canAccessRoute(curatorUser, '/api/upload', 'POST')).toBe(true) + expect(engine.canAccessRoute(curatorUser, '/admin/settings', 'GET')).toBe(false) + }) + + it('allows admin full access to any route and method', () => { + expect(engine.canAccessRoute(adminUser, '/admin/settings', 'GET')).toBe(true) + expect(engine.canAccessRoute(adminUser, '/api/documents/123', 'DELETE')).toBe(true) + }) + + it('applies default deny for unmapped routes or missing roles', () => { + const anon: RbacUserContext = { id: 'anon', roles: [] } + expect(engine.canAccessRoute(anon, '/api/curate', 'GET')).toBe(false) + }) + }) + + describe('Field-Level Security (FLS) Calculation', () => { + const readerUser: RbacUserContext = { id: 'u1', roles: ['reader'] } + const curatorUser: RbacUserContext = { id: 'u2', roles: ['curator'] } + const adminUser: RbacUserContext = { id: 'u3', roles: ['admin'] } + + it('resolves field modes accurately per role level', () => { + // Reader + expect(engine.getFieldAccess(readerUser, 'okf-document', 'internalReviewerNotes')).toBe('hidden') + expect(engine.getFieldAccess(readerUser, 'okf-document', 'title')).toBe('readonly') + expect(engine.getFieldAccess(readerUser, 'okf-document', 'soa')).toBe('readonly') + + // Curator (inherits reader, overrides default to readwrite, but keeps soa readonly and notes hidden) + expect(engine.getFieldAccess(curatorUser, 'okf-document', 'title')).toBe('readwrite') + expect(engine.getFieldAccess(curatorUser, 'okf-document', 'soa')).toBe('readonly') + expect(engine.getFieldAccess(curatorUser, 'okf-document', 'internalReviewerNotes')).toBe('hidden') + + // Admin (full readwrite on all fields) + expect(engine.getFieldAccess(adminUser, 'okf-document', 'internalReviewerNotes')).toBe('readwrite') + expect(engine.getFieldAccess(adminUser, 'okf-document', 'soa')).toBe('readwrite') + }) + }) + + describe('Payload Sanitization (sanitizeRead & sanitizeWrite)', () => { + const rawDocument = { + title: 'Diagnostic des Sols', + soa: 'bradtech/world-agronomy', + revision: 'rev-1.0.0', + description: 'Analyse terrain', + internalReviewerNotes: 'Confidential peer review remarks', + telemetryWeights: { score: 98 } + } + + it('strips hidden fields on sanitizeRead for readers', () => { + const readerUser: RbacUserContext = { id: 'u1', roles: ['reader'] } + const readResult = engine.sanitizeRead(readerUser, 'okf-document', rawDocument) + + expect(readResult.title).toBe('Diagnostic des Sols') + expect(readResult.soa).toBe('bradtech/world-agronomy') + expect((readResult as any).internalReviewerNotes).toBeUndefined() + expect((readResult as any).telemetryWeights).toBeUndefined() + }) + + it('filters out readonly and hidden fields on sanitizeWrite for curators', () => { + const curatorUser: RbacUserContext = { id: 'u2', roles: ['curator'] } + const inputUpdate = { + title: 'Updated Title', + description: 'New Description', + soa: 'hacked/malicious-soa', // Readonly -> MUST be stripped + revision: 'rev-999.0.0', // Readonly -> MUST be stripped + internalReviewerNotes: 'Injected notes' // Hidden -> MUST be stripped + } + + const writeResult = engine.sanitizeWrite(curatorUser, 'okf-document', inputUpdate) + + expect(writeResult.title).toBe('Updated Title') + expect(writeResult.description).toBe('New Description') + expect((writeResult as any).soa).toBeUndefined() + expect((writeResult as any).revision).toBeUndefined() + expect((writeResult as any).internalReviewerNotes).toBeUndefined() + }) + + it('preserves all writable fields on sanitizeWrite for admins', () => { + const adminUser: RbacUserContext = { id: 'u3', roles: ['admin'] } + const adminInput = { + title: 'Admin Override Title', + soa: 'bradtech/official-authority', + revision: 'rev-2.0.0', + internalReviewerNotes: 'Approved by Dr. Dupont' + } + + const writeResult = engine.sanitizeWrite(adminUser, 'okf-document', adminInput) + expect(writeResult.title).toBe('Admin Override Title') + expect(writeResult.soa).toBe('bradtech/official-authority') + expect(writeResult.revision).toBe('rev-2.0.0') + expect((writeResult as any).internalReviewerNotes).toBe('Approved by Dr. Dupont') + }) + }) + + describe('Subject Type & Tarpitting for AI Agents', () => { + it('enforces subjectType matching so human cannot assume agent-only role', () => { + const humanUser: RbacUserContext = { id: 'h1', roles: ['ai-agent'], subjectType: 'human' } + expect(engine.canAccessRoute(humanUser, '/api/agent/task', 'POST')).toBe(false) + + const agentUser: RbacUserContext = { id: 'bot-1', roles: ['ai-agent'], subjectType: 'agent' } + expect(engine.canAccessRoute(agentUser, '/api/agent/task', 'POST')).toBe(true) + }) + + it('injects tarpit delay when an agent exceeds burst limit', () => { + const agentUser: RbacUserContext = { id: 'bot-fast', roles: ['ai-agent'], subjectType: 'agent' } + + // 1st & 2nd request (burst = 2) + const res1 = engine.evaluateRoute(agentUser, '/api/agent/task', 'POST') + expect(res1.allowed).toBe(true) + expect(res1.tarpitDelayMs).toBe(0) + + const res2 = engine.evaluateRoute(agentUser, '/api/agent/task', 'POST') + expect(res2.allowed).toBe(true) + expect(res2.tarpitDelayMs).toBe(0) + + // 3rd request -> burst exceeded -> Tarpit latency injected! + const res3 = engine.evaluateRoute(agentUser, '/api/agent/task', 'POST') + expect(res3.allowed).toBe(true) + expect(res3.tarpitDelayMs).toBeGreaterThan(0) + expect(res3.isThrottled).toBe(true) + }) + }) +}) diff --git a/packages/auth-rbac/src/engine/RbacPolicyEngine.ts b/packages/auth-rbac/src/engine/RbacPolicyEngine.ts new file mode 100644 index 00000000..59c0a7e1 --- /dev/null +++ b/packages/auth-rbac/src/engine/RbacPolicyEngine.ts @@ -0,0 +1,318 @@ +import type { + RoleDefinition, + RbacUserContext, + HttpMethod, + FieldAccessMode, + RouteRule, + RouteEvaluationResult, + SubjectType +} from '../types' +import { TarpitManager } from './TarpitManager' + +/** + * Normalizes an URI string for consistent glob and segment comparison. + */ +function normalizeUri(uri: string): string { + let clean = uri.trim() + if (!clean.startsWith('/')) clean = `/${clean}` + if (clean.length > 1 && clean.endsWith('/')) clean = clean.slice(0, -1) + return clean +} + +/** + * Checks if a path matches a glob pattern (supporting `*` for single segment and `**` for recursive segments). + */ +function matchGlob(pattern: string, uri: string): boolean { + const normPattern = normalizeUri(pattern) + const normUri = normalizeUri(uri) + + if (normPattern === '/**' || normPattern === '*') return true + if (normPattern === normUri) return true + + // Safely translate glob tokens (** and *) to regex + const regexString = + '^' + + normPattern + .split('**') + .map((segment) => + segment + .split('*') + .map((sub) => sub.replace(/[-[\]{}()+?.,\\^$|#\s]/g, '\\$&')) + .join('[^/]+') + ) + .join('.*') + + '$' + + const regex = new RegExp(regexString) + return regex.test(normUri) +} + +/** + * Isomorphic RBAC and Field-Level Security Engine for Quatrain. + * Manages role hierarchies, route authorizations, payload sanitization, and M2M tarpitting. + */ +export class RbacPolicyEngine { + private roles: Map = new Map() + public readonly tarpitManager: TarpitManager + + constructor(rolesConfig: RoleDefinition[] = [], tarpitManager?: TarpitManager) { + rolesConfig.forEach((role) => { + this.registerRole(role) + }) + this.tarpitManager = tarpitManager || new TarpitManager() + } + + /** + * Registers a new role definition into the engine. + * + * @param role - The role definition to add. + */ + public registerRole(role: RoleDefinition): void { + this.roles.set(role.id, role) + } + + /** + * Resolves the full list of inherited and direct roles for a given set of role IDs. + * + * @param roleIds - Assigned role identifiers. + * @param visited - Cycle detection tracker. + * @returns Array of all active RoleDefinition instances. + */ + public resolveRoles(roleIds: string[], visited: Set = new Set()): RoleDefinition[] { + const resolved: RoleDefinition[] = [] + + for (const roleId of roleIds) { + if (visited.has(roleId)) continue + visited.add(roleId) + + const role = this.roles.get(roleId) + if (role) { + resolved.push(role) + if (role.inherits && role.inherits.length > 0) { + const parentRoles = this.resolveRoles(role.inherits, visited) + resolved.push(...parentRoles) + } + } + } + + return resolved + } + + /** + * Filters roles based on subject type compatibility (e.g. human vs agent vs service). + */ + private getApplicableRoles(user: RbacUserContext): RoleDefinition[] { + const allRoles = this.resolveRoles(user.roles || []) + const userSubject: SubjectType = user.subjectType || 'human' + + return allRoles.filter((r) => { + if (!r.subjectTypes || r.subjectTypes.length === 0) return true + return r.subjectTypes.includes(userSubject) + }) + } + + /** + * Evaluates route access for a user context against a target URI and HTTP method. + * + * @param user - Authenticated user context. + * @param uri - Requested URI path. + * @param method - HTTP method (defaults to 'GET'). + * @returns Detailed evaluation result including allow/deny decision and tarpit latency. + */ + public evaluateRoute( + user: RbacUserContext, + uri: string, + method: HttpMethod = 'GET' + ): RouteEvaluationResult { + const normUri = normalizeUri(uri) + const upperMethod = (method.toUpperCase() as HttpMethod) || 'GET' + const applicableRoles = this.getApplicableRoles(user) + + // 1. Tarpit Evaluation for M2M Agents and suspicious traffic + let highestTarpitDelay = 0 + let isThrottled = false + + for (const role of applicableRoles) { + if (role.tarpit && role.tarpit.enabled !== false) { + const subjectKey = `${user.subjectType || 'human'}:${user.id}` + const tarpitRes = this.tarpitManager.evaluate(subjectKey, role.tarpit) + if (tarpitRes.delayMs > highestTarpitDelay) { + highestTarpitDelay = tarpitRes.delayMs + } + if (tarpitRes.isThrottled) { + isThrottled = true + } + if (tarpitRes.isBlocked) { + return { + allowed: false, + decision: 'deny', + tarpitDelayMs: highestTarpitDelay, + isThrottled: true, + reason: 'Subject is temporarily blocked due to repeated rate limit violations (Tarpit Lock).' + } + } + } + } + + // 2. Gather all route rules from applicable roles + const matchingRules: { rule: RouteRule; score: number }[] = [] + + for (const role of applicableRoles) { + if (!role.routes) continue + + for (const rule of role.routes) { + const methodMatches = + !rule.methods || + rule.methods.length === 0 || + rule.methods.includes('*') || + rule.methods.includes(upperMethod) + + if (methodMatches && matchGlob(rule.pattern, normUri)) { + // Specificity score: longer patterns have higher priority + const score = rule.pattern.replace(/\*/g, '').length + matchingRules.push({ rule, score }) + } + } + } + + // Sort by specificity descending + matchingRules.sort((a, b) => b.score - a.score) + + if (matchingRules.length > 0) { + const topMatch = matchingRules[0].rule + return { + allowed: topMatch.access === 'allow', + decision: topMatch.access, + matchedRule: topMatch, + tarpitDelayMs: highestTarpitDelay, + isThrottled + } + } + + // Default Deny if no explicit rule matched + return { + allowed: false, + decision: 'deny', + tarpitDelayMs: highestTarpitDelay, + isThrottled, + reason: 'No matching route rule found (Default Deny).' + } + } + + /** + * Fast boolean check for route access. + */ + public canAccessRoute(user: RbacUserContext, uri: string, method: HttpMethod = 'GET'): boolean { + return this.evaluateRoute(user, uri, method).allowed + } + + /** + * Computes the effective Field Access Mode ('hidden' | 'readonly' | 'readwrite') + * for a specific entity property across all assigned roles. + * + * Precedence: 'readwrite' (2) > 'readonly' (1) > 'hidden' (0). + * + * @param user - Authenticated user context. + * @param entity - Entity name (e.g. "okf-document"). + * @param property - Property/field name (e.g. "soa", "internalNotes"). + * @returns FieldAccessMode. + */ + public getFieldAccess(user: RbacUserContext, entity: string, property: string): FieldAccessMode { + const applicableRoles = this.getApplicableRoles(user) + if (applicableRoles.length === 0) return 'hidden' + + let highestRank = -1 // -1: undefined, 0: hidden, 1: readonly, 2: readwrite + const rankMap: Record = { + hidden: 0, + readonly: 1, + readwrite: 2 + } + const modeMap: Record = { + 0: 'hidden', + 1: 'readonly', + 2: 'readwrite' + } + + for (const role of applicableRoles) { + const entityRules = role.entities?.[entity] + if (entityRules) { + const fieldMode = entityRules.fields?.[property] ?? entityRules.defaultMode + if (fieldMode) { + const rank = rankMap[fieldMode] + if (rank > highestRank) { + highestRank = rank + } + } + } + } + + return highestRank >= 0 ? modeMap[highestRank] : 'readwrite' + } + + /** + * Sanitizes an outgoing read payload by removing all properties marked as 'hidden'. + * + * @param user - Authenticated user context. + * @param entity - Entity name. + * @param payload - Data object to sanitize. + * @returns Filtered object. + */ + public sanitizeRead>( + user: RbacUserContext, + entity: string, + payload: T + ): Partial { + if (!payload || typeof payload !== 'object') return payload + const result: Record = {} + + for (const [key, value] of Object.entries(payload)) { + const mode = this.getFieldAccess(user, entity, key) + if (mode !== 'hidden') { + result[key] = value + } + } + + return result as Partial + } + + /** + * Sanitizes an incoming write payload by stripping any properties marked as 'hidden' or 'readonly'. + * Only properties explicitly in 'readwrite' mode are preserved. + * + * @param user - Authenticated user context. + * @param entity - Entity name. + * @param payload - Incoming update data. + * @returns Safe object containing only writable fields. + */ + public sanitizeWrite>( + user: RbacUserContext, + entity: string, + payload: T + ): Partial { + if (!payload || typeof payload !== 'object') return payload + const result: Record = {} + + for (const [key, value] of Object.entries(payload)) { + const mode = this.getFieldAccess(user, entity, key) + if (mode === 'readwrite') { + result[key] = value + } + } + + return result as Partial + } + + /** + * Generic sanitization helper for either 'read' or 'write' operations. + */ + public sanitizePayload>( + user: RbacUserContext, + entity: string, + payload: T, + operation: 'read' | 'write' + ): Partial { + return operation === 'read' + ? this.sanitizeRead(user, entity, payload) + : this.sanitizeWrite(user, entity, payload) + } +} diff --git a/packages/auth-rbac/src/engine/TarpitManager.test.ts b/packages/auth-rbac/src/engine/TarpitManager.test.ts new file mode 100644 index 00000000..f0e33200 --- /dev/null +++ b/packages/auth-rbac/src/engine/TarpitManager.test.ts @@ -0,0 +1,89 @@ +import { TarpitManager } from './TarpitManager' + +describe('TarpitManager', () => { + let manager: TarpitManager + + beforeEach(() => { + manager = new TarpitManager() + }) + + it('allows normal traffic with zero delay when disabled or within limits', () => { + const resDisabled = manager.evaluate('agent-1', { enabled: false }) + expect(resDisabled.delayMs).toBe(0) + expect(resDisabled.isThrottled).toBe(false) + + const resNormal = manager.evaluate('agent-1', { + enabled: true, + maxRequestsPerMinute: 10, + burst: 5, + delayMs: 500 + }) + expect(resNormal.delayMs).toBe(0) + expect(resNormal.isThrottled).toBe(false) + }) + + it('triggers progressive tarpitting delay when burst limit is exceeded', () => { + const config = { + enabled: true, + burst: 3, + maxRequestsPerMinute: 10, + delayMs: 200 + } + + // 1 to 3 requests -> OK + manager.evaluate('agent-2', config) + manager.evaluate('agent-2', config) + const res3 = manager.evaluate('agent-2', config) + expect(res3.isThrottled).toBe(false) + + // 4th request -> Tarpit triggered (multiplier 1) + const res4 = manager.evaluate('agent-2', config) + expect(res4.isThrottled).toBe(true) + expect(res4.delayMs).toBe(200) + + // 5th request -> Progressive multiplier 2 + const res5 = manager.evaluate('agent-2', config) + expect(res5.isThrottled).toBe(true) + expect(res5.delayMs).toBe(400) + }) + + it('triggers temporary blocking when repeated violations occur and blockDurationMs is configured', () => { + const config = { + enabled: true, + burst: 1, + maxRequestsPerMinute: 2, + delayMs: 100, + blockDurationMs: 5000 + } + + manager.evaluate('bad-bot', config) // 1 -> ok + manager.evaluate('bad-bot', config) // 2 -> violation 1 + manager.evaluate('bad-bot', config) // 3 -> violation 2 + manager.evaluate('bad-bot', config) // 4 -> violation 3 + manager.evaluate('bad-bot', config) // 5 -> violation 4 + const resBlock = manager.evaluate('bad-bot', config) // 6 -> violation 5 => Blocked + + expect(resBlock.isThrottled).toBe(true) + expect(resBlock.isBlocked).toBe(true) + + // Subsequent request while blocked + const resWhileBlocked = manager.evaluate('bad-bot', config) + expect(resWhileBlocked.isBlocked).toBe(true) + }) + + it('cleans history on reset', () => { + const config = { enabled: true, burst: 1, delayMs: 100 } + manager.evaluate('agent-3', config) + manager.evaluate('agent-3', config) // Throttled + + manager.reset('agent-3') + const fresh = manager.evaluate('agent-3', config) + expect(fresh.isThrottled).toBe(false) + }) + + it('sleep executes without throwing', async () => { + const start = Date.now() + await manager.sleep(10) + expect(Date.now() - start).toBeGreaterThanOrEqual(8) + }) +}) diff --git a/packages/auth-rbac/src/engine/TarpitManager.ts b/packages/auth-rbac/src/engine/TarpitManager.ts new file mode 100644 index 00000000..b9cc2111 --- /dev/null +++ b/packages/auth-rbac/src/engine/TarpitManager.ts @@ -0,0 +1,100 @@ +import type { TarpitRuleConfig } from '../types' + +interface SubjectTrafficRecord { + timestamps: number[] + blockedUntil?: number + consecutiveViolations: number +} + +/** + * TarpitManager manages rate limiting, anomaly throttling, and intentional latency injection (tarpitting). + * Designed to neutralize aggressive scraping, brute-force attempts, and runaway AI agent loops. + */ +export class TarpitManager { + private traffic: Map = new Map() + + /** + * Evaluates request traffic for a given subject key and returns the required tarpit delay or blocking decision. + * + * @param subjectKey - Unique identifier for the subject (e.g. `user:123`, `agent:curator-bot`, `ip:192.168.1.1`). + * @param config - Tarpit configuration rules. + * @returns An object containing the delay to sleep (in ms) and throttling flags. + */ + public evaluate( + subjectKey: string, + config?: TarpitRuleConfig + ): { delayMs: number; isThrottled: boolean; isBlocked: boolean } { + if (!config || config.enabled === false) { + return { delayMs: 0, isThrottled: false, isBlocked: false } + } + + const now = Date.now() + const record = this.traffic.get(subjectKey) || { + timestamps: [], + consecutiveViolations: 0 + } + + // 1. Check if currently under temporary hard block + if (record.blockedUntil && record.blockedUntil > now) { + return { + delayMs: config.delayMs || 1000, + isThrottled: true, + isBlocked: true + } + } + + // 2. Clean up timestamps older than 60 seconds (sliding window) + const windowStart = now - 60000 + record.timestamps = record.timestamps.filter((ts) => ts > windowStart) + record.timestamps.push(now) + this.traffic.set(subjectKey, record) + + const maxRpm = config.maxRequestsPerMinute ?? 60 + const burst = config.burst ?? 10 + const currentCount = record.timestamps.length + + // 3. Normal traffic within limits + if (currentCount <= burst && currentCount <= maxRpm) { + record.consecutiveViolations = 0 + return { delayMs: 0, isThrottled: false, isBlocked: false } + } + + // 4. Rate violation detected -> Apply progressive tarpitting + record.consecutiveViolations += 1 + const baseDelay = config.delayMs ?? 1000 + // Exponential multiplier based on consecutive violations (capped at 10x) + const multiplier = Math.min(record.consecutiveViolations, 10) + const totalDelay = baseDelay * multiplier + + // Check if hard block threshold should trigger + if (config.blockDurationMs && record.consecutiveViolations >= 5) { + record.blockedUntil = now + config.blockDurationMs + return { delayMs: totalDelay, isThrottled: true, isBlocked: true } + } + + return { delayMs: totalDelay, isThrottled: true, isBlocked: false } + } + + /** + * Injects an intentional asynchronous delay into the execution loop (tarpitting). + * + * @param delayMs - Duration in milliseconds to delay. + */ + public async sleep(delayMs: number): Promise { + if (delayMs <= 0) return + return new Promise((resolve) => setTimeout(resolve, delayMs)) + } + + /** + * Resets traffic history for a specific subject or clears all records. + * + * @param subjectKey - Optional subject key to reset. + */ + public reset(subjectKey?: string): void { + if (subjectKey) { + this.traffic.delete(subjectKey) + } else { + this.traffic.clear() + } + } +} diff --git a/packages/auth-rbac/src/index.ts b/packages/auth-rbac/src/index.ts new file mode 100644 index 00000000..a2deada1 --- /dev/null +++ b/packages/auth-rbac/src/index.ts @@ -0,0 +1,17 @@ +export * from './types' +export { RbacPolicyEngine } from './engine/RbacPolicyEngine' +export { TarpitManager } from './engine/TarpitManager' +export { AbstractRbacMiddleware } from './middlewares/AbstractRbacMiddleware' +export { + ExpressRbacMiddleware, + type ExpressRbacOptions, + type ExpressLikeRequest, + type ExpressLikeResponse, + type ExpressLikeNextFunction +} from './middlewares/ExpressRbacMiddleware' +export { + AstroRbacMiddleware, + type AstroRbacOptions, + type AstroLikeContext, + type AstroLikeMiddlewareNext +} from './middlewares/AstroRbacMiddleware' diff --git a/packages/auth-rbac/src/middlewares/AbstractRbacMiddleware.ts b/packages/auth-rbac/src/middlewares/AbstractRbacMiddleware.ts new file mode 100644 index 00000000..e0e082e3 --- /dev/null +++ b/packages/auth-rbac/src/middlewares/AbstractRbacMiddleware.ts @@ -0,0 +1,70 @@ +import { RbacPolicyEngine } from '../engine/RbacPolicyEngine' +import type { RbacUserContext, HttpMethod, RbacRequestContext } from '../types' + +/** + * Abstract base class for framework-specific RBAC middlewares (Express, Astro, etc.). + * Coordinates route access decisions, user context resolution, FLS helper injection, and tarpitting. + */ +export abstract class AbstractRbacMiddleware { + constructor(public readonly engine: RbacPolicyEngine) {} + + /** + * Extracts the authenticated user or M2M agent context from the incoming request. + * + * @param request - Native request object. + * @returns RbacUserContext or null if unauthenticated. + */ + public abstract extractUser(request: TRequest): Promise | RbacUserContext | null + + /** + * Normalizes the target URI path and HTTP method from the incoming request. + * + * @param request - Native request object. + * @returns Object containing `uri` and `method`. + */ + public abstract extractRoute(request: TRequest): { uri: string; method: HttpMethod } + + /** + * Handles access denial according to request context (e.g. JSON error for API, redirect/403 for HTML pages). + * + * @param request - Native request object. + * @param response - Native response object. + * @param reason - Denial rationale ('unauthenticated' | 'forbidden' | 'tarpit_blocked'). + */ + public abstract handleAccessDenied( + request: TRequest, + response: TResponse, + reason: 'unauthenticated' | 'forbidden' | 'tarpit_blocked' + ): Promise | any + + /** + * Factory method building a scoped `RbacRequestContext` helper for controllers and templates. + * + * @param user - Current user context (or null for anonymous guest). + * @returns RbacRequestContext instance. + */ + public createRequestContext(user: RbacUserContext | null): RbacRequestContext { + const anonymousUser: RbacUserContext = { + id: 'anonymous', + roles: ['anonymous'], + subjectType: 'human' + } + const activeUser = user || anonymousUser + + return { + user, + canAccessRoute: (uri: string, method?: HttpMethod) => + this.engine.canAccessRoute(activeUser, uri, method), + getFieldMode: (entity: string, property: string) => + this.engine.getFieldAccess(activeUser, entity, property), + isFieldEditable: (entity: string, property: string) => + this.engine.getFieldAccess(activeUser, entity, property) === 'readwrite', + isFieldVisible: (entity: string, property: string) => + this.engine.getFieldAccess(activeUser, entity, property) !== 'hidden', + sanitizeRead: >(entity: string, data: T) => + this.engine.sanitizeRead(activeUser, entity, data), + sanitizeWrite: >(entity: string, data: T) => + this.engine.sanitizeWrite(activeUser, entity, data) + } + } +} diff --git a/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.test.ts b/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.test.ts new file mode 100644 index 00000000..e77c6af6 --- /dev/null +++ b/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.test.ts @@ -0,0 +1,95 @@ +import { AstroRbacMiddleware } from './AstroRbacMiddleware' +import { RbacPolicyEngine } from '../engine/RbacPolicyEngine' +import type { RoleDefinition } from '../types' + +describe('AstroRbacMiddleware', () => { + const roles: RoleDefinition[] = [ + { + id: 'reader', + name: 'Reader', + routes: [ + { pattern: '/api/taxonomies', methods: ['GET'], access: 'allow' }, + { pattern: '/docs/**', methods: ['GET'], access: 'allow' } + ] + }, + { + id: 'admin', + name: 'Admin', + routes: [{ pattern: '/**', methods: ['*'], access: 'allow' }] + } + ] + + let engine: RbacPolicyEngine + let middleware: AstroRbacMiddleware + + beforeEach(() => { + engine = new RbacPolicyEngine(roles) + middleware = new AstroRbacMiddleware(engine, { enableTarpitSleep: false }) + }) + + function createMockAstroContext(urlPath: string, method: string = 'GET', user?: any) { + const context: any = { + url: new URL(`http://localhost:4321${urlPath}`), + request: new Request(`http://localhost:4321${urlPath}`, { method }), + locals: { user }, + redirect: jest.fn((path: string) => { + return new Response(null, { status: 302, headers: { Location: path } }) + }) + } + const next = jest.fn(async () => new Response('OK', { status: 200 })) + return { context, next } + } + + it('allows access to permitted API endpoint and injects locals.rbac', async () => { + const { context, next } = createMockAstroContext('/api/taxonomies', 'GET', { + id: 'u-1', + roles: ['reader'] + }) + + const handler = middleware.handler() + const res = await handler(context, next) + + expect(res.status).toBe(200) + expect(next).toHaveBeenCalled() + expect(context.locals.rbac).toBeDefined() + expect(context.locals.rbac.canAccessRoute('/api/taxonomies', 'GET')).toBe(true) + }) + + it('returns JSON 401 when unauthenticated on protected API endpoint', async () => { + const { context, next } = createMockAstroContext('/api/admin/secrets', 'GET', undefined) + + const handler = middleware.handler() + const res = await handler(context, next) + + expect(next).not.toHaveBeenCalled() + expect(res.status).toBe(401) + const json = await res.json() + expect(json.error).toBe('unauthenticated') + }) + + it('returns JSON 403 when authenticated user lacks permissions on API endpoint', async () => { + const { context, next } = createMockAstroContext('/api/admin/secrets', 'GET', { + id: 'u-1', + roles: ['reader'] + }) + + const handler = middleware.handler() + const res = await handler(context, next) + + expect(next).not.toHaveBeenCalled() + expect(res.status).toBe(403) + const json = await res.json() + expect(json.error).toBe('forbidden') + }) + + it('redirects to /login when unauthenticated on protected HTML page', async () => { + const { context, next } = createMockAstroContext('/dashboard', 'GET', undefined) + + const handler = middleware.handler() + const res = await handler(context, next) + + expect(next).not.toHaveBeenCalled() + expect(context.redirect).toHaveBeenCalledWith(expect.stringContaining('/login?returnTo=')) + expect(res.status).toBe(302) + }) +}) diff --git a/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.ts b/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.ts new file mode 100644 index 00000000..91382d37 --- /dev/null +++ b/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.ts @@ -0,0 +1,146 @@ +import { AbstractRbacMiddleware } from './AbstractRbacMiddleware' +import type { HttpMethod, RbacUserContext } from '../types' + +/** + * Minimal interface representing Astro API/Middleware Context. + */ +export interface AstroLikeContext { + url: URL + request: Request + locals: Record + redirect: (path: string, status?: number) => Response +} + +export type AstroLikeMiddlewareNext = () => Promise + +/** + * Options for configuring AstroRbacMiddleware. + */ +export interface AstroRbacOptions { + /** Custom extractor function to retrieve the user context from Astro context */ + userResolver?: (context: AstroLikeContext) => Promise | RbacUserContext | null + /** URL path to redirect unauthenticated users for HTML pages (defaults to "/login") */ + loginRedirectPath?: string + /** URL path to redirect forbidden users for HTML pages (defaults to "/403") */ + forbiddenRedirectPath?: string + /** Whether to inject tarpit delay asynchronously before proceeding */ + enableTarpitSleep?: boolean +} + +/** + * Astro middleware implementing Quatrain RBAC route guards, FLS context injection and tarpit delays. + * Unifies API endpoints (JSON responses) and SSR pages (redirects / forbidden status). + */ +export class AstroRbacMiddleware extends AbstractRbacMiddleware { + private userResolver?: (context: AstroLikeContext) => Promise | RbacUserContext | null + private loginRedirectPath: string + private forbiddenRedirectPath: string + private enableTarpitSleep: boolean + + constructor(engine: any, options: AstroRbacOptions = {}) { + super(engine) + this.userResolver = options.userResolver + this.loginRedirectPath = options.loginRedirectPath || '/login' + this.forbiddenRedirectPath = options.forbiddenRedirectPath || '/403' + this.enableTarpitSleep = options.enableTarpitSleep ?? true + } + + public extractUser(context: AstroLikeContext): Promise | RbacUserContext | null { + if (this.userResolver) { + return this.userResolver(context) + } + return context.locals?.user || null + } + + public extractRoute(context: AstroLikeContext): { uri: string; method: HttpMethod } { + return { + uri: context.url.pathname, + method: (context.request.method.toUpperCase() as HttpMethod) || 'GET' + } + } + + public handleAccessDenied( + context: AstroLikeContext, + _res: any, + reason: 'unauthenticated' | 'forbidden' | 'tarpit_blocked' + ): Response { + const isApi = context.url.pathname.startsWith('/api/') + + // 1. API Endpoints return standard JSON responses + if (isApi) { + const statusMap = { + unauthenticated: 401, + forbidden: 403, + tarpit_blocked: 429 + } + const messageMap = { + unauthenticated: 'Authentication required to access this endpoint.', + forbidden: 'Forbidden: Insufficient privileges.', + tarpit_blocked: 'Too Many Requests: Throttled by security tarpit policy.' + } + + return new Response( + JSON.stringify({ + error: reason, + message: messageMap[reason] + }), + { + status: statusMap[reason], + headers: { 'Content-Type': 'application/json' } + } + ) + } + + // 2. SSR HTML Pages return redirects or status pages + if (reason === 'unauthenticated') { + const returnUrl = encodeURIComponent(context.url.pathname + context.url.search) + return context.redirect(`${this.loginRedirectPath}?returnTo=${returnUrl}`) + } + + return context.redirect(this.forbiddenRedirectPath) + } + + /** + * Produces standard Astro middleware handler function. + */ + public handler() { + return async (context: AstroLikeContext, next: AstroLikeMiddlewareNext): Promise => { + const user = await this.extractUser(context) + const { uri, method } = this.extractRoute(context) + + // 1. Inject RBAC helper into Astro.locals + if (!context.locals) { + context.locals = {} + } + context.locals.rbac = this.createRequestContext(user) + + // 2. Evaluate route and tarpit + const activeUser = user || { id: 'anonymous', roles: ['anonymous'], subjectType: 'human' } + const evaluation = this.engine.evaluateRoute(activeUser, uri, method) + + // 3. Apply tarpit latency + if (this.enableTarpitSleep && evaluation.tarpitDelayMs > 0) { + await this.engine.tarpitManager.sleep(evaluation.tarpitDelayMs) + } + + // 4. Access Decision + if (!evaluation.allowed) { + const reason = evaluation.isThrottled && evaluation.tarpitDelayMs > 0 + ? 'tarpit_blocked' + : user + ? 'forbidden' + : 'unauthenticated' + + return this.handleAccessDenied(context, null, reason) + } + + const response = await next() + + if (evaluation.tarpitDelayMs > 0 && response?.headers) { + response.headers.set('X-Security-Tarpit-Delay', `${evaluation.tarpitDelayMs}ms`) + } + + return response + } + } +} diff --git a/packages/auth-rbac/src/middlewares/ExpressRbacMiddleware.test.ts b/packages/auth-rbac/src/middlewares/ExpressRbacMiddleware.test.ts new file mode 100644 index 00000000..fd2afdb8 --- /dev/null +++ b/packages/auth-rbac/src/middlewares/ExpressRbacMiddleware.test.ts @@ -0,0 +1,96 @@ +import { ExpressRbacMiddleware } from './ExpressRbacMiddleware' +import { RbacPolicyEngine } from '../engine/RbacPolicyEngine' +import type { RoleDefinition } from '../types' + +describe('ExpressRbacMiddleware', () => { + const roles: RoleDefinition[] = [ + { + id: 'reader', + name: 'Reader', + routes: [ + { pattern: '/api/curate', methods: ['GET'], access: 'allow' }, + { pattern: '/public/**', methods: ['*'], access: 'allow' } + ] + }, + { + id: 'curator', + name: 'Curator', + inherits: ['reader'], + routes: [{ pattern: '/api/curate', methods: ['POST'], access: 'allow' }] + } + ] + + let engine: RbacPolicyEngine + let middleware: ExpressRbacMiddleware + + beforeEach(() => { + engine = new RbacPolicyEngine(roles) + middleware = new ExpressRbacMiddleware(engine, { enableTarpitSleep: false }) + }) + + function createMockContext(path: string, method: string, user?: any) { + const req: any = { + path, + method, + user + } + const res: any = { + statusCode: 200, + status: jest.fn(function (code) { + this.statusCode = code + return this + }), + json: jest.fn(function (data) { + this.body = data + return this + }), + setHeader: jest.fn() + } + const next = jest.fn() + return { req, res, next } + } + + it('allows authorized requests and injects req.rbac helpers', async () => { + const { req, res, next } = createMockContext('/api/curate', 'GET', { + id: 'user-1', + roles: ['reader'] + }) + + const handler = middleware.handler() + await handler(req, res, next) + + expect(next).toHaveBeenCalled() + expect(req.rbac).toBeDefined() + expect(req.rbac.user.id).toBe('user-1') + expect(typeof req.rbac.sanitizeWrite).toBe('function') + }) + + it('rejects unauthenticated requests with 401 on protected routes', async () => { + const { req, res, next } = createMockContext('/api/curate', 'POST', undefined) + + const handler = middleware.handler() + await handler(req, res, next) + + expect(next).not.toHaveBeenCalled() + expect(res.status).toHaveBeenCalledWith(401) + expect(res.json).toHaveBeenCalledWith( + expect.objectContaining({ error: 'Unauthorized' }) + ) + }) + + it('rejects authenticated requests with 403 when role is insufficient', async () => { + const { req, res, next } = createMockContext('/api/curate', 'POST', { + id: 'user-1', + roles: ['reader'] + }) + + const handler = middleware.handler() + await handler(req, res, next) + + expect(next).not.toHaveBeenCalled() + expect(res.status).toHaveBeenCalledWith(403) + expect(res.json).toHaveBeenCalledWith( + expect.objectContaining({ error: 'Forbidden' }) + ) + }) +}) diff --git a/packages/auth-rbac/src/middlewares/ExpressRbacMiddleware.ts b/packages/auth-rbac/src/middlewares/ExpressRbacMiddleware.ts new file mode 100644 index 00000000..b18fc508 --- /dev/null +++ b/packages/auth-rbac/src/middlewares/ExpressRbacMiddleware.ts @@ -0,0 +1,137 @@ +import { AbstractRbacMiddleware } from './AbstractRbacMiddleware' +import type { HttpMethod, RbacUserContext } from '../types' + +/** + * Minimal interface representing Express-like Request. + */ +export interface ExpressLikeRequest { + path: string + url?: string + method: string + user?: RbacUserContext + auth?: { user?: RbacUserContext } + rbac?: any + headers?: Record + ip?: string + socket?: { remoteAddress?: string } +} + +/** + * Minimal interface representing Express-like Response. + */ +export interface ExpressLikeResponse { + statusCode?: number + status: (code: number) => this + json: (body: any) => this + setHeader?: (name: string, value: string) => this +} + +export type ExpressLikeNextFunction = (err?: any) => void + +/** + * Options for configuring ExpressRbacMiddleware. + */ +export interface ExpressRbacOptions { + /** Custom extractor function to retrieve the user context from request */ + userResolver?: (req: ExpressLikeRequest) => Promise | RbacUserContext | null + /** Whether to inject tarpit delay asynchronously before calling next() */ + enableTarpitSleep?: boolean +} + +/** + * Express middleware implementing Quatrain RBAC route guards, FLS context injection and tarpit delays. + */ +export class ExpressRbacMiddleware extends AbstractRbacMiddleware< + ExpressLikeRequest, + ExpressLikeResponse, + ExpressLikeNextFunction +> { + private userResolver?: (req: ExpressLikeRequest) => Promise | RbacUserContext | null + private enableTarpitSleep: boolean + + constructor(engine: any, options: ExpressRbacOptions = {}) { + super(engine) + this.userResolver = options.userResolver + this.enableTarpitSleep = options.enableTarpitSleep ?? true + } + + public extractUser(req: ExpressLikeRequest): Promise | RbacUserContext | null { + if (this.userResolver) { + return this.userResolver(req) + } + return req.user || req.auth?.user || null + } + + public extractRoute(req: ExpressLikeRequest): { uri: string; method: HttpMethod } { + return { + uri: req.path || req.url || '/', + method: ((req.method || 'GET').toUpperCase() as HttpMethod) || 'GET' + } + } + + public handleAccessDenied( + _req: ExpressLikeRequest, + res: ExpressLikeResponse, + reason: 'unauthenticated' | 'forbidden' | 'tarpit_blocked' + ) { + if (reason === 'unauthenticated') { + return res.status(401).json({ + error: 'Unauthorized', + message: 'Authentication is required to access this resource.' + }) + } + if (reason === 'tarpit_blocked') { + return res.status(429).json({ + error: 'Too Many Requests', + message: 'Access temporarily throttled or blocked by security tarpit policy.' + }) + } + return res.status(403).json({ + error: 'Forbidden', + message: 'Insufficient privileges to access this endpoint.' + }) + } + + /** + * Generates standard Express middleware handler function. + */ + public handler() { + return async (req: ExpressLikeRequest, res: ExpressLikeResponse, next: ExpressLikeNextFunction) => { + try { + const user = await this.extractUser(req) + const { uri, method } = this.extractRoute(req) + + // 1. Inject RBAC request helper + req.rbac = this.createRequestContext(user) + + // 2. Evaluate route and tarpitting policy + const activeUser = user || { id: 'anonymous', roles: ['anonymous'], subjectType: 'human' } + const evaluation = this.engine.evaluateRoute(activeUser, uri, method) + + // 3. Apply tarpit latency if required (slows down bots and rapid scanners) + if (this.enableTarpitSleep && evaluation.tarpitDelayMs > 0) { + await this.engine.tarpitManager.sleep(evaluation.tarpitDelayMs) + } + + if (res.setHeader && evaluation.tarpitDelayMs > 0) { + res.setHeader('X-Security-Tarpit-Delay', `${evaluation.tarpitDelayMs}ms`) + } + + // 4. Access Decision + if (!evaluation.allowed) { + const reason = evaluation.isThrottled && evaluation.tarpitDelayMs > 0 + ? 'tarpit_blocked' + : user + ? 'forbidden' + : 'unauthenticated' + + return this.handleAccessDenied(req, res, reason) + } + + return next() + } catch (err) { + return next(err) + } + } + } +} diff --git a/packages/auth-rbac/src/types/RbacTypes.ts b/packages/auth-rbac/src/types/RbacTypes.ts new file mode 100644 index 00000000..a44f3c5c --- /dev/null +++ b/packages/auth-rbac/src/types/RbacTypes.ts @@ -0,0 +1,143 @@ +/** + * Standard HTTP methods supported in route rules. + */ +export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD' | '*' + +/** + * Access decision outcome for a route evaluation. + */ +export type AccessDecision = 'allow' | 'deny' + +/** + * Field-level access mode for entity properties. + * - 'hidden': Property is stripped from read payloads and forbidden in write payloads. + * - 'readonly': Property is returned in read payloads but cannot be modified in write payloads. + * - 'readwrite': Property can be freely read and modified. + */ +export type FieldAccessMode = 'hidden' | 'readonly' | 'readwrite' + +/** + * Subject category executing the request. + * Useful for differentiating human interactions from automated AI agents or M2M services. + */ +export type SubjectType = 'human' | 'agent' | 'service' + +/** + * Rule governing access to a specific URI route pattern and HTTP method. + */ +export interface RouteRule { + /** Glob-like URI pattern (e.g. "/api/curate/**", "/admin/*", "/**") */ + pattern: string + /** Targeted HTTP methods. If omitted or containing '*', applies to all methods. */ + methods?: HttpMethod[] + /** Explicit authorization decision. */ + access: AccessDecision + /** Optional human-readable rationale or description. */ + description?: string +} + +/** + * Field-level security rules for a specific entity schema. + */ +export interface EntityFieldRules { + /** Target entity or schema name (e.g. "okf-document", "user", "farm-profile") */ + entity?: string + /** Default mode applied when a property is not explicitly defined in `fields` */ + defaultMode?: FieldAccessMode + /** Property-to-mode mapping (e.g. { "soa": "readonly", "internalNotes": "hidden" }) */ + fields: Record +} + +/** + * Role definition encapsulating route rules, entity field security, inheritance and M2M tarpitting. + */ +export interface RoleDefinition { + /** Unique role identifier (e.g. "reader", "curator", "admin", "ai-agent") */ + id: string + /** Human-readable role name */ + name: string + /** Role description and scope */ + description?: string + /** Inherited role IDs whose permissions are automatically merged */ + inherits?: string[] + /** Allowed subject types for this role (e.g. ['agent', 'service'] or ['human']) */ + subjectTypes?: SubjectType[] + /** Route-level access rules */ + routes?: RouteRule[] + /** Entity field-level security rules */ + entities?: Record + /** Role-specific rate limiting and tarpitting policy */ + tarpit?: TarpitRuleConfig +} + +/** + * Tarpitting and rate limiting configuration applied to roles or subjects. + */ +export interface TarpitRuleConfig { + /** Whether tarpitting is active */ + enabled?: boolean + /** Intentional latency (in milliseconds) injected into suspicious or rate-limited requests */ + delayMs?: number + /** Maximum allowable requests per sliding minute window */ + maxRequestsPerMinute?: number + /** Maximum burst capacity before throttling */ + burst?: number + /** Temporary block duration (in milliseconds) when severe rate violations occur */ + blockDurationMs?: number +} + +/** + * Authenticated user or M2M agent security context passed into the RBAC engine. + */ +export interface RbacUserContext { + /** Unique user, service account, or agent identifier */ + id: string + /** Optional email address */ + email?: string + /** Assigned role identifiers */ + roles: string[] + /** Subject kind (defaults to 'human' if not specified) */ + subjectType?: SubjectType + /** Optional fine-grained permission claims */ + permissions?: string[] + /** Dynamic context attributes (e.g. tenantId, farmId, ipAddress) */ + attributes?: Record +} + +/** + * Outcome of evaluating a route request against RBAC policies. + */ +export interface RouteEvaluationResult { + /** Whether access is granted */ + allowed: boolean + /** Final decision ('allow' or 'deny') */ + decision: AccessDecision + /** Matching route rule that determined the outcome, if any */ + matchedRule?: RouteRule + /** Delay (in ms) to be injected via tarpitting */ + tarpitDelayMs: number + /** Whether the subject is currently throttled / rate-limited */ + isThrottled: boolean + /** Human-readable explanation */ + reason?: string +} + +/** + * Scoped helper context exposed to controllers and request handlers. + */ +export interface RbacRequestContext { + /** Current authenticated user context (null if unauthenticated) */ + user: RbacUserContext | null + /** Evaluates route permission for a given URI and method */ + canAccessRoute: (uri: string, method?: HttpMethod) => boolean + /** Returns the calculated field access mode ('hidden' | 'readonly' | 'readwrite') */ + getFieldMode: (entity: string, property: string) => FieldAccessMode + /** Returns true if the field is editable ('readwrite') */ + isFieldEditable: (entity: string, property: string) => boolean + /** Returns true if the field is visible (not 'hidden') */ + isFieldVisible: (entity: string, property: string) => boolean + /** Strips 'hidden' fields from outgoing read payloads */ + sanitizeRead: >(entity: string, data: T) => Partial + /** Strips 'hidden' and 'readonly' fields from incoming write payloads */ + sanitizeWrite: >(entity: string, data: T) => Partial +} diff --git a/packages/auth-rbac/src/types/index.ts b/packages/auth-rbac/src/types/index.ts new file mode 100644 index 00000000..c5eacbef --- /dev/null +++ b/packages/auth-rbac/src/types/index.ts @@ -0,0 +1 @@ +export * from './RbacTypes' diff --git a/packages/auth-rbac/tsconfig.json b/packages/auth-rbac/tsconfig.json new file mode 100644 index 00000000..6ae477f9 --- /dev/null +++ b/packages/auth-rbac/tsconfig.json @@ -0,0 +1,15 @@ +{ + "extends": "@tsconfig/recommended/tsconfig.json", + "compileOnSave": true, + "compilerOptions": { + "rootDir": "src", + "outDir": "dist", + "declaration": true, + "target": "es2022", + "moduleResolution": "node", + "resolveJsonModule": true, + "strict": true + }, + "include": ["src"], + "exclude": ["node_modules", "**/__test__", "**/*.spec.ts", "**/*.test.ts"] +} diff --git a/yarn.lock b/yarn.lock index 58c4e04e..533899a5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3097,6 +3097,25 @@ __metadata: languageName: unknown linkType: soft +"@quatrain/auth-rbac@workspace:packages/auth-rbac": + version: 0.0.0-use.local + resolution: "@quatrain/auth-rbac@workspace:packages/auth-rbac" + dependencies: + "@quatrain/api": "workspace:*" + "@quatrain/http": "workspace:*" + "@tsconfig/recommended": "npm:^1.0.1" + "@types/jest": "npm:^29.5.12" + "@types/node": "npm:^22.10.1" + jest: "npm:^29.7.0" + jest-node-exports-resolver: "npm:^1.1.6" + jest-serial-runner: "npm:^1.2.1" + trace-unhandled: "npm:^2.0.1" + ts-jest: "npm:^29.4.6" + ts-node: "npm:^10.9.1" + typescript: "npm:^5.1.5" + languageName: unknown + linkType: soft + "@quatrain/auth-supabase@workspace:packages/auth-supabase": version: 0.0.0-use.local resolution: "@quatrain/auth-supabase@workspace:packages/auth-supabase" From 73793fc2e480eaf8369fa9488dea51e24fb23b12 Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 24 Aug 2026 09:31:08 +0200 Subject: [PATCH 02/10] feat(auth-rbac): support semantic RbacAction constants (READ, WRITE, UPDATE, DELETE, MANAGE) and protocol decoupling --- .../src/engine/RbacPolicyEngine.test.ts | 34 +++++++++---- .../auth-rbac/src/engine/RbacPolicyEngine.ts | 46 ++++++++++++----- .../src/middlewares/AbstractRbacMiddleware.ts | 6 +-- packages/auth-rbac/src/types/RbacTypes.ts | 50 ++++++++++++++++--- 4 files changed, 103 insertions(+), 33 deletions(-) diff --git a/packages/auth-rbac/src/engine/RbacPolicyEngine.test.ts b/packages/auth-rbac/src/engine/RbacPolicyEngine.test.ts index 84b7263c..7c42a48c 100644 --- a/packages/auth-rbac/src/engine/RbacPolicyEngine.test.ts +++ b/packages/auth-rbac/src/engine/RbacPolicyEngine.test.ts @@ -7,10 +7,10 @@ describe('RbacPolicyEngine', () => { id: 'reader', name: 'Reader', routes: [ - { pattern: '/api/curate', methods: ['GET'], access: 'allow' }, - { pattern: '/api/taxonomies', methods: ['GET'], access: 'allow' }, - { pattern: '/public/**', methods: ['*'], access: 'allow' }, - { pattern: '/**', methods: ['*'], access: 'deny' } + { pattern: '/api/curate', actions: ['READ'], access: 'allow' }, + { pattern: '/api/taxonomies', actions: ['READ'], access: 'allow' }, + { pattern: '/public/**', actions: ['*'], access: 'allow' }, + { pattern: '/**', actions: ['*'], access: 'deny' } ], entities: { 'okf-document': { @@ -29,8 +29,8 @@ describe('RbacPolicyEngine', () => { name: 'Curator', inherits: ['reader'], routes: [ - { pattern: '/api/curate', methods: ['POST', 'PUT'], access: 'allow' }, - { pattern: '/api/upload', methods: ['POST'], access: 'allow' } + { pattern: '/api/curate', actions: ['WRITE', 'UPDATE'], access: 'allow' }, + { pattern: '/api/upload', actions: ['WRITE'], access: 'allow' } ], entities: { 'okf-document': { @@ -47,7 +47,7 @@ describe('RbacPolicyEngine', () => { id: 'admin', name: 'Administrator', inherits: ['curator'], - routes: [{ pattern: '/**', methods: ['*'], access: 'allow' }], + routes: [{ pattern: '/**', actions: ['MANAGE'], access: 'allow' }], entities: { 'okf-document': { defaultMode: 'readwrite', @@ -63,7 +63,7 @@ describe('RbacPolicyEngine', () => { id: 'ai-agent', name: 'AI Agent Bot', subjectTypes: ['agent'], - routes: [{ pattern: '/api/agent/**', methods: ['POST'], access: 'allow' }], + routes: [{ pattern: '/api/agent/**', actions: ['WRITE', 'EXECUTE'], access: 'allow' }], tarpit: { enabled: true, burst: 2, @@ -84,14 +84,28 @@ describe('RbacPolicyEngine', () => { const curatorUser: RbacUserContext = { id: 'u2', roles: ['curator'], subjectType: 'human' } const adminUser: RbacUserContext = { id: 'u3', roles: ['admin'], subjectType: 'human' } - it('allows reader to GET /api/curate but denies POST /api/curate', () => { + it('allows reader to READ /api/curate but denies WRITE /api/curate', () => { + // Direct semantic action checks + expect(engine.canAccessRoute(readerUser, '/api/curate', 'READ')).toBe(true) + expect(engine.canAccessRoute(readerUser, '/api/curate', 'WRITE')).toBe(false) + expect(engine.canAccessRoute(readerUser, '/api/curate', 'UPDATE')).toBe(false) + expect(engine.canAccessRoute(readerUser, '/api/curate', 'DELETE')).toBe(false) + + // HTTP method mapped checks expect(engine.canAccessRoute(readerUser, '/api/curate', 'GET')).toBe(true) expect(engine.canAccessRoute(readerUser, '/api/curate', 'POST')).toBe(false) }) - it('allows curator to GET and POST /api/curate via inherited permissions', () => { + it('allows curator to READ, WRITE and UPDATE /api/curate via inherited permissions', () => { + expect(engine.canAccessRoute(curatorUser, '/api/curate', 'READ')).toBe(true) + expect(engine.canAccessRoute(curatorUser, '/api/curate', 'WRITE')).toBe(true) + expect(engine.canAccessRoute(curatorUser, '/api/curate', 'UPDATE')).toBe(true) + expect(engine.canAccessRoute(curatorUser, '/api/curate', 'DELETE')).toBe(false) + + // With HTTP verbs expect(engine.canAccessRoute(curatorUser, '/api/curate', 'GET')).toBe(true) expect(engine.canAccessRoute(curatorUser, '/api/curate', 'POST')).toBe(true) + expect(engine.canAccessRoute(curatorUser, '/api/curate', 'PUT')).toBe(true) expect(engine.canAccessRoute(curatorUser, '/api/upload', 'POST')).toBe(true) expect(engine.canAccessRoute(curatorUser, '/admin/settings', 'GET')).toBe(false) }) diff --git a/packages/auth-rbac/src/engine/RbacPolicyEngine.ts b/packages/auth-rbac/src/engine/RbacPolicyEngine.ts index 59c0a7e1..992e6fec 100644 --- a/packages/auth-rbac/src/engine/RbacPolicyEngine.ts +++ b/packages/auth-rbac/src/engine/RbacPolicyEngine.ts @@ -1,14 +1,27 @@ import type { RoleDefinition, RbacUserContext, + RbacAction, HttpMethod, FieldAccessMode, RouteRule, RouteEvaluationResult, SubjectType } from '../types' +import { mapHttpMethodToAction } from '../types' import { TarpitManager } from './TarpitManager' +/** + * Normalizes an action or HTTP method to unified semantic RbacAction. + */ +function normalizeAction(actionOrMethod: string): { semantic: RbacAction; raw: string } { + const upper = (actionOrMethod || 'READ').toUpperCase() + if (['READ', 'WRITE', 'CREATE', 'UPDATE', 'DELETE', 'EXECUTE', 'MANAGE', '*'].includes(upper)) { + return { semantic: upper as RbacAction, raw: upper } + } + return { semantic: mapHttpMethodToAction(upper), raw: upper } +} + /** * Normalizes an URI string for consistent glob and segment comparison. */ @@ -112,20 +125,20 @@ export class RbacPolicyEngine { } /** - * Evaluates route access for a user context against a target URI and HTTP method. + * Evaluates route access for a user context against a target URI and semantic action (or HTTP method). * * @param user - Authenticated user context. * @param uri - Requested URI path. - * @param method - HTTP method (defaults to 'GET'). + * @param actionOrMethod - Semantic action ('READ', 'WRITE', 'UPDATE', 'DELETE') or HTTP method ("GET", "POST"...). * @returns Detailed evaluation result including allow/deny decision and tarpit latency. */ public evaluateRoute( user: RbacUserContext, uri: string, - method: HttpMethod = 'GET' + actionOrMethod: RbacAction | HttpMethod | string = 'READ' ): RouteEvaluationResult { const normUri = normalizeUri(uri) - const upperMethod = (method.toUpperCase() as HttpMethod) || 'GET' + const normalized = normalizeAction(actionOrMethod) const applicableRoles = this.getApplicableRoles(user) // 1. Tarpit Evaluation for M2M Agents and suspicious traffic @@ -161,13 +174,16 @@ export class RbacPolicyEngine { if (!role.routes) continue for (const rule of role.routes) { - const methodMatches = - !rule.methods || - rule.methods.length === 0 || - rule.methods.includes('*') || - rule.methods.includes(upperMethod) - - if (methodMatches && matchGlob(rule.pattern, normUri)) { + const declaredActions = rule.actions || rule.methods || [] + const actionMatches = + declaredActions.length === 0 || + declaredActions.includes('*') || + declaredActions.includes('MANAGE') || + declaredActions.includes(normalized.semantic) || + declaredActions.includes(normalized.raw as any) || + (normalized.semantic === 'WRITE' && declaredActions.includes('CREATE' as any)) + + if (actionMatches && matchGlob(rule.pattern, normUri)) { // Specificity score: longer patterns have higher priority const score = rule.pattern.replace(/\*/g, '').length matchingRules.push({ rule, score }) @@ -202,8 +218,12 @@ export class RbacPolicyEngine { /** * Fast boolean check for route access. */ - public canAccessRoute(user: RbacUserContext, uri: string, method: HttpMethod = 'GET'): boolean { - return this.evaluateRoute(user, uri, method).allowed + public canAccessRoute( + user: RbacUserContext, + uri: string, + actionOrMethod: RbacAction | HttpMethod | string = 'READ' + ): boolean { + return this.evaluateRoute(user, uri, actionOrMethod).allowed } /** diff --git a/packages/auth-rbac/src/middlewares/AbstractRbacMiddleware.ts b/packages/auth-rbac/src/middlewares/AbstractRbacMiddleware.ts index e0e082e3..edca1604 100644 --- a/packages/auth-rbac/src/middlewares/AbstractRbacMiddleware.ts +++ b/packages/auth-rbac/src/middlewares/AbstractRbacMiddleware.ts @@ -1,5 +1,5 @@ import { RbacPolicyEngine } from '../engine/RbacPolicyEngine' -import type { RbacUserContext, HttpMethod, RbacRequestContext } from '../types' +import type { RbacUserContext, RbacAction, HttpMethod, RbacRequestContext } from '../types' /** * Abstract base class for framework-specific RBAC middlewares (Express, Astro, etc.). @@ -53,8 +53,8 @@ export abstract class AbstractRbacMiddleware - this.engine.canAccessRoute(activeUser, uri, method), + canAccessRoute: (uri: string, action?: RbacAction | HttpMethod) => + this.engine.canAccessRoute(activeUser, uri, action), getFieldMode: (entity: string, property: string) => this.engine.getFieldAccess(activeUser, entity, property), isFieldEditable: (entity: string, property: string) => diff --git a/packages/auth-rbac/src/types/RbacTypes.ts b/packages/auth-rbac/src/types/RbacTypes.ts index a44f3c5c..097d62e8 100644 --- a/packages/auth-rbac/src/types/RbacTypes.ts +++ b/packages/auth-rbac/src/types/RbacTypes.ts @@ -1,8 +1,39 @@ /** - * Standard HTTP methods supported in route rules. + * Semantic CRUD and management actions for business-level authorization. + * Decoupled from transport-level HTTP methods for maximum readability and business alignment. + */ +export type RbacAction = 'READ' | 'WRITE' | 'CREATE' | 'UPDATE' | 'DELETE' | 'EXECUTE' | 'MANAGE' | '*' + +/** + * Standard HTTP methods supported as transport-level representations. */ export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD' | '*' +/** + * Helper translating standard HTTP transport methods to high-level semantic RBAC actions. + * + * @param method - The HTTP method string (e.g. "GET", "POST", "PUT", "DELETE"). + * @returns The corresponding high-level semantic RbacAction. + */ +export function mapHttpMethodToAction(method: string): RbacAction { + const m = (method || '').toUpperCase() + switch (m) { + case 'GET': + case 'HEAD': + case 'OPTIONS': + return 'READ' + case 'POST': + return 'WRITE' + case 'PUT': + case 'PATCH': + return 'UPDATE' + case 'DELETE': + return 'DELETE' + default: + return 'READ' + } +} + /** * Access decision outcome for a route evaluation. */ @@ -23,13 +54,18 @@ export type FieldAccessMode = 'hidden' | 'readonly' | 'readwrite' export type SubjectType = 'human' | 'agent' | 'service' /** - * Rule governing access to a specific URI route pattern and HTTP method. + * Rule governing access to a specific URI route pattern and semantic actions (READ, WRITE, UPDATE, DELETE). */ export interface RouteRule { /** Glob-like URI pattern (e.g. "/api/curate/**", "/admin/*", "/**") */ pattern: string - /** Targeted HTTP methods. If omitted or containing '*', applies to all methods. */ - methods?: HttpMethod[] + /** + * Targeted semantic actions (e.g. ['READ'], ['WRITE', 'UPDATE'], ['*']). + * Also accepts transport HTTP methods for seamless backward compatibility. + */ + actions?: (RbacAction | HttpMethod)[] + /** Alias for `actions` */ + methods?: (RbacAction | HttpMethod)[] /** Explicit authorization decision. */ access: AccessDecision /** Optional human-readable rationale or description. */ @@ -62,7 +98,7 @@ export interface RoleDefinition { inherits?: string[] /** Allowed subject types for this role (e.g. ['agent', 'service'] or ['human']) */ subjectTypes?: SubjectType[] - /** Route-level access rules */ + /** Route-level access rules with semantic actions */ routes?: RouteRule[] /** Entity field-level security rules */ entities?: Record @@ -128,8 +164,8 @@ export interface RouteEvaluationResult { export interface RbacRequestContext { /** Current authenticated user context (null if unauthenticated) */ user: RbacUserContext | null - /** Evaluates route permission for a given URI and method */ - canAccessRoute: (uri: string, method?: HttpMethod) => boolean + /** Evaluates route permission for a given URI and action/method */ + canAccessRoute: (uri: string, action?: RbacAction | HttpMethod) => boolean /** Returns the calculated field access mode ('hidden' | 'readonly' | 'readwrite') */ getFieldMode: (entity: string, property: string) => FieldAccessMode /** Returns true if the field is editable ('readwrite') */ From 999ab8392d0aace8c01fa7f60c378b0b201e16c3 Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 24 Aug 2026 09:55:27 +0200 Subject: [PATCH 03/10] chore(release): configure beta pre-release version 1.0.0-beta.1 and .npmignore test exclusions --- packages/auth-rbac/.npmignore | 9 +++++++++ packages/auth-rbac/package.json | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 packages/auth-rbac/.npmignore diff --git a/packages/auth-rbac/.npmignore b/packages/auth-rbac/.npmignore new file mode 100644 index 00000000..67d6f394 --- /dev/null +++ b/packages/auth-rbac/.npmignore @@ -0,0 +1,9 @@ +# Ignore test files and test configurations from registry bundle +**/*.test.ts +**/*.spec.ts +**/__test__/ +**/__tests__/ +jest.config.ts +tsconfig.tsbuildinfo +*.log +.turbo diff --git a/packages/auth-rbac/package.json b/packages/auth-rbac/package.json index 79c627d5..2a5dfc04 100644 --- a/packages/auth-rbac/package.json +++ b/packages/auth-rbac/package.json @@ -1,8 +1,12 @@ { "name": "@quatrain/auth-rbac", - "version": "1.0.0", + "version": "1.0.0-beta.1", "license": "AGPL-3.0-only", "description": "Isomorphic Role-Based Access Control, Field-Level Security, M2M Agent Guards & Tarpitting for Quatrain", + "publishConfig": { + "access": "public", + "tag": "beta" + }, "main": "dist/index.js", "types": "dist/index.d.ts", "bun": "src/index.ts", From 5c22faa643ec1d5c718f1699696fc843c598f647 Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 24 Aug 2026 09:56:43 +0200 Subject: [PATCH 04/10] chore(package): clean files field in package.json to guarantee pristine registry tarball --- packages/auth-rbac/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/auth-rbac/package.json b/packages/auth-rbac/package.json index 2a5dfc04..1532bc7d 100644 --- a/packages/auth-rbac/package.json +++ b/packages/auth-rbac/package.json @@ -12,7 +12,6 @@ "bun": "src/index.ts", "files": [ "LICENSE.md", - "src/", "dist/", "README.md", "HOWTO.md", From 13ef0807c4eb9ebf5b034578474423c92f1cde0c Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 24 Aug 2026 09:58:12 +0200 Subject: [PATCH 05/10] docs(auth-rbac): complete 100% JSDoc documentation to satisfy CI quality gate audit --- .../auth-rbac/src/engine/RbacPolicyEngine.ts | 3 +++ .../src/middlewares/AstroRbacMiddleware.ts | 20 +++++++++++++++++++ .../src/middlewares/ExpressRbacMiddleware.ts | 19 ++++++++++++++++++ 3 files changed, 42 insertions(+) diff --git a/packages/auth-rbac/src/engine/RbacPolicyEngine.ts b/packages/auth-rbac/src/engine/RbacPolicyEngine.ts index 992e6fec..883e1f03 100644 --- a/packages/auth-rbac/src/engine/RbacPolicyEngine.ts +++ b/packages/auth-rbac/src/engine/RbacPolicyEngine.ts @@ -66,6 +66,9 @@ function matchGlob(pattern: string, uri: string): boolean { */ export class RbacPolicyEngine { private roles: Map = new Map() + /** + * Dedicated manager handling rate-limiting, anomaly detection, and intentional tarpitting latency. + */ public readonly tarpitManager: TarpitManager constructor(rolesConfig: RoleDefinition[] = [], tarpitManager?: TarpitManager) { diff --git a/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.ts b/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.ts index 91382d37..62c1bd81 100644 --- a/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.ts +++ b/packages/auth-rbac/src/middlewares/AstroRbacMiddleware.ts @@ -45,6 +45,12 @@ export class AstroRbacMiddleware extends AbstractRbacMiddleware | RbacUserContext | null { if (this.userResolver) { return this.userResolver(context) @@ -52,6 +58,12 @@ export class AstroRbacMiddleware extends AbstractRbacMiddleware | RbacUserContext | null { if (this.userResolver) { return this.userResolver(req) @@ -62,6 +68,12 @@ export class ExpressRbacMiddleware extends AbstractRbacMiddleware< return req.user || req.auth?.user || null } + /** + * Normalizes the target URI and HTTP method from the Express-like request. + * + * @param req - The Express-like request. + * @returns Object containing the normalized URI and HTTP method. + */ public extractRoute(req: ExpressLikeRequest): { uri: string; method: HttpMethod } { return { uri: req.path || req.url || '/', @@ -69,6 +81,13 @@ export class ExpressRbacMiddleware extends AbstractRbacMiddleware< } } + /** + * Generates a standard JSON response when access is denied. + * + * @param _req - The Express-like request. + * @param res - The Express-like response. + * @param reason - Denial rationale ('unauthenticated' | 'forbidden' | 'tarpit_blocked'). + */ public handleAccessDenied( _req: ExpressLikeRequest, res: ExpressLikeResponse, From 1e0ba56b69882efda7ace9b9feabdb79536778a0 Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 24 Aug 2026 10:23:32 +0200 Subject: [PATCH 06/10] ci(gitflow): configure develop branch pipeline, turborepo test caching and staging release automation --- .github/workflows/ci.yml | 20 ++++++++++++++------ turbo.json | 8 ++++++++ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 19db2a6f..b76692c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,10 +1,9 @@ -name: CI & Quality Gate - on: workflow_dispatch: push: branches: - main + - develop paths: - 'packages/**' - 'bin/**' @@ -15,6 +14,9 @@ on: - '.github/workflows/ci.yml' pull_request: types: [opened, synchronize, reopened] + branches: + - main + - develop paths: - 'packages/**' - 'bin/**' @@ -112,7 +114,7 @@ jobs: name: Publish Independent Packages needs: sonarcloud runs-on: ubuntu-latest - if: github.ref == 'refs/heads/main' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') + if: (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') permissions: contents: write packages: write @@ -170,14 +172,20 @@ jobs: fi - name: Publish all changed packages - run: yarn publish:all + run: | + if [ "${{ github.ref }}" = "refs/heads/develop" ]; then + yarn publish:all --tag latest-dev + else + yarn publish:all + fi - name: Sync with remote to prevent push rejection run: | git config --global user.name "github-actions[bot]" git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git fetch origin main - git pull --rebase origin main --autostash + BRANCH="${GITHUB_REF_NAME:-main}" + git fetch origin "$BRANCH" + git pull --rebase origin "$BRANCH" --autostash - name: Commit version bumps & hashes uses: stefanzweifel/git-auto-commit-action@v5 # NOSONAR diff --git a/turbo.json b/turbo.json index 7c7ad51d..3a6cd4ed 100644 --- a/turbo.json +++ b/turbo.json @@ -28,6 +28,14 @@ "lint": { "dependsOn": ["^build"] }, + "test": { + "dependsOn": ["^build"], + "outputs": ["coverage/**"] + }, + "test:coverage": { + "dependsOn": ["^build"], + "outputs": ["coverage/**"] + }, "dev": { "cache": false, "persistent": true From 7d52f0176d5d93e21cb8ccc4696f9167144d1dfc Mon Sep 17 00:00:00 2001 From: Olivier Date: Mon, 24 Aug 2026 11:18:07 +0200 Subject: [PATCH 07/10] fix(auth): type OAuth token response in AbstractOAuthAdapter to fix TypeDoc build --- docs/pages/packages/api-server-astro/howto.md | 35 +++ .../pages/packages/api-server-astro/readme.md | 19 ++ docs/pages/packages/api-xmlrpc/howto.md | 33 ++ docs/pages/packages/api-xmlrpc/readme.md | 19 ++ docs/pages/packages/app/howto.md | 162 ++++++++++ docs/pages/packages/auth-github/howto.md | 83 ++++++ docs/pages/packages/auth-github/readme.md | 18 ++ docs/pages/packages/auth-http-basic/howto.md | 33 ++ docs/pages/packages/auth-http-basic/readme.md | 19 ++ docs/pages/packages/auth-rbac/howto.md | 139 +++++++++ docs/pages/packages/auth-rbac/readme.md | 85 ++++++ docs/pages/packages/chat/readme.md | 15 + docs/pages/packages/cli/howto.md | 98 ++++++ docs/pages/packages/cli/readme.md | 103 +++++++ docs/pages/packages/http/howto.md | 36 +++ docs/pages/packages/http/readme.md | 20 ++ docs/pages/packages/i18n-es/howto.md | 20 ++ docs/pages/packages/ingestion/readme.md | 17 ++ docs/pages/packages/mdm/howto.md | 144 +++++++++ docs/pages/packages/mdm/readme.md | 21 ++ docs/pages/packages/okf/howto.md | 66 ++++ docs/pages/packages/okf/readme.md | 17 ++ docs/pages/packages/queue-sqlite/howto.md | 94 ++++++ docs/pages/packages/queue-sqlite/readme.md | 33 ++ docs/pages/packages/searchengine-qmd/howto.md | 48 +++ .../pages/packages/searchengine-qmd/readme.md | 18 ++ docs/pages/packages/searchengine/howto.md | 66 ++++ docs/pages/packages/searchengine/readme.md | 18 ++ docs/pages/packages/skills/howto.md | 50 ++++ docs/pages/packages/skills/readme.md | 19 ++ docs/pages/packages/state-machine/howto.md | 71 +++++ docs/pages/packages/state-machine/readme.md | 16 + docs/pages/packages/types/howto.md | 39 +++ docs/pages/packages/types/readme.md | 19 ++ .../public/api-reference/assets/highlight.css | 12 +- .../_quatrain_ai-gemini.GeminiAdapter.html | 17 +- .../_quatrain_ai.AbstractAiAdapter.html | 17 +- .../classes/_quatrain_ai.Ai.html | 8 +- .../_quatrain_api-client.ApiClient.html | 46 +-- ...quatrain_api-client.BasicAuthProvider.html | 6 +- ...uatrain_api-client.BearerAuthProvider.html | 6 +- .../_quatrain_api-client.OAuthProvider.html | 6 +- ...uatrain_api-server-astro.AstroAdapter.html | 57 ++++ ...ain_api-server-express.ExpressAdapter.html | 48 +++ .../_quatrain_api-xmlrpc.XmlRpcClient.html | 10 + .../classes/_quatrain_api.Api.html | 56 ++-- .../classes/_quatrain_api.HttpHelper.html | 11 +- .../classes/_quatrain_app.AppBootloader.html | 5 + .../classes/_quatrain_app.AppInfra.html | 9 + .../classes/_quatrain_app.CodeGenerator.html | 5 + .../classes/_quatrain_app.InfraBuilder.html | 5 + ...ain_auth-firebase.FirebaseAuthAdapter.html | 64 ++++ ...uatrain_auth-github.GithubAuthAdapter.html | 82 +++++ .../_quatrain_auth-http-basic.AuthBasic.html | 16 + .../classes/_quatrain_auth-oidc.AuthOIDC.html | 9 + ...auth-pocketbase.PocketBaseAuthAdapter.html | 64 ++++ ...rain_auth-rbac.AbstractRbacMiddleware.html | 22 ++ ...uatrain_auth-rbac.AstroRbacMiddleware.html | 25 ++ ...train_auth-rbac.ExpressRbacMiddleware.html | 23 ++ .../_quatrain_auth-rbac.RbacPolicyEngine.html | 45 +++ .../_quatrain_auth-rbac.TarpitManager.html | 15 + ...ain_auth-supabase.SupabaseAuthAdapter.html | 67 +++++ .../_quatrain_auth.AbstractAuthAdapter.html | 68 +++++ .../_quatrain_auth.AbstractOAuthAdapter.html | 79 +++++ .../classes/_quatrain_auth.Auth.html | 101 +++++++ .../_quatrain_auth.AuthenticationError.html | 34 +++ ...in_backend-firestore.FirestoreAdapter.html | 104 +++++++ ...n_backend-migrations.MigrationManager.html | 16 + ...in_backend-migrations.MigrationRecord.html | 101 +++++++ ...d-migrations.QuatrainMigrationStorage.html | 13 + ...train_backend-migrations.SchemaDiffer.html | 6 + ...in_backend-migrations.SnapshotManager.html | 8 + ...rain_backend-postgres.PostgresAdapter.html | 146 +++++++++ ...end-restapi-recipes.AccuweatherRecipe.html | 17 ++ ...ckend-restapi-recipes.CoinGeckoRecipe.html | 17 ++ ...-restapi-recipes.OpenWeatherMapRecipe.html | 17 ++ ...train_backend-restapi.OpenApiIngestor.html | 9 + ...in_backend-restapi.RestBackendAdapter.html | 109 +++++++ ...quatrain_backend-sqlite.SQLiteAdapter.html | 115 +++++++ ...atrain_backend.AbstractBackendAdapter.html | 98 ++++++ .../classes/_quatrain_backend.Backend.html | 94 ++++++ .../_quatrain_backend.BackendError.html | 35 +++ .../_quatrain_backend.BaseRepository.html | 36 +++ .../_quatrain_backend.CollectionProperty.html | 105 +++++++ .../classes/_quatrain_backend.Filter.html | 9 + .../classes/_quatrain_backend.Filters.html | 8 + ...rain_backend.InjectKeywordsMiddleware.html | 11 + ...quatrain_backend.InjectMetaMiddleware.html | 11 + .../classes/_quatrain_backend.Limits.html | 7 + .../_quatrain_backend.MockAdapter.html | 116 ++++++++ ..._quatrain_backend.PersistedBaseObject.html | 102 +++++++ ..._quatrain_backend.PersistedDataObject.html | 101 +++++++ .../classes/_quatrain_backend.Query.html | 99 ++++++ .../classes/_quatrain_backend.Repository.html | 28 ++ .../_quatrain_backend.SortAndLimit.html | 8 + .../classes/_quatrain_backend.Sorting.html | 8 + .../classes/_quatrain_backend.User.html | 98 ++++++ .../_quatrain_backend.UserRepository.html | 40 +++ ...uatrain_cache-redis.RedisCacheAdapter.html | 24 ++ .../_quatrain_cache-redis.RedisManager.html | 7 + .../classes/_quatrain_cache.Cache.html | 94 ++++++ ...train_cache.CacheInvalidateMiddleware.html | 11 + .../_quatrain_cache.MediaCacheProxy.html | 12 + .../_quatrain_chat.ChatController.html | 7 + .../classes/_quatrain_cli.CliCommand.html | 281 ++++++++++++++++++ .../classes/_quatrain_cli.Command.html | 30 ++ .../_quatrain_cli.inquirer.Separator.html | 11 + .../_quatrain_cli.inquirer.ui.BottomBar.html | 31 ++ .../_quatrain_cli.inquirer.ui.Prompt.html | 42 +++ ...wrapper-firebase.FirebaseCloudWrapper.html | 17 ++ ...wrapper-supabase.SupabaseCloudWrapper.html | 19 ++ ...ain_cloudwrapper.AbstractCloudWrapper.html | 4 + .../_quatrain_cloudwrapper.CloudWrapper.html | 78 +++++ .../_quatrain_code-github.GithubAdapter.html | 18 ++ ...atrain_code.AbstractRepositoryAdapter.html | 12 + .../_quatrain_code.CodeRepository.html | 11 + .../_quatrain_core.AbstractObject.html | 36 +++ .../classes/_quatrain_core.ArrayProperty.html | 55 ++++ .../classes/_quatrain_core.BackendError.html | 36 +++ .../_quatrain_core.BadRequestError.html | 36 +++ .../classes/_quatrain_core.BaseObject.html | 68 +++++ .../classes/_quatrain_core.BaseProperty.html | 47 +++ .../_quatrain_core.BooleanProperty.html | 45 +++ .../_quatrain_core.CollectionProperty.html | 103 +++++++ .../classes/_quatrain_core.Core.html | 79 +++++ .../classes/_quatrain_core.DataObject.html | 73 +++++ .../_quatrain_core.DateTimeProperty.html | 55 ++++ .../classes/_quatrain_core.Entity.html | 66 ++++ .../classes/_quatrain_core.EnumProperty.html | 52 ++++ .../classes/_quatrain_core.FileProperty.html | 48 +++ .../_quatrain_core.ForbiddenError.html | 36 +++ .../classes/_quatrain_core.GoneError.html | 36 +++ .../classes/_quatrain_core.HashProperty.html | 96 ++++++ .../classes/_quatrain_core.MapProperty.html | 46 +++ .../classes/_quatrain_core.NotFoundError.html | 36 +++ .../_quatrain_core.NumberProperty.html | 70 +++++ .../_quatrain_core.ObjectProperty.html | 52 ++++ .../classes/_quatrain_core.ObjectUri.html | 73 +++++ .../classes/_quatrain_core.Property.html | 33 ++ .../_quatrain_core.StringProperty.html | 73 +++++ .../_quatrain_core.UnauthorizedError.html | 36 +++ .../classes/_quatrain_core.User.html | 66 ++++ .../_quatrain_core.ValidationError.html | 39 +++ ..._quatrain_git-client.GithubHttpClient.html | 10 + .../classes/_quatrain_http.HttpHelper.html | 11 + .../classes/_quatrain_i18n.Translator.html | 41 +++ ...ingestion-audio.AudioIngestionAdapter.html | 7 + ...ain_ingestion-ocr.OcrIngestionAdapter.html | 7 + ...ingestion-video.VideoIngestionAdapter.html | 7 + ...ain_ingestion-web.WebIngestionAdapter.html | 7 + ...in_ingestion.AbstractIngestionAdapter.html | 7 + .../_quatrain_ingestion.Ingestion.html | 89 ++++++ .../_quatrain_log.AbstractLoggerAdapter.html | 36 +++ .../_quatrain_log.DefaultLoggerAdapter.html | 37 +++ .../classes/_quatrain_log.Log.html | 37 +++ .../_quatrain_mdm.AbstractMdmAdapter.html | 101 +++++++ .../_quatrain_mdm.AbstractMdmObject.html | 135 +++++++++ ...train_mdm.AbstractMdmObjectRepository.html | 36 +++ .../classes/_quatrain_mdm.Disk.html | 134 +++++++++ .../classes/_quatrain_mdm.Garment.html | 134 +++++++++ .../classes/_quatrain_mdm.HardwareDevice.html | 134 +++++++++ .../classes/_quatrain_mdm.Mdm.html | 99 ++++++ .../classes/_quatrain_mdm.MdmSpecGroups.html | 15 + .../classes/_quatrain_mdm.MockMdmAdapter.html | 100 +++++++ .../classes/_quatrain_mdm.ObjectVendor.html | 101 +++++++ .../_quatrain_mdm.ObjectVendorRepository.html | 36 +++ .../classes/_quatrain_mdm.Specification.html | 101 +++++++ ..._quatrain_mdm.SpecificationRepository.html | 36 +++ .../classes/_quatrain_mdm.TeeShirt.html | 133 +++++++++ .../classes/_quatrain_mdm.Vendor.html | 101 +++++++ .../_quatrain_mdm.VendorRepository.html | 36 +++ .../_quatrain_mdm.VirtualKeychain.html | 134 +++++++++ ...ing-firebase.FirebaseMessagingAdapter.html | 17 ++ ...in_messaging.AbstractMessagingAdapter.html | 5 + .../_quatrain_messaging.MessageFormatter.html | 14 + .../_quatrain_messaging.Messaging.html | 91 ++++++ .../_quatrain_okf.OKFBackendAdapter.html | 128 ++++++++ ..._quatrain_queue-amqp.AmqpQueueAdapter.html | 15 + .../_quatrain_queue-aws.SqsAdapter.html | 13 + ...train_queue-sqlite.SQLiteQueueAdapter.html | 21 ++ .../_quatrain_queue.AbstractQueueAdapter.html | 15 + .../classes/_quatrain_queue.Queue.html | 91 ++++++ ...archengine-qmd.QmdSearchEngineAdapter.html | 23 ++ ...rchengine.AbstractSearchEngineAdapter.html | 23 ++ .../_quatrain_searchengine.SearchEngine.html | 101 +++++++ ..._quatrain_skills.AbstractSkillAdapter.html | 9 + .../classes/_quatrain_skills.Skills.html | 101 +++++++ ...atrain_state-machine.BaseStateMachine.html | 18 ++ ...state-machine.ConformanceStateMachine.html | 28 ++ ...in_state-machine.WorkflowStateMachine.html | 35 +++ ...orage-firebase.FirebaseStorageAdapter.html | 94 ++++++ ...uatrain_storage-git.GitStorageAdapter.html | 100 +++++++ ...ain_storage-local.LocalStorageAdapter.html | 93 ++++++ ..._quatrain_storage-s3.S3StorageAdapter.html | 100 +++++++ ...orage-supabase.SupabaseStorageAdapter.html | 108 +++++++ ...atrain_storage.AbstractStorageAdapter.html | 89 ++++++ .../_quatrain_storage.MockAdapter.html | 91 ++++++ .../classes/_quatrain_storage.Storage.html | 94 ++++++ .../_quatrain_studio.CodeGenerator.html | 8 + .../classes/_quatrain_studio.StudioAgent.html | 9 + .../classes/_quatrain_studio.StudioAuth.html | 97 ++++++ .../_quatrain_studio.StudioBackend.html | 97 ++++++ .../_quatrain_studio.StudioDeployment.html | 97 ++++++ .../_quatrain_studio.StudioEnvironment.html | 97 ++++++ .../_quatrain_studio.StudioHistory.html | 97 ++++++ .../classes/_quatrain_studio.StudioModel.html | 97 ++++++ .../_quatrain_studio.StudioProject.html | 97 ++++++ .../_quatrain_studio.StudioProperty.html | 97 ++++++ .../_quatrain_studio.StudioSecret.html | 97 ++++++ .../_quatrain_studio.StudioStorage.html | 97 ++++++ .../_quatrain_studio.StudioTarget.html | 97 ++++++ .../classes/_quatrain_studio.StudioView.html | 97 ++++++ .../_quatrain_studio.StudioWidget.html | 97 ++++++ .../classes/_quatrain_testing.Entity.html | 98 ++++++ .../classes/_quatrain_types.BackendError.html | 36 +++ .../_quatrain_types.BadRequestError.html | 36 +++ .../_quatrain_types.ForbiddenError.html | 36 +++ .../classes/_quatrain_types.GoneError.html | 36 +++ .../_quatrain_types.NotFoundError.html | 36 +++ .../classes/_quatrain_types.ObjectUri.html | 73 +++++ .../_quatrain_types.ResourceError.html | 36 +++ .../_quatrain_types.UnauthorizedError.html | 36 +++ .../_quatrain_types.ValidationError.html | 39 +++ .../classes/_quatrain_worker.FileSystem.html | 32 ++ .../classes/_quatrain_worker.Helpers.html | 10 + .../classes/_quatrain_worker.Worker.html | 95 ++++++ .../documents/api-client_HOWTO.html | 4 +- .../documents/api-server-astro_HOWTO.html | 14 + .../documents/api-server-astro_README.html | 14 + .../documents/api-server-express_HOWTO.html | 2 +- .../documents/api-xmlrpc_HOWTO.html | 14 + .../documents/api-xmlrpc_README.html | 14 + .../api-reference/documents/api_HOWTO.html | 2 +- .../api-reference/documents/app_HOWTO.html | 58 ++++ .../documents/auth-firebase_HOWTO.html | 2 +- .../documents/auth-github_HOWTO.html | 35 +++ .../documents/auth-github_README.html | 15 + .../documents/auth-http-basic_HOWTO.html | 14 + .../documents/auth-http-basic_README.html | 14 + .../documents/auth-rbac_HOWTO.html | 24 ++ .../documents/auth-rbac_README.html | 30 ++ .../documents/auth-supabase_HOWTO.html | 2 +- .../api-reference/documents/auth_HOWTO.html | 2 +- .../documents/backend-restapi_README.html | 2 +- .../documents/backend_HOWTO.html | 14 +- .../documents/backend_README.html | 4 +- .../documents/cache-redis_README.html | 2 +- .../api-reference/documents/cache_README.html | 4 +- .../api-reference/documents/chat_README.html | 12 + .../api-reference/documents/cli_HOWTO.html | 55 ++++ .../api-reference/documents/cli_README.html | 57 ++++ .../documents/core-cli_HOWTO.html | 60 ---- .../documents/core-cli_README.html | 45 --- .../api-reference/documents/core_HOWTO.html | 4 +- .../api-reference/documents/core_README.html | 4 +- .../gateway-upstream-express_HOWTO.html | 2 +- .../gateway-upstream-express_README.html | 2 +- .../api-reference/documents/http_HOWTO.html | 14 + .../api-reference/documents/http_README.html | 15 + .../documents/i18n-en_README.html | 2 +- .../documents/i18n-es_HOWTO.html | 9 + .../documents/i18n-es_README.html | 2 +- .../documents/i18n-fr_README.html | 2 +- .../api-reference/documents/i18n_HOWTO.html | 2 +- .../api-reference/documents/i18n_README.html | 2 +- .../documents/ingestion_README.html | 14 + .../api-reference/documents/log_HOWTO.html | 4 +- .../api-reference/documents/mdm_HOWTO.html | 57 ++++ .../api-reference/documents/mdm_README.html | 17 ++ .../documents/messaging-firebase_HOWTO.html | 2 +- .../documents/messaging_HOWTO.html | 2 +- .../api-reference/documents/okf_HOWTO.html | 25 ++ .../api-reference/documents/okf_README.html | 17 ++ .../documents/queue-amqp_HOWTO.html | 2 +- .../documents/queue-sqlite_HOWTO.html | 27 ++ .../documents/queue-sqlite_README.html | 20 ++ .../documents/searchengine-qmd_HOWTO.html | 15 + .../documents/searchengine-qmd_README.html | 14 + .../documents/searchengine_HOWTO.html | 17 ++ .../documents/searchengine_README.html | 14 + .../api-reference/documents/skills_HOWTO.html | 14 + .../documents/skills_README.html | 14 + .../documents/state-machine_HOWTO.html | 15 + .../documents/state-machine_README.html | 15 + .../documents/storage-firebase_HOWTO.html | 2 +- .../documents/storage-s3_HOWTO.html | 4 +- .../documents/storage-supabase_HOWTO.html | 4 +- .../documents/storage_HOWTO.html | 6 +- .../api-reference/documents/types_HOWTO.html | 14 + .../api-reference/documents/types_README.html | 14 + .../api-reference/documents/worker_HOWTO.html | 6 +- .../enums/_quatrain_api-client.Method.html | 4 +- .../enums/_quatrain_api.HttpHeader.html | 4 +- .../enums/_quatrain_api.HttpMethod.html | 4 +- .../enums/_quatrain_api.HttpStatus.html | 4 +- .../enums/_quatrain_auth.AuthAction.html | 4 + .../_quatrain_backend.BackendAction.html | 6 + .../enums/_quatrain_backend.OperatorKeys.html | 14 + .../enums/_quatrain_core.returnAs.html | 5 + .../enums/_quatrain_http.HttpHeader.html | 7 + .../enums/_quatrain_http.HttpMethod.html | 9 + .../enums/_quatrain_http.HttpStatus.html | 37 +++ .../enums/_quatrain_log.LogLevel.html | 7 + .../enums/_quatrain_mdm.AuthMechanism.html | 8 + .../enums/_quatrain_mdm.CommTechnology.html | 8 + .../enums/_quatrain_mdm.GarmentSize.html | 11 + .../enums/_quatrain_mdm.MdmAuthMechanism.html | 8 + .../_quatrain_mdm.MdmCommTechnology.html | 8 + .../_quatrain_mdm.MdmLifecycleState.html | 16 + .../_quatrain_mdm.MdmMediaDiskFormat.html | 9 + .../enums/_quatrain_mdm.MdmNature.html | 6 + .../enums/_quatrain_mdm.MdmPowerSource.html | 6 + .../enums/_quatrain_mdm.MdmSensorBus.html | 7 + .../_quatrain_mdm.MdmServiceCategory.html | 7 + .../_quatrain_mdm.MdmStandardOntologies.html | 9 + .../enums/_quatrain_mdm.MediaDiskFormat.html | 11 + .../enums/_quatrain_mdm.PowerSource.html | 6 + .../enums/_quatrain_mdm.SensorBus.html | 7 + .../enums/_quatrain_mdm.TextileColor.html | 13 + .../enums/_quatrain_mdm.TextileMaterial.html | 11 + .../enums/_quatrain_mdm.TextileWashCare.html | 10 + .../enums/_quatrain_mdm.VinylRpm.html | 5 + .../enums/_quatrain_worker.ModeEnum.html | 4 + .../_quatrain_api-server.CrudEndpoint.html | 2 +- .../_quatrain_api-server.ListEndpoint.html | 2 +- .../_quatrain_api-server.ValuesEndpoint.html | 2 +- .../_quatrain_auth-github.GithubAuthApi.html | 3 + ...train_auth-rbac.mapHttpMethodToAction.html | 4 + ...atrain_backend.asyncContextMiddleware.html | 6 + .../functions/_quatrain_cli.askChoice.html | 2 + .../functions/_quatrain_cli.askConfirm.html | 2 + .../functions/_quatrain_cli.askInput.html | 2 + ...-upstream-express.createGatewayRouter.html | 4 + .../_quatrain_testing.DataGenerator.html | 2 + .../_quatrain_testing.createEntity.html | 1 + .../_quatrain_testing.createUser.html | 1 + .../_quatrain_testing.createUsers.html | 1 + docs/public/api-reference/hierarchy.html | 2 +- docs/public/api-reference/index.html | 2 +- .../_quatrain_api-client.AuthProvider.html | 4 +- .../_quatrain_api-client.RestApi.html | 4 +- ...atrain_api-xmlrpc.XmlRpcClientOptions.html | 10 + .../interfaces/_quatrain_api.ApiRequest.html | 4 +- .../interfaces/_quatrain_api.ApiResponse.html | 4 +- .../_quatrain_api.EndpointOptions.html | 4 +- .../_quatrain_api.ServerAdapter.html | 6 +- ..._quatrain_app.AppCompositionInterface.html | 9 + .../_quatrain_app.AppContentInterface.html | 5 + .../interfaces/_quatrain_app.ComposeFile.html | 5 + .../_quatrain_app.ComposeService.html | 11 + .../_quatrain_app.PWAContentInterface.html | 9 + .../_quatrain_auth-rbac.AstroLikeContext.html | 6 + .../_quatrain_auth-rbac.AstroRbacOptions.html | 10 + .../_quatrain_auth-rbac.EntityFieldRules.html | 8 + ...quatrain_auth-rbac.ExpressLikeRequest.html | 11 + ...uatrain_auth-rbac.ExpressLikeResponse.html | 6 + ...quatrain_auth-rbac.ExpressRbacOptions.html | 6 + ...quatrain_auth-rbac.RbacRequestContext.html | 16 + .../_quatrain_auth-rbac.RbacUserContext.html | 14 + .../_quatrain_auth-rbac.RoleDefinition.html | 18 ++ ...train_auth-rbac.RouteEvaluationResult.html | 14 + .../_quatrain_auth-rbac.RouteRule.html | 13 + .../_quatrain_auth-rbac.TarpitRuleConfig.html | 12 + .../_quatrain_auth.AuthInterface.html | 8 + .../_quatrain_auth.AuthParameters.html | 8 + ...n_backend-migrations.MigrationOptions.html | 3 + ...backend-restapi-recipes.RestApiRecipe.html | 10 + ...ackend-restapi.OpenApiIngestorOptions.html | 5 + ...in_backend-restapi.RestAdapterOptions.html | 6 + .../_quatrain_backend.BackendInterface.html | 10 + .../_quatrain_backend.BackendMiddleware.html | 10 + .../_quatrain_backend.BackendParameters.html | 12 + .../_quatrain_backend.BackendRecordType.html | 4 + .../_quatrain_backend.DataObjectClass.html | 26 ++ ...ackend.InjectKeywordsMiddlewareParams.html | 1 + ...in_backend.InjectMetaMiddlewareParams.html | 2 + .../_quatrain_backend.SchemaDelta.html | 4 + ..._quatrain_cache.CacheAdapterInterface.html | 6 + .../_quatrain_chat.ChatDocument.html | 7 + .../_quatrain_chat.ChatSessionConfig.html | 5 + ...nquirer.prompts.FailedPromptStateData.html | 4 + ...train_cli.inquirer.prompts.PromptBase.html | 7 + ...li.inquirer.prompts.PromptConstructor.html | 7 + ...cli.inquirer.prompts.PromptEventPipes.html | 7 + ..._cli.inquirer.prompts.PromptStateData.html | 4 + ...rer.prompts.SuccessfulPromptStateData.html | 7 + ...rain_cli.inquirer.ui.BottomBarOptions.html | 10 + ...uatrain_cli.inquirer.ui.FetchedAnswer.html | 6 + ...rain_cloudwrapper.DatabaseTriggerType.html | 7 + ..._cloudwrapper.StorageEventPayloadType.html | 4 + ...train_cloudwrapper.StorageTriggerType.html | 4 + .../interfaces/_quatrain_code.CommitFile.html | 3 + .../_quatrain_core.ArrayPropertyType.html | 52 ++++ .../_quatrain_core.BaseObjectClass.html | 5 + .../_quatrain_core.BaseObjectType.html | 18 ++ .../_quatrain_core.BasePropertyType.html | 72 +++++ .../_quatrain_core.BooleanPropertyType.html | 12 + ..._quatrain_core.CollectionPropertyType.html | 45 +++ .../_quatrain_core.DataObjectClass.html | 21 ++ .../_quatrain_core.DataObjectParams.html | 4 + .../_quatrain_core.DateTimePropertyType.html | 31 ++ .../interfaces/_quatrain_core.EntityType.html | 19 ++ .../_quatrain_core.EnumPropertyType.html | 31 ++ .../_quatrain_core.FilePropertyType.html | 12 + .../_quatrain_core.HashPropertyType.html | 52 ++++ .../_quatrain_core.MapPropertyType.html | 12 + .../interfaces/_quatrain_core.Meta.html | 3 + .../_quatrain_core.NumberPropertyType.html | 72 +++++ .../_quatrain_core.ObjectPropertyType.html | 31 ++ .../_quatrain_core.StringPropertyType.html | 73 +++++ .../interfaces/_quatrain_core.UserType.html | 24 ++ ...upstream-express.GatewayRouterOptions.html | 10 + ...eway-upstream-express.MediaResolution.html | 4 + .../interfaces/_quatrain_http.ApiRequest.html | 5 + .../_quatrain_http.ApiResponse.html | 7 + .../_quatrain_i18n.CoreDictionary.html | 6 + .../_quatrain_i18n.SystemStatusesLabels.html | 83 ++++++ .../_quatrain_i18n.SystemTableLabels.html | 30 ++ .../_quatrain_ingestion.IngestionResult.html | 9 + ...train_mdm.HardwareDeviceSpecInterface.html | 11 + .../_quatrain_mdm.MdmArchetypeSpec.html | 19 ++ ...atrain_mdm.MdmCommCapabilityInterface.html | 11 + ..._mdm.MdmHardwareCapabilitiesInterface.html | 5 + ..._quatrain_mdm.MdmObjectTypeDefinition.html | 14 + ...train_mdm.MdmPowerCapabilityInterface.html | 5 + ...n_mdm.MdmSensorBusCapabilityInterface.html | 5 + ...n_mdm.MdmServiceCapabilitiesInterface.html | 6 + ...n_mdm.MdmVirtualCapabilitiesInterface.html | 7 + .../_quatrain_mdm.MediaDiskSpecInterface.html | 11 + ...quatrain_mdm.OntologyMappingInterface.html | 8 + ...train_mdm.TextileGarmentSpecInterface.html | 10 + ...rain_mdm.VirtualKeychainSpecInterface.html | 8 + ...uatrain_messaging.EmailCapableAdapter.html | 3 + .../_quatrain_messaging.MessageType.html | 5 + ...uatrain_messaging.MessagingParameters.html | 3 + ..._messaging.NotificationCapableAdapter.html | 3 + ...uatrain_messaging.NotificationMessage.html | 5 + ...quatrain_messaging.TextCapableAdapter.html | 3 + .../_quatrain_queue.ConfigParameters.html | 10 + .../_quatrain_queue.QueueParameters.html | 3 + ...rain_searchengine-qmd.QmdEngineConfig.html | 9 + ..._quatrain_searchengine.SearchDocument.html | 18 ++ ...n_searchengine.SearchEngineParameters.html | 8 + ...train_searchengine.SearchQueryOptions.html | 10 + ...uatrain_searchengine.SearchResultItem.html | 14 + .../_quatrain_skills.ApiSkillDefinition.html | 6 + ...uatrain_skills.RemoteMethodDefinition.html | 7 + ..._quatrain_skills.SkillApiClientConfig.html | 5 + .../_quatrain_skills.SkillField.html | 9 + .../_quatrain_skills.SkillManifest.html | 13 + .../_quatrain_skills.SkillRegistration.html | 5 + .../_quatrain_skills.ToolDefinition.html | 4 + .../_quatrain_skills.ToolParameter.html | 5 + ...uatrain_state-machine.ConformanceRule.html | 3 + ...rain_state-machine.WorkflowTransition.html | 6 + .../_quatrain_storage.BlobMediaType.html | 14 + .../_quatrain_storage.BlobType.html | 14 + .../_quatrain_storage.BucketStatsType.html | 5 + ...quatrain_storage.DownloadFileMetaType.html | 3 + .../_quatrain_storage.FileType.html | 13 + ...train_storage.StorageAdapterInterface.html | 17 ++ .../_quatrain_storage.StorageParameters.html | 7 + .../_quatrain_studio.StudioAuthType.html | 21 ++ .../_quatrain_studio.StudioBackendType.html | 28 ++ ..._quatrain_studio.StudioDeploymentType.html | 22 ++ ...quatrain_studio.StudioEnvironmentType.html | 27 ++ .../_quatrain_studio.StudioHistoryType.html | 24 ++ .../_quatrain_studio.StudioModelType.html | 22 ++ .../_quatrain_studio.StudioProjectType.html | 23 ++ .../_quatrain_studio.StudioPropertyType.html | 24 ++ .../_quatrain_studio.StudioSecretType.html | 20 ++ .../_quatrain_studio.StudioStorageType.html | 21 ++ .../_quatrain_studio.StudioTargetType.html | 20 ++ .../_quatrain_studio.StudioViewType.html | 20 ++ .../_quatrain_studio.StudioWidgetType.html | 21 ++ ...uatrain_types.AppCompositionInterface.html | 9 + .../_quatrain_types.AppContentInterface.html | 5 + .../_quatrain_types.BaseObjectType.html | 18 ++ .../_quatrain_types.PWAContentInterface.html | 9 + .../_quatrain_worker.HandlerParameters.html | 6 + ...train_worker.MessagehandlerParameters.html | 3 + docs/public/api-reference/modules.html | 2 +- .../modules/_quatrain_api-server-astro.html | 14 + .../modules/_quatrain_api-server-express.html | 1 + .../modules/_quatrain_api-xmlrpc.html | 14 + .../api-reference/modules/_quatrain_app.html | 15 + .../modules/_quatrain_auth-firebase.html | 18 ++ .../modules/_quatrain_auth-github.html | 15 + .../modules/_quatrain_auth-http-basic.html | 14 + .../modules/_quatrain_auth-oidc.html | 15 + .../modules/_quatrain_auth-pocketbase.html | 15 + .../modules/_quatrain_auth-rbac.html | 30 ++ .../modules/_quatrain_auth-supabase.html | 18 ++ .../api-reference/modules/_quatrain_auth.html | 20 ++ .../modules/_quatrain_backend-firestore.html | 20 ++ .../modules/_quatrain_backend-migrations.html | 15 + .../modules/_quatrain_backend-postgres.html | 30 ++ .../_quatrain_backend-restapi-recipes.html | 22 ++ .../modules/_quatrain_backend-restapi.html | 29 ++ .../modules/_quatrain_backend-sqlite.html | 18 ++ ..._quatrain_backend.CollectionHierarchy.html | 1 + .../modules/_quatrain_backend.html | 33 ++ .../modules/_quatrain_cache-redis.html | 26 ++ .../modules/_quatrain_cache.html | 21 ++ .../api-reference/modules/_quatrain_chat.html | 12 + .../api-reference/modules/_quatrain_cli.html | 57 ++++ .../modules/_quatrain_cli.inquirer.html | 2 + .../_quatrain_cli.inquirer.prompts.html | 2 + .../modules/_quatrain_cli.inquirer.ui.html | 2 + .../_quatrain_cloudwrapper-firebase.html | 25 ++ .../_quatrain_cloudwrapper-supabase.html | 24 ++ .../modules/_quatrain_cloudwrapper.html | 20 ++ .../modules/_quatrain_code-github.html | 15 + .../api-reference/modules/_quatrain_code.html | 15 + .../api-reference/modules/_quatrain_core.html | 103 +++++++ .../modules/_quatrain_core.htmlType.html | 1 + .../modules/_quatrain_core.statuses.html | 1 + .../_quatrain_gateway-upstream-express.html | 12 + .../modules/_quatrain_git-client.html | 1 + .../api-reference/modules/_quatrain_http.html | 15 + .../modules/_quatrain_i18n-en.html | 10 + .../modules/_quatrain_i18n-es.html | 10 + .../modules/_quatrain_i18n-fr.html | 10 + .../api-reference/modules/_quatrain_i18n.html | 10 + .../modules/_quatrain_ingestion-audio.html | 1 + .../modules/_quatrain_ingestion-ocr.html | 1 + .../modules/_quatrain_ingestion-video.html | 1 + .../modules/_quatrain_ingestion-web.html | 1 + .../modules/_quatrain_ingestion.html | 14 + .../api-reference/modules/_quatrain_log.html | 27 ++ .../api-reference/modules/_quatrain_mdm.html | 17 ++ .../modules/_quatrain_messaging-firebase.html | 18 ++ .../modules/_quatrain_messaging.html | 20 ++ .../api-reference/modules/_quatrain_okf.html | 17 ++ .../modules/_quatrain_queue-amqp.html | 18 ++ .../modules/_quatrain_queue-aws.html | 18 ++ .../modules/_quatrain_queue-gcp.html | 18 ++ .../modules/_quatrain_queue-sqlite.html | 20 ++ .../modules/_quatrain_queue.html | 20 ++ .../modules/_quatrain_searchengine-qmd.html | 14 + .../modules/_quatrain_searchengine.html | 14 + .../modules/_quatrain_skills.html | 14 + .../modules/_quatrain_state-machine.html | 15 + .../modules/_quatrain_storage-firebase.html | 18 ++ .../modules/_quatrain_storage-git.html | 1 + .../modules/_quatrain_storage-local.html | 15 + .../modules/_quatrain_storage-s3.html | 18 ++ .../modules/_quatrain_storage-supabase.html | 18 ++ .../modules/_quatrain_storage.html | 20 ++ .../modules/_quatrain_studio.html | 19 ++ .../modules/_quatrain_testing.html | 15 + .../modules/_quatrain_types.html | 14 + .../modules/_quatrain_types.statuses.html | 1 + .../modules/_quatrain_worker.html | 26 ++ .../_quatrain_api-client.QueryOptions.html | 4 +- ...atrain_api-client.SelectValuesOptions.html | 4 +- .../types/_quatrain_api.ApiHandler.html | 2 +- .../types/_quatrain_api.ApiMiddleware.html | 2 +- .../types/_quatrain_api.EndpointHandler.html | 2 +- .../_quatrain_app.AdapterConfigSpec.html | 2 + .../_quatrain_app.PivotAdaptersSpec.html | 2 + .../_quatrain_auth-rbac.AccessDecision.html | 2 + ...ain_auth-rbac.AstroLikeMiddlewareNext.html | 1 + ...ain_auth-rbac.ExpressLikeNextFunction.html | 1 + .../_quatrain_auth-rbac.FieldAccessMode.html | 7 + .../types/_quatrain_auth-rbac.HttpMethod.html | 2 + .../types/_quatrain_auth-rbac.RbacAction.html | 3 + .../_quatrain_auth-rbac.SubjectType.html | 3 + .../_quatrain_auth.AuthParametersKeys.html | 2 + ...train_backend-restapi.QuerySerializer.html | 1 + .../_quatrain_backend.QueryMetaType.html | 8 + .../_quatrain_backend.QueryResultType.html | 3 + .../types/_quatrain_cache.PrefixResolver.html | 1 + ...cli.inquirer.prompts.PromptCollection.html | 2 + ...in_cli.inquirer.prompts.PromptOptions.html | 4 + ...rain_cli.inquirer.prompts.PromptState.html | 2 + ...train_cli.inquirer.ui.FetchedQuestion.html | 7 + .../_quatrain_core.DataObjectProperties.html | 1 + .../types/_quatrain_core.Persisted.html | 1 + .../types/_quatrain_core.Proxy.html | 1 + ...atrain_core.htmlType.PropertyHTMLType.html | 1 + .../types/_quatrain_http.ApiHandler.html | 1 + .../types/_quatrain_http.ApiMiddleware.html | 1 + .../_quatrain_mdm.MdmObjectConstructor.html | 2 + ...quatrain_messaging.MessagingRecipient.html | 1 + .../types/_quatrain_skills.ApiClientType.html | 2 + ...quatrain_state-machine.ActionFunction.html | 1 + ...atrain_state-machine.ConformanceState.html | 2 + ..._quatrain_state-machine.GuardFunction.html | 1 + ...quatrain_storage.FileResponseLinkType.html | 6 + ..._quatrain_storage.FileResponseUrlType.html | 3 + ...uatrain_storage.StorageParametersKeys.html | 2 + ..._quatrain_studio.StudioAuthProperties.html | 1 + .../_quatrain_studio.StudioBackendDef.html | 1 + .../_quatrain_studio.StudioDeploymentDef.html | 1 + ...in_studio.StudioEnvironmentProperties.html | 1 + .../_quatrain_studio.StudioHistoryDef.html | 1 + ...quatrain_studio.StudioModelProperties.html | 1 + ...atrain_studio.StudioProjectProperties.html | 1 + .../_quatrain_studio.StudioPropertyDef.html | 1 + ...uatrain_studio.StudioSecretProperties.html | 1 + ...atrain_studio.StudioStorageProperties.html | 1 + .../types/_quatrain_studio.StudioViewDef.html | 1 + .../_quatrain_studio.StudioWidgetDef.html | 1 + .../_quatrain_types.AdapterConfigSpec.html | 2 + .../_quatrain_types.PivotAdaptersSpec.html | 2 + .../types/_quatrain_types.ReferenceType.html | 8 + .../_quatrain_backend.BackendContext.html | 3 + ..._backend.CollectionHierarchy.STANDARD.html | 1 + ...end.CollectionHierarchy.SUBCOLLECTION.html | 1 + ...llectionHierarchy.SUBCOLLECTION_GROUP.html | 1 + ...train_cli.inquirer.createPromptModule.html | 4 + .../_quatrain_cli.inquirer.prompt.html | 2 + ..._quatrain_cli.inquirer.registerPrompt.html | 4 + ...in_cli.inquirer.restoreDefaultPrompts.html | 2 + .../_quatrain_core.BaseObjectProperties.html | 1 + .../_quatrain_core.UserProperties.html | 1 + .../_quatrain_core.htmlType.BIRTHDAY.html | 1 + .../_quatrain_core.htmlType.CHECKBOX.html | 1 + .../_quatrain_core.htmlType.EMAIL.html | 1 + .../_quatrain_core.htmlType.FAMILY_NAME.html | 1 + .../_quatrain_core.htmlType.FILE.html | 1 + .../_quatrain_core.htmlType.GENDER.html | 1 + .../_quatrain_core.htmlType.GIVEN_NAME.html | 1 + .../_quatrain_core.htmlType.HIDDEN.html | 1 + .../_quatrain_core.htmlType.NAME.html | 1 + .../_quatrain_core.htmlType.NUMBER.html | 1 + .../_quatrain_core.htmlType.OFF.html | 1 + .../_quatrain_core.htmlType.ORG.html | 1 + .../_quatrain_core.htmlType.PASSWORD.html | 1 + .../_quatrain_core.htmlType.SELECT.html | 1 + .../_quatrain_core.htmlType.TEXT.html | 1 + .../_quatrain_core.htmlType.TEXTAREA.html | 1 + .../_quatrain_core.statuses.ACTIVE.html | 1 + .../_quatrain_core.statuses.APPROVED.html | 1 + .../_quatrain_core.statuses.ARCHIVED.html | 1 + .../_quatrain_core.statuses.BLOCKED.html | 1 + .../_quatrain_core.statuses.CANCELLED.html | 1 + .../_quatrain_core.statuses.COMPLETED.html | 1 + .../_quatrain_core.statuses.CONVERTING.html | 1 + .../_quatrain_core.statuses.CREATED.html | 1 + .../_quatrain_core.statuses.DELETABLE.html | 1 + .../_quatrain_core.statuses.DELETED.html | 1 + .../_quatrain_core.statuses.DISABLED.html | 1 + .../_quatrain_core.statuses.DOCUMENT.html | 2 + .../_quatrain_core.statuses.DONE.html | 1 + .../_quatrain_core.statuses.DOWNLOAD.html | 2 + .../_quatrain_core.statuses.DOWNLOADED.html | 1 + .../_quatrain_core.statuses.DOWNLOADING.html | 1 + .../_quatrain_core.statuses.DOWNLOAD_KO.html | 1 + .../_quatrain_core.statuses.DRAFT.html | 1 + .../_quatrain_core.statuses.ERROR.html | 1 + .../_quatrain_core.statuses.EXPIRED.html | 1 + .../_quatrain_core.statuses.FAILED.html | 1 + .../_quatrain_core.statuses.FINISHING.html | 1 + .../_quatrain_core.statuses.GENERATED.html | 1 + .../_quatrain_core.statuses.GENERATING.html | 1 + .../_quatrain_core.statuses.IN_PROGRESS.html | 1 + .../variables/_quatrain_core.statuses.KO.html | 1 + .../variables/_quatrain_core.statuses.OK.html | 1 + .../_quatrain_core.statuses.OPTIMIZING.html | 1 + .../_quatrain_core.statuses.PAUSED.html | 1 + .../_quatrain_core.statuses.PENDING.html | 1 + .../_quatrain_core.statuses.PREPARING.html | 1 + .../_quatrain_core.statuses.PROCESSING.html | 1 + .../_quatrain_core.statuses.PUBLISHED.html | 1 + .../_quatrain_core.statuses.QUEUED.html | 1 + .../_quatrain_core.statuses.REJECTED.html | 1 + .../_quatrain_core.statuses.RUNNING.html | 1 + .../_quatrain_core.statuses.SUCCESS.html | 1 + .../_quatrain_core.statuses.SUSPENDED.html | 1 + .../_quatrain_core.statuses.TRIAGING.html | 1 + .../_quatrain_core.statuses.UNKNOWN.html | 1 + .../_quatrain_core.statuses.UPDATED.html | 1 + .../_quatrain_core.statuses.UPLOAD.html | 2 + .../_quatrain_core.statuses.UPLOADED.html | 1 + .../_quatrain_core.statuses.UPLOADING.html | 1 + .../_quatrain_core.statuses.UPLOAD_KO.html | 1 + .../_quatrain_core.statuses.VALIDATED.html | 1 + .../_quatrain_core.statuses.ZIPPING.html | 1 + .../_quatrain_i18n-en.enDictionary.html | 2 + .../_quatrain_i18n-es.esDictionary.html | 2 + .../_quatrain_i18n-fr.frDictionary.html | 2 + ...train_ingestion-audio.IngestionSchema.html | 1 + ...uatrain_ingestion-ocr.IngestionSchema.html | 1 + ...uatrain_ingestion-web.IngestionSchema.html | 1 + ..._mdm.HARDWARE_DEVICE_ONTOLOGY_DEFAULT.html | 2 + ...train_mdm.MEDIA_DISK_ONTOLOGY_DEFAULT.html | 2 + ..._mdm.TEXTILE_GARMENT_ONTOLOGY_DEFAULT.html | 2 + ...mdm.VIRTUAL_KEYCHAIN_ONTOLOGY_DEFAULT.html | 2 + .../_quatrain_skills.writeOutput.html | 2 + .../_quatrain_types.statuses.ACTIVE.html | 1 + .../_quatrain_types.statuses.APPROVED.html | 1 + .../_quatrain_types.statuses.ARCHIVED.html | 1 + .../_quatrain_types.statuses.BLOCKED.html | 1 + .../_quatrain_types.statuses.CANCELLED.html | 1 + .../_quatrain_types.statuses.COMPLETED.html | 1 + .../_quatrain_types.statuses.CONVERTING.html | 1 + .../_quatrain_types.statuses.CREATED.html | 1 + .../_quatrain_types.statuses.DELETABLE.html | 1 + .../_quatrain_types.statuses.DELETED.html | 1 + .../_quatrain_types.statuses.DISABLED.html | 1 + .../_quatrain_types.statuses.DOCUMENT.html | 2 + .../_quatrain_types.statuses.DONE.html | 1 + .../_quatrain_types.statuses.DOWNLOAD.html | 2 + .../_quatrain_types.statuses.DOWNLOADED.html | 1 + .../_quatrain_types.statuses.DOWNLOADING.html | 1 + .../_quatrain_types.statuses.DOWNLOAD_KO.html | 1 + .../_quatrain_types.statuses.DRAFT.html | 1 + .../_quatrain_types.statuses.ERROR.html | 1 + .../_quatrain_types.statuses.EXPIRED.html | 1 + .../_quatrain_types.statuses.FAILED.html | 1 + .../_quatrain_types.statuses.FINISHING.html | 1 + .../_quatrain_types.statuses.GENERATED.html | 1 + .../_quatrain_types.statuses.GENERATING.html | 1 + .../_quatrain_types.statuses.IN_PROGRESS.html | 1 + .../_quatrain_types.statuses.KO.html | 1 + .../_quatrain_types.statuses.OK.html | 1 + .../_quatrain_types.statuses.OPTIMIZING.html | 1 + .../_quatrain_types.statuses.PAUSED.html | 1 + .../_quatrain_types.statuses.PENDING.html | 1 + .../_quatrain_types.statuses.PREPARING.html | 1 + .../_quatrain_types.statuses.PROCESSING.html | 1 + .../_quatrain_types.statuses.PUBLISHED.html | 1 + .../_quatrain_types.statuses.QUEUED.html | 1 + .../_quatrain_types.statuses.REJECTED.html | 1 + .../_quatrain_types.statuses.RUNNING.html | 1 + .../_quatrain_types.statuses.SUCCESS.html | 1 + .../_quatrain_types.statuses.SUSPENDED.html | 1 + .../_quatrain_types.statuses.TRIAGING.html | 1 + .../_quatrain_types.statuses.UNKNOWN.html | 1 + .../_quatrain_types.statuses.UPDATED.html | 1 + .../_quatrain_types.statuses.UPLOAD.html | 2 + .../_quatrain_types.statuses.UPLOADED.html | 1 + .../_quatrain_types.statuses.UPLOADING.html | 1 + .../_quatrain_types.statuses.UPLOAD_KO.html | 1 + .../_quatrain_types.statuses.VALIDATED.html | 1 + .../_quatrain_types.statuses.ZIPPING.html | 1 + .../auth-http-basic/tsconfig.typedoc.json | 7 - packages/auth/src/AbstractOAuthAdapter.ts | 2 +- tsconfig.typedoc.json | 4 - 741 files changed, 16152 insertions(+), 283 deletions(-) create mode 100644 docs/pages/packages/api-server-astro/howto.md create mode 100644 docs/pages/packages/api-server-astro/readme.md create mode 100644 docs/pages/packages/api-xmlrpc/howto.md create mode 100644 docs/pages/packages/api-xmlrpc/readme.md create mode 100644 docs/pages/packages/app/howto.md create mode 100644 docs/pages/packages/auth-github/howto.md create mode 100644 docs/pages/packages/auth-github/readme.md create mode 100644 docs/pages/packages/auth-http-basic/howto.md create mode 100644 docs/pages/packages/auth-http-basic/readme.md create mode 100644 docs/pages/packages/auth-rbac/howto.md create mode 100644 docs/pages/packages/auth-rbac/readme.md create mode 100644 docs/pages/packages/chat/readme.md create mode 100644 docs/pages/packages/cli/howto.md create mode 100644 docs/pages/packages/cli/readme.md create mode 100644 docs/pages/packages/http/howto.md create mode 100644 docs/pages/packages/http/readme.md create mode 100644 docs/pages/packages/i18n-es/howto.md create mode 100644 docs/pages/packages/ingestion/readme.md create mode 100644 docs/pages/packages/mdm/howto.md create mode 100644 docs/pages/packages/mdm/readme.md create mode 100644 docs/pages/packages/okf/howto.md create mode 100644 docs/pages/packages/okf/readme.md create mode 100644 docs/pages/packages/queue-sqlite/howto.md create mode 100644 docs/pages/packages/queue-sqlite/readme.md create mode 100644 docs/pages/packages/searchengine-qmd/howto.md create mode 100644 docs/pages/packages/searchengine-qmd/readme.md create mode 100644 docs/pages/packages/searchengine/howto.md create mode 100644 docs/pages/packages/searchengine/readme.md create mode 100644 docs/pages/packages/skills/howto.md create mode 100644 docs/pages/packages/skills/readme.md create mode 100644 docs/pages/packages/state-machine/howto.md create mode 100644 docs/pages/packages/state-machine/readme.md create mode 100644 docs/pages/packages/types/howto.md create mode 100644 docs/pages/packages/types/readme.md create mode 100644 docs/public/api-reference/classes/_quatrain_api-server-astro.AstroAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_api-server-express.ExpressAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_api-xmlrpc.XmlRpcClient.html create mode 100644 docs/public/api-reference/classes/_quatrain_app.AppBootloader.html create mode 100644 docs/public/api-reference/classes/_quatrain_app.AppInfra.html create mode 100644 docs/public/api-reference/classes/_quatrain_app.CodeGenerator.html create mode 100644 docs/public/api-reference/classes/_quatrain_app.InfraBuilder.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-firebase.FirebaseAuthAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-github.GithubAuthAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-http-basic.AuthBasic.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-oidc.AuthOIDC.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-pocketbase.PocketBaseAuthAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-rbac.AbstractRbacMiddleware.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-rbac.AstroRbacMiddleware.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-rbac.ExpressRbacMiddleware.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-rbac.RbacPolicyEngine.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-rbac.TarpitManager.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth-supabase.SupabaseAuthAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth.AbstractAuthAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth.AbstractOAuthAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth.Auth.html create mode 100644 docs/public/api-reference/classes/_quatrain_auth.AuthenticationError.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-firestore.FirestoreAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-migrations.MigrationManager.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-migrations.MigrationRecord.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-migrations.QuatrainMigrationStorage.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-migrations.SchemaDiffer.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-migrations.SnapshotManager.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-postgres.PostgresAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.AccuweatherRecipe.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.CoinGeckoRecipe.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.OpenWeatherMapRecipe.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-restapi.OpenApiIngestor.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-restapi.RestBackendAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend-sqlite.SQLiteAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.AbstractBackendAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.Backend.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.BackendError.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.BaseRepository.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.CollectionProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.Filter.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.Filters.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.InjectKeywordsMiddleware.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.InjectMetaMiddleware.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.Limits.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.MockAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.PersistedBaseObject.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.PersistedDataObject.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.Query.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.Repository.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.SortAndLimit.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.Sorting.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.User.html create mode 100644 docs/public/api-reference/classes/_quatrain_backend.UserRepository.html create mode 100644 docs/public/api-reference/classes/_quatrain_cache-redis.RedisCacheAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_cache-redis.RedisManager.html create mode 100644 docs/public/api-reference/classes/_quatrain_cache.Cache.html create mode 100644 docs/public/api-reference/classes/_quatrain_cache.CacheInvalidateMiddleware.html create mode 100644 docs/public/api-reference/classes/_quatrain_cache.MediaCacheProxy.html create mode 100644 docs/public/api-reference/classes/_quatrain_chat.ChatController.html create mode 100644 docs/public/api-reference/classes/_quatrain_cli.CliCommand.html create mode 100644 docs/public/api-reference/classes/_quatrain_cli.Command.html create mode 100644 docs/public/api-reference/classes/_quatrain_cli.inquirer.Separator.html create mode 100644 docs/public/api-reference/classes/_quatrain_cli.inquirer.ui.BottomBar.html create mode 100644 docs/public/api-reference/classes/_quatrain_cli.inquirer.ui.Prompt.html create mode 100644 docs/public/api-reference/classes/_quatrain_cloudwrapper-firebase.FirebaseCloudWrapper.html create mode 100644 docs/public/api-reference/classes/_quatrain_cloudwrapper-supabase.SupabaseCloudWrapper.html create mode 100644 docs/public/api-reference/classes/_quatrain_cloudwrapper.AbstractCloudWrapper.html create mode 100644 docs/public/api-reference/classes/_quatrain_cloudwrapper.CloudWrapper.html create mode 100644 docs/public/api-reference/classes/_quatrain_code-github.GithubAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_code.AbstractRepositoryAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_code.CodeRepository.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.AbstractObject.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.ArrayProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.BackendError.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.BadRequestError.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.BaseObject.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.BaseProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.BooleanProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.CollectionProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.Core.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.DataObject.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.DateTimeProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.Entity.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.EnumProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.FileProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.ForbiddenError.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.GoneError.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.HashProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.MapProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.NotFoundError.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.NumberProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.ObjectProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.ObjectUri.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.Property.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.StringProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.UnauthorizedError.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.User.html create mode 100644 docs/public/api-reference/classes/_quatrain_core.ValidationError.html create mode 100644 docs/public/api-reference/classes/_quatrain_git-client.GithubHttpClient.html create mode 100644 docs/public/api-reference/classes/_quatrain_http.HttpHelper.html create mode 100644 docs/public/api-reference/classes/_quatrain_i18n.Translator.html create mode 100644 docs/public/api-reference/classes/_quatrain_ingestion-audio.AudioIngestionAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_ingestion-ocr.OcrIngestionAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_ingestion-video.VideoIngestionAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_ingestion-web.WebIngestionAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_ingestion.AbstractIngestionAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_ingestion.Ingestion.html create mode 100644 docs/public/api-reference/classes/_quatrain_log.AbstractLoggerAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_log.DefaultLoggerAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_log.Log.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmObject.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmObjectRepository.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.Disk.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.Garment.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.HardwareDevice.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.Mdm.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.MdmSpecGroups.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.MockMdmAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.ObjectVendor.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.ObjectVendorRepository.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.Specification.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.SpecificationRepository.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.TeeShirt.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.Vendor.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.VendorRepository.html create mode 100644 docs/public/api-reference/classes/_quatrain_mdm.VirtualKeychain.html create mode 100644 docs/public/api-reference/classes/_quatrain_messaging-firebase.FirebaseMessagingAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_messaging.AbstractMessagingAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_messaging.MessageFormatter.html create mode 100644 docs/public/api-reference/classes/_quatrain_messaging.Messaging.html create mode 100644 docs/public/api-reference/classes/_quatrain_okf.OKFBackendAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_queue-amqp.AmqpQueueAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_queue-aws.SqsAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_queue-sqlite.SQLiteQueueAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_queue.AbstractQueueAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_queue.Queue.html create mode 100644 docs/public/api-reference/classes/_quatrain_searchengine-qmd.QmdSearchEngineAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_searchengine.AbstractSearchEngineAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_searchengine.SearchEngine.html create mode 100644 docs/public/api-reference/classes/_quatrain_skills.AbstractSkillAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_skills.Skills.html create mode 100644 docs/public/api-reference/classes/_quatrain_state-machine.BaseStateMachine.html create mode 100644 docs/public/api-reference/classes/_quatrain_state-machine.ConformanceStateMachine.html create mode 100644 docs/public/api-reference/classes/_quatrain_state-machine.WorkflowStateMachine.html create mode 100644 docs/public/api-reference/classes/_quatrain_storage-firebase.FirebaseStorageAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_storage-git.GitStorageAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_storage-local.LocalStorageAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_storage-s3.S3StorageAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_storage-supabase.SupabaseStorageAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_storage.AbstractStorageAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_storage.MockAdapter.html create mode 100644 docs/public/api-reference/classes/_quatrain_storage.Storage.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.CodeGenerator.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioAgent.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioAuth.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioBackend.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioDeployment.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioEnvironment.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioHistory.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioModel.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioProject.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioProperty.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioSecret.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioStorage.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioTarget.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioView.html create mode 100644 docs/public/api-reference/classes/_quatrain_studio.StudioWidget.html create mode 100644 docs/public/api-reference/classes/_quatrain_testing.Entity.html create mode 100644 docs/public/api-reference/classes/_quatrain_types.BackendError.html create mode 100644 docs/public/api-reference/classes/_quatrain_types.BadRequestError.html create mode 100644 docs/public/api-reference/classes/_quatrain_types.ForbiddenError.html create mode 100644 docs/public/api-reference/classes/_quatrain_types.GoneError.html create mode 100644 docs/public/api-reference/classes/_quatrain_types.NotFoundError.html create mode 100644 docs/public/api-reference/classes/_quatrain_types.ObjectUri.html create mode 100644 docs/public/api-reference/classes/_quatrain_types.ResourceError.html create mode 100644 docs/public/api-reference/classes/_quatrain_types.UnauthorizedError.html create mode 100644 docs/public/api-reference/classes/_quatrain_types.ValidationError.html create mode 100644 docs/public/api-reference/classes/_quatrain_worker.FileSystem.html create mode 100644 docs/public/api-reference/classes/_quatrain_worker.Helpers.html create mode 100644 docs/public/api-reference/classes/_quatrain_worker.Worker.html create mode 100644 docs/public/api-reference/documents/api-server-astro_HOWTO.html create mode 100644 docs/public/api-reference/documents/api-server-astro_README.html create mode 100644 docs/public/api-reference/documents/api-xmlrpc_HOWTO.html create mode 100644 docs/public/api-reference/documents/api-xmlrpc_README.html create mode 100644 docs/public/api-reference/documents/app_HOWTO.html create mode 100644 docs/public/api-reference/documents/auth-github_HOWTO.html create mode 100644 docs/public/api-reference/documents/auth-github_README.html create mode 100644 docs/public/api-reference/documents/auth-http-basic_HOWTO.html create mode 100644 docs/public/api-reference/documents/auth-http-basic_README.html create mode 100644 docs/public/api-reference/documents/auth-rbac_HOWTO.html create mode 100644 docs/public/api-reference/documents/auth-rbac_README.html create mode 100644 docs/public/api-reference/documents/chat_README.html create mode 100644 docs/public/api-reference/documents/cli_HOWTO.html create mode 100644 docs/public/api-reference/documents/cli_README.html delete mode 100644 docs/public/api-reference/documents/core-cli_HOWTO.html delete mode 100644 docs/public/api-reference/documents/core-cli_README.html create mode 100644 docs/public/api-reference/documents/http_HOWTO.html create mode 100644 docs/public/api-reference/documents/http_README.html create mode 100644 docs/public/api-reference/documents/i18n-es_HOWTO.html create mode 100644 docs/public/api-reference/documents/ingestion_README.html create mode 100644 docs/public/api-reference/documents/mdm_HOWTO.html create mode 100644 docs/public/api-reference/documents/mdm_README.html create mode 100644 docs/public/api-reference/documents/okf_HOWTO.html create mode 100644 docs/public/api-reference/documents/okf_README.html create mode 100644 docs/public/api-reference/documents/queue-sqlite_HOWTO.html create mode 100644 docs/public/api-reference/documents/queue-sqlite_README.html create mode 100644 docs/public/api-reference/documents/searchengine-qmd_HOWTO.html create mode 100644 docs/public/api-reference/documents/searchengine-qmd_README.html create mode 100644 docs/public/api-reference/documents/searchengine_HOWTO.html create mode 100644 docs/public/api-reference/documents/searchengine_README.html create mode 100644 docs/public/api-reference/documents/skills_HOWTO.html create mode 100644 docs/public/api-reference/documents/skills_README.html create mode 100644 docs/public/api-reference/documents/state-machine_HOWTO.html create mode 100644 docs/public/api-reference/documents/state-machine_README.html create mode 100644 docs/public/api-reference/documents/types_HOWTO.html create mode 100644 docs/public/api-reference/documents/types_README.html create mode 100644 docs/public/api-reference/enums/_quatrain_auth.AuthAction.html create mode 100644 docs/public/api-reference/enums/_quatrain_backend.BackendAction.html create mode 100644 docs/public/api-reference/enums/_quatrain_backend.OperatorKeys.html create mode 100644 docs/public/api-reference/enums/_quatrain_core.returnAs.html create mode 100644 docs/public/api-reference/enums/_quatrain_http.HttpHeader.html create mode 100644 docs/public/api-reference/enums/_quatrain_http.HttpMethod.html create mode 100644 docs/public/api-reference/enums/_quatrain_http.HttpStatus.html create mode 100644 docs/public/api-reference/enums/_quatrain_log.LogLevel.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.AuthMechanism.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.CommTechnology.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.GarmentSize.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MdmAuthMechanism.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MdmCommTechnology.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MdmLifecycleState.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MdmMediaDiskFormat.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MdmNature.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MdmPowerSource.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MdmSensorBus.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MdmServiceCategory.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MdmStandardOntologies.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.MediaDiskFormat.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.PowerSource.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.SensorBus.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.TextileColor.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.TextileMaterial.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.TextileWashCare.html create mode 100644 docs/public/api-reference/enums/_quatrain_mdm.VinylRpm.html create mode 100644 docs/public/api-reference/enums/_quatrain_worker.ModeEnum.html create mode 100644 docs/public/api-reference/functions/_quatrain_auth-github.GithubAuthApi.html create mode 100644 docs/public/api-reference/functions/_quatrain_auth-rbac.mapHttpMethodToAction.html create mode 100644 docs/public/api-reference/functions/_quatrain_backend.asyncContextMiddleware.html create mode 100644 docs/public/api-reference/functions/_quatrain_cli.askChoice.html create mode 100644 docs/public/api-reference/functions/_quatrain_cli.askConfirm.html create mode 100644 docs/public/api-reference/functions/_quatrain_cli.askInput.html create mode 100644 docs/public/api-reference/functions/_quatrain_gateway-upstream-express.createGatewayRouter.html create mode 100644 docs/public/api-reference/functions/_quatrain_testing.DataGenerator.html create mode 100644 docs/public/api-reference/functions/_quatrain_testing.createEntity.html create mode 100644 docs/public/api-reference/functions/_quatrain_testing.createUser.html create mode 100644 docs/public/api-reference/functions/_quatrain_testing.createUsers.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_api-xmlrpc.XmlRpcClientOptions.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_app.AppCompositionInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_app.AppContentInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_app.ComposeFile.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_app.ComposeService.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_app.PWAContentInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.AstroLikeContext.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.AstroRbacOptions.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.EntityFieldRules.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.ExpressLikeRequest.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.ExpressLikeResponse.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.ExpressRbacOptions.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.RbacRequestContext.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.RbacUserContext.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.RoleDefinition.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.RouteEvaluationResult.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.RouteRule.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth-rbac.TarpitRuleConfig.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth.AuthInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_auth.AuthParameters.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend-migrations.MigrationOptions.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend-restapi-recipes.RestApiRecipe.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend-restapi.OpenApiIngestorOptions.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend-restapi.RestAdapterOptions.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend.BackendInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend.BackendMiddleware.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend.BackendParameters.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend.BackendRecordType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend.DataObjectClass.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend.InjectKeywordsMiddlewareParams.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend.InjectMetaMiddlewareParams.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_backend.SchemaDelta.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cache.CacheAdapterInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_chat.ChatDocument.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_chat.ChatSessionConfig.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cli.inquirer.prompts.FailedPromptStateData.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cli.inquirer.prompts.PromptBase.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cli.inquirer.prompts.PromptConstructor.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cli.inquirer.prompts.PromptEventPipes.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cli.inquirer.prompts.PromptStateData.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cli.inquirer.prompts.SuccessfulPromptStateData.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cli.inquirer.ui.BottomBarOptions.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cli.inquirer.ui.FetchedAnswer.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cloudwrapper.DatabaseTriggerType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cloudwrapper.StorageEventPayloadType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_cloudwrapper.StorageTriggerType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_code.CommitFile.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.ArrayPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.BaseObjectClass.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.BaseObjectType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.BasePropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.BooleanPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.CollectionPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.DataObjectClass.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.DataObjectParams.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.DateTimePropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.EntityType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.EnumPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.FilePropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.HashPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.MapPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.Meta.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.NumberPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.ObjectPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.StringPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_core.UserType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_gateway-upstream-express.GatewayRouterOptions.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_gateway-upstream-express.MediaResolution.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_http.ApiRequest.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_http.ApiResponse.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_i18n.CoreDictionary.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_i18n.SystemStatusesLabels.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_i18n.SystemTableLabels.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_ingestion.IngestionResult.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.HardwareDeviceSpecInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.MdmArchetypeSpec.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.MdmCommCapabilityInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.MdmHardwareCapabilitiesInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.MdmObjectTypeDefinition.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.MdmPowerCapabilityInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.MdmSensorBusCapabilityInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.MdmServiceCapabilitiesInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.MdmVirtualCapabilitiesInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.MediaDiskSpecInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.OntologyMappingInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.TextileGarmentSpecInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_mdm.VirtualKeychainSpecInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_messaging.EmailCapableAdapter.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_messaging.MessageType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_messaging.MessagingParameters.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_messaging.NotificationCapableAdapter.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_messaging.NotificationMessage.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_messaging.TextCapableAdapter.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_queue.ConfigParameters.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_queue.QueueParameters.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_searchengine-qmd.QmdEngineConfig.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_searchengine.SearchDocument.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_searchengine.SearchEngineParameters.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_searchengine.SearchQueryOptions.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_searchengine.SearchResultItem.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_skills.ApiSkillDefinition.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_skills.RemoteMethodDefinition.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_skills.SkillApiClientConfig.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_skills.SkillField.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_skills.SkillManifest.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_skills.SkillRegistration.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_skills.ToolDefinition.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_skills.ToolParameter.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_state-machine.ConformanceRule.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_state-machine.WorkflowTransition.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_storage.BlobMediaType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_storage.BlobType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_storage.BucketStatsType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_storage.DownloadFileMetaType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_storage.FileType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_storage.StorageAdapterInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_storage.StorageParameters.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioAuthType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioBackendType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioDeploymentType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioEnvironmentType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioHistoryType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioModelType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioProjectType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioPropertyType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioSecretType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioStorageType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioTargetType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioViewType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_studio.StudioWidgetType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_types.AppCompositionInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_types.AppContentInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_types.BaseObjectType.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_types.PWAContentInterface.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_worker.HandlerParameters.html create mode 100644 docs/public/api-reference/interfaces/_quatrain_worker.MessagehandlerParameters.html create mode 100644 docs/public/api-reference/modules/_quatrain_api-server-astro.html create mode 100644 docs/public/api-reference/modules/_quatrain_api-server-express.html create mode 100644 docs/public/api-reference/modules/_quatrain_api-xmlrpc.html create mode 100644 docs/public/api-reference/modules/_quatrain_app.html create mode 100644 docs/public/api-reference/modules/_quatrain_auth-firebase.html create mode 100644 docs/public/api-reference/modules/_quatrain_auth-github.html create mode 100644 docs/public/api-reference/modules/_quatrain_auth-http-basic.html create mode 100644 docs/public/api-reference/modules/_quatrain_auth-oidc.html create mode 100644 docs/public/api-reference/modules/_quatrain_auth-pocketbase.html create mode 100644 docs/public/api-reference/modules/_quatrain_auth-rbac.html create mode 100644 docs/public/api-reference/modules/_quatrain_auth-supabase.html create mode 100644 docs/public/api-reference/modules/_quatrain_auth.html create mode 100644 docs/public/api-reference/modules/_quatrain_backend-firestore.html create mode 100644 docs/public/api-reference/modules/_quatrain_backend-migrations.html create mode 100644 docs/public/api-reference/modules/_quatrain_backend-postgres.html create mode 100644 docs/public/api-reference/modules/_quatrain_backend-restapi-recipes.html create mode 100644 docs/public/api-reference/modules/_quatrain_backend-restapi.html create mode 100644 docs/public/api-reference/modules/_quatrain_backend-sqlite.html create mode 100644 docs/public/api-reference/modules/_quatrain_backend.CollectionHierarchy.html create mode 100644 docs/public/api-reference/modules/_quatrain_backend.html create mode 100644 docs/public/api-reference/modules/_quatrain_cache-redis.html create mode 100644 docs/public/api-reference/modules/_quatrain_cache.html create mode 100644 docs/public/api-reference/modules/_quatrain_chat.html create mode 100644 docs/public/api-reference/modules/_quatrain_cli.html create mode 100644 docs/public/api-reference/modules/_quatrain_cli.inquirer.html create mode 100644 docs/public/api-reference/modules/_quatrain_cli.inquirer.prompts.html create mode 100644 docs/public/api-reference/modules/_quatrain_cli.inquirer.ui.html create mode 100644 docs/public/api-reference/modules/_quatrain_cloudwrapper-firebase.html create mode 100644 docs/public/api-reference/modules/_quatrain_cloudwrapper-supabase.html create mode 100644 docs/public/api-reference/modules/_quatrain_cloudwrapper.html create mode 100644 docs/public/api-reference/modules/_quatrain_code-github.html create mode 100644 docs/public/api-reference/modules/_quatrain_code.html create mode 100644 docs/public/api-reference/modules/_quatrain_core.html create mode 100644 docs/public/api-reference/modules/_quatrain_core.htmlType.html create mode 100644 docs/public/api-reference/modules/_quatrain_core.statuses.html create mode 100644 docs/public/api-reference/modules/_quatrain_gateway-upstream-express.html create mode 100644 docs/public/api-reference/modules/_quatrain_git-client.html create mode 100644 docs/public/api-reference/modules/_quatrain_http.html create mode 100644 docs/public/api-reference/modules/_quatrain_i18n-en.html create mode 100644 docs/public/api-reference/modules/_quatrain_i18n-es.html create mode 100644 docs/public/api-reference/modules/_quatrain_i18n-fr.html create mode 100644 docs/public/api-reference/modules/_quatrain_i18n.html create mode 100644 docs/public/api-reference/modules/_quatrain_ingestion-audio.html create mode 100644 docs/public/api-reference/modules/_quatrain_ingestion-ocr.html create mode 100644 docs/public/api-reference/modules/_quatrain_ingestion-video.html create mode 100644 docs/public/api-reference/modules/_quatrain_ingestion-web.html create mode 100644 docs/public/api-reference/modules/_quatrain_ingestion.html create mode 100644 docs/public/api-reference/modules/_quatrain_log.html create mode 100644 docs/public/api-reference/modules/_quatrain_mdm.html create mode 100644 docs/public/api-reference/modules/_quatrain_messaging-firebase.html create mode 100644 docs/public/api-reference/modules/_quatrain_messaging.html create mode 100644 docs/public/api-reference/modules/_quatrain_okf.html create mode 100644 docs/public/api-reference/modules/_quatrain_queue-amqp.html create mode 100644 docs/public/api-reference/modules/_quatrain_queue-aws.html create mode 100644 docs/public/api-reference/modules/_quatrain_queue-gcp.html create mode 100644 docs/public/api-reference/modules/_quatrain_queue-sqlite.html create mode 100644 docs/public/api-reference/modules/_quatrain_queue.html create mode 100644 docs/public/api-reference/modules/_quatrain_searchengine-qmd.html create mode 100644 docs/public/api-reference/modules/_quatrain_searchengine.html create mode 100644 docs/public/api-reference/modules/_quatrain_skills.html create mode 100644 docs/public/api-reference/modules/_quatrain_state-machine.html create mode 100644 docs/public/api-reference/modules/_quatrain_storage-firebase.html create mode 100644 docs/public/api-reference/modules/_quatrain_storage-git.html create mode 100644 docs/public/api-reference/modules/_quatrain_storage-local.html create mode 100644 docs/public/api-reference/modules/_quatrain_storage-s3.html create mode 100644 docs/public/api-reference/modules/_quatrain_storage-supabase.html create mode 100644 docs/public/api-reference/modules/_quatrain_storage.html create mode 100644 docs/public/api-reference/modules/_quatrain_studio.html create mode 100644 docs/public/api-reference/modules/_quatrain_testing.html create mode 100644 docs/public/api-reference/modules/_quatrain_types.html create mode 100644 docs/public/api-reference/modules/_quatrain_types.statuses.html create mode 100644 docs/public/api-reference/modules/_quatrain_worker.html create mode 100644 docs/public/api-reference/types/_quatrain_app.AdapterConfigSpec.html create mode 100644 docs/public/api-reference/types/_quatrain_app.PivotAdaptersSpec.html create mode 100644 docs/public/api-reference/types/_quatrain_auth-rbac.AccessDecision.html create mode 100644 docs/public/api-reference/types/_quatrain_auth-rbac.AstroLikeMiddlewareNext.html create mode 100644 docs/public/api-reference/types/_quatrain_auth-rbac.ExpressLikeNextFunction.html create mode 100644 docs/public/api-reference/types/_quatrain_auth-rbac.FieldAccessMode.html create mode 100644 docs/public/api-reference/types/_quatrain_auth-rbac.HttpMethod.html create mode 100644 docs/public/api-reference/types/_quatrain_auth-rbac.RbacAction.html create mode 100644 docs/public/api-reference/types/_quatrain_auth-rbac.SubjectType.html create mode 100644 docs/public/api-reference/types/_quatrain_auth.AuthParametersKeys.html create mode 100644 docs/public/api-reference/types/_quatrain_backend-restapi.QuerySerializer.html create mode 100644 docs/public/api-reference/types/_quatrain_backend.QueryMetaType.html create mode 100644 docs/public/api-reference/types/_quatrain_backend.QueryResultType.html create mode 100644 docs/public/api-reference/types/_quatrain_cache.PrefixResolver.html create mode 100644 docs/public/api-reference/types/_quatrain_cli.inquirer.prompts.PromptCollection.html create mode 100644 docs/public/api-reference/types/_quatrain_cli.inquirer.prompts.PromptOptions.html create mode 100644 docs/public/api-reference/types/_quatrain_cli.inquirer.prompts.PromptState.html create mode 100644 docs/public/api-reference/types/_quatrain_cli.inquirer.ui.FetchedQuestion.html create mode 100644 docs/public/api-reference/types/_quatrain_core.DataObjectProperties.html create mode 100644 docs/public/api-reference/types/_quatrain_core.Persisted.html create mode 100644 docs/public/api-reference/types/_quatrain_core.Proxy.html create mode 100644 docs/public/api-reference/types/_quatrain_core.htmlType.PropertyHTMLType.html create mode 100644 docs/public/api-reference/types/_quatrain_http.ApiHandler.html create mode 100644 docs/public/api-reference/types/_quatrain_http.ApiMiddleware.html create mode 100644 docs/public/api-reference/types/_quatrain_mdm.MdmObjectConstructor.html create mode 100644 docs/public/api-reference/types/_quatrain_messaging.MessagingRecipient.html create mode 100644 docs/public/api-reference/types/_quatrain_skills.ApiClientType.html create mode 100644 docs/public/api-reference/types/_quatrain_state-machine.ActionFunction.html create mode 100644 docs/public/api-reference/types/_quatrain_state-machine.ConformanceState.html create mode 100644 docs/public/api-reference/types/_quatrain_state-machine.GuardFunction.html create mode 100644 docs/public/api-reference/types/_quatrain_storage.FileResponseLinkType.html create mode 100644 docs/public/api-reference/types/_quatrain_storage.FileResponseUrlType.html create mode 100644 docs/public/api-reference/types/_quatrain_storage.StorageParametersKeys.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioAuthProperties.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioBackendDef.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioDeploymentDef.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioEnvironmentProperties.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioHistoryDef.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioModelProperties.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioProjectProperties.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioPropertyDef.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioSecretProperties.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioStorageProperties.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioViewDef.html create mode 100644 docs/public/api-reference/types/_quatrain_studio.StudioWidgetDef.html create mode 100644 docs/public/api-reference/types/_quatrain_types.AdapterConfigSpec.html create mode 100644 docs/public/api-reference/types/_quatrain_types.PivotAdaptersSpec.html create mode 100644 docs/public/api-reference/types/_quatrain_types.ReferenceType.html create mode 100644 docs/public/api-reference/variables/_quatrain_backend.BackendContext.html create mode 100644 docs/public/api-reference/variables/_quatrain_backend.CollectionHierarchy.STANDARD.html create mode 100644 docs/public/api-reference/variables/_quatrain_backend.CollectionHierarchy.SUBCOLLECTION.html create mode 100644 docs/public/api-reference/variables/_quatrain_backend.CollectionHierarchy.SUBCOLLECTION_GROUP.html create mode 100644 docs/public/api-reference/variables/_quatrain_cli.inquirer.createPromptModule.html create mode 100644 docs/public/api-reference/variables/_quatrain_cli.inquirer.prompt.html create mode 100644 docs/public/api-reference/variables/_quatrain_cli.inquirer.registerPrompt.html create mode 100644 docs/public/api-reference/variables/_quatrain_cli.inquirer.restoreDefaultPrompts.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.BaseObjectProperties.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.UserProperties.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.BIRTHDAY.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.CHECKBOX.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.EMAIL.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.FAMILY_NAME.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.FILE.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.GENDER.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.GIVEN_NAME.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.HIDDEN.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.NAME.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.NUMBER.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.OFF.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.ORG.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.PASSWORD.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.SELECT.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.TEXT.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.htmlType.TEXTAREA.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.ACTIVE.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.APPROVED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.ARCHIVED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.BLOCKED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.CANCELLED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.COMPLETED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.CONVERTING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.CREATED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DELETABLE.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DELETED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DISABLED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DOCUMENT.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DONE.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DOWNLOAD.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DOWNLOADED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DOWNLOADING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DOWNLOAD_KO.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.DRAFT.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.ERROR.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.EXPIRED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.FAILED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.FINISHING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.GENERATED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.GENERATING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.IN_PROGRESS.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.KO.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.OK.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.OPTIMIZING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.PAUSED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.PENDING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.PREPARING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.PROCESSING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.PUBLISHED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.QUEUED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.REJECTED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.RUNNING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.SUCCESS.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.SUSPENDED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.TRIAGING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.UNKNOWN.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.UPDATED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.UPLOAD.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.UPLOADED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.UPLOADING.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.UPLOAD_KO.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.VALIDATED.html create mode 100644 docs/public/api-reference/variables/_quatrain_core.statuses.ZIPPING.html create mode 100644 docs/public/api-reference/variables/_quatrain_i18n-en.enDictionary.html create mode 100644 docs/public/api-reference/variables/_quatrain_i18n-es.esDictionary.html create mode 100644 docs/public/api-reference/variables/_quatrain_i18n-fr.frDictionary.html create mode 100644 docs/public/api-reference/variables/_quatrain_ingestion-audio.IngestionSchema.html create mode 100644 docs/public/api-reference/variables/_quatrain_ingestion-ocr.IngestionSchema.html create mode 100644 docs/public/api-reference/variables/_quatrain_ingestion-web.IngestionSchema.html create mode 100644 docs/public/api-reference/variables/_quatrain_mdm.HARDWARE_DEVICE_ONTOLOGY_DEFAULT.html create mode 100644 docs/public/api-reference/variables/_quatrain_mdm.MEDIA_DISK_ONTOLOGY_DEFAULT.html create mode 100644 docs/public/api-reference/variables/_quatrain_mdm.TEXTILE_GARMENT_ONTOLOGY_DEFAULT.html create mode 100644 docs/public/api-reference/variables/_quatrain_mdm.VIRTUAL_KEYCHAIN_ONTOLOGY_DEFAULT.html create mode 100644 docs/public/api-reference/variables/_quatrain_skills.writeOutput.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.ACTIVE.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.APPROVED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.ARCHIVED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.BLOCKED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.CANCELLED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.COMPLETED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.CONVERTING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.CREATED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DELETABLE.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DELETED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DISABLED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DOCUMENT.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DONE.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DOWNLOAD.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DOWNLOADED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DOWNLOADING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DOWNLOAD_KO.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.DRAFT.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.ERROR.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.EXPIRED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.FAILED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.FINISHING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.GENERATED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.GENERATING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.IN_PROGRESS.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.KO.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.OK.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.OPTIMIZING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.PAUSED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.PENDING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.PREPARING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.PROCESSING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.PUBLISHED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.QUEUED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.REJECTED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.RUNNING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.SUCCESS.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.SUSPENDED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.TRIAGING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.UNKNOWN.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.UPDATED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.UPLOAD.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.UPLOADED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.UPLOADING.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.UPLOAD_KO.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.VALIDATED.html create mode 100644 docs/public/api-reference/variables/_quatrain_types.statuses.ZIPPING.html delete mode 100644 packages/auth-http-basic/tsconfig.typedoc.json delete mode 100644 tsconfig.typedoc.json diff --git a/docs/pages/packages/api-server-astro/howto.md b/docs/pages/packages/api-server-astro/howto.md new file mode 100644 index 00000000..38056669 --- /dev/null +++ b/docs/pages/packages/api-server-astro/howto.md @@ -0,0 +1,35 @@ +# HOWTO: Using @quatrain/api-server-astro + +This document guides you on routing API endpoints through Astro. + +--- + +## 1. Catch-all Routing in Astro + +Create a catch-all server endpoint in Astro (e.g. `src/pages/api/[...path].ts`) and bind the AstroAdapter: + +```typescript +import { AstroAdapter } from '@quatrain/api-server-astro'; +import { setupApiServer } from '../your-api-setup'; // Your API router configuration + +const adapter = new AstroAdapter('/api'); +setupApiServer(adapter); + +// Export Astro APIRoute handlers +export const ALL = adapter.handle(); +``` + +## 2. Wrapping a single handler + +If you only want to wrap a single Quatrain API handler as an Astro APIRoute: + +```typescript +import { AstroAdapter } from '@quatrain/api-server-astro'; +import { ApiRequest, ApiResponse } from '@quatrain/api'; + +const myHandler = async (req: ApiRequest, res: ApiResponse) => { + res.json({ message: 'Hello from Astro!' }); +}; + +export const GET = AstroAdapter.wrap(myHandler); +``` diff --git a/docs/pages/packages/api-server-astro/readme.md b/docs/pages/packages/api-server-astro/readme.md new file mode 100644 index 00000000..410e5938 --- /dev/null +++ b/docs/pages/packages/api-server-astro/readme.md @@ -0,0 +1,19 @@ +# @quatrain/api-server-astro + +Astro Adapter for the Quatrain API Server. It bridges the Quatrain API server interface with the web standard Request/Response API used natively by Astro endpoints. + +## Features + +- **Standard Astro APIRoute compatibility**: Easily host Quatrain API handlers inside Astro server routes. +- **Express-like Route Parsing**: Supports catch-all routes and extracts route parameters dynamically. +- **Response Recording**: Records Quatrain API responses and translates them to native Astro standard Responses. + +--- + +## Getting Started + +Refer to `HOWTO.md` for integration details. + +## License + +AGPL-3.0-only diff --git a/docs/pages/packages/api-xmlrpc/howto.md b/docs/pages/packages/api-xmlrpc/howto.md new file mode 100644 index 00000000..58f38335 --- /dev/null +++ b/docs/pages/packages/api-xmlrpc/howto.md @@ -0,0 +1,33 @@ +# HOWTO: Using @quatrain/api-xmlrpc + +This document shows how to initialize and use the XML-RPC client wrapper. + +--- + +## 1. Initializing the Client + +Provide target connection options to instantiate `XmlRpcClient`: + +```typescript +import { XmlRpcClient } from '@quatrain/api-xmlrpc'; + +const client = new XmlRpcClient({ + host: 'odoo.example.com', + port: 443, + path: '/xmlrpc/2/common', + secure: true +}); +``` + +## 2. Invoking Remote Methods + +Use the `methodCall` method to execute calls asynchronously. It returns a Promise: + +```typescript +try { + const version = await client.methodCall('version', []); + console.log('Odoo Version Details:', version); +} catch (err) { + console.error('Connection failed:', err); +} +``` diff --git a/docs/pages/packages/api-xmlrpc/readme.md b/docs/pages/packages/api-xmlrpc/readme.md new file mode 100644 index 00000000..54b896e2 --- /dev/null +++ b/docs/pages/packages/api-xmlrpc/readme.md @@ -0,0 +1,19 @@ +# @quatrain/api-xmlrpc + +An XML-RPC client package designed for the Quatrain Core framework. It provides a simple, Promise-based wrapper around the XML-RPC protocol. + +## Features + +- **Promise-based API**: Replaces node-style callback interfaces with modern async/await patterns. +- **Support for secure connections**: Easily toggle secure HTTPS execution. +- **Seamless integration**: Built specifically to connect with external systems utilizing the XML-RPC protocol (e.g. Odoo). + +--- + +## Getting Started + +Refer to the `HOWTO.md` file for code examples and configuration details. + +## License + +AGPL-3.0-only diff --git a/docs/pages/packages/app/howto.md b/docs/pages/packages/app/howto.md new file mode 100644 index 00000000..e3dbebd0 --- /dev/null +++ b/docs/pages/packages/app/howto.md @@ -0,0 +1,162 @@ +# Application Composition & Ports/Adapters Guide (@quatrain/app) + +This document provides a comprehensive guide on the **Hexagonal Application Composition Model** defined in `@quatrain/types` and orchestrated via `@quatrain/app`. + +--- + +## 1. Architectural Philosophy + +Quatrain applications strictly follow the **Hexagonal Architecture (Ports & Adapters)** design pattern: + +- **The Deliverable Application Payload (`AppContentInterface`)**: Represents the user-facing application deliverable (such as a PWA, a Web Bundle, a CLI tool, or Native Assets). It is 100% agnostic to deployment topology. +- **Pivot Classes (`Ai`, `Backend`, `Storage`, `Auth`, `Queue`, `Messaging`)**: Central registries and lifecycle managers in Quatrain Core that can hold single or multiple named adapter instances. +- **Composition (`AppCompositionInterface`)**: A typed, isomorphic contract that glues a deliverable application payload with its runtime context of Quatrain infrastructure adapters. + +Whether an application runs as a **Local Single-User App**, an **Offline Mobile App (Native WebView Shell)**, or a **Multi-Tenant Cloud SaaS**, the application core remains unchanged; only the context of bound infrastructure adapters changes. + +--- + +## 2. Interface Definitions + +All shared composition contracts reside in `@quatrain/types` to ensure isomorphic sharing across both frontend (browser/WebView) and backend (Node/Bun) environments with zero bundle bloat: + +```typescript +import type { + AppCompositionInterface, + PWAContentInterface, + PivotAdaptersSpec, + AdapterConfigSpec +} from '@quatrain/types'; +``` + +### Key Interfaces + +- **`AdapterConfigSpec`**: Specifies a single adapter package, class, and configuration options. +- **`PivotAdaptersSpec`**: Configures either a single default adapter or a map of named adapters for a pivot class (e.g. `ai.default`, `ai.transcription`). +- **`AppContentInterface`**: Base interface describing any deliverable payload (`pwa`, `web-bundle`, `cli`, `native`). +- **`PWAContentInterface`**: Specialized payload contract for Progressive Web Applications. +- **`AppCompositionInterface`**: Isomorphic glue binding `TContent` with its pivot adapters and domain config. + +--- + +## 3. Real-World Case Study 1: Modaka (Second Brain Copilot) + +**Modaka** is a local-first personal knowledge copilot. It exports its composition using `AppCompositionInterface`. + +### A. Composition Specification + +```typescript +// modaka/src/composition.ts +import type { AppCompositionInterface, PWAContentInterface } from '@quatrain/types'; + +export const modakaComposition: AppCompositionInterface = { + content: { + type: 'pwa', + name: 'modaka', + version: '1.0.0', + distPath: './dist', + manifest: { + name: 'Modaka Second Brain', + short_name: 'Modaka', + theme_color: '#090d16', + background_color: '#090d16' + } + }, + adapters: { + // Pivot class Ai holding Gemini text generation and Whisper audio transcription + ai: { + default: { package: '@quatrain/ai-gemini', adapter: 'GeminiAdapter' }, + transcription: { package: '@quatrain/ai-whisper', adapter: 'WhisperAdapter' } + }, + // Local SQLite backend for desktop/local deployment + backend: { package: '@quatrain/backend-sqlite', adapter: 'SQLiteAdapter' }, + // Local disk storage for OKF documents + storage: { package: '@quatrain/storage-local', adapter: 'LocalStorageAdapter' }, + // GitHub OAuth authentication provider + auth: { package: '@quatrain/auth-github', adapter: 'GitHubAuthAdapter' } + }, + config: { + okfRoot: './second-brain-data/content', + defaultCategory: 'inbox' + } +}; +``` + +### B. Deployment Modalities for Modaka + +1. **Local Desktop / PWA Mode**: Bootstrapped via `AppBootloader.bootstrap()` with local disk storage and SQLite. +2. **Mobile App Mode (`modaka-app`)**: Embedded inside an Expo React Native `WebView` shell. The mobile shell injects a native bridge adapter (`expo-sqlite`, `expo-audio`) into the composition context without changing Modaka's UI or domain code. + +--- + +## 4. Real-World Case Study 2: Hey Brad (Agronomic AI Companion) + +**Hey Brad** is a verticalized domain application built for the agricultural sector. It extends the knowledge engine by injecting agricultural system prompts, domain-specific schemas, and agricultural UI styling while connecting to cloud multi-tenant adapters. + +### A. Composition Specification + +```typescript +// hey-brad/src/composition.ts +import type { AppCompositionInterface, PWAContentInterface } from '@quatrain/types'; + +export const heyBradComposition: AppCompositionInterface = { + content: { + type: 'pwa', + name: 'hey-brad', + version: '1.0.0', + distPath: './dist', + theme: { + primaryColor: '#2e7d32', // Agronomic green + accentColor: '#81c784' + }, + manifest: { + name: 'Hey Brad — Agricultural AI Companion', + short_name: 'HeyBrad' + } + }, + adapters: { + // Multi-tenant Cloud AI configuration + ai: { + default: { package: '@quatrain/ai-gemini', adapter: 'GeminiAdapter' } + }, + // Cloud PostgreSQL backend for tenant data + backend: { package: '@quatrain/backend-postgres', adapter: 'PostgreSQLAdapter' }, + // Managed S3 bucket storage for farm documents and images + storage: { package: '@quatrain/storage-s3', adapter: 'S3StorageAdapter' }, + // Supabase / OIDC authentication for agricultural enterprise tenants + auth: { package: '@quatrain/auth-supabase', adapter: 'SupabaseAuthAdapter' } + }, + config: { + domain: 'agronomy', + systemPromptPath: './prompts/agronomic-rules.yaml', + supportedCrops: ['wheat', 'corn', 'vineyard', 'fruit-trees'] + } +}; +``` + +--- + +## 5. Bootstrapping a Composition + +To bootstrap any composition at runtime, pass the configuration to `AppBootloader`: + +```typescript +import { AppBootloader } from '@quatrain/app'; +import { modakaComposition } from './composition'; + +async function main() { + // Bootstraps all declared adapters into Quatrain Core singletons + await AppBootloader.bootstrapFromComposition(modakaComposition); + console.log('Application environment initialized successfully.'); +} + +main(); +``` + +--- + +## 6. Summary of Architectural Benefits + +- **Isomorphic Types**: Shared contracts reside in `@quatrain/types`, ensuring zero bundle weight overhead on client builds. +- **Multi-Adapter Support**: Pivot classes (`Ai`, `Storage`, etc.) can host multiple named adapters for specialized sub-tasks. +- **Total Decoupling**: Products (`modaka`, `hey-brad`) remain pure PWA/Web deliverables; infrastructure modalities (Mobile, SaaS, Standalone) are simply contexts of adapters glued to the deliverable payload. diff --git a/docs/pages/packages/auth-github/howto.md b/docs/pages/packages/auth-github/howto.md new file mode 100644 index 00000000..879ce4c9 --- /dev/null +++ b/docs/pages/packages/auth-github/howto.md @@ -0,0 +1,83 @@ +# HOWTO: Using `@quatrain/auth-github` + +This guide explains how to configure and use the GitHub OAuth adapter and its associated endpoints. + +--- + +## 1. Registering the Adapter + +First, initialize the adapter using your GitHub OAuth application credentials, and register it to the global `Auth` manager: + +```typescript +import { Auth } from '@quatrain/auth' +import { GithubAuthAdapter } from '@quatrain/auth-github' + +const githubAdapter = GithubAuthAdapter.factory({ + clientId: process.env.GITHUB_CLIENT_ID, + clientSecret: process.env.GITHUB_CLIENT_SECRET, +}) + +if (githubAdapter) { + Auth.addProvider(githubAdapter, 'github') +} +``` + +--- + +## 2. Registering Pluggable Router Endpoints + +To expose the login and callback routes, register them on your `ServerAdapter` using `Auth.registerEndpoints()`. This dynamically collects endpoints from all registered adapters and namespaces them. + +### Web Server (Astro/Express) Example + +```typescript +import { Auth } from '@quatrain/auth' +import { AstroAdapter } from '@quatrain/api-server-astro' + +const server = new AstroAdapter() + +// Register all endpoints under /api/auth/[provider_alias] +Auth.registerEndpoints(server, '/api/auth') +``` + +This will automatically mount: +- `GET /api/auth/github/login` -> Redirects the browser to GitHub login. +- `GET /api/auth/github/callback` -> Handles the OAuth code exchange. + +--- + +## 3. Configuring Mobile Deep-Link Redirection + +If the API is consumed by a mobile application, configure the `appScheme` option during server initialization: + +```typescript +Auth.addProvider(githubAdapter, 'github') + +// Inside your API setup, specify the target app scheme +server.addEndpoint(githubAdapter.getEndpointHandler(), '/api/auth/github', { + appScheme: 'modaka' // Will redirect to modaka://auth/github/callback?token=... +}) +``` + +Alternatively, you can pass the app scheme dynamically in the login/callback query string: +`GET /api/auth/github/callback?code=CODE&app_scheme=modaka` + +--- + +## 4. Custom GitHub Repository Actions + +The adapter includes helper functions to check and create repositories directly: + +```typescript +// Check if a repository exists +const exists = await githubAdapter.checkRepositoryExists(accessToken, 'owner', 'repo-name') + +// Create a new private repository +if (!exists) { + const repo = await githubAdapter.createRepository(accessToken, 'repo-name', { + private: true, + description: 'Tactile knowledge base repository', + autoInit: true + }) +} +``` diff --git a/docs/pages/packages/auth-github/readme.md b/docs/pages/packages/auth-github/readme.md new file mode 100644 index 00000000..b65edbca --- /dev/null +++ b/docs/pages/packages/auth-github/readme.md @@ -0,0 +1,18 @@ +# @quatrain/auth-github + +Authentication adapter and pluggable endpoints for GitHub OAuth 2.0 Web Application Flow. + +## Installation + +This package is a workspace package within the Quatrain Core monorepo. It depends on `@quatrain/auth` and `@quatrain/api`. + +```bash +yarn add @quatrain/auth-github +``` + +## Features + +- **OAuth 2.0 Flow**: Handles authorization URL generation and exchanging code for token. +- **Pluggable API Router**: Framework-agnostic `GithubAuthApi` endpoint handler matching `ServerAdapter` specification. +- **Deep Linking**: Supports generic redirect schemes for mobile contexts. +- **GitHub API Utilities**: Methods to check repository existence and create new repositories. diff --git a/docs/pages/packages/auth-http-basic/howto.md b/docs/pages/packages/auth-http-basic/howto.md new file mode 100644 index 00000000..dc61ce11 --- /dev/null +++ b/docs/pages/packages/auth-http-basic/howto.md @@ -0,0 +1,33 @@ +# HOWTO: Using @quatrain/auth-http-basic + +This document shows how to configure and run the Basic Authentication middleware inside your Quatrain API. + +--- + +## 1. Initializing AuthBasic + +Create a new basic auth verifier manually or via its `factory` method: + +```typescript +import { AuthBasic } from '@quatrain/auth-http-basic'; + +// Manually +const auth = new AuthBasic('admin', 'super-secret-password'); + +// Or from a configuration object +const configAuth = AuthBasic.factory({ + user: 'admin', + pass: 'super-secret-password' +}); +``` + +## 2. Registering the Middleware + +Register the verifier's middleware on your Quatrain API instance: + +```typescript +import { Api } from '@quatrain/api'; + +const api = new Api(); +api.use(auth.middleware()); +``` diff --git a/docs/pages/packages/auth-http-basic/readme.md b/docs/pages/packages/auth-http-basic/readme.md new file mode 100644 index 00000000..5f52cb02 --- /dev/null +++ b/docs/pages/packages/auth-http-basic/readme.md @@ -0,0 +1,19 @@ +# @quatrain/auth-http-basic + +Basic HTTP Authentication Adapter (RFC 7617) for the Quatrain API Server. + +## Features + +- **Standard RFC 7617 Compliance**: Decodes `Authorization: Basic ` header payloads. +- **Isomorphic Support**: Works correctly inside standard Express-like contexts and Quatrain API servers. +- **Simple Configuration**: Instantiate with user/password credentials or configuration structures. + +--- + +## Getting Started + +Refer to `HOWTO.md` for integration examples. + +## License + +AGPL-3.0-only diff --git a/docs/pages/packages/auth-rbac/howto.md b/docs/pages/packages/auth-rbac/howto.md new file mode 100644 index 00000000..f1d98d41 --- /dev/null +++ b/docs/pages/packages/auth-rbac/howto.md @@ -0,0 +1,139 @@ +# How-To & Integration Guide : @quatrain/auth-rbac + +This guide demonstrates common integration scenarios using `@quatrain/auth-rbac` across Astro, Express, and headless controllers. + +--- + +## 1. Defining Roles & Tarpit Policies + +Declare role hierarchies, entity field rules, and M2M agent tarpit limits: + +```typescript +import { RbacPolicyEngine, type RoleDefinition } from '@quatrain/auth-rbac' + +export const appRoles: RoleDefinition[] = [ + { + id: 'reader', + name: 'Reader', + routes: [ + { pattern: '/api/curate', methods: ['GET'], access: 'allow' }, + { pattern: '/public/**', methods: ['*'], access: 'allow' }, + { pattern: '/**', methods: ['*'], access: 'deny' } + ], + entities: { + 'okf-document': { + defaultMode: 'readonly', + fields: { + internalNotes: 'hidden', + rawLogs: 'hidden' + } + } + } + }, + { + id: 'curator', + name: 'Curator', + inherits: ['reader'], + routes: [ + { pattern: '/api/curate', methods: ['POST', 'PUT'], access: 'allow' }, + { pattern: '/api/upload', methods: ['POST'], access: 'allow' } + ], + entities: { + 'okf-document': { + defaultMode: 'readwrite', + fields: { + soa: 'readonly', + revision: 'readonly', + internalNotes: 'hidden' + } + } + } + }, + { + id: 'ai-agent', + name: 'AI Agent Service', + subjectTypes: ['agent', 'service'], + routes: [ + { pattern: '/api/agent/**', methods: ['POST'], access: 'allow' } + ], + tarpit: { + enabled: true, + burst: 5, + maxRequestsPerMinute: 30, + delayMs: 500, + blockDurationMs: 60000 // 1 minute temporary lock on abuse + } + } +] + +export const rbacEngine = new RbacPolicyEngine(appRoles) +``` + +--- + +## 2. Using with Astro (SSR & API Middlewares) + +In `src/middleware.ts` of your Astro application: + +```typescript +import { sequence } from 'astro:middleware' +import { AstroRbacMiddleware } from '@quatrain/auth-rbac' +import { rbacEngine } from './lib/rbac' + +const rbacMiddleware = new AstroRbacMiddleware(rbacEngine, { + loginRedirectPath: '/login', + forbiddenRedirectPath: '/403', + enableTarpitSleep: true +}) + +export const onRequest = sequence( + // Your auth session middleware setting context.locals.user ... + rbacMiddleware.handler() +) +``` + +Inside an Astro API endpoint (`src/pages/api/curate.ts`): + +```typescript +import type { APIRoute } from 'astro' + +export const POST: APIRoute = async ({ request, locals }) => { + const rbac = locals.rbac // Injected automatically + const body = await request.json() + + // 1. Sanitize incoming write payload against curator role + const safeData = rbac.sanitizeWrite('okf-document', body) + + // 2. Persist to storage / database + const savedItem = await documentService.save(safeData) + + // 3. Sanitize outgoing read payload + const clientResponse = rbac.sanitizeRead('okf-document', savedItem) + + return new Response(JSON.stringify(clientResponse), { + headers: { 'Content-Type': 'application/json' } + }) +} +``` + +--- + +## 3. Using with Express + +```typescript +import express from 'express' +import { ExpressRbacMiddleware } from '@quatrain/auth-rbac' +import { rbacEngine } from './lib/rbac' + +const app = express() +const rbacMiddleware = new ExpressRbacMiddleware(rbacEngine) + +app.use(express.json()) +app.use(rbacMiddleware.handler()) + +app.post('/api/curate', (req, res) => { + const safeInput = req.rbac.sanitizeWrite('okf-document', req.body) + // ... process safeInput + res.json(req.rbac.sanitizeRead('okf-document', safeInput)) +}) +``` diff --git a/docs/pages/packages/auth-rbac/readme.md b/docs/pages/packages/auth-rbac/readme.md new file mode 100644 index 00000000..7de1dcca --- /dev/null +++ b/docs/pages/packages/auth-rbac/readme.md @@ -0,0 +1,85 @@ +# @quatrain/auth-rbac + +> **License**: AGPL-3.0-only +> **Isomorphic Role-Based Access Control, Field-Level Security, M2M Agent Guards & Tarpitting for Quatrain** + +`@quatrain/auth-rbac` is an isomorphic, cloud-native authorization engine designed for the Quatrain ecosystem. It provides unified, declarative access control spanning: +- **Macro-Security**: Route and endpoint protection (URI patterns + HTTP methods). +- **Micro-Security (FLS)**: Field-Level Security calculating `hidden`, `readonly`, and `readwrite` modes per entity property. +- **Automated Payload Sanitization**: `sanitizeRead()` and `sanitizeWrite()` eliminating schema duplication. +- **M2M & AI Agent Defense**: Subject-type separation (`human`, `agent`, `service`) with built-in **tarpitting** (progressive latency injection and request throttling for automated scraping and runaway agent loops). +- **Isomorphic Middlewares**: Abstract base class with concrete adapters for **Express** and **Astro SSR/API**. + +--- + +## Installation + +Within the Quatrain monorepo: + +```json +{ + "dependencies": { + "@quatrain/auth-rbac": "workspace:*" + } +} +``` + +--- + +## Core Architecture + +``` +@quatrain/auth-rbac + ├── engine/ + │ ├── RbacPolicyEngine # Resolves role inheritance, route matching, FLS and payload sanitization + │ └── TarpitManager # Manages sliding-window request throttling and progressive latency injection + ├── middlewares/ + │ ├── AbstractRbacMiddleware # Agnostic middleware foundation + │ ├── ExpressRbacMiddleware # Standard Express (req, res, next) guard + │ └── AstroRbacMiddleware # Unified Astro SSR and API guard + └── types/ # Strongly typed interfaces and contracts +``` + +--- + +## Quick Example + +```typescript +import { RbacPolicyEngine } from '@quatrain/auth-rbac' + +const engine = new RbacPolicyEngine([ + { + id: 'curator', + name: 'Agronomy Curator', + routes: [ + { pattern: '/api/curate', methods: ['GET', 'POST'], access: 'allow' }, + { pattern: '/**', methods: ['*'], access: 'deny' } + ], + entities: { + 'okf-document': { + defaultMode: 'readwrite', + fields: { + soa: 'readonly', + internalReviewerNotes: 'hidden' + } + } + } + } +]) + +const user = { id: 'u1', roles: ['curator'], subjectType: 'human' } + +// 1. Route check +engine.canAccessRoute(user, '/api/curate', 'POST') // true + +// 2. Field mode check +engine.getFieldAccess(user, 'okf-document', 'soa') // 'readonly' +engine.getFieldAccess(user, 'okf-document', 'internalReviewerNotes') // 'hidden' + +// 3. Payload sanitization +const cleanPayload = engine.sanitizeWrite(user, 'okf-document', { + title: 'Soil Guide', + soa: 'malicious/soa', // Stripped automatically + internalReviewerNotes: 'Secret' // Stripped automatically +}) +``` diff --git a/docs/pages/packages/chat/readme.md b/docs/pages/packages/chat/readme.md new file mode 100644 index 00000000..33996db8 --- /dev/null +++ b/docs/pages/packages/chat/readme.md @@ -0,0 +1,15 @@ +# @quatrain/chat + +The core conversational engine for the Quatrain framework. + +This package provides a headless, UI-agnostic implementation of conversational agents, handling message history, prompt templating, context injection (RAG), and integration with LLM providers (Gemini, OpenAI, Ollama). + +## Architecture + +`@quatrain/chat` is decoupled from the frontend presentation layer. +* Logical controllers like `ChatController` manage session state and interactions. +* Visual presentation (chat bubbles, input boxes) is managed separately in the `CoreUX` workspace. + +## License + +AGPL-3.0-only diff --git a/docs/pages/packages/cli/howto.md b/docs/pages/packages/cli/howto.md new file mode 100644 index 00000000..588ab28f --- /dev/null +++ b/docs/pages/packages/cli/howto.md @@ -0,0 +1,98 @@ +# HOW-TO: Getting Started with `@quatrain/cli` + +This guide explains how to leverage both the programmatic library utilities and the command line commands of `@quatrain/cli`. + +--- + +## 1. Scripting & Custom CLI Tools (Programmatic Usage) + +Use the exported APIs of `@quatrain/cli` to build custom runner scripts, sync actions, and integration workflows. + +### A. Spawning Subprocesses with `Command` +To execute external commands securely and retrieve their logs: + +```typescript +import { Command } from '@quatrain/cli'; + +async function listKubectlNamespaces() { + const result = await Command.create('kubectl') + .args(['get', 'namespaces', '-o', 'json']) + .execute(); + + if (!result.success) { + throw new Error(`Failed to list namespaces: ${result.stderr}`); + } + + return JSON.parse(result.stdout); +} +``` + +### B. Requesting User Validation +Ask for confirmations or inputs interactively in your CLI actions: + +```typescript +import { askConfirm, askInput } from '@quatrain/cli'; + +const cleanDb = await askConfirm('Reset database before starting?', false); +if (cleanDb) { + const dbName = await askInput('Specify DB name to reset:', 'quatrain_dev'); + // ... run reset +} +``` + +--- + +## 2. Using the Global CLI Tool (`core`) + +The package exposes a `core` binary to scaffold files and deploy infrastructures. + +### A. Initializing a New Project +```bash +npx @quatrain/cli generate scaffold MyNewProject +cd MyNewProject +bun install +``` +Creates folder directories (`apps/`, `packages/`, etc.) and sets up monorepo packages and `tsconfig.json`. + +### B. Generating Configurations +```bash +npx @quatrain/cli generate config +``` +Walks through an interactive wizard to configure PostgreSQL, Redis, Queues, and outputs a resolved `quatrain.json`. + +### C. Creating Migrations +```bash +npx @quatrain/cli generate migration add_profile_fields +``` +Scaffolds timestamped files under `migrations/` containing migration templates. + +### D. Managing Deployments +```bash +npx @quatrain/cli deploy +``` + +--- + +## 3. Local Development & CLI Linking + +When making local changes to `@quatrain/cli` in the `Core` monorepo: + +### Running core commands on-the-fly: +```bash +# From the root of the Core monorepo +yarn workspace @quatrain/cli core deploy +``` + +### Compiling changes: +Make sure to re-compile TypeScript code when editing `src/` files: +```bash +cd packages/cli +yarn build +# Or watch mode: +yarn wbuild +``` + +--- + +## Documentation Guidelines +> **Recommendation:** Ensure all console outputs, instructions, logging, and codebase comments are written in **International English** to meet Quatrain standards. diff --git a/docs/pages/packages/cli/readme.md b/docs/pages/packages/cli/readme.md new file mode 100644 index 00000000..cd050172 --- /dev/null +++ b/docs/pages/packages/cli/readme.md @@ -0,0 +1,103 @@ +# @quatrain/cli + +The official Command Line Interface (CLI) and script utility library for the Quatrain ecosystem. + +This package serves two distinct purposes: +1. **Programmatic Utilities (Library API):** Exported classes and prompt helpers to build interactive scripts and run system subprocesses (e.g. within agent skills). +2. **Core Command-Line Executable (`core`):** A global terminal command runner to scaffold projects, generate configurations, and manage deployments. + +--- + +## 1. Programmatic Utilities (Library API) + +Import these utilities directly in your TypeScript/JavaScript scripts to interact with the user or run external processes. + +### A. Fluent Command Executor (`Command`) + +The `Command` class provides a cross-platform, fluent builder-pattern interface to execute system subprocesses. It simplifies spawning commands, passing arguments, setting working directories, extending environment variables, and supports PowerShell routing. + +```typescript +import { Command } from '@quatrain/cli'; + +const result = await Command.create('kubectl') + .arg('apply') + .arg('-f') + .arg('deployment.yaml') + .cwd('/path/to/project') + .env({ KUBECONFIG: '/path/to/config' }) + .execute(); + +if (result.success) { + console.log(`Success: ${result.stdout}`); +} else { + console.error(`Exit code: ${result.code}, Error: ${result.stderr}`); +} +``` + +**Fluent Methods:** +- `Command.create(bin)` / `new Command(bin)`: Start building a command for the given binary. +- `.arg(value)` / `.args([values])`: Append command-line arguments. +- `.cwd(dir)`: Set the execution working directory. +- `.env({ KEY: VALUE })`: Set or extend environment variables. +- `.inherit()`: Direct stdout and stderr to the parent process terminal. +- `.usePowerShell(use, type)`: Force process execution through PowerShell (`powershell.exe` or `pwsh`) with safe quote escaping. +- `.execute()`: Run the process asynchronously and return `{ stdout, stderr, code, success }`. + +### B. Interactive Prompt Helpers + +Helpers wrapping `inquirer` to prompt user inputs cleanly: + +```typescript +import { askConfirm, askInput, askChoice } from '@quatrain/cli'; + +// Yes/No Confirmations +const proceed = await askConfirm('Do you want to deploy now?'); + +// String Inputs +const name = await askInput('Enter your username:', 'default_user'); + +// Multi-choice select lists +const selected = await askChoice('Select action:', [ + { name: 'Sync Google Calendar', value: 'sync' }, + { name: 'Reset Database', value: 'reset' } +]); +``` + +--- + +## 2. Core Command-Line Executable + +A global CLI tool invoked via the `core` command (or `quatrain` depending on symlinks). + +### Installation + +Install globally or run on-the-fly: + +```bash +# Global +bun add -g @quatrain/cli + +# Run on the fly +bunx @quatrain/cli +``` + +### Commands Reference + +#### `core deploy` +Manage Kubernetes deployments (create, list, modify, promote, delete namespaces and manifests). + +#### `core generate scaffold ` +Initialize a new Quatrain project structure: +- Sets up directories: `apps/`, `data/`, `config/`, `packages/`, `migrations/`. +- Generates a monorepo-ready workspace `package.json` and a pre-configured `tsconfig.json`. + +#### `core generate config` +Start an interactive wizard to generate the `quatrain.json` bootloader configuration file. + +#### `core generate migration ` +Scaffold a timestamped TypeScript migration file (e.g., `migrations/20260427_name.ts`) with template `up()` and `down()` blocks. + +--- + +## Language Guidelines +> **Recommendation:** All text contents (logs, console prints, commit messages, comments) within the Quatrain ecosystem must be written in **International English** to ensure global team maintainability. diff --git a/docs/pages/packages/http/howto.md b/docs/pages/packages/http/howto.md new file mode 100644 index 00000000..903af864 --- /dev/null +++ b/docs/pages/packages/http/howto.md @@ -0,0 +1,36 @@ +# HOWTO: Using @quatrain/http + +This document outlines how to use the HTTP enums and header parsing helper functions. + +--- + +## 1. Using Enums + +Import standard headers, methods, and status codes to avoid hardcoding strings: + +```typescript +import { HttpHeader, HttpMethod, HttpStatus } from '@quatrain/http'; + +console.log(HttpMethod.GET); // "GET" +console.log(HttpStatus.OK); // 200 +console.log(HttpHeader.AUTHORIZATION); // "Authorization" +``` + +## 2. Parsing Authorization Headers + +Use `HttpHelper` to decode header credentials safely: + +```typescript +import { HttpHelper } from '@quatrain/http'; + +// Bearer tokens +const token = HttpHelper.parseBearerToken('Bearer xyz123'); +console.log(token); // "xyz123" + +// Basic credentials +const credentials = HttpHelper.parseBasicAuth('Basic YWRtaW46cGFzczEyMw=='); +if (credentials) { + console.log(credentials.user); // "admin" + console.log(credentials.pass); // "pass123" +} +``` diff --git a/docs/pages/packages/http/readme.md b/docs/pages/packages/http/readme.md new file mode 100644 index 00000000..a1e58b27 --- /dev/null +++ b/docs/pages/packages/http/readme.md @@ -0,0 +1,20 @@ +# @quatrain/http + +A lightweight utility package containing standard HTTP enums and utility helpers for HTTP request/response handling. + +## Features + +- **HTTP Status Codes**: Strongly-typed HTTP response codes enum (`HttpStatus`). +- **HTTP Methods**: Standard HTTP request methods enum (`HttpMethod`). +- **HTTP Headers**: Commonly used custom and standard headers enum (`HttpHeader`). +- **HTTP Auth Parsing Helpers**: Utilities to extract bearer tokens and basic credentials (`HttpHelper`). + +--- + +## Getting Started + +Refer to `HOWTO.md` for code examples. + +## License + +AGPL-3.0-only diff --git a/docs/pages/packages/i18n-es/howto.md b/docs/pages/packages/i18n-es/howto.md new file mode 100644 index 00000000..4333b429 --- /dev/null +++ b/docs/pages/packages/i18n-es/howto.md @@ -0,0 +1,20 @@ +# HOWTO: Using @quatrain/i18n-es + +This document shows how to consume the Spanish translation bundle in your application. + +--- + +## Usage + +Import the dictionary and register it into the central `Translator` instance: + +```typescript +import { Translator } from '@quatrain/i18n' +import { esDictionary } from '@quatrain/i18n-es' + +const translator = new Translator('es') +translator.register('es', esDictionary) + +const label = translator.translate('table', 'uid', 'es') +console.log(label) // "Identificador" +``` diff --git a/docs/pages/packages/ingestion/readme.md b/docs/pages/packages/ingestion/readme.md new file mode 100644 index 00000000..52868e56 --- /dev/null +++ b/docs/pages/packages/ingestion/readme.md @@ -0,0 +1,17 @@ +# @quatrain/ingestion + +Agnostic ingestion, extraction, and media processing interfaces for the Quatrain framework. + +This package defines ports (`AbstractIngestionAdapter`) and common types to build OCR, audio transcription, video metadata parsing, and web crawling adapters. + +## Architecture + +Specific ingestion implementations inherit from `AbstractIngestionAdapter` and are registered to handle distinct media types. +* `@quatrain/ingestion-ocr`: Text extraction (Vision SDK, PDF parse). +* `@quatrain/ingestion-audio`: Audio transcripts (Whisper local/cloud). +* `@quatrain/ingestion-video`: Video downloads and track analysis (YouTube, MP4). +* `@quatrain/ingestion-web`: HTML parsing and normalization. + +## License + +AGPL-3.0-only diff --git a/docs/pages/packages/mdm/howto.md b/docs/pages/packages/mdm/howto.md new file mode 100644 index 00000000..26c3cb46 --- /dev/null +++ b/docs/pages/packages/mdm/howto.md @@ -0,0 +1,144 @@ +# HOWTO: `@quatrain/mdm` — Step-by-Step Guide: Creating a T-Shirt Product Variant & Inventory Unit + +This guide demonstrates how to create a concrete **T-Shirt** garment product using `@quatrain/mdm` with standardized ENUMs, extensible interfaces, archetype specification validation, top-level `Vendor` entities, `ObjectVendor` relational associations, and child `Specification` collections. + +--- + +## 1. Define the Concrete `TeeShirt` Model Class + +Extend `AbstractMdmObject` and define the mandatory `getArchetypeSpec()` schema specifying required and optional properties: + +```typescript +import { + AbstractMdmObject, + MdmArchetypeSpec, + MdmNature, + TextileGarmentSpecInterface +} from '@quatrain/mdm'; + +/** + * Concrete TeeShirt Model Class (Extends AbstractMdmObject) + */ +export class TeeShirt extends AbstractMdmObject { + static COLLECTION = 'tshirts' + + getArchetypeSpec(): MdmArchetypeSpec { + return { + archetypeId: 'textile.tshirt', + name: 'Organic Cotton T-Shirt', + nature: MdmNature.PHYSICAL, + collection: TeeShirt.COLLECTION, + requiredProperties: ['sizes', 'colors', 'materials'], + optionalProperties: ['washCare', 'brand', 'weightGrams', 'fitType'] + } + } + + public get specifications(): TextileGarmentSpecInterface { + return this.specificationsObject as TextileGarmentSpecInterface + } +} +``` + +--- + +## 2. Register Provider Adapter & Archetype with Pivot Class `Mdm` + +Centralize registry initialization via `Mdm`: + +```typescript +import { Mdm, MockMdmAdapter, MdmNature } from '@quatrain/mdm'; + +// Register provider adapter +Mdm.addAdapter(new MockMdmAdapter('default'), 'default', true); + +// Instantiate sample and register TeeShirt Archetype Spec & Model Class +const tshirtSample = TeeShirt.fromObject({ + name: 'T-Shirt Archetype', + archetypeId: 'textile.tshirt', + nature: MdmNature.PHYSICAL +}); + +Mdm.registerArchetype(tshirtSample.getArchetypeSpec()); +Mdm.registerModel('textile.tshirt', TeeShirt); +``` + +--- + +## 3. Create Independent `Vendor` Entities and Associate via `ObjectVendor` + +Create top-level `Vendor` instances and associate them to the `TeeShirt` variant with product-vendor metadata (*vendorSku, role, primary status*): + +```typescript +import { + Vendor, + GarmentSize, + TextileColor, + TextileMaterial, + TextileWashCare, + TextileGarmentSpecInterface, + MdmNature +} from '@quatrain/mdm'; + +// 1. Create standalone Vendor entities +const ecoMillsVendor = Vendor.fromObject({ + name: 'EcoApparel Mills', + url: 'https://ecomills.example.com' +}); + +const globalDistroVendor = Vendor.fromObject({ + name: 'Textile Global Distro', + url: 'https://tgd.example.com' +}); + +// 2. Instantiate T-Shirt Product Variant +const tshirtVariant = TeeShirt.fromObject({ + name: 'Quatrain Organic V-Neck T-Shirt (Navy)', + sku: 'QT-TSHIRT-ORG-001', + archetypeId: 'textile.tshirt', + nature: MdmNature.PHYSICAL, + lifecycleState: 'production', +}); + +// 3. Associate Vendors via ObjectVendor relationship records +tshirtVariant.addVendor(ecoMillsVendor, 'ECO-MILL-883', 'manufacturer', true); +tshirtVariant.addVendor(globalDistroVendor, 'TGD-2026-9', 'distributor'); + +// 4. Populate Specification child collection +tshirtVariant.setSpecificationsFromObject({ + sizes: [GarmentSize.SMALL, GarmentSize.MEDIUM, GarmentSize.LARGE], + colors: [TextileColor.NAVY_BLUE, TextileColor.WHITE], + materials: [TextileMaterial.ORGANIC_COTTON], + brand: 'Quatrain EcoWear' +}); + +// 5. Validate specifications against archetype schema +tshirtVariant.validateArchetypeSpecs(); // Returns true +console.log(tshirtVariant.getVendors().map(v => v.val('name'))); // ['EcoApparel Mills', 'Textile Global Distro'] +``` + +--- + +## 4. Property Types Guidelines: Inline Maps vs Relational Collections + +When declaring property definitions (`PROPS_DEFINITION`) in domain models: + +| Property Type | Source Package | Usage | Example | +| :--- | :--- | :--- | :--- | +| `MapProperty.TYPE` (`'map'`) | `@quatrain/core` | **Inline Group Dictionaries**: Autocontained JSON / JSONB maps stored directly in table columns. | `dimensions`, `vendor_info` | +| `CollectionProperty.TYPE` (`'collection'`) | `@quatrain/backend` | **Relational Collections**: Child entities persisted as separate table rows with a parent foreign key. | `specifications`, `vendors` | +| `ObjectProperty.TYPE` (`'object'`) | `@quatrain/core` | **Single Entity References**: Direct link to a single model instance. Requires `instanceOf: ClassName`. | `parent` | + +```typescript +import { AbstractMdmObject } from '@quatrain/mdm' +import { MapProperty } from '@quatrain/core' + +export class Device extends AbstractMdmObject { + static COLLECTION = 'devices' + static PROPS_DEFINITION = [ + ...AbstractMdmObject.PROPS_DEFINITION, + // Inline specification group JSONB map (use MapProperty.TYPE) + { name: 'dimensions', type: MapProperty.TYPE, required: false, default: { unitSystem: 'metric' } }, + { name: 'vendor_info', type: MapProperty.TYPE, required: false, default: {} }, + ] as typeof AbstractMdmObject.PROPS_DEFINITION +} +``` diff --git a/docs/pages/packages/mdm/readme.md b/docs/pages/packages/mdm/readme.md new file mode 100644 index 00000000..b71b7dd2 --- /dev/null +++ b/docs/pages/packages/mdm/readme.md @@ -0,0 +1,21 @@ +# `@quatrain/mdm` — Agnostic Master Data Management (MDM) Core Package + +The `@quatrain/mdm` package provides an abstract, domain-agnostic Master Data Management (MDM) architecture for physical assets, garments, audio/video media, virtual products (*digital access keychains, credentials*), managed services, and composite objects. + +--- + +## 🏛️ Abstract Architecture & Sibling Conventions + +Following standard **Quatrain Core** sibling package conventions: +- **`abstract class AbstractMdmObject extends PersistedBaseObject`**: Core abstract model class that MUST be extended to define concrete real-world objects (e.g. `TeeShirt`, `Garment`, `Disk`, `HardwareDevice`, `VirtualKeychain`). Cannot be instantiated directly. +- **Clean Concrete Derived Class Naming**: Derived domain classes drop the `MdmObject` suffix (e.g., `TeeShirt`, `Garment`, `Disk`, `HardwareDevice`, `VirtualKeychain`). +- **Archetype Specifications (`MdmArchetypeSpec`)**: Archetypes define mandatory (`requiredProperties`) and optional (`optionalProperties`) specification schemas (e.g., Garment: sizes/colors/materials; Disk: format/duration/tracks; IoT Device: serialNumber/radioCapabilities). +- **Validation Engine (`validateArchetypeSpecs()`)**: Built-in validation ensuring required archetype specification fields exist prior to persistence. +- **Pivot Class `Mdm extends Core`**: Central registry manager providing provider adapter registration (`Mdm.addAdapter()`), archetype specification registration (`Mdm.registerArchetype()`), and custom model registration (`Mdm.registerModel()`). +- **Subcollections**: Supports attaching $N$ subitems or attributes linked to a parent element via dynamic collection paths (`//`). + +--- + +## 📦 Usage + +See [`HOWTO.md`](HOWTO.md) for practical examples and registration scenarios. diff --git a/docs/pages/packages/okf/howto.md b/docs/pages/packages/okf/howto.md new file mode 100644 index 00000000..5b4a8541 --- /dev/null +++ b/docs/pages/packages/okf/howto.md @@ -0,0 +1,66 @@ +# HOWTO - Using the @quatrain/okf Adapter + +This guide presents the most common usage scenarios for the OKF backend storage adapter. + +--- + +## 1. Registering the OKF Adapter + +To tell the Quatrain framework to persist models into local JSON files, register the `OKFBackendAdapter` in your application setup: + +```typescript +import { Backend } from '@quatrain/backend'; +import { OKFBackendAdapter } from '@quatrain/okf'; + +const okfAdapter = new OKFBackendAdapter({ + config: { + database: '/path/to/my/data/okf' // Root folder for JSON files + } +}); + +// Set as default database backend +Backend.addBackend(okfAdapter, 'default', true); +``` + +--- + +## 2. Declaring Models and Saving Data + +Define models inheriting from `PersistedBaseObject`: + +```typescript +import { PersistedBaseObject } from '@quatrain/backend'; +import { StringProperty } from '@quatrain/core'; + +class Bassin extends PersistedBaseObject { + static COLLECTION = 'bassins'; + static PROPS_DEFINITION = [ + { name: 'name', type: StringProperty.TYPE } + ]; +} +``` + +To save files, instantiate your model and save it: + +```typescript +const basin = await Bassin.factory(); +basin.set('name', 'Bassin N°4'); +basin.set('createdBy', 'pascal@sodav.ci'); // Injected in OKF meta block + +await basin.save(); // Generates /path/to/my/data/okf/bassins/{uid}.json +``` + +--- + +## 3. Querying Local Files + +Use the repository interface to search the flat-file structure: + +```typescript +const query = Bassin.query().filter('name', 'eq', 'Bassin N°4'); +const results = await Bassin.repository().query(query); + +results.items.forEach((item) => { + console.log(item.val('name')); +}); +``` diff --git a/docs/pages/packages/okf/readme.md b/docs/pages/packages/okf/readme.md new file mode 100644 index 00000000..14829922 --- /dev/null +++ b/docs/pages/packages/okf/readme.md @@ -0,0 +1,17 @@ +# @quatrain/okf + +Open Knowledge Format (OKF) flat file storage adapter for the Quatrain Core framework. + +## Overview + +The `@quatrain/okf` package provides a file-based persistence adapter (`OKFBackendAdapter`) that serializes Quatrain `PersistedBaseObject` entities into a structured flat file filesystem directory conforming to the OKF format. + +This adapter is specifically designed to facilitate local-first, offline-first architectures by excluding relational databases and utilizing structured directory trees containing lightweight JSON files. + +## Features + +- **Decoupled Architecture:** Pure filesystem storage format independent of underlying Git versioning or synchronization layers. +- **Operator Auditing:** Automatically stores the operator's email in the document's metadata block (`meta.created_by`) for full change traceability. +- **Hierarchical Layouts:** + - Telemetry: Saved as `telemetry/YYYY-MM-DD/{type}/{HHMMSS}-{millis}-{bassinId}.json` + - Other: Saved as `{collection}/{uid}.json` diff --git a/docs/pages/packages/queue-sqlite/howto.md b/docs/pages/packages/queue-sqlite/howto.md new file mode 100644 index 00000000..7e8f20c6 --- /dev/null +++ b/docs/pages/packages/queue-sqlite/howto.md @@ -0,0 +1,94 @@ +# How-To Guide: Working with @quatrain/queue-sqlite + +This guide covers common integration scenarios and recipes for using `@quatrain/queue-sqlite`. + +--- + +## 1. Initializing and Registering the Queue + +To use the queue, initialize the `SQLiteQueueAdapter` and add it to the static `Queue` registry. + +```typescript +import { Queue } from '@quatrain/queue'; +import { SQLiteQueueAdapter } from '@quatrain/queue-sqlite'; + +// Register the SQLite queue adapter as the default queue +Queue.addQueue( + new SQLiteQueueAdapter({ + config: { database: './database.sqlite' } + }), + 'default', + true +); +``` + +--- + +## 2. Dispatching a Task + +To dispatch a task payload to the queue, use `Queue.getQueue().send()`. + +```typescript +import { Queue } from '@quatrain/queue'; + +async function dispatchIngestion(filePath: string) { + const adapter = Queue.getQueue(); + const taskId = await adapter.send({ + type: 'pdf', + name: 'annual_report.pdf', + tempFilePath: filePath, + }, 'ingestion'); + + console.log(`Task dispatched with ID: ${taskId}`); +} +``` + +--- + +## 3. Registering a Queue Listener + +A listener polls the SQLite queue for pending tasks, marks them as processing, calls the handler, and records completion or failure. + +```typescript +import { Queue } from '@quatrain/queue'; + +function startTaskWorker() { + const adapter = Queue.getQueue(); + + adapter.listen('ingestion', async (task: any, options: { updateProgress: Function }) => { + console.log(`Processing task: ${task.name}`); + + // Update task progress dynamically + await options.updateProgress(25); + + // Perform work... + await options.updateProgress(100); + }); +} +``` + +--- + +## 4. Querying and Managing Tasks + +You can query the status of all queued tasks, delete finished tasks, or retry failed ones directly from the adapter: + +```typescript +import { Queue } from '@quatrain/queue'; +import { SQLiteQueueAdapter } from '@quatrain/queue-sqlite'; + +async function manageQueue() { + const adapter = Queue.getQueue(); + + // Get all tasks sorted by creation date + const tasks = await adapter.getTasks('ingestion'); + console.log('Active Tasks:', tasks); + + // Retry a failed task + const wasRetried = await adapter.retryTask('failed-task-uuid'); + if (wasRetried) console.log('Task set back to pending.'); + + // Delete a completed or failed task + await adapter.deleteTask('completed-task-uuid'); +} +``` diff --git a/docs/pages/packages/queue-sqlite/readme.md b/docs/pages/packages/queue-sqlite/readme.md new file mode 100644 index 00000000..fa0f2717 --- /dev/null +++ b/docs/pages/packages/queue-sqlite/readme.md @@ -0,0 +1,33 @@ +# @quatrain/queue-sqlite + +SQLite Task Queue Adapter for the `@quatrain/queue` namespace. + +This package provides a robust local-first persistent queue adapter using SQLite. It is designed to queue tasks locally in memory or write them persistently on disk, processing them sequentially or concurrently under unprivileged user execution constraints. + +## Features + +- **Local Persistence**: Save tasks to a local SQLite database (`:memory:` or persistent file). +- **Concurrency Locking**: Utilizes transactions and `BEGIN IMMEDIATE` statements to prevent multi-process locking conflicts. +- **Task Lifecycle Management**: Supports progress reporting, task retries, deletion, and query utilities. +- **Agnostic Interface**: Conforms strictly to Quatrain Core's `AbstractQueueAdapter` specification. + +## Installation + +```bash +yarn add @quatrain/queue-sqlite +``` + +## Configuration + +Initialize the adapter with a path to your SQLite database file: + +```typescript +import { Queue } from '@quatrain/queue'; +import { SQLiteQueueAdapter } from '@quatrain/queue-sqlite'; + +const queueDbPath = './data/queue.sqlite'; + +Queue.addQueue(new SQLiteQueueAdapter({ + config: { database: queueDbPath } +}), 'default', true); +``` diff --git a/docs/pages/packages/searchengine-qmd/howto.md b/docs/pages/packages/searchengine-qmd/howto.md new file mode 100644 index 00000000..a1e128f2 --- /dev/null +++ b/docs/pages/packages/searchengine-qmd/howto.md @@ -0,0 +1,48 @@ +# HOWTO: Using `@quatrain/searchengine-qmd` + +This guide explains how to integrate and configure `@quatrain/searchengine-qmd` with `@quatrain/searchengine`. + +## 1. Initializing and Registering the Adapter + +```typescript +import { SearchEngine } from '@quatrain/searchengine'; +import { QmdSearchEngineAdapter } from '@quatrain/searchengine-qmd'; + +const qmdAdapter = new QmdSearchEngineAdapter({ + alias: 'default', + config: { + collectionName: 'second-brain', + storageDir: './content', + preferCli: false + } +}); + +await qmdAdapter.initialize(); +SearchEngine.addEngine(qmdAdapter, 'default', true); +``` + +## 2. Indexing Markdown Documents + +```typescript +await SearchEngine.indexDocument({ + id: 'okf-specification', + title: 'OKF - The Markdown Spec for Humans and AI Agents', + content: 'OKF is an open specification for creating AI-consumable knowledge bases using markdown files.', + category: 'technology/ai', + tags: ['spec', 'markdown', 'agents'] +}); +``` + +## 3. Querying the Search Engine + +```typescript +const results = await SearchEngine.search('knowledge base', { + mode: 'hybrid', + category: 'technology', + limit: 5 +}); + +results.forEach(res => { + console.log(`[Score: ${res.score}] ${res.title} - ${res.snippet}`); +}); +``` diff --git a/docs/pages/packages/searchengine-qmd/readme.md b/docs/pages/packages/searchengine-qmd/readme.md new file mode 100644 index 00000000..ad783f86 --- /dev/null +++ b/docs/pages/packages/searchengine-qmd/readme.md @@ -0,0 +1,18 @@ +# @quatrain/searchengine-qmd + +QMD (Query Markup Documents) search engine provider adapter for the `@quatrain/searchengine` namespace. + +## Overview + +`@quatrain/searchengine-qmd` connects the Quatrain Core framework with QMD, a local-first search engine that combines BM25 keyword matching, vector embeddings, and LLM re-ranking across Markdown and OKF document repositories. + +## Features + +- **Hybrid Search**: BM25, semantic vector retrieval, and scoring. +- **Category & Tag Scoping**: Filters search queries by folder taxonomy. +- **Dual Execution Engine**: Automatic detection and execution via QMD CLI binary or structured local fallback. +- **Fail-Fast Configuration**: Validates storage paths and collection parameters at startup. + +## License + +AGPL-v3 diff --git a/docs/pages/packages/searchengine/howto.md b/docs/pages/packages/searchengine/howto.md new file mode 100644 index 00000000..d63947f2 --- /dev/null +++ b/docs/pages/packages/searchengine/howto.md @@ -0,0 +1,66 @@ +# HOWTO: Using `@quatrain/searchengine` + +This guide presents the most common usage scenarios for configuring and performing document searches with `@quatrain/searchengine`. + +## 1. Defining a Custom Search Engine Adapter + +Extend `AbstractSearchEngineAdapter` and implement the abstract methods: + +```typescript +import { AbstractSearchEngineAdapter, SearchDocument, SearchQueryOptions, SearchResultItem } from '@quatrain/searchengine'; + +export class CustomSearchAdapter extends AbstractSearchEngineAdapter { + async initialize(): Promise { + // Connect to search backend or initialize index + } + + async indexDocument(doc: SearchDocument): Promise { + // Index document + } + + async removeDocument(id: string): Promise { + // Remove document + } + + async search(query: string, options?: SearchQueryOptions): Promise { + // Execute search query + return []; + } +} +``` + +## 2. Registering an Engine Instance + +Register the adapter into the `SearchEngine` singleton: + +```typescript +import { SearchEngine } from '@quatrain/searchengine'; +import { CustomSearchAdapter } from './CustomSearchAdapter'; + +const adapter = new CustomSearchAdapter({ + alias: 'default', + config: { host: 'localhost' } +}); + +SearchEngine.addEngine(adapter, 'default', true); +``` + +## 3. Indexing and Searching Documents + +```typescript +// Indexing +await SearchEngine.indexDocument({ + id: 'doc-101', + title: 'Project Architecture Plan', + content: 'Cloud-native architecture and dependency injection guidelines.', + category: 'technology' +}); + +// Searching +const results = await SearchEngine.search('cloud-native', { + mode: 'hybrid', + limit: 10 +}); + +console.log(results); +``` diff --git a/docs/pages/packages/searchengine/readme.md b/docs/pages/packages/searchengine/readme.md new file mode 100644 index 00000000..c7f735e1 --- /dev/null +++ b/docs/pages/packages/searchengine/readme.md @@ -0,0 +1,18 @@ +# @quatrain/searchengine + +Base search engine abstraction, contract interfaces, and singleton registry for the Quatrain Core framework. + +## Overview + +`@quatrain/searchengine` defines the standard `AbstractSearchEngineAdapter` interface and the central `SearchEngine` registry. It allows applications in the Quatrain ecosystem to perform hybrid document search, vector retrieval, and BM25 indexing without binding to specific search implementations. + +## Features + +- **Adapter Pattern**: Decouples search query execution from underlying search backends (QMD, Meilisearch, SQLite FTS, Algolia). +- **Singleton Registry**: Centralized engine registration with alias lookup via `SearchEngine.getEngine()`. +- **Fail-Fast Validation**: Guarantees initialization parameters are validated at constructor time. +- **TypeScript First**: Full type safety for documents, queries, and search result items. + +## License + +AGPL-v3 diff --git a/docs/pages/packages/skills/howto.md b/docs/pages/packages/skills/howto.md new file mode 100644 index 00000000..de2c9c60 --- /dev/null +++ b/docs/pages/packages/skills/howto.md @@ -0,0 +1,50 @@ +# HOWTO: Using @quatrain/skills + +This document shows how to utilize the skill helper structures and safely write execution outputs. + +--- + +## 1. Writing Outputs Safely + +Use the `writeOutput` function to write any object data to a file. It automatically takes care of recursive parent directory creation: + +```typescript +import { writeOutput } from '@quatrain/skills'; + +const myRunData = { + status: 'success', + timestamp: Date.now(), + results: [1, 2, 3] +}; + +// Writes to '.log/runs/latest.json', creating '.log/' and 'runs/' directories if missing +await writeOutput(myRunData, '.log/runs/latest.json'); +``` + +## 2. Declaring an API-based Skill + +You can implement the exported interfaces to declare structured skills: + +```typescript +import { ApiSkillDefinition } from '@quatrain/skills'; + +const myOdooSkill: ApiSkillDefinition = { + name: 'odoo-fetch-partners', + description: 'Fetches partner data from Odoo ERP', + client: { + type: 'xmlrpc', + endpointUrl: 'https://erp.example.com', + parameters: { + db: 'my_database', + user: 'admin' + } + }, + methods: [ + { + name: 'getPartners', + remoteName: 'execute_kw', + description: 'Read partners' + } + ] +}; +``` diff --git a/docs/pages/packages/skills/readme.md b/docs/pages/packages/skills/readme.md new file mode 100644 index 00000000..38bb3baf --- /dev/null +++ b/docs/pages/packages/skills/readme.md @@ -0,0 +1,19 @@ +# @quatrain/skills + +Shared TypeScript CLI and API client helper utilities for building and running Quatrain Agent skills. + +## Features + +- **Robust File Writing**: Includes `writeOutput` which safely creates parent directories (such as `.log/` or subfolders) when saving results. +- **Typed Schemas**: Exports TypeScript interfaces for declaring API-based skills (`ApiSkillDefinition`), remote method registries (`RemoteMethodDefinition`), and client configs (`SkillApiClientConfig`). +- **Standardized Logging**: Reuses Quatrain Core's base logger to write consistent logs. + +--- + +## Getting Started + +Refer to `HOWTO.md` for guidelines and usage. + +## License + +AGPL-3.0-only diff --git a/docs/pages/packages/state-machine/howto.md b/docs/pages/packages/state-machine/howto.md new file mode 100644 index 00000000..ced87821 --- /dev/null +++ b/docs/pages/packages/state-machine/howto.md @@ -0,0 +1,71 @@ +# HOWTO - Using the @quatrain/state-machine Package + +This guide details how to implement workflow lifecycles and conformance evaluation rules. + +--- + +## 1. Setting up a Workflow (FSM) + +Workflow state machines are event-driven and linear. You declare transitions and check results: + +```typescript +import { WorkflowStateMachine } from '@quatrain/state-machine'; + +type States = 'empty' | 'filling' | 'stocked'; +type Events = 'FILL' | 'STOCK'; +interface Context { + oxygenLevel: number; +} + +const context: Context = { oxygenLevel: 4.5 }; +const fsm = new WorkflowStateMachine('empty', context); + +// 1. Declare transitions +fsm + .addTransition('empty', 'FILL', 'filling') + .addTransition( + 'filling', + 'STOCK', + 'stocked', + // Guard (anonymous function check) + (ctx) => ctx.oxygenLevel >= 4.0, + // Action callback + () => console.log('Bassin has been stocked!') + ); + +// 2. Perform transitions +const success = await fsm.transition('FILL'); // true +console.log(fsm.getState()); // 'filling' +``` + +--- + +## 2. Setting up a Conformance Evaluator + +Conformance machines analyze context attributes continuously to assign status levels: + +```typescript +import { ConformanceStateMachine } from '@quatrain/state-machine'; + +interface Metrics { + ph: number; +} + +const metrics: Metrics = { ph: 7.2 }; +const sm = new ConformanceStateMachine('conforming', metrics); + +// Declare priority rules (KO check runs first, then degraded, defaulting to conforming) +sm + .addRule('ko', (ctx) => ctx.ph < 5.5) + .addRule('degraded', (ctx) => ctx.ph < 6.5 || ctx.ph > 8.5) + .addRule('conforming', () => true); + +// Run evaluation +sm.evaluate(); +console.log(sm.getState()); // 'conforming' + +// Update metric values and re-evaluate +sm.updateContext({ ph: 5.2 }); +sm.evaluate(); +console.log(sm.getState()); // 'ko' +``` diff --git a/docs/pages/packages/state-machine/readme.md b/docs/pages/packages/state-machine/readme.md new file mode 100644 index 00000000..9e56d7c0 --- /dev/null +++ b/docs/pages/packages/state-machine/readme.md @@ -0,0 +1,16 @@ +# @quatrain/state-machine + +Generic strongly-typed Finite State Machine with anonymous guards and actions. + +## Overview + +The `@quatrain/state-machine` package provides a declarative engine to model and transition states inside Quatrain applications. It supports two main operational dimensions: + +1. **Workflow State Machine (`WorkflowStateMachine`):** Event-driven transitions typically mapping a linear lifecycle (e.g. forward-only progress without backtracking). +2. **Conformance State Machine (`ConformanceStateMachine`):** Rule-driven evaluation that classifies an observed object's status (e.g. `conforming`, `degraded`, or `ko`) by running guard predicates over its data context. + +## Key Design Patterns + +- **Anonymous Functions:** Guards (predicates) and transition actions are defined inline via anonymous functions. +- **Strict Typing:** Transition states, events, and contexts are generic parameters ensuring full compiler-time safety. +- **Clear Inheritance:** Exposes `BaseStateMachine` properties to support standard extension paths. diff --git a/docs/pages/packages/types/howto.md b/docs/pages/packages/types/howto.md new file mode 100644 index 00000000..a7270cfb --- /dev/null +++ b/docs/pages/packages/types/howto.md @@ -0,0 +1,39 @@ +# HOWTO: Using @quatrain/types + +This document shows how to utilize the reference URI systems and resource exceptions. + +--- + +## 1. Using ObjectUri + +The `ObjectUri` system helps identify database records and references: + +```typescript +import { ObjectUri } from '@quatrain/types'; + +// Instantiate from a path string +const uri = new ObjectUri('users/usr-100'); + +console.log(uri.uid); // "usr-100" +console.log(uri.collection); // "users" +console.log(uri.path); // "users/usr-100" + +// Bind class instance directly to compute path +uri.class = User; +``` + +## 2. Using Exceptions + +Import and throw Quatrain resource errors to automate error responses: + +```typescript +import { NotFoundError, ValidationError } from '@quatrain/types'; + +// Resource lookup failures +throw new NotFoundError('User could not be found.'); + +// validation failures +throw new ValidationError('Validation failed', { + email: 'Invalid email address format' +}); +``` diff --git a/docs/pages/packages/types/readme.md b/docs/pages/packages/types/readme.md new file mode 100644 index 00000000..f363a3a1 --- /dev/null +++ b/docs/pages/packages/types/readme.md @@ -0,0 +1,19 @@ +# @quatrain/types + +Fundamental type definitions, domain exceptions, and global reference structures (URIs) for the Quatrain Core framework. + +## Features + +- **Object Reference System**: The `ObjectUri` class represents a unique global reference system for all Quatrain models. +- **Resource Exceptions**: Contains structured resource exceptions (e.g. `NotFoundError`, `ValidationError`, `BadRequestError`) aligning with standard HTTP responses. +- **Domain Interfaces**: Base interfaces mapping system entities (`BaseObjectType`, `ReferenceType`). + +--- + +## Getting Started + +Refer to `HOWTO.md` for API and coding examples. + +## License + +AGPL-3.0-only diff --git a/docs/public/api-reference/assets/highlight.css b/docs/public/api-reference/assets/highlight.css index 9889499e..c9fb155d 100644 --- a/docs/public/api-reference/assets/highlight.css +++ b/docs/public/api-reference/assets/highlight.css @@ -17,12 +17,12 @@ --dark-hl-7: #4FC1FF; --light-hl-8: #EE0000; --dark-hl-8: #D7BA7D; - --light-hl-9: #267F99; - --dark-hl-9: #4EC9B0; - --light-hl-10: #098658; - --dark-hl-10: #B5CEA8; - --light-hl-11: #0451A5; - --dark-hl-11: #9CDCFE; + --light-hl-9: #0451A5; + --dark-hl-9: #9CDCFE; + --light-hl-10: #267F99; + --dark-hl-10: #4EC9B0; + --light-hl-11: #098658; + --dark-hl-11: #B5CEA8; --light-hl-12: #000000FF; --dark-hl-12: #D4D4D4; --light-code-background: #FFFFFF; diff --git a/docs/public/api-reference/classes/_quatrain_ai-gemini.GeminiAdapter.html b/docs/public/api-reference/classes/_quatrain_ai-gemini.GeminiAdapter.html index 19a2191c..35d902dd 100644 --- a/docs/public/api-reference/classes/_quatrain_ai-gemini.GeminiAdapter.html +++ b/docs/public/api-reference/classes/_quatrain_ai-gemini.GeminiAdapter.html @@ -1,19 +1,24 @@ GeminiAdapter | Quatrain Core Documentation
Quatrain Core Documentation
    Preparing search index...

    AI Adapter implementation for Google's Gemini models using the official genai SDK.

    -

    Hierarchy (View Summary)

    Index

    Constructors

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _ai: GoogleGenAI | null = null
    _apiKey: string

    Methods

    • Instructs the Gemini model to output structured JSON data conforming to a given schema.

      -

      Parameters

      • prompt: string

        The instruction or context.

        +

    Constructors

    Properties

    _ai: GoogleGenAI | null = null
    _apiKey: string

    Methods

    • Instructs the Gemini model to output structured JSON data conforming to a given schema.

      +

      Parameters

      • prompt: any

        The instruction or context.

      • schema: any

        The expected JSON schema structure.

      • Optionaloptions: any

        Additional options including the model identifier.

      Returns Promise<any>

      The parsed JSON object returned by the model.

      If the API does not return valid text.

      -
    • Sends a textual prompt to the Gemini API and retrieves the generated text response.

      Parameters

      • prompt: string

        The instruction or query to send to the model.

      • Optionaloptions: any

        Configuration options. Can include a model string identifier.

      Returns Promise<string>

      The generated response string.

      -
    +
    • Sends a textual prompt to the Gemini API and returns an async iterable of text chunks.

      +

      Parameters

      • prompt: string

        The instruction or query to send to the model.

        +
      • Optionaloptions: any

        Configuration options including the model identifier.

        +

      Returns Promise<AsyncIterable<string, any, any>>

      An async iterable stream of text chunks.

      +
    diff --git a/docs/public/api-reference/classes/_quatrain_ai.AbstractAiAdapter.html b/docs/public/api-reference/classes/_quatrain_ai.AbstractAiAdapter.html index 4110eb2a..7db97f47 100644 --- a/docs/public/api-reference/classes/_quatrain_ai.AbstractAiAdapter.html +++ b/docs/public/api-reference/classes/_quatrain_ai.AbstractAiAdapter.html @@ -1,10 +1,15 @@ AbstractAiAdapter | Quatrain Core Documentation
    Quatrain Core Documentation
      Preparing search index...

      Class AbstractAiAdapterAbstract

      Abstract blueprint for AI model provider adapters.

      -

      Hierarchy (View Summary)

      Index

      Constructors

      Hierarchy (View Summary)

      Index

      Constructors

      Methods

      • Generate structured data from a prompt

        -

        Parameters

        • prompt: string
        • schema: any

          The expected output schema

          -
        • Optionaloptions: any

        Returns Promise<any>

      • Generate plain text from a prompt

        -

        Parameters

        • prompt: string
        • Optionaloptions: any

        Returns Promise<string>

      +

      Constructors

      Methods

      • Generate structured data from a prompt

        +

        Parameters

        • prompt: any
        • schema: any

          The expected output schema

          +
        • Optionaloptions: any

        Returns Promise<any>

      • Generate plain text from a prompt

        +

        Parameters

        • prompt: string
        • Optionaloptions: any

        Returns Promise<string>

      • Generate a streaming text response from a prompt.

        +

        Parameters

        • prompt: string

          The instruction or query.

          +
        • Optionaloptions: any

          Configuration options.

          +

        Returns Promise<AsyncIterable<string, any, any>>

        A promise resolving to an async iterable stream of text chunks.

        +
      diff --git a/docs/public/api-reference/classes/_quatrain_ai.Ai.html b/docs/public/api-reference/classes/_quatrain_ai.Ai.html index 8f8fbac7..3a2fc062 100644 --- a/docs/public/api-reference/classes/_quatrain_ai.Ai.html +++ b/docs/public/api-reference/classes/_quatrain_ai.Ai.html @@ -1,11 +1,11 @@ Ai | Quatrain Core Documentation
      Quatrain Core Documentation
        Preparing search index...

        Singleton to access the configured AI adapter

        -
        Index

        Constructors

        Index

        Constructors

        Properties

        Methods

        Constructors

        • Returns Ai

        Properties

        _adapter: AbstractAiAdapter | null = null

        Methods

        Constructors

        • Returns Ai

        Properties

        _adapter: AbstractAiAdapter | null = null

        Methods

        +

        Returns void

        diff --git a/docs/public/api-reference/classes/_quatrain_api-client.ApiClient.html b/docs/public/api-reference/classes/_quatrain_api-client.ApiClient.html index c0d75732..0c1577f9 100644 --- a/docs/public/api-reference/classes/_quatrain_api-client.ApiClient.html +++ b/docs/public/api-reference/classes/_quatrain_api-client.ApiClient.html @@ -1,6 +1,6 @@ ApiClient | Quatrain Core Documentation
        Quatrain Core Documentation
          Preparing search index...

          Universal isomorphic REST API Client for making structured requests towards a Quatrain backend or other standard REST APIs.

          -

          Implements

          Index

          Constructors

          Implements

          Index

          Constructors

          Properties

          Constructors

          Properties

          client: any

          Native HTTP client / wrapper.

          -
          debug: boolean = false

          Instance specific debug flag.

          -
          params: QueryOptions = {}

          Default request query parameters/options.

          -
          CACHE_ACTIVE: boolean = true

          Cache status flag.

          -
          CACHE_REMOVE: string = '__force_cache_removal__'

          Magic string indicating cache eviction.

          -
          CACHE_TTL: number = ...

          Default cache TTL in seconds.

          -
          debug: boolean = ...

          Controls detailed logging of the requests.

          -
          DEFAULT: string = 'default'

          Default instance name.

          -
          DEFAULT_ENDPOINT: string = 'api'

          Default API endpoint path.

          -
          DEFAULT_URL: string = ''

          Default base URL prefix.

          -

          Methods

          • Performs an HTTP DELETE request.

            +

          Constructors

          Properties

          client: any

          Native HTTP client / wrapper.

          +
          debug: boolean = false

          Instance specific debug flag.

          +
          params: QueryOptions = {}

          Default request query parameters/options.

          +
          CACHE_ACTIVE: boolean = true

          Cache status flag.

          +
          CACHE_REMOVE: string = '__force_cache_removal__'

          Magic string indicating cache eviction.

          +
          CACHE_TTL: number = ...

          Default cache TTL in seconds.

          +
          debug: boolean = ...

          Controls detailed logging of the requests.

          +
          DEFAULT: string = 'default'

          Default instance name.

          +
          DEFAULT_ENDPOINT: string = 'api'

          Default API endpoint path.

          +
          DEFAULT_URL: string = ''

          Default base URL prefix.

          +

          Methods

          • Performs an HTTP DELETE request.

            Parameters

            • endpoint: string

              The API path.

            • payload: object

              Optional body data for the delete request.

            Returns Promise<ApiPayload>

            The API response payload.

            -
          • Performs an HTTP PATCH request.

            Parameters

            • endpoint: string

              The API path.

            • payload: object

              The delta body data.

            Returns Promise<ApiPayload>

            The API response payload.

            -

          post

          post

          • post(endpoint: string, payload: object): Promise<ApiPayload>

            Performs an HTTP POST request.

            Parameters

            • endpoint: string

              The API path.

            • payload: object

              The body data.

            Returns Promise<ApiPayload>

            The API response payload.

            -
          • Performs an HTTP PUT request.

            Parameters

            • endpoint: string

              The API path.

            • payload: object

              The body data.

            Returns Promise<ApiPayload>

            The API response payload.

            -
          • Unified query dispatcher.

            Parameters

            • url: string

              The target endpoint.

            • method: Method = Method.GET

              The HTTP verb.

            • payload: object = {}

              The body content.

            • params: QueryOptions = {}

              Additional query strings and headers.

            Returns Promise<ApiPayload>

            A constructed Quatrain API response payload.

            -
          • Cache data access method (currently a stub).

            +

          Returns void

          • Cache data access method (currently a stub).

            Parameters

            • key: string

              The cache key.

            • data: any = undefined

              The data payload to store, or a signal to remove.

            Returns any

            The stored data or false.

            -
          • Generates a unique cache key based on the endpoint and query options.

            +
          • Generates a unique cache key based on the endpoint and query options.

            Parameters

            • endpoint: string

              The API endpoint.

            • options: any = null

              Additional query configurations.

            Returns string

            A string cache key.

            -
          • Retrieves or creates a named singleton instance of the ApiClient.

            Parameters

            • url: string | null = null

              Optional base URL.

            • name: string = ApiClient.DEFAULT

              Instance name.

            Returns ApiClient

            The ApiClient instance.

            -
          • Invalidates all cache entries starting with a specific prefix.

            Parameters

            • _prefix: string

              The prefix string to invalidate.

              -

            Returns void

          +

          Returns void

          diff --git a/docs/public/api-reference/classes/_quatrain_api-client.BasicAuthProvider.html b/docs/public/api-reference/classes/_quatrain_api-client.BasicAuthProvider.html index e50edfce..9bd08d7d 100644 --- a/docs/public/api-reference/classes/_quatrain_api-client.BasicAuthProvider.html +++ b/docs/public/api-reference/classes/_quatrain_api-client.BasicAuthProvider.html @@ -1,7 +1,7 @@ BasicAuthProvider | Quatrain Core Documentation
          Quatrain Core Documentation
            Preparing search index...

            Basic Authentication HTTP provider that sets Authorization: Basic <base64> headers using either a raw string or username/password combinations.

            -

            Implements

            Index

            Constructors

            Implements

            Index

            Constructors

            Methods

            Constructors

            Methods

            • Generates the structured auth headers for fetch.

              +

            Constructors

            Methods

            +
            diff --git a/docs/public/api-reference/classes/_quatrain_api-client.BearerAuthProvider.html b/docs/public/api-reference/classes/_quatrain_api-client.BearerAuthProvider.html index c0ed7700..c6a39cd6 100644 --- a/docs/public/api-reference/classes/_quatrain_api-client.BearerAuthProvider.html +++ b/docs/public/api-reference/classes/_quatrain_api-client.BearerAuthProvider.html @@ -1,7 +1,7 @@ BearerAuthProvider | Quatrain Core Documentation
            Quatrain Core Documentation
              Preparing search index...

              Bearer Authentication HTTP provider that sets Authorization: Bearer <token> headers. Accepts a static string or an asynchronous callback to resolve dynamic tokens.

              -

              Implements

              Index

              Constructors

              Implements

              Index

              Constructors

              Methods

              Constructors

              Methods

              • Generates the structured auth headers for fetch.

                +

              Constructors

              Methods

              +
              diff --git a/docs/public/api-reference/classes/_quatrain_api-client.OAuthProvider.html b/docs/public/api-reference/classes/_quatrain_api-client.OAuthProvider.html index 7de62991..4729b6ef 100644 --- a/docs/public/api-reference/classes/_quatrain_api-client.OAuthProvider.html +++ b/docs/public/api-reference/classes/_quatrain_api-client.OAuthProvider.html @@ -2,8 +2,8 @@ Expects an asynchronous callback that returns an active Access Token. It is up to the developer to provide a callback that handles token refreshing (e.g. using oidc-client-ts or a custom fetch).

              -

              Implements

              Index

              Constructors

              Implements

              Index

              Constructors

              Methods

              Constructors

              Methods

              • Generates the structured auth headers by invoking the dynamic OAuth fetcher callback.

                +

              Constructors

              Methods

              • Generates the structured auth headers by invoking the dynamic OAuth fetcher callback.

                Returns Promise<Record<string, string>>

                A promise resolving to the headers record.

                -
              +
              diff --git a/docs/public/api-reference/classes/_quatrain_api-server-astro.AstroAdapter.html b/docs/public/api-reference/classes/_quatrain_api-server-astro.AstroAdapter.html new file mode 100644 index 00000000..5b38111d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_api-server-astro.AstroAdapter.html @@ -0,0 +1,57 @@ +AstroAdapter | Quatrain Core Documentation
              Quatrain Core Documentation
                Preparing search index...

                Api Server adapter wrapping the Astro API environment. +Maps Quatrain's standardized ServerAdapter interfaces to web standards (Request/Response) used by Astro.

                +

                Implements

                Index

                Constructors

                • Instantiates a new AstroAdapter.

                  +

                  Parameters

                  • prefix: string = ''

                    Prefix URL segment (e.g. '/api').

                    +
                  • OptionalroutesRef: RegisteredRoute[]

                    Internal reference sharing existing routes list.

                    +
                  • OptionalmiddlewaresRef: ApiMiddleware[]

                    Internal reference sharing existing middlewares.

                    +

                  Returns AstroAdapter

                Methods

                • Returns an Astro APIRoute handler that resolves dynamic catch-all route matching.

                  +

                  Returns any

                  The compiled Astro APIRoute handler.

                  +

                post

                • Stub serving static files (handled natively by Astro).

                  +

                  Parameters

                  • folderPath: string

                    Public filesystem directory.

                    +
                  • OptionalapiPrefix: string

                    Endpoint segment prefix.

                    +

                  Returns void

                • Stub starting the server environment (handled natively by Astro).

                  +

                  Parameters

                  • port: number

                    Target port.

                    +
                  • Optionalcallback: () => void

                    Optional completion routine.

                    +

                  Returns void

                • Appends middleware routines to the router execution flow.

                  +

                  Parameters

                  • middleware: any

                    The middleware callback function.

                    +

                  Returns void

                • Static helper to wrap a single Quatrain ApiHandler into a native Astro APIRoute.

                  +

                  Parameters

                  • handler: ApiHandler

                    The Quatrain API action handler.

                    +

                  Returns any

                  The wrapped Astro APIRoute execution callback.

                  +
                diff --git a/docs/public/api-reference/classes/_quatrain_api-server-express.ExpressAdapter.html b/docs/public/api-reference/classes/_quatrain_api-server-express.ExpressAdapter.html new file mode 100644 index 00000000..c4551449 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_api-server-express.ExpressAdapter.html @@ -0,0 +1,48 @@ +ExpressAdapter | Quatrain Core Documentation
                Quatrain Core Documentation
                  Preparing search index...

                  Api Server adapter wrapping the express framework. +Maps Quatrain's standardized ServerAdapter interfaces to native Express mechanisms.

                  +

                  Implements

                  Index

                  Constructors

                  • Parameters

                    • appOrRouter: Application | Router = ...
                    • config: { apiPrefix?: string } = {}

                    Returns ExpressAdapter

                  Methods

                  post

                  • Configures the server to serve static files from a specified folder. +It also sets up a fallback route for SPA (Single Page Application) navigation, +ensuring that non-API routes return the main index.html file.

                    +

                    Parameters

                    • folderPath: string

                      The absolute path to the directory containing static files (e.g. built frontend).

                      +
                    • apiPrefix: string = '/api'

                      The prefix used for API routes, which will be ignored by the SPA fallback. Defaults to '/api'.

                      +

                    Returns void

                  • Binds the server to the network and starts listening.

                    +

                    Parameters

                    • port: number

                      The network port.

                      +
                    • Optionalcallback: () => void

                      Optional completion callback.

                      +

                    Returns void

                  • Attaches a native Express middleware or sub-router.

                    +

                    Parameters

                    • middleware: any

                      The Express RequestHandler or Router.

                      +

                    Returns void

                  diff --git a/docs/public/api-reference/classes/_quatrain_api-xmlrpc.XmlRpcClient.html b/docs/public/api-reference/classes/_quatrain_api-xmlrpc.XmlRpcClient.html new file mode 100644 index 00000000..6ccb3fae --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_api-xmlrpc.XmlRpcClient.html @@ -0,0 +1,10 @@ +XmlRpcClient | Quatrain Core Documentation
                  Quatrain Core Documentation
                    Preparing search index...

                    Promise-based wrapper around the XML-RPC protocol client.

                    +
                    Index

                    Constructors

                    Methods

                    Constructors

                    Methods

                    • Performs an XML-RPC method call and returns a Promise resolving to the value.

                      +

                      Parameters

                      • method: string

                        The name of the remote procedure to execute.

                        +
                      • args: any[]

                        The arguments array to pass to the remote procedure.

                        +

                      Returns Promise<any>

                      A promise resolving to the result of the method call.

                      +
                    diff --git a/docs/public/api-reference/classes/_quatrain_api.Api.html b/docs/public/api-reference/classes/_quatrain_api.Api.html index 364d80bd..30a2acd5 100644 --- a/docs/public/api-reference/classes/_quatrain_api.Api.html +++ b/docs/public/api-reference/classes/_quatrain_api.Api.html @@ -1,5 +1,5 @@ Api | Quatrain Core Documentation
                    Quatrain Core Documentation
                      Preparing search index...

                      Core registry for managing and retrieving configured API Server instances.

                      -

                      Hierarchy

                      • Core
                        • Api
                      Index

                      Constructors

                      Hierarchy (View Summary)

                      Index

                      Constructors

                      Properties

                      Constructors

                      • Returns Api

                      Properties

                      classRegistry: { [key: string]: any } = {}

                      Dictionary holding registered active Quatrain models/components.

                      -
                      logger: any = ...

                      Core logger dedicated to Api actions.

                      -
                      logLevel: DEBUG = LogLevel.DEBUG

                      System-wide base log verbosity.

                      -
                      me: string = ...

                      Identifying namespace for this core component.

                      -
                      storage: any = ...

                      Persistent key-value storage engine reference.

                      -
                      storagePrefix: "core" = 'core'

                      Context prefix string for scoped storage keys.

                      -

                      Accessors

                      • get userClass(): any

                        Returns any

                      • set userClass(cls: any): void

                        Parameters

                        • cls: any

                        Returns void

                      Methods

                      • Maps a specific entity class to an active name so the factory reflection can locate it.

                        +

                      Constructors

                      Properties

                      classRegistry: { [key: string]: any } = {}

                      Dictionary holding registered active Quatrain models/components.

                      +
                      logger: any = ...

                      Core logger dedicated to Api actions.

                      +
                      logLevel: DEBUG = LogLevel.DEBUG

                      System-wide base log verbosity.

                      +
                      me: string = ...

                      Identifying namespace for this core component.

                      +
                      storage: typeof NodePersist = persist

                      Persistent key-value storage engine reference.

                      +
                      storagePrefix: "core" = 'core'

                      Context prefix string for scoped storage keys.

                      +

                      Accessors

                      • get userClass(): any

                        Returns any

                      • set userClass(cls: any): void

                        Parameters

                        • cls: any

                        Returns void

                      Methods

                      • Maps a specific entity class to an active name so the factory reflection can locate it.

                        Parameters

                        • name: string

                          Semantic registry name.

                        • obj: any

                          Class constructor.

                          -

                        Returns void

                      • Stores a primitive value durably in the core storage instance.

                        +

                      Returns void

                      • Stores a primitive value durably in the core storage instance.

                        Parameters

                        • key: string

                          Identification string.

                        • value: any

                          Value.

                          -

                        Returns Promise<void>

                      • Injects a new logger block under a specific namespace alias.

                        +

                      Returns Promise<void>

                      • Injects a new logger block under a specific namespace alias.

                        Parameters

                        • alias: string = ...

                          The logging context name.

                        Returns any

                        Instantiated LoggerAdapter.

                        -
                      • Registers a new server adapter in the global registry.

                        Parameters

                        • adapter: ServerAdapter

                          The server adapter instance.

                        • name: string = 'default'

                          The identifier for this server. Defaults to 'default'.

                          -

                        Returns void

                      • Triggers a debug log on the core logger.

                        +

                      Returns void

                      • Triggers a debug log on the core logger.

                        Parameters

                        • ...message: any

                          Content to log.

                          -

                        Returns void

                      • Deprecated: Reserved schema definition hook.

                        +

                      Returns void

                      • Deprecated: Reserved schema definition hook.

                        Parameters

                        • key: string

                          The property block to generate.

                        Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                        Field definitions block.

                        -
                      • Triggers an error log on the core logger.

                        Parameters

                        • ...message: any

                          Content to log.

                          -

                        Returns void

                      • Execute an external command in a promise

                        +

                      Returns void

                      • Returns an injected class constructor by its registry identifier.

                        Parameters

                        • name: string

                          The semantic name to resolve.

                        Returns any

                        Class definition.

                        -
                      • Recovers a durably persisted value from the storage layer.

                        Parameters

                        • key: string

                          The target identifier.

                        Returns Promise<any>

                        The recovered value.

                        -
                      • Retrieves a server adapter from the global registry.

                        Parameters

                        • name: string = 'default'

                          The identifier for the server. Defaults to 'default'.

                        Returns ServerAdapter

                        The server adapter instance.

                        Error if the server adapter is not found.

                        -
                      • Utility lookup to find executable paths in the system using which.

                        +
                      • Utility lookup to find executable paths in the system using which.

                        Parameters

                        • command: string

                          The executable.

                        Returns Promise<string>

                        The resolved system path.

                        -
                      • Triggers an info log on the core logger.

                        Parameters

                        • ...message: any

                          Content to log.

                          -

                        Returns void

                      • Triggers a standard log on the core logger.

                        +

                      Returns void

                      • Triggers a standard log on the core logger.

                        Parameters

                        • ...message: any

                          Content to log.

                          -

                        Returns void

                      • Mutates the underlying verbosity constraints.

                        -

                        Parameters

                        • level: LogLevel

                          Active LogLevel filter.

                          -

                        Returns void

                      • Execution suspension utility blocking the event loop context.

                        +

                      Returns void

                      • Execution suspension utility blocking the event loop context.

                        Parameters

                        • seconds: number = 1

                          Duration count.

                        Returns Promise<unknown>

                        The promise to await.

                        -
                      • Returns an ISO string representing the current time.

                        -

                        Returns string

                      • Triggers a trace log on the core logger.

                        Parameters

                        • ...message: any

                          Content to log.

                          -

                        Returns void

                      • Triggers a warning log on the core logger.

                        +

                      Returns void

                      • Triggers a warning log on the core logger.

                        Parameters

                        • ...message: any

                          Content to log.

                          -

                        Returns void

                      +

                      Returns void

                      diff --git a/docs/public/api-reference/classes/_quatrain_api.HttpHelper.html b/docs/public/api-reference/classes/_quatrain_api.HttpHelper.html index 4ec8b4b5..3ae6088e 100644 --- a/docs/public/api-reference/classes/_quatrain_api.HttpHelper.html +++ b/docs/public/api-reference/classes/_quatrain_api.HttpHelper.html @@ -1,6 +1,11 @@ -HttpHelper | Quatrain Core Documentation
                      Quatrain Core Documentation
                        Preparing search index...

                        Class HttpHelper

                        Index

                        Constructors

                        constructor +HttpHelper | Quatrain Core Documentation
                        Quatrain Core Documentation
                          Preparing search index...

                          Class HttpHelper

                          Static utility helpers for processing standard HTTP request parameters and headers.

                          +
                          Index

                          Constructors

                          Methods

                          • Extracts username and password credentials from a Basic Authorization header.

                            -

                            Parameters

                            • authorization: string | undefined

                            Returns { pass: string; user: string } | null

                          • Extracts a bearer token from an Authorization header.

                            -

                            Parameters

                            • authorization: string | undefined

                            Returns string

                          +

                          Parameters

                          • authorization: string | undefined

                            The raw Authorization header string (e.g. 'Basic ').

                            +

                          Returns { pass: string; user: string } | null

                          An object containing the user and pass properties, or null if parsing fails.

                          +
                          • Extracts a bearer token from an Authorization header.

                            +

                            Parameters

                            • authorization: string | undefined

                              The raw Authorization header string (e.g. 'Bearer ').

                              +

                            Returns string

                            The extracted token string, or an empty string if invalid or missing.

                            +
                          diff --git a/docs/public/api-reference/classes/_quatrain_app.AppBootloader.html b/docs/public/api-reference/classes/_quatrain_app.AppBootloader.html new file mode 100644 index 00000000..e4254429 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_app.AppBootloader.html @@ -0,0 +1,5 @@ +AppBootloader | Quatrain Core Documentation
                          Quatrain Core Documentation
                            Preparing search index...

                            Class AppBootloader

                            Central initialization registry that boots the application environment from a JSON configuration.

                            +
                            Index

                            Constructors

                            Methods

                            Constructors

                            Methods

                            • Charge la configuration JSON et initialise tous les Adapters.

                              +

                              Parameters

                              • configPath: string = 'quatrain.json'

                              Returns Promise<void>

                            diff --git a/docs/public/api-reference/classes/_quatrain_app.AppInfra.html b/docs/public/api-reference/classes/_quatrain_app.AppInfra.html new file mode 100644 index 00000000..4d054a26 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_app.AppInfra.html @@ -0,0 +1,9 @@ +AppInfra | Quatrain Core Documentation
                            Quatrain Core Documentation
                              Preparing search index...

                              Class AppInfra

                              Manages the local deployment infrastructure lifecycle (start/stop) using podman-compose/docker-compose.

                              +
                              Index

                              Constructors

                              Methods

                              Constructors

                              Methods

                              • Démarrer l'infrastructure locale (bases de données, storages, brokers) +via podman-compose ou docker-compose +Si une configuration est fournie, génère d'abord les fichiers compose.yaml et .env dans le dossier app/

                                +

                                Parameters

                                • config: Record<string, any>
                                • OptionalonProgress: (
                                      event: {
                                          message: string;
                                          status: "error" | "running" | "success";
                                          step: string;
                                      },
                                  ) => void

                                Returns Promise<void>

                              • Arrêter l'infrastructure locale

                                +

                                Parameters

                                • config: Record<string, any>

                                Returns Promise<void>

                              diff --git a/docs/public/api-reference/classes/_quatrain_app.CodeGenerator.html b/docs/public/api-reference/classes/_quatrain_app.CodeGenerator.html new file mode 100644 index 00000000..9a44f722 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_app.CodeGenerator.html @@ -0,0 +1,5 @@ +CodeGenerator | Quatrain Core Documentation
                              Quatrain Core Documentation
                                Preparing search index...

                                Class CodeGenerator

                                Responsible for generating application boilerplate code and scaffolding out project structures.

                                +
                                Index

                                Constructors

                                Methods

                                Constructors

                                Methods

                                • Génère une application complète dans le dossier cible

                                  +

                                  Parameters

                                  • config: any
                                  • targetDir: string

                                  Returns void

                                diff --git a/docs/public/api-reference/classes/_quatrain_app.InfraBuilder.html b/docs/public/api-reference/classes/_quatrain_app.InfraBuilder.html new file mode 100644 index 00000000..f88338df --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_app.InfraBuilder.html @@ -0,0 +1,5 @@ +InfraBuilder | Quatrain Core Documentation
                                Quatrain Core Documentation
                                  Preparing search index...

                                  Class InfraBuilder

                                  Generates compose and dockerfile specifications dynamically based on application configurations.

                                  +
                                  Index

                                  Constructors

                                  Methods

                                  Constructors

                                  Methods

                                  • Génère le contenu des fichiers compose.yaml, .env et Containerfile en fonction de la configuration de l'application

                                    +

                                    Parameters

                                    • config: any
                                    • OptionalappName: string

                                    Returns { compose: string; dockerfile: string; env: string }

                                  diff --git a/docs/public/api-reference/classes/_quatrain_auth-firebase.FirebaseAuthAdapter.html b/docs/public/api-reference/classes/_quatrain_auth-firebase.FirebaseAuthAdapter.html new file mode 100644 index 00000000..9af63caf --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-firebase.FirebaseAuthAdapter.html @@ -0,0 +1,64 @@ +FirebaseAuthAdapter | Quatrain Core Documentation
                                  Quatrain Core Documentation
                                    Preparing search index...

                                    Authentication adapter implementing the Google Firebase Auth ecosystem. +Handles server-side validation of JWTs and admin functions via firebase-admin.

                                    +

                                    Hierarchy (View Summary)

                                    Index

                                    Constructors

                                    Properties

                                    _alias: string = ''
                                    _params: AuthParameters = {}
                                    UserClass: typeof User = User

                                    The User class reference to be used by the adapter.

                                    +

                                    Accessors

                                    Methods

                                    • User authentication flow (Not natively supported on Firebase Admin Server SDK). +Usually handled on the client.

                                      +

                                      Parameters

                                      • login: string

                                        Email address.

                                        +
                                      • password: string

                                        Plain password.

                                        +

                                      Returns Promise<void>

                                    diff --git a/docs/public/api-reference/classes/_quatrain_auth-github.GithubAuthAdapter.html b/docs/public/api-reference/classes/_quatrain_auth-github.GithubAuthAdapter.html new file mode 100644 index 00000000..4360e9e0 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-github.GithubAuthAdapter.html @@ -0,0 +1,82 @@ +GithubAuthAdapter | Quatrain Core Documentation
                                    Quatrain Core Documentation
                                      Preparing search index...

                                      Authentication adapter for GitHub OAuth 2.0 Web Application Flow. +Handles profiles, repository existence checks, and repository creation.

                                      +

                                      Hierarchy (View Summary)

                                      Index

                                      Constructors

                                      Properties

                                      _alias: string = ''
                                      _authorizationEndpoint: string = 'https://github.com/login/oauth/authorize'
                                      _params: AuthParameters = {}
                                      _tokenEndpoint: string = 'https://github.com/login/oauth/access_token'
                                      _userProfileEndpoint: string = 'https://api.github.com/user'
                                      UserClass: typeof User = User

                                      The User class reference to be used by the adapter.

                                      +

                                      Accessors

                                      Methods

                                      • Custom GitHub API call to check repository existence.

                                        +

                                        Parameters

                                        • accessToken: string
                                        • owner: string
                                        • name: string

                                        Returns Promise<boolean>

                                      • Custom GitHub API call to create a repository.

                                        +

                                        Parameters

                                        • accessToken: string
                                        • name: string
                                        • options: { autoInit?: boolean; description?: string; private?: boolean } = {}

                                        Returns Promise<any>

                                      • Exchanges the temporary authorization code for an access token packet.

                                        +

                                        Parameters

                                        • code: string

                                          The temporary auth code.

                                          +
                                        • OptionalredirectUri: string

                                          Optional redirect URL context.

                                          +

                                        Returns Promise<any>

                                        Access token payload.

                                        +
                                      • Returns the authorization redirect URL.

                                        +

                                        Parameters

                                        • OptionalredirectUri: string

                                          The callback URL.

                                          +
                                        • scopes: string[] = []

                                          The requested authorization scopes.

                                          +
                                        • Optionalstate: string

                                          The state parameters for CSRF protection.

                                          +

                                        Returns string

                                        The generated authorization URL.

                                        +
                                      • Refreshes an expired access token using a refresh token string.

                                        +

                                        Parameters

                                        • refreshToken: string

                                          Target refresh token.

                                          +

                                        Returns Promise<any>

                                        Throws an error if refresh token logic is not implemented by the provider.

                                        +
                                      • Registers a new user account (unsupported for OAuth adapters).

                                        +

                                        Parameters

                                        • user: User

                                          Target user entity.

                                          +
                                        • OptionalclearPassword: string

                                          Optional cleartext password.

                                          +

                                        Returns Promise<any>

                                        Throws an error indicating registration is unsupported.

                                        +
                                      • Performs user signup with credentials (unsupported for OAuth adapters).

                                        +

                                        Parameters

                                        • login: string

                                          Login identifier string.

                                          +
                                        • password: string

                                          Password string.

                                          +

                                        Returns Promise<any>

                                        Throws an error indicating signup should use exchangeCodeForToken.

                                        +
                                      diff --git a/docs/public/api-reference/classes/_quatrain_auth-http-basic.AuthBasic.html b/docs/public/api-reference/classes/_quatrain_auth-http-basic.AuthBasic.html new file mode 100644 index 00000000..59781872 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-http-basic.AuthBasic.html @@ -0,0 +1,16 @@ +AuthBasic | Quatrain Core Documentation
                                      Quatrain Core Documentation
                                        Preparing search index...

                                        A rudimentary Basic Authentication implementation (RFC 7617). +Parses Authorization: Basic <base64> headers for hardcoded credentials.

                                        +
                                        Index

                                        Constructors

                                        Methods

                                        Constructors

                                        • Instantiates a new AuthBasic verifier with target credentials.

                                          +

                                          Parameters

                                          • user: string

                                            The expected username.

                                            +
                                          • pass: string

                                            The expected password.

                                            +

                                          Returns AuthBasic

                                        Methods

                                        • Returns an Express-compatible API middleware. +Validates the request headers against the configured Basic credentials.

                                          +

                                          Returns ApiMiddleware

                                          The middleware function.

                                          +
                                        • Instantiates a new Basic Auth verifier.

                                          +

                                          Parameters

                                          • OptionaluserOrConfig: any

                                            Username string, or a config object containing {user, pass}.

                                            +
                                          • Optionalpass: string

                                            Password string.

                                            +

                                          Returns AuthBasic | null

                                          The generated instance, or null if params are invalid.

                                          +
                                        diff --git a/docs/public/api-reference/classes/_quatrain_auth-oidc.AuthOIDC.html b/docs/public/api-reference/classes/_quatrain_auth-oidc.AuthOIDC.html new file mode 100644 index 00000000..668c2194 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-oidc.AuthOIDC.html @@ -0,0 +1,9 @@ +AuthOIDC | Quatrain Core Documentation
                                        Quatrain Core Documentation
                                          Preparing search index...

                                          OpenID Connect provider factory implementing oidc-provider. +Can be used to run a fully functional OAuth2 / OIDC server locally.

                                          +
                                          Index

                                          Constructors

                                          Methods

                                          Constructors

                                          Methods

                                          • Creates an OIDC Provider instance.

                                            +

                                            Parameters

                                            • issuer: string

                                              The base URL issuer (e.g. http://localhost:3000).

                                              +
                                            • Optionalconfig: any

                                              Overrides for the underlying OIDC configuration.

                                              +

                                            Returns any

                                            An oidc-provider instance.

                                            +
                                          diff --git a/docs/public/api-reference/classes/_quatrain_auth-pocketbase.PocketBaseAuthAdapter.html b/docs/public/api-reference/classes/_quatrain_auth-pocketbase.PocketBaseAuthAdapter.html new file mode 100644 index 00000000..a8f2ed4f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-pocketbase.PocketBaseAuthAdapter.html @@ -0,0 +1,64 @@ +PocketBaseAuthAdapter | Quatrain Core Documentation
                                          Quatrain Core Documentation
                                            Preparing search index...

                                            Authentication adapter implementing the PocketBase backend logic. +Exposes login, registration, and token management via the official pocketbase JS SDK.

                                            +

                                            Hierarchy (View Summary)

                                            Index

                                            Constructors

                                            Properties

                                            _alias: string = ''
                                            _client: Client
                                            _params: AuthParameters = {}
                                            UserClass: typeof User = User

                                            The User class reference to be used by the adapter.

                                            +

                                            Accessors

                                            Methods

                                            • Authenticates a user against PocketBase via email and password.

                                              +

                                              Parameters

                                              • login: string

                                                Login identifier.

                                                +
                                              • password: string

                                                Plaintext password.

                                                +

                                              Returns Promise<any>

                                              The authenticated session wrapper containing user state and the JWT token.

                                              +
                                            diff --git a/docs/public/api-reference/classes/_quatrain_auth-rbac.AbstractRbacMiddleware.html b/docs/public/api-reference/classes/_quatrain_auth-rbac.AbstractRbacMiddleware.html new file mode 100644 index 00000000..57a5e80e --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-rbac.AbstractRbacMiddleware.html @@ -0,0 +1,22 @@ +AbstractRbacMiddleware | Quatrain Core Documentation
                                            Quatrain Core Documentation
                                              Preparing search index...

                                              Class AbstractRbacMiddleware<TRequest, TResponse, TNext>Abstract

                                              Abstract base class for framework-specific RBAC middlewares (Express, Astro, etc.). +Coordinates route access decisions, user context resolution, FLS helper injection, and tarpitting.

                                              +

                                              Type Parameters

                                              • TRequest = any
                                              • TResponse = any
                                              • TNext = any

                                              Hierarchy (View Summary)

                                              Index

                                              Constructors

                                              Properties

                                              Methods

                                              • Handles access denial according to request context (e.g. JSON error for API, redirect/403 for HTML pages).

                                                +

                                                Parameters

                                                • request: TRequest

                                                  Native request object.

                                                  +
                                                • response: TResponse

                                                  Native response object.

                                                  +
                                                • reason: "unauthenticated" | "forbidden" | "tarpit_blocked"

                                                  Denial rationale ('unauthenticated' | 'forbidden' | 'tarpit_blocked').

                                                  +

                                                Returns any

                                              diff --git a/docs/public/api-reference/classes/_quatrain_auth-rbac.AstroRbacMiddleware.html b/docs/public/api-reference/classes/_quatrain_auth-rbac.AstroRbacMiddleware.html new file mode 100644 index 00000000..ad57b67f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-rbac.AstroRbacMiddleware.html @@ -0,0 +1,25 @@ +AstroRbacMiddleware | Quatrain Core Documentation
                                              Quatrain Core Documentation
                                                Preparing search index...

                                                Astro middleware implementing Quatrain RBAC route guards, FLS context injection and tarpit delays. +Unifies API endpoints (JSON responses) and SSR pages (redirects / forbidden status).

                                                +

                                                Hierarchy (View Summary)

                                                Index

                                                Constructors

                                                Properties

                                                Methods

                                                • Handles access denial by returning JSON for API endpoints or a redirect Response for HTML pages.

                                                  +

                                                  Parameters

                                                  • context: AstroLikeContext

                                                    The Astro request context.

                                                    +
                                                  • _res: any

                                                    Response placeholder.

                                                    +
                                                  • reason: "unauthenticated" | "forbidden" | "tarpit_blocked"

                                                    Denial rationale ('unauthenticated' | 'forbidden' | 'tarpit_blocked').

                                                    +

                                                  Returns Response

                                                  Astro standard Response.

                                                  +
                                                diff --git a/docs/public/api-reference/classes/_quatrain_auth-rbac.ExpressRbacMiddleware.html b/docs/public/api-reference/classes/_quatrain_auth-rbac.ExpressRbacMiddleware.html new file mode 100644 index 00000000..59c30827 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-rbac.ExpressRbacMiddleware.html @@ -0,0 +1,23 @@ +ExpressRbacMiddleware | Quatrain Core Documentation
                                                Quatrain Core Documentation
                                                  Preparing search index...

                                                  Class ExpressRbacMiddleware

                                                  Express middleware implementing Quatrain RBAC route guards, FLS context injection and tarpit delays.

                                                  +

                                                  Hierarchy (View Summary)

                                                  Index

                                                  Constructors

                                                  Properties

                                                  Methods

                                                  diff --git a/docs/public/api-reference/classes/_quatrain_auth-rbac.RbacPolicyEngine.html b/docs/public/api-reference/classes/_quatrain_auth-rbac.RbacPolicyEngine.html new file mode 100644 index 00000000..c8e00c0c --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-rbac.RbacPolicyEngine.html @@ -0,0 +1,45 @@ +RbacPolicyEngine | Quatrain Core Documentation
                                                  Quatrain Core Documentation
                                                    Preparing search index...

                                                    Isomorphic RBAC and Field-Level Security Engine for Quatrain. +Manages role hierarchies, route authorizations, payload sanitization, and M2M tarpitting.

                                                    +
                                                    Index

                                                    Constructors

                                                    Properties

                                                    tarpitManager: TarpitManager

                                                    Dedicated manager handling rate-limiting, anomaly detection, and intentional tarpitting latency.

                                                    +

                                                    Methods

                                                    • Evaluates route access for a user context against a target URI and semantic action (or HTTP method).

                                                      +

                                                      Parameters

                                                      • user: RbacUserContext

                                                        Authenticated user context.

                                                        +
                                                      • uri: string

                                                        Requested URI path.

                                                        +
                                                      • actionOrMethod: string = 'READ'

                                                        Semantic action ('READ', 'WRITE', 'UPDATE', 'DELETE') or HTTP method ("GET", "POST"...).

                                                        +

                                                      Returns RouteEvaluationResult

                                                      Detailed evaluation result including allow/deny decision and tarpit latency.

                                                      +
                                                    • Computes the effective Field Access Mode ('hidden' | 'readonly' | 'readwrite') +for a specific entity property across all assigned roles.

                                                      +

                                                      Precedence: 'readwrite' (2) > 'readonly' (1) > 'hidden' (0).

                                                      +

                                                      Parameters

                                                      • user: RbacUserContext

                                                        Authenticated user context.

                                                        +
                                                      • entity: string

                                                        Entity name (e.g. "okf-document").

                                                        +
                                                      • property: string

                                                        Property/field name (e.g. "soa", "internalNotes").

                                                        +

                                                      Returns FieldAccessMode

                                                      FieldAccessMode.

                                                      +
                                                    • Resolves the full list of inherited and direct roles for a given set of role IDs.

                                                      +

                                                      Parameters

                                                      • roleIds: string[]

                                                        Assigned role identifiers.

                                                        +
                                                      • visited: Set<string> = ...

                                                        Cycle detection tracker.

                                                        +

                                                      Returns RoleDefinition[]

                                                      Array of all active RoleDefinition instances.

                                                      +
                                                    • Generic sanitization helper for either 'read' or 'write' operations.

                                                      +

                                                      Type Parameters

                                                      • T extends Record<string, any>

                                                      Parameters

                                                      Returns Partial<T>

                                                    • Sanitizes an outgoing read payload by removing all properties marked as 'hidden'.

                                                      +

                                                      Type Parameters

                                                      • T extends Record<string, any>

                                                      Parameters

                                                      • user: RbacUserContext

                                                        Authenticated user context.

                                                        +
                                                      • entity: string

                                                        Entity name.

                                                        +
                                                      • payload: T

                                                        Data object to sanitize.

                                                        +

                                                      Returns Partial<T>

                                                      Filtered object.

                                                      +
                                                    • Sanitizes an incoming write payload by stripping any properties marked as 'hidden' or 'readonly'. +Only properties explicitly in 'readwrite' mode are preserved.

                                                      +

                                                      Type Parameters

                                                      • T extends Record<string, any>

                                                      Parameters

                                                      • user: RbacUserContext

                                                        Authenticated user context.

                                                        +
                                                      • entity: string

                                                        Entity name.

                                                        +
                                                      • payload: T

                                                        Incoming update data.

                                                        +

                                                      Returns Partial<T>

                                                      Safe object containing only writable fields.

                                                      +
                                                    diff --git a/docs/public/api-reference/classes/_quatrain_auth-rbac.TarpitManager.html b/docs/public/api-reference/classes/_quatrain_auth-rbac.TarpitManager.html new file mode 100644 index 00000000..92525c62 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-rbac.TarpitManager.html @@ -0,0 +1,15 @@ +TarpitManager | Quatrain Core Documentation
                                                    Quatrain Core Documentation
                                                      Preparing search index...

                                                      TarpitManager manages rate limiting, anomaly throttling, and intentional latency injection (tarpitting). +Designed to neutralize aggressive scraping, brute-force attempts, and runaway AI agent loops.

                                                      +
                                                      Index

                                                      Constructors

                                                      Methods

                                                      Constructors

                                                      Methods

                                                      • Evaluates request traffic for a given subject key and returns the required tarpit delay or blocking decision.

                                                        +

                                                        Parameters

                                                        • subjectKey: string

                                                          Unique identifier for the subject (e.g. user:123, agent:curator-bot, ip:192.168.1.1).

                                                          +
                                                        • Optionalconfig: TarpitRuleConfig

                                                          Tarpit configuration rules.

                                                          +

                                                        Returns { delayMs: number; isBlocked: boolean; isThrottled: boolean }

                                                        An object containing the delay to sleep (in ms) and throttling flags.

                                                        +
                                                      • Resets traffic history for a specific subject or clears all records.

                                                        +

                                                        Parameters

                                                        • OptionalsubjectKey: string

                                                          Optional subject key to reset.

                                                          +

                                                        Returns void

                                                      • Injects an intentional asynchronous delay into the execution loop (tarpitting).

                                                        +

                                                        Parameters

                                                        • delayMs: number

                                                          Duration in milliseconds to delay.

                                                          +

                                                        Returns Promise<void>

                                                      diff --git a/docs/public/api-reference/classes/_quatrain_auth-supabase.SupabaseAuthAdapter.html b/docs/public/api-reference/classes/_quatrain_auth-supabase.SupabaseAuthAdapter.html new file mode 100644 index 00000000..04f788dc --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth-supabase.SupabaseAuthAdapter.html @@ -0,0 +1,67 @@ +SupabaseAuthAdapter | Quatrain Core Documentation
                                                      Quatrain Core Documentation
                                                        Preparing search index...

                                                        Authentication adapter implementing the Supabase SDK ecosystem. +Acts as a centralized bridge handling signup, tokens, and middleware enforcement.

                                                        +

                                                        Hierarchy (View Summary)

                                                        Index

                                                        Constructors

                                                        Properties

                                                        _alias: string = ''
                                                        _client: any
                                                        _params: AuthParameters = {}
                                                        UserClass: typeof User = User

                                                        The User class reference to be used by the adapter.

                                                        +

                                                        Accessors

                                                        Methods

                                                        • Executes a direct login / session instantiation via signInWithPassword.

                                                          +

                                                          Parameters

                                                          • login: string

                                                            Email string.

                                                            +
                                                          • password: string

                                                            Raw password.

                                                            +

                                                          Returns Promise<false | { session: any; user: any }>

                                                          Resolved user session.

                                                          +
                                                        diff --git a/docs/public/api-reference/classes/_quatrain_auth.AbstractAuthAdapter.html b/docs/public/api-reference/classes/_quatrain_auth.AbstractAuthAdapter.html new file mode 100644 index 00000000..94d6fbc0 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth.AbstractAuthAdapter.html @@ -0,0 +1,68 @@ +AbstractAuthAdapter | Quatrain Core Documentation
                                                        Quatrain Core Documentation
                                                          Preparing search index...

                                                          Class AbstractAuthAdapterAbstract

                                                          Abstract base class that defines the contract for all authentication adapters. +Implementations should adapt standard authentication methods to specific providers +(e.g. Firebase, Supabase, basic auth).

                                                          +

                                                          Hierarchy (View Summary)

                                                          Implements

                                                          Index

                                                          Constructors

                                                          Properties

                                                          _alias: string = ''
                                                          _params: AuthParameters = {}
                                                          UserClass: typeof User = User

                                                          The User class reference to be used by the adapter.

                                                          +

                                                          Accessors

                                                          Methods

                                                          • Initiates password recovery/reset process for a user.

                                                            +

                                                            Parameters

                                                            • email: string

                                                              The user email.

                                                              +
                                                            • OptionalredirectTo: string

                                                              Optional redirect destination.

                                                              +

                                                            Returns Promise<any>

                                                          • Injects custom claims (e.g. role, tenant info) into the user's token structure.

                                                            +

                                                            Parameters

                                                            • id: string

                                                              The user ID.

                                                              +
                                                            • claims: any

                                                              The payload of claims to merge.

                                                              +

                                                            Returns any

                                                            Action response from the provider.

                                                            +
                                                          • Authenticates a user by login and password (generates tokens).

                                                            +

                                                            Parameters

                                                            • login: string

                                                              User's email or login name.

                                                              +
                                                            • password: string

                                                              Plaintext password.

                                                              +

                                                            Returns Promise<any>

                                                            A promise resolving to the token payload.

                                                            +
                                                          • Updates user credentials or metadata within the external auth provider.

                                                            +

                                                            Parameters

                                                            • user: User

                                                              The User to modify.

                                                              +
                                                            • updatable: any

                                                              The delta payload of properties to update.

                                                              +

                                                            Returns Promise<any>

                                                            A promise resolving when the update completes.

                                                            +
                                                          diff --git a/docs/public/api-reference/classes/_quatrain_auth.AbstractOAuthAdapter.html b/docs/public/api-reference/classes/_quatrain_auth.AbstractOAuthAdapter.html new file mode 100644 index 00000000..1d28e8d7 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth.AbstractOAuthAdapter.html @@ -0,0 +1,79 @@ +AbstractOAuthAdapter | Quatrain Core Documentation
                                                          Quatrain Core Documentation
                                                            Preparing search index...

                                                            Class AbstractOAuthAdapterAbstract

                                                            Abstract class summarizing typical OAuth2 Web Application Flows. +Extend this to implement providers like GitHub, GitLab, Google, etc.

                                                            +

                                                            Hierarchy (View Summary)

                                                            Index

                                                            Constructors

                                                            Properties

                                                            _alias: string = ''
                                                            _authorizationEndpoint: string
                                                            _params: AuthParameters = {}
                                                            _tokenEndpoint: string
                                                            _userProfileEndpoint: string
                                                            UserClass: typeof User = User

                                                            The User class reference to be used by the adapter.

                                                            +

                                                            Accessors

                                                            Methods

                                                            • Exchanges the temporary authorization code for an access token packet.

                                                              +

                                                              Parameters

                                                              • code: string

                                                                The temporary auth code.

                                                                +
                                                              • OptionalredirectUri: string

                                                                Optional redirect URL context.

                                                                +

                                                              Returns Promise<any>

                                                              Access token payload.

                                                              +
                                                            • Returns the authorization redirect URL.

                                                              +

                                                              Parameters

                                                              • OptionalredirectUri: string

                                                                The callback URL.

                                                                +
                                                              • scopes: string[] = []

                                                                The requested authorization scopes.

                                                                +
                                                              • Optionalstate: string

                                                                The state parameters for CSRF protection.

                                                                +

                                                              Returns string

                                                              The generated authorization URL.

                                                              +
                                                            • Performs user signup with credentials (unsupported for OAuth adapters).

                                                              +

                                                              Parameters

                                                              • login: string

                                                                Login identifier string.

                                                                +
                                                              • password: string

                                                                Password string.

                                                                +

                                                              Returns Promise<any>

                                                              Throws an error indicating signup should use exchangeCodeForToken.

                                                              +
                                                            diff --git a/docs/public/api-reference/classes/_quatrain_auth.Auth.html b/docs/public/api-reference/classes/_quatrain_auth.Auth.html new file mode 100644 index 00000000..9485fc90 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth.Auth.html @@ -0,0 +1,101 @@ +Auth | Quatrain Core Documentation
                                                            Quatrain Core Documentation
                                                              Preparing search index...

                                                              Global authentication manager handling registration and retrieval +of diverse Auth providers (adapters) via an alias registry.

                                                              +

                                                              Hierarchy (View Summary)

                                                              Index

                                                              Constructors

                                                              Properties

                                                              _providers: AuthRegistry<any> = {}
                                                              classRegistry: { [key: string]: any } = {}

                                                              Dictionary holding registered active Quatrain models/components.

                                                              +
                                                              defaultProvider: string = 'default'

                                                              The fallback provider alias.

                                                              +
                                                              ERROR_EMAIL_EXISTS: string = ...

                                                              Standardized error message for duplicate email constraint violations.

                                                              +
                                                              ERROR_WEAK_PASSWORD: string = ...

                                                              Standardized error message for weak password / password complexity violations.

                                                              +
                                                              logger: any = ...

                                                              Core logger dedicated to Auth actions.

                                                              +
                                                              logLevel: DEBUG = LogLevel.DEBUG

                                                              System-wide base log verbosity.

                                                              +
                                                              me: string = ...

                                                              Identifying namespace for this core component.

                                                              +
                                                              storage: typeof NodePersist = persist

                                                              Persistent key-value storage engine reference.

                                                              +
                                                              storagePrefix: "core" = 'core'

                                                              Context prefix string for scoped storage keys.

                                                              +

                                                              Accessors

                                                              Methods

                                                              • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                +

                                                                Parameters

                                                                • name: string

                                                                  Semantic registry name.

                                                                  +
                                                                • obj: any

                                                                  Class constructor.

                                                                  +

                                                                Returns void

                                                              • Stores a primitive value durably in the core storage instance.

                                                                +

                                                                Parameters

                                                                • key: string

                                                                  Identification string.

                                                                  +
                                                                • value: any

                                                                  Value.

                                                                  +

                                                                Returns Promise<void>

                                                              • Injects a new logger block under a specific namespace alias.

                                                                +

                                                                Parameters

                                                                • alias: string = ...

                                                                  The logging context name.

                                                                  +

                                                                Returns any

                                                                Instantiated LoggerAdapter.

                                                                +
                                                              • Registers a configured auth provider into the global context.

                                                                +

                                                                Parameters

                                                                • provider: AbstractAuthAdapter

                                                                  Instantiated auth adapter.

                                                                  +
                                                                • alias: string

                                                                  Short identifier name.

                                                                  +
                                                                • setDefault: boolean = false

                                                                  If true, marks this adapter as the fallback provider.

                                                                  +

                                                                Returns void

                                                              • Deprecated: Reserved schema definition hook.

                                                                +

                                                                Parameters

                                                                • key: string

                                                                  The property block to generate.

                                                                  +

                                                                Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                Field definitions block.

                                                                +
                                                              • Returns an injected class constructor by its registry identifier.

                                                                +

                                                                Parameters

                                                                • name: string

                                                                  The semantic name to resolve.

                                                                  +

                                                                Returns any

                                                                Class definition.

                                                                +
                                                              • Recovers a durably persisted value from the storage layer.

                                                                +

                                                                Parameters

                                                                • key: string

                                                                  The target identifier.

                                                                  +

                                                                Returns Promise<any>

                                                                The recovered value.

                                                                +
                                                              • Utility lookup to find executable paths in the system using which.

                                                                +

                                                                Parameters

                                                                • command: string

                                                                  The executable.

                                                                  +

                                                                Returns Promise<string>

                                                                The resolved system path.

                                                                +
                                                              • Scans all registered auth providers, collects their endpoint handlers, +and registers them dynamically under a common routing root path.

                                                                +

                                                                Parameters

                                                                • server: any

                                                                  The Quatrain ServerAdapter (Astro, Express, etc.).

                                                                  +
                                                                • rootPath: string = '/api/auth'

                                                                  The common authentication root segment (defaults to '/api/auth').

                                                                  +

                                                                Returns void

                                                              • Execution suspension utility blocking the event loop context.

                                                                +

                                                                Parameters

                                                                • seconds: number = 1

                                                                  Duration count.

                                                                  +

                                                                Returns Promise<unknown>

                                                                The promise to await.

                                                                +
                                                              diff --git a/docs/public/api-reference/classes/_quatrain_auth.AuthenticationError.html b/docs/public/api-reference/classes/_quatrain_auth.AuthenticationError.html new file mode 100644 index 00000000..7d97b6bc --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_auth.AuthenticationError.html @@ -0,0 +1,34 @@ +AuthenticationError | Quatrain Core Documentation
                                                              Quatrain Core Documentation
                                                                Preparing search index...

                                                                Class AuthenticationError

                                                                Standard exception representing authentication failures, invalid credentials, +or token expiration events.

                                                                +

                                                                Hierarchy

                                                                • Error
                                                                  • AuthenticationError
                                                                Index

                                                                Constructors

                                                                • Parameters

                                                                  • Optionalmessage: string

                                                                  Returns AuthenticationError

                                                                Properties

                                                                message: string
                                                                name: string
                                                                stack?: string
                                                                stackTraceLimit: number

                                                                The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                +

                                                                The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                +

                                                                If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                +

                                                                Methods

                                                                • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                  +
                                                                  const myObject = {};
                                                                  Error.captureStackTrace(myObject);
                                                                  myObject.stack; // Similar to `new Error().stack` +
                                                                  + +

                                                                  The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                  +

                                                                  The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                  +

                                                                  The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                  +
                                                                  function a() {
                                                                  b();
                                                                  }

                                                                  function b() {
                                                                  c();
                                                                  }

                                                                  function c() {
                                                                  // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                  const { stackTraceLimit } = Error;
                                                                  Error.stackTraceLimit = 0;
                                                                  const error = new Error();
                                                                  Error.stackTraceLimit = stackTraceLimit;

                                                                  // Capture the stack trace above function b
                                                                  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                  throw error;
                                                                  }

                                                                  a(); +
                                                                  + +

                                                                  Parameters

                                                                  • targetObject: object
                                                                  • OptionalconstructorOpt: Function

                                                                  Returns void

                                                                • Parameters

                                                                  • err: Error
                                                                  • stackTraces: CallSite[]

                                                                  Returns any

                                                                diff --git a/docs/public/api-reference/classes/_quatrain_backend-firestore.FirestoreAdapter.html b/docs/public/api-reference/classes/_quatrain_backend-firestore.FirestoreAdapter.html new file mode 100644 index 00000000..70599ea0 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-firestore.FirestoreAdapter.html @@ -0,0 +1,104 @@ +FirestoreAdapter | Quatrain Core Documentation
                                                                Quatrain Core Documentation
                                                                  Preparing search index...

                                                                  Backend adapter implementation for Google Cloud Firestore. +Maps Quatrain's DataObjects and Queries to Firestore documents and collections. +Inherits all baseline CRUD and Query logic from AbstractBackendAdapter.

                                                                  +

                                                                  Hierarchy (View Summary)

                                                                  Index

                                                                  Constructors

                                                                  Properties

                                                                  _alias: string = ''
                                                                  _middlewares: BM[] = []
                                                                  _params: BackendParameters = {}
                                                                  PKEY_IDENTIFIER: FieldPath = ...

                                                                  The reserved field path identifier for a document's primary key in Firestore.

                                                                  +

                                                                  Accessors

                                                                  Methods

                                                                  • Attaches a new middleware to the adapter's execution pipeline. +Middlewares are triggered before or after database actions.

                                                                    +

                                                                    Parameters

                                                                    • middleware: BM

                                                                      The instantiated middleware to attach.

                                                                      +

                                                                    Returns void

                                                                    If a middleware with the same class name is already attached.

                                                                    +
                                                                  • Executes an aggregation operation (sum, avg, distinct, min, max, count) on a query. +The default implementation fetches all matching records and performs in-memory aggregation. +Specific database adapters should override this to perform native query aggregation.

                                                                    +

                                                                    Parameters

                                                                    • query: Query<any>

                                                                      The Query instance defining the collection and filters.

                                                                      +
                                                                    • operation: "sum" | "avg" | "distinct" | "min" | "max" | "count"

                                                                      The aggregate operation.

                                                                      +
                                                                    • Optionalproperty: string

                                                                      The name of the property to aggregate.

                                                                      +

                                                                    Returns Promise<any>

                                                                    A promise resolving to the aggregated result.

                                                                    +
                                                                  • Removes a document from Firestore. +If softDelete is enabled in backend parameters and hardDelete is false, +it updates the document's status to DELETED instead of destroying the record.

                                                                    +

                                                                    Parameters

                                                                    • dataObject: DataObjectClass<any>

                                                                      The DataObject representing the document to delete.

                                                                      +
                                                                    • hardDelete: boolean = false

                                                                      Force absolute removal even if softDelete is globally enabled.

                                                                      +

                                                                    Returns Promise<DataObjectClass<any>>

                                                                    A promise resolving to the processed DataObject (with cleared URI if hard deleted).

                                                                    +
                                                                  • Completely obliterates an entire collection by batch-deleting all its documents recursively. +Use with extreme caution.

                                                                    +

                                                                    Parameters

                                                                    • collection: string

                                                                      The name of the root collection to delete.

                                                                      +
                                                                    • batchSize: number = 500

                                                                      The number of documents to delete per transaction chunk.

                                                                      +

                                                                    Returns Promise<void>

                                                                    A promise resolving when the collection is empty.

                                                                    +
                                                                  • Generates raw SQL for creating a table.

                                                                    +

                                                                    Parameters

                                                                    • collection: string
                                                                    • properties: any[]

                                                                    Returns { downSql: string; upSql: string }

                                                                    Always throws because Firestore is a NoSQL database and does not support SQL generation.

                                                                    +
                                                                  • Generates raw SQL for altering a table schema.

                                                                    +

                                                                    Parameters

                                                                    • collection: string
                                                                    • delta: any

                                                                    Returns { downSql: string[]; upSql: string[] }

                                                                    Always throws because Firestore does not support relational schema deltas.

                                                                    +
                                                                  • Outputs an adapter-level diagnostic message to the console if debug mode is enabled.

                                                                    +

                                                                    Parameters

                                                                    • message: string

                                                                      The textual content to log.

                                                                      +

                                                                    Returns void

                                                                    Use Backend.debug() or Backend.log() (which itself is deprecated in favor of specific levels) instead.

                                                                    +
                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_backend-migrations.MigrationManager.html b/docs/public/api-reference/classes/_quatrain_backend-migrations.MigrationManager.html new file mode 100644 index 00000000..d23cfaad --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-migrations.MigrationManager.html @@ -0,0 +1,16 @@ +MigrationManager | Quatrain Core Documentation
                                                                  Quatrain Core Documentation
                                                                    Preparing search index...

                                                                    Core manager for orchestrating database migrations. +Wraps umzug to provide atomic execution, generation, and diffing.

                                                                    +
                                                                    Index

                                                                    Constructors

                                                                    Methods

                                                                    • Creates a new atomic migration file. +If a model is provided, it generates standard CREATE TABLE statements.

                                                                      +

                                                                      Parameters

                                                                      • name: string
                                                                      • OptionalmodelOptions: any

                                                                      Returns Promise<string>

                                                                    • Compares the current schema models against the saved snapshot and generates a migration file +with the deltas (e.g. ALTER TABLE ADD COLUMN).

                                                                      +

                                                                      Parameters

                                                                      • name: string
                                                                      • models: { collection: string; properties: any[] }[]

                                                                      Returns Promise<string | null>

                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_backend-migrations.MigrationRecord.html b/docs/public/api-reference/classes/_quatrain_backend-migrations.MigrationRecord.html new file mode 100644 index 00000000..cd679459 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-migrations.MigrationRecord.html @@ -0,0 +1,101 @@ +MigrationRecord | Quatrain Core Documentation
                                                                    Quatrain Core Documentation
                                                                      Preparing search index...

                                                                      MigrationRecord Model +Stores the state of executed migrations in the target backend.

                                                                      +

                                                                      Hierarchy (View Summary)

                                                                      Index

                                                                      Constructors

                                                                      Properties

                                                                      _dataObject: DataObjectClass<any>
                                                                      _repositoryInstance: any = null
                                                                      COLLECTION: string = '_quatrain_migrations'

                                                                      The collection name for storing migration logs.

                                                                      +
                                                                      LABEL_KEY: string = 'name'

                                                                      Which property's value to use in backend as label for object reference

                                                                      +
                                                                      PARENT_PROP: string | undefined

                                                                      The name of the property handling hierarchical parent relationships.

                                                                      +
                                                                      PROPS_DEFINITION: any[] = ...

                                                                      The properties describing a single migration entry.

                                                                      +
                                                                      REPOSITORY_CLASS: any = null

                                                                      The designated repository class for this model (defaults to BaseRepository).

                                                                      +

                                                                      Accessors

                                                                      Methods

                                                                      • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                        +

                                                                        Parameters

                                                                        • hardDelete: boolean = false

                                                                          If true, permanently removes the record from the database.

                                                                          +

                                                                        Returns Promise<DataObjectClass<any>>

                                                                        A promise resolving to the underlying DataObjectClass.

                                                                        +
                                                                      • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                        +

                                                                        Parameters

                                                                        • obj: any

                                                                          The child class definition (e.g., LogModel) to query.

                                                                          +

                                                                        Returns Query<any>

                                                                        A new Query builder scoped to this parent instance.

                                                                        +
                                                                      • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                        +

                                                                        Parameters

                                                                        • src: string | ObjectUri | undefined = undefined

                                                                          The source data: a string path, an ObjectUri, or raw object data.

                                                                          +
                                                                        • child: any = ...

                                                                          The specific child class constructor to instantiate.

                                                                          +

                                                                        Returns Promise<any>

                                                                        A promise resolving to the fully constructed and hydrated model instance.

                                                                        +

                                                                        If instantiation fails.

                                                                        +
                                                                      • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                        +

                                                                        Type Parameters

                                                                        • T

                                                                        Parameters

                                                                        • path: string

                                                                          The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                          +

                                                                        Returns Promise<T>

                                                                        A promise resolving to the populated class instance.

                                                                        +
                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_backend-migrations.QuatrainMigrationStorage.html b/docs/public/api-reference/classes/_quatrain_backend-migrations.QuatrainMigrationStorage.html new file mode 100644 index 00000000..ca695451 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-migrations.QuatrainMigrationStorage.html @@ -0,0 +1,13 @@ +QuatrainMigrationStorage | Quatrain Core Documentation
                                                                      Quatrain Core Documentation
                                                                        Preparing search index...

                                                                        Storage implementation for umzug using the Quatrain backend adapter. +Persists migration history directly in the target database using the MigrationRecord model.

                                                                        +

                                                                        Implements

                                                                        • UmzugStorage
                                                                        Index

                                                                        Constructors

                                                                        Methods

                                                                        • Logs a successful migration execution.

                                                                          +

                                                                          Parameters

                                                                          • params: { name: string }

                                                                            Contains the name of the migration.

                                                                            +

                                                                          Returns Promise<void>

                                                                        • Removes a migration from the executed log.

                                                                          +

                                                                          Parameters

                                                                          • params: { name: string }

                                                                            Contains the name of the migration.

                                                                            +

                                                                          Returns Promise<void>

                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_backend-migrations.SchemaDiffer.html b/docs/public/api-reference/classes/_quatrain_backend-migrations.SchemaDiffer.html new file mode 100644 index 00000000..4110d03f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-migrations.SchemaDiffer.html @@ -0,0 +1,6 @@ +SchemaDiffer | Quatrain Core Documentation
                                                                        Quatrain Core Documentation
                                                                          Preparing search index...

                                                                          Utility class for computing structural differences between two schema property lists.

                                                                          +
                                                                          Index

                                                                          Constructors

                                                                          Methods

                                                                          Constructors

                                                                          Methods

                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_backend-migrations.SnapshotManager.html b/docs/public/api-reference/classes/_quatrain_backend-migrations.SnapshotManager.html new file mode 100644 index 00000000..50b4f0c5 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-migrations.SnapshotManager.html @@ -0,0 +1,8 @@ +SnapshotManager | Quatrain Core Documentation
                                                                          Quatrain Core Documentation
                                                                            Preparing search index...

                                                                            Handles saving and loading local schema snapshots for migration diffing.

                                                                            +
                                                                            Index

                                                                            Constructors

                                                                            Methods

                                                                            Constructors

                                                                            Methods

                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_backend-postgres.PostgresAdapter.html b/docs/public/api-reference/classes/_quatrain_backend-postgres.PostgresAdapter.html new file mode 100644 index 00000000..e57325d5 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-postgres.PostgresAdapter.html @@ -0,0 +1,146 @@ +PostgresAdapter | Quatrain Core Documentation
                                                                            Quatrain Core Documentation
                                                                              Preparing search index...

                                                                              Backend adapter implementation for PostgreSQL databases. +Translates Quatrain's DataObjects and Queries into raw SQL queries using the pg client. +Supports relational schema mapping, JSONB arrays, and advanced filtering.

                                                                              +

                                                                              https://en.wikipedia.org/wiki/List_of_SQL_reserved_words

                                                                              +

                                                                              Hierarchy (View Summary)

                                                                              Index

                                                                              Constructors

                                                                              Properties

                                                                              _alias: string = ''
                                                                              _connection: PoolClient | undefined
                                                                              _middlewares: BM[] = []
                                                                              _params: BackendParameters = {}
                                                                              _pool: Pool | undefined
                                                                              PKEY_IDENTIFIER: any = 'id'

                                                                              The string identifier for primary keys, mapped to 'id' by default.

                                                                              +

                                                                              Accessors

                                                                              Methods

                                                                              • Ensures that the database table for the given DataObject's collection exists. +If the table does not exist, it automatically creates it. +Additionally, ensures that any related join tables for ObjectProperty references +are also created so that LEFT JOIN queries do not crash on non-existent tables.

                                                                                +

                                                                                Parameters

                                                                                • dataObject: DataObjectClass<any>

                                                                                  The DataObject payload defining properties and collection.

                                                                                  +

                                                                                Returns Promise<void>

                                                                                A promise resolving when the table and relation tables exist.

                                                                                +
                                                                              • Dynamically ensures that a table exists with the correct columns derived from properties. +Deduplicates column definitions by lowercase name to prevent SQL parser errors +(e.g. "column 'name' specified more than once") when child models override base properties.

                                                                                +

                                                                                Parameters

                                                                                • tableName: string

                                                                                  The name of the table to verify/create.

                                                                                  +
                                                                                • properties: any

                                                                                  The schema properties mapping to columns.

                                                                                  +

                                                                                Returns Promise<void>

                                                                                A promise resolving when the table is successfully created or verified.

                                                                                +
                                                                              • Resolves the table/collection name for a given model or relation reference. +Accounts for mapping definitions, class constructors, or raw string types.

                                                                                +

                                                                                Parameters

                                                                                • instanceOf: any

                                                                                  The relation constructor, class, or collection name string.

                                                                                  +

                                                                                Returns string

                                                                                The resolved table/collection name.

                                                                                +
                                                                              • Attaches a new middleware to the adapter's execution pipeline. +Middlewares are triggered before or after database actions.

                                                                                +

                                                                                Parameters

                                                                                • middleware: BM

                                                                                  The instantiated middleware to attach.

                                                                                  +

                                                                                Returns void

                                                                                If a middleware with the same class name is already attached.

                                                                                +
                                                                              • Executes an aggregation operation (sum, avg, distinct, min, max, count) on a query. +The default implementation fetches all matching records and performs in-memory aggregation. +Specific database adapters should override this to perform native query aggregation.

                                                                                +

                                                                                Parameters

                                                                                • query: Query<any>

                                                                                  The Query instance defining the collection and filters.

                                                                                  +
                                                                                • operation: "sum" | "avg" | "distinct" | "min" | "max" | "count"

                                                                                  The aggregate operation.

                                                                                  +
                                                                                • Optionalproperty: string

                                                                                  The name of the property to aggregate.

                                                                                  +

                                                                                Returns Promise<any>

                                                                                A promise resolving to the aggregated result.

                                                                                +
                                                                              • Generates the SQL CREATE TABLE and DROP TABLE statements required to initialize +a collection's storage in PostgreSQL, mapping Quatrain Property types to SQL Column types.

                                                                                +

                                                                                Parameters

                                                                                • collection: string

                                                                                  The table name.

                                                                                  +
                                                                                • properties: any[]

                                                                                  The property dictionary of the model.

                                                                                  +

                                                                                Returns { downSql: string; upSql: string }

                                                                                Up and Down migration SQL strings.

                                                                                +
                                                                              • Generates the SQL ALTER TABLE statements to apply a schema delta (add/drop columns).

                                                                                +

                                                                                Parameters

                                                                                • collection: string

                                                                                  The table name.

                                                                                  +
                                                                                • delta: any

                                                                                  The SchemaDelta tracking property additions/removals.

                                                                                  +

                                                                                Returns { downSql: string[]; upSql: string[] }

                                                                                Arrays of Up and Down migration SQL statements.

                                                                                +
                                                                              • Outputs an adapter-level diagnostic message to the console if debug mode is enabled.

                                                                                +

                                                                                Parameters

                                                                                • message: string

                                                                                  The textual content to log.

                                                                                  +

                                                                                Returns void

                                                                                Use Backend.debug() or Backend.log() (which itself is deprecated in favor of specific levels) instead.

                                                                                +
                                                                              • Executes an arbitrary raw SQL query against the Postgres database.

                                                                                +

                                                                                Parameters

                                                                                • sql: string

                                                                                  The SQL statement with optional $1, $2 parameterized placeholders.

                                                                                  +
                                                                                • Optionalparams: any[]

                                                                                  The array of parameter values to inject into the query.

                                                                                  +

                                                                                Returns Promise<any>

                                                                                A promise resolving to the pg QueryResult.

                                                                                +
                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.AccuweatherRecipe.html b/docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.AccuweatherRecipe.html new file mode 100644 index 00000000..e90e6fcc --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.AccuweatherRecipe.html @@ -0,0 +1,17 @@ +AccuweatherRecipe | Quatrain Core Documentation
                                                                              Quatrain Core Documentation
                                                                                Preparing search index...

                                                                                Recipe providing configuration and query mapping for the AccuWeather REST API.

                                                                                +

                                                                                Implements

                                                                                Index

                                                                                Constructors

                                                                                Properties

                                                                                Methods

                                                                                Constructors

                                                                                Properties

                                                                                defaultBaseUrl: string = 'https://dataservice.accuweather.com'

                                                                                The default endpoint URL.

                                                                                +
                                                                                name: string = 'AccuWeather'

                                                                                The human-readable name of the recipe.

                                                                                +
                                                                                querySerializer: QuerySerializer = ...

                                                                                Custom query serializer transforming Quatrain filters into AccuWeather parameters.

                                                                                +

                                                                                Active filters.

                                                                                +

                                                                                Pagination details.

                                                                                +

                                                                                The parameter record.

                                                                                +

                                                                                Methods

                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.CoinGeckoRecipe.html b/docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.CoinGeckoRecipe.html new file mode 100644 index 00000000..774af688 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.CoinGeckoRecipe.html @@ -0,0 +1,17 @@ +CoinGeckoRecipe | Quatrain Core Documentation
                                                                                Quatrain Core Documentation
                                                                                  Preparing search index...

                                                                                  Recipe providing configuration and query mapping for the CoinGecko REST API.

                                                                                  +

                                                                                  Implements

                                                                                  Index

                                                                                  Constructors

                                                                                  Properties

                                                                                  Methods

                                                                                  Constructors

                                                                                  Properties

                                                                                  defaultBaseUrl: string = 'https://api.coingecko.com/api/v3'

                                                                                  The default endpoint URL.

                                                                                  +
                                                                                  name: string = 'CoinGecko'

                                                                                  The human-readable name of the recipe.

                                                                                  +
                                                                                  querySerializer: QuerySerializer = ...

                                                                                  Custom query serializer transforming Quatrain filters and pagination into CoinGecko parameters.

                                                                                  +

                                                                                  Active filters.

                                                                                  +

                                                                                  Pagination details.

                                                                                  +

                                                                                  The parameter record.

                                                                                  +

                                                                                  Methods

                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.OpenWeatherMapRecipe.html b/docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.OpenWeatherMapRecipe.html new file mode 100644 index 00000000..42eddb70 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-restapi-recipes.OpenWeatherMapRecipe.html @@ -0,0 +1,17 @@ +OpenWeatherMapRecipe | Quatrain Core Documentation
                                                                                  Quatrain Core Documentation
                                                                                    Preparing search index...

                                                                                    Recipe providing configuration and query mapping for the OpenWeatherMap REST API.

                                                                                    +

                                                                                    Implements

                                                                                    Index

                                                                                    Constructors

                                                                                    Properties

                                                                                    Methods

                                                                                    Constructors

                                                                                    Properties

                                                                                    defaultBaseUrl: string = 'https://api.openweathermap.org/data/2.5'

                                                                                    The default endpoint URL.

                                                                                    +
                                                                                    name: string = 'OpenWeatherMap'

                                                                                    The human-readable name of the recipe.

                                                                                    +
                                                                                    querySerializer: QuerySerializer = ...

                                                                                    Custom query serializer transforming Quatrain filters into OpenWeatherMap parameters.

                                                                                    +

                                                                                    Active filters.

                                                                                    +

                                                                                    Pagination details.

                                                                                    +

                                                                                    The parameter record.

                                                                                    +

                                                                                    Methods

                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_backend-restapi.OpenApiIngestor.html b/docs/public/api-reference/classes/_quatrain_backend-restapi.OpenApiIngestor.html new file mode 100644 index 00000000..62329e7f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-restapi.OpenApiIngestor.html @@ -0,0 +1,9 @@ +OpenApiIngestor | Quatrain Core Documentation
                                                                                    Quatrain Core Documentation
                                                                                      Preparing search index...

                                                                                      Utility class to ingest OpenAPI/Swagger documentation or raw web documentation +and generate Quatrain Models and RestBackendAdapter endpoint configurations.

                                                                                      +
                                                                                      Index

                                                                                      Constructors

                                                                                      Methods

                                                                                      • Parses a structured OpenAPI/Swagger JSON or YAML definition. +Returns a dictionary of generated models and endpoints mapping.

                                                                                        +

                                                                                        Parameters

                                                                                        • definitionData: any

                                                                                        Returns Promise<any>

                                                                                      • Uses the injected AI service to parse raw web documentation.

                                                                                        +

                                                                                        Parameters

                                                                                        • urlOrHtml: string

                                                                                        Returns Promise<any>

                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_backend-restapi.RestBackendAdapter.html b/docs/public/api-reference/classes/_quatrain_backend-restapi.RestBackendAdapter.html new file mode 100644 index 00000000..23b2237f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-restapi.RestBackendAdapter.html @@ -0,0 +1,109 @@ +RestBackendAdapter | Quatrain Core Documentation
                                                                                      Quatrain Core Documentation
                                                                                        Preparing search index...

                                                                                        Backend adapter implementation bridging Quatrain's DataObjects to an external REST API. +Maps CRUD operations to standard HTTP methods (POST, GET, PATCH, DELETE).

                                                                                        +

                                                                                        Hierarchy (View Summary)

                                                                                        Index

                                                                                        Constructors

                                                                                        Properties

                                                                                        _alias: string = ''
                                                                                        _middlewares: BM[] = []
                                                                                        _params: BackendParameters = {}
                                                                                        allowedMethods: BackendAction[]
                                                                                        authProvider?: AuthProvider
                                                                                        baseUrl: string
                                                                                        endpointMap: Record<string, string>
                                                                                        querySerializer?: QuerySerializer
                                                                                        PKEY_IDENTIFIER: any = 'id'

                                                                                        The string identifier for primary keys, mapped to 'id' by default.

                                                                                        +

                                                                                        Accessors

                                                                                        Methods

                                                                                        • Attaches a new middleware to the adapter's execution pipeline. +Middlewares are triggered before or after database actions.

                                                                                          +

                                                                                          Parameters

                                                                                          • middleware: BM

                                                                                            The instantiated middleware to attach.

                                                                                            +

                                                                                          Returns void

                                                                                          If a middleware with the same class name is already attached.

                                                                                          +
                                                                                        • Executes an aggregation operation (sum, avg, distinct, min, max, count) on a query. +The default implementation fetches all matching records and performs in-memory aggregation. +Specific database adapters should override this to perform native query aggregation.

                                                                                          +

                                                                                          Parameters

                                                                                          • query: Query<any>

                                                                                            The Query instance defining the collection and filters.

                                                                                            +
                                                                                          • operation: "sum" | "avg" | "distinct" | "min" | "max" | "count"

                                                                                            The aggregate operation.

                                                                                            +
                                                                                          • Optionalproperty: string

                                                                                            The name of the property to aggregate.

                                                                                            +

                                                                                          Returns Promise<any>

                                                                                          A promise resolving to the aggregated result.

                                                                                          +
                                                                                        • Executes a DELETE request targeting an entire collection endpoint.

                                                                                          +

                                                                                          Parameters

                                                                                          • collection: string

                                                                                            The collection name mapping to the target API endpoint.

                                                                                            +

                                                                                          Returns Promise<void>

                                                                                          A promise resolving upon successful deletion.

                                                                                          +

                                                                                          If the DELETE action is not permitted.

                                                                                          +
                                                                                        • Generates raw SQL for creating a table.

                                                                                          +

                                                                                          Parameters

                                                                                          • collection: string
                                                                                          • properties: any[]

                                                                                          Returns { downSql: string; upSql: string }

                                                                                          Always throws because REST APIs do not support local schema generation.

                                                                                          +
                                                                                        • Outputs an adapter-level diagnostic message to the console if debug mode is enabled.

                                                                                          +

                                                                                          Parameters

                                                                                          • message: string

                                                                                            The textual content to log.

                                                                                            +

                                                                                          Returns void

                                                                                          Use Backend.debug() or Backend.log() (which itself is deprecated in favor of specific levels) instead.

                                                                                          +
                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_backend-sqlite.SQLiteAdapter.html b/docs/public/api-reference/classes/_quatrain_backend-sqlite.SQLiteAdapter.html new file mode 100644 index 00000000..a98f7d23 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend-sqlite.SQLiteAdapter.html @@ -0,0 +1,115 @@ +SQLiteAdapter | Quatrain Core Documentation
                                                                                        Quatrain Core Documentation
                                                                                          Preparing search index...

                                                                                          Backend adapter implementation for SQLite databases. +Uses the sqlite driver to provide a fast, local relational store without external dependencies. +Highly useful for local development, CI/CD testing environments, or lightweight local deployments.

                                                                                          +

                                                                                          Hierarchy (View Summary)

                                                                                          Index

                                                                                          Constructors

                                                                                          Properties

                                                                                          _alias: string = ''
                                                                                          _connection: Database<Database, Statement> | undefined
                                                                                          _dbPath: string
                                                                                          _middlewares: BM[] = []
                                                                                          _params: BackendParameters = {}
                                                                                          PKEY_IDENTIFIER: any = 'id'

                                                                                          The string identifier for primary keys, mapped to 'id' by default.

                                                                                          +

                                                                                          Accessors

                                                                                          Methods

                                                                                          • Convert array into SQL expression

                                                                                            +

                                                                                            Parameters

                                                                                            • from: (string | number)[]

                                                                                              Array of strings or numbers

                                                                                              +

                                                                                            Returns string

                                                                                            string

                                                                                            +
                                                                                          • Process data for compatibility

                                                                                            +

                                                                                            Parameters

                                                                                            • data: any
                                                                                            • filterNulls: boolean = true

                                                                                            Returns any[]

                                                                                          • Attaches a new middleware to the adapter's execution pipeline. +Middlewares are triggered before or after database actions.

                                                                                            +

                                                                                            Parameters

                                                                                            • middleware: BM

                                                                                              The instantiated middleware to attach.

                                                                                              +

                                                                                            Returns void

                                                                                            If a middleware with the same class name is already attached.

                                                                                            +
                                                                                          • Executes an aggregation operation (sum, avg, distinct, min, max, count) on a query. +The default implementation fetches all matching records and performs in-memory aggregation. +Specific database adapters should override this to perform native query aggregation.

                                                                                            +

                                                                                            Parameters

                                                                                            • query: Query<any>

                                                                                              The Query instance defining the collection and filters.

                                                                                              +
                                                                                            • operation: "sum" | "avg" | "distinct" | "min" | "max" | "count"

                                                                                              The aggregate operation.

                                                                                              +
                                                                                            • Optionalproperty: string

                                                                                              The name of the property to aggregate.

                                                                                              +

                                                                                            Returns Promise<any>

                                                                                            A promise resolving to the aggregated result.

                                                                                            +
                                                                                          • Outputs an adapter-level diagnostic message to the console if debug mode is enabled.

                                                                                            +

                                                                                            Parameters

                                                                                            • message: string

                                                                                              The textual content to log.

                                                                                              +

                                                                                            Returns void

                                                                                            Use Backend.debug() or Backend.log() (which itself is deprecated in favor of specific levels) instead.

                                                                                            +
                                                                                          • Executes an arbitrary raw SQL query against the SQLite database.

                                                                                            +

                                                                                            Parameters

                                                                                            • sql: string

                                                                                              The SQL statement with optional ? parameterized placeholders.

                                                                                              +
                                                                                            • params: any[] = []

                                                                                              The array of parameter values.

                                                                                              +

                                                                                            Returns Promise<any>

                                                                                            A promise resolving to the SQLite result rows.

                                                                                            +
                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_backend.AbstractBackendAdapter.html b/docs/public/api-reference/classes/_quatrain_backend.AbstractBackendAdapter.html new file mode 100644 index 00000000..5377a8ad --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.AbstractBackendAdapter.html @@ -0,0 +1,98 @@ +AbstractBackendAdapter | Quatrain Core Documentation
                                                                                          Quatrain Core Documentation
                                                                                            Preparing search index...

                                                                                            Class AbstractBackendAdapterAbstract

                                                                                            The baseline abstract class defining the contract for all Quatrain database adapters. +Implementations must extend this class to translate agnostic CRUD operations into +specific database queries (e.g., PostgreSQL, Firestore). +It also handles middleware execution lifecycles.

                                                                                            +

                                                                                            Hierarchy (View Summary)

                                                                                            Implements

                                                                                            Index

                                                                                            Constructors

                                                                                            Properties

                                                                                            _alias: string = ''
                                                                                            _middlewares: BM[] = []
                                                                                            _params: BackendParameters = {}
                                                                                            PKEY_IDENTIFIER: any = 'id'

                                                                                            The string identifier for primary keys, mapped to 'id' by default.

                                                                                            +

                                                                                            Accessors

                                                                                            Methods

                                                                                            • Processes raw data entries to convert relational reference objects into native database foreign key IDs +if the adapter has been configured with useNativeForeignKeys = true.

                                                                                              +

                                                                                              Parameters

                                                                                              • data: any[]

                                                                                              Returns any[]

                                                                                            • Attaches a new middleware to the adapter's execution pipeline. +Middlewares are triggered before or after database actions.

                                                                                              +

                                                                                              Parameters

                                                                                              • middleware: BM

                                                                                                The instantiated middleware to attach.

                                                                                                +

                                                                                              Returns void

                                                                                              If a middleware with the same class name is already attached.

                                                                                              +
                                                                                            • Executes an aggregation operation (sum, avg, distinct, min, max, count) on a query. +The default implementation fetches all matching records and performs in-memory aggregation. +Specific database adapters should override this to perform native query aggregation.

                                                                                              +

                                                                                              Parameters

                                                                                              • query: Query<any>

                                                                                                The Query instance defining the collection and filters.

                                                                                                +
                                                                                              • operation: "sum" | "avg" | "distinct" | "min" | "max" | "count"

                                                                                                The aggregate operation.

                                                                                                +
                                                                                              • Optionalproperty: string

                                                                                                The name of the property to aggregate.

                                                                                                +

                                                                                              Returns Promise<any>

                                                                                              A promise resolving to the aggregated result.

                                                                                              +
                                                                                            • Adapter-specific implementation for removing an entire collection.

                                                                                              +

                                                                                              Parameters

                                                                                              • collection: string

                                                                                                The collection name.

                                                                                                +
                                                                                              • OptionalbatchSize: number

                                                                                                The pagination batch limit for NoSQL sequential deletes.

                                                                                                +

                                                                                              Returns Promise<void>

                                                                                            • Removes a middleware from the pipeline by its class name.

                                                                                              +

                                                                                              Parameters

                                                                                              • middlewareClassName: string

                                                                                                The exact name of the middleware class to remove.

                                                                                                +

                                                                                              Returns void

                                                                                            • Orchestrates the sequential execution of all attached middlewares for a given action.

                                                                                              +

                                                                                              Parameters

                                                                                              • dataObject: DataObjectClass<any>

                                                                                                The payload traversing the middlewares.

                                                                                                +
                                                                                              • action: BackendAction

                                                                                                The context (READ, CREATE, UPDATE, DELETE).

                                                                                                +
                                                                                              • timing: "before" | "after" = 'before'

                                                                                                Whether to run the before or after pipeline.

                                                                                                +
                                                                                              • Optionalparams: MiddlewareParams

                                                                                                Optional parameters passed down to the middlewares.

                                                                                                +

                                                                                              Returns Promise<DataObjectClass<any>>

                                                                                              A promise resolving to the potentially mutated DataObject.

                                                                                              +
                                                                                            • Retrieves a specific configuration parameter.

                                                                                              +

                                                                                              Parameters

                                                                                              • key: BackendParametersKeys

                                                                                                The parameter key to fetch.

                                                                                                +

                                                                                              Returns any

                                                                                              The value associated with the key, or undefined.

                                                                                              +
                                                                                            • Outputs an adapter-level diagnostic message to the console if debug mode is enabled.

                                                                                              +

                                                                                              Parameters

                                                                                              • message: string

                                                                                                The textual content to log.

                                                                                                +

                                                                                              Returns void

                                                                                              Use Backend.debug() or Backend.log() (which itself is deprecated in favor of specific levels) instead.

                                                                                              +
                                                                                            • Overrides or adds a backend configuration parameter dynamically.

                                                                                              +

                                                                                              Parameters

                                                                                              • key: BackendParametersKeys

                                                                                                The parameter key to modify.

                                                                                                +
                                                                                              • value: any

                                                                                                The new value to assign.

                                                                                                +

                                                                                              Returns void

                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_backend.Backend.html b/docs/public/api-reference/classes/_quatrain_backend.Backend.html new file mode 100644 index 00000000..7a16bafc --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.Backend.html @@ -0,0 +1,94 @@ +Backend | Quatrain Core Documentation
                                                                                            Quatrain Core Documentation
                                                                                              Preparing search index...

                                                                                              The core static class managing the registration and retrieval of backend adapters. +Quatrain supports multiple concurrent backends, allowing different models to route their persistence to different data stores (e.g. Postgres, Firestore, REST).

                                                                                              +

                                                                                              Hierarchy (View Summary)

                                                                                              Index

                                                                                              Constructors

                                                                                              Properties

                                                                                              _backends: BackendRegistry<any> = {}

                                                                                              Internal registry mapping aliases to their configured AbstractBackendAdapter instances.

                                                                                              +
                                                                                              classRegistry: { [key: string]: any } = {}

                                                                                              Dictionary holding registered active Quatrain models/components.

                                                                                              +
                                                                                              defaultBackend: string = 'default'

                                                                                              The alias of the currently active default backend adapter.

                                                                                              +
                                                                                              logger: any = ...

                                                                                              Winston logger instance dedicated to the Backend module.

                                                                                              +
                                                                                              logLevel: DEBUG = LogLevel.DEBUG

                                                                                              System-wide base log verbosity.

                                                                                              +
                                                                                              me: string = ...

                                                                                              Identifying namespace for this core component.

                                                                                              +
                                                                                              storage: typeof NodePersist = persist

                                                                                              Persistent key-value storage engine reference.

                                                                                              +
                                                                                              storagePrefix: "core" = 'core'

                                                                                              Context prefix string for scoped storage keys.

                                                                                              +
                                                                                              userClass: any

                                                                                              Global reference to the registered user class for authentication and relationships.

                                                                                              +

                                                                                              Methods

                                                                                              • Registers a new backend adapter instance into the global registry.

                                                                                                +

                                                                                                Parameters

                                                                                                • backend: AbstractBackendAdapter

                                                                                                  An instantiated adapter (e.g., FirestoreAdapter, PostgresAdapter).

                                                                                                  +
                                                                                                • alias: string

                                                                                                  The string identifier used to retrieve this backend later.

                                                                                                  +
                                                                                                • setDefault: boolean = false

                                                                                                  If true, this adapter becomes the default fallback for all operations.

                                                                                                  +

                                                                                                Returns void

                                                                                              • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                +

                                                                                                Parameters

                                                                                                • name: string

                                                                                                  Semantic registry name.

                                                                                                  +
                                                                                                • obj: any

                                                                                                  Class constructor.

                                                                                                  +

                                                                                                Returns void

                                                                                              • Stores a primitive value durably in the core storage instance.

                                                                                                +

                                                                                                Parameters

                                                                                                • key: string

                                                                                                  Identification string.

                                                                                                  +
                                                                                                • value: any

                                                                                                  Value.

                                                                                                  +

                                                                                                Returns Promise<void>

                                                                                              • Injects a new logger block under a specific namespace alias.

                                                                                                +

                                                                                                Parameters

                                                                                                • alias: string = ...

                                                                                                  The logging context name.

                                                                                                  +

                                                                                                Returns any

                                                                                                Instantiated LoggerAdapter.

                                                                                                +
                                                                                              • Deprecated: Reserved schema definition hook.

                                                                                                +

                                                                                                Parameters

                                                                                                • key: string

                                                                                                  The property block to generate.

                                                                                                  +

                                                                                                Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                Field definitions block.

                                                                                                +
                                                                                              • Retrieves a configured backend adapter from the registry by its alias.

                                                                                                +

                                                                                                Type Parameters

                                                                                                Parameters

                                                                                                • alias: string = ...

                                                                                                  The string identifier of the backend to retrieve (defaults to the defaultBackend).

                                                                                                  +

                                                                                                Returns T

                                                                                                The requested AbstractBackendAdapter instance.

                                                                                                +

                                                                                                If the requested alias is not found in the registry.

                                                                                                +
                                                                                              • Returns an injected class constructor by its registry identifier.

                                                                                                +

                                                                                                Parameters

                                                                                                • name: string

                                                                                                  The semantic name to resolve.

                                                                                                  +

                                                                                                Returns any

                                                                                                Class definition.

                                                                                                +
                                                                                              • Recovers a durably persisted value from the storage layer.

                                                                                                +

                                                                                                Parameters

                                                                                                • key: string

                                                                                                  The target identifier.

                                                                                                  +

                                                                                                Returns Promise<any>

                                                                                                The recovered value.

                                                                                                +
                                                                                              • Utility lookup to find executable paths in the system using which.

                                                                                                +

                                                                                                Parameters

                                                                                                • command: string

                                                                                                  The executable.

                                                                                                  +

                                                                                                Returns Promise<string>

                                                                                                The resolved system path.

                                                                                                +
                                                                                              • Execution suspension utility blocking the event loop context.

                                                                                                +

                                                                                                Parameters

                                                                                                • seconds: number = 1

                                                                                                  Duration count.

                                                                                                  +

                                                                                                Returns Promise<unknown>

                                                                                                The promise to await.

                                                                                                +
                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_backend.BackendError.html b/docs/public/api-reference/classes/_quatrain_backend.BackendError.html new file mode 100644 index 00000000..50f2cadf --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.BackendError.html @@ -0,0 +1,35 @@ +BackendError | Quatrain Core Documentation
                                                                                              Quatrain Core Documentation
                                                                                                Preparing search index...

                                                                                                General exception thrown when an adapter encounters an execution, syntax, or network failure.

                                                                                                +

                                                                                                Hierarchy (View Summary)

                                                                                                Index

                                                                                                Constructors

                                                                                                Properties

                                                                                                message: string
                                                                                                name: string
                                                                                                stack?: string
                                                                                                stackTraceLimit: number

                                                                                                The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                +

                                                                                                The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                +

                                                                                                If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                +

                                                                                                Methods

                                                                                                • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                  +
                                                                                                  const myObject = {};
                                                                                                  Error.captureStackTrace(myObject);
                                                                                                  myObject.stack; // Similar to `new Error().stack` +
                                                                                                  + +

                                                                                                  The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                  +

                                                                                                  The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                  +

                                                                                                  The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                  +
                                                                                                  function a() {
                                                                                                  b();
                                                                                                  }

                                                                                                  function b() {
                                                                                                  c();
                                                                                                  }

                                                                                                  function c() {
                                                                                                  // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                  const { stackTraceLimit } = Error;
                                                                                                  Error.stackTraceLimit = 0;
                                                                                                  const error = new Error();
                                                                                                  Error.stackTraceLimit = stackTraceLimit;

                                                                                                  // Capture the stack trace above function b
                                                                                                  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                  throw error;
                                                                                                  }

                                                                                                  a(); +
                                                                                                  + +

                                                                                                  Parameters

                                                                                                  • targetObject: object
                                                                                                  • OptionalconstructorOpt: Function

                                                                                                  Returns void

                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_backend.BaseRepository.html b/docs/public/api-reference/classes/_quatrain_backend.BaseRepository.html new file mode 100644 index 00000000..ba0026f1 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.BaseRepository.html @@ -0,0 +1,36 @@ +BaseRepository | Quatrain Core Documentation
                                                                                                Quatrain Core Documentation
                                                                                                  Preparing search index...

                                                                                                  Class BaseRepository<T>

                                                                                                  CRUD methods for models/entities inheriting from BaseObject +Extend this by passing the typeof of the desired class to the constructor

                                                                                                  +

                                                                                                  Type Parameters

                                                                                                  Hierarchy (View Summary)

                                                                                                  Index

                                                                                                  Constructors

                                                                                                  Properties

                                                                                                  _model: typeof PersistedBaseObject
                                                                                                  backendAdapter: BackendInterface

                                                                                                  The specific backend adapter designated for this repository's requests.

                                                                                                  +
                                                                                                  useDateFormat: boolean = true

                                                                                                  Toggle indicating whether to automatically parse formats natively as Date.

                                                                                                  +

                                                                                                  Accessors

                                                                                                  Methods

                                                                                                  • Internal utility transforming a string key or path into a ready-to-use DataObject.

                                                                                                    +

                                                                                                    Parameters

                                                                                                    • key: string

                                                                                                      The short UID or full database path.

                                                                                                      +

                                                                                                    Returns Promise<DataObjectClass<any>>

                                                                                                    A promise resolving to the newly initialized DataObjectClass.

                                                                                                    +

                                                                                                    If key is empty or malformed.

                                                                                                    +
                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_backend.CollectionProperty.html b/docs/public/api-reference/classes/_quatrain_backend.CollectionProperty.html new file mode 100644 index 00000000..871eedf5 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.CollectionProperty.html @@ -0,0 +1,105 @@ +CollectionProperty | Quatrain Core Documentation
                                                                                                  Quatrain Core Documentation
                                                                                                    Preparing search index...

                                                                                                    Class CollectionProperty

                                                                                                    A specialized backend property that represents a one-to-many or many-to-many relationship. +Unlike the core CollectionProperty, this property acts as a dynamic query builder, +fetching related PersistedBaseObject instances directly from the database when accessed.

                                                                                                    +
                                                                                                    const users = new CollectionProperty({
                                                                                                    name: 'employees',
                                                                                                    instanceOf: User,
                                                                                                    parentKey: 'companyUri' // The field in 'User' that stores the company ID
                                                                                                    });

                                                                                                    // Fetch the collection from the database
                                                                                                    const results = await users.val();
                                                                                                    console.log(results); // Array of User objects +
                                                                                                    + +

                                                                                                    Hierarchy (View Summary)

                                                                                                    Index

                                                                                                    Constructors

                                                                                                    Properties

                                                                                                    _allows: string[] = []
                                                                                                    _backend: any
                                                                                                    _defaultValue: any
                                                                                                    _events: { [key: string]: Function } = {}
                                                                                                    _filters: Filter | Filter[] | undefined = undefined
                                                                                                    _hasChanged: boolean
                                                                                                    _htmlType: PropertyHTMLType = 'off'
                                                                                                    _id: string
                                                                                                    _instanceOf: typeof PersistedBaseObject
                                                                                                    _mandatory: boolean = false
                                                                                                    _name: string
                                                                                                    _parent: DataObjectClass<any> | undefined
                                                                                                    _parentKey: string
                                                                                                    _protected: boolean = false
                                                                                                    _query: Query<any>
                                                                                                    _value: any[] | DataObjectClass<any>[] | ObjectUri[] | undefined = undefined
                                                                                                    EVENT_ONCHANGE: string = 'onChange'

                                                                                                    Event name triggered when the property value changes.

                                                                                                    +
                                                                                                    EVENT_ONDELETE: string = 'onDelete'

                                                                                                    Event name triggered when the property is deleted.

                                                                                                    +
                                                                                                    TYPE: string = 'collection'

                                                                                                    Type identifier for the property registry.

                                                                                                    +

                                                                                                    Accessors

                                                                                                    Methods

                                                                                                    • Applies an anonymous function to each item in the collection. +Fetches fully instantiated model class instances from the database if not hydrated.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • fn: (item: any) => any

                                                                                                        The anonymous callback function to apply to each item.

                                                                                                        +

                                                                                                      Returns Promise<any[]>

                                                                                                      A promise resolving to the results of the callback applications.

                                                                                                      +
                                                                                                    • Calculates the average of the numeric values of a property across items in the collection. +Delegates to database query if not hydrated.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • property: string

                                                                                                        The name of the property to average.

                                                                                                        +

                                                                                                      Returns Promise<number>

                                                                                                      A promise resolving to the average of all numeric values.

                                                                                                      +
                                                                                                    • Returns the count of items in the collection, optionally filtered by a predicate callback. +If no predicate is provided and the collection is not hydrated, it runs a fast database query.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • Optionalpredicate: (item: any) => boolean

                                                                                                        An optional filter callback to run on each item.

                                                                                                        +

                                                                                                      Returns Promise<number>

                                                                                                      A promise resolving to the count of matching items.

                                                                                                      +
                                                                                                    • Retrieves all distinct values of a property across the collection items. +Delegates to database query if not hydrated.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • property: string

                                                                                                        The name of the property.

                                                                                                        +

                                                                                                      Returns Promise<any[]>

                                                                                                      A promise resolving to an array of unique property values.

                                                                                                      +
                                                                                                    • Constructs or retrieves the backend query builder for this collection. +This allows chaining further database conditions before execution.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • filters: Filter[] | undefined = undefined

                                                                                                        Optional array of filters to apply to the collection query.

                                                                                                        +

                                                                                                      Returns Query<any>

                                                                                                      A Query object ready to be executed against the backend.

                                                                                                      +
                                                                                                    • Groups the collection items by the values of a specific property. +Fetches and hydrates the collection first if not already hydrated.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • property: string

                                                                                                        The name of the property to group by.

                                                                                                        +

                                                                                                      Returns Promise<Record<string, any[]>>

                                                                                                      A promise resolving to a dictionary object.

                                                                                                      +
                                                                                                    • Returns the maximum value of a numeric property across the collection items. +Delegates to database query if not hydrated.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • property: string

                                                                                                        The name of the property.

                                                                                                        +

                                                                                                      Returns Promise<number | undefined>

                                                                                                      A promise resolving to the maximum numeric value found, or undefined.

                                                                                                      +
                                                                                                    • Returns the minimum value of a numeric property across the collection items. +Delegates to database query if not hydrated.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • property: string

                                                                                                        The name of the property.

                                                                                                        +

                                                                                                      Returns Promise<number | undefined>

                                                                                                      A promise resolving to the minimum numeric value found, or undefined.

                                                                                                      +
                                                                                                    • Plucks a specific property from each item in the collection. +Fetches and hydrates the collection first if not already hydrated.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • property: string

                                                                                                        The name of the property to extract.

                                                                                                        +

                                                                                                      Returns Promise<any[]>

                                                                                                      A promise resolving to an array containing the extracted property values.

                                                                                                      +
                                                                                                    • Sums the numeric values of a property across items in the collection. +Delegates to database query if not hydrated.

                                                                                                      +

                                                                                                      Parameters

                                                                                                      • property: string

                                                                                                        The name of the property to sum.

                                                                                                        +

                                                                                                      Returns Promise<number>

                                                                                                      A promise resolving to the sum of all numeric values.

                                                                                                      +
                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_backend.Filter.html b/docs/public/api-reference/classes/_quatrain_backend.Filter.html new file mode 100644 index 00000000..bd0b21d1 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.Filter.html @@ -0,0 +1,9 @@ +Filter | Quatrain Core Documentation
                                                                                                    Quatrain Core Documentation
                                                                                                      Preparing search index...

                                                                                                      Represents a single atomic filtering condition for a database query.

                                                                                                      +

                                                                                                      Implements

                                                                                                      • FilterType
                                                                                                      Index

                                                                                                      Constructors

                                                                                                      Properties

                                                                                                      Constructors

                                                                                                      Properties

                                                                                                      operator: FilterOperatorType

                                                                                                      The logic operator evaluating the condition (e.g., 'equals', 'greater', 'contains').

                                                                                                      +
                                                                                                      prop: string

                                                                                                      The precise property name in the collection to apply the filter against.

                                                                                                      +
                                                                                                      value: any

                                                                                                      The raw value, array of values, or object reference to compare against.

                                                                                                      +
                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_backend.Filters.html b/docs/public/api-reference/classes/_quatrain_backend.Filters.html new file mode 100644 index 00000000..850ac4bb --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.Filters.html @@ -0,0 +1,8 @@ +Filters | Quatrain Core Documentation
                                                                                                      Quatrain Core Documentation
                                                                                                        Preparing search index...

                                                                                                        Aggregates multiple Filter instances into logical groups (OR, AND). +Used heavily by the Query builder for advanced search criteria.

                                                                                                        +

                                                                                                        Implements

                                                                                                        • FiltersType
                                                                                                        Index

                                                                                                        Constructors

                                                                                                        Properties

                                                                                                        Constructors

                                                                                                        Properties

                                                                                                        and?: Filter[]

                                                                                                        Array of filters evaluated with a strict AND logical operator.

                                                                                                        +
                                                                                                        or?: Filter[]

                                                                                                        Array of filters evaluated with an inclusive OR logical operator.

                                                                                                        +
                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_backend.InjectKeywordsMiddleware.html b/docs/public/api-reference/classes/_quatrain_backend.InjectKeywordsMiddleware.html new file mode 100644 index 00000000..bd6cf3ea --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.InjectKeywordsMiddleware.html @@ -0,0 +1,11 @@ +InjectKeywordsMiddleware | Quatrain Core Documentation
                                                                                                        Quatrain Core Documentation
                                                                                                          Preparing search index...

                                                                                                          Class InjectKeywordsMiddleware

                                                                                                          Backend middleware that automatically generates searchable keywords for an object. +It scans all string properties marked with fullSearch: true and generates substrings +to enable fast type-ahead searches on platforms like Firestore.

                                                                                                          +

                                                                                                          Implements

                                                                                                          Index

                                                                                                          Constructors

                                                                                                          Methods

                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_backend.InjectMetaMiddleware.html b/docs/public/api-reference/classes/_quatrain_backend.InjectMetaMiddleware.html new file mode 100644 index 00000000..c7b51477 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.InjectMetaMiddleware.html @@ -0,0 +1,11 @@ +InjectMetaMiddleware | Quatrain Core Documentation
                                                                                                          Quatrain Core Documentation
                                                                                                            Preparing search index...

                                                                                                            Class InjectMetaMiddleware

                                                                                                            Backend middleware that automatically timestamps and logs user activity. +Injects createdAt, updatedAt, deletedAt and corresponding By relations +using the current Context user when the object undergoes CRUD operations.

                                                                                                            +

                                                                                                            Implements

                                                                                                            Index

                                                                                                            Constructors

                                                                                                            Properties

                                                                                                            Methods

                                                                                                            Constructors

                                                                                                            Properties

                                                                                                            _user: User | undefined

                                                                                                            Methods

                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_backend.Limits.html b/docs/public/api-reference/classes/_quatrain_backend.Limits.html new file mode 100644 index 00000000..f2f13228 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.Limits.html @@ -0,0 +1,7 @@ +Limits | Quatrain Core Documentation
                                                                                                            Quatrain Core Documentation
                                                                                                              Preparing search index...

                                                                                                              Defines the pagination boundaries for a database query.

                                                                                                              +

                                                                                                              Implements

                                                                                                              • LimitsType
                                                                                                              Index

                                                                                                              Constructors

                                                                                                              Properties

                                                                                                              Constructors

                                                                                                              Properties

                                                                                                              batch: number

                                                                                                              The maximum number of records to return in a single batch. Defaults to 10.

                                                                                                              +
                                                                                                              offset: number

                                                                                                              The number of initial records to skip. Defaults to 0.

                                                                                                              +
                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_backend.MockAdapter.html b/docs/public/api-reference/classes/_quatrain_backend.MockAdapter.html new file mode 100644 index 00000000..fa4f8a43 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.MockAdapter.html @@ -0,0 +1,116 @@ +MockAdapter | Quatrain Core Documentation
                                                                                                              Quatrain Core Documentation
                                                                                                                Preparing search index...

                                                                                                                In-memory mock adapter used strictly for testing and validation. +Intercepts database calls and reads/writes to a static local fixture dictionary. +Does not support SQL operations.

                                                                                                                +

                                                                                                                Hierarchy (View Summary)

                                                                                                                Implements

                                                                                                                Index

                                                                                                                Constructors

                                                                                                                Properties

                                                                                                                _alias: string = ''
                                                                                                                _middlewares: BM[] = []
                                                                                                                _params: BackendParameters = {}
                                                                                                                _fixtures: any = {}
                                                                                                                PKEY_IDENTIFIER: any = 'id'

                                                                                                                The string identifier for primary keys, mapped to 'id' by default.

                                                                                                                +

                                                                                                                Accessors

                                                                                                                Methods

                                                                                                                • Executes an aggregation operation (sum, avg, distinct, min, max, count) on a query. +The default implementation fetches all matching records and performs in-memory aggregation. +Specific database adapters should override this to perform native query aggregation.

                                                                                                                  +

                                                                                                                  Parameters

                                                                                                                  • query: Query<any>

                                                                                                                    The Query instance defining the collection and filters.

                                                                                                                    +
                                                                                                                  • operation: "sum" | "avg" | "distinct" | "min" | "max" | "count"

                                                                                                                    The aggregate operation.

                                                                                                                    +
                                                                                                                  • Optionalproperty: string

                                                                                                                    The name of the property to aggregate.

                                                                                                                    +

                                                                                                                  Returns Promise<any>

                                                                                                                  A promise resolving to the aggregated result.

                                                                                                                  +
                                                                                                                • Mocks the deleteCollection action by looping through all fixtures and deleting matches.

                                                                                                                  +

                                                                                                                  Parameters

                                                                                                                  • collection: string

                                                                                                                    The collection name prefix.

                                                                                                                    +
                                                                                                                  • OptionalbatchSize: number

                                                                                                                    Unused in Mock adapter.

                                                                                                                    +

                                                                                                                  Returns Promise<void>

                                                                                                                  A promise resolving on completion.

                                                                                                                  +
                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_backend.PersistedBaseObject.html b/docs/public/api-reference/classes/_quatrain_backend.PersistedBaseObject.html new file mode 100644 index 00000000..b4230e49 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.PersistedBaseObject.html @@ -0,0 +1,102 @@ +PersistedBaseObject | Quatrain Core Documentation
                                                                                                                Quatrain Core Documentation
                                                                                                                  Preparing search index...

                                                                                                                  Class PersistedBaseObject

                                                                                                                  The fundamental class for all domain models that require database persistence. +Extends the core BaseObject by adding backend-aware lifecycle methods (save, delete, query) +and providing a factory to hydrate objects directly from the database.

                                                                                                                  +

                                                                                                                  Hierarchy (View Summary)

                                                                                                                  Index

                                                                                                                  Constructors

                                                                                                                  Properties

                                                                                                                  _dataObject: DataObjectClass<any>
                                                                                                                  _repositoryInstance: any = null
                                                                                                                  COLLECTION: string | undefined

                                                                                                                  The backend identifier (table or collection name) representing this class.

                                                                                                                  +
                                                                                                                  LABEL_KEY: string = 'name'

                                                                                                                  Which property's value to use in backend as label for object reference

                                                                                                                  +
                                                                                                                  PARENT_PROP: string | undefined

                                                                                                                  The name of the property handling hierarchical parent relationships.

                                                                                                                  +
                                                                                                                  PROPS_DEFINITION: any = BaseObjectProperties

                                                                                                                  The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                  +
                                                                                                                  REPOSITORY_CLASS: any = null

                                                                                                                  The designated repository class for this model (defaults to BaseRepository).

                                                                                                                  +

                                                                                                                  Accessors

                                                                                                                  Methods

                                                                                                                  • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                    +

                                                                                                                    Parameters

                                                                                                                    • hardDelete: boolean = false

                                                                                                                      If true, permanently removes the record from the database.

                                                                                                                      +

                                                                                                                    Returns Promise<DataObjectClass<any>>

                                                                                                                    A promise resolving to the underlying DataObjectClass.

                                                                                                                    +
                                                                                                                  • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                    +

                                                                                                                    Parameters

                                                                                                                    • obj: any

                                                                                                                      The child class definition (e.g., LogModel) to query.

                                                                                                                      +

                                                                                                                    Returns Query<any>

                                                                                                                    A new Query builder scoped to this parent instance.

                                                                                                                    +
                                                                                                                  • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                    +

                                                                                                                    Parameters

                                                                                                                    • src: string | ObjectUri | undefined = undefined

                                                                                                                      The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                      +
                                                                                                                    • child: any = ...

                                                                                                                      The specific child class constructor to instantiate.

                                                                                                                      +

                                                                                                                    Returns Promise<any>

                                                                                                                    A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                    +

                                                                                                                    If instantiation fails.

                                                                                                                    +
                                                                                                                  • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                    +

                                                                                                                    Type Parameters

                                                                                                                    • T

                                                                                                                    Parameters

                                                                                                                    • path: string

                                                                                                                      The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                      +

                                                                                                                    Returns Promise<T>

                                                                                                                    A promise resolving to the populated class instance.

                                                                                                                    +
                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_backend.PersistedDataObject.html b/docs/public/api-reference/classes/_quatrain_backend.PersistedDataObject.html new file mode 100644 index 00000000..a5813af6 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.PersistedDataObject.html @@ -0,0 +1,101 @@ +PersistedDataObject | Quatrain Core Documentation
                                                                                                                  Quatrain Core Documentation
                                                                                                                    Preparing search index...

                                                                                                                    Class PersistedDataObject

                                                                                                                    Data objects constitute the agnostic glue between objects and backends. +They handle data and identifiers in a protected registry. +This is what backends and objects manipulate, oblivious of the other. +It manages the actual "dirty" state, paths, and values mapped from the database.

                                                                                                                    +

                                                                                                                    Hierarchy (View Summary)

                                                                                                                    Implements

                                                                                                                    • Persisted
                                                                                                                    Index

                                                                                                                    Constructors

                                                                                                                    Properties

                                                                                                                    _modified: boolean = false

                                                                                                                    Has data been modified since last backend operation?

                                                                                                                    +
                                                                                                                    _objectUri: ObjectUri
                                                                                                                    _parentProp: string | undefined
                                                                                                                    _persisted: boolean = false
                                                                                                                    _populated: boolean = false
                                                                                                                    _properties: Properties = {}
                                                                                                                    _proxied: any
                                                                                                                    _uid: string | undefined = undefined

                                                                                                                    Accessors

                                                                                                                    • get backend(): string | undefined

                                                                                                                      Retrieves the specific backend alias bound to this object's URI.

                                                                                                                      +

                                                                                                                      Returns string | undefined

                                                                                                                      The string alias of the backend adapter (e.g., 'default', 'firestore').

                                                                                                                      +

                                                                                                                    Methods

                                                                                                                    • Parameters

                                                                                                                      • objectsAsReferences: boolean = false
                                                                                                                      • ignoreUnchanged: boolean = false
                                                                                                                      • ignoreNulls: boolean = false
                                                                                                                      • converters: {} = {}

                                                                                                                      Returns {}

                                                                                                                    • Checks or updates the persisted state of the DataObject.

                                                                                                                      +

                                                                                                                      Parameters

                                                                                                                      • set: boolean = false

                                                                                                                        If true, flags the object as fully saved and resets property modification trackers.

                                                                                                                        +

                                                                                                                      Returns boolean

                                                                                                                      True if the object was explicitly persisted.

                                                                                                                      +
                                                                                                                    • Populates the internal properties with given data or triggers a backend fetch +if the object possesses a path but hasn't been loaded yet.

                                                                                                                      +

                                                                                                                      Parameters

                                                                                                                      • data: { name: string; [x: string]: unknown } | undefined = undefined

                                                                                                                        Optional predefined data dictionary to hydrate immediately.

                                                                                                                        +

                                                                                                                      Returns Promise<PersistedDataObject>

                                                                                                                      A promise resolving to the hydrated data object.

                                                                                                                      +
                                                                                                                    • Serializes the data object using advanced configuration params.

                                                                                                                      +

                                                                                                                      Parameters

                                                                                                                      • params: boolean | toJSONParams = false

                                                                                                                        Serialization settings (e.g. resolve references, remove nulls).

                                                                                                                        +

                                                                                                                      Returns { [x: string]: any }

                                                                                                                      The raw serialized dictionary.

                                                                                                                      +
                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_backend.Query.html b/docs/public/api-reference/classes/_quatrain_backend.Query.html new file mode 100644 index 00000000..d57417a0 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.Query.html @@ -0,0 +1,99 @@ +Query | Quatrain Core Documentation
                                                                                                                    Quatrain Core Documentation
                                                                                                                      Preparing search index...

                                                                                                                      A fluent interface for building and executing database queries across all backend adapters. +Manages filters, sort orders, and pagination limits dynamically.

                                                                                                                      +
                                                                                                                      const query = new Query(User);
                                                                                                                      query.where('status', 'active').sortBy('createdAt', 'desc').batch(20);
                                                                                                                      const results = await query.execute(returnAs.AS_INSTANCES); +
                                                                                                                      + +

                                                                                                                      Type Parameters

                                                                                                                      Index

                                                                                                                      Constructors

                                                                                                                      Properties

                                                                                                                      _obj: T
                                                                                                                      _parent: T | undefined
                                                                                                                      filters: Filter[]

                                                                                                                      Array of instantiated Filter objects defining the query conditions.

                                                                                                                      +
                                                                                                                      limits: Limits

                                                                                                                      Pagination rules defining limits, batches, and offsets.

                                                                                                                      +
                                                                                                                      meta: any

                                                                                                                      Execution metadata populated by the backend after fetching (e.g. total count, execution time).

                                                                                                                      +
                                                                                                                      sortings: Sorting[]

                                                                                                                      Array of Sorting conditions dictating the order of returned results.

                                                                                                                      +

                                                                                                                      Accessors

                                                                                                                      Methods

                                                                                                                      • Executes an average aggregation query on the target property.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • property: string

                                                                                                                          The name of the numeric property to average.

                                                                                                                          +
                                                                                                                        • backend: BackendInterface = ...

                                                                                                                          The backend adapter to query against. Defaults to the global default backend.

                                                                                                                          +

                                                                                                                        Returns Promise<number>

                                                                                                                        A promise resolving to the average of the property values.

                                                                                                                        +
                                                                                                                      • Sets the maximum number of records to return (batch size).

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • batch: number = 10

                                                                                                                          The limit of records to fetch. Defaults to 10.

                                                                                                                          +

                                                                                                                        Returns Query<T>

                                                                                                                        The query instance for chaining.

                                                                                                                        +
                                                                                                                      • Executes a distinct aggregation query on the target property.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • property: string

                                                                                                                          The name of the property.

                                                                                                                          +
                                                                                                                        • backend: BackendInterface = ...

                                                                                                                          The backend adapter to query against. Defaults to the global default backend.

                                                                                                                          +

                                                                                                                        Returns Promise<any[]>

                                                                                                                        A promise resolving to an array of unique values.

                                                                                                                        +
                                                                                                                      • Primary execution handler for the query. Transforms the output based on the requested returnAs format.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • as: returnAs = returnAs.AS_DATAOBJECTS

                                                                                                                          The desired output format (AS_DATAOBJECTS, AS_OBJECTURIS, or AS_INSTANCES).

                                                                                                                          +
                                                                                                                        • backend: BackendInterface = ...

                                                                                                                          The backend adapter to query against.

                                                                                                                          +

                                                                                                                        Returns Promise<QueryResultType<any>>

                                                                                                                        A promise resolving to the query results in the specified format.

                                                                                                                        +

                                                                                                                        If an unknown output mode is requested.

                                                                                                                        +
                                                                                                                      • Executes a maximum aggregation query on the target property.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • property: string

                                                                                                                          The name of the property.

                                                                                                                          +
                                                                                                                        • backend: BackendInterface = ...

                                                                                                                          The backend adapter to query against. Defaults to the global default backend.

                                                                                                                          +

                                                                                                                        Returns Promise<number | undefined>

                                                                                                                        A promise resolving to the maximum value found, or undefined.

                                                                                                                        +
                                                                                                                      • Executes a minimum aggregation query on the target property.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • property: string

                                                                                                                          The name of the property.

                                                                                                                          +
                                                                                                                        • backend: BackendInterface = ...

                                                                                                                          The backend adapter to query against. Defaults to the global default backend.

                                                                                                                          +

                                                                                                                        Returns Promise<number | undefined>

                                                                                                                        A promise resolving to the minimum value found, or undefined.

                                                                                                                        +
                                                                                                                      • Sets the starting offset for pagination.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • offset: number = 0

                                                                                                                          The number of records to skip before returning results. Defaults to 0.

                                                                                                                          +

                                                                                                                        Returns Query<T>

                                                                                                                        The query instance for chaining.

                                                                                                                        +
                                                                                                                      • Updates the parent property of the current object. +This method is useful for SQL backends where a model may have two parent records +and requires dynamically setting the name of one of them.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • parent: string

                                                                                                                        Returns void

                                                                                                                      • Specifies a sorting rule for the query results.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • param: string | Sorting

                                                                                                                          The Sorting object or the string name of the field to sort by.

                                                                                                                          +
                                                                                                                        • order: any = 'asc'

                                                                                                                          The direction of the sort: 'asc' or 'desc'.

                                                                                                                          +

                                                                                                                        Returns Query<T>

                                                                                                                        The query instance for chaining.

                                                                                                                        +
                                                                                                                      • Executes a sum aggregation query on the target property.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • property: string

                                                                                                                          The name of the numeric property to sum.

                                                                                                                          +
                                                                                                                        • backend: BackendInterface = ...

                                                                                                                          The backend adapter to query against. Defaults to the global default backend.

                                                                                                                          +

                                                                                                                        Returns Promise<number>

                                                                                                                        A promise resolving to the sum of the property values.

                                                                                                                        +
                                                                                                                      • Appends a new filter condition to the query. +Can accept an instantiated Filter object or raw field parameters.

                                                                                                                        +

                                                                                                                        Parameters

                                                                                                                        • param: any

                                                                                                                          The Filter object or the string name of the field to filter on.

                                                                                                                          +
                                                                                                                        • value: any = null

                                                                                                                          The value to match (ignored if param is a Filter).

                                                                                                                          +
                                                                                                                        • operator: OperatorKeys = OperatorKeys.equals

                                                                                                                          The OperatorKeys comparison operator (e.g., equals, gt, lt). Defaults to equals.

                                                                                                                          +

                                                                                                                        Returns Query<T>

                                                                                                                        The query instance for chaining.

                                                                                                                        +
                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_backend.Repository.html b/docs/public/api-reference/classes/_quatrain_backend.Repository.html new file mode 100644 index 00000000..60f310ef --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.Repository.html @@ -0,0 +1,28 @@ +Repository | Quatrain Core Documentation
                                                                                                                      Quatrain Core Documentation
                                                                                                                        Preparing search index...

                                                                                                                        A service layer acting as a factory and container for retrieving specific model repositories. +Repositories encapsulate complex data access logic beyond basic CRUD operations.

                                                                                                                        +
                                                                                                                        Index

                                                                                                                        Constructors

                                                                                                                        Properties

                                                                                                                        backendAdapter: BackendInterface

                                                                                                                        The persistence adapter backing this repository.

                                                                                                                        +
                                                                                                                        currentUser: User | undefined

                                                                                                                        The authenticated user currently operating within this repository context.

                                                                                                                        +
                                                                                                                        useDateFormat: boolean = true

                                                                                                                        Configuration flag indicating whether dates should be formatted.

                                                                                                                        +
                                                                                                                        matches: { [x: string]: string } = {}

                                                                                                                        Registry matching model class names to their corresponding repository file paths (backward compatibility).

                                                                                                                        +

                                                                                                                        Methods

                                                                                                                        • Dynamically resolves and instantiates the specific repository class registered for a given model. +Incorporates dynamic ESM registry lookups with fallback to BaseRepository.

                                                                                                                          +

                                                                                                                          Parameters

                                                                                                                          • model: typeof PersistedBaseObject

                                                                                                                            The model class (extending PersistedBaseObject) to find a repository for.

                                                                                                                            +

                                                                                                                          Returns any

                                                                                                                          An instantiated repository pre-bound to this context's adapter.

                                                                                                                          +
                                                                                                                        • Assigns an authenticated user to this repository context for permission/audit tracking.

                                                                                                                          +

                                                                                                                          Parameters

                                                                                                                          • user: User

                                                                                                                            The User instance performing the operations.

                                                                                                                            +

                                                                                                                          Returns void

                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_backend.SortAndLimit.html b/docs/public/api-reference/classes/_quatrain_backend.SortAndLimit.html new file mode 100644 index 00000000..800a42d0 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.SortAndLimit.html @@ -0,0 +1,8 @@ +SortAndLimit | Quatrain Core Documentation
                                                                                                                        Quatrain Core Documentation
                                                                                                                          Preparing search index...

                                                                                                                          Aggregates sorting and pagination limit rules into a single structure +used by Query and Backend Adapters to process list requests.

                                                                                                                          +

                                                                                                                          Implements

                                                                                                                          • SortAndLimitType
                                                                                                                          Index

                                                                                                                          Constructors

                                                                                                                          Properties

                                                                                                                          Constructors

                                                                                                                          Properties

                                                                                                                          limits: Limits

                                                                                                                          Pagination rules defining batch size and offset.

                                                                                                                          +
                                                                                                                          sortings: Sorting[]

                                                                                                                          Array of property sorting definitions applied sequentially.

                                                                                                                          +
                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_backend.Sorting.html b/docs/public/api-reference/classes/_quatrain_backend.Sorting.html new file mode 100644 index 00000000..05036a74 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.Sorting.html @@ -0,0 +1,8 @@ +Sorting | Quatrain Core Documentation
                                                                                                                          Quatrain Core Documentation
                                                                                                                            Preparing search index...

                                                                                                                            Represents a single sorting rule applied to a Query. +Specifies the target property name and the sorting direction.

                                                                                                                            +

                                                                                                                            Implements

                                                                                                                            • SortingType
                                                                                                                            Index

                                                                                                                            Constructors

                                                                                                                            Properties

                                                                                                                            Constructors

                                                                                                                            Properties

                                                                                                                            order: "asc" | "desc"

                                                                                                                            The sorting order, either ascending (asc) or descending (desc).

                                                                                                                            +
                                                                                                                            prop: string

                                                                                                                            The exact property name in the collection to sort by.

                                                                                                                            +
                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_backend.User.html b/docs/public/api-reference/classes/_quatrain_backend.User.html new file mode 100644 index 00000000..c1b7e1e7 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.User.html @@ -0,0 +1,98 @@ +User | Quatrain Core Documentation
                                                                                                                            Quatrain Core Documentation
                                                                                                                              Preparing search index...

                                                                                                                              Core User domain model in the Quatrain framework. +Represents an authenticated or registered actor in the system.

                                                                                                                              +

                                                                                                                              Hierarchy (View Summary)

                                                                                                                              Index

                                                                                                                              Constructors

                                                                                                                              Properties

                                                                                                                              _dataObject: DataObjectClass<any>
                                                                                                                              _repositoryInstance: any = null
                                                                                                                              COLLECTION: string = 'user'

                                                                                                                              The backend database collection name for this model.

                                                                                                                              +
                                                                                                                              LABEL_KEY: string = 'name'

                                                                                                                              Which property's value to use in backend as label for object reference

                                                                                                                              +
                                                                                                                              PARENT_PROP: string | undefined

                                                                                                                              The name of the property handling hierarchical parent relationships.

                                                                                                                              +
                                                                                                                              PROPS_DEFINITION: any = UserProperties

                                                                                                                              Defines the property schema structure for a User.

                                                                                                                              +
                                                                                                                              REPOSITORY_CLASS: any = null

                                                                                                                              The designated repository class for this model (defaults to BaseRepository).

                                                                                                                              +

                                                                                                                              Accessors

                                                                                                                              Methods

                                                                                                                              • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                +

                                                                                                                                Type Parameters

                                                                                                                                • T

                                                                                                                                Parameters

                                                                                                                                • path: string

                                                                                                                                  The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                  +

                                                                                                                                Returns Promise<T>

                                                                                                                                A promise resolving to the populated class instance.

                                                                                                                                +
                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_backend.UserRepository.html b/docs/public/api-reference/classes/_quatrain_backend.UserRepository.html new file mode 100644 index 00000000..9a00cf99 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_backend.UserRepository.html @@ -0,0 +1,40 @@ +UserRepository | Quatrain Core Documentation
                                                                                                                              Quatrain Core Documentation
                                                                                                                                Preparing search index...

                                                                                                                                Specific repository implementation handling User model persistence and querying logic.

                                                                                                                                +

                                                                                                                                Hierarchy (View Summary)

                                                                                                                                Index

                                                                                                                                Constructors

                                                                                                                                Properties

                                                                                                                                _model: typeof PersistedBaseObject
                                                                                                                                backendAdapter: BackendInterface

                                                                                                                                The specific backend adapter designated for this repository's requests.

                                                                                                                                +
                                                                                                                                useDateFormat: boolean = true

                                                                                                                                Toggle indicating whether to automatically parse formats natively as Date.

                                                                                                                                +

                                                                                                                                Accessors

                                                                                                                                Methods

                                                                                                                                • Finds and loads a user profile based on an exact email match.

                                                                                                                                  +

                                                                                                                                  Parameters

                                                                                                                                  • email: string

                                                                                                                                    The email address to search for.

                                                                                                                                    +

                                                                                                                                  Returns Promise<UserType>

                                                                                                                                  A promise resolving to the found User object.

                                                                                                                                  +

                                                                                                                                  If no user is associated with this email.

                                                                                                                                  +
                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_cache-redis.RedisCacheAdapter.html b/docs/public/api-reference/classes/_quatrain_cache-redis.RedisCacheAdapter.html new file mode 100644 index 00000000..71700de1 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cache-redis.RedisCacheAdapter.html @@ -0,0 +1,24 @@ +RedisCacheAdapter | Quatrain Core Documentation
                                                                                                                                Quatrain Core Documentation
                                                                                                                                  Preparing search index...

                                                                                                                                  Concrete cache adapter implementation utilizing Redis via ioredis.

                                                                                                                                  +

                                                                                                                                  Implements

                                                                                                                                  Index

                                                                                                                                  Constructors

                                                                                                                                  Accessors

                                                                                                                                  Methods

                                                                                                                                  Constructors

                                                                                                                                  Accessors

                                                                                                                                  Methods

                                                                                                                                  • Deletes one or more keys from the cache.

                                                                                                                                    +

                                                                                                                                    Parameters

                                                                                                                                    • ...keys: string[]

                                                                                                                                      Rest array of keys to remove.

                                                                                                                                      +

                                                                                                                                    Returns Promise<void>

                                                                                                                                  • Retrieves a string value by key.

                                                                                                                                    +

                                                                                                                                    Parameters

                                                                                                                                    • key: string

                                                                                                                                      The cache key.

                                                                                                                                      +

                                                                                                                                    Returns Promise<string | null>

                                                                                                                                    The resolved string or null.

                                                                                                                                    +
                                                                                                                                  • Retrieves a raw buffer value by key.

                                                                                                                                    +

                                                                                                                                    Parameters

                                                                                                                                    • key: string

                                                                                                                                      The cache key.

                                                                                                                                      +

                                                                                                                                    Returns Promise<Buffer<ArrayBufferLike> | null>

                                                                                                                                    The resolved Buffer or null.

                                                                                                                                    +
                                                                                                                                  • Locates all cache keys matching a specific pattern.

                                                                                                                                    +

                                                                                                                                    Parameters

                                                                                                                                    • pattern: string

                                                                                                                                      Glob-style key matcher.

                                                                                                                                      +

                                                                                                                                    Returns Promise<string[]>

                                                                                                                                    List of matching keys.

                                                                                                                                    +
                                                                                                                                  • Stores a value in Redis with an optional TTL.

                                                                                                                                    +

                                                                                                                                    Parameters

                                                                                                                                    • key: string

                                                                                                                                      The target key.

                                                                                                                                      +
                                                                                                                                    • value: string | Buffer<ArrayBufferLike>

                                                                                                                                      String or binary payload.

                                                                                                                                      +
                                                                                                                                    • OptionalttlSeconds: number

                                                                                                                                      Expiration time in seconds.

                                                                                                                                      +

                                                                                                                                    Returns Promise<void>

                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_cache-redis.RedisManager.html b/docs/public/api-reference/classes/_quatrain_cache-redis.RedisManager.html new file mode 100644 index 00000000..2fdca888 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cache-redis.RedisManager.html @@ -0,0 +1,7 @@ +RedisManager | Quatrain Core Documentation
                                                                                                                                  Quatrain Core Documentation
                                                                                                                                    Preparing search index...

                                                                                                                                    Singleton connection manager encapsulating the active ioredis client.

                                                                                                                                    +
                                                                                                                                    Index

                                                                                                                                    Accessors

                                                                                                                                    Methods

                                                                                                                                    Accessors

                                                                                                                                    Methods

                                                                                                                                    • Instantiates or returns the active Redis connection singleton.

                                                                                                                                      +

                                                                                                                                      Parameters

                                                                                                                                      • Optionaloptions: string | RedisOptions

                                                                                                                                        Configuration URI or settings.

                                                                                                                                        +

                                                                                                                                      Returns RedisManager

                                                                                                                                      The active RedisManager instance.

                                                                                                                                      +
                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_cache.Cache.html b/docs/public/api-reference/classes/_quatrain_cache.Cache.html new file mode 100644 index 00000000..780cde73 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cache.Cache.html @@ -0,0 +1,94 @@ +Cache | Quatrain Core Documentation
                                                                                                                                    Quatrain Core Documentation
                                                                                                                                      Preparing search index...

                                                                                                                                      Global singleton cache registry holding references to instantiated cache adapters.

                                                                                                                                      +

                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                      Index

                                                                                                                                      Constructors

                                                                                                                                      Properties

                                                                                                                                      classRegistry: { [key: string]: any } = {}

                                                                                                                                      Dictionary holding registered active Quatrain models/components.

                                                                                                                                      +
                                                                                                                                      logger: AbstractLoggerAdapter = ...

                                                                                                                                      Active logger instance for the Core domain.

                                                                                                                                      +
                                                                                                                                      logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                      System-wide base log verbosity.

                                                                                                                                      +
                                                                                                                                      me: string = ...

                                                                                                                                      Identifying namespace for this core component.

                                                                                                                                      +
                                                                                                                                      storage: typeof NodePersist = persist

                                                                                                                                      Persistent key-value storage engine reference.

                                                                                                                                      +
                                                                                                                                      storagePrefix: "core" = 'core'

                                                                                                                                      Context prefix string for scoped storage keys.

                                                                                                                                      +

                                                                                                                                      Accessors

                                                                                                                                      • get userClass(): any

                                                                                                                                        Returns any

                                                                                                                                      • set userClass(cls: any): void

                                                                                                                                        Parameters

                                                                                                                                        • cls: any

                                                                                                                                        Returns void

                                                                                                                                      Methods

                                                                                                                                      • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • name: string

                                                                                                                                          Semantic registry name.

                                                                                                                                          +
                                                                                                                                        • obj: any

                                                                                                                                          Class constructor.

                                                                                                                                          +

                                                                                                                                        Returns void

                                                                                                                                      • Stores a primitive value durably in the core storage instance.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • key: string

                                                                                                                                          Identification string.

                                                                                                                                          +
                                                                                                                                        • value: any

                                                                                                                                          Value.

                                                                                                                                          +

                                                                                                                                        Returns Promise<void>

                                                                                                                                      • Injects a new logger block under a specific namespace alias.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • alias: string = ...

                                                                                                                                          The logging context name.

                                                                                                                                          +

                                                                                                                                        Returns any

                                                                                                                                        Instantiated LoggerAdapter.

                                                                                                                                        +
                                                                                                                                      • Flushes the internal map of registered cache adapters.

                                                                                                                                        +

                                                                                                                                        Returns void

                                                                                                                                      • Triggers a debug log on the core logger.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • ...message: any

                                                                                                                                          Content to log.

                                                                                                                                          +

                                                                                                                                        Returns void

                                                                                                                                      • Deprecated: Reserved schema definition hook.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • key: string

                                                                                                                                          The property block to generate.

                                                                                                                                          +

                                                                                                                                        Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                        Field definitions block.

                                                                                                                                        +
                                                                                                                                      • Triggers an error log on the core logger.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • ...message: any

                                                                                                                                          Content to log.

                                                                                                                                          +

                                                                                                                                        Returns void

                                                                                                                                      • Returns an injected class constructor by its registry identifier.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • name: string

                                                                                                                                          The semantic name to resolve.

                                                                                                                                          +

                                                                                                                                        Returns any

                                                                                                                                        Class definition.

                                                                                                                                        +
                                                                                                                                      • Recovers a durably persisted value from the storage layer.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • key: string

                                                                                                                                          The target identifier.

                                                                                                                                          +

                                                                                                                                        Returns Promise<any>

                                                                                                                                        The recovered value.

                                                                                                                                        +
                                                                                                                                      • Utility lookup to find executable paths in the system using which.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • command: string

                                                                                                                                          The executable.

                                                                                                                                          +

                                                                                                                                        Returns Promise<string>

                                                                                                                                        The resolved system path.

                                                                                                                                        +
                                                                                                                                      • Triggers an info log on the core logger.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • ...message: any

                                                                                                                                          Content to log.

                                                                                                                                          +

                                                                                                                                        Returns void

                                                                                                                                      • Triggers a standard log on the core logger.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • ...message: any

                                                                                                                                          Content to log.

                                                                                                                                          +

                                                                                                                                        Returns void

                                                                                                                                      • Execution suspension utility blocking the event loop context.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • seconds: number = 1

                                                                                                                                          Duration count.

                                                                                                                                          +

                                                                                                                                        Returns Promise<unknown>

                                                                                                                                        The promise to await.

                                                                                                                                        +
                                                                                                                                      • Triggers a trace log on the core logger.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • ...message: any

                                                                                                                                          Content to log.

                                                                                                                                          +

                                                                                                                                        Returns void

                                                                                                                                      • Removes a cache adapter from the registry.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • name: string

                                                                                                                                          The name to deregister.

                                                                                                                                          +

                                                                                                                                        Returns void

                                                                                                                                      • Triggers a warning log on the core logger.

                                                                                                                                        +

                                                                                                                                        Parameters

                                                                                                                                        • ...message: any

                                                                                                                                          Content to log.

                                                                                                                                          +

                                                                                                                                        Returns void

                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_cache.CacheInvalidateMiddleware.html b/docs/public/api-reference/classes/_quatrain_cache.CacheInvalidateMiddleware.html new file mode 100644 index 00000000..056f947a --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cache.CacheInvalidateMiddleware.html @@ -0,0 +1,11 @@ +CacheInvalidateMiddleware | Quatrain Core Documentation
                                                                                                                                      Quatrain Core Documentation
                                                                                                                                        Preparing search index...

                                                                                                                                        Class CacheInvalidateMiddleware

                                                                                                                                        Middleware that intercepts backend data modifications to trigger cache invalidation.

                                                                                                                                        +

                                                                                                                                        Implements

                                                                                                                                        Index

                                                                                                                                        Constructors

                                                                                                                                        Properties

                                                                                                                                        Methods

                                                                                                                                        Constructors

                                                                                                                                        Properties

                                                                                                                                        _prefixResolver: PrefixResolver

                                                                                                                                        Methods

                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_cache.MediaCacheProxy.html b/docs/public/api-reference/classes/_quatrain_cache.MediaCacheProxy.html new file mode 100644 index 00000000..73e78a61 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cache.MediaCacheProxy.html @@ -0,0 +1,12 @@ +MediaCacheProxy | Quatrain Core Documentation
                                                                                                                                        Quatrain Core Documentation
                                                                                                                                          Preparing search index...

                                                                                                                                          Class MediaCacheProxy

                                                                                                                                          A proxy layer that attempts to serve media files from a cache adapter before falling back to storage.

                                                                                                                                          +
                                                                                                                                          Index

                                                                                                                                          Constructors

                                                                                                                                          Properties

                                                                                                                                          Methods

                                                                                                                                          Constructors

                                                                                                                                          Properties

                                                                                                                                          _ttl: number

                                                                                                                                          Methods

                                                                                                                                          • Fetches a media file, trying Cache first, and falling back to the StorageAdapter.

                                                                                                                                            +

                                                                                                                                            Parameters

                                                                                                                                            Returns Promise<Buffer<ArrayBufferLike>>

                                                                                                                                            The file binary data as a Buffer

                                                                                                                                            +
                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_chat.ChatController.html b/docs/public/api-reference/classes/_quatrain_chat.ChatController.html new file mode 100644 index 00000000..ef63e0df --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_chat.ChatController.html @@ -0,0 +1,7 @@ +ChatController | Quatrain Core Documentation
                                                                                                                                          Quatrain Core Documentation
                                                                                                                                            Preparing search index...

                                                                                                                                            Class ChatController

                                                                                                                                            Controller managing chat sessions, local context extraction, and LLM message dispatching.

                                                                                                                                            +
                                                                                                                                            Index

                                                                                                                                            Constructors

                                                                                                                                            Methods

                                                                                                                                            Constructors

                                                                                                                                            Methods

                                                                                                                                            • Dispatches user message thread, matches local documents, extracts context, and returns the LLM stream.

                                                                                                                                              +

                                                                                                                                              Parameters

                                                                                                                                              • messages: { content: string; role: string }[]

                                                                                                                                                Complete message thread history.

                                                                                                                                                +
                                                                                                                                              • documents: ChatDocument[]

                                                                                                                                                Availables documents for keyword/tag RAG injection.

                                                                                                                                                +

                                                                                                                                              Returns Promise<
                                                                                                                                                  {
                                                                                                                                                      enrichedContentLength: number;
                                                                                                                                                      finalPrompt: string;
                                                                                                                                                      matchedDocsCount: number;
                                                                                                                                                      model: string;
                                                                                                                                                      stream: AsyncIterable<string>;
                                                                                                                                                  },
                                                                                                                                              >

                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_cli.CliCommand.html b/docs/public/api-reference/classes/_quatrain_cli.CliCommand.html new file mode 100644 index 00000000..3f56eea0 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cli.CliCommand.html @@ -0,0 +1,281 @@ +CliCommand | Quatrain Core Documentation
                                                                                                                                            Quatrain Core Documentation
                                                                                                                                              Preparing search index...

                                                                                                                                              Class CliCommand

                                                                                                                                              Custom Commander subclass to wrap Command functionality inside @quatrain/cli.

                                                                                                                                              +

                                                                                                                                              Hierarchy

                                                                                                                                              • Command
                                                                                                                                                • CliCommand
                                                                                                                                              Index

                                                                                                                                              Constructors

                                                                                                                                              • Parameters

                                                                                                                                                • Optionalname: string

                                                                                                                                                Returns CliCommand

                                                                                                                                              Properties

                                                                                                                                              args: string[]
                                                                                                                                              commands: readonly Command[]
                                                                                                                                              options: readonly Option[]
                                                                                                                                              parent: Command | null
                                                                                                                                              processedArgs: any[]
                                                                                                                                              registeredArguments: readonly Argument[]

                                                                                                                                              Methods

                                                                                                                                              • Register callback fn for the command.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • fn: (...args: any[]) => void | Promise<void>

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                program
                                                                                                                                                .command('serve')
                                                                                                                                                .description('start service')
                                                                                                                                                .action(function() {
                                                                                                                                                // do work here
                                                                                                                                                }); +
                                                                                                                                                + +
                                                                                                                                              • Define argument syntax for command, adding a prepared argument.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • arg: Argument

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Add a prepared subcommand.

                                                                                                                                                +

                                                                                                                                                See .command() for creating an attached subcommand which inherits settings from its parent.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • cmd: Command
                                                                                                                                                • Optionalopts: CommandOptions

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Override default decision whether to add implicit help command.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • OptionalenableOrNameAndArgs: string | boolean
                                                                                                                                                • Optionaldescription: string

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                addHelpCommand() // force on
                                                                                                                                                addHelpCommand(false); // force off
                                                                                                                                                addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details +
                                                                                                                                                + +
                                                                                                                                              • Add additional text to be displayed with the built-in help.

                                                                                                                                                +

                                                                                                                                                Position is 'before' or 'after' to affect just this command, +and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • position: AddHelpTextPosition
                                                                                                                                                • text: string

                                                                                                                                                Returns this

                                                                                                                                              • Add additional text to be displayed with the built-in help.

                                                                                                                                                +

                                                                                                                                                Position is 'before' or 'after' to affect just this command, +and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • position: AddHelpTextPosition
                                                                                                                                                • text: (context: AddHelpTextContext) => string

                                                                                                                                                Returns this

                                                                                                                                              • Add a prepared Option.

                                                                                                                                                +

                                                                                                                                                See .option() and .requiredOption() for creating and attaching an option in a single call.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • option: Option

                                                                                                                                                Returns this

                                                                                                                                              • Set an alias for the command.

                                                                                                                                                +

                                                                                                                                                You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • alias: string

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Get alias for the command.

                                                                                                                                                +

                                                                                                                                                Returns string

                                                                                                                                              • Set aliases for the command.

                                                                                                                                                +

                                                                                                                                                Only the first alias is shown in the auto-generated help.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • aliases: readonly string[]

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Get aliases for the command.

                                                                                                                                                +

                                                                                                                                                Returns string[]

                                                                                                                                              • Allow excess command-arguments on the command line. Pass false to make excess arguments an error.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • OptionalallowExcess: boolean

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Allow unknown options on the command line.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • OptionalallowUnknown: boolean

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Define argument syntax for command.

                                                                                                                                                +

                                                                                                                                                The default is that the argument is required, and you can explicitly +indicate this with <> around the name. Put [] around the name for an optional argument.

                                                                                                                                                +

                                                                                                                                                Type Parameters

                                                                                                                                                • T

                                                                                                                                                Parameters

                                                                                                                                                • flags: string
                                                                                                                                                • description: string
                                                                                                                                                • fn: (value: string, previous: T) => T
                                                                                                                                                • OptionaldefaultValue: T

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                program.argument('<input-file>');
                                                                                                                                                program.argument('[output-file]'); +
                                                                                                                                                + +
                                                                                                                                              • Define argument syntax for command.

                                                                                                                                                +

                                                                                                                                                The default is that the argument is required, and you can explicitly +indicate this with <> around the name. Put [] around the name for an optional argument.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • name: string
                                                                                                                                                • Optionaldescription: string
                                                                                                                                                • OptionaldefaultValue: unknown

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                program.argument('<input-file>');
                                                                                                                                                program.argument('[output-file]'); +
                                                                                                                                                + +
                                                                                                                                              • Define argument syntax for command, adding multiple at once (without descriptions).

                                                                                                                                                +

                                                                                                                                                See also .argument().

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • names: string

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                program.arguments('<cmd> [env]');
                                                                                                                                                +
                                                                                                                                                + +
                                                                                                                                              • Alter parsing of short flags with optional values.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalcombine: boolean

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                // for `.option('-f,--flag [value]'):
                                                                                                                                                .combineFlagAndOptionalValue(true) // `-f80` is treated like `--flag=80`, this is the default behaviour
                                                                                                                                                .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b` +
                                                                                                                                                + +
                                                                                                                                              • Define a command, implemented using an action handler.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • nameAndArgs: string

                                                                                                                                                  command name and arguments, args are <required> or [optional] and last may also be variadic...

                                                                                                                                                  +
                                                                                                                                                • Optionalopts: CommandOptions

                                                                                                                                                  configuration options

                                                                                                                                                  +

                                                                                                                                                Returns Command

                                                                                                                                                new command

                                                                                                                                                +

                                                                                                                                                The command description is supplied using .description, not as a parameter to .command.

                                                                                                                                                +
                                                                                                                                                program
                                                                                                                                                .command('clone <source> [destination]')
                                                                                                                                                .description('clone a repository into a newly created directory')
                                                                                                                                                .action((source, destination) => {
                                                                                                                                                console.log('clone command called');
                                                                                                                                                }); +
                                                                                                                                                + +
                                                                                                                                              • Define a command, implemented in a separate executable file.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • nameAndArgs: string

                                                                                                                                                  command name and arguments, args are <required> or [optional] and last may also be variadic...

                                                                                                                                                  +
                                                                                                                                                • description: string

                                                                                                                                                  description of executable command

                                                                                                                                                  +
                                                                                                                                                • Optionalopts: ExecutableCommandOptions

                                                                                                                                                  configuration options

                                                                                                                                                  +

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +

                                                                                                                                                The command description is supplied as the second parameter to .command.

                                                                                                                                                +
                                                                                                                                                 program
                                                                                                                                                .command('start <service>', 'start named service')
                                                                                                                                                .command('stop [service]', 'stop named service, or all if no name supplied'); +
                                                                                                                                                + +
                                                                                                                                              • You can customise the help by overriding Help properties using configureHelp(), +or with a subclass of Help by overriding createHelp().

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • configuration: HelpConfiguration

                                                                                                                                                Returns this

                                                                                                                                              • Get configuration

                                                                                                                                                +

                                                                                                                                                Returns HelpConfiguration

                                                                                                                                              • The default output goes to stdout and stderr. You can customise this for special +applications. You can also customise the display of errors by overriding outputError.

                                                                                                                                                +

                                                                                                                                                The configuration properties are all functions:

                                                                                                                                                +
                                                                                                                                                // functions to change where being written, stdout and stderr
                                                                                                                                                writeOut(str)
                                                                                                                                                writeErr(str)
                                                                                                                                                // matching functions to specify width for wrapping help
                                                                                                                                                getOutHelpWidth()
                                                                                                                                                getErrHelpWidth()
                                                                                                                                                // functions based on what is being written out
                                                                                                                                                outputError(str, write) // used for displaying errors, and not used for displaying help +
                                                                                                                                                + +

                                                                                                                                                Parameters

                                                                                                                                                • configuration: OutputConfiguration

                                                                                                                                                Returns this

                                                                                                                                              • Get configuration

                                                                                                                                                +

                                                                                                                                                Returns OutputConfiguration

                                                                                                                                              • Copy settings that are useful to have in common across root command and subcommands.

                                                                                                                                                +

                                                                                                                                                (Used internally when adding a command using .command() so subcommands inherit parent settings.)

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • sourceCommand: Command

                                                                                                                                                Returns this

                                                                                                                                              • Factory routine to create a new unattached argument.

                                                                                                                                                +

                                                                                                                                                See .argument() for creating an attached argument, which uses this routine to +create the argument. You can override createArgument to return a custom argument.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • name: string
                                                                                                                                                • Optionaldescription: string

                                                                                                                                                Returns Argument

                                                                                                                                              • Factory routine to create a new unattached command.

                                                                                                                                                +

                                                                                                                                                See .command() for creating an attached subcommand, which uses this routine to +create the command. You can override createCommand to customise subcommands.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalname: string

                                                                                                                                                Returns Command

                                                                                                                                              • You can customise the help with a subclass of Help by overriding createHelp, +or by overriding Help properties using configureHelp().

                                                                                                                                                +

                                                                                                                                                Returns Help

                                                                                                                                              • Factory routine to create a new unattached option.

                                                                                                                                                +

                                                                                                                                                See .option() for creating an attached option, which uses this routine to +create the option. You can override createOption to return a custom option.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • flags: string
                                                                                                                                                • Optionaldescription: string

                                                                                                                                                Returns Option

                                                                                                                                              • Set the description.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • str: string

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Parameters

                                                                                                                                                • str: string
                                                                                                                                                • argsDescription: Record<string, string>

                                                                                                                                                Returns this

                                                                                                                                                since v8, instead use .argument to add command argument with description

                                                                                                                                                +
                                                                                                                                              • Get the description.

                                                                                                                                                +

                                                                                                                                                Returns string

                                                                                                                                              • Enable positional options. Positional means global options are specified before subcommands which lets +subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.

                                                                                                                                                +

                                                                                                                                                The default behaviour is non-positional and global options may appear anywhere on the command line.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalpositional: boolean

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Display error message and exit (or call exitOverride).

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • message: string
                                                                                                                                                • OptionalerrorOptions: ErrorOptions

                                                                                                                                                Returns never

                                                                                                                                              • Set the directory for searching for executable subcommands of this command.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • path: string

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                program.executableDir(__dirname);
                                                                                                                                                // or
                                                                                                                                                program.executableDir('subcommands'); +
                                                                                                                                                + +
                                                                                                                                              • Get the executable search directory.

                                                                                                                                                +

                                                                                                                                                Returns string | null

                                                                                                                                              • Register callback to use as replacement for calling process.exit.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalcallback: (err: CommanderError) => void

                                                                                                                                                Returns this

                                                                                                                                              • Retrieve option value.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • key: string

                                                                                                                                                Returns any

                                                                                                                                              • Get source of option value.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • key: string

                                                                                                                                                Returns OptionValueSource

                                                                                                                                              • Get source of option value. See also .optsWithGlobals().

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • key: string

                                                                                                                                                Returns OptionValueSource

                                                                                                                                              • Output help information and exit.

                                                                                                                                                +

                                                                                                                                                Outputs built-in help, and custom text added using .addHelpText().

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalcontext: HelpContext

                                                                                                                                                Returns never

                                                                                                                                              • Parameters

                                                                                                                                                • Optionalcb: (str: string) => string

                                                                                                                                                Returns never

                                                                                                                                                since v7

                                                                                                                                                +
                                                                                                                                              • Return command help documentation.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalcontext: HelpContext

                                                                                                                                                Returns string

                                                                                                                                              • You can pass in flags and a description to override the help +flags and help description for your command. Pass in false +to disable the built-in help option.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalflags: string | boolean
                                                                                                                                                • Optionaldescription: string

                                                                                                                                                Returns this

                                                                                                                                              • Add hook for life cycle event.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • event: HookEvent
                                                                                                                                                • listener: (thisCommand: Command, actionCommand: Command) => void | Promise<void>

                                                                                                                                                Returns this

                                                                                                                                              • Set the name of the command.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • str: string

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Get the name of the command.

                                                                                                                                                +

                                                                                                                                                Returns string

                                                                                                                                              • Set the name of the command from script filename, such as process.argv[1], +or require.main.filename, or __filename.

                                                                                                                                                +

                                                                                                                                                (Used internally and public although not documented in README.)

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • filename: string

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                program.nameFromFilename(require.main.filename);
                                                                                                                                                +
                                                                                                                                                + +
                                                                                                                                              • Add a listener (callback) for when events occur. (Implemented using EventEmitter.)

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • event: string | symbol
                                                                                                                                                • listener: (...args: any[]) => void

                                                                                                                                                Returns this

                                                                                                                                              • Define option with flags, description, and optional argument parsing function or defaultValue or both.

                                                                                                                                                +

                                                                                                                                                The flags string contains the short and/or long flags, separated by comma, a pipe or space. A required +option-argument is indicated by <> and an optional option-argument by [].

                                                                                                                                                +

                                                                                                                                                See the README for more details, and see also addOption() and requiredOption().

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • flags: string
                                                                                                                                                • Optionaldescription: string
                                                                                                                                                • OptionaldefaultValue: string | boolean | string[]

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                program
                                                                                                                                                .option('-p, --pepper', 'add pepper')
                                                                                                                                                .option('-p, --pizza-type <TYPE>', 'type of pizza') // required option-argument
                                                                                                                                                .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
                                                                                                                                                .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function +
                                                                                                                                                + +
                                                                                                                                              • Define option with flags, description, and optional argument parsing function or defaultValue or both.

                                                                                                                                                +

                                                                                                                                                The flags string contains the short and/or long flags, separated by comma, a pipe or space. A required +option-argument is indicated by <> and an optional option-argument by [].

                                                                                                                                                +

                                                                                                                                                See the README for more details, and see also addOption() and requiredOption().

                                                                                                                                                +

                                                                                                                                                Type Parameters

                                                                                                                                                • T

                                                                                                                                                Parameters

                                                                                                                                                • flags: string
                                                                                                                                                • description: string
                                                                                                                                                • parseArg: (value: string, previous: T) => T
                                                                                                                                                • OptionaldefaultValue: T

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                program
                                                                                                                                                .option('-p, --pepper', 'add pepper')
                                                                                                                                                .option('-p, --pizza-type <TYPE>', 'type of pizza') // required option-argument
                                                                                                                                                .option('-c, --cheese [CHEESE]', 'add extra cheese', 'mozzarella') // optional option-argument with default
                                                                                                                                                .option('-t, --tip <VALUE>', 'add tip to purchase cost', parseFloat) // custom parse function +
                                                                                                                                                + +
                                                                                                                                              • Parameters

                                                                                                                                                • flags: string
                                                                                                                                                • description: string
                                                                                                                                                • regexp: RegExp
                                                                                                                                                • OptionaldefaultValue: string | boolean | string[]

                                                                                                                                                Returns this

                                                                                                                                                since v7, instead use choices or a custom function

                                                                                                                                                +
                                                                                                                                              • Return an object containing local option values as key-value pairs

                                                                                                                                                +

                                                                                                                                                Type Parameters

                                                                                                                                                • T extends OptionValues

                                                                                                                                                Returns T

                                                                                                                                              • Return an object containing merged local and global option values as key-value pairs.

                                                                                                                                                +

                                                                                                                                                Type Parameters

                                                                                                                                                • T extends OptionValues

                                                                                                                                                Returns T

                                                                                                                                              • Output help information for this command.

                                                                                                                                                +

                                                                                                                                                Outputs built-in help, and custom text added using .addHelpText().

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalcontext: HelpContext

                                                                                                                                                Returns void

                                                                                                                                              • Parameters

                                                                                                                                                • Optionalcb: (str: string) => string

                                                                                                                                                Returns void

                                                                                                                                                since v7

                                                                                                                                                +
                                                                                                                                              • Parse argv, setting options and invoking commands when defined.

                                                                                                                                                +

                                                                                                                                                The default expectation is that the arguments are from node and have the application as argv[0] +and the script being run in argv[1], with user parameters after that.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalargv: readonly string[]
                                                                                                                                                • Optionaloptions: ParseOptions

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                                program.parse(process.argv);
                                                                                                                                                program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
                                                                                                                                                program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] +
                                                                                                                                                + +
                                                                                                                                              • Parse argv, setting options and invoking commands when defined.

                                                                                                                                                +

                                                                                                                                                Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.

                                                                                                                                                +

                                                                                                                                                The default expectation is that the arguments are from node and have the application as argv[0] +and the script being run in argv[1], with user parameters after that.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • Optionalargv: readonly string[]
                                                                                                                                                • Optionaloptions: ParseOptions

                                                                                                                                                Returns Promise<CliCommand>

                                                                                                                                                Promise

                                                                                                                                                +
                                                                                                                                                program.parseAsync(process.argv);
                                                                                                                                                program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
                                                                                                                                                program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0] +
                                                                                                                                                + +
                                                                                                                                              • Parse options from argv removing known options, +and return argv split into operands and unknown arguments.

                                                                                                                                                +
                                                                                                                                                argv => operands, unknown
                                                                                                                                                +--known kkk op => [op], []
                                                                                                                                                +op --known kkk => [op], []
                                                                                                                                                +sub --unknown uuu op => [sub], [--unknown uuu op]
                                                                                                                                                +sub -- --unknown uuu op => [sub --unknown uuu op], []
                                                                                                                                                +
                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • argv: string[]

                                                                                                                                                Returns ParseOptionsResult

                                                                                                                                              • Pass through options that come after command-arguments rather than treat them as command-options, +so actual command-options come before command-arguments. Turning this on for a subcommand requires +positional options to have been enabled on the program (parent commands).

                                                                                                                                                +

                                                                                                                                                The default behaviour is non-positional and options may appear before or after command-arguments.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • OptionalpassThrough: boolean

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Define a required option, which must have a value after parsing. This usually means +the option must be specified on the command line. (Otherwise the same as .option().)

                                                                                                                                                +

                                                                                                                                                The flags string contains the short and/or long flags, separated by comma, a pipe or space.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • flags: string
                                                                                                                                                • Optionaldescription: string
                                                                                                                                                • OptionaldefaultValue: string | boolean | string[]

                                                                                                                                                Returns this

                                                                                                                                              • Define a required option, which must have a value after parsing. This usually means +the option must be specified on the command line. (Otherwise the same as .option().)

                                                                                                                                                +

                                                                                                                                                The flags string contains the short and/or long flags, separated by comma, a pipe or space.

                                                                                                                                                +

                                                                                                                                                Type Parameters

                                                                                                                                                • T

                                                                                                                                                Parameters

                                                                                                                                                • flags: string
                                                                                                                                                • description: string
                                                                                                                                                • parseArg: (value: string, previous: T) => T
                                                                                                                                                • OptionaldefaultValue: T

                                                                                                                                                Returns this

                                                                                                                                              • Parameters

                                                                                                                                                • flags: string
                                                                                                                                                • description: string
                                                                                                                                                • regexp: RegExp
                                                                                                                                                • OptionaldefaultValue: string | boolean | string[]

                                                                                                                                                Returns this

                                                                                                                                                since v7, instead use choices or a custom function

                                                                                                                                                +
                                                                                                                                              • Store option value.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • key: string
                                                                                                                                                • value: unknown

                                                                                                                                                Returns this

                                                                                                                                              • Store option value and where the value came from.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • key: string
                                                                                                                                                • value: unknown
                                                                                                                                                • source: OptionValueSource

                                                                                                                                                Returns this

                                                                                                                                              • Display the help or a custom message after an error occurs.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • OptionaldisplayHelp: string | boolean

                                                                                                                                                Returns this

                                                                                                                                              • Display suggestion of similar commands for unknown commands, or options for unknown options.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • OptionaldisplaySuggestion: boolean

                                                                                                                                                Returns this

                                                                                                                                              • Whether to store option values as properties on command object, +or store separately (specify false). In both cases the option values can be accessed using .opts().

                                                                                                                                                +

                                                                                                                                                Type Parameters

                                                                                                                                                • T extends OptionValues

                                                                                                                                                Returns CliCommand & T

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Whether to store option values as properties on command object, +or store separately (specify false). In both cases the option values can be accessed using .opts().

                                                                                                                                                +

                                                                                                                                                Type Parameters

                                                                                                                                                • T extends OptionValues

                                                                                                                                                Parameters

                                                                                                                                                • storeAsProperties: true

                                                                                                                                                Returns CliCommand & T

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Whether to store option values as properties on command object, +or store separately (specify false). In both cases the option values can be accessed using .opts().

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • OptionalstoreAsProperties: boolean

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Set the summary. Used when listed as subcommand of parent.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • str: string

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Get the summary.

                                                                                                                                                +

                                                                                                                                                Returns string

                                                                                                                                              • Set the command usage.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • str: string

                                                                                                                                                Returns this

                                                                                                                                                this command for chaining

                                                                                                                                                +
                                                                                                                                              • Get the command usage.

                                                                                                                                                +

                                                                                                                                                Returns string

                                                                                                                                              • Set the program version to str.

                                                                                                                                                +

                                                                                                                                                This method auto-registers the "-V, --version" flag +which will print the version number when passed.

                                                                                                                                                +

                                                                                                                                                You can optionally supply the flags and description to override the defaults.

                                                                                                                                                +

                                                                                                                                                Parameters

                                                                                                                                                • str: string
                                                                                                                                                • Optionalflags: string
                                                                                                                                                • Optionaldescription: string

                                                                                                                                                Returns this

                                                                                                                                              • Get the program version.

                                                                                                                                                +

                                                                                                                                                Returns string | undefined

                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_cli.Command.html b/docs/public/api-reference/classes/_quatrain_cli.Command.html new file mode 100644 index 00000000..173a139a --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cli.Command.html @@ -0,0 +1,30 @@ +Command | Quatrain Core Documentation
                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                Preparing search index...

                                                                                                                                                Fluent builder for launching and managing system subprocesses. +Supports cross-platform execution and shell redirection (e.g. PowerShell).

                                                                                                                                                +
                                                                                                                                                Index

                                                                                                                                                Constructors

                                                                                                                                                Methods

                                                                                                                                                • Add multiple command-line arguments.

                                                                                                                                                  +

                                                                                                                                                  Parameters

                                                                                                                                                  • values: string[]

                                                                                                                                                    List of argument strings.

                                                                                                                                                    +

                                                                                                                                                  Returns this

                                                                                                                                                • Set the working directory for the subprocess.

                                                                                                                                                  +

                                                                                                                                                  Parameters

                                                                                                                                                  • dir: string

                                                                                                                                                    Absolute or relative directory path.

                                                                                                                                                    +

                                                                                                                                                  Returns this

                                                                                                                                                • Set or extend environment variables for the subprocess.

                                                                                                                                                  +

                                                                                                                                                  Parameters

                                                                                                                                                  • vars: Record<string, string>

                                                                                                                                                    Key-value dictionary of environment variables.

                                                                                                                                                    +

                                                                                                                                                  Returns this

                                                                                                                                                • Execute the configured command and return a Promise resolving on process exit.

                                                                                                                                                  +

                                                                                                                                                  Returns Promise<
                                                                                                                                                      {
                                                                                                                                                          code: number
                                                                                                                                                          | null;
                                                                                                                                                          stderr: string;
                                                                                                                                                          stdout: string;
                                                                                                                                                          success: boolean;
                                                                                                                                                      },
                                                                                                                                                  >

                                                                                                                                                  Promise resolving with standard output, error streams, and status.

                                                                                                                                                  +
                                                                                                                                                • Enable executing the command via PowerShell (powershell.exe or pwsh).

                                                                                                                                                  +

                                                                                                                                                  Parameters

                                                                                                                                                  • use: boolean = true

                                                                                                                                                    Whether to use PowerShell.

                                                                                                                                                    +
                                                                                                                                                  • type: "powershell" | "pwsh" = 'powershell'

                                                                                                                                                    Shell binary choice ('powershell' or 'pwsh').

                                                                                                                                                    +

                                                                                                                                                  Returns this

                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_cli.inquirer.Separator.html b/docs/public/api-reference/classes/_quatrain_cli.inquirer.Separator.html new file mode 100644 index 00000000..04dc614b --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cli.inquirer.Separator.html @@ -0,0 +1,11 @@ +Separator | Quatrain Core Documentation
                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                  Preparing search index...

                                                                                                                                                  Represents a choice-item separator.

                                                                                                                                                  +

                                                                                                                                                  Implements

                                                                                                                                                  • SeparatorOptions
                                                                                                                                                  Index

                                                                                                                                                  Constructors

                                                                                                                                                  Properties

                                                                                                                                                  Methods

                                                                                                                                                  Constructors

                                                                                                                                                  • Initializes a new instance of the Separator class.

                                                                                                                                                    +

                                                                                                                                                    Parameters

                                                                                                                                                    • Optionalline: string

                                                                                                                                                      The text of the separator.

                                                                                                                                                      +

                                                                                                                                                    Returns Separator

                                                                                                                                                  Properties

                                                                                                                                                  line: string
                                                                                                                                                  type: "separator"

                                                                                                                                                  Methods

                                                                                                                                                  • Checks whether the specified item is not a separator.

                                                                                                                                                    +

                                                                                                                                                    Parameters

                                                                                                                                                    • item: any

                                                                                                                                                      The item to check.

                                                                                                                                                      +

                                                                                                                                                    Returns boolean

                                                                                                                                                    A value indicating whether the item is not a separator.

                                                                                                                                                    +
                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_cli.inquirer.ui.BottomBar.html b/docs/public/api-reference/classes/_quatrain_cli.inquirer.ui.BottomBar.html new file mode 100644 index 00000000..379b3a1f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cli.inquirer.ui.BottomBar.html @@ -0,0 +1,31 @@ +BottomBar | Quatrain Core Documentation
                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                    Preparing search index...

                                                                                                                                                    Represents the bottom-bar UI.

                                                                                                                                                    +

                                                                                                                                                    Hierarchy

                                                                                                                                                    • UI
                                                                                                                                                      • BottomBar
                                                                                                                                                    Index

                                                                                                                                                    Constructors

                                                                                                                                                    • Initializes a new instance of the BottomBar class.

                                                                                                                                                      +

                                                                                                                                                      Parameters

                                                                                                                                                      Returns BottomBar

                                                                                                                                                    Properties

                                                                                                                                                    activePrompt: PromptBase

                                                                                                                                                    Gets or sets the currently active prompt.

                                                                                                                                                    +
                                                                                                                                                    log: ThroughStream

                                                                                                                                                    Gets or sets a stream to write logs to.

                                                                                                                                                    +
                                                                                                                                                    rl: Interface

                                                                                                                                                    Gets or sets an object for performing read from and write to the console.

                                                                                                                                                    +

                                                                                                                                                    Methods

                                                                                                                                                    • Cleans the bottom bar.

                                                                                                                                                      +

                                                                                                                                                      Returns this

                                                                                                                                                    • Releases all unmanaged resources.

                                                                                                                                                      +

                                                                                                                                                      Returns void

                                                                                                                                                    • Fixes the new-line characters of the specified text.

                                                                                                                                                      +

                                                                                                                                                      Parameters

                                                                                                                                                      • text: string

                                                                                                                                                        The text to process.

                                                                                                                                                        +

                                                                                                                                                      Returns string

                                                                                                                                                    • Handles a forced exit of the application.

                                                                                                                                                      +

                                                                                                                                                      Returns void

                                                                                                                                                    • Renders the bottom bar.

                                                                                                                                                      +

                                                                                                                                                      Returns this

                                                                                                                                                    • Renders the specified text to the bottom bar.

                                                                                                                                                      +

                                                                                                                                                      Parameters

                                                                                                                                                      • text: string

                                                                                                                                                        The text to print to the bottom bar.

                                                                                                                                                        +

                                                                                                                                                      Returns this

                                                                                                                                                    • Writes a message to the bottom bar.

                                                                                                                                                      +

                                                                                                                                                      Parameters

                                                                                                                                                      • message: string

                                                                                                                                                        The message to write.

                                                                                                                                                        +

                                                                                                                                                      Returns void

                                                                                                                                                    • Writes the specified data to the log-zone.

                                                                                                                                                      +

                                                                                                                                                      Parameters

                                                                                                                                                      • data: any

                                                                                                                                                        The data to write to the log-zone.

                                                                                                                                                        +

                                                                                                                                                      Returns this

                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_cli.inquirer.ui.Prompt.html b/docs/public/api-reference/classes/_quatrain_cli.inquirer.ui.Prompt.html new file mode 100644 index 00000000..5661c18c --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cli.inquirer.ui.Prompt.html @@ -0,0 +1,42 @@ +Prompt | Quatrain Core Documentation
                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                      Preparing search index...

                                                                                                                                                      Represents the prompt ui.

                                                                                                                                                      +

                                                                                                                                                      Type Parameters

                                                                                                                                                      • T extends Answers = Answers

                                                                                                                                                      Hierarchy

                                                                                                                                                      • UI
                                                                                                                                                        • Prompt
                                                                                                                                                      Index

                                                                                                                                                      Constructors

                                                                                                                                                      • Initializes a new instance of the Prompt class.

                                                                                                                                                        +

                                                                                                                                                        Type Parameters

                                                                                                                                                        • T extends Answers = Answers

                                                                                                                                                        Parameters

                                                                                                                                                        • prompts: PromptCollection

                                                                                                                                                          The prompts for the ui.

                                                                                                                                                          +
                                                                                                                                                        • Optionaloptions: StreamOptions

                                                                                                                                                          The input- and output-stream of the ui.

                                                                                                                                                          +

                                                                                                                                                        Returns Prompt<T>

                                                                                                                                                      Properties

                                                                                                                                                      activePrompt: PromptBase

                                                                                                                                                      Gets or sets the currently active prompt.

                                                                                                                                                      +
                                                                                                                                                      answers: T

                                                                                                                                                      Gets or sets the answers provided by the user.

                                                                                                                                                      +
                                                                                                                                                      process: Observable<QuestionAnswer<T>>

                                                                                                                                                      Gets or sets the event-flow of the process.

                                                                                                                                                      +

                                                                                                                                                      Gets or sets the prompts of the ui.

                                                                                                                                                      +
                                                                                                                                                      rl: Interface

                                                                                                                                                      Gets or sets an object for performing read from and write to the console.

                                                                                                                                                      +

                                                                                                                                                      Methods

                                                                                                                                                      • Releases all unmanaged resources.

                                                                                                                                                        +

                                                                                                                                                        Returns void

                                                                                                                                                      • Fetches the answer to a question.

                                                                                                                                                        +

                                                                                                                                                        Parameters

                                                                                                                                                        Returns Observable<FetchedAnswer>

                                                                                                                                                        The answer to the question.

                                                                                                                                                        +
                                                                                                                                                      • Filters the question if it is runnable.

                                                                                                                                                        +

                                                                                                                                                        Parameters

                                                                                                                                                        • question: DistinctQuestion<T>

                                                                                                                                                          The question to filter.

                                                                                                                                                          +

                                                                                                                                                        Returns Observable<DistinctQuestion<T>>

                                                                                                                                                        Either the event-flow of the question if it is runnable or an empty event-flow.

                                                                                                                                                        +
                                                                                                                                                      • Finishes the process.

                                                                                                                                                        +

                                                                                                                                                        Returns T

                                                                                                                                                      • Handles a forced exit of the application.

                                                                                                                                                        +

                                                                                                                                                        Returns void

                                                                                                                                                      • Processes a question.

                                                                                                                                                        +

                                                                                                                                                        Parameters

                                                                                                                                                        • question: DistinctQuestion<T>

                                                                                                                                                          The question to process.

                                                                                                                                                          +

                                                                                                                                                        Returns Observable<FetchedAnswer>

                                                                                                                                                        The answer to the question.

                                                                                                                                                        +
                                                                                                                                                      • Runs the prompt-UI.

                                                                                                                                                        +

                                                                                                                                                        Parameters

                                                                                                                                                        • questions: DistinctQuestion<T>[]

                                                                                                                                                          The questions to prompt the user to answer.

                                                                                                                                                          +

                                                                                                                                                        Returns Promise<T>

                                                                                                                                                        The answers provided by the user.

                                                                                                                                                        +
                                                                                                                                                      • Sets the type of the question if no question-type is specified.

                                                                                                                                                        +

                                                                                                                                                        Parameters

                                                                                                                                                        • question: DistinctQuestion<T>

                                                                                                                                                          The question to set the default type for.

                                                                                                                                                          +

                                                                                                                                                        Returns Observable<DistinctQuestion<T>>

                                                                                                                                                        The processed question.

                                                                                                                                                        +
                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_cloudwrapper-firebase.FirebaseCloudWrapper.html b/docs/public/api-reference/classes/_quatrain_cloudwrapper-firebase.FirebaseCloudWrapper.html new file mode 100644 index 00000000..8a0a7794 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cloudwrapper-firebase.FirebaseCloudWrapper.html @@ -0,0 +1,17 @@ +FirebaseCloudWrapper | Quatrain Core Documentation
                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                        Preparing search index...

                                                                                                                                                        Concrete implementation adapting Firebase / Google Cloud platform functions and triggers.

                                                                                                                                                        +

                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                        Index

                                                                                                                                                        Constructors

                                                                                                                                                        Properties

                                                                                                                                                        _isInitialized: boolean = false
                                                                                                                                                        _params: any

                                                                                                                                                        Methods

                                                                                                                                                        • Registers a new Firebase HTTPS/HTTP function.

                                                                                                                                                          +

                                                                                                                                                          Parameters

                                                                                                                                                          • func: any

                                                                                                                                                            The cloud function handler logic.

                                                                                                                                                            +
                                                                                                                                                          • params: HttpsOptions = DEFAULT_HTTPS_OPTIONS

                                                                                                                                                            Resource options (memory, timeout).

                                                                                                                                                            +

                                                                                                                                                          Returns HttpsFunction

                                                                                                                                                          The constructed HTTPS function.

                                                                                                                                                          +
                                                                                                                                                        • Registers a Firebase Storage finalized trigger.

                                                                                                                                                          +

                                                                                                                                                          Parameters

                                                                                                                                                          • func: any

                                                                                                                                                            The execution callback payload.

                                                                                                                                                            +
                                                                                                                                                          • eventType: BackendAction

                                                                                                                                                            Event tracking action (e.g. CREATE).

                                                                                                                                                            +

                                                                                                                                                          Returns CloudFunction<StorageEvent>

                                                                                                                                                          The generated CloudFunction event handler.

                                                                                                                                                          +

                                                                                                                                                          If action type is unknown.

                                                                                                                                                          +
                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_cloudwrapper-supabase.SupabaseCloudWrapper.html b/docs/public/api-reference/classes/_quatrain_cloudwrapper-supabase.SupabaseCloudWrapper.html new file mode 100644 index 00000000..25591670 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cloudwrapper-supabase.SupabaseCloudWrapper.html @@ -0,0 +1,19 @@ +SupabaseCloudWrapper | Quatrain Core Documentation
                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                          Preparing search index...

                                                                                                                                                          Concrete implementation adapting Supabase realtime channels and functions.

                                                                                                                                                          +

                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                          Index

                                                                                                                                                          Constructors

                                                                                                                                                          Properties

                                                                                                                                                          _connectionTimeout: Timeout | undefined
                                                                                                                                                          _heartbeatOkReceived: boolean = false
                                                                                                                                                          _isInitialized: boolean = false
                                                                                                                                                          _params: any
                                                                                                                                                          _supabaseClient: SupabaseClient<any, "public", "public", any, any> | undefined

                                                                                                                                                          Methods

                                                                                                                                                          • Binds a PostgreSQL Realtime subscription to track CRUD events on tables.

                                                                                                                                                            +

                                                                                                                                                            Parameters

                                                                                                                                                            • trigger: DatabaseTriggerType

                                                                                                                                                              Configuration defining the targeted table, event, and callback script.

                                                                                                                                                              +

                                                                                                                                                            Returns void | { event: any; schema: string; table: string }

                                                                                                                                                            Event subscription payload params.

                                                                                                                                                            +

                                                                                                                                                            If script or client is improperly configured.

                                                                                                                                                            +
                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_cloudwrapper.AbstractCloudWrapper.html b/docs/public/api-reference/classes/_quatrain_cloudwrapper.AbstractCloudWrapper.html new file mode 100644 index 00000000..b09fbf58 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cloudwrapper.AbstractCloudWrapper.html @@ -0,0 +1,4 @@ +AbstractCloudWrapper | Quatrain Core Documentation
                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                            Preparing search index...

                                                                                                                                                            Base abstraction for Cloud platform wrappers.

                                                                                                                                                            +

                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                            Index

                                                                                                                                                            Constructors

                                                                                                                                                            Properties

                                                                                                                                                            Constructors

                                                                                                                                                            Properties

                                                                                                                                                            _params: any
                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_cloudwrapper.CloudWrapper.html b/docs/public/api-reference/classes/_quatrain_cloudwrapper.CloudWrapper.html new file mode 100644 index 00000000..6fd81e57 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_cloudwrapper.CloudWrapper.html @@ -0,0 +1,78 @@ +CloudWrapper | Quatrain Core Documentation
                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                              Preparing search index...

                                                                                                                                                              Singleton registry for managing cloud wrapper contexts.

                                                                                                                                                              +

                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                              Index

                                                                                                                                                              Constructors

                                                                                                                                                              Properties

                                                                                                                                                              classRegistry: { [key: string]: any } = {}

                                                                                                                                                              Dictionary holding registered active Quatrain models/components.

                                                                                                                                                              +
                                                                                                                                                              logger: any = ...

                                                                                                                                                              Internal domain logger instance.

                                                                                                                                                              +
                                                                                                                                                              logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                              System-wide base log verbosity.

                                                                                                                                                              +
                                                                                                                                                              me: string = ...

                                                                                                                                                              Identifying namespace for this core component.

                                                                                                                                                              +
                                                                                                                                                              storage: typeof NodePersist = persist

                                                                                                                                                              Persistent key-value storage engine reference.

                                                                                                                                                              +
                                                                                                                                                              storagePrefix: "core" = 'core'

                                                                                                                                                              Context prefix string for scoped storage keys.

                                                                                                                                                              +

                                                                                                                                                              Accessors

                                                                                                                                                              • get userClass(): any

                                                                                                                                                                Returns any

                                                                                                                                                              • set userClass(cls: any): void

                                                                                                                                                                Parameters

                                                                                                                                                                • cls: any

                                                                                                                                                                Returns void

                                                                                                                                                              Methods

                                                                                                                                                              • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • name: string

                                                                                                                                                                  Semantic registry name.

                                                                                                                                                                  +
                                                                                                                                                                • obj: any

                                                                                                                                                                  Class constructor.

                                                                                                                                                                  +

                                                                                                                                                                Returns void

                                                                                                                                                              • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • key: string

                                                                                                                                                                  Identification string.

                                                                                                                                                                  +
                                                                                                                                                                • value: any

                                                                                                                                                                  Value.

                                                                                                                                                                  +

                                                                                                                                                                Returns Promise<void>

                                                                                                                                                              • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • alias: string = ...

                                                                                                                                                                  The logging context name.

                                                                                                                                                                  +

                                                                                                                                                                Returns any

                                                                                                                                                                Instantiated LoggerAdapter.

                                                                                                                                                                +
                                                                                                                                                              • Triggers a debug log on the core logger.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • ...message: any

                                                                                                                                                                  Content to log.

                                                                                                                                                                  +

                                                                                                                                                                Returns void

                                                                                                                                                              • Deprecated: Reserved schema definition hook.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • key: string

                                                                                                                                                                  The property block to generate.

                                                                                                                                                                  +

                                                                                                                                                                Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                Field definitions block.

                                                                                                                                                                +
                                                                                                                                                              • Triggers an error log on the core logger.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • ...message: any

                                                                                                                                                                  Content to log.

                                                                                                                                                                  +

                                                                                                                                                                Returns void

                                                                                                                                                              • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • name: string

                                                                                                                                                                  The semantic name to resolve.

                                                                                                                                                                  +

                                                                                                                                                                Returns any

                                                                                                                                                                Class definition.

                                                                                                                                                                +
                                                                                                                                                              • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • key: string

                                                                                                                                                                  The target identifier.

                                                                                                                                                                  +

                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                The recovered value.

                                                                                                                                                                +
                                                                                                                                                              • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • command: string

                                                                                                                                                                  The executable.

                                                                                                                                                                  +

                                                                                                                                                                Returns Promise<string>

                                                                                                                                                                The resolved system path.

                                                                                                                                                                +
                                                                                                                                                              • Triggers an info log on the core logger.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • ...message: any

                                                                                                                                                                  Content to log.

                                                                                                                                                                  +

                                                                                                                                                                Returns void

                                                                                                                                                              • Triggers a standard log on the core logger.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • ...message: any

                                                                                                                                                                  Content to log.

                                                                                                                                                                  +

                                                                                                                                                                Returns void

                                                                                                                                                              • Execution suspension utility blocking the event loop context.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • seconds: number = 1

                                                                                                                                                                  Duration count.

                                                                                                                                                                  +

                                                                                                                                                                Returns Promise<unknown>

                                                                                                                                                                The promise to await.

                                                                                                                                                                +
                                                                                                                                                              • Triggers a trace log on the core logger.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • ...message: any

                                                                                                                                                                  Content to log.

                                                                                                                                                                  +

                                                                                                                                                                Returns void

                                                                                                                                                              • Triggers a warning log on the core logger.

                                                                                                                                                                +

                                                                                                                                                                Parameters

                                                                                                                                                                • ...message: any

                                                                                                                                                                  Content to log.

                                                                                                                                                                  +

                                                                                                                                                                Returns void

                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_code-github.GithubAdapter.html b/docs/public/api-reference/classes/_quatrain_code-github.GithubAdapter.html new file mode 100644 index 00000000..fc2ee533 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_code-github.GithubAdapter.html @@ -0,0 +1,18 @@ +GithubAdapter | Quatrain Core Documentation
                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                Preparing search index...

                                                                                                                                                                Repository integration logic specifically adapting GitHub via the official Octokit SDK.

                                                                                                                                                                +

                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                Index

                                                                                                                                                                Constructors

                                                                                                                                                                Properties

                                                                                                                                                                Methods

                                                                                                                                                                Constructors

                                                                                                                                                                Properties

                                                                                                                                                                _octokit: Octokit & { paginate: PaginateInterface } & RestEndpointMethods & Api
                                                                                                                                                                _owner: string
                                                                                                                                                                _repo: string

                                                                                                                                                                Methods

                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_code.AbstractRepositoryAdapter.html b/docs/public/api-reference/classes/_quatrain_code.AbstractRepositoryAdapter.html new file mode 100644 index 00000000..67ae0bf5 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_code.AbstractRepositoryAdapter.html @@ -0,0 +1,12 @@ +AbstractRepositoryAdapter | Quatrain Core Documentation
                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                  Preparing search index...

                                                                                                                                                                  Class AbstractRepositoryAdapterAbstract

                                                                                                                                                                  Base blueprint for defining repository source control adapters.

                                                                                                                                                                  +

                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                  Index

                                                                                                                                                                  Constructors

                                                                                                                                                                  Methods

                                                                                                                                                                  Constructors

                                                                                                                                                                  Methods

                                                                                                                                                                  • Create a new branch

                                                                                                                                                                    +

                                                                                                                                                                    Parameters

                                                                                                                                                                    • branchName: string
                                                                                                                                                                    • OptionalfromBranch: string

                                                                                                                                                                    Returns Promise<void>

                                                                                                                                                                  • Pull latest changes from remote repository

                                                                                                                                                                    +

                                                                                                                                                                    Parameters

                                                                                                                                                                    • Optionalbranch: string

                                                                                                                                                                    Returns Promise<void>

                                                                                                                                                                  • Commit and push files to remote repository

                                                                                                                                                                    +

                                                                                                                                                                    Parameters

                                                                                                                                                                    • files: CommitFile[]

                                                                                                                                                                      List of files to commit

                                                                                                                                                                      +
                                                                                                                                                                    • message: string

                                                                                                                                                                      Commit message

                                                                                                                                                                      +
                                                                                                                                                                    • Optionalbranch: string

                                                                                                                                                                      Target branch

                                                                                                                                                                      +

                                                                                                                                                                    Returns Promise<void>

                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_code.CodeRepository.html b/docs/public/api-reference/classes/_quatrain_code.CodeRepository.html new file mode 100644 index 00000000..6df93910 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_code.CodeRepository.html @@ -0,0 +1,11 @@ +CodeRepository | Quatrain Core Documentation
                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                    Preparing search index...

                                                                                                                                                                    Class CodeRepository

                                                                                                                                                                    Singleton to access the configured Repository adapter

                                                                                                                                                                    +
                                                                                                                                                                    Index

                                                                                                                                                                    Constructors

                                                                                                                                                                    Properties

                                                                                                                                                                    Methods

                                                                                                                                                                    Constructors

                                                                                                                                                                    Properties

                                                                                                                                                                    _adapter: AbstractRepositoryAdapter | null = null

                                                                                                                                                                    Methods

                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_core.AbstractObject.html b/docs/public/api-reference/classes/_quatrain_core.AbstractObject.html new file mode 100644 index 00000000..f0e86340 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.AbstractObject.html @@ -0,0 +1,36 @@ +AbstractObject | Quatrain Core Documentation
                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                      Preparing search index...

                                                                                                                                                                      Class AbstractObjectAbstract

                                                                                                                                                                      Foundational wrapper for interacting with properties dynamically.

                                                                                                                                                                      +

                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                      Index

                                                                                                                                                                      Constructors

                                                                                                                                                                      Properties

                                                                                                                                                                      _dataObject: DataObjectClass<any>
                                                                                                                                                                      COLLECTION: string | undefined

                                                                                                                                                                      The backend identifier (table or collection name) representing this class.

                                                                                                                                                                      +
                                                                                                                                                                      LABEL_KEY: string = 'name'

                                                                                                                                                                      Which property's value to use in backend as label for object reference

                                                                                                                                                                      +
                                                                                                                                                                      PARENT_PROP: string | undefined

                                                                                                                                                                      The name of the property handling hierarchical parent relationships.

                                                                                                                                                                      +
                                                                                                                                                                      PROPS_DEFINITION: DataObjectProperties = []

                                                                                                                                                                      Array defining the structure and constraints of properties belonging to this model.

                                                                                                                                                                      +

                                                                                                                                                                      Accessors

                                                                                                                                                                      Methods

                                                                                                                                                                      • Proxies a set command to the underlying data object.

                                                                                                                                                                        +

                                                                                                                                                                        Parameters

                                                                                                                                                                        • key: string

                                                                                                                                                                          The property key.

                                                                                                                                                                          +
                                                                                                                                                                        • val: any

                                                                                                                                                                          The value to assign.

                                                                                                                                                                          +

                                                                                                                                                                        Returns any

                                                                                                                                                                        The DataObject instance for chaining.

                                                                                                                                                                        +
                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_core.ArrayProperty.html b/docs/public/api-reference/classes/_quatrain_core.ArrayProperty.html new file mode 100644 index 00000000..377bfa54 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.ArrayProperty.html @@ -0,0 +1,55 @@ +ArrayProperty | Quatrain Core Documentation
                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                        Preparing search index...

                                                                                                                                                                        Class ArrayProperty

                                                                                                                                                                        A property type that validates and manages arrays of primitive values. +Allows enforcement of minimum and maximum element counts, as well as primitive type restrictions.

                                                                                                                                                                        +
                                                                                                                                                                        const tags = new ArrayProperty({
                                                                                                                                                                        name: 'tags',
                                                                                                                                                                        minLength: 1,
                                                                                                                                                                        maxLength: 5,
                                                                                                                                                                        allowNumbers: false // Only string tags allowed
                                                                                                                                                                        });

                                                                                                                                                                        tags.set(['typescript', 'quatrain']); // OK
                                                                                                                                                                        tags.set([123]); // Throws Error: Numbers are not allowed in value +
                                                                                                                                                                        + +

                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                        Index

                                                                                                                                                                        Constructors

                                                                                                                                                                        Properties

                                                                                                                                                                        _allows: string[] = []
                                                                                                                                                                        _defaultValue: any
                                                                                                                                                                        _events: { [key: string]: Function } = {}
                                                                                                                                                                        _hasChanged: boolean
                                                                                                                                                                        _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                        _id: string
                                                                                                                                                                        _mandatory: boolean = false
                                                                                                                                                                        _maxLength: number = 0
                                                                                                                                                                        _minLength: number = 0
                                                                                                                                                                        _name: string
                                                                                                                                                                        _parent: DataObjectClass<any> | undefined
                                                                                                                                                                        _protected: boolean = false
                                                                                                                                                                        _value: any[] | undefined = undefined
                                                                                                                                                                        EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                        Event name triggered when the property value changes.

                                                                                                                                                                        +
                                                                                                                                                                        EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                        Event name triggered when the property is deleted.

                                                                                                                                                                        +
                                                                                                                                                                        TYPE: string = 'array'

                                                                                                                                                                        The string literal type identifier for this property.

                                                                                                                                                                        +

                                                                                                                                                                        Accessors

                                                                                                                                                                        Methods

                                                                                                                                                                        • Retrieves the array, optionally applying a mapping/transformation function.

                                                                                                                                                                          +

                                                                                                                                                                          Parameters

                                                                                                                                                                          • transform: Function | undefined = undefined

                                                                                                                                                                            A custom function to apply to the array before returning it.

                                                                                                                                                                            +

                                                                                                                                                                          Returns any

                                                                                                                                                                          The raw or transformed array.

                                                                                                                                                                          +
                                                                                                                                                                        • Assigns a new array value while enforcing length constraints and content type rules.

                                                                                                                                                                          +

                                                                                                                                                                          Parameters

                                                                                                                                                                          • value: any[]

                                                                                                                                                                            The array to assign. Null values are cast to empty arrays [].

                                                                                                                                                                            +
                                                                                                                                                                          • setChanged: boolean = true

                                                                                                                                                                            Whether to mark the property as modified.

                                                                                                                                                                            +

                                                                                                                                                                          Returns ArrayProperty

                                                                                                                                                                          The property instance for chaining.

                                                                                                                                                                          +

                                                                                                                                                                          If the value is not an array, violates length bounds, or contains forbidden types.

                                                                                                                                                                          +
                                                                                                                                                                        • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                          +

                                                                                                                                                                          Parameters

                                                                                                                                                                          • transform: any = undefined

                                                                                                                                                                            An optional transformation function applied to the value before returning it.

                                                                                                                                                                            +

                                                                                                                                                                          Returns any

                                                                                                                                                                          The raw or transformed property value.

                                                                                                                                                                          +
                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_core.BackendError.html b/docs/public/api-reference/classes/_quatrain_core.BackendError.html new file mode 100644 index 00000000..09f4addd --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.BackendError.html @@ -0,0 +1,36 @@ +BackendError | Quatrain Core Documentation
                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                          Preparing search index...

                                                                                                                                                                          Class BackendError

                                                                                                                                                                          General exception thrown when an adapter encounters an execution, syntax, or network failure.

                                                                                                                                                                          +

                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                          Index

                                                                                                                                                                          Constructors

                                                                                                                                                                          Properties

                                                                                                                                                                          cause?: unknown
                                                                                                                                                                          message: string
                                                                                                                                                                          name: string
                                                                                                                                                                          stack?: string
                                                                                                                                                                          stackTraceLimit: number

                                                                                                                                                                          The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                          +

                                                                                                                                                                          The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                          +

                                                                                                                                                                          If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                          +

                                                                                                                                                                          Methods

                                                                                                                                                                          • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                            +
                                                                                                                                                                            const myObject = {};
                                                                                                                                                                            Error.captureStackTrace(myObject);
                                                                                                                                                                            myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                            + +

                                                                                                                                                                            The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                            +

                                                                                                                                                                            The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                            +

                                                                                                                                                                            The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                            +
                                                                                                                                                                            function a() {
                                                                                                                                                                            b();
                                                                                                                                                                            }

                                                                                                                                                                            function b() {
                                                                                                                                                                            c();
                                                                                                                                                                            }

                                                                                                                                                                            function c() {
                                                                                                                                                                            // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                            const { stackTraceLimit } = Error;
                                                                                                                                                                            Error.stackTraceLimit = 0;
                                                                                                                                                                            const error = new Error();
                                                                                                                                                                            Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                            // Capture the stack trace above function b
                                                                                                                                                                            Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                            throw error;
                                                                                                                                                                            }

                                                                                                                                                                            a(); +
                                                                                                                                                                            + +

                                                                                                                                                                            Parameters

                                                                                                                                                                            • targetObject: object
                                                                                                                                                                            • OptionalconstructorOpt: Function

                                                                                                                                                                            Returns void

                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_core.BadRequestError.html b/docs/public/api-reference/classes/_quatrain_core.BadRequestError.html new file mode 100644 index 00000000..516f0461 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.BadRequestError.html @@ -0,0 +1,36 @@ +BadRequestError | Quatrain Core Documentation
                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                            Preparing search index...

                                                                                                                                                                            Class BadRequestError

                                                                                                                                                                            Indicates a structurally flawed request (e.g., HTTP 400).

                                                                                                                                                                            +

                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                            Index

                                                                                                                                                                            Constructors

                                                                                                                                                                            Properties

                                                                                                                                                                            cause?: unknown
                                                                                                                                                                            message: string
                                                                                                                                                                            name: string
                                                                                                                                                                            stack?: string
                                                                                                                                                                            stackTraceLimit: number

                                                                                                                                                                            The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                            +

                                                                                                                                                                            The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                            +

                                                                                                                                                                            If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                            +

                                                                                                                                                                            Methods

                                                                                                                                                                            • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                              +
                                                                                                                                                                              const myObject = {};
                                                                                                                                                                              Error.captureStackTrace(myObject);
                                                                                                                                                                              myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                              + +

                                                                                                                                                                              The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                              +

                                                                                                                                                                              The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                              +

                                                                                                                                                                              The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                              +
                                                                                                                                                                              function a() {
                                                                                                                                                                              b();
                                                                                                                                                                              }

                                                                                                                                                                              function b() {
                                                                                                                                                                              c();
                                                                                                                                                                              }

                                                                                                                                                                              function c() {
                                                                                                                                                                              // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                              const { stackTraceLimit } = Error;
                                                                                                                                                                              Error.stackTraceLimit = 0;
                                                                                                                                                                              const error = new Error();
                                                                                                                                                                              Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                              // Capture the stack trace above function b
                                                                                                                                                                              Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                              throw error;
                                                                                                                                                                              }

                                                                                                                                                                              a(); +
                                                                                                                                                                              + +

                                                                                                                                                                              Parameters

                                                                                                                                                                              • targetObject: object
                                                                                                                                                                              • OptionalconstructorOpt: Function

                                                                                                                                                                              Returns void

                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_core.BaseObject.html b/docs/public/api-reference/classes/_quatrain_core.BaseObject.html new file mode 100644 index 00000000..1b531ab4 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.BaseObject.html @@ -0,0 +1,68 @@ +BaseObject | Quatrain Core Documentation
                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                              Preparing search index...

                                                                                                                                                                              Class BaseObject

                                                                                                                                                                              Base generic model class. All Quatrain models inherit from this object. +Provides the lifecycle methods and structural properties logic.

                                                                                                                                                                              +

                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                              Index

                                                                                                                                                                              Constructors

                                                                                                                                                                              Properties

                                                                                                                                                                              _dataObject: DataObjectClass<any>
                                                                                                                                                                              COLLECTION: string | undefined

                                                                                                                                                                              The backend identifier (table or collection name) representing this class.

                                                                                                                                                                              +
                                                                                                                                                                              LABEL_KEY: string = 'name'

                                                                                                                                                                              Which property's value to use in backend as label for object reference

                                                                                                                                                                              +
                                                                                                                                                                              PARENT_PROP: string | undefined

                                                                                                                                                                              The name of the property handling hierarchical parent relationships.

                                                                                                                                                                              +
                                                                                                                                                                              PROPS_DEFINITION: any = BaseObjectProperties

                                                                                                                                                                              Standard properties inherited by all children models.

                                                                                                                                                                              +

                                                                                                                                                                              Accessors

                                                                                                                                                                              Methods

                                                                                                                                                                              • Instantiates the DataObject for a specific model class.

                                                                                                                                                                                +

                                                                                                                                                                                Parameters

                                                                                                                                                                                • src: string | ObjectUri | DataObjectType | undefined = undefined

                                                                                                                                                                                  Potential source path or object.

                                                                                                                                                                                  +
                                                                                                                                                                                • child: any = ...

                                                                                                                                                                                  The class constructor context.

                                                                                                                                                                                  +

                                                                                                                                                                                Returns Promise<DataObjectType>

                                                                                                                                                                                A promise resolving to the inner DataObject payload.

                                                                                                                                                                                +
                                                                                                                                                                              • Main initialization factory. Evaluates path or object sources and returns a fully +initialized model instance.

                                                                                                                                                                                +

                                                                                                                                                                                Parameters

                                                                                                                                                                                • src: string | ObjectUri | BaseObjectType | undefined = undefined

                                                                                                                                                                                  Source data payload or path reference.

                                                                                                                                                                                  +
                                                                                                                                                                                • child: any = ...

                                                                                                                                                                                  Model subclass context.

                                                                                                                                                                                  +

                                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                                The generated model instance.

                                                                                                                                                                                +
                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_core.BaseProperty.html b/docs/public/api-reference/classes/_quatrain_core.BaseProperty.html new file mode 100644 index 00000000..bfc8b0fe --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.BaseProperty.html @@ -0,0 +1,47 @@ +BaseProperty | Quatrain Core Documentation
                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                Class BaseProperty

                                                                                                                                                                                The core foundation class for all Quatrain properties. +It manages the state, immutability (protected), change tracking, and events of a data field.

                                                                                                                                                                                +
                                                                                                                                                                                const myProp = new BaseProperty({
                                                                                                                                                                                name: 'status',
                                                                                                                                                                                defaultValue: 'active',
                                                                                                                                                                                protected: false,
                                                                                                                                                                                onChange: (dao) => console.log('Status changed on', dao.id)
                                                                                                                                                                                });

                                                                                                                                                                                myProp.set('inactive');
                                                                                                                                                                                console.log(myProp.val()); // "inactive" +
                                                                                                                                                                                + +

                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                Implements

                                                                                                                                                                                • PropertyClassType
                                                                                                                                                                                Index

                                                                                                                                                                                Constructors

                                                                                                                                                                                Properties

                                                                                                                                                                                _allows: string[] = []
                                                                                                                                                                                _defaultValue: any
                                                                                                                                                                                _events: { [key: string]: Function } = {}
                                                                                                                                                                                _hasChanged: boolean
                                                                                                                                                                                _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                _id: string
                                                                                                                                                                                _mandatory: boolean = false
                                                                                                                                                                                _name: string
                                                                                                                                                                                _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                _protected: boolean = false
                                                                                                                                                                                _value: any = undefined
                                                                                                                                                                                EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                Event name triggered when the property value changes.

                                                                                                                                                                                +
                                                                                                                                                                                EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                Event name triggered when the property is deleted.

                                                                                                                                                                                +
                                                                                                                                                                                TYPE: string = 'any'

                                                                                                                                                                                The string literal type identifier for this property.

                                                                                                                                                                                +

                                                                                                                                                                                Accessors

                                                                                                                                                                                Methods

                                                                                                                                                                                • Sets a new value for the property and triggers the onChange event if modified.

                                                                                                                                                                                  +

                                                                                                                                                                                  Parameters

                                                                                                                                                                                  • value: any

                                                                                                                                                                                    The new value to assign.

                                                                                                                                                                                    +
                                                                                                                                                                                  • setChanged: boolean = true

                                                                                                                                                                                    Whether to mark the property as modified (defaults to true).

                                                                                                                                                                                    +

                                                                                                                                                                                  Returns BaseProperty

                                                                                                                                                                                  The current property instance for chaining.

                                                                                                                                                                                  +

                                                                                                                                                                                  If the property is marked as protected and already has a value.

                                                                                                                                                                                  +
                                                                                                                                                                                • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                                  +

                                                                                                                                                                                  Parameters

                                                                                                                                                                                  • transform: any = undefined

                                                                                                                                                                                    An optional transformation function applied to the value before returning it.

                                                                                                                                                                                    +

                                                                                                                                                                                  Returns any

                                                                                                                                                                                  The raw or transformed property value.

                                                                                                                                                                                  +
                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_core.BooleanProperty.html b/docs/public/api-reference/classes/_quatrain_core.BooleanProperty.html new file mode 100644 index 00000000..b44c1c4d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.BooleanProperty.html @@ -0,0 +1,45 @@ +BooleanProperty | Quatrain Core Documentation
                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                  Class BooleanProperty

                                                                                                                                                                                  A property type strictly handling boolean values (true or false).

                                                                                                                                                                                  +
                                                                                                                                                                                  const isActive = new BooleanProperty({
                                                                                                                                                                                  name: 'isActive',
                                                                                                                                                                                  defaultValue: false
                                                                                                                                                                                  });

                                                                                                                                                                                  isActive.set(true);
                                                                                                                                                                                  console.log(isActive.val()); // true +
                                                                                                                                                                                  + +

                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                  Index

                                                                                                                                                                                  Constructors

                                                                                                                                                                                  Properties

                                                                                                                                                                                  _allows: string[] = []
                                                                                                                                                                                  _defaultValue: any
                                                                                                                                                                                  _events: { [key: string]: Function } = {}
                                                                                                                                                                                  _hasChanged: boolean
                                                                                                                                                                                  _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                  _id: string
                                                                                                                                                                                  _mandatory: boolean = false
                                                                                                                                                                                  _name: string
                                                                                                                                                                                  _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                  _protected: boolean = false
                                                                                                                                                                                  _value: any = undefined
                                                                                                                                                                                  EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                  Event name triggered when the property value changes.

                                                                                                                                                                                  +
                                                                                                                                                                                  EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                  Event name triggered when the property is deleted.

                                                                                                                                                                                  +
                                                                                                                                                                                  TYPE: string = 'boolean'

                                                                                                                                                                                  The string literal type identifier for this property.

                                                                                                                                                                                  +

                                                                                                                                                                                  Accessors

                                                                                                                                                                                  Methods

                                                                                                                                                                                  • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                                    +

                                                                                                                                                                                    Parameters

                                                                                                                                                                                    • transform: any = undefined

                                                                                                                                                                                      An optional transformation function applied to the value before returning it.

                                                                                                                                                                                      +

                                                                                                                                                                                    Returns any

                                                                                                                                                                                    The raw or transformed property value.

                                                                                                                                                                                    +
                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_core.CollectionProperty.html b/docs/public/api-reference/classes/_quatrain_core.CollectionProperty.html new file mode 100644 index 00000000..40b7d681 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.CollectionProperty.html @@ -0,0 +1,103 @@ +CollectionProperty | Quatrain Core Documentation
                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                    Class CollectionProperty

                                                                                                                                                                                    A basic relational property type representing a collection of BaseObject instances. +This core class manages the in-memory array representation. For dynamic querying, see the backend CollectionProperty.

                                                                                                                                                                                    +
                                                                                                                                                                                    const permissions = new CollectionProperty({
                                                                                                                                                                                    name: 'permissions',
                                                                                                                                                                                    instanceOf: Permission
                                                                                                                                                                                    }); +
                                                                                                                                                                                    + +

                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                    Index

                                                                                                                                                                                    Constructors

                                                                                                                                                                                    Properties

                                                                                                                                                                                    _allows: string[] = []
                                                                                                                                                                                    _defaultValue: any
                                                                                                                                                                                    _events: { [key: string]: Function } = {}
                                                                                                                                                                                    _hasChanged: boolean
                                                                                                                                                                                    _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                    _id: string
                                                                                                                                                                                    _instanceOf: typeof BaseObject
                                                                                                                                                                                    _mandatory: boolean = false
                                                                                                                                                                                    _name: string
                                                                                                                                                                                    _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                    _parentKey: string
                                                                                                                                                                                    _protected: boolean = false
                                                                                                                                                                                    _value: any[] | DataObjectClass<any>[] | ObjectUri[] | undefined = undefined
                                                                                                                                                                                    EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                    Event name triggered when the property value changes.

                                                                                                                                                                                    +
                                                                                                                                                                                    EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                    Event name triggered when the property is deleted.

                                                                                                                                                                                    +
                                                                                                                                                                                    TYPE: string = 'collection'

                                                                                                                                                                                    The string literal type identifier for this property.

                                                                                                                                                                                    +

                                                                                                                                                                                    Accessors

                                                                                                                                                                                    Methods

                                                                                                                                                                                    • Applies an anonymous function to each item in the collection. +Can execute either on the internal collection value or an external array. +Supporting both synchronous and asynchronous callback functions.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • fn: (item: any) => any

                                                                                                                                                                                        The anonymous callback function to apply to each item.

                                                                                                                                                                                        +
                                                                                                                                                                                      • items: any[] = ...

                                                                                                                                                                                        Optional external items array. Defaults to the internal collection array.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns any[] | Promise<any[]>

                                                                                                                                                                                      The results of the function applications (or a Promise resolving to the results if async).

                                                                                                                                                                                      +
                                                                                                                                                                                    • Calculates the average of the numeric values of a property across items in the collection. +Can aggregate either the internal collection value or an external array.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • property: string

                                                                                                                                                                                        The name of the property to average.

                                                                                                                                                                                        +
                                                                                                                                                                                      • items: any[] = ...

                                                                                                                                                                                        Optional external items array. Defaults to the internal collection array.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns number | Promise<number>

                                                                                                                                                                                      The average of all numeric values, or 0 if empty.

                                                                                                                                                                                      +
                                                                                                                                                                                    • Returns the count of items in the collection, optionally filtered by a predicate callback. +Can aggregate either the internal collection value or an external array.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • Optionalpredicate: (item: any) => boolean

                                                                                                                                                                                        An optional filter callback to run on each item.

                                                                                                                                                                                        +
                                                                                                                                                                                      • items: any[] = ...

                                                                                                                                                                                        Optional external items array. Defaults to the internal collection array.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns number | Promise<number>

                                                                                                                                                                                      The count of matching items.

                                                                                                                                                                                      +
                                                                                                                                                                                    • Retrieves all distinct values of a property across the collection items. +Can aggregate either the internal collection value or an external array.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • property: string

                                                                                                                                                                                        The name of the property.

                                                                                                                                                                                        +
                                                                                                                                                                                      • items: any[] = ...

                                                                                                                                                                                        Optional external items array. Defaults to the internal collection array.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns any[] | Promise<any[]>

                                                                                                                                                                                      An array of unique property values.

                                                                                                                                                                                      +
                                                                                                                                                                                    • Groups the collection items by the values of a specific property. +Can aggregate either the internal collection value or an external array.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • property: string

                                                                                                                                                                                        The name of the property to group by.

                                                                                                                                                                                        +
                                                                                                                                                                                      • items: any[] = ...

                                                                                                                                                                                        Optional external items array. Defaults to the internal collection array.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns Record<string, any[]> | Promise<Record<string, any[]>>

                                                                                                                                                                                      A dictionary object where keys are the property values and values are arrays of matching items.

                                                                                                                                                                                      +
                                                                                                                                                                                    • Returns the maximum value of a numeric property across the collection items. +Can aggregate either the internal collection value or an external array.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • property: string

                                                                                                                                                                                        The name of the property.

                                                                                                                                                                                        +
                                                                                                                                                                                      • items: any[] = ...

                                                                                                                                                                                        Optional external items array. Defaults to the internal collection array.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns number | Promise<number | undefined> | undefined

                                                                                                                                                                                      The maximum numeric value found, or undefined if no valid numbers are present.

                                                                                                                                                                                      +
                                                                                                                                                                                    • Returns the minimum value of a numeric property across the collection items. +Can aggregate either the internal collection value or an external array.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • property: string

                                                                                                                                                                                        The name of the property.

                                                                                                                                                                                        +
                                                                                                                                                                                      • items: any[] = ...

                                                                                                                                                                                        Optional external items array. Defaults to the internal collection array.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns number | Promise<number | undefined> | undefined

                                                                                                                                                                                      The minimum numeric value found, or undefined if no valid numbers are present.

                                                                                                                                                                                      +
                                                                                                                                                                                    • Plucks a specific property from each item in the collection. +Can aggregate either the internal collection value or an external array.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • property: string

                                                                                                                                                                                        The name of the property to extract.

                                                                                                                                                                                        +
                                                                                                                                                                                      • items: any[] = ...

                                                                                                                                                                                        Optional external items array. Defaults to the internal collection array.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns any[] | Promise<any[]>

                                                                                                                                                                                      An array containing the extracted property values.

                                                                                                                                                                                      +
                                                                                                                                                                                    • Sums the numeric values of a property across items in the collection. +Can aggregate either the internal collection value or an external array.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • property: string

                                                                                                                                                                                        The name of the property to sum.

                                                                                                                                                                                        +
                                                                                                                                                                                      • items: any[] = ...

                                                                                                                                                                                        Optional external items array. Defaults to the internal collection array.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns number | Promise<number>

                                                                                                                                                                                      The sum of all numeric values.

                                                                                                                                                                                      +
                                                                                                                                                                                    • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                                      +

                                                                                                                                                                                      Parameters

                                                                                                                                                                                      • transform: any = undefined

                                                                                                                                                                                        An optional transformation function applied to the value before returning it.

                                                                                                                                                                                        +

                                                                                                                                                                                      Returns any

                                                                                                                                                                                      The raw or transformed property value.

                                                                                                                                                                                      +
                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_core.Core.html b/docs/public/api-reference/classes/_quatrain_core.Core.html new file mode 100644 index 00000000..9fe1f826 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.Core.html @@ -0,0 +1,79 @@ +Core | Quatrain Core Documentation
                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                      Core foundation class for Quatrain architecture. +Manages central configuration, logger registry, storage binding, and class mapping.

                                                                                                                                                                                      +

                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                      Index

                                                                                                                                                                                      Constructors

                                                                                                                                                                                      Properties

                                                                                                                                                                                      classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                      Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                      +
                                                                                                                                                                                      logger: AbstractLoggerAdapter = ...

                                                                                                                                                                                      Active logger instance for the Core domain.

                                                                                                                                                                                      +
                                                                                                                                                                                      logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                      System-wide base log verbosity.

                                                                                                                                                                                      +
                                                                                                                                                                                      me: string = ...

                                                                                                                                                                                      Identifying namespace for this core component.

                                                                                                                                                                                      +
                                                                                                                                                                                      storage: typeof NodePersist = persist

                                                                                                                                                                                      Persistent key-value storage engine reference.

                                                                                                                                                                                      +
                                                                                                                                                                                      storagePrefix: "core" = 'core'

                                                                                                                                                                                      Context prefix string for scoped storage keys.

                                                                                                                                                                                      +

                                                                                                                                                                                      Accessors

                                                                                                                                                                                      Methods

                                                                                                                                                                                      • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • name: string

                                                                                                                                                                                          Semantic registry name.

                                                                                                                                                                                          +
                                                                                                                                                                                        • obj: any

                                                                                                                                                                                          Class constructor.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns void

                                                                                                                                                                                      • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • key: string

                                                                                                                                                                                          Identification string.

                                                                                                                                                                                          +
                                                                                                                                                                                        • value: any

                                                                                                                                                                                          Value.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns Promise<void>

                                                                                                                                                                                      • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • alias: string = ...

                                                                                                                                                                                          The logging context name.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns any

                                                                                                                                                                                        Instantiated LoggerAdapter.

                                                                                                                                                                                        +
                                                                                                                                                                                      • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • key: string

                                                                                                                                                                                          The property block to generate.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                        Field definitions block.

                                                                                                                                                                                        +
                                                                                                                                                                                      • Triggers an error log on the core logger.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • ...message: any

                                                                                                                                                                                          Content to log.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns void

                                                                                                                                                                                      • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • name: string

                                                                                                                                                                                          The semantic name to resolve.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns any

                                                                                                                                                                                        Class definition.

                                                                                                                                                                                        +
                                                                                                                                                                                      • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • key: string

                                                                                                                                                                                          The target identifier.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns Promise<any>

                                                                                                                                                                                        The recovered value.

                                                                                                                                                                                        +
                                                                                                                                                                                      • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • command: string

                                                                                                                                                                                          The executable.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns Promise<string>

                                                                                                                                                                                        The resolved system path.

                                                                                                                                                                                        +
                                                                                                                                                                                      • Triggers a standard log on the core logger.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • ...message: any

                                                                                                                                                                                          Content to log.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns void

                                                                                                                                                                                      • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • seconds: number = 1

                                                                                                                                                                                          Duration count.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns Promise<unknown>

                                                                                                                                                                                        The promise to await.

                                                                                                                                                                                        +
                                                                                                                                                                                      • Triggers a warning log on the core logger.

                                                                                                                                                                                        +

                                                                                                                                                                                        Parameters

                                                                                                                                                                                        • ...message: any

                                                                                                                                                                                          Content to log.

                                                                                                                                                                                          +

                                                                                                                                                                                        Returns void

                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_core.DataObject.html b/docs/public/api-reference/classes/_quatrain_core.DataObject.html new file mode 100644 index 00000000..d19aebd5 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.DataObject.html @@ -0,0 +1,73 @@ +DataObject | Quatrain Core Documentation
                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                        Class DataObject

                                                                                                                                                                                        Data objects constitute the agnostic glue between objects and backends. +They handle data and identifiers in a protected registry +This is what backends and objects manipulate, oblivious of the other.

                                                                                                                                                                                        +

                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                        Implements

                                                                                                                                                                                        • DataObjectType
                                                                                                                                                                                        Index

                                                                                                                                                                                        Constructors

                                                                                                                                                                                        Properties

                                                                                                                                                                                        _modified: boolean = false

                                                                                                                                                                                        Has data been modified since last backend operation?

                                                                                                                                                                                        +
                                                                                                                                                                                        _objectUri: ObjectUri
                                                                                                                                                                                        _parentProp: string | undefined
                                                                                                                                                                                        _populated: boolean = false
                                                                                                                                                                                        _properties: Properties = {}
                                                                                                                                                                                        _proxied: any
                                                                                                                                                                                        _uid: string | undefined = undefined

                                                                                                                                                                                        Accessors

                                                                                                                                                                                        Methods

                                                                                                                                                                                        • Parameters

                                                                                                                                                                                          • objectsAsReferences: boolean = false
                                                                                                                                                                                          • ignoreUnchanged: boolean = false
                                                                                                                                                                                          • ignoreNulls: boolean = false
                                                                                                                                                                                          • converters: {} = {}

                                                                                                                                                                                          Returns {}

                                                                                                                                                                                        • Appends a new property definition instance to the registry dynamically.

                                                                                                                                                                                          +

                                                                                                                                                                                          Parameters

                                                                                                                                                                                          • property: PropertyClassType

                                                                                                                                                                                            The instantiated Property element.

                                                                                                                                                                                            +

                                                                                                                                                                                          Returns void

                                                                                                                                                                                        • Populate data object from instant data or backend query

                                                                                                                                                                                          +

                                                                                                                                                                                          Parameters

                                                                                                                                                                                          • data: { name: string; [x: string]: unknown } | undefined = undefined

                                                                                                                                                                                          Returns Promise<DataObject>

                                                                                                                                                                                        • Populate data object from instant data or backend query

                                                                                                                                                                                          +

                                                                                                                                                                                          Parameters

                                                                                                                                                                                          • data: { [x: string]: unknown }

                                                                                                                                                                                          Returns this

                                                                                                                                                                                        • Forces a completely new set of properties into the registry.

                                                                                                                                                                                          +

                                                                                                                                                                                          Parameters

                                                                                                                                                                                          • properties: Properties

                                                                                                                                                                                            The dictionary of PropertyClassType entities.

                                                                                                                                                                                            +

                                                                                                                                                                                          Returns void

                                                                                                                                                                                        • Serializes the data object using advanced configuration params.

                                                                                                                                                                                          +

                                                                                                                                                                                          Parameters

                                                                                                                                                                                          • params: boolean | toJSONParams = false

                                                                                                                                                                                            Serialization settings (e.g. resolve references, remove nulls).

                                                                                                                                                                                            +

                                                                                                                                                                                          Returns { [x: string]: any }

                                                                                                                                                                                          The raw serialized dictionary.

                                                                                                                                                                                          +
                                                                                                                                                                                        • Flattens the object to a standard ObjectUri wrapper reference format.

                                                                                                                                                                                          +

                                                                                                                                                                                          Returns { label: any; ref: string; uri: string }

                                                                                                                                                                                          Reference object format.

                                                                                                                                                                                          +
                                                                                                                                                                                        • Get value of given property

                                                                                                                                                                                          +

                                                                                                                                                                                          Parameters

                                                                                                                                                                                          • key: string

                                                                                                                                                                                            string

                                                                                                                                                                                            +
                                                                                                                                                                                          • transform: string | undefined = undefined

                                                                                                                                                                                          Returns any

                                                                                                                                                                                          any

                                                                                                                                                                                          +
                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_core.DateTimeProperty.html b/docs/public/api-reference/classes/_quatrain_core.DateTimeProperty.html new file mode 100644 index 00000000..19a31236 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.DateTimeProperty.html @@ -0,0 +1,55 @@ +DateTimeProperty | Quatrain Core Documentation
                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                          Class DateTimeProperty

                                                                                                                                                                                          A property type that manages Dates, Timestamps, and ISO date strings. +It automatically parses strings and standardizes UTC conversions depending on the global RETURN_AS setting.

                                                                                                                                                                                          +
                                                                                                                                                                                          const createdAt = new DateTimeProperty({
                                                                                                                                                                                          name: 'createdAt',
                                                                                                                                                                                          timezone: 'UTC'
                                                                                                                                                                                          });

                                                                                                                                                                                          createdAt.set(new Date()); // Will store as UNIX timestamp if RETURN_AS is configured
                                                                                                                                                                                          console.log(createdAt.val()); +
                                                                                                                                                                                          + +

                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                          Index

                                                                                                                                                                                          Constructors

                                                                                                                                                                                          Properties

                                                                                                                                                                                          _allows: string[] = []
                                                                                                                                                                                          _defaultValue: any
                                                                                                                                                                                          _events: { [key: string]: Function } = {}
                                                                                                                                                                                          _hasChanged: boolean
                                                                                                                                                                                          _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                          _id: string
                                                                                                                                                                                          _mandatory: boolean = false
                                                                                                                                                                                          _name: string
                                                                                                                                                                                          _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                          _protected: boolean = false
                                                                                                                                                                                          _timezone: string
                                                                                                                                                                                          _value: any = undefined
                                                                                                                                                                                          AS_IS: string = 'asis'

                                                                                                                                                                                          Return behavior to return the original Date object or string as is.

                                                                                                                                                                                          +
                                                                                                                                                                                          EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                          Event name triggered when the property value changes.

                                                                                                                                                                                          +
                                                                                                                                                                                          EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                          Event name triggered when the property is deleted.

                                                                                                                                                                                          +
                                                                                                                                                                                          RETURN_AS: string = DateTimeProperty.AS_IS

                                                                                                                                                                                          Global configuration determining the default format returned by val().

                                                                                                                                                                                          +
                                                                                                                                                                                          TYPE: string = 'datetime'

                                                                                                                                                                                          The string literal type identifier for this property.

                                                                                                                                                                                          +
                                                                                                                                                                                          UNIX_TIMESTAMP: string = 'unix_timestamp'

                                                                                                                                                                                          Return behavior to auto-convert dates into numeric UNIX timestamps.

                                                                                                                                                                                          +

                                                                                                                                                                                          Accessors

                                                                                                                                                                                          Methods

                                                                                                                                                                                          • Assigns a new date value. If RETURN_AS is set to unix_timestamp, +strings and JS Date objects are automatically parsed and converted to UNIX timestamps (milliseconds).

                                                                                                                                                                                            +

                                                                                                                                                                                            Parameters

                                                                                                                                                                                            • value: string | number | Date

                                                                                                                                                                                              The date string, timestamp, or Date object to assign.

                                                                                                                                                                                              +
                                                                                                                                                                                            • setChanged: boolean = true

                                                                                                                                                                                              Whether to mark the property as modified.

                                                                                                                                                                                              +

                                                                                                                                                                                            Returns DateTimeProperty

                                                                                                                                                                                            The property instance for chaining.

                                                                                                                                                                                            +
                                                                                                                                                                                          • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                                            +

                                                                                                                                                                                            Parameters

                                                                                                                                                                                            • transform: any = undefined

                                                                                                                                                                                              An optional transformation function applied to the value before returning it.

                                                                                                                                                                                              +

                                                                                                                                                                                            Returns any

                                                                                                                                                                                            The raw or transformed property value.

                                                                                                                                                                                            +
                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_core.Entity.html b/docs/public/api-reference/classes/_quatrain_core.Entity.html new file mode 100644 index 00000000..42feceb9 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.Entity.html @@ -0,0 +1,66 @@ +Entity | Quatrain Core Documentation
                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                            Represents a generic grouping structure, such as a company or organization, +to which Users may be associated.

                                                                                                                                                                                            +

                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                            Index

                                                                                                                                                                                            Constructors

                                                                                                                                                                                            Properties

                                                                                                                                                                                            _dataObject: DataObjectClass<any>
                                                                                                                                                                                            COLLECTION: string = 'entities'

                                                                                                                                                                                            Base collection scope name.

                                                                                                                                                                                            +
                                                                                                                                                                                            LABEL_KEY: string = 'name'

                                                                                                                                                                                            Which property's value to use in backend as label for object reference

                                                                                                                                                                                            +
                                                                                                                                                                                            PARENT_PROP: string | undefined

                                                                                                                                                                                            The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                            +
                                                                                                                                                                                            PROPS_DEFINITION: any[] = ...

                                                                                                                                                                                            Component structure declaration.

                                                                                                                                                                                            +

                                                                                                                                                                                            Accessors

                                                                                                                                                                                            Methods

                                                                                                                                                                                            • Instantiates the DataObject for a specific model class.

                                                                                                                                                                                              +

                                                                                                                                                                                              Parameters

                                                                                                                                                                                              • src: string | ObjectUri | DataObjectType | undefined = undefined

                                                                                                                                                                                                Potential source path or object.

                                                                                                                                                                                                +
                                                                                                                                                                                              • child: any = ...

                                                                                                                                                                                                The class constructor context.

                                                                                                                                                                                                +

                                                                                                                                                                                              Returns Promise<DataObjectType>

                                                                                                                                                                                              A promise resolving to the inner DataObject payload.

                                                                                                                                                                                              +
                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_core.EnumProperty.html b/docs/public/api-reference/classes/_quatrain_core.EnumProperty.html new file mode 100644 index 00000000..d04aaef7 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.EnumProperty.html @@ -0,0 +1,52 @@ +EnumProperty | Quatrain Core Documentation
                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                              Class EnumProperty

                                                                                                                                                                                              A property type that validates string values against a strict list of allowed options. +Useful for status fields, categories, or predefined states.

                                                                                                                                                                                              +
                                                                                                                                                                                              const status = new EnumProperty({
                                                                                                                                                                                              name: 'status',
                                                                                                                                                                                              values: ['pending', 'active', 'deleted']
                                                                                                                                                                                              });

                                                                                                                                                                                              status.set('active'); // OK
                                                                                                                                                                                              status.set('archived'); // Throws Error: Value 'archived' is not acceptable +
                                                                                                                                                                                              + +

                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                              Index

                                                                                                                                                                                              Constructors

                                                                                                                                                                                              Properties

                                                                                                                                                                                              _allows: string[] = []
                                                                                                                                                                                              _defaultValue: any
                                                                                                                                                                                              _events: { [key: string]: Function } = {}
                                                                                                                                                                                              _hasChanged: boolean
                                                                                                                                                                                              _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                              _id: string
                                                                                                                                                                                              _mandatory: boolean = false
                                                                                                                                                                                              _name: string
                                                                                                                                                                                              _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                              _protected: boolean = false
                                                                                                                                                                                              _value: any = undefined
                                                                                                                                                                                              _values: string[] = []
                                                                                                                                                                                              EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                              Event name triggered when the property value changes.

                                                                                                                                                                                              +
                                                                                                                                                                                              EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                              Event name triggered when the property is deleted.

                                                                                                                                                                                              +
                                                                                                                                                                                              TYPE: string = 'enum'

                                                                                                                                                                                              The string literal type identifier for this property.

                                                                                                                                                                                              +
                                                                                                                                                                                              WILDCARD: string = '*'

                                                                                                                                                                                              Special wildcard value allowing any string to be accepted if configured in values.

                                                                                                                                                                                              +

                                                                                                                                                                                              Accessors

                                                                                                                                                                                              Methods

                                                                                                                                                                                              • Assigns a new value, validating it against the allowed enum values. +If the wildcard (*) is present in the allowed values, any value is accepted.

                                                                                                                                                                                                +

                                                                                                                                                                                                Parameters

                                                                                                                                                                                                • value: string

                                                                                                                                                                                                  The enum string to assign.

                                                                                                                                                                                                  +
                                                                                                                                                                                                • setChanged: boolean = true

                                                                                                                                                                                                  Whether to mark the property as modified.

                                                                                                                                                                                                  +

                                                                                                                                                                                                Returns EnumProperty

                                                                                                                                                                                                The property instance for chaining.

                                                                                                                                                                                                +

                                                                                                                                                                                                If the value is not in the allowed list.

                                                                                                                                                                                                +
                                                                                                                                                                                              • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                                                +

                                                                                                                                                                                                Parameters

                                                                                                                                                                                                • transform: any = undefined

                                                                                                                                                                                                  An optional transformation function applied to the value before returning it.

                                                                                                                                                                                                  +

                                                                                                                                                                                                Returns any

                                                                                                                                                                                                The raw or transformed property value.

                                                                                                                                                                                                +
                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_core.FileProperty.html b/docs/public/api-reference/classes/_quatrain_core.FileProperty.html new file mode 100644 index 00000000..d9a647b2 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.FileProperty.html @@ -0,0 +1,48 @@ +FileProperty | Quatrain Core Documentation
                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                Class FileProperty

                                                                                                                                                                                                A property type designed to hold a reference to a File or Blob. +It usually stores either the raw BaseObjectClass representing the file, or an ObjectUri pointing to the storage location.

                                                                                                                                                                                                +
                                                                                                                                                                                                const avatar = new FileProperty({
                                                                                                                                                                                                name: 'avatar'
                                                                                                                                                                                                }); +
                                                                                                                                                                                                + +

                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                Index

                                                                                                                                                                                                Constructors

                                                                                                                                                                                                Properties

                                                                                                                                                                                                _allows: string[] = []
                                                                                                                                                                                                _defaultValue: any
                                                                                                                                                                                                _events: { [key: string]: Function } = {}
                                                                                                                                                                                                _hasChanged: boolean
                                                                                                                                                                                                _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                                _id: string
                                                                                                                                                                                                _mandatory: boolean = false
                                                                                                                                                                                                _name: string
                                                                                                                                                                                                _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                                _protected: boolean = false
                                                                                                                                                                                                _value: ObjectUri | BaseObjectClass | undefined = undefined

                                                                                                                                                                                                The internal stored value, either a class instance or a URI.

                                                                                                                                                                                                +
                                                                                                                                                                                                EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                                Event name triggered when the property value changes.

                                                                                                                                                                                                +
                                                                                                                                                                                                EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                                Event name triggered when the property is deleted.

                                                                                                                                                                                                +
                                                                                                                                                                                                TYPE: string = 'file'

                                                                                                                                                                                                The string literal type identifier for this property.

                                                                                                                                                                                                +

                                                                                                                                                                                                Accessors

                                                                                                                                                                                                Methods

                                                                                                                                                                                                • Sets a new value for the property and triggers the onChange event if modified.

                                                                                                                                                                                                  +

                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                  • value: any

                                                                                                                                                                                                    The new value to assign.

                                                                                                                                                                                                    +
                                                                                                                                                                                                  • setChanged: boolean = true

                                                                                                                                                                                                    Whether to mark the property as modified (defaults to true).

                                                                                                                                                                                                    +

                                                                                                                                                                                                  Returns FileProperty

                                                                                                                                                                                                  The current property instance for chaining.

                                                                                                                                                                                                  +

                                                                                                                                                                                                  If the property is marked as protected and already has a value.

                                                                                                                                                                                                  +
                                                                                                                                                                                                • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                                                  +

                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                  • transform: any = undefined

                                                                                                                                                                                                    An optional transformation function applied to the value before returning it.

                                                                                                                                                                                                    +

                                                                                                                                                                                                  Returns any

                                                                                                                                                                                                  The raw or transformed property value.

                                                                                                                                                                                                  +
                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_core.ForbiddenError.html b/docs/public/api-reference/classes/_quatrain_core.ForbiddenError.html new file mode 100644 index 00000000..c343bab2 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.ForbiddenError.html @@ -0,0 +1,36 @@ +ForbiddenError | Quatrain Core Documentation
                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                  Class ForbiddenError

                                                                                                                                                                                                  Indicates an authenticated action denied by privileges (e.g., HTTP 403).

                                                                                                                                                                                                  +

                                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                                  Index

                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                  Properties

                                                                                                                                                                                                  cause?: unknown
                                                                                                                                                                                                  message: string
                                                                                                                                                                                                  name: string
                                                                                                                                                                                                  stack?: string
                                                                                                                                                                                                  stackTraceLimit: number

                                                                                                                                                                                                  The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                  +

                                                                                                                                                                                                  The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                  +

                                                                                                                                                                                                  If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                  +

                                                                                                                                                                                                  Methods

                                                                                                                                                                                                  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                    +
                                                                                                                                                                                                    const myObject = {};
                                                                                                                                                                                                    Error.captureStackTrace(myObject);
                                                                                                                                                                                                    myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                    + +

                                                                                                                                                                                                    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                    +

                                                                                                                                                                                                    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                    +

                                                                                                                                                                                                    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                    +
                                                                                                                                                                                                    function a() {
                                                                                                                                                                                                    b();
                                                                                                                                                                                                    }

                                                                                                                                                                                                    function b() {
                                                                                                                                                                                                    c();
                                                                                                                                                                                                    }

                                                                                                                                                                                                    function c() {
                                                                                                                                                                                                    // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                    const { stackTraceLimit } = Error;
                                                                                                                                                                                                    Error.stackTraceLimit = 0;
                                                                                                                                                                                                    const error = new Error();
                                                                                                                                                                                                    Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                    // Capture the stack trace above function b
                                                                                                                                                                                                    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                    throw error;
                                                                                                                                                                                                    }

                                                                                                                                                                                                    a(); +
                                                                                                                                                                                                    + +

                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                    • targetObject: object
                                                                                                                                                                                                    • OptionalconstructorOpt: Function

                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_core.GoneError.html b/docs/public/api-reference/classes/_quatrain_core.GoneError.html new file mode 100644 index 00000000..2af3fe01 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.GoneError.html @@ -0,0 +1,36 @@ +GoneError | Quatrain Core Documentation
                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                    Indicates an originally valid asset that has been purged (e.g., HTTP 410).

                                                                                                                                                                                                    +

                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                    Index

                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                    Properties

                                                                                                                                                                                                    cause?: unknown
                                                                                                                                                                                                    message: string
                                                                                                                                                                                                    name: string
                                                                                                                                                                                                    stack?: string
                                                                                                                                                                                                    stackTraceLimit: number

                                                                                                                                                                                                    The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                    +

                                                                                                                                                                                                    The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                    +

                                                                                                                                                                                                    If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                    +

                                                                                                                                                                                                    Methods

                                                                                                                                                                                                    • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      const myObject = {};
                                                                                                                                                                                                      Error.captureStackTrace(myObject);
                                                                                                                                                                                                      myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                      + +

                                                                                                                                                                                                      The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                      +

                                                                                                                                                                                                      The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                      +

                                                                                                                                                                                                      The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                      +
                                                                                                                                                                                                      function a() {
                                                                                                                                                                                                      b();
                                                                                                                                                                                                      }

                                                                                                                                                                                                      function b() {
                                                                                                                                                                                                      c();
                                                                                                                                                                                                      }

                                                                                                                                                                                                      function c() {
                                                                                                                                                                                                      // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                      const { stackTraceLimit } = Error;
                                                                                                                                                                                                      Error.stackTraceLimit = 0;
                                                                                                                                                                                                      const error = new Error();
                                                                                                                                                                                                      Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                      // Capture the stack trace above function b
                                                                                                                                                                                                      Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                      throw error;
                                                                                                                                                                                                      }

                                                                                                                                                                                                      a(); +
                                                                                                                                                                                                      + +

                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                      • targetObject: object
                                                                                                                                                                                                      • OptionalconstructorOpt: Function

                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_core.HashProperty.html b/docs/public/api-reference/classes/_quatrain_core.HashProperty.html new file mode 100644 index 00000000..f81b656d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.HashProperty.html @@ -0,0 +1,96 @@ +HashProperty | Quatrain Core Documentation
                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                      Class HashProperty

                                                                                                                                                                                                      A specialized string property that automatically hashes incoming values before storing them. +Useful for storing passwords, secret tokens, or generating unique fingerprints. +Values set on this property are one-way hashed and cannot be reversed.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      const password = new HashProperty({
                                                                                                                                                                                                      name: 'password',
                                                                                                                                                                                                      algorithm: HashProperty.ALGORITHM_SHA256,
                                                                                                                                                                                                      salt: 'mySecretSalt'
                                                                                                                                                                                                      });

                                                                                                                                                                                                      password.set('mySuperPassword');
                                                                                                                                                                                                      console.log(password.val()); // Returns the SHA256 hashed string
                                                                                                                                                                                                      const isValid = password.compare('mySuperPassword'); // true +
                                                                                                                                                                                                      + +

                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                      Index

                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                      Properties

                                                                                                                                                                                                      _algorithm: string
                                                                                                                                                                                                      _allows: string[] = []
                                                                                                                                                                                                      _defaultValue: any
                                                                                                                                                                                                      _events: { [key: string]: Function } = {}
                                                                                                                                                                                                      _fullSearch: boolean = false
                                                                                                                                                                                                      _hasChanged: boolean
                                                                                                                                                                                                      _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                                      _id: string
                                                                                                                                                                                                      _mandatory: boolean = false
                                                                                                                                                                                                      _maxLength: number = 0
                                                                                                                                                                                                      _minLength: number = 0
                                                                                                                                                                                                      _name: string
                                                                                                                                                                                                      _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                                      _prefixed: boolean = false
                                                                                                                                                                                                      _protected: boolean = false
                                                                                                                                                                                                      _rawValue: boolean = true

                                                                                                                                                                                                      Set to false to bypass some rules

                                                                                                                                                                                                      +
                                                                                                                                                                                                      _salt: string = ''
                                                                                                                                                                                                      _value: string | undefined
                                                                                                                                                                                                      ALGORITHM_BCRYPT: string = 'bcrypt'

                                                                                                                                                                                                      Identifier for the BCRYPT hashing algorithm.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      ALGORITHM_MD5: string = 'md5'

                                                                                                                                                                                                      Identifier for the MD5 hashing algorithm.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      ALGORITHM_SHA1: string = 'sha1'

                                                                                                                                                                                                      Identifier for the SHA1 hashing algorithm.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      ALGORITHM_SHA256: string = 'sha256'

                                                                                                                                                                                                      Identifier for the SHA256 hashing algorithm.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      ALLOW_DIGITS: string = 'digits'

                                                                                                                                                                                                      Permission flag to allow numeric digits.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      ALLOW_LETTERS: string = 'letters'

                                                                                                                                                                                                      Permission flag to allow alphabetic letters.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      ALLOW_NUMBERS: string = 'numbers'

                                                                                                                                                                                                      Permission flag to allow number values.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      ALLOW_SPACES: string = 'spaces'

                                                                                                                                                                                                      Permission flag to allow whitespace characters.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      ALLOW_STRINGS: string = 'strings'

                                                                                                                                                                                                      Permission flag to allow string values.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                                      Event name triggered when the property value changes.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                                      Event name triggered when the property is deleted.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      TRANSFORM_LCASE: string = 'lower'

                                                                                                                                                                                                      Transformation identifier to convert string to lowercase.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      TRANSFORM_UCASE: string = 'upper'

                                                                                                                                                                                                      Transformation identifier to convert string to uppercase.

                                                                                                                                                                                                      +
                                                                                                                                                                                                      TYPE: string = 'hash'

                                                                                                                                                                                                      The string literal type identifier for this property.

                                                                                                                                                                                                      +

                                                                                                                                                                                                      Accessors

                                                                                                                                                                                                      Methods

                                                                                                                                                                                                      • Internal method to perform the cryptographic hash on a raw string. +Uses Node.js native crypto module.

                                                                                                                                                                                                        +

                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                        • value: string

                                                                                                                                                                                                          The raw string to hash.

                                                                                                                                                                                                          +

                                                                                                                                                                                                        Returns string

                                                                                                                                                                                                        The hexadecimal representation of the hashed string.

                                                                                                                                                                                                        +

                                                                                                                                                                                                        If the chosen algorithm is unsupported.

                                                                                                                                                                                                        +
                                                                                                                                                                                                      • Compares a raw cleartext string against the stored hashed value. +Automatically applies the configured salt and algorithm to the input before comparison.

                                                                                                                                                                                                        +

                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                        • value: string

                                                                                                                                                                                                          The raw cleartext string to test.

                                                                                                                                                                                                          +

                                                                                                                                                                                                        Returns boolean

                                                                                                                                                                                                        True if the hashed input matches the stored hash, false otherwise.

                                                                                                                                                                                                        +
                                                                                                                                                                                                      • Retrieves the string value, optionally applying a casing transformation.

                                                                                                                                                                                                        +

                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                        • transform: string | undefined = undefined

                                                                                                                                                                                                          Use TRANSFORM_LCASE or TRANSFORM_UCASE to mutate output case.

                                                                                                                                                                                                          +

                                                                                                                                                                                                        Returns string | undefined

                                                                                                                                                                                                        The raw or transformed string, or undefined.

                                                                                                                                                                                                        +
                                                                                                                                                                                                      • Hashes the provided value and stores the hashed result. +String length constraints (from StringProperty) are bypassed after hashing.

                                                                                                                                                                                                        +

                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                        • value: string

                                                                                                                                                                                                          The raw cleartext string to hash and store.

                                                                                                                                                                                                          +
                                                                                                                                                                                                        • setChanged: boolean = true

                                                                                                                                                                                                          Whether to mark the property as modified.

                                                                                                                                                                                                          +

                                                                                                                                                                                                        Returns HashProperty

                                                                                                                                                                                                        The property instance for chaining.

                                                                                                                                                                                                        +
                                                                                                                                                                                                      • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                                                        +

                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                        • transform: any = undefined

                                                                                                                                                                                                          An optional transformation function applied to the value before returning it.

                                                                                                                                                                                                          +

                                                                                                                                                                                                        Returns any

                                                                                                                                                                                                        The raw or transformed property value.

                                                                                                                                                                                                        +
                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_core.MapProperty.html b/docs/public/api-reference/classes/_quatrain_core.MapProperty.html new file mode 100644 index 00000000..f688807f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.MapProperty.html @@ -0,0 +1,46 @@ +MapProperty | Quatrain Core Documentation
                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                        Class MapProperty

                                                                                                                                                                                                        A property type designed to store arbitrary JSON objects or Key-Value maps.

                                                                                                                                                                                                        +
                                                                                                                                                                                                        const metadata = new MapProperty({
                                                                                                                                                                                                        name: 'metadata',
                                                                                                                                                                                                        defaultValue: {}
                                                                                                                                                                                                        });

                                                                                                                                                                                                        metadata.set({ theme: 'dark', version: 2 }); +
                                                                                                                                                                                                        + +

                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                        Index

                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                        Properties

                                                                                                                                                                                                        _allows: string[] = []
                                                                                                                                                                                                        _defaultValue: any
                                                                                                                                                                                                        _events: { [key: string]: Function } = {}
                                                                                                                                                                                                        _hasChanged: boolean
                                                                                                                                                                                                        _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                                        _id: string
                                                                                                                                                                                                        _mandatory: boolean = false
                                                                                                                                                                                                        _name: string
                                                                                                                                                                                                        _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                                        _protected: boolean = false
                                                                                                                                                                                                        _value: any = undefined
                                                                                                                                                                                                        EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                                        Event name triggered when the property value changes.

                                                                                                                                                                                                        +
                                                                                                                                                                                                        EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                                        Event name triggered when the property is deleted.

                                                                                                                                                                                                        +
                                                                                                                                                                                                        TYPE: string = 'map'

                                                                                                                                                                                                        The string literal type identifier for this property.

                                                                                                                                                                                                        +

                                                                                                                                                                                                        Accessors

                                                                                                                                                                                                        Methods

                                                                                                                                                                                                        • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                                                          +

                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                          • transform: any = undefined

                                                                                                                                                                                                            An optional transformation function applied to the value before returning it.

                                                                                                                                                                                                            +

                                                                                                                                                                                                          Returns any

                                                                                                                                                                                                          The raw or transformed property value.

                                                                                                                                                                                                          +
                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_core.NotFoundError.html b/docs/public/api-reference/classes/_quatrain_core.NotFoundError.html new file mode 100644 index 00000000..74097141 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.NotFoundError.html @@ -0,0 +1,36 @@ +NotFoundError | Quatrain Core Documentation
                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                          Class NotFoundError

                                                                                                                                                                                                          Indicates a non-existent database or file resource lookup (e.g., HTTP 404).

                                                                                                                                                                                                          +

                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                          Index

                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                          Properties

                                                                                                                                                                                                          cause?: unknown
                                                                                                                                                                                                          message: string
                                                                                                                                                                                                          name: string
                                                                                                                                                                                                          stack?: string
                                                                                                                                                                                                          stackTraceLimit: number

                                                                                                                                                                                                          The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                          +

                                                                                                                                                                                                          The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                          +

                                                                                                                                                                                                          If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                          +

                                                                                                                                                                                                          Methods

                                                                                                                                                                                                          • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                            +
                                                                                                                                                                                                            const myObject = {};
                                                                                                                                                                                                            Error.captureStackTrace(myObject);
                                                                                                                                                                                                            myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                            + +

                                                                                                                                                                                                            The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                            +

                                                                                                                                                                                                            The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                            +

                                                                                                                                                                                                            The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                            +
                                                                                                                                                                                                            function a() {
                                                                                                                                                                                                            b();
                                                                                                                                                                                                            }

                                                                                                                                                                                                            function b() {
                                                                                                                                                                                                            c();
                                                                                                                                                                                                            }

                                                                                                                                                                                                            function c() {
                                                                                                                                                                                                            // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                            const { stackTraceLimit } = Error;
                                                                                                                                                                                                            Error.stackTraceLimit = 0;
                                                                                                                                                                                                            const error = new Error();
                                                                                                                                                                                                            Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                            // Capture the stack trace above function b
                                                                                                                                                                                                            Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                            throw error;
                                                                                                                                                                                                            }

                                                                                                                                                                                                            a(); +
                                                                                                                                                                                                            + +

                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                            • targetObject: object
                                                                                                                                                                                                            • OptionalconstructorOpt: Function

                                                                                                                                                                                                            Returns void

                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_core.NumberProperty.html b/docs/public/api-reference/classes/_quatrain_core.NumberProperty.html new file mode 100644 index 00000000..b4b0995a --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.NumberProperty.html @@ -0,0 +1,70 @@ +NumberProperty | Quatrain Core Documentation
                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                            Class NumberProperty

                                                                                                                                                                                                            A property type strictly validating and formatting numeric values. +Allows enforcement of integers, positive-only limits, and boundary checking.

                                                                                                                                                                                                            +
                                                                                                                                                                                                            const price = new NumberProperty({
                                                                                                                                                                                                            name: 'price',
                                                                                                                                                                                                            type: NumberProperty.TYPE_FLOAT,
                                                                                                                                                                                                            sign: NumberProperty.TYPE_UNSIGNED,
                                                                                                                                                                                                            prefix: '$',
                                                                                                                                                                                                            minVal: 0
                                                                                                                                                                                                            });

                                                                                                                                                                                                            price.set(19.99);
                                                                                                                                                                                                            console.log(price.val(NumberProperty.TRANSFORM_FORMATTED)); // "$ 19.99"
                                                                                                                                                                                                            price.set(-5); // Throws Error: Value must be unsigned +
                                                                                                                                                                                                            + +

                                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                                            Index

                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                            Properties

                                                                                                                                                                                                            _allows: string[] = []
                                                                                                                                                                                                            _defaultValue: any
                                                                                                                                                                                                            _events: { [key: string]: Function } = {}
                                                                                                                                                                                                            _hasChanged: boolean
                                                                                                                                                                                                            _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                                            _id: string
                                                                                                                                                                                                            _mandatory: boolean = false
                                                                                                                                                                                                            _maxVal: number | undefined = undefined
                                                                                                                                                                                                            _minVal: number | undefined = undefined
                                                                                                                                                                                                            _name: string
                                                                                                                                                                                                            _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                                            _precision: number = 0
                                                                                                                                                                                                            _prefix: string = ''
                                                                                                                                                                                                            _protected: boolean = false
                                                                                                                                                                                                            _sign: string = NumberProperty.TYPE_SIGNED
                                                                                                                                                                                                            _suffix: string = ''
                                                                                                                                                                                                            _type: string = NumberProperty.TYPE_INTEGER
                                                                                                                                                                                                            _value: number | undefined
                                                                                                                                                                                                            EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                                            Event name triggered when the property value changes.

                                                                                                                                                                                                            +
                                                                                                                                                                                                            EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                                            Event name triggered when the property is deleted.

                                                                                                                                                                                                            +
                                                                                                                                                                                                            SEPARATOR: string = ' '

                                                                                                                                                                                                            Default separator used for string formatting.

                                                                                                                                                                                                            +
                                                                                                                                                                                                            TRANSFORM_FORMATTED: string = 'formatted'

                                                                                                                                                                                                            Transformation identifier to return the number as a formatted string.

                                                                                                                                                                                                            +
                                                                                                                                                                                                            TYPE: string = 'number'

                                                                                                                                                                                                            The string literal type identifier for this property.

                                                                                                                                                                                                            +
                                                                                                                                                                                                            TYPE_FLOAT: string = 'float'

                                                                                                                                                                                                            Type flag indicating a floating-point value.

                                                                                                                                                                                                            +
                                                                                                                                                                                                            TYPE_INTEGER: string = 'integer'

                                                                                                                                                                                                            Type flag indicating an integer value.

                                                                                                                                                                                                            +
                                                                                                                                                                                                            TYPE_SIGNED: string = 'signed'

                                                                                                                                                                                                            Constraint flag for signed numbers (positive and negative).

                                                                                                                                                                                                            +
                                                                                                                                                                                                            TYPE_UNSIGNED: string = 'unsigned'

                                                                                                                                                                                                            Constraint flag for unsigned numbers (positive only).

                                                                                                                                                                                                            +

                                                                                                                                                                                                            Accessors

                                                                                                                                                                                                            Methods

                                                                                                                                                                                                            • Assigns a new numeric value while strictly enforcing boundary, sign, and type constraints. +If configured as an integer, the input is floored.

                                                                                                                                                                                                              +

                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                              • value: number

                                                                                                                                                                                                                The number to assign.

                                                                                                                                                                                                                +
                                                                                                                                                                                                              • setChanged: boolean = true

                                                                                                                                                                                                                Whether to mark the property as modified.

                                                                                                                                                                                                                +

                                                                                                                                                                                                              Returns NumberProperty

                                                                                                                                                                                                              The property instance for chaining.

                                                                                                                                                                                                              +

                                                                                                                                                                                                              If the number violates the min, max, or sign constraints.

                                                                                                                                                                                                              +
                                                                                                                                                                                                            • Retrieves the numeric value, optionally applying UI string formatting.

                                                                                                                                                                                                              +

                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                              • transform: string | undefined = undefined

                                                                                                                                                                                                                Use TRANSFORM_FORMATTED to return a string with the configured prefix and suffix.

                                                                                                                                                                                                                +

                                                                                                                                                                                                              Returns string | number | undefined

                                                                                                                                                                                                              The raw number or the formatted string representation.

                                                                                                                                                                                                              +
                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_core.ObjectProperty.html b/docs/public/api-reference/classes/_quatrain_core.ObjectProperty.html new file mode 100644 index 00000000..b7c82b3f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.ObjectProperty.html @@ -0,0 +1,52 @@ +ObjectProperty | Quatrain Core Documentation
                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                              Class ObjectProperty

                                                                                                                                                                                                              A relational property type designed to store references to other BaseObjectClass instances. +Handles polymorphic resolution between raw ObjectUri, underlying DataObject, or the full class instance.

                                                                                                                                                                                                              +
                                                                                                                                                                                                              const owner = new ObjectProperty({
                                                                                                                                                                                                              name: 'owner',
                                                                                                                                                                                                              instanceOf: User
                                                                                                                                                                                                              });

                                                                                                                                                                                                              owner.set(userInstance);
                                                                                                                                                                                                              const uri = owner.val(returnAs.AS_OBJECTURIS); // Returns just the reference +
                                                                                                                                                                                                              + +

                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                              Index

                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                              Properties

                                                                                                                                                                                                              _allows: string[] = []
                                                                                                                                                                                                              _defaultValue: any
                                                                                                                                                                                                              _events: { [key: string]: Function } = {}
                                                                                                                                                                                                              _hasChanged: boolean
                                                                                                                                                                                                              _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                                              _id: string
                                                                                                                                                                                                              _instanceOf: any

                                                                                                                                                                                                              The class constructor or class name string the object must match.

                                                                                                                                                                                                              +
                                                                                                                                                                                                              _mandatory: boolean = false
                                                                                                                                                                                                              _name: string
                                                                                                                                                                                                              _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                                              _protected: boolean = false
                                                                                                                                                                                                              _value: ObjectUri | BaseObjectClass | undefined = undefined

                                                                                                                                                                                                              The internal stored value, either a class instance or a URI.

                                                                                                                                                                                                              +
                                                                                                                                                                                                              EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                                              Event name triggered when the property value changes.

                                                                                                                                                                                                              +
                                                                                                                                                                                                              EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                                              Event name triggered when the property is deleted.

                                                                                                                                                                                                              +
                                                                                                                                                                                                              TYPE: string = 'object'

                                                                                                                                                                                                              The string literal type identifier for this property.

                                                                                                                                                                                                              +

                                                                                                                                                                                                              Accessors

                                                                                                                                                                                                              Methods

                                                                                                                                                                                                              • Assigns an object or an object reference to the property. +Validates that the provided object matches the instanceOf class definition.

                                                                                                                                                                                                                +

                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                • value: object

                                                                                                                                                                                                                  The BaseObjectClass, DataObject, or ObjectUri to assign.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                • setChanged: boolean = true

                                                                                                                                                                                                                  Whether to mark the property as modified.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                Returns ObjectProperty

                                                                                                                                                                                                                The property instance for chaining.

                                                                                                                                                                                                                +

                                                                                                                                                                                                                If the assigned value is not an instance of the configured class.

                                                                                                                                                                                                                +
                                                                                                                                                                                                              • Retrieves the object, optionally resolving it to a specific representation.

                                                                                                                                                                                                                +

                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                • transform: string | undefined = undefined

                                                                                                                                                                                                                  The desired format (returnAs.AS_OBJECTURIS, AS_DATAOBJECTS, AS_INSTANCES).

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                Returns any

                                                                                                                                                                                                                The resolved object, data object, or URI based on the requested transform.

                                                                                                                                                                                                                +
                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_core.ObjectUri.html b/docs/public/api-reference/classes/_quatrain_core.ObjectUri.html new file mode 100644 index 00000000..28742489 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.ObjectUri.html @@ -0,0 +1,73 @@ +ObjectUri | Quatrain Core Documentation
                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                Unique global reference system for all Quatrain models. +Used for backend identification and cross-system relational links.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                Index

                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                • Creates a new ObjectUri instance from a path string. +ex: 'xyz', '@backend:xyz', 'collection/xyz', '@backend:collection/xyz'

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                  • str: string = ''

                                                                                                                                                                                                                    Partial or full resource path.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                  • label: string | undefined = ''

                                                                                                                                                                                                                    Optional label describing the resource path.

                                                                                                                                                                                                                    +

                                                                                                                                                                                                                  Returns ObjectUri

                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                _backend: string | undefined

                                                                                                                                                                                                                Target backend identifier.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                _collection: string | undefined = undefined

                                                                                                                                                                                                                Collection name context.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                _label: string | undefined = ''

                                                                                                                                                                                                                Human-readable label representation.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                _literal: string = ''

                                                                                                                                                                                                                The literal representation including backend name.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                _objClass: any

                                                                                                                                                                                                                Object model class reference.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                _pairs: string[] = []

                                                                                                                                                                                                                Split pairs of path segments.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                _parent: ObjectUri | undefined

                                                                                                                                                                                                                Parent ObjectUri context.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                _path: string = ObjectUri.DEFAULT

                                                                                                                                                                                                                Standardized path.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                _str: string

                                                                                                                                                                                                                Internal string representation.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                _uid: string | undefined = undefined

                                                                                                                                                                                                                Unique resource ID.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                DEFAULT: string = '/'

                                                                                                                                                                                                                Root path divider.

                                                                                                                                                                                                                +
                                                                                                                                                                                                                MISSING_COLLECTION: string = '_?_'

                                                                                                                                                                                                                Placeholder used when collections cannot be guessed.

                                                                                                                                                                                                                +

                                                                                                                                                                                                                Accessors

                                                                                                                                                                                                                • get collection(): string | undefined

                                                                                                                                                                                                                  Retrieves the collection or table name context.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Returns string | undefined

                                                                                                                                                                                                                  The collection name, or undefined.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                • set collection(collection: string | undefined): void

                                                                                                                                                                                                                  Injects a specific collection or table context name.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                  • collection: string | undefined

                                                                                                                                                                                                                    The target collection name.

                                                                                                                                                                                                                    +

                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                • get label(): string | undefined

                                                                                                                                                                                                                  Retrieves the human-readable label representation.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Returns string | undefined

                                                                                                                                                                                                                  The descriptive label, or undefined.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                • set label(label: string | undefined): void

                                                                                                                                                                                                                  Sets the human-readable label representation.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                  • label: string | undefined

                                                                                                                                                                                                                    The descriptive string label.

                                                                                                                                                                                                                    +

                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                • get path(): string

                                                                                                                                                                                                                  Returns the full path of the resource, including optional parents' paths.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Returns string

                                                                                                                                                                                                                  The computed path string.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                • set path(path: string): void

                                                                                                                                                                                                                  Overwrites the path and automatically recalculates collection details.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                  • path: string

                                                                                                                                                                                                                    The new relative path segment.

                                                                                                                                                                                                                    +

                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                • Returns references to locate the target object locally and remotely.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Returns { label: string | undefined; ref: string; uri: string }

                                                                                                                                                                                                                  An object detailing path, uri literal, and label.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_core.Property.html b/docs/public/api-reference/classes/_quatrain_core.Property.html new file mode 100644 index 00000000..2e52f5b2 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.Property.html @@ -0,0 +1,33 @@ +Property | Quatrain Core Documentation
                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                  A central factory class for instantiating property objects dynamically based on a configuration payload. +It routes property definitions to their respective concrete classes.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                  TYPE_ANY: string = 'any'

                                                                                                                                                                                                                  Identifier for the BaseProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_ARRAY: string = 'array'

                                                                                                                                                                                                                  Identifier for the ArrayProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_BOOLEAN: string = 'boolean'

                                                                                                                                                                                                                  Identifier for the BooleanProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_DATETIME: string = 'datetime'

                                                                                                                                                                                                                  Identifier for the DateTimeProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_ENUM: string = 'enum'

                                                                                                                                                                                                                  Identifier for the EnumProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_FILE: string = 'file'

                                                                                                                                                                                                                  Identifier for the FileProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_HASH: string = 'hash'

                                                                                                                                                                                                                  Identifier for the HashProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_MAP: string = 'map'

                                                                                                                                                                                                                  Identifier for the MapProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_NUMBER: string = 'number'

                                                                                                                                                                                                                  Identifier for the NumberProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_OBJECT: string = 'object'

                                                                                                                                                                                                                  Identifier for the ObjectProperty class.

                                                                                                                                                                                                                  +
                                                                                                                                                                                                                  TYPE_STRING: string = 'string'

                                                                                                                                                                                                                  Identifier for the StringProperty class.

                                                                                                                                                                                                                  +

                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_core.StringProperty.html b/docs/public/api-reference/classes/_quatrain_core.StringProperty.html new file mode 100644 index 00000000..df68e8c6 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.StringProperty.html @@ -0,0 +1,73 @@ +StringProperty | Quatrain Core Documentation
                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                    Class StringProperty

                                                                                                                                                                                                                    A property type strictly validating and handling strings. +It ensures that length constraints and specific character rules are respected before saving.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    const username = new StringProperty({
                                                                                                                                                                                                                    name: 'username',
                                                                                                                                                                                                                    minLength: 3,
                                                                                                                                                                                                                    maxLength: 15,
                                                                                                                                                                                                                    allowSpaces: false
                                                                                                                                                                                                                    });

                                                                                                                                                                                                                    username.set('my user'); // Throws Error: Spaces are not allowed
                                                                                                                                                                                                                    username.set('my_user'); // OK
                                                                                                                                                                                                                    console.log(username.get(StringProperty.TRANSFORM_UCASE)); // "MY_USER" +
                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                    _allows: string[] = []
                                                                                                                                                                                                                    _defaultValue: any
                                                                                                                                                                                                                    _events: { [key: string]: Function } = {}
                                                                                                                                                                                                                    _fullSearch: boolean = false
                                                                                                                                                                                                                    _hasChanged: boolean
                                                                                                                                                                                                                    _htmlType: PropertyHTMLType = 'off'
                                                                                                                                                                                                                    _id: string
                                                                                                                                                                                                                    _mandatory: boolean = false
                                                                                                                                                                                                                    _maxLength: number = 0
                                                                                                                                                                                                                    _minLength: number = 0
                                                                                                                                                                                                                    _name: string
                                                                                                                                                                                                                    _parent: DataObjectClass<any> | undefined
                                                                                                                                                                                                                    _protected: boolean = false
                                                                                                                                                                                                                    _rawValue: boolean = true

                                                                                                                                                                                                                    Set to false to bypass some rules

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    _value: string | undefined
                                                                                                                                                                                                                    ALLOW_DIGITS: string = 'digits'

                                                                                                                                                                                                                    Permission flag to allow numeric digits.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    ALLOW_LETTERS: string = 'letters'

                                                                                                                                                                                                                    Permission flag to allow alphabetic letters.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    ALLOW_NUMBERS: string = 'numbers'

                                                                                                                                                                                                                    Permission flag to allow number values.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    ALLOW_SPACES: string = 'spaces'

                                                                                                                                                                                                                    Permission flag to allow whitespace characters.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    ALLOW_STRINGS: string = 'strings'

                                                                                                                                                                                                                    Permission flag to allow string values.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    EVENT_ONCHANGE: string = 'onChange'

                                                                                                                                                                                                                    Event name triggered when the property value changes.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    EVENT_ONDELETE: string = 'onDelete'

                                                                                                                                                                                                                    Event name triggered when the property is deleted.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    TRANSFORM_LCASE: string = 'lower'

                                                                                                                                                                                                                    Transformation identifier to convert string to lowercase.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    TRANSFORM_UCASE: string = 'upper'

                                                                                                                                                                                                                    Transformation identifier to convert string to uppercase.

                                                                                                                                                                                                                    +
                                                                                                                                                                                                                    TYPE: string = 'string'

                                                                                                                                                                                                                    The string literal type identifier for this property.

                                                                                                                                                                                                                    +

                                                                                                                                                                                                                    Accessors

                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                    • Retrieves the string value, optionally applying a casing transformation.

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                      • transform: string | undefined = undefined

                                                                                                                                                                                                                        Use TRANSFORM_LCASE or TRANSFORM_UCASE to mutate output case.

                                                                                                                                                                                                                        +

                                                                                                                                                                                                                      Returns string | undefined

                                                                                                                                                                                                                      The raw or transformed string, or undefined.

                                                                                                                                                                                                                      +
                                                                                                                                                                                                                    • Assigns a new string value while strictly enforcing length and character constraints.

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                      • value: any

                                                                                                                                                                                                                        The string to assign.

                                                                                                                                                                                                                        +
                                                                                                                                                                                                                      • setChanged: boolean = true

                                                                                                                                                                                                                        Whether to mark the property as modified.

                                                                                                                                                                                                                        +

                                                                                                                                                                                                                      Returns StringProperty

                                                                                                                                                                                                                      The property instance for chaining.

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      If the string contains forbidden characters (spaces, letters, digits) or violates length limits.

                                                                                                                                                                                                                      +
                                                                                                                                                                                                                    • Retrieves the current value of the property, or its default value if currently undefined.

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                      • transform: any = undefined

                                                                                                                                                                                                                        An optional transformation function applied to the value before returning it.

                                                                                                                                                                                                                        +

                                                                                                                                                                                                                      Returns any

                                                                                                                                                                                                                      The raw or transformed property value.

                                                                                                                                                                                                                      +
                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_core.UnauthorizedError.html b/docs/public/api-reference/classes/_quatrain_core.UnauthorizedError.html new file mode 100644 index 00000000..5114c068 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.UnauthorizedError.html @@ -0,0 +1,36 @@ +UnauthorizedError | Quatrain Core Documentation
                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                      Class UnauthorizedError

                                                                                                                                                                                                                      Indicates missing or invalid authentication credentials (e.g., HTTP 401).

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                      cause?: unknown
                                                                                                                                                                                                                      message: string
                                                                                                                                                                                                                      name: string
                                                                                                                                                                                                                      stack?: string
                                                                                                                                                                                                                      stackTraceLimit: number

                                                                                                                                                                                                                      The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                      +

                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                      • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                        +
                                                                                                                                                                                                                        const myObject = {};
                                                                                                                                                                                                                        Error.captureStackTrace(myObject);
                                                                                                                                                                                                                        myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                        The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                        +

                                                                                                                                                                                                                        The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                        +

                                                                                                                                                                                                                        The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                        +
                                                                                                                                                                                                                        function a() {
                                                                                                                                                                                                                        b();
                                                                                                                                                                                                                        }

                                                                                                                                                                                                                        function b() {
                                                                                                                                                                                                                        c();
                                                                                                                                                                                                                        }

                                                                                                                                                                                                                        function c() {
                                                                                                                                                                                                                        // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                        const { stackTraceLimit } = Error;
                                                                                                                                                                                                                        Error.stackTraceLimit = 0;
                                                                                                                                                                                                                        const error = new Error();
                                                                                                                                                                                                                        Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                        // Capture the stack trace above function b
                                                                                                                                                                                                                        Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                        throw error;
                                                                                                                                                                                                                        }

                                                                                                                                                                                                                        a(); +
                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                        • targetObject: object
                                                                                                                                                                                                                        • OptionalconstructorOpt: Function

                                                                                                                                                                                                                        Returns void

                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_core.User.html b/docs/public/api-reference/classes/_quatrain_core.User.html new file mode 100644 index 00000000..0eb62766 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.User.html @@ -0,0 +1,66 @@ +User | Quatrain Core Documentation
                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                        Built-in User representation model handling authentication, profiles, +and entity bindings out of the box.

                                                                                                                                                                                                                        +

                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                        _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                        COLLECTION: string = 'user'

                                                                                                                                                                                                                        Standard persistence namespace.

                                                                                                                                                                                                                        +
                                                                                                                                                                                                                        LABEL_KEY: string = 'name'

                                                                                                                                                                                                                        Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                        +
                                                                                                                                                                                                                        PARENT_PROP: string | undefined

                                                                                                                                                                                                                        The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                        +
                                                                                                                                                                                                                        PROPS_DEFINITION: any = UserProperties

                                                                                                                                                                                                                        User internal schema layout.

                                                                                                                                                                                                                        +

                                                                                                                                                                                                                        Accessors

                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                        • Instantiates the DataObject for a specific model class.

                                                                                                                                                                                                                          +

                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                          • src: string | ObjectUri | DataObjectType | undefined = undefined

                                                                                                                                                                                                                            Potential source path or object.

                                                                                                                                                                                                                            +
                                                                                                                                                                                                                          • child: any = ...

                                                                                                                                                                                                                            The class constructor context.

                                                                                                                                                                                                                            +

                                                                                                                                                                                                                          Returns Promise<DataObjectType>

                                                                                                                                                                                                                          A promise resolving to the inner DataObject payload.

                                                                                                                                                                                                                          +
                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_core.ValidationError.html b/docs/public/api-reference/classes/_quatrain_core.ValidationError.html new file mode 100644 index 00000000..40829b8e --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_core.ValidationError.html @@ -0,0 +1,39 @@ +ValidationError | Quatrain Core Documentation
                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                          Class ValidationError

                                                                                                                                                                                                                          Indicates property rejection. Holds a payload of granular property-specific validation issues.

                                                                                                                                                                                                                          +

                                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                          cause?: unknown
                                                                                                                                                                                                                          errors: Record<string, string>

                                                                                                                                                                                                                          Detailed key-value map linking property names to specific violation causes.

                                                                                                                                                                                                                          +
                                                                                                                                                                                                                          message: string
                                                                                                                                                                                                                          name: string
                                                                                                                                                                                                                          stack?: string
                                                                                                                                                                                                                          stackTraceLimit: number

                                                                                                                                                                                                                          The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                          +

                                                                                                                                                                                                                          The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                          +

                                                                                                                                                                                                                          If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                          +

                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                          • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                            +
                                                                                                                                                                                                                            const myObject = {};
                                                                                                                                                                                                                            Error.captureStackTrace(myObject);
                                                                                                                                                                                                                            myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                            The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                            +

                                                                                                                                                                                                                            The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                            +

                                                                                                                                                                                                                            The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                            +
                                                                                                                                                                                                                            function a() {
                                                                                                                                                                                                                            b();
                                                                                                                                                                                                                            }

                                                                                                                                                                                                                            function b() {
                                                                                                                                                                                                                            c();
                                                                                                                                                                                                                            }

                                                                                                                                                                                                                            function c() {
                                                                                                                                                                                                                            // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                            const { stackTraceLimit } = Error;
                                                                                                                                                                                                                            Error.stackTraceLimit = 0;
                                                                                                                                                                                                                            const error = new Error();
                                                                                                                                                                                                                            Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                            // Capture the stack trace above function b
                                                                                                                                                                                                                            Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                            throw error;
                                                                                                                                                                                                                            }

                                                                                                                                                                                                                            a(); +
                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                            • targetObject: object
                                                                                                                                                                                                                            • OptionalconstructorOpt: Function

                                                                                                                                                                                                                            Returns void

                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_git-client.GithubHttpClient.html b/docs/public/api-reference/classes/_quatrain_git-client.GithubHttpClient.html new file mode 100644 index 00000000..0f3899ba --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_git-client.GithubHttpClient.html @@ -0,0 +1,10 @@ +GithubHttpClient | Quatrain Core Documentation
                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                            A lightweight, HTTP-based GitHub Git client that runs in standard Web / WebView +environments without requiring native git binary dependencies or Node.js process execution.

                                                                                                                                                                                                                            +
                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                            • Downloads a file's raw content by its blob SHA.

                                                                                                                                                                                                                              +

                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                              • sha: string

                                                                                                                                                                                                                              Returns Promise<string>

                                                                                                                                                                                                                            • Fetches the repository file tree recursively.

                                                                                                                                                                                                                              +

                                                                                                                                                                                                                              Returns Promise<{ path: string; sha: string; type: string }[]>

                                                                                                                                                                                                                            • Parses a Markdown note containing a YAML frontmatter block.

                                                                                                                                                                                                                              +

                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                              • content: string

                                                                                                                                                                                                                              Returns { body: string; metadata: Record<string, any> }

                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_http.HttpHelper.html b/docs/public/api-reference/classes/_quatrain_http.HttpHelper.html new file mode 100644 index 00000000..76dae0eb --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_http.HttpHelper.html @@ -0,0 +1,11 @@ +HttpHelper | Quatrain Core Documentation
                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                              Class HttpHelper

                                                                                                                                                                                                                              Static utility helpers for processing standard HTTP request parameters and headers.

                                                                                                                                                                                                                              +
                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                              • Extracts username and password credentials from a Basic Authorization header.

                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                • authorization: string | undefined

                                                                                                                                                                                                                                  The raw Authorization header string (e.g. 'Basic ').

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                Returns { pass: string; user: string } | null

                                                                                                                                                                                                                                An object containing the user and pass properties, or null if parsing fails.

                                                                                                                                                                                                                                +
                                                                                                                                                                                                                              • Extracts a bearer token from an Authorization header.

                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                • authorization: string | undefined

                                                                                                                                                                                                                                  The raw Authorization header string (e.g. 'Bearer ').

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                Returns string

                                                                                                                                                                                                                                The extracted token string, or an empty string if invalid or missing.

                                                                                                                                                                                                                                +
                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_i18n.Translator.html b/docs/public/api-reference/classes/_quatrain_i18n.Translator.html new file mode 100644 index 00000000..c52197b0 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_i18n.Translator.html @@ -0,0 +1,41 @@ +Translator | Quatrain Core Documentation
                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                Class Translator

                                                                                                                                                                                                                                A standard, framework-agnostic translation manager and dictionary resolver. +Handles language registration and scoped key extraction with safety fallbacks.

                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                • Initializes the translator utility.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                  • defaultLang: string = 'en'

                                                                                                                                                                                                                                    The default language code (e.g. 'en', 'fr') to fallback to if a key is missing.

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                  Returns Translator

                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                defaultLang: string
                                                                                                                                                                                                                                dictionaries: Record<string, CoreDictionary> = {}

                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                • A helper method to perform recursive deep-merging of two dictionary objects.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                  • target: any

                                                                                                                                                                                                                                    The base target object.

                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                  • source: any

                                                                                                                                                                                                                                    The source object containing updates to merge.

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                  Returns any

                                                                                                                                                                                                                                  The deep-merged dictionary object.

                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                • Dynamically extends and merges existing translation dictionaries. +This allows consuming applications to register their specific UI translations at runtime.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                  • dicts: Record<string, Record<string, any>>

                                                                                                                                                                                                                                    A record mapping language keys (e.g. 'en', 'fr') to custom dictionaries.

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                • Dynamically extends and merges an existing dictionary for a given language. +This allows consuming applications to register their specific UI translations at runtime.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                  • lang: string

                                                                                                                                                                                                                                    The language key code (e.g. 'en', 'fr').

                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                  • customDict: Record<string, any>

                                                                                                                                                                                                                                    The custom dictionary object containing terms to merge.

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                • Returns a Proxy object representing a callable translation shortcut function t.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                  • Optionallang: string

                                                                                                                                                                                                                                    Optional default language code override for this proxy instance.

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                  Returns any

                                                                                                                                                                                                                                  A callable and chainable translation Proxy.

                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                  const t = translator.getProxy('en')
                                                                                                                                                                                                                                  t('app.title') // -> "Core App"
                                                                                                                                                                                                                                  t.fr('app.title') // -> "Application Core" +
                                                                                                                                                                                                                                  + +
                                                                                                                                                                                                                                • Registers one or multiple translation language dictionaries.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                  • dicts: Record<string, CoreDictionary>

                                                                                                                                                                                                                                    A record mapping language keys (e.g. 'en', 'fr') to dictionaries.

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                • Registers a specific translation language dictionary.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                  • lang: string

                                                                                                                                                                                                                                    The language key code (e.g. 'en', 'fr').

                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                  • dict: CoreDictionary

                                                                                                                                                                                                                                    The fully conforming Quatrain dictionary instance.

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                • Translates a specific text label key inside a given dictionary scope. +Supports both standard (scope, key) calls and dotted key path (e.g. "backends.title") notation.

                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                  • scope: string

                                                                                                                                                                                                                                    The dictionary scope key (e.g. 'table') or a dotted key path (e.g. 'app.title').

                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                  • OptionalkeyOrLang: string

                                                                                                                                                                                                                                    The specific term key inside the selected scope, or the language code if scope is a dotted key.

                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                  • Optionallang: string

                                                                                                                                                                                                                                    The target language code to extract from (falls back to default language).

                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                  Returns string

                                                                                                                                                                                                                                  The localized translation string, or the raw key string if no match was found.

                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_ingestion-audio.AudioIngestionAdapter.html b/docs/public/api-reference/classes/_quatrain_ingestion-audio.AudioIngestionAdapter.html new file mode 100644 index 00000000..f5404a61 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_ingestion-audio.AudioIngestionAdapter.html @@ -0,0 +1,7 @@ +AudioIngestionAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                  config: Record<string, any> = {}

                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_ingestion-ocr.OcrIngestionAdapter.html b/docs/public/api-reference/classes/_quatrain_ingestion-ocr.OcrIngestionAdapter.html new file mode 100644 index 00000000..193c76d8 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_ingestion-ocr.OcrIngestionAdapter.html @@ -0,0 +1,7 @@ +OcrIngestionAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                    config: Record<string, any> = {}

                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_ingestion-video.VideoIngestionAdapter.html b/docs/public/api-reference/classes/_quatrain_ingestion-video.VideoIngestionAdapter.html new file mode 100644 index 00000000..5a366421 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_ingestion-video.VideoIngestionAdapter.html @@ -0,0 +1,7 @@ +VideoIngestionAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                      config: Record<string, any> = {}

                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_ingestion-web.WebIngestionAdapter.html b/docs/public/api-reference/classes/_quatrain_ingestion-web.WebIngestionAdapter.html new file mode 100644 index 00000000..53d1162f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_ingestion-web.WebIngestionAdapter.html @@ -0,0 +1,7 @@ +WebIngestionAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                        config: Record<string, any> = {}

                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_ingestion.AbstractIngestionAdapter.html b/docs/public/api-reference/classes/_quatrain_ingestion.AbstractIngestionAdapter.html new file mode 100644 index 00000000..ac1f75f2 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_ingestion.AbstractIngestionAdapter.html @@ -0,0 +1,7 @@ +AbstractIngestionAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                          Class AbstractIngestionAdapterAbstract

                                                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                                          config: Record<string, any> = {}

                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                          • Process input source (file path, URL, or raw data) and extract structured content.

                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                            • source: string | Buffer<ArrayBufferLike>
                                                                                                                                                                                                                                            • Optionaloptions: Record<string, any>

                                                                                                                                                                                                                                            Returns Promise<IngestionResult>

                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_ingestion.Ingestion.html b/docs/public/api-reference/classes/_quatrain_ingestion.Ingestion.html new file mode 100644 index 00000000..ce36d5e7 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_ingestion.Ingestion.html @@ -0,0 +1,89 @@ +Ingestion | Quatrain Core Documentation
                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                            Core foundation class for Quatrain architecture. +Manages central configuration, logger registry, storage binding, and class mapping.

                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                            Properties

                                                                                                                                                                                                                                            _adapters: Record<string, AbstractIngestionAdapter> = {}
                                                                                                                                                                                                                                            classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                            Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                            defaultAdapter: string = ''
                                                                                                                                                                                                                                            logger: AbstractLoggerAdapter = ...

                                                                                                                                                                                                                                            Active logger instance for the Core domain.

                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                            logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                            System-wide base log verbosity.

                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                            me: string = ...

                                                                                                                                                                                                                                            Identifying namespace for this core component.

                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                            storage: typeof NodePersist = persist

                                                                                                                                                                                                                                            Persistent key-value storage engine reference.

                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                            storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                            Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                            Accessors

                                                                                                                                                                                                                                            • get userClass(): any

                                                                                                                                                                                                                                              Returns any

                                                                                                                                                                                                                                            • set userClass(cls: any): void

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • cls: any

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                            • Registers an instantiated ingestion adapter into the global registry.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • adapter: AbstractIngestionAdapter

                                                                                                                                                                                                                                                The initialized adapter (e.g. OcrIngestionAdapter).

                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • alias: string

                                                                                                                                                                                                                                                The string identifier to register it under.

                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • setDefault: boolean = false

                                                                                                                                                                                                                                                Whether this should become the default backend.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                            • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • name: string

                                                                                                                                                                                                                                                Semantic registry name.

                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • obj: any

                                                                                                                                                                                                                                                Class constructor.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                            • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • key: string

                                                                                                                                                                                                                                                Identification string.

                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • value: any

                                                                                                                                                                                                                                                Value.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns Promise<void>

                                                                                                                                                                                                                                            • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • alias: string = ...

                                                                                                                                                                                                                                                The logging context name.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns any

                                                                                                                                                                                                                                              Instantiated LoggerAdapter.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                            • Triggers a debug log on the core logger.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                            • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • key: string

                                                                                                                                                                                                                                                The property block to generate.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                              Field definitions block.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                            • Triggers an error log on the core logger.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                            • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • name: string

                                                                                                                                                                                                                                                The semantic name to resolve.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns any

                                                                                                                                                                                                                                              Class definition.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                            • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • key: string

                                                                                                                                                                                                                                                The target identifier.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns Promise<any>

                                                                                                                                                                                                                                              The recovered value.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                            • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • command: string

                                                                                                                                                                                                                                                The executable.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns Promise<string>

                                                                                                                                                                                                                                              The resolved system path.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                            • Triggers an info log on the core logger.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                            • Triggers a standard log on the core logger.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                            • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • seconds: number = 1

                                                                                                                                                                                                                                                Duration count.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns Promise<unknown>

                                                                                                                                                                                                                                              The promise to await.

                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                            • Triggers a trace log on the core logger.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                            • Triggers a warning log on the core logger.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_log.AbstractLoggerAdapter.html b/docs/public/api-reference/classes/_quatrain_log.AbstractLoggerAdapter.html new file mode 100644 index 00000000..b1286139 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_log.AbstractLoggerAdapter.html @@ -0,0 +1,36 @@ +AbstractLoggerAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                              Class AbstractLoggerAdapterAbstract

                                                                                                                                                                                                                                              Base abstraction for creating custom logging adapters. +Ensures consistent log levels and signature formats across implementations.

                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                                                              Implements

                                                                                                                                                                                                                                              • LoggerType
                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                              Properties

                                                                                                                                                                                                                                              _logger: any = undefined
                                                                                                                                                                                                                                              _logLevel: LogLevel = ...
                                                                                                                                                                                                                                              _me: string = ''

                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                              • Renvoie un clone de l'adaptateur avec un préfixe concatené +Ex: new Logger("Queue").clone("MyQueue") => Logger("Queue][MyQueue") -> qui s'affichera [Queue][MyQueue]

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                • suffix: string

                                                                                                                                                                                                                                                Returns this

                                                                                                                                                                                                                                              • Trigger a debug-level log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                • ..._messages: any[]

                                                                                                                                                                                                                                                  Items to log.

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                              • Trigger an error-level log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                • ..._messages: any[]

                                                                                                                                                                                                                                                  Items to log.

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                              • Safely stringifies and combines all parts of a log payload into a single string.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                • messages: any[]

                                                                                                                                                                                                                                                  Array of items to log.

                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                • _loglevel: LogLevel = LogLevel.INFO

                                                                                                                                                                                                                                                  Severity of the log.

                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                • tag: string = ''

                                                                                                                                                                                                                                                  A specific label for the line.

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                Returns string

                                                                                                                                                                                                                                                Formatted output string.

                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                              • Trigger an info-level log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                • ..._messages: any[]

                                                                                                                                                                                                                                                  Items to log.

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                              • Log message using defined logger

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                • ..._messages: any[]

                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                              • Trigger a trace-level log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                • ..._messages: any[]

                                                                                                                                                                                                                                                  Items to log.

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                              • Trigger a warn-level log.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                • ..._messages: any[]

                                                                                                                                                                                                                                                  Items to log.

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_log.DefaultLoggerAdapter.html b/docs/public/api-reference/classes/_quatrain_log.DefaultLoggerAdapter.html new file mode 100644 index 00000000..35a6bb2c --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_log.DefaultLoggerAdapter.html @@ -0,0 +1,37 @@ +DefaultLoggerAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                Class DefaultLoggerAdapter

                                                                                                                                                                                                                                                Default internal implementation relying on loglevel and chalk for colored console outputs.

                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                _logger: any = undefined
                                                                                                                                                                                                                                                _logLevel: LogLevel = ...
                                                                                                                                                                                                                                                _me: string = ''

                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                • Renvoie un clone de l'adaptateur avec un préfixe concatené +Ex: new Logger("Queue").clone("MyQueue") => Logger("Queue][MyQueue") -> qui s'affichera [Queue][MyQueue]

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                  • suffix: string

                                                                                                                                                                                                                                                  Returns this

                                                                                                                                                                                                                                                • Safely stringifies and combines all parts of a log payload into a single string.

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                  • messages: any[]

                                                                                                                                                                                                                                                    Array of items to log.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                  • _loglevel: LogLevel = LogLevel.INFO

                                                                                                                                                                                                                                                    Severity of the log.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                  • tag: string = ''

                                                                                                                                                                                                                                                    A specific label for the line.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                  Returns string

                                                                                                                                                                                                                                                  Formatted output string.

                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_log.Log.html b/docs/public/api-reference/classes/_quatrain_log.Log.html new file mode 100644 index 00000000..002bb637 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_log.Log.html @@ -0,0 +1,37 @@ +Log | Quatrain Core Documentation
                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                  Global static registry and entrypoint for logging in Quatrain. +Manages instantiated logger adapters.

                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                  _loggers: LoggerRegistry<any> = {}
                                                                                                                                                                                                                                                  defaultLogger: string = '@default'

                                                                                                                                                                                                                                                  Alias for the active default logger.

                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                  • Registers a new initialized logger context within the singleton context.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                    • alias: string

                                                                                                                                                                                                                                                      Short identifier name.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                    • logger: AbstractLoggerAdapter = ...

                                                                                                                                                                                                                                                      The concrete logger instance.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                    • setDefault: boolean = false

                                                                                                                                                                                                                                                      Makes this instance the new default target.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                    Returns any

                                                                                                                                                                                                                                                    The newly added logger.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                  • Delegate debug call to the default logger.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                    • ...messages: any[]

                                                                                                                                                                                                                                                      Variadic arguments to log.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                  • Delegate error call to the default logger.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                    • ...messages: any[]

                                                                                                                                                                                                                                                      Variadic arguments to log.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                  • Delegate info call to the default logger.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                    • ...messages: any[]

                                                                                                                                                                                                                                                      Variadic arguments to log.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                  • Log message using defined logger

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                    • ...messages: any[]

                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                  • Centralized formatting for log timestamps.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Returns string

                                                                                                                                                                                                                                                    The ISO date string.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                  • Delegate trace call to the default logger.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                    • ...messages: any[]

                                                                                                                                                                                                                                                      Variadic arguments to log.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                  • Delegate warning call to the default logger.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                    • ...messages: any[]

                                                                                                                                                                                                                                                      Variadic arguments to log.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmAdapter.html b/docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmAdapter.html new file mode 100644 index 00000000..73c6125a --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmAdapter.html @@ -0,0 +1,101 @@ +AbstractMdmAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                    Class AbstractMdmAdapterAbstract

                                                                                                                                                                                                                                                    Abstract Adapter for MDM Providers. +Declares contracts for object CRUD, archetype specs, specifications read/write, and vendor relationships.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                    _alias: string = 'default'
                                                                                                                                                                                                                                                    classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                                    Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                    logger: AbstractLoggerAdapter = ...

                                                                                                                                                                                                                                                    Active logger instance for the Core domain.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                    logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                                    System-wide base log verbosity.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                    me: string = ...

                                                                                                                                                                                                                                                    Identifying namespace for this core component.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                    storage: typeof NodePersist = persist

                                                                                                                                                                                                                                                    Persistent key-value storage engine reference.

                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                    storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                                    Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                    Accessors

                                                                                                                                                                                                                                                    • get userClass(): any

                                                                                                                                                                                                                                                      Returns any

                                                                                                                                                                                                                                                    • set userClass(cls: any): void

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • cls: any

                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                    • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • name: string

                                                                                                                                                                                                                                                        Semantic registry name.

                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                      • obj: any

                                                                                                                                                                                                                                                        Class constructor.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                    • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • key: string

                                                                                                                                                                                                                                                        Identification string.

                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                      • value: any

                                                                                                                                                                                                                                                        Value.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns Promise<void>

                                                                                                                                                                                                                                                    • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • alias: string = ...

                                                                                                                                                                                                                                                        The logging context name.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns any

                                                                                                                                                                                                                                                      Instantiated LoggerAdapter.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                    • Triggers a debug log on the core logger.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • ...message: any

                                                                                                                                                                                                                                                        Content to log.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                    • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • key: string

                                                                                                                                                                                                                                                        The property block to generate.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                                      Field definitions block.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                    • Triggers an error log on the core logger.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • ...message: any

                                                                                                                                                                                                                                                        Content to log.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                    • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • name: string

                                                                                                                                                                                                                                                        The semantic name to resolve.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns any

                                                                                                                                                                                                                                                      Class definition.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                    • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • key: string

                                                                                                                                                                                                                                                        The target identifier.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns Promise<any>

                                                                                                                                                                                                                                                      The recovered value.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                    • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • command: string

                                                                                                                                                                                                                                                        The executable.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns Promise<string>

                                                                                                                                                                                                                                                      The resolved system path.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                    • Triggers an info log on the core logger.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • ...message: any

                                                                                                                                                                                                                                                        Content to log.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                    • Triggers a standard log on the core logger.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • ...message: any

                                                                                                                                                                                                                                                        Content to log.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                    • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • seconds: number = 1

                                                                                                                                                                                                                                                        Duration count.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns Promise<unknown>

                                                                                                                                                                                                                                                      The promise to await.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                    • Triggers a trace log on the core logger.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • ...message: any

                                                                                                                                                                                                                                                        Content to log.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                    • Triggers a warning log on the core logger.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                      • ...message: any

                                                                                                                                                                                                                                                        Content to log.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmObject.html b/docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmObject.html new file mode 100644 index 00000000..3515971f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmObject.html @@ -0,0 +1,135 @@ +AbstractMdmObject | Quatrain Core Documentation
                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                      Class AbstractMdmObjectAbstract

                                                                                                                                                                                                                                                      Abstract Base Class for all MDM Domain Objects. +MUST be extended by concrete object definitions (e.g. TeeShirt, Garment, Disk, HardwareDevice, VirtualKeychain).

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Note: Persistence routing and identification are natively carried by Quatrain ObjectUri (no explicit 'id' property in PROPS_DEFINITION). +Object <-> Vendor relationships are carried by the ObjectVendor junction entity collection.

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                      _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                      _objectVendorsList: ObjectVendor[] = []
                                                                                                                                                                                                                                                      _specificationsMap: Map<string, Specification> = ...
                                                                                                                                                                                                                                                      _repositoryInstance: any = null
                                                                                                                                                                                                                                                      COLLECTION: string = 'objects'

                                                                                                                                                                                                                                                      The backend identifier (table or collection name) representing this class.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                      LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                      Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                      PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                      The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                      PROPS_DEFINITION: (
                                                                                                                                                                                                                                                          | {
                                                                                                                                                                                                                                                              default?: undefined;
                                                                                                                                                                                                                                                              instanceOf?: undefined;
                                                                                                                                                                                                                                                              name: string;
                                                                                                                                                                                                                                                              parentKey?: undefined;
                                                                                                                                                                                                                                                              required: boolean;
                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                          | {
                                                                                                                                                                                                                                                              default: string;
                                                                                                                                                                                                                                                              instanceOf?: undefined;
                                                                                                                                                                                                                                                              name: string;
                                                                                                                                                                                                                                                              parentKey?: undefined;
                                                                                                                                                                                                                                                              required: boolean;
                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                          | {
                                                                                                                                                                                                                                                              default?: undefined;
                                                                                                                                                                                                                                                              instanceOf: string;
                                                                                                                                                                                                                                                              name: string;
                                                                                                                                                                                                                                                              parentKey?: undefined;
                                                                                                                                                                                                                                                              required: boolean;
                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                          | {
                                                                                                                                                                                                                                                              default?: undefined;
                                                                                                                                                                                                                                                              instanceOf: typeof ObjectVendor;
                                                                                                                                                                                                                                                              name: string;
                                                                                                                                                                                                                                                              parentKey: string;
                                                                                                                                                                                                                                                              required?: undefined;
                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                      )[] = ...

                                                                                                                                                                                                                                                      The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                      REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                      The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                      Accessors

                                                                                                                                                                                                                                                      • get specificationsCollectionName(): string

                                                                                                                                                                                                                                                        Returns the subcollection path for Specifications attached to this parent object. +Scheme: //specifications

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Returns string

                                                                                                                                                                                                                                                      • get specificationsObject(): Record<string, any>

                                                                                                                                                                                                                                                        Returns a plain key-value object of all specifications for interface casting and validation.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Returns Record<string, any>

                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                      • Associates a Vendor entity to this object via an ObjectVendor relationship record.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                        • vendor: Vendor
                                                                                                                                                                                                                                                        • OptionalvendorSku: string
                                                                                                                                                                                                                                                        • Optionalrole: string
                                                                                                                                                                                                                                                        • isPrimary: boolean = false

                                                                                                                                                                                                                                                        Returns ObjectVendor

                                                                                                                                                                                                                                                      • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                        • hardDelete: boolean = false

                                                                                                                                                                                                                                                          If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                        Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                        A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                      • Returns the subcollection path for attaching N child subitems linked to this parent object. +Scheme: //

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                        • subcollection: string

                                                                                                                                                                                                                                                        Returns string

                                                                                                                                                                                                                                                      • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                        • obj: any

                                                                                                                                                                                                                                                          The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                        Returns Query<any>

                                                                                                                                                                                                                                                        A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                      • Sets a specification key/value pair by instantiating a Specification model.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                        • key: string
                                                                                                                                                                                                                                                        • value: any
                                                                                                                                                                                                                                                        • Optionalunit: string
                                                                                                                                                                                                                                                        • Optionalgroup: string

                                                                                                                                                                                                                                                        Returns Specification

                                                                                                                                                                                                                                                      • Bulk populates specifications from a dictionary object.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                        • specsObj: Record<string, any>

                                                                                                                                                                                                                                                        Returns this

                                                                                                                                                                                                                                                      • Validates that the current instance specifications comply with the archetype's required and optional properties.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Returns boolean

                                                                                                                                                                                                                                                        True if valid; throws error if required specification properties are missing.

                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                      • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                        • src: string | ObjectUri | undefined = undefined

                                                                                                                                                                                                                                                          The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                        • child: any = ...

                                                                                                                                                                                                                                                          The specific child class constructor to instantiate.

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                        Returns Promise<any>

                                                                                                                                                                                                                                                        A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        If instantiation fails.

                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                      • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Type Parameters

                                                                                                                                                                                                                                                        • T

                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                        • path: string

                                                                                                                                                                                                                                                          The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                        Returns Promise<T>

                                                                                                                                                                                                                                                        A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmObjectRepository.html b/docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmObjectRepository.html new file mode 100644 index 00000000..d1a41292 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.AbstractMdmObjectRepository.html @@ -0,0 +1,36 @@ +AbstractMdmObjectRepository | Quatrain Core Documentation
                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                        Class AbstractMdmObjectRepository

                                                                                                                                                                                                                                                        Base Repository for AbstractMdmObject child models

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                        _model: typeof PersistedBaseObject
                                                                                                                                                                                                                                                        backendAdapter: BackendInterface

                                                                                                                                                                                                                                                        The specific backend adapter designated for this repository's requests.

                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                        COLLECTION_NAME: "objects" = 'objects'
                                                                                                                                                                                                                                                        useDateFormat: boolean = true

                                                                                                                                                                                                                                                        Toggle indicating whether to automatically parse formats natively as Date.

                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                        Accessors

                                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_mdm.Disk.html b/docs/public/api-reference/classes/_quatrain_mdm.Disk.html new file mode 100644 index 00000000..57ebf1fe --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.Disk.html @@ -0,0 +1,134 @@ +Disk | Quatrain Core Documentation
                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                          Concrete Audio/Video Disk MDM Object Class (Extends AbstractMdmObject) +Enforces MediaDiskSpecInterface over child Specification collection.

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                                                          _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                          _objectVendorsList: ObjectVendor[] = []
                                                                                                                                                                                                                                                          _specificationsMap: Map<string, Specification> = ...
                                                                                                                                                                                                                                                          _repositoryInstance: any = null
                                                                                                                                                                                                                                                          COLLECTION: string = 'disks'

                                                                                                                                                                                                                                                          The backend identifier (table or collection name) representing this class.

                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                          LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                          Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                          PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                          The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                          PROPS_DEFINITION: (
                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                  default?: undefined;
                                                                                                                                                                                                                                                                  instanceOf?: undefined;
                                                                                                                                                                                                                                                                  name: string;
                                                                                                                                                                                                                                                                  parentKey?: undefined;
                                                                                                                                                                                                                                                                  required: boolean;
                                                                                                                                                                                                                                                                  type: string;
                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                  default: string;
                                                                                                                                                                                                                                                                  instanceOf?: undefined;
                                                                                                                                                                                                                                                                  name: string;
                                                                                                                                                                                                                                                                  parentKey?: undefined;
                                                                                                                                                                                                                                                                  required: boolean;
                                                                                                                                                                                                                                                                  type: string;
                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                  default?: undefined;
                                                                                                                                                                                                                                                                  instanceOf: string;
                                                                                                                                                                                                                                                                  name: string;
                                                                                                                                                                                                                                                                  parentKey?: undefined;
                                                                                                                                                                                                                                                                  required: boolean;
                                                                                                                                                                                                                                                                  type: string;
                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                  default?: undefined;
                                                                                                                                                                                                                                                                  instanceOf: typeof ObjectVendor;
                                                                                                                                                                                                                                                                  name: string;
                                                                                                                                                                                                                                                                  parentKey: string;
                                                                                                                                                                                                                                                                  required?: undefined;
                                                                                                                                                                                                                                                                  type: string;
                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                          )[] = ...

                                                                                                                                                                                                                                                          The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                          REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                          The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                          Accessors

                                                                                                                                                                                                                                                          • get specificationsCollectionName(): string

                                                                                                                                                                                                                                                            Returns the subcollection path for Specifications attached to this parent object. +Scheme: //specifications

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Returns string

                                                                                                                                                                                                                                                          • get specificationsObject(): Record<string, any>

                                                                                                                                                                                                                                                            Returns a plain key-value object of all specifications for interface casting and validation.

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Returns Record<string, any>

                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                          • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                            • hardDelete: boolean = false

                                                                                                                                                                                                                                                              If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                            Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                            A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                          • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                            • obj: any

                                                                                                                                                                                                                                                              The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                            Returns Query<any>

                                                                                                                                                                                                                                                            A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                          • Persists the current state of the object to the configured backend database. +Triggers creation or update operations depending on whether the object already exists.

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Returns Promise<Disk>

                                                                                                                                                                                                                                                            A promise resolving to the instance itself for chaining.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                          • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                            • src: string | ObjectUri | undefined = undefined

                                                                                                                                                                                                                                                              The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                            • child: any = ...

                                                                                                                                                                                                                                                              The specific child class constructor to instantiate.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                            Returns Promise<any>

                                                                                                                                                                                                                                                            A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            If instantiation fails.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                          • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Type Parameters

                                                                                                                                                                                                                                                            • T

                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                            • path: string

                                                                                                                                                                                                                                                              The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                            Returns Promise<T>

                                                                                                                                                                                                                                                            A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_mdm.Garment.html b/docs/public/api-reference/classes/_quatrain_mdm.Garment.html new file mode 100644 index 00000000..b22b9589 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.Garment.html @@ -0,0 +1,134 @@ +Garment | Quatrain Core Documentation
                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                            Concrete Garment MDM Object Class (Extends AbstractMdmObject) +Enforces TextileGarmentSpecInterface over child Specification collection.

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                            Properties

                                                                                                                                                                                                                                                            _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                            _objectVendorsList: ObjectVendor[] = []
                                                                                                                                                                                                                                                            _specificationsMap: Map<string, Specification> = ...
                                                                                                                                                                                                                                                            _repositoryInstance: any = null
                                                                                                                                                                                                                                                            COLLECTION: string = 'garments'

                                                                                                                                                                                                                                                            The backend identifier (table or collection name) representing this class.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                            LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                            Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                            PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                            The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                            PROPS_DEFINITION: (
                                                                                                                                                                                                                                                                | {
                                                                                                                                                                                                                                                                    default?: undefined;
                                                                                                                                                                                                                                                                    instanceOf?: undefined;
                                                                                                                                                                                                                                                                    name: string;
                                                                                                                                                                                                                                                                    parentKey?: undefined;
                                                                                                                                                                                                                                                                    required: boolean;
                                                                                                                                                                                                                                                                    type: string;
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                | {
                                                                                                                                                                                                                                                                    default: string;
                                                                                                                                                                                                                                                                    instanceOf?: undefined;
                                                                                                                                                                                                                                                                    name: string;
                                                                                                                                                                                                                                                                    parentKey?: undefined;
                                                                                                                                                                                                                                                                    required: boolean;
                                                                                                                                                                                                                                                                    type: string;
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                | {
                                                                                                                                                                                                                                                                    default?: undefined;
                                                                                                                                                                                                                                                                    instanceOf: string;
                                                                                                                                                                                                                                                                    name: string;
                                                                                                                                                                                                                                                                    parentKey?: undefined;
                                                                                                                                                                                                                                                                    required: boolean;
                                                                                                                                                                                                                                                                    type: string;
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                | {
                                                                                                                                                                                                                                                                    default?: undefined;
                                                                                                                                                                                                                                                                    instanceOf: typeof ObjectVendor;
                                                                                                                                                                                                                                                                    name: string;
                                                                                                                                                                                                                                                                    parentKey: string;
                                                                                                                                                                                                                                                                    required?: undefined;
                                                                                                                                                                                                                                                                    type: string;
                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                            )[] = ...

                                                                                                                                                                                                                                                            The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                            REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                            The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                            Accessors

                                                                                                                                                                                                                                                            • get specificationsCollectionName(): string

                                                                                                                                                                                                                                                              Returns the subcollection path for Specifications attached to this parent object. +Scheme: //specifications

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              Returns string

                                                                                                                                                                                                                                                            • get specificationsObject(): Record<string, any>

                                                                                                                                                                                                                                                              Returns a plain key-value object of all specifications for interface casting and validation.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              Returns Record<string, any>

                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                            • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                              • hardDelete: boolean = false

                                                                                                                                                                                                                                                                If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                              Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                              A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                            • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                              • obj: any

                                                                                                                                                                                                                                                                The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                              Returns Query<any>

                                                                                                                                                                                                                                                              A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                            • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                              • src: string | ObjectUri | undefined = undefined

                                                                                                                                                                                                                                                                The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                              • child: any = ...

                                                                                                                                                                                                                                                                The specific child class constructor to instantiate.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                              Returns Promise<any>

                                                                                                                                                                                                                                                              A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              If instantiation fails.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                            • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              Type Parameters

                                                                                                                                                                                                                                                              • T

                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                              • path: string

                                                                                                                                                                                                                                                                The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                              Returns Promise<T>

                                                                                                                                                                                                                                                              A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_mdm.HardwareDevice.html b/docs/public/api-reference/classes/_quatrain_mdm.HardwareDevice.html new file mode 100644 index 00000000..22339223 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.HardwareDevice.html @@ -0,0 +1,134 @@ +HardwareDevice | Quatrain Core Documentation
                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                              Class HardwareDevice

                                                                                                                                                                                                                                                              Concrete Hardware IoT Device MDM Object Class (Extends AbstractMdmObject) +Enforces HardwareDeviceSpecInterface over child Specification collection.

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                              Properties

                                                                                                                                                                                                                                                              _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                              _objectVendorsList: ObjectVendor[] = []
                                                                                                                                                                                                                                                              _specificationsMap: Map<string, Specification> = ...
                                                                                                                                                                                                                                                              _repositoryInstance: any = null
                                                                                                                                                                                                                                                              COLLECTION: string = 'devices'

                                                                                                                                                                                                                                                              The backend identifier (table or collection name) representing this class.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                              LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                              Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                              PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                              The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                              PROPS_DEFINITION: (
                                                                                                                                                                                                                                                                  | {
                                                                                                                                                                                                                                                                      default?: undefined;
                                                                                                                                                                                                                                                                      instanceOf?: undefined;
                                                                                                                                                                                                                                                                      name: string;
                                                                                                                                                                                                                                                                      parentKey?: undefined;
                                                                                                                                                                                                                                                                      required: boolean;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                  | {
                                                                                                                                                                                                                                                                      default: string;
                                                                                                                                                                                                                                                                      instanceOf?: undefined;
                                                                                                                                                                                                                                                                      name: string;
                                                                                                                                                                                                                                                                      parentKey?: undefined;
                                                                                                                                                                                                                                                                      required: boolean;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                  | {
                                                                                                                                                                                                                                                                      default?: undefined;
                                                                                                                                                                                                                                                                      instanceOf: string;
                                                                                                                                                                                                                                                                      name: string;
                                                                                                                                                                                                                                                                      parentKey?: undefined;
                                                                                                                                                                                                                                                                      required: boolean;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                  | {
                                                                                                                                                                                                                                                                      default?: undefined;
                                                                                                                                                                                                                                                                      instanceOf: typeof ObjectVendor;
                                                                                                                                                                                                                                                                      name: string;
                                                                                                                                                                                                                                                                      parentKey: string;
                                                                                                                                                                                                                                                                      required?: undefined;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                              )[] = ...

                                                                                                                                                                                                                                                              The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                              REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                              The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                              Accessors

                                                                                                                                                                                                                                                              • get specificationsCollectionName(): string

                                                                                                                                                                                                                                                                Returns the subcollection path for Specifications attached to this parent object. +Scheme: //specifications

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                Returns string

                                                                                                                                                                                                                                                              • get specificationsObject(): Record<string, any>

                                                                                                                                                                                                                                                                Returns a plain key-value object of all specifications for interface casting and validation.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                Returns Record<string, any>

                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                              • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                • hardDelete: boolean = false

                                                                                                                                                                                                                                                                  If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                              • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                • obj: any

                                                                                                                                                                                                                                                                  The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                Returns Query<any>

                                                                                                                                                                                                                                                                A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                              • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                • src: string | ObjectUri | undefined = undefined

                                                                                                                                                                                                                                                                  The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                • child: any = ...

                                                                                                                                                                                                                                                                  The specific child class constructor to instantiate.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                                                                                                                A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                If instantiation fails.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                              • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                Type Parameters

                                                                                                                                                                                                                                                                • T

                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                • path: string

                                                                                                                                                                                                                                                                  The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                Returns Promise<T>

                                                                                                                                                                                                                                                                A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_mdm.Mdm.html b/docs/public/api-reference/classes/_quatrain_mdm.Mdm.html new file mode 100644 index 00000000..44d19745 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.Mdm.html @@ -0,0 +1,99 @@ +Mdm | Quatrain Core Documentation
                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                MDM Core Pivot Class. +Manages global provider adapters, archetypes registry, and custom domain model mappings.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                                                Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                logger: AbstractLoggerAdapter = ...

                                                                                                                                                                                                                                                                Active logger instance for the Core domain.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                                                System-wide base log verbosity.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                me: string = ...

                                                                                                                                                                                                                                                                Identifying namespace for this core component.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                storage: typeof NodePersist = persist

                                                                                                                                                                                                                                                                Persistent key-value storage engine reference.

                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                                                Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                Accessors

                                                                                                                                                                                                                                                                • get userClass(): any

                                                                                                                                                                                                                                                                  Returns any

                                                                                                                                                                                                                                                                • set userClass(cls: any): void

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • cls: any

                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                • Register an MDM Provider Adapter under a given alias.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • name: string

                                                                                                                                                                                                                                                                    Semantic registry name.

                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                  • obj: any

                                                                                                                                                                                                                                                                    Class constructor.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • key: string

                                                                                                                                                                                                                                                                    Identification string.

                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                  • value: any

                                                                                                                                                                                                                                                                    Value.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns Promise<void>

                                                                                                                                                                                                                                                                • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • alias: string = ...

                                                                                                                                                                                                                                                                    The logging context name.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns any

                                                                                                                                                                                                                                                                  Instantiated LoggerAdapter.

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                • Triggers a debug log on the core logger.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • key: string

                                                                                                                                                                                                                                                                    The property block to generate.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                                                  Field definitions block.

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                • Triggers an error log on the core logger.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • name: string

                                                                                                                                                                                                                                                                    The semantic name to resolve.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns any

                                                                                                                                                                                                                                                                  Class definition.

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • key: string

                                                                                                                                                                                                                                                                    The target identifier.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns Promise<any>

                                                                                                                                                                                                                                                                  The recovered value.

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • command: string

                                                                                                                                                                                                                                                                    The executable.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns Promise<string>

                                                                                                                                                                                                                                                                  The resolved system path.

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                • Parameters

                                                                                                                                                                                                                                                                  • vendorId: string
                                                                                                                                                                                                                                                                  • Optionalalias: string

                                                                                                                                                                                                                                                                  Returns Promise<Vendor | null>

                                                                                                                                                                                                                                                                • Triggers an info log on the core logger.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                • Triggers a standard log on the core logger.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • seconds: number = 1

                                                                                                                                                                                                                                                                    Duration count.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns Promise<unknown>

                                                                                                                                                                                                                                                                  The promise to await.

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                • Triggers a trace log on the core logger.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                • Triggers a warning log on the core logger.

                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_mdm.MdmSpecGroups.html b/docs/public/api-reference/classes/_quatrain_mdm.MdmSpecGroups.html new file mode 100644 index 00000000..ec6c946d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.MdmSpecGroups.html @@ -0,0 +1,15 @@ +MdmSpecGroups | Quatrain Core Documentation
                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                  Class MdmSpecGroups

                                                                                                                                                                                                                                                                  Reusable Standard Specification Groups Registry in @quatrain/mdm. +Allows domain models to reference standard Quatrain MDM groups (dimensions, vendor, electrical, network) +and extend them locally.

                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                                  DIMENSIONS: {
                                                                                                                                                                                                                                                                      $id: string;
                                                                                                                                                                                                                                                                      description: string;
                                                                                                                                                                                                                                                                      properties: {
                                                                                                                                                                                                                                                                          depth: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                          enclosureRating: { enum: string[]; title: string; type: string };
                                                                                                                                                                                                                                                                          height: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                          unitSystem: {
                                                                                                                                                                                                                                                                              default: string;
                                                                                                                                                                                                                                                                              enum: string[];
                                                                                                                                                                                                                                                                              title: string;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                                                          weight: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                          width: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                                                                      required: string[];
                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  } = ...
                                                                                                                                                                                                                                                                  ELECTRICAL: {
                                                                                                                                                                                                                                                                      $id: string;
                                                                                                                                                                                                                                                                      description: string;
                                                                                                                                                                                                                                                                      properties: {
                                                                                                                                                                                                                                                                          currentMax: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                          powerActive: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                          powerSleep: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                          voltageMax: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                          voltageMin: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                          voltageNominal: { minimum: number; title: string; type: string };
                                                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  } = ...
                                                                                                                                                                                                                                                                  NETWORK: {
                                                                                                                                                                                                                                                                      $id: string;
                                                                                                                                                                                                                                                                      description: string;
                                                                                                                                                                                                                                                                      properties: {
                                                                                                                                                                                                                                                                          eth: {
                                                                                                                                                                                                                                                                              $id: string;
                                                                                                                                                                                                                                                                              properties: {
                                                                                                                                                                                                                                                                                  macAddress: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                                  poeSupported: { default: boolean; title: string; type: string };
                                                                                                                                                                                                                                                                                  speed: { enum: number[]; title: string; type: string };
                                                                                                                                                                                                                                                                              };
                                                                                                                                                                                                                                                                              title: string;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                                                          gsm: {
                                                                                                                                                                                                                                                                              $id: string;
                                                                                                                                                                                                                                                                              properties: {
                                                                                                                                                                                                                                                                                  iccid: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                                  imei: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                                  technologies: {
                                                                                                                                                                                                                                                                                      items: { enum: string[]; type: string };
                                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                  };
                                                                                                                                                                                                                                                                              };
                                                                                                                                                                                                                                                                              title: string;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                                                          lorawan: {
                                                                                                                                                                                                                                                                              $id: string;
                                                                                                                                                                                                                                                                              properties: {
                                                                                                                                                                                                                                                                                  activationMode: {
                                                                                                                                                                                                                                                                                      default: string;
                                                                                                                                                                                                                                                                                      enum: string[];
                                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                  };
                                                                                                                                                                                                                                                                                  appEui: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                                  devEui: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                                  frequencyBand: { enum: string[]; title: string; type: string };
                                                                                                                                                                                                                                                                              };
                                                                                                                                                                                                                                                                              title: string;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                                                          powerSource: { enum: string[]; title: string; type: string };
                                                                                                                                                                                                                                                                          wifi: {
                                                                                                                                                                                                                                                                              $id: string;
                                                                                                                                                                                                                                                                              properties: {
                                                                                                                                                                                                                                                                                  frequencyBands: {
                                                                                                                                                                                                                                                                                      items: { enum: string[]; type: string };
                                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                  };
                                                                                                                                                                                                                                                                                  macAddress: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                                  supportedStandards: {
                                                                                                                                                                                                                                                                                      items: { enum: string[]; type: string };
                                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                  };
                                                                                                                                                                                                                                                                              };
                                                                                                                                                                                                                                                                              title: string;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  } = ...
                                                                                                                                                                                                                                                                  NETWORK_ETH: {
                                                                                                                                                                                                                                                                      $id: string;
                                                                                                                                                                                                                                                                      properties: {
                                                                                                                                                                                                                                                                          macAddress: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                          poeSupported: { default: boolean; title: string; type: string };
                                                                                                                                                                                                                                                                          speed: { enum: number[]; title: string; type: string };
                                                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  } = ...
                                                                                                                                                                                                                                                                  NETWORK_GSM: {
                                                                                                                                                                                                                                                                      $id: string;
                                                                                                                                                                                                                                                                      properties: {
                                                                                                                                                                                                                                                                          iccid: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                          imei: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                          technologies: {
                                                                                                                                                                                                                                                                              items: { enum: string[]; type: string };
                                                                                                                                                                                                                                                                              title: string;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  } = ...
                                                                                                                                                                                                                                                                  NETWORK_LORAWAN: {
                                                                                                                                                                                                                                                                      $id: string;
                                                                                                                                                                                                                                                                      properties: {
                                                                                                                                                                                                                                                                          activationMode: {
                                                                                                                                                                                                                                                                              default: string;
                                                                                                                                                                                                                                                                              enum: string[];
                                                                                                                                                                                                                                                                              title: string;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                                                          appEui: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                          devEui: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                          frequencyBand: { enum: string[]; title: string; type: string };
                                                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  } = ...
                                                                                                                                                                                                                                                                  NETWORK_WIFI: {
                                                                                                                                                                                                                                                                      $id: string;
                                                                                                                                                                                                                                                                      properties: {
                                                                                                                                                                                                                                                                          frequencyBands: {
                                                                                                                                                                                                                                                                              items: { enum: string[]; type: string };
                                                                                                                                                                                                                                                                              title: string;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                                                          macAddress: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                          supportedStandards: {
                                                                                                                                                                                                                                                                              items: { enum: string[]; type: string };
                                                                                                                                                                                                                                                                              title: string;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          };
                                                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  } = ...
                                                                                                                                                                                                                                                                  VENDOR: {
                                                                                                                                                                                                                                                                      $id: string;
                                                                                                                                                                                                                                                                      description: string;
                                                                                                                                                                                                                                                                      properties: {
                                                                                                                                                                                                                                                                          eolDate: { format: string; title: string; type: string };
                                                                                                                                                                                                                                                                          releaseDate: { format: string; title: string; type: string };
                                                                                                                                                                                                                                                                          status: { default: string; enum: string[]; title: string; type: string };
                                                                                                                                                                                                                                                                          vendorSku: { title: string; type: string };
                                                                                                                                                                                                                                                                          vendorUri: { pattern: string; title: string; type: string };
                                                                                                                                                                                                                                                                      };
                                                                                                                                                                                                                                                                      required: string[];
                                                                                                                                                                                                                                                                      title: string;
                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                  } = ...

                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                  • Parameters

                                                                                                                                                                                                                                                                    • groupId: string

                                                                                                                                                                                                                                                                    Returns Record<string, unknown> | undefined

                                                                                                                                                                                                                                                                  • Parameters

                                                                                                                                                                                                                                                                    • groupId: string
                                                                                                                                                                                                                                                                    • schema: Record<string, unknown>

                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_mdm.MockMdmAdapter.html b/docs/public/api-reference/classes/_quatrain_mdm.MockMdmAdapter.html new file mode 100644 index 00000000..26a9662c --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.MockMdmAdapter.html @@ -0,0 +1,100 @@ +MockMdmAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                    Class MockMdmAdapter

                                                                                                                                                                                                                                                                    Mock MDM Adapter for unit testing and offline development

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                                    _alias: string = 'default'
                                                                                                                                                                                                                                                                    classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                                                    Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                    logger: AbstractLoggerAdapter = ...

                                                                                                                                                                                                                                                                    Active logger instance for the Core domain.

                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                    logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                                                    System-wide base log verbosity.

                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                    me: string = ...

                                                                                                                                                                                                                                                                    Identifying namespace for this core component.

                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                    storage: typeof NodePersist = persist

                                                                                                                                                                                                                                                                    Persistent key-value storage engine reference.

                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                    storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                                                    Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                    Accessors

                                                                                                                                                                                                                                                                    • get userClass(): any

                                                                                                                                                                                                                                                                      Returns any

                                                                                                                                                                                                                                                                    • set userClass(cls: any): void

                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                      • cls: any

                                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                                    • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                      • name: string

                                                                                                                                                                                                                                                                        Semantic registry name.

                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                      • obj: any

                                                                                                                                                                                                                                                                        Class constructor.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                                    • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                      • key: string

                                                                                                                                                                                                                                                                        Identification string.

                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                      • value: any

                                                                                                                                                                                                                                                                        Value.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                      Returns Promise<void>

                                                                                                                                                                                                                                                                    • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                      • alias: string = ...

                                                                                                                                                                                                                                                                        The logging context name.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                      Returns any

                                                                                                                                                                                                                                                                      Instantiated LoggerAdapter.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                    • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                      • key: string

                                                                                                                                                                                                                                                                        The property block to generate.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                      Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                                                      Field definitions block.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                    • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                      • name: string

                                                                                                                                                                                                                                                                        The semantic name to resolve.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                      Returns any

                                                                                                                                                                                                                                                                      Class definition.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                    • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                      • key: string

                                                                                                                                                                                                                                                                        The target identifier.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                      Returns Promise<any>

                                                                                                                                                                                                                                                                      The recovered value.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                    • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                      • command: string

                                                                                                                                                                                                                                                                        The executable.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                      Returns Promise<string>

                                                                                                                                                                                                                                                                      The resolved system path.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                    • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                      • seconds: number = 1

                                                                                                                                                                                                                                                                        Duration count.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                      Returns Promise<unknown>

                                                                                                                                                                                                                                                                      The promise to await.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_mdm.ObjectVendor.html b/docs/public/api-reference/classes/_quatrain_mdm.ObjectVendor.html new file mode 100644 index 00000000..fe5bff9f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.ObjectVendor.html @@ -0,0 +1,101 @@ +ObjectVendor | Quatrain Core Documentation
                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                      Class ObjectVendor

                                                                                                                                                                                                                                                                      Junction entity carrying the relationship between an MDM Object and a Vendor. +Stores object-vendor specific metadata (vendorSku, role, primary flag).

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                                      _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                      _repositoryInstance: any = null
                                                                                                                                                                                                                                                                      COLLECTION: string = 'object_vendors'

                                                                                                                                                                                                                                                                      The backend identifier (table or collection name) representing this class.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                      LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                      Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                      PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                      The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                      PROPS_DEFINITION: (
                                                                                                                                                                                                                                                                          | {
                                                                                                                                                                                                                                                                              default?: undefined;
                                                                                                                                                                                                                                                                              instanceOf?: undefined;
                                                                                                                                                                                                                                                                              name: string;
                                                                                                                                                                                                                                                                              required: boolean;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                          | {
                                                                                                                                                                                                                                                                              default?: undefined;
                                                                                                                                                                                                                                                                              instanceOf: string;
                                                                                                                                                                                                                                                                              name: string;
                                                                                                                                                                                                                                                                              required: boolean;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                          | {
                                                                                                                                                                                                                                                                              default?: undefined;
                                                                                                                                                                                                                                                                              instanceOf: typeof Vendor;
                                                                                                                                                                                                                                                                              name: string;
                                                                                                                                                                                                                                                                              required: boolean;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                          | {
                                                                                                                                                                                                                                                                              default: string;
                                                                                                                                                                                                                                                                              instanceOf?: undefined;
                                                                                                                                                                                                                                                                              name: string;
                                                                                                                                                                                                                                                                              required: boolean;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                          | {
                                                                                                                                                                                                                                                                              default: boolean;
                                                                                                                                                                                                                                                                              instanceOf?: undefined;
                                                                                                                                                                                                                                                                              name: string;
                                                                                                                                                                                                                                                                              required: boolean;
                                                                                                                                                                                                                                                                              type: string;
                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                      )[] = ...

                                                                                                                                                                                                                                                                      The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                      REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                      The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                      Accessors

                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                      • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                        • hardDelete: boolean = false

                                                                                                                                                                                                                                                                          If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                        Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                        A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                      • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                        • obj: any

                                                                                                                                                                                                                                                                          The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                        Returns Query<any>

                                                                                                                                                                                                                                                                        A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                      • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                        • src: string | ObjectUri | undefined = undefined

                                                                                                                                                                                                                                                                          The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                        • child: any = ...

                                                                                                                                                                                                                                                                          The specific child class constructor to instantiate.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                        Returns Promise<any>

                                                                                                                                                                                                                                                                        A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                        If instantiation fails.

                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                      • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                        Type Parameters

                                                                                                                                                                                                                                                                        • T

                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                        • path: string

                                                                                                                                                                                                                                                                          The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                        Returns Promise<T>

                                                                                                                                                                                                                                                                        A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_mdm.ObjectVendorRepository.html b/docs/public/api-reference/classes/_quatrain_mdm.ObjectVendorRepository.html new file mode 100644 index 00000000..1569e498 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.ObjectVendorRepository.html @@ -0,0 +1,36 @@ +ObjectVendorRepository | Quatrain Core Documentation
                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                        Class ObjectVendorRepository

                                                                                                                                                                                                                                                                        Repository for ObjectVendor relationship records

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                                        _model: typeof PersistedBaseObject
                                                                                                                                                                                                                                                                        backendAdapter: BackendInterface

                                                                                                                                                                                                                                                                        The specific backend adapter designated for this repository's requests.

                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                        COLLECTION_NAME: "object_vendors" = 'object_vendors'
                                                                                                                                                                                                                                                                        useDateFormat: boolean = true

                                                                                                                                                                                                                                                                        Toggle indicating whether to automatically parse formats natively as Date.

                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                        Accessors

                                                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_mdm.Specification.html b/docs/public/api-reference/classes/_quatrain_mdm.Specification.html new file mode 100644 index 00000000..ed4182bc --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.Specification.html @@ -0,0 +1,101 @@ +Specification | Quatrain Core Documentation
                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                          Class Specification

                                                                                                                                                                                                                                                                          Class representing an individual MDM Object Specification entry. +Inherits from Quatrain Core PersistedBaseObject.

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                                                                          _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                          _repositoryInstance: any = null
                                                                                                                                                                                                                                                                          COLLECTION: string = 'specifications'

                                                                                                                                                                                                                                                                          The backend identifier (table or collection name) representing this class.

                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                          LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                          Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                          PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                          The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                          PROPS_DEFINITION: (
                                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                                  default?: undefined;
                                                                                                                                                                                                                                                                                  instanceOf?: undefined;
                                                                                                                                                                                                                                                                                  name: string;
                                                                                                                                                                                                                                                                                  required: boolean;
                                                                                                                                                                                                                                                                                  type: string;
                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                                  default: boolean;
                                                                                                                                                                                                                                                                                  instanceOf?: undefined;
                                                                                                                                                                                                                                                                                  name: string;
                                                                                                                                                                                                                                                                                  required: boolean;
                                                                                                                                                                                                                                                                                  type: string;
                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                              | {
                                                                                                                                                                                                                                                                                  default?: undefined;
                                                                                                                                                                                                                                                                                  instanceOf: string;
                                                                                                                                                                                                                                                                                  name: string;
                                                                                                                                                                                                                                                                                  required: boolean;
                                                                                                                                                                                                                                                                                  type: string;
                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                          )[] = ...

                                                                                                                                                                                                                                                                          The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                          REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                          The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                          Accessors

                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                          • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                            • hardDelete: boolean = false

                                                                                                                                                                                                                                                                              If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                            Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                            A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                          • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                            • obj: any

                                                                                                                                                                                                                                                                              The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                            Returns Query<any>

                                                                                                                                                                                                                                                                            A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                          • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                            • src: string | ObjectUri | undefined = undefined

                                                                                                                                                                                                                                                                              The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                            • child: any = ...

                                                                                                                                                                                                                                                                              The specific child class constructor to instantiate.

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                            Returns Promise<any>

                                                                                                                                                                                                                                                                            A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            If instantiation fails.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                          • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Type Parameters

                                                                                                                                                                                                                                                                            • T

                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                            • path: string

                                                                                                                                                                                                                                                                              The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                            Returns Promise<T>

                                                                                                                                                                                                                                                                            A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_mdm.SpecificationRepository.html b/docs/public/api-reference/classes/_quatrain_mdm.SpecificationRepository.html new file mode 100644 index 00000000..ee881f12 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.SpecificationRepository.html @@ -0,0 +1,36 @@ +SpecificationRepository | Quatrain Core Documentation
                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                            Class SpecificationRepository

                                                                                                                                                                                                                                                                            Repository for Specification subcollection items

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                            Properties

                                                                                                                                                                                                                                                                            _model: typeof PersistedBaseObject
                                                                                                                                                                                                                                                                            backendAdapter: BackendInterface

                                                                                                                                                                                                                                                                            The specific backend adapter designated for this repository's requests.

                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                            COLLECTION_NAME: "specifications" = 'specifications'
                                                                                                                                                                                                                                                                            useDateFormat: boolean = true

                                                                                                                                                                                                                                                                            Toggle indicating whether to automatically parse formats natively as Date.

                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                            Accessors

                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_mdm.TeeShirt.html b/docs/public/api-reference/classes/_quatrain_mdm.TeeShirt.html new file mode 100644 index 00000000..3cd39316 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.TeeShirt.html @@ -0,0 +1,133 @@ +TeeShirt | Quatrain Core Documentation
                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                              Class TeeShirt

                                                                                                                                                                                                                                                                              Concrete TeeShirt Model Class (Extends Garment)

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                              Properties

                                                                                                                                                                                                                                                                              _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                              _objectVendorsList: ObjectVendor[] = []
                                                                                                                                                                                                                                                                              _specificationsMap: Map<string, Specification> = ...
                                                                                                                                                                                                                                                                              _repositoryInstance: any = null
                                                                                                                                                                                                                                                                              COLLECTION: string = 'tshirts'

                                                                                                                                                                                                                                                                              The backend identifier (table or collection name) representing this class.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                              Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                              The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              PROPS_DEFINITION: (
                                                                                                                                                                                                                                                                                  | {
                                                                                                                                                                                                                                                                                      default?: undefined;
                                                                                                                                                                                                                                                                                      instanceOf?: undefined;
                                                                                                                                                                                                                                                                                      name: string;
                                                                                                                                                                                                                                                                                      parentKey?: undefined;
                                                                                                                                                                                                                                                                                      required: boolean;
                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                  | {
                                                                                                                                                                                                                                                                                      default: string;
                                                                                                                                                                                                                                                                                      instanceOf?: undefined;
                                                                                                                                                                                                                                                                                      name: string;
                                                                                                                                                                                                                                                                                      parentKey?: undefined;
                                                                                                                                                                                                                                                                                      required: boolean;
                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                  | {
                                                                                                                                                                                                                                                                                      default?: undefined;
                                                                                                                                                                                                                                                                                      instanceOf: string;
                                                                                                                                                                                                                                                                                      name: string;
                                                                                                                                                                                                                                                                                      parentKey?: undefined;
                                                                                                                                                                                                                                                                                      required: boolean;
                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                                  | {
                                                                                                                                                                                                                                                                                      default?: undefined;
                                                                                                                                                                                                                                                                                      instanceOf: typeof ObjectVendor;
                                                                                                                                                                                                                                                                                      name: string;
                                                                                                                                                                                                                                                                                      parentKey: string;
                                                                                                                                                                                                                                                                                      required?: undefined;
                                                                                                                                                                                                                                                                                      type: string;
                                                                                                                                                                                                                                                                                  }
                                                                                                                                                                                                                                                                              )[] = ...

                                                                                                                                                                                                                                                                              The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                              REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                              The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                              Accessors

                                                                                                                                                                                                                                                                              • get specificationsCollectionName(): string

                                                                                                                                                                                                                                                                                Returns the subcollection path for Specifications attached to this parent object. +Scheme: //specifications

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Returns string

                                                                                                                                                                                                                                                                              • get specificationsObject(): Record<string, any>

                                                                                                                                                                                                                                                                                Returns a plain key-value object of all specifications for interface casting and validation.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Returns Record<string, any>

                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                              • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                  If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                • obj: any

                                                                                                                                                                                                                                                                                  The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                Returns Query<any>

                                                                                                                                                                                                                                                                                A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • Persists the current state of the object to the configured backend database. +Triggers creation or update operations depending on whether the object already exists.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Returns Promise<TeeShirt>

                                                                                                                                                                                                                                                                                A promise resolving to the instance itself for chaining.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • Proxies a set command to the underlying data object.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                • key: string

                                                                                                                                                                                                                                                                                  The property key.

                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                • val: any

                                                                                                                                                                                                                                                                                  The value to assign.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                Returns any

                                                                                                                                                                                                                                                                                The DataObject instance for chaining.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • Validates that the current instance specifications comply with the archetype's required and optional properties.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Returns boolean

                                                                                                                                                                                                                                                                                True if valid; throws error if required specification properties are missing.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                • src: string | ObjectUri | undefined = undefined

                                                                                                                                                                                                                                                                                  The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                • child: any = ...

                                                                                                                                                                                                                                                                                  The specific child class constructor to instantiate.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                                                                                                                                A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                If instantiation fails.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Type Parameters

                                                                                                                                                                                                                                                                                • T

                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                • path: string

                                                                                                                                                                                                                                                                                  The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                Returns Promise<T>

                                                                                                                                                                                                                                                                                A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              • Looks up a property definition by its name from the merged PROPS_DEFINITION.

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                • key: string

                                                                                                                                                                                                                                                                                  The property name.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                Returns any

                                                                                                                                                                                                                                                                                The property definition object if found.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_mdm.Vendor.html b/docs/public/api-reference/classes/_quatrain_mdm.Vendor.html new file mode 100644 index 00000000..7e901abf --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.Vendor.html @@ -0,0 +1,101 @@ +Vendor | Quatrain Core Documentation
                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                Top-level Vendor entity representing a manufacturer, supplier, distributor, or brand. +Independent entity without parent property (associated to MDM objects via ObjectVendor).

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                COLLECTION: string = 'vendors'

                                                                                                                                                                                                                                                                                The backend identifier (table or collection name) representing this class.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                PROPS_DEFINITION: (
                                                                                                                                                                                                                                                                                    | { default?: undefined; name: string; required: boolean; type: string }
                                                                                                                                                                                                                                                                                    | { default: {}; name: string; required: boolean; type: string }
                                                                                                                                                                                                                                                                                )[] = ...

                                                                                                                                                                                                                                                                                The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                Accessors

                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                  • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                    If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                  Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                  A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                  • obj: any

                                                                                                                                                                                                                                                                                    The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                  Returns Query<any>

                                                                                                                                                                                                                                                                                  A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                  • src: string | ObjectUri | undefined = undefined

                                                                                                                                                                                                                                                                                    The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                  • child: any = ...

                                                                                                                                                                                                                                                                                    The specific child class constructor to instantiate.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                  Returns Promise<any>

                                                                                                                                                                                                                                                                                  A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                  If instantiation fails.

                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                  Type Parameters

                                                                                                                                                                                                                                                                                  • T

                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                  • path: string

                                                                                                                                                                                                                                                                                    The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                  Returns Promise<T>

                                                                                                                                                                                                                                                                                  A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_mdm.VendorRepository.html b/docs/public/api-reference/classes/_quatrain_mdm.VendorRepository.html new file mode 100644 index 00000000..bda48ea9 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.VendorRepository.html @@ -0,0 +1,36 @@ +VendorRepository | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                  Class VendorRepository

                                                                                                                                                                                                                                                                                  Repository for Vendor entities

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                                                  _model: typeof PersistedBaseObject
                                                                                                                                                                                                                                                                                  backendAdapter: BackendInterface

                                                                                                                                                                                                                                                                                  The specific backend adapter designated for this repository's requests.

                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                  COLLECTION_NAME: "vendors" = 'vendors'
                                                                                                                                                                                                                                                                                  useDateFormat: boolean = true

                                                                                                                                                                                                                                                                                  Toggle indicating whether to automatically parse formats natively as Date.

                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                  Accessors

                                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_mdm.VirtualKeychain.html b/docs/public/api-reference/classes/_quatrain_mdm.VirtualKeychain.html new file mode 100644 index 00000000..a31d9c8f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_mdm.VirtualKeychain.html @@ -0,0 +1,134 @@ +VirtualKeychain | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                    Class VirtualKeychain

                                                                                                                                                                                                                                                                                    Concrete Virtual Keychain MDM Object Class (Extends AbstractMdmObject) +Enforces VirtualKeychainSpecInterface over child Specification collection.

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                                                    _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                    _objectVendorsList: ObjectVendor[] = []
                                                                                                                                                                                                                                                                                    _specificationsMap: Map<string, Specification> = ...
                                                                                                                                                                                                                                                                                    _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                    COLLECTION: string = 'keychains'

                                                                                                                                                                                                                                                                                    The backend identifier (table or collection name) representing this class.

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                    Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                    The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    PROPS_DEFINITION: (
                                                                                                                                                                                                                                                                                        | {
                                                                                                                                                                                                                                                                                            default?: undefined;
                                                                                                                                                                                                                                                                                            instanceOf?: undefined;
                                                                                                                                                                                                                                                                                            name: string;
                                                                                                                                                                                                                                                                                            parentKey?: undefined;
                                                                                                                                                                                                                                                                                            required: boolean;
                                                                                                                                                                                                                                                                                            type: string;
                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                        | {
                                                                                                                                                                                                                                                                                            default: string;
                                                                                                                                                                                                                                                                                            instanceOf?: undefined;
                                                                                                                                                                                                                                                                                            name: string;
                                                                                                                                                                                                                                                                                            parentKey?: undefined;
                                                                                                                                                                                                                                                                                            required: boolean;
                                                                                                                                                                                                                                                                                            type: string;
                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                        | {
                                                                                                                                                                                                                                                                                            default?: undefined;
                                                                                                                                                                                                                                                                                            instanceOf: string;
                                                                                                                                                                                                                                                                                            name: string;
                                                                                                                                                                                                                                                                                            parentKey?: undefined;
                                                                                                                                                                                                                                                                                            required: boolean;
                                                                                                                                                                                                                                                                                            type: string;
                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                        | {
                                                                                                                                                                                                                                                                                            default?: undefined;
                                                                                                                                                                                                                                                                                            instanceOf: typeof ObjectVendor;
                                                                                                                                                                                                                                                                                            name: string;
                                                                                                                                                                                                                                                                                            parentKey: string;
                                                                                                                                                                                                                                                                                            required?: undefined;
                                                                                                                                                                                                                                                                                            type: string;
                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                    )[] = ...

                                                                                                                                                                                                                                                                                    The overarching property schema definition inherited and merged from BaseObject.

                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                    REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                    The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                    Accessors

                                                                                                                                                                                                                                                                                    • get specificationsCollectionName(): string

                                                                                                                                                                                                                                                                                      Returns the subcollection path for Specifications attached to this parent object. +Scheme: //specifications

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Returns string

                                                                                                                                                                                                                                                                                    • get specificationsObject(): Record<string, any>

                                                                                                                                                                                                                                                                                      Returns a plain key-value object of all specifications for interface casting and validation.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Returns Record<string, any>

                                                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                                                    • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                      • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                        If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                      Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                      A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                      • obj: any

                                                                                                                                                                                                                                                                                        The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                      Returns Query<any>

                                                                                                                                                                                                                                                                                      A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • Dynamically builds an instance of the class. It can hydrate from a raw data object, +an ObjectUri, or a backend string path.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                      • src: string | ObjectUri | undefined = undefined

                                                                                                                                                                                                                                                                                        The source data: a string path, an ObjectUri, or raw object data.

                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                      • child: any = ...

                                                                                                                                                                                                                                                                                        The specific child class constructor to instantiate.

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                      Returns Promise<any>

                                                                                                                                                                                                                                                                                      A promise resolving to the fully constructed and hydrated model instance.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      If instantiation fails.

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Type Parameters

                                                                                                                                                                                                                                                                                      • T

                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                      • path: string

                                                                                                                                                                                                                                                                                        The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                      Returns Promise<T>

                                                                                                                                                                                                                                                                                      A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_messaging-firebase.FirebaseMessagingAdapter.html b/docs/public/api-reference/classes/_quatrain_messaging-firebase.FirebaseMessagingAdapter.html new file mode 100644 index 00000000..88b4b0c4 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_messaging-firebase.FirebaseMessagingAdapter.html @@ -0,0 +1,17 @@ +FirebaseMessagingAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                      Implementation to send Firebase Cloud Messaging (FCM) notifications using firebase-admin.

                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                      Implements

                                                                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                                                      _messaging: any
                                                                                                                                                                                                                                                                                      _params: MessagingParameters = {}

                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_messaging.AbstractMessagingAdapter.html b/docs/public/api-reference/classes/_quatrain_messaging.AbstractMessagingAdapter.html new file mode 100644 index 00000000..8961fef2 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_messaging.AbstractMessagingAdapter.html @@ -0,0 +1,5 @@ +AbstractMessagingAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                        Class AbstractMessagingAdapterAbstract

                                                                                                                                                                                                                                                                                        Base class contract enforcing setup logic across all messaging capabilities +(Email, SMS, Push Notifications).

                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                                                        _params: MessagingParameters = {}
                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_messaging.MessageFormatter.html b/docs/public/api-reference/classes/_quatrain_messaging.MessageFormatter.html new file mode 100644 index 00000000..6e90fcb3 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_messaging.MessageFormatter.html @@ -0,0 +1,14 @@ +MessageFormatter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                          Specialized utility handling string cleanup and Mustache interpolation for templates.

                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                                          • Renders the Mustache layout with provided contextual variables.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                                            • body: string

                                                                                                                                                                                                                                                                                              The markdown/HTML layout.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                            • Optionaldata: {}

                                                                                                                                                                                                                                                                                              The variables context map.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                            Returns string

                                                                                                                                                                                                                                                                                            Parsed output string.

                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                          • Cleans all HTML tags from the title string. +This uses a robust, RegExp-free state loop to prevent any risk of Regular Expression +Denial of Service (ReDoS) or catastrophic backtracking, fully satisfying SonarQube security rules.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                                            • title: string

                                                                                                                                                                                                                                                                                              The raw subject line containing potential HTML tags.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                            Returns string

                                                                                                                                                                                                                                                                                            The formatted title string with all HTML tags stripped out.

                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_messaging.Messaging.html b/docs/public/api-reference/classes/_quatrain_messaging.Messaging.html new file mode 100644 index 00000000..7e3fb07f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_messaging.Messaging.html @@ -0,0 +1,91 @@ +Messaging | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                            Singleton Registry dispatching text messages, emails, or push notifications.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                                            Properties

                                                                                                                                                                                                                                                                                            _messagers: MessagingRegistry<any> = {}
                                                                                                                                                                                                                                                                                            classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                                                                            Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                            defaultMessager: string = 'default'

                                                                                                                                                                                                                                                                                            The alias for the primary fallback messager instance.

                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                            logger: any = ...

                                                                                                                                                                                                                                                                                            Scoped domain logger.

                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                            logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                                                                            System-wide base log verbosity.

                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                            me: string = ...

                                                                                                                                                                                                                                                                                            Identifying namespace for this core component.

                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                            storage: typeof NodePersist = persist

                                                                                                                                                                                                                                                                                            Persistent key-value storage engine reference.

                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                            storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                                                                            Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                            Accessors

                                                                                                                                                                                                                                                                                            • get userClass(): any

                                                                                                                                                                                                                                                                                              Returns any

                                                                                                                                                                                                                                                                                            • set userClass(cls: any): void

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • cls: any

                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                                            • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • name: string

                                                                                                                                                                                                                                                                                                Semantic registry name.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                              • obj: any

                                                                                                                                                                                                                                                                                                Class constructor.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                            • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • key: string

                                                                                                                                                                                                                                                                                                Identification string.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                              • value: any

                                                                                                                                                                                                                                                                                                Value.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns Promise<void>

                                                                                                                                                                                                                                                                                            • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • alias: string = ...

                                                                                                                                                                                                                                                                                                The logging context name.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns any

                                                                                                                                                                                                                                                                                              Instantiated LoggerAdapter.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                            • Triggers a debug log on the core logger.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                            • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • key: string

                                                                                                                                                                                                                                                                                                The property block to generate.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                                                                              Field definitions block.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                            • Triggers an error log on the core logger.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                            • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • name: string

                                                                                                                                                                                                                                                                                                The semantic name to resolve.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns any

                                                                                                                                                                                                                                                                                              Class definition.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                            • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • key: string

                                                                                                                                                                                                                                                                                                The target identifier.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns Promise<any>

                                                                                                                                                                                                                                                                                              The recovered value.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                            • Recovers a registered messager by alias.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • alias: string = ...

                                                                                                                                                                                                                                                                                                The name identifier.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns any

                                                                                                                                                                                                                                                                                              The requested messaging provider.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              If the alias was never registered.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                            • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • command: string

                                                                                                                                                                                                                                                                                                The executable.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns Promise<string>

                                                                                                                                                                                                                                                                                              The resolved system path.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                            • Triggers an info log on the core logger.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                            • Triggers a standard log on the core logger.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                            • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • seconds: number = 1

                                                                                                                                                                                                                                                                                                Duration count.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns Promise<unknown>

                                                                                                                                                                                                                                                                                              The promise to await.

                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                            • Triggers a trace log on the core logger.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                            • Triggers a warning log on the core logger.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                              • ...message: any

                                                                                                                                                                                                                                                                                                Content to log.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_okf.OKFBackendAdapter.html b/docs/public/api-reference/classes/_quatrain_okf.OKFBackendAdapter.html new file mode 100644 index 00000000..a6f145f8 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_okf.OKFBackendAdapter.html @@ -0,0 +1,128 @@ +OKFBackendAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                              Class OKFBackendAdapter

                                                                                                                                                                                                                                                                                              File-based persistence adapter conforming to the Open Knowledge Format (OKF) standard. +Serializes entities into flat directory layouts, optionally delegating to a Storage Adapter.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                              Properties

                                                                                                                                                                                                                                                                                              _alias: string = ''
                                                                                                                                                                                                                                                                                              _middlewares: BM[] = []
                                                                                                                                                                                                                                                                                              _params: BackendParameters = {}
                                                                                                                                                                                                                                                                                              dataDir: string
                                                                                                                                                                                                                                                                                              storage: AbstractStorageAdapter | null = null
                                                                                                                                                                                                                                                                                              PKEY_IDENTIFIER: any = 'id'

                                                                                                                                                                                                                                                                                              The string identifier for primary keys, mapped to 'id' by default.

                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                              Accessors

                                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                              • Attaches a new middleware to the adapter's execution pipeline. +Middlewares are triggered before or after database actions.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                • middleware: BM

                                                                                                                                                                                                                                                                                                  The instantiated middleware to attach.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                If a middleware with the same class name is already attached.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                              • Executes an aggregation operation (sum, avg, distinct, min, max, count) on a query. +The default implementation fetches all matching records and performs in-memory aggregation. +Specific database adapters should override this to perform native query aggregation.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                • query: Query<any>

                                                                                                                                                                                                                                                                                                  The Query instance defining the collection and filters.

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                • operation: "sum" | "avg" | "distinct" | "min" | "max" | "count"

                                                                                                                                                                                                                                                                                                  The aggregate operation.

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                • Optionalproperty: string

                                                                                                                                                                                                                                                                                                  The name of the property to aggregate.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                                                                                                                                                A promise resolving to the aggregated result.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                              • Parameters

                                                                                                                                                                                                                                                                                                • content: string
                                                                                                                                                                                                                                                                                                • relativePath: string

                                                                                                                                                                                                                                                                                                Returns any

                                                                                                                                                                                                                                                                                              • Evaluates active query filters against a single DataObject instance in memory. +Supports advanced operator comparisons (equals, contains, containsAny, etc.).

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                Returns boolean

                                                                                                                                                                                                                                                                                                true if the object matches all criteria, false otherwise.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                              • Parses markdown body to extract all internal hyperlinks (Obsidian-style [[WikiLinks]] or markdown Label links).

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                • body: string

                                                                                                                                                                                                                                                                                                  The markdown text content.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                Returns string[]

                                                                                                                                                                                                                                                                                                Array of unique target slugs or paths.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                              • Parameters

                                                                                                                                                                                                                                                                                                • collection: string
                                                                                                                                                                                                                                                                                                • filename: string

                                                                                                                                                                                                                                                                                                Returns Promise<string | null>

                                                                                                                                                                                                                                                                                              • Parameters

                                                                                                                                                                                                                                                                                                • ref: string
                                                                                                                                                                                                                                                                                                • Optionalmime: string

                                                                                                                                                                                                                                                                                                Returns { bucket: string; mime: string | undefined; name: string; ref: string }

                                                                                                                                                                                                                                                                                              • Resolves the relative storage path matching the OKF collection and metadata hierarchy. +For telemetry: telemetry/YYYY-MM-DD/{type}/{HHMMSS}-{millis}-{bassinId}.json +For other: {collection}/{uid}.json

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                • dao: DataObjectClass<any>

                                                                                                                                                                                                                                                                                                  The data object model being persisted.

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                • uid: string

                                                                                                                                                                                                                                                                                                  The unique identifier of the record.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                Returns string

                                                                                                                                                                                                                                                                                                The relative file path string.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                              • Outputs an adapter-level diagnostic message to the console if debug mode is enabled.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                • message: string

                                                                                                                                                                                                                                                                                                  The textual content to log.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                Use Backend.debug() or Backend.log() (which itself is deprecated in favor of specific levels) instead.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                              • Resolves incoming backlinks pointing to the target UID by scanning the collection.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                • collection: string

                                                                                                                                                                                                                                                                                                  The collection name.

                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                • targetUid: string

                                                                                                                                                                                                                                                                                                  The UID of the target document.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                Returns Promise<{ category: string; id: string; title: string }[]>

                                                                                                                                                                                                                                                                                                Array of backlink references { id, title, category }.

                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_queue-amqp.AmqpQueueAdapter.html b/docs/public/api-reference/classes/_quatrain_queue-amqp.AmqpQueueAdapter.html new file mode 100644 index 00000000..7077fa0a --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_queue-amqp.AmqpQueueAdapter.html @@ -0,0 +1,15 @@ +AmqpQueueAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                AMQP Protocol compatible adapter (RabbitMQ, etc.) using amqplib.

                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                                _client: ChannelModel | undefined
                                                                                                                                                                                                                                                                                                _logger: any

                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                • Listen to given queue and process messages with messageHandler function

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                  • topic: string | undefined = ...
                                                                                                                                                                                                                                                                                                  • messageHandler: Function
                                                                                                                                                                                                                                                                                                  • Optionalparams: any

                                                                                                                                                                                                                                                                                                  Returns Promise<Consume>

                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_queue-aws.SqsAdapter.html b/docs/public/api-reference/classes/_quatrain_queue-aws.SqsAdapter.html new file mode 100644 index 00000000..ce70e834 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_queue-aws.SqsAdapter.html @@ -0,0 +1,13 @@ +SqsAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                  Amazon Web Services SQS adapter utilizing the official SDK V3.

                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                                                                  _client: any
                                                                                                                                                                                                                                                                                                  _logger: any

                                                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                                                  • Dispatches the AWS SQS SendMessageCommand.

                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                    • data: any

                                                                                                                                                                                                                                                                                                      Payload.

                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                    • topic: string

                                                                                                                                                                                                                                                                                                      Partial Queue URL / Queue name.

                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                    Returns Promise<string>

                                                                                                                                                                                                                                                                                                    The newly returned MessageId.

                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_queue-sqlite.SQLiteQueueAdapter.html b/docs/public/api-reference/classes/_quatrain_queue-sqlite.SQLiteQueueAdapter.html new file mode 100644 index 00000000..3758052a --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_queue-sqlite.SQLiteQueueAdapter.html @@ -0,0 +1,21 @@ +SQLiteQueueAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                    Blueprint for Queue messaging adapters (AMQP, SQS, PubSub, etc.).

                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                                                                    _client: any
                                                                                                                                                                                                                                                                                                    _connection: Database<Database, Statement> | undefined
                                                                                                                                                                                                                                                                                                    _dbPath: string
                                                                                                                                                                                                                                                                                                    _intervals: Map<string, Timeout> = ...

                                                                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                                                                    • Listens for pending tasks on a topic and runs the handler.

                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                      • topic: string
                                                                                                                                                                                                                                                                                                      • handler: Function
                                                                                                                                                                                                                                                                                                      • Optionalparams: { concurrency?: number; gpu?: boolean }

                                                                                                                                                                                                                                                                                                      Returns any

                                                                                                                                                                                                                                                                                                    • Retries a failed or stuck processing task by setting its status back to pending.

                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                      • taskId: string

                                                                                                                                                                                                                                                                                                      Returns Promise<boolean>

                                                                                                                                                                                                                                                                                                    • Helper to update running task progress.

                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                      • taskId: string
                                                                                                                                                                                                                                                                                                      • progress: number

                                                                                                                                                                                                                                                                                                      Returns Promise<void>

                                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_queue.AbstractQueueAdapter.html b/docs/public/api-reference/classes/_quatrain_queue.AbstractQueueAdapter.html new file mode 100644 index 00000000..af623967 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_queue.AbstractQueueAdapter.html @@ -0,0 +1,15 @@ +AbstractQueueAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                      Class AbstractQueueAdapterAbstract

                                                                                                                                                                                                                                                                                                      Blueprint for Queue messaging adapters (AMQP, SQS, PubSub, etc.).

                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                                                                      _client: any

                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                      • Starts a background listener on a given queue topic.

                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                        • topic: string

                                                                                                                                                                                                                                                                                                          The queue name.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                        • handler: Function

                                                                                                                                                                                                                                                                                                          The callback function.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                        • Optionalparams: { concurrency?: number; gpu?: boolean }

                                                                                                                                                                                                                                                                                                          Execution context options.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                        Returns any

                                                                                                                                                                                                                                                                                                      • Dispatches a payload into a specified queue or topic.

                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                        • data: any

                                                                                                                                                                                                                                                                                                          The payload to send.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                        • topic: string

                                                                                                                                                                                                                                                                                                          The destination topic/queue name.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                        Returns Promise<string>

                                                                                                                                                                                                                                                                                                        The resolved message ID.

                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_queue.Queue.html b/docs/public/api-reference/classes/_quatrain_queue.Queue.html new file mode 100644 index 00000000..5855ac7c --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_queue.Queue.html @@ -0,0 +1,91 @@ +Queue | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                        Singleton Registry dispatching abstract asynchronous tasks.

                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                                                                        _queues: QueueRegistry<any> = {}
                                                                                                                                                                                                                                                                                                        classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                                                                                        Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                        defaultQueue: string = '@default'

                                                                                                                                                                                                                                                                                                        Reference ID for the primary default queue.

                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                        logger: any = ...

                                                                                                                                                                                                                                                                                                        Domain specific Core Logger.

                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                        logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                                                                                        System-wide base log verbosity.

                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                        me: string = ...

                                                                                                                                                                                                                                                                                                        Identifying namespace for this core component.

                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                        storage: typeof NodePersist = persist

                                                                                                                                                                                                                                                                                                        Persistent key-value storage engine reference.

                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                        storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                                                                                        Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                        Accessors

                                                                                                                                                                                                                                                                                                        • get userClass(): any

                                                                                                                                                                                                                                                                                                          Returns any

                                                                                                                                                                                                                                                                                                        • set userClass(cls: any): void

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • cls: any

                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                                                                                        • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • name: string

                                                                                                                                                                                                                                                                                                            Semantic registry name.

                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                          • obj: any

                                                                                                                                                                                                                                                                                                            Class constructor.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                        • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • key: string

                                                                                                                                                                                                                                                                                                            Identification string.

                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                          • value: any

                                                                                                                                                                                                                                                                                                            Value.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns Promise<void>

                                                                                                                                                                                                                                                                                                        • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • alias: string = ...

                                                                                                                                                                                                                                                                                                            The logging context name.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns any

                                                                                                                                                                                                                                                                                                          Instantiated LoggerAdapter.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                        • Appends a new instantiated queue handler logic block into the system map.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • queue: AbstractQueueAdapter

                                                                                                                                                                                                                                                                                                            The underlying provider adapter.

                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                          • alias: string

                                                                                                                                                                                                                                                                                                            The lookup name.

                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                          • setDefault: boolean = false

                                                                                                                                                                                                                                                                                                            True to switch standard queue router.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                        • Triggers a debug log on the core logger.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                        • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • key: string

                                                                                                                                                                                                                                                                                                            The property block to generate.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                                                                                          Field definitions block.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                        • Triggers an error log on the core logger.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                        • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • name: string

                                                                                                                                                                                                                                                                                                            The semantic name to resolve.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns any

                                                                                                                                                                                                                                                                                                          Class definition.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                        • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • key: string

                                                                                                                                                                                                                                                                                                            The target identifier.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns Promise<any>

                                                                                                                                                                                                                                                                                                          The recovered value.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                        • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • command: string

                                                                                                                                                                                                                                                                                                            The executable.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns Promise<string>

                                                                                                                                                                                                                                                                                                          The resolved system path.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                        • Triggers an info log on the core logger.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                        • Triggers a standard log on the core logger.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                        • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • seconds: number = 1

                                                                                                                                                                                                                                                                                                            Duration count.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns Promise<unknown>

                                                                                                                                                                                                                                                                                                          The promise to await.

                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                        • Triggers a trace log on the core logger.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                        • Triggers a warning log on the core logger.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_searchengine-qmd.QmdSearchEngineAdapter.html b/docs/public/api-reference/classes/_quatrain_searchengine-qmd.QmdSearchEngineAdapter.html new file mode 100644 index 00000000..79e98a28 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_searchengine-qmd.QmdSearchEngineAdapter.html @@ -0,0 +1,23 @@ +QmdSearchEngineAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                          Concrete Search Engine Adapter implementing QMD (Query Markup Documents) hybrid search.

                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                                                                                                          Accessors

                                                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_searchengine.AbstractSearchEngineAdapter.html b/docs/public/api-reference/classes/_quatrain_searchengine.AbstractSearchEngineAdapter.html new file mode 100644 index 00000000..1143a4e9 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_searchengine.AbstractSearchEngineAdapter.html @@ -0,0 +1,23 @@ +AbstractSearchEngineAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                                            Class AbstractSearchEngineAdapterAbstract

                                                                                                                                                                                                                                                                                                            Blueprint for Search Engine adapters (QMD, Meilisearch, SQLite FTS, etc.). +Guarantees a unified contract for indexing and hybrid document retrieval.

                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                                                            Properties

                                                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_searchengine.SearchEngine.html b/docs/public/api-reference/classes/_quatrain_searchengine.SearchEngine.html new file mode 100644 index 00000000..89debfd5 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_searchengine.SearchEngine.html @@ -0,0 +1,101 @@ +SearchEngine | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                                              Singleton Registry dispatching document indexing and search operations across configured search engine providers.

                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                                              Properties

                                                                                                                                                                                                                                                                                                              _engines: SearchEngineRegistry<any> = {}
                                                                                                                                                                                                                                                                                                              classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                                                                                              Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                              defaultEngine: string = '@default'

                                                                                                                                                                                                                                                                                                              Reference identifier for the primary default search engine.

                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                              logger: any = ...

                                                                                                                                                                                                                                                                                                              Domain-specific Core Logger instance.

                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                              logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                                                                                              System-wide base log verbosity.

                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                              me: string = ...

                                                                                                                                                                                                                                                                                                              Identifying namespace for this core component.

                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                              storage: typeof NodePersist = persist

                                                                                                                                                                                                                                                                                                              Persistent key-value storage engine reference.

                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                              storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                                                                                              Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                              Accessors

                                                                                                                                                                                                                                                                                                              • get userClass(): any

                                                                                                                                                                                                                                                                                                                Returns any

                                                                                                                                                                                                                                                                                                              • set userClass(cls: any): void

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • cls: any

                                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                                              • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • name: string

                                                                                                                                                                                                                                                                                                                  Semantic registry name.

                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                • obj: any

                                                                                                                                                                                                                                                                                                                  Class constructor.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                              • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • key: string

                                                                                                                                                                                                                                                                                                                  Identification string.

                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                • value: any

                                                                                                                                                                                                                                                                                                                  Value.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns Promise<void>

                                                                                                                                                                                                                                                                                                              • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • alias: string = ...

                                                                                                                                                                                                                                                                                                                  The logging context name.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns any

                                                                                                                                                                                                                                                                                                                Instantiated LoggerAdapter.

                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                              • Triggers a debug log on the core logger.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • ...message: any

                                                                                                                                                                                                                                                                                                                  Content to log.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                              • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • key: string

                                                                                                                                                                                                                                                                                                                  The property block to generate.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                                                                                                Field definitions block.

                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                              • Triggers an error log on the core logger.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • ...message: any

                                                                                                                                                                                                                                                                                                                  Content to log.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                              • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • name: string

                                                                                                                                                                                                                                                                                                                  The semantic name to resolve.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns any

                                                                                                                                                                                                                                                                                                                Class definition.

                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                              • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • key: string

                                                                                                                                                                                                                                                                                                                  The target identifier.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                                                                                                                                                                The recovered value.

                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                              • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • command: string

                                                                                                                                                                                                                                                                                                                  The executable.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns Promise<string>

                                                                                                                                                                                                                                                                                                                The resolved system path.

                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                              • Triggers an info log on the core logger.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • ...message: any

                                                                                                                                                                                                                                                                                                                  Content to log.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                              • Triggers a standard log on the core logger.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • ...message: any

                                                                                                                                                                                                                                                                                                                  Content to log.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                              • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • seconds: number = 1

                                                                                                                                                                                                                                                                                                                  Duration count.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns Promise<unknown>

                                                                                                                                                                                                                                                                                                                The promise to await.

                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                              • Triggers a trace log on the core logger.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • ...message: any

                                                                                                                                                                                                                                                                                                                  Content to log.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                              • Triggers a warning log on the core logger.

                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                • ...message: any

                                                                                                                                                                                                                                                                                                                  Content to log.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_skills.AbstractSkillAdapter.html b/docs/public/api-reference/classes/_quatrain_skills.AbstractSkillAdapter.html new file mode 100644 index 00000000..c22bb219 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_skills.AbstractSkillAdapter.html @@ -0,0 +1,9 @@ +AbstractSkillAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                                Class AbstractSkillAdapterAbstract

                                                                                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                                                Accessors

                                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                                                manifest: SkillManifest

                                                                                                                                                                                                                                                                                                                Accessors

                                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                                • Parameters

                                                                                                                                                                                                                                                                                                                  • toolName: string
                                                                                                                                                                                                                                                                                                                  • params: any

                                                                                                                                                                                                                                                                                                                  Returns Promise<any>

                                                                                                                                                                                                                                                                                                                • Parameters

                                                                                                                                                                                                                                                                                                                  • values: Record<string, any>

                                                                                                                                                                                                                                                                                                                  Returns Promise<{ error?: string; message?: string; success: boolean }>

                                                                                                                                                                                                                                                                                                                • Parameters

                                                                                                                                                                                                                                                                                                                  • values: Record<string, any>

                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_skills.Skills.html b/docs/public/api-reference/classes/_quatrain_skills.Skills.html new file mode 100644 index 00000000..37d98c0d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_skills.Skills.html @@ -0,0 +1,101 @@ +Skills | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                                  Base utility container representing Agent skills logic. +Extends the Quatrain Core framework functionalities.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                                                                                  _adapters: Map<string, AbstractSkillAdapter> = ...
                                                                                                                                                                                                                                                                                                                  _registeredPackages: Map<string, SkillRegistration> = ...
                                                                                                                                                                                                                                                                                                                  classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                                                                                                  Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                  logger: any = ...

                                                                                                                                                                                                                                                                                                                  Active logger instance for the Core domain.

                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                  logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                                                                                                  System-wide base log verbosity.

                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                  me: string = ...

                                                                                                                                                                                                                                                                                                                  Identifying namespace for this core component.

                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                  storage: typeof NodePersist = persist

                                                                                                                                                                                                                                                                                                                  Persistent key-value storage engine reference.

                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                  storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                                                                                                  Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                  Accessors

                                                                                                                                                                                                                                                                                                                  • get userClass(): any

                                                                                                                                                                                                                                                                                                                    Returns any

                                                                                                                                                                                                                                                                                                                  • set userClass(cls: any): void

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • cls: any

                                                                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                                                                  • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • name: string

                                                                                                                                                                                                                                                                                                                      Semantic registry name.

                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                    • obj: any

                                                                                                                                                                                                                                                                                                                      Class constructor.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                                                                  • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • key: string

                                                                                                                                                                                                                                                                                                                      Identification string.

                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                    • value: any

                                                                                                                                                                                                                                                                                                                      Value.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns Promise<void>

                                                                                                                                                                                                                                                                                                                  • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • alias: string = ...

                                                                                                                                                                                                                                                                                                                      The logging context name.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns any

                                                                                                                                                                                                                                                                                                                    Instantiated LoggerAdapter.

                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                  • Triggers a debug log on the core logger.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • ...message: any

                                                                                                                                                                                                                                                                                                                      Content to log.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                                                                  • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • key: string

                                                                                                                                                                                                                                                                                                                      The property block to generate.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                                                                                                    Field definitions block.

                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                  • Triggers an error log on the core logger.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • ...message: any

                                                                                                                                                                                                                                                                                                                      Content to log.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                                                                  • Dispatches tool execution to the matching registered active skill.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • toolName: string
                                                                                                                                                                                                                                                                                                                    • params: any

                                                                                                                                                                                                                                                                                                                    Returns Promise<any>

                                                                                                                                                                                                                                                                                                                  • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • name: string

                                                                                                                                                                                                                                                                                                                      The semantic name to resolve.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns any

                                                                                                                                                                                                                                                                                                                    Class definition.

                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                  • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • key: string

                                                                                                                                                                                                                                                                                                                      The target identifier.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns Promise<any>

                                                                                                                                                                                                                                                                                                                    The recovered value.

                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                  • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • command: string

                                                                                                                                                                                                                                                                                                                      The executable.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns Promise<string>

                                                                                                                                                                                                                                                                                                                    The resolved system path.

                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                  • Check if a skill adapter is active.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • alias: string

                                                                                                                                                                                                                                                                                                                    Returns boolean

                                                                                                                                                                                                                                                                                                                  • Triggers an info log on the core logger.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • ...message: any

                                                                                                                                                                                                                                                                                                                      Content to log.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                                                                  • Triggers a standard log on the core logger.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • ...message: any

                                                                                                                                                                                                                                                                                                                      Content to log.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                                                                  • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • seconds: number = 1

                                                                                                                                                                                                                                                                                                                      Duration count.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns Promise<unknown>

                                                                                                                                                                                                                                                                                                                    The promise to await.

                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                  • Triggers a trace log on the core logger.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • ...message: any

                                                                                                                                                                                                                                                                                                                      Content to log.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                                                                  • Triggers a warning log on the core logger.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • ...message: any

                                                                                                                                                                                                                                                                                                                      Content to log.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                                                                  • Safely writes JSON results to a file, automatically creating parent subfolders.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                    • data: any
                                                                                                                                                                                                                                                                                                                    • filePath: string

                                                                                                                                                                                                                                                                                                                    Returns Promise<void>

                                                                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_state-machine.BaseStateMachine.html b/docs/public/api-reference/classes/_quatrain_state-machine.BaseStateMachine.html new file mode 100644 index 00000000..20e819f1 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_state-machine.BaseStateMachine.html @@ -0,0 +1,18 @@ +BaseStateMachine | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                                    Class BaseStateMachine<TState, TContext>Abstract

                                                                                                                                                                                                                                                                                                                    Base Abstract class representing state machines. +Encapsulates the current state and shared execution context.

                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                    Type Parameters

                                                                                                                                                                                                                                                                                                                    • TState
                                                                                                                                                                                                                                                                                                                    • TContext

                                                                                                                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                                                                                    context: TContext
                                                                                                                                                                                                                                                                                                                    currentState: TState

                                                                                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                                                                                    • Merges new properties into the state machine's execution context.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                      • newContext: Partial<TContext>

                                                                                                                                                                                                                                                                                                                        Partial context to merge.

                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_state-machine.ConformanceStateMachine.html b/docs/public/api-reference/classes/_quatrain_state-machine.ConformanceStateMachine.html new file mode 100644 index 00000000..805cb07d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_state-machine.ConformanceStateMachine.html @@ -0,0 +1,28 @@ +ConformanceStateMachine | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                                      Class ConformanceStateMachine<TContext>

                                                                                                                                                                                                                                                                                                                      State machine managing dynamic object conformance evaluations. +Evaluates the context dynamically based on a series of prioritised rules.

                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                      Type Parameters

                                                                                                                                                                                                                                                                                                                      • TContext

                                                                                                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                                                                                      context: TContext
                                                                                                                                                                                                                                                                                                                      currentState: ConformanceState
                                                                                                                                                                                                                                                                                                                      rules: ConformanceRule<TContext>[] = []

                                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                                      • Evaluates the current context and triggers transitions between conformance levels if necessary.

                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                        Returns boolean

                                                                                                                                                                                                                                                                                                                        True if a state change occurred, false otherwise.

                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_state-machine.WorkflowStateMachine.html b/docs/public/api-reference/classes/_quatrain_state-machine.WorkflowStateMachine.html new file mode 100644 index 00000000..473fa257 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_state-machine.WorkflowStateMachine.html @@ -0,0 +1,35 @@ +WorkflowStateMachine | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                                        Class WorkflowStateMachine<TState, TEvent, TContext>

                                                                                                                                                                                                                                                                                                                        State machine managing linear forward-only workflows. +Handled via explicit events and transitions.

                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                        Type Parameters

                                                                                                                                                                                                                                                                                                                        • TState
                                                                                                                                                                                                                                                                                                                        • TEvent
                                                                                                                                                                                                                                                                                                                        • TContext

                                                                                                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                                                                                        context: TContext
                                                                                                                                                                                                                                                                                                                        currentState: TState
                                                                                                                                                                                                                                                                                                                        history: TState[] = []
                                                                                                                                                                                                                                                                                                                        transitions: WorkflowTransition<TState, TEvent, TContext>[] = []

                                                                                                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                                                                                                        • Performs a transition to a new state if the event matches and the guard function passes.

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                          • event: TEvent

                                                                                                                                                                                                                                                                                                                            The triggering event.

                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                          Returns Promise<boolean>

                                                                                                                                                                                                                                                                                                                          A promise resolving to true if the transition succeeded, false otherwise.

                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_storage-firebase.FirebaseStorageAdapter.html b/docs/public/api-reference/classes/_quatrain_storage-firebase.FirebaseStorageAdapter.html new file mode 100644 index 00000000..d6d0d918 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_storage-firebase.FirebaseStorageAdapter.html @@ -0,0 +1,94 @@ +FirebaseStorageAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                                          Storage adapter implementing Google Firebase Storage integration. +Uses firebase-admin to manage files, metadata, and signed URLs seamlessly +across Firebase buckets.

                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                                                                                                                          _alias: string = ''
                                                                                                                                                                                                                                                                                                                          _client: any
                                                                                                                                                                                                                                                                                                                          _params: StorageParameters = {}

                                                                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                                                                          • Entry point for thumbnail generation. Analyzes the content type and automatically +delegates to the appropriate generation strategy (Image, Video, or Document).

                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                                                                            • file: FileType

                                                                                                                                                                                                                                                                                                                              Target file footprint.

                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                            • sizes: number[]

                                                                                                                                                                                                                                                                                                                              Desired dimensions.

                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                            Returns Promise<any>

                                                                                                                                                                                                                                                                                                                            The generated thumbnail map, or an empty object if unsupported/failed.

                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          • Extracts a single frame from a remote video via ffmpeg, resizes it, and uploads the frame as an image thumbnail.

                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                                                                            • file: FileType

                                                                                                                                                                                                                                                                                                                              Original video footprint.

                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                            • sizes: number[]

                                                                                                                                                                                                                                                                                                                              Array of desired thumbnail dimensions (px).

                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                            Returns Promise<any>

                                                                                                                                                                                                                                                                                                                            A mapping of generated thumbnail identifiers to their respective storage refs.

                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_storage-git.GitStorageAdapter.html b/docs/public/api-reference/classes/_quatrain_storage-git.GitStorageAdapter.html new file mode 100644 index 00000000..0089b076 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_storage-git.GitStorageAdapter.html @@ -0,0 +1,100 @@ +GitStorageAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                                                            Git and GitHub Storage Adapter for Quatrain Core. +Manages files locally via Git shell execution, or remotely via the GitHub REST API.

                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                                                                            Properties

                                                                                                                                                                                                                                                                                                                            _alias: string = ''
                                                                                                                                                                                                                                                                                                                            _client: any
                                                                                                                                                                                                                                                                                                                            _params: StorageParameters = {}
                                                                                                                                                                                                                                                                                                                            config: GitStorageConfig
                                                                                                                                                                                                                                                                                                                            octokit:
                                                                                                                                                                                                                                                                                                                                | Octokit & { paginate: PaginateInterface } & RestEndpointMethods & Api
                                                                                                                                                                                                                                                                                                                                | null = null

                                                                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                                                                            • Generates a raw URL pointing to the raw file content in Git/GitHub.

                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                              • file: FileType

                                                                                                                                                                                                                                                                                                                                Target file footprint.

                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                              • OptionalexpiresIn: number

                                                                                                                                                                                                                                                                                                                                Expiry window in seconds (ignored).

                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                              • Optionalaction: string

                                                                                                                                                                                                                                                                                                                                Action intent (ignored).

                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                              • Optionalextra: any

                                                                                                                                                                                                                                                                                                                                Provider specific overrides (ignored).

                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                              Returns Promise<any>

                                                                                                                                                                                                                                                                                                                              A promise resolving to the final raw public URL string.

                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                            • Lists all files within the repository that match the prefix.

                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                              • prefixOrOptions: any = ''

                                                                                                                                                                                                                                                                                                                                Root prefix directory or options object.

                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                              Returns Promise<string[]>

                                                                                                                                                                                                                                                                                                                              A promise resolving to a list of matching file reference paths.

                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_storage-local.LocalStorageAdapter.html b/docs/public/api-reference/classes/_quatrain_storage-local.LocalStorageAdapter.html new file mode 100644 index 00000000..1f8e4118 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_storage-local.LocalStorageAdapter.html @@ -0,0 +1,93 @@ +LocalStorageAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                                                              Provides a localized file system storage backend. +Perfect for development or single-node deployments using local disk volumes.

                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                                                              Properties

                                                                                                                                                                                                                                                                                                                              _alias: string = ''
                                                                                                                                                                                                                                                                                                                              _client: any
                                                                                                                                                                                                                                                                                                                              _params: StorageParameters = {}

                                                                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                                                              • Entry point for thumbnail generation. Analyzes the content type and automatically +delegates to the appropriate generation strategy (Image, Video, or Document).

                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                • file: FileType

                                                                                                                                                                                                                                                                                                                                  Target file footprint.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                • sizes: number[]

                                                                                                                                                                                                                                                                                                                                  Desired dimensions.

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                The generated thumbnail map, or an empty object if unsupported/failed.

                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                              • Extracts a single frame from a remote video via ffmpeg, resizes it, and uploads the frame as an image thumbnail.

                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                • file: FileType

                                                                                                                                                                                                                                                                                                                                  Original video footprint.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                • sizes: number[]

                                                                                                                                                                                                                                                                                                                                  Array of desired thumbnail dimensions (px).

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                A mapping of generated thumbnail identifiers to their respective storage refs.

                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                              • Generates a local file:// URI protocol link for system interoperability.

                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                • file: FileType

                                                                                                                                                                                                                                                                                                                                  Target file.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                • OptionalexpiresIn: number

                                                                                                                                                                                                                                                                                                                                  Ignored for local files.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                • Optionalaction: string

                                                                                                                                                                                                                                                                                                                                  Ignored.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                • Optionalextra: any

                                                                                                                                                                                                                                                                                                                                  Ignored.

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                A promise resolving to the local file URI string.

                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_storage-s3.S3StorageAdapter.html b/docs/public/api-reference/classes/_quatrain_storage-s3.S3StorageAdapter.html new file mode 100644 index 00000000..7cf5647a --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_storage-s3.S3StorageAdapter.html @@ -0,0 +1,100 @@ +S3StorageAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                                                Storage adapter implementation for AWS S3 compatible services. +Implements direct stream uploads, presigned URLs, and multipart handling.

                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                                                                _alias: string = ''
                                                                                                                                                                                                                                                                                                                                _client: S3Client
                                                                                                                                                                                                                                                                                                                                _params: StorageParameters = {}

                                                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                                                • Entry point for thumbnail generation. Analyzes the content type and automatically +delegates to the appropriate generation strategy (Image, Video, or Document).

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                  • file: FileType

                                                                                                                                                                                                                                                                                                                                    Target file footprint.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  • sizes: number[]

                                                                                                                                                                                                                                                                                                                                    Desired dimensions.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                  Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                  The generated thumbnail map, or an empty object if unsupported/failed.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                • Extracts a single frame from a remote video via ffmpeg, resizes it, and uploads the frame as an image thumbnail.

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                  • file: FileType

                                                                                                                                                                                                                                                                                                                                    Original video footprint.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  • sizes: number[]

                                                                                                                                                                                                                                                                                                                                    Array of desired thumbnail dimensions (px).

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                  Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                  A mapping of generated thumbnail identifiers to their respective storage refs.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                • Generates a temporary, presigned GET URL for public or secure access.

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                  • file: FileType

                                                                                                                                                                                                                                                                                                                                    Target file.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  • expiresIn: number = 3600

                                                                                                                                                                                                                                                                                                                                    URL expiration time in seconds.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  • action: any = 'read'

                                                                                                                                                                                                                                                                                                                                    The requested action ('read', etc.).

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  • extra: any = {}

                                                                                                                                                                                                                                                                                                                                    Extra parameters such as 'cacheControl'.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                  Returns Promise<{ expiresIn: number; url: string }>

                                                                                                                                                                                                                                                                                                                                  A promise resolving to the generated URL and expiration payload.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                • Helper utility converting a Node.js Stream into a raw Buffer. +Required for S3 payloads when streaming sizes are indeterminate.

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                  • stream: Stream

                                                                                                                                                                                                                                                                                                                                    The input stream.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                  Returns Promise<Buffer<ArrayBufferLike>>

                                                                                                                                                                                                                                                                                                                                  A promise resolving to the concatenated Buffer.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                • Validates the connection to the configured S3 endpoint by attempting to list buckets.

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                  Returns Promise<boolean>

                                                                                                                                                                                                                                                                                                                                  True if the connection succeeds and buckets are accessible.

                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_storage-supabase.SupabaseStorageAdapter.html b/docs/public/api-reference/classes/_quatrain_storage-supabase.SupabaseStorageAdapter.html new file mode 100644 index 00000000..687c675b --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_storage-supabase.SupabaseStorageAdapter.html @@ -0,0 +1,108 @@ +SupabaseStorageAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                                                  Storage adapter implementation targeting Supabase Storage. +Interfaces with the @supabase/storage-js client to manage buckets, +secure signed URLs, and file uploads.

                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                                                                                                  _alias: string = ''
                                                                                                                                                                                                                                                                                                                                  _client: StorageClient
                                                                                                                                                                                                                                                                                                                                  _params: StorageParameters = {}

                                                                                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                                                                                  • Entry point for thumbnail generation. Analyzes the content type and automatically +delegates to the appropriate generation strategy (Image, Video, or Document).

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                    • file: FileType

                                                                                                                                                                                                                                                                                                                                      Target file footprint.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    • sizes: number[]

                                                                                                                                                                                                                                                                                                                                      Desired dimensions.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                    Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                    The generated thumbnail map, or an empty object if unsupported/failed.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  • Extracts a single frame from a remote video via ffmpeg, resizes it, and uploads the frame as an image thumbnail.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                    • file: FileType

                                                                                                                                                                                                                                                                                                                                      Original video footprint.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    • sizes: number[]

                                                                                                                                                                                                                                                                                                                                      Array of desired thumbnail dimensions (px).

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                    Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                    A mapping of generated thumbnail identifiers to their respective storage refs.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  • Generates a secure, temporary GET link to access the object remotely.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                    • file: FileType

                                                                                                                                                                                                                                                                                                                                      The file footprint.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    • expiresIn: number = 3600

                                                                                                                                                                                                                                                                                                                                      URL expiration in seconds.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    • action: any = 'read'

                                                                                                                                                                                                                                                                                                                                      Intended action context.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    • extra: any = {}

                                                                                                                                                                                                                                                                                                                                      Optional parameters (e.g. cache configurations).

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                    Returns Promise<{ expiresIn: number; url: string }>

                                                                                                                                                                                                                                                                                                                                    A promise resolving to the signed URL payload.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                    If signature creation fails.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  • Helper converting a node stream to a Buffer, essential for Blob creation.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                    • stream: Stream

                                                                                                                                                                                                                                                                                                                                      The input stream.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                    Returns Promise<Buffer<ArrayBufferLike>>

                                                                                                                                                                                                                                                                                                                                    A promise resolving to the concatenated Buffer.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  • Internal helper to convert a Buffer into a native ArrayBuffer.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                    • buffer: Buffer

                                                                                                                                                                                                                                                                                                                                      The raw Buffer.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                    Returns ArrayBuffer

                                                                                                                                                                                                                                                                                                                                    The ArrayBuffer representation.

                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_storage.AbstractStorageAdapter.html b/docs/public/api-reference/classes/_quatrain_storage.AbstractStorageAdapter.html new file mode 100644 index 00000000..75dc7f79 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_storage.AbstractStorageAdapter.html @@ -0,0 +1,89 @@ +AbstractStorageAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                                                    Class AbstractStorageAdapterAbstract

                                                                                                                                                                                                                                                                                                                                    Base abstract class defining the contract for all storage adapters. +Implements common logic for media thumbnailing and URL routing via gateways.

                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                    Implements

                                                                                                                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                                                                                                    _alias: string = ''
                                                                                                                                                                                                                                                                                                                                    _client: any
                                                                                                                                                                                                                                                                                                                                    _params: StorageParameters = {}

                                                                                                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                                                                                                    • Parameters

                                                                                                                                                                                                                                                                                                                                      • file: FileType
                                                                                                                                                                                                                                                                                                                                      • size: number
                                                                                                                                                                                                                                                                                                                                      • workingDir: string
                                                                                                                                                                                                                                                                                                                                      • bucketDir: string
                                                                                                                                                                                                                                                                                                                                      • thumbnailExtension: string
                                                                                                                                                                                                                                                                                                                                      • imagePath: string

                                                                                                                                                                                                                                                                                                                                      Returns Promise<{ [key: string]: string }>

                                                                                                                                                                                                                                                                                                                                    • Extracts the first page of a document (e.g. PDF) via ImageMagick, resizes it, and uploads it as a thumbnail.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                      • file: FileType

                                                                                                                                                                                                                                                                                                                                        Original document footprint.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      • sizes: number[]

                                                                                                                                                                                                                                                                                                                                        Array of desired thumbnail dimensions (px).

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                      Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                      A mapping of generated thumbnail identifiers to their respective storage refs.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    • Entry point for thumbnail generation. Analyzes the content type and automatically +delegates to the appropriate generation strategy (Image, Video, or Document).

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                      • file: FileType

                                                                                                                                                                                                                                                                                                                                        Target file footprint.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      • sizes: number[]

                                                                                                                                                                                                                                                                                                                                        Desired dimensions.

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                      Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                      The generated thumbnail map, or an empty object if unsupported/failed.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    • Extracts a single frame from a remote video via ffmpeg, resizes it, and uploads the frame as an image thumbnail.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                      • file: FileType

                                                                                                                                                                                                                                                                                                                                        Original video footprint.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      • sizes: number[]

                                                                                                                                                                                                                                                                                                                                        Array of desired thumbnail dimensions (px).

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                      Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                      A mapping of generated thumbnail identifiers to their respective storage refs.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    • Generates a raw, natively routable provider URL (e.g., S3 presigned URL).

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                      • file: FileType

                                                                                                                                                                                                                                                                                                                                        The target file footprint.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      • OptionalexpiresIn: number

                                                                                                                                                                                                                                                                                                                                        Signature expiration in seconds.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      • Optionalaction: string

                                                                                                                                                                                                                                                                                                                                        Intended action ('read', 'write').

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      • Optionalextra: any

                                                                                                                                                                                                                                                                                                                                        Provider-specific overrides (e.g. { native: true }).

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                      Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                      A promise resolving to the final native URL payload.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    • Checks if the file is a video or audio stream based on its MIME type or file extension.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                      Returns boolean

                                                                                                                                                                                                                                                                                                                                      True if the file represents a video or audio asset.

                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_storage.MockAdapter.html b/docs/public/api-reference/classes/_quatrain_storage.MockAdapter.html new file mode 100644 index 00000000..d713707f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_storage.MockAdapter.html @@ -0,0 +1,91 @@ +MockAdapter | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                                                      A purely in-memory storage adapter designed for unit tests and local mock integrations. +Files are temporarily stored in a Node.js Map<string, Buffer>.

                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                                                                                                      _alias: string = ''
                                                                                                                                                                                                                                                                                                                                      _client: any
                                                                                                                                                                                                                                                                                                                                      _params: StorageParameters = {}

                                                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                                                      • Entry point for thumbnail generation. Analyzes the content type and automatically +delegates to the appropriate generation strategy (Image, Video, or Document).

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                                                        • file: FileType

                                                                                                                                                                                                                                                                                                                                          Target file footprint.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                        • sizes: number[]

                                                                                                                                                                                                                                                                                                                                          Desired dimensions.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                        Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                        The generated thumbnail map, or an empty object if unsupported/failed.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      • Extracts a single frame from a remote video via ffmpeg, resizes it, and uploads the frame as an image thumbnail.

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                                                        • file: FileType

                                                                                                                                                                                                                                                                                                                                          Original video footprint.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                        • sizes: number[]

                                                                                                                                                                                                                                                                                                                                          Array of desired thumbnail dimensions (px).

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                        Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                        A mapping of generated thumbnail identifiers to their respective storage refs.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_storage.Storage.html b/docs/public/api-reference/classes/_quatrain_storage.Storage.html new file mode 100644 index 00000000..087d8819 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_storage.Storage.html @@ -0,0 +1,94 @@ +Storage | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                                                        Global registry and utility class for managing multiple storage backends. +Follows the Quatrain Core convention of centralizing dependency access via aliases.

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                                                                                                        _storages: StorageBackendRegistry<any> = {}
                                                                                                                                                                                                                                                                                                                                        classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                                                                                                                        Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                        defaultStorage: string = ''

                                                                                                                                                                                                                                                                                                                                        The fallback storage alias used when none is explicitly requested.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                        defaultUpsert: boolean = true

                                                                                                                                                                                                                                                                                                                                        Global configuration flag to control whether uploads overwrite existing files by default (upsert).

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                        logger: any = ...

                                                                                                                                                                                                                                                                                                                                        Central logger scope dedicated to the Storage subsystem.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                        logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                                                                                                                        System-wide base log verbosity.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                        me: string = ...

                                                                                                                                                                                                                                                                                                                                        Identifying namespace for this core component.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                        storage: typeof NodePersist = persist

                                                                                                                                                                                                                                                                                                                                        Persistent key-value storage engine reference.

                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                        storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                                                                                                                        Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                        Accessors

                                                                                                                                                                                                                                                                                                                                        • get userClass(): any

                                                                                                                                                                                                                                                                                                                                          Returns any

                                                                                                                                                                                                                                                                                                                                        • set userClass(cls: any): void

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • cls: any

                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                                                                                                                        • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • name: string

                                                                                                                                                                                                                                                                                                                                            Semantic registry name.

                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                          • obj: any

                                                                                                                                                                                                                                                                                                                                            Class constructor.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                        • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • key: string

                                                                                                                                                                                                                                                                                                                                            Identification string.

                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                          • value: any

                                                                                                                                                                                                                                                                                                                                            Value.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns Promise<void>

                                                                                                                                                                                                                                                                                                                                        • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • alias: string = ...

                                                                                                                                                                                                                                                                                                                                            The logging context name.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns any

                                                                                                                                                                                                                                                                                                                                          Instantiated LoggerAdapter.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                        • Registers an instantiated storage adapter into the global registry.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • adapter: AbstractStorageAdapter

                                                                                                                                                                                                                                                                                                                                            The initialized adapter (e.g. S3StorageAdapter).

                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                          • alias: string

                                                                                                                                                                                                                                                                                                                                            The string identifier to register it under.

                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                          • setDefault: boolean = false

                                                                                                                                                                                                                                                                                                                                            Whether this should become the global default backend.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                        • Triggers a debug log on the core logger.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                        • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • key: string

                                                                                                                                                                                                                                                                                                                                            The property block to generate.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                                                                                                                          Field definitions block.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                        • Triggers an error log on the core logger.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                        • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • name: string

                                                                                                                                                                                                                                                                                                                                            The semantic name to resolve.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns any

                                                                                                                                                                                                                                                                                                                                          Class definition.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                        • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • key: string

                                                                                                                                                                                                                                                                                                                                            The target identifier.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                          The recovered value.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                        • Retrieves a previously registered storage adapter by its alias.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Type Parameters

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • alias: string = ...

                                                                                                                                                                                                                                                                                                                                            The target registry identifier. Defaults to defaultStorage.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns T

                                                                                                                                                                                                                                                                                                                                          The adapter instance.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          If the alias is not registered.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                        • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • command: string

                                                                                                                                                                                                                                                                                                                                            The executable.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns Promise<string>

                                                                                                                                                                                                                                                                                                                                          The resolved system path.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                        • Triggers an info log on the core logger.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                        • Triggers a standard log on the core logger.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                        • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • seconds: number = 1

                                                                                                                                                                                                                                                                                                                                            Duration count.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns Promise<unknown>

                                                                                                                                                                                                                                                                                                                                          The promise to await.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                        • Triggers a trace log on the core logger.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                        • Triggers a warning log on the core logger.

                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                          • ...message: any

                                                                                                                                                                                                                                                                                                                                            Content to log.

                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_studio.CodeGenerator.html b/docs/public/api-reference/classes/_quatrain_studio.CodeGenerator.html new file mode 100644 index 00000000..1ad952bf --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.CodeGenerator.html @@ -0,0 +1,8 @@ +CodeGenerator | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                                                          Core utility for programmatically generating Quatrain model TypeScript code. +Transforms StudioModel and its properties into valid TS classes and interfaces.

                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioAgent.html b/docs/public/api-reference/classes/_quatrain_studio.StudioAgent.html new file mode 100644 index 00000000..8a523c11 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioAgent.html @@ -0,0 +1,9 @@ +StudioAgent | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                                                                            The Studio Agent uses the configured AI adapter to translate +natural language prompts into SQLite-persisted Studio models.

                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                                                                                            • Parses a prompt and creates a StudioModel with its StudioProperties

                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                              • prompt: string

                                                                                                                                                                                                                                                                                                                                                User's natural language request

                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                              • projectId: string

                                                                                                                                                                                                                                                                                                                                                The ID of the current StudioProject

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                              Returns Promise<StudioModel>

                                                                                                                                                                                                                                                                                                                                              The generated StudioModel

                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioAuth.html b/docs/public/api-reference/classes/_quatrain_studio.StudioAuth.html new file mode 100644 index 00000000..fa935aab --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioAuth.html @@ -0,0 +1,97 @@ +StudioAuth | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                                                                              Core domain model representing a StudioAuth within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                                                                              Properties

                                                                                                                                                                                                                                                                                                                                              _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                              _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                              COLLECTION: string = 'studio_auth'

                                                                                                                                                                                                                                                                                                                                              The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                              LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                              Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                              PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                              The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                              PROPS_DEFINITION: any = StudioAuthProperties

                                                                                                                                                                                                                                                                                                                                              The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                              REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                              The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                              Accessors

                                                                                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                                                                              • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                                • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                  If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                              • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                                • obj: any

                                                                                                                                                                                                                                                                                                                                                  The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                              • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Type Parameters

                                                                                                                                                                                                                                                                                                                                                • T

                                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                                • path: string

                                                                                                                                                                                                                                                                                                                                                  The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioBackend.html b/docs/public/api-reference/classes/_quatrain_studio.StudioBackend.html new file mode 100644 index 00000000..93f99bcd --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioBackend.html @@ -0,0 +1,97 @@ +StudioBackend | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                                                                Core domain model representing a StudioBackend within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                                                                                _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                COLLECTION: string = 'studio_backend'

                                                                                                                                                                                                                                                                                                                                                The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                PROPS_DEFINITION: any = StudioBackendDef

                                                                                                                                                                                                                                                                                                                                                The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                Accessors

                                                                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                                                                • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                  • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                    If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                  Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                  A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                  • obj: any

                                                                                                                                                                                                                                                                                                                                                    The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                  Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                  A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Type Parameters

                                                                                                                                                                                                                                                                                                                                                  • T

                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                  • path: string

                                                                                                                                                                                                                                                                                                                                                    The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                  Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                  A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioDeployment.html b/docs/public/api-reference/classes/_quatrain_studio.StudioDeployment.html new file mode 100644 index 00000000..6ebffc2d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioDeployment.html @@ -0,0 +1,97 @@ +StudioDeployment | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                                                                  Class StudioDeployment

                                                                                                                                                                                                                                                                                                                                                  Core domain model representing a StudioDeployment within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                                                                                                                  _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                  _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                  COLLECTION: string = 'studio_deployment'

                                                                                                                                                                                                                                                                                                                                                  The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                  LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                  Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                  PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                  The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                  PROPS_DEFINITION: any = StudioDeploymentDef

                                                                                                                                                                                                                                                                                                                                                  The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                  REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                  The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                  Accessors

                                                                                                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                                                                                                  • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                                    • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                      If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                    Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                    A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                  • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                                    • obj: any

                                                                                                                                                                                                                                                                                                                                                      The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                    Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                    A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                  • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                    Type Parameters

                                                                                                                                                                                                                                                                                                                                                    • T

                                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                                    • path: string

                                                                                                                                                                                                                                                                                                                                                      The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                    Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                    A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioEnvironment.html b/docs/public/api-reference/classes/_quatrain_studio.StudioEnvironment.html new file mode 100644 index 00000000..1bd8234d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioEnvironment.html @@ -0,0 +1,97 @@ +StudioEnvironment | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                                                                    Class StudioEnvironment

                                                                                                                                                                                                                                                                                                                                                    Core domain model representing a StudioEnvironment within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                                                                                                                    _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                    _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                    COLLECTION: string = 'studio_environment'

                                                                                                                                                                                                                                                                                                                                                    The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                    LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                    Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                    PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                    The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                    PROPS_DEFINITION: any = StudioEnvironmentProperties

                                                                                                                                                                                                                                                                                                                                                    The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                    REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                    The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                    Accessors

                                                                                                                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                                                                                                                    • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                      • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                        If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                      Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                      A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                    • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                      • obj: any

                                                                                                                                                                                                                                                                                                                                                        The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                      Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                      A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                    • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                      Type Parameters

                                                                                                                                                                                                                                                                                                                                                      • T

                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                      • path: string

                                                                                                                                                                                                                                                                                                                                                        The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                      Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                      A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioHistory.html b/docs/public/api-reference/classes/_quatrain_studio.StudioHistory.html new file mode 100644 index 00000000..76137833 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioHistory.html @@ -0,0 +1,97 @@ +StudioHistory | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                                                                      Core domain model representing a StudioHistory within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                                                                                                                      _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                      _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                      COLLECTION: string = 'studio_history'

                                                                                                                                                                                                                                                                                                                                                      The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                      LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                      Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                      PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                      The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                      PROPS_DEFINITION: any = StudioHistoryDef

                                                                                                                                                                                                                                                                                                                                                      The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                      REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                      The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                      Accessors

                                                                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                                                                      • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                                                                        • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                          If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                        Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                        A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                      • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                                                                        • obj: any

                                                                                                                                                                                                                                                                                                                                                          The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                        Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                        A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                      • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Type Parameters

                                                                                                                                                                                                                                                                                                                                                        • T

                                                                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                                                                        • path: string

                                                                                                                                                                                                                                                                                                                                                          The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                        Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                        A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioModel.html b/docs/public/api-reference/classes/_quatrain_studio.StudioModel.html new file mode 100644 index 00000000..a159d26a --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioModel.html @@ -0,0 +1,97 @@ +StudioModel | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                                                                        Core domain model representing a StudioModel within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                                                                                                                        _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                        _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                        COLLECTION: string = 'studio_model'

                                                                                                                                                                                                                                                                                                                                                        The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                        LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                        Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                        PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                        The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                        PROPS_DEFINITION: any = StudioModelProperties

                                                                                                                                                                                                                                                                                                                                                        The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                        REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                        The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                        Accessors

                                                                                                                                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                                                                                                                                        • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                                          • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                            If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                          Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                          A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                        • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                                          • obj: any

                                                                                                                                                                                                                                                                                                                                                            The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                          Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                          A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                        • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                          Type Parameters

                                                                                                                                                                                                                                                                                                                                                          • T

                                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                                          • path: string

                                                                                                                                                                                                                                                                                                                                                            The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                          Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                          A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioProject.html b/docs/public/api-reference/classes/_quatrain_studio.StudioProject.html new file mode 100644 index 00000000..da991c1f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioProject.html @@ -0,0 +1,97 @@ +StudioProject | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                                                                          Core domain model representing a StudioProject within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                                                                                                                                                          _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                          _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                          COLLECTION: string = 'studio_project'

                                                                                                                                                                                                                                                                                                                                                          The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                          LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                          Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                          PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                          The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                          PROPS_DEFINITION: any = StudioProjectProperties

                                                                                                                                                                                                                                                                                                                                                          The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                          REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                          The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                          Accessors

                                                                                                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                                                                                                          • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                                                                                                            • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                              If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                            Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                            A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                          • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                                                                                                            • obj: any

                                                                                                                                                                                                                                                                                                                                                              The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                            Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                            A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                          • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                            Type Parameters

                                                                                                                                                                                                                                                                                                                                                            • T

                                                                                                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                                                                                                            • path: string

                                                                                                                                                                                                                                                                                                                                                              The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                            Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                            A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioProperty.html b/docs/public/api-reference/classes/_quatrain_studio.StudioProperty.html new file mode 100644 index 00000000..ae3cbd82 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioProperty.html @@ -0,0 +1,97 @@ +StudioProperty | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                                                                                            Class StudioProperty

                                                                                                                                                                                                                                                                                                                                                            Core domain model representing a StudioProperty within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                                                                                                            Properties

                                                                                                                                                                                                                                                                                                                                                            _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                            _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                            COLLECTION: string = 'studio_property'

                                                                                                                                                                                                                                                                                                                                                            The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                            LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                            Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                            PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                            The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                            PROPS_DEFINITION: any = StudioPropertyDef

                                                                                                                                                                                                                                                                                                                                                            The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                            REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                            The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                            Accessors

                                                                                                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                                                                                                            • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                              • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                                If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                              Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                              A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                            • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                              • obj: any

                                                                                                                                                                                                                                                                                                                                                                The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                              Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                              A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                            • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Type Parameters

                                                                                                                                                                                                                                                                                                                                                              • T

                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                              • path: string

                                                                                                                                                                                                                                                                                                                                                                The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                              Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                              A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioSecret.html b/docs/public/api-reference/classes/_quatrain_studio.StudioSecret.html new file mode 100644 index 00000000..2294d237 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioSecret.html @@ -0,0 +1,97 @@ +StudioSecret | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                                                                                              Core domain model representing a StudioSecret within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                                                                                              Properties

                                                                                                                                                                                                                                                                                                                                                              _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                              _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                              COLLECTION: string = 'studio_secret'

                                                                                                                                                                                                                                                                                                                                                              The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                              Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                              The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              PROPS_DEFINITION: any = StudioSecretProperties

                                                                                                                                                                                                                                                                                                                                                              The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                              REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                              The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                              Accessors

                                                                                                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                                                                                              • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                                                • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                                  If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                                A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                                                • obj: any

                                                                                                                                                                                                                                                                                                                                                                  The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                                A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                Type Parameters

                                                                                                                                                                                                                                                                                                                                                                • T

                                                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                                                • path: string

                                                                                                                                                                                                                                                                                                                                                                  The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                                A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioStorage.html b/docs/public/api-reference/classes/_quatrain_studio.StudioStorage.html new file mode 100644 index 00000000..d75cf12f --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioStorage.html @@ -0,0 +1,97 @@ +StudioStorage | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                Core domain model representing a StudioStorage within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                                                                                                _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                                _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                                COLLECTION: string = 'studio_storage'

                                                                                                                                                                                                                                                                                                                                                                The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                                Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                                The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                PROPS_DEFINITION: any = StudioStorageProperties

                                                                                                                                                                                                                                                                                                                                                                The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                                The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                Accessors

                                                                                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                                                                                • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                  • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                                    If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                  Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                                  A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                  • obj: any

                                                                                                                                                                                                                                                                                                                                                                    The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                  Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                                  A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                  Type Parameters

                                                                                                                                                                                                                                                                                                                                                                  • T

                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                  • path: string

                                                                                                                                                                                                                                                                                                                                                                    The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                  Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                                  A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioTarget.html b/docs/public/api-reference/classes/_quatrain_studio.StudioTarget.html new file mode 100644 index 00000000..d74ed958 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioTarget.html @@ -0,0 +1,97 @@ +StudioTarget | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                  Core domain model representing a StudioTarget within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                                                                                                                                  _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                                  _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                                  COLLECTION: string = 'studio_target'

                                                                                                                                                                                                                                                                                                                                                                  The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                  LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                                  Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                  PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                                  The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                  PROPS_DEFINITION: any = StudioTargetProperties

                                                                                                                                                                                                                                                                                                                                                                  The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                  REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                                  The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                  Accessors

                                                                                                                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                                                                                                                  • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                                                    • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                                      If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                    Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                                    A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                  • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                                                    • obj: any

                                                                                                                                                                                                                                                                                                                                                                      The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                    Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                                    A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                  • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Type Parameters

                                                                                                                                                                                                                                                                                                                                                                    • T

                                                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                                                    • path: string

                                                                                                                                                                                                                                                                                                                                                                      The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                    Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                                    A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioView.html b/docs/public/api-reference/classes/_quatrain_studio.StudioView.html new file mode 100644 index 00000000..a98b3b69 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioView.html @@ -0,0 +1,97 @@ +StudioView | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                    Core domain model representing a StudioView within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                                                                                                                                    _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                                    _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                                    COLLECTION: string = 'studio_view'

                                                                                                                                                                                                                                                                                                                                                                    The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                                    Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                                    The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    PROPS_DEFINITION: any = StudioViewDef

                                                                                                                                                                                                                                                                                                                                                                    The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                    REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                                    The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                    Accessors

                                                                                                                                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                                                                                                                                    • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                                      • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                                        If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                      Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                                      A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                                      • obj: any

                                                                                                                                                                                                                                                                                                                                                                        The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                      Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                                      A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                      Type Parameters

                                                                                                                                                                                                                                                                                                                                                                      • T

                                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                                      • path: string

                                                                                                                                                                                                                                                                                                                                                                        The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                      Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                                      A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_studio.StudioWidget.html b/docs/public/api-reference/classes/_quatrain_studio.StudioWidget.html new file mode 100644 index 00000000..43fc2148 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_studio.StudioWidget.html @@ -0,0 +1,97 @@ +StudioWidget | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                      Core domain model representing a StudioWidget within the Quatrain Studio ecosystem.

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                                                                                                                                      _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                                      _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                                      COLLECTION: string = 'studio_widget'

                                                                                                                                                                                                                                                                                                                                                                      The underlying database collection or table name.

                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                      LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                                      Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                      PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                                      The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                      PROPS_DEFINITION: any = StudioWidgetDef

                                                                                                                                                                                                                                                                                                                                                                      The schema definition dictating the properties of this model.

                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                      REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                                      The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                      Accessors

                                                                                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                                                                                      • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                                                                                        • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                                          If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                        Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                                        A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                      • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                                                                                        • obj: any

                                                                                                                                                                                                                                                                                                                                                                          The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                        Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                                        A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                      • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                        Type Parameters

                                                                                                                                                                                                                                                                                                                                                                        • T

                                                                                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                                                                                        • path: string

                                                                                                                                                                                                                                                                                                                                                                          The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                        Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                                        A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_testing.Entity.html b/docs/public/api-reference/classes/_quatrain_testing.Entity.html new file mode 100644 index 00000000..0cb5471d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_testing.Entity.html @@ -0,0 +1,98 @@ +Entity | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                        A mock persisted entity used across unit and integration tests. +Extends PersistedBaseObject to simulate database interactions.

                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                                                                                                                                        _dataObject: DataObjectClass<any>
                                                                                                                                                                                                                                                                                                                                                                        _repositoryInstance: any = null
                                                                                                                                                                                                                                                                                                                                                                        COLLECTION: string = 'entities'

                                                                                                                                                                                                                                                                                                                                                                        The mock collection name where this entity would be stored.

                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                        LABEL_KEY: string = 'name'

                                                                                                                                                                                                                                                                                                                                                                        Which property's value to use in backend as label for object reference

                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                        PARENT_PROP: string | undefined

                                                                                                                                                                                                                                                                                                                                                                        The name of the property handling hierarchical parent relationships.

                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                        PROPS_DEFINITION: any[] = CoreEntity.PROPS_DEFINITION

                                                                                                                                                                                                                                                                                                                                                                        The schema definition inherited from CoreEntity.

                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                        REPOSITORY_CLASS: any = null

                                                                                                                                                                                                                                                                                                                                                                        The designated repository class for this model (defaults to BaseRepository).

                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                        Accessors

                                                                                                                                                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                                                                                                                                                        • Deletes the object from the backend database. +By default, it performs a soft-delete (modifying the status property) unless hardDelete is enabled.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                                                          • hardDelete: boolean = false

                                                                                                                                                                                                                                                                                                                                                                            If true, permanently removes the record from the database.

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                          Returns Promise<DataObjectClass<any>>

                                                                                                                                                                                                                                                                                                                                                                          A promise resolving to the underlying DataObjectClass.

                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                        • Creates a chained query for child records originating from the current instance. +Used mainly for NoSQL backends to query subcollections seamlessly.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                                                          • obj: any

                                                                                                                                                                                                                                                                                                                                                                            The child class definition (e.g., LogModel) to query.

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                          Returns Query<any>

                                                                                                                                                                                                                                                                                                                                                                          A new Query builder scoped to this parent instance.

                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                        • Fetches and hydrates an object directly from its backend storage path via the repository facade.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Type Parameters

                                                                                                                                                                                                                                                                                                                                                                          • T

                                                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                                                          • path: string

                                                                                                                                                                                                                                                                                                                                                                            The backend unique identifier or full URI path (e.g. "users/123" or "123").

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                          Returns Promise<T>

                                                                                                                                                                                                                                                                                                                                                                          A promise resolving to the populated class instance.

                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_types.BackendError.html b/docs/public/api-reference/classes/_quatrain_types.BackendError.html new file mode 100644 index 00000000..342b6672 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_types.BackendError.html @@ -0,0 +1,36 @@ +BackendError | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                          Class BackendError

                                                                                                                                                                                                                                                                                                                                                                          General exception thrown when an adapter encounters an execution, syntax, or network failure.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                                                                                                                                                                          cause?: unknown
                                                                                                                                                                                                                                                                                                                                                                          message: string
                                                                                                                                                                                                                                                                                                                                                                          name: string
                                                                                                                                                                                                                                                                                                                                                                          stack?: string
                                                                                                                                                                                                                                                                                                                                                                          stackTraceLimit: number

                                                                                                                                                                                                                                                                                                                                                                          The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                                                                                                                          • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                            const myObject = {};
                                                                                                                                                                                                                                                                                                                                                                            Error.captureStackTrace(myObject);
                                                                                                                                                                                                                                                                                                                                                                            myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                            The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                            The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                            The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                            function a() {
                                                                                                                                                                                                                                                                                                                                                                            b();
                                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                                            function b() {
                                                                                                                                                                                                                                                                                                                                                                            c();
                                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                                            function c() {
                                                                                                                                                                                                                                                                                                                                                                            // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                                                                                                                                                                            const { stackTraceLimit } = Error;
                                                                                                                                                                                                                                                                                                                                                                            Error.stackTraceLimit = 0;
                                                                                                                                                                                                                                                                                                                                                                            const error = new Error();
                                                                                                                                                                                                                                                                                                                                                                            Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                                                                                                                                                                            // Capture the stack trace above function b
                                                                                                                                                                                                                                                                                                                                                                            Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                                                                                                                                                                            throw error;
                                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                                            a(); +
                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                                                                                                                            • targetObject: object
                                                                                                                                                                                                                                                                                                                                                                            • OptionalconstructorOpt: Function

                                                                                                                                                                                                                                                                                                                                                                            Returns void

                                                                                                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_types.BadRequestError.html b/docs/public/api-reference/classes/_quatrain_types.BadRequestError.html new file mode 100644 index 00000000..c180a3ef --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_types.BadRequestError.html @@ -0,0 +1,36 @@ +BadRequestError | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                            Class BadRequestError

                                                                                                                                                                                                                                                                                                                                                                            Indicates a structurally flawed request (e.g., HTTP 400).

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                            Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                                                                                                                            Properties

                                                                                                                                                                                                                                                                                                                                                                            cause?: unknown
                                                                                                                                                                                                                                                                                                                                                                            message: string
                                                                                                                                                                                                                                                                                                                                                                            name: string
                                                                                                                                                                                                                                                                                                                                                                            stack?: string
                                                                                                                                                                                                                                                                                                                                                                            stackTraceLimit: number

                                                                                                                                                                                                                                                                                                                                                                            The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                            The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                            If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                                                                                                                            • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                              const myObject = {};
                                                                                                                                                                                                                                                                                                                                                                              Error.captureStackTrace(myObject);
                                                                                                                                                                                                                                                                                                                                                                              myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                              The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                              The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                              The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                              function a() {
                                                                                                                                                                                                                                                                                                                                                                              b();
                                                                                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                                                                              function b() {
                                                                                                                                                                                                                                                                                                                                                                              c();
                                                                                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                                                                              function c() {
                                                                                                                                                                                                                                                                                                                                                                              // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                                                                                                                                                                              const { stackTraceLimit } = Error;
                                                                                                                                                                                                                                                                                                                                                                              Error.stackTraceLimit = 0;
                                                                                                                                                                                                                                                                                                                                                                              const error = new Error();
                                                                                                                                                                                                                                                                                                                                                                              Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                                                                                                                                                                              // Capture the stack trace above function b
                                                                                                                                                                                                                                                                                                                                                                              Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                                                                                                                                                                              throw error;
                                                                                                                                                                                                                                                                                                                                                                              }

                                                                                                                                                                                                                                                                                                                                                                              a(); +
                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                                              • targetObject: object
                                                                                                                                                                                                                                                                                                                                                                              • OptionalconstructorOpt: Function

                                                                                                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_types.ForbiddenError.html b/docs/public/api-reference/classes/_quatrain_types.ForbiddenError.html new file mode 100644 index 00000000..ed7a5064 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_types.ForbiddenError.html @@ -0,0 +1,36 @@ +ForbiddenError | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                              Class ForbiddenError

                                                                                                                                                                                                                                                                                                                                                                              Indicates an authenticated action denied by privileges (e.g., HTTP 403).

                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                              Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                                                                                                              Properties

                                                                                                                                                                                                                                                                                                                                                                              cause?: unknown
                                                                                                                                                                                                                                                                                                                                                                              message: string
                                                                                                                                                                                                                                                                                                                                                                              name: string
                                                                                                                                                                                                                                                                                                                                                                              stack?: string
                                                                                                                                                                                                                                                                                                                                                                              stackTraceLimit: number

                                                                                                                                                                                                                                                                                                                                                                              The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                              The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                              If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                                                                                                              • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                const myObject = {};
                                                                                                                                                                                                                                                                                                                                                                                Error.captureStackTrace(myObject);
                                                                                                                                                                                                                                                                                                                                                                                myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                function a() {
                                                                                                                                                                                                                                                                                                                                                                                b();
                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                function b() {
                                                                                                                                                                                                                                                                                                                                                                                c();
                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                function c() {
                                                                                                                                                                                                                                                                                                                                                                                // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                                                                                                                                                                                const { stackTraceLimit } = Error;
                                                                                                                                                                                                                                                                                                                                                                                Error.stackTraceLimit = 0;
                                                                                                                                                                                                                                                                                                                                                                                const error = new Error();
                                                                                                                                                                                                                                                                                                                                                                                Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                                                                                                                                                                                // Capture the stack trace above function b
                                                                                                                                                                                                                                                                                                                                                                                Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                                                                                                                                                                                throw error;
                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                a(); +
                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                                                                • targetObject: object
                                                                                                                                                                                                                                                                                                                                                                                • OptionalconstructorOpt: Function

                                                                                                                                                                                                                                                                                                                                                                                Returns void

                                                                                                                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_types.GoneError.html b/docs/public/api-reference/classes/_quatrain_types.GoneError.html new file mode 100644 index 00000000..9c6c4a3c --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_types.GoneError.html @@ -0,0 +1,36 @@ +GoneError | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                Indicates an originally valid asset that has been purged (e.g., HTTP 410).

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                                                                                                                cause?: unknown
                                                                                                                                                                                                                                                                                                                                                                                message: string
                                                                                                                                                                                                                                                                                                                                                                                name: string
                                                                                                                                                                                                                                                                                                                                                                                stack?: string
                                                                                                                                                                                                                                                                                                                                                                                stackTraceLimit: number

                                                                                                                                                                                                                                                                                                                                                                                The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                                                                                                • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                  const myObject = {};
                                                                                                                                                                                                                                                                                                                                                                                  Error.captureStackTrace(myObject);
                                                                                                                                                                                                                                                                                                                                                                                  myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                                                                                                                                                                                  + +

                                                                                                                                                                                                                                                                                                                                                                                  The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                  The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                  The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                  function a() {
                                                                                                                                                                                                                                                                                                                                                                                  b();
                                                                                                                                                                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                                                                                                                                                                  function b() {
                                                                                                                                                                                                                                                                                                                                                                                  c();
                                                                                                                                                                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                                                                                                                                                                  function c() {
                                                                                                                                                                                                                                                                                                                                                                                  // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                                                                                                                                                                                  const { stackTraceLimit } = Error;
                                                                                                                                                                                                                                                                                                                                                                                  Error.stackTraceLimit = 0;
                                                                                                                                                                                                                                                                                                                                                                                  const error = new Error();
                                                                                                                                                                                                                                                                                                                                                                                  Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                                                                                                                                                                                  // Capture the stack trace above function b
                                                                                                                                                                                                                                                                                                                                                                                  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                                                                                                                                                                                  throw error;
                                                                                                                                                                                                                                                                                                                                                                                  }

                                                                                                                                                                                                                                                                                                                                                                                  a(); +
                                                                                                                                                                                                                                                                                                                                                                                  + +

                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                  • targetObject: object
                                                                                                                                                                                                                                                                                                                                                                                  • OptionalconstructorOpt: Function

                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/classes/_quatrain_types.NotFoundError.html b/docs/public/api-reference/classes/_quatrain_types.NotFoundError.html new file mode 100644 index 00000000..9f0bd67c --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_types.NotFoundError.html @@ -0,0 +1,36 @@ +NotFoundError | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                  Class NotFoundError

                                                                                                                                                                                                                                                                                                                                                                                  Indicates a non-existent database or file resource lookup (e.g., HTTP 404).

                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                  Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                                  Index

                                                                                                                                                                                                                                                                                                                                                                                  Constructors

                                                                                                                                                                                                                                                                                                                                                                                  Properties

                                                                                                                                                                                                                                                                                                                                                                                  cause?: unknown
                                                                                                                                                                                                                                                                                                                                                                                  message: string
                                                                                                                                                                                                                                                                                                                                                                                  name: string
                                                                                                                                                                                                                                                                                                                                                                                  stack?: string
                                                                                                                                                                                                                                                                                                                                                                                  stackTraceLimit: number

                                                                                                                                                                                                                                                                                                                                                                                  The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                  The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                  If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                  Methods

                                                                                                                                                                                                                                                                                                                                                                                  • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    const myObject = {};
                                                                                                                                                                                                                                                                                                                                                                                    Error.captureStackTrace(myObject);
                                                                                                                                                                                                                                                                                                                                                                                    myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                    The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                    The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                    The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    function a() {
                                                                                                                                                                                                                                                                                                                                                                                    b();
                                                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                                                    function b() {
                                                                                                                                                                                                                                                                                                                                                                                    c();
                                                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                                                    function c() {
                                                                                                                                                                                                                                                                                                                                                                                    // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                                                                                                                                                                                    const { stackTraceLimit } = Error;
                                                                                                                                                                                                                                                                                                                                                                                    Error.stackTraceLimit = 0;
                                                                                                                                                                                                                                                                                                                                                                                    const error = new Error();
                                                                                                                                                                                                                                                                                                                                                                                    Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                                                                                                                                                                                    // Capture the stack trace above function b
                                                                                                                                                                                                                                                                                                                                                                                    Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                                                                                                                                                                                    throw error;
                                                                                                                                                                                                                                                                                                                                                                                    }

                                                                                                                                                                                                                                                                                                                                                                                    a(); +
                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                    Parameters

                                                                                                                                                                                                                                                                                                                                                                                    • targetObject: object
                                                                                                                                                                                                                                                                                                                                                                                    • OptionalconstructorOpt: Function

                                                                                                                                                                                                                                                                                                                                                                                    Returns void

                                                                                                                                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/classes/_quatrain_types.ObjectUri.html b/docs/public/api-reference/classes/_quatrain_types.ObjectUri.html new file mode 100644 index 00000000..4eecd35c --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_types.ObjectUri.html @@ -0,0 +1,73 @@ +ObjectUri | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                    Unique global reference system for all Quatrain models. +Used for backend identification and cross-system relational links.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    Index

                                                                                                                                                                                                                                                                                                                                                                                    Constructors

                                                                                                                                                                                                                                                                                                                                                                                    • Creates a new ObjectUri instance from a path string. +ex: 'xyz', '@backend:xyz', 'collection/xyz', '@backend:collection/xyz'

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                                                      • str: string = ''

                                                                                                                                                                                                                                                                                                                                                                                        Partial or full resource path.

                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                      • label: string | undefined = ''

                                                                                                                                                                                                                                                                                                                                                                                        Optional label describing the resource path.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                      Returns ObjectUri

                                                                                                                                                                                                                                                                                                                                                                                    Properties

                                                                                                                                                                                                                                                                                                                                                                                    _backend: string | undefined

                                                                                                                                                                                                                                                                                                                                                                                    Target backend identifier.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    _collection: string | undefined = undefined

                                                                                                                                                                                                                                                                                                                                                                                    Collection name context.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    _label: string | undefined = ''

                                                                                                                                                                                                                                                                                                                                                                                    Human-readable label representation.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    _literal: string = ''

                                                                                                                                                                                                                                                                                                                                                                                    The literal representation including backend name.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    _objClass: any

                                                                                                                                                                                                                                                                                                                                                                                    Object model class reference.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    _pairs: string[] = []

                                                                                                                                                                                                                                                                                                                                                                                    Split pairs of path segments.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    _parent: ObjectUri | undefined

                                                                                                                                                                                                                                                                                                                                                                                    Parent ObjectUri context.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    _path: string = ObjectUri.DEFAULT

                                                                                                                                                                                                                                                                                                                                                                                    Standardized path.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    _str: string

                                                                                                                                                                                                                                                                                                                                                                                    Internal string representation.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    _uid: string | undefined = undefined

                                                                                                                                                                                                                                                                                                                                                                                    Unique resource ID.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    DEFAULT: string = '/'

                                                                                                                                                                                                                                                                                                                                                                                    Root path divider.

                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                    MISSING_COLLECTION: string = '_?_'

                                                                                                                                                                                                                                                                                                                                                                                    Placeholder used when collections cannot be guessed.

                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                    Accessors

                                                                                                                                                                                                                                                                                                                                                                                    • get backend(): string | undefined

                                                                                                                                                                                                                                                                                                                                                                                      Retrieves the target backend alias.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Returns string | undefined

                                                                                                                                                                                                                                                                                                                                                                                      The backend identifier, or undefined if not set.

                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                    • get class(): any

                                                                                                                                                                                                                                                                                                                                                                                      Retrieves the model class bound to the URI.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Returns any

                                                                                                                                                                                                                                                                                                                                                                                      The model class reference.

                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                    • set class(objClass: any): void

                                                                                                                                                                                                                                                                                                                                                                                      Binds a model class reference to resolve collection details.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                                                      • objClass: any

                                                                                                                                                                                                                                                                                                                                                                                        The model constructor class.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                                                                                                                                                    • get collection(): string | undefined

                                                                                                                                                                                                                                                                                                                                                                                      Retrieves the collection or table name context.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Returns string | undefined

                                                                                                                                                                                                                                                                                                                                                                                      The collection name, or undefined.

                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                    • set collection(collection: string | undefined): void

                                                                                                                                                                                                                                                                                                                                                                                      Injects a specific collection or table context name.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                                                      • collection: string | undefined

                                                                                                                                                                                                                                                                                                                                                                                        The target collection name.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                                                                                                                                                    • get label(): string | undefined

                                                                                                                                                                                                                                                                                                                                                                                      Retrieves the human-readable label representation.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Returns string | undefined

                                                                                                                                                                                                                                                                                                                                                                                      The descriptive label, or undefined.

                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                    • set label(label: string | undefined): void

                                                                                                                                                                                                                                                                                                                                                                                      Sets the human-readable label representation.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                                                      • label: string | undefined

                                                                                                                                                                                                                                                                                                                                                                                        The descriptive string label.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                                                                                                                                                    • get literal(): string

                                                                                                                                                                                                                                                                                                                                                                                      Return the full path literal, including the backend alias.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Returns string

                                                                                                                                                                                                                                                                                                                                                                                      The fully qualified URI literal.

                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                    • get ownPath(): string

                                                                                                                                                                                                                                                                                                                                                                                      Returns the own path of the resource without the optional parents' paths.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Returns string

                                                                                                                                                                                                                                                                                                                                                                                      The own path segment string.

                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                    • get path(): string

                                                                                                                                                                                                                                                                                                                                                                                      Returns the full path of the resource, including optional parents' paths.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Returns string

                                                                                                                                                                                                                                                                                                                                                                                      The computed path string.

                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                    • set path(path: string): void

                                                                                                                                                                                                                                                                                                                                                                                      Overwrites the path and automatically recalculates collection details.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Parameters

                                                                                                                                                                                                                                                                                                                                                                                      • path: string

                                                                                                                                                                                                                                                                                                                                                                                        The new relative path segment.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                      Returns void

                                                                                                                                                                                                                                                                                                                                                                                    Methods

                                                                                                                                                                                                                                                                                                                                                                                    • Returns references to locate the target object locally and remotely.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Returns { label: string | undefined; ref: string; uri: string }

                                                                                                                                                                                                                                                                                                                                                                                      An object detailing path, uri literal, and label.

                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/classes/_quatrain_types.ResourceError.html b/docs/public/api-reference/classes/_quatrain_types.ResourceError.html new file mode 100644 index 00000000..1b8f8963 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_types.ResourceError.html @@ -0,0 +1,36 @@ +ResourceError | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                      Class ResourceError

                                                                                                                                                                                                                                                                                                                                                                                      Global abstraction identifying Quatrain-specific execution exceptions.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                                      Index

                                                                                                                                                                                                                                                                                                                                                                                      Constructors

                                                                                                                                                                                                                                                                                                                                                                                      Properties

                                                                                                                                                                                                                                                                                                                                                                                      cause?: unknown
                                                                                                                                                                                                                                                                                                                                                                                      message: string
                                                                                                                                                                                                                                                                                                                                                                                      name: string
                                                                                                                                                                                                                                                                                                                                                                                      stack?: string
                                                                                                                                                                                                                                                                                                                                                                                      stackTraceLimit: number

                                                                                                                                                                                                                                                                                                                                                                                      The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                      Methods

                                                                                                                                                                                                                                                                                                                                                                                      • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                        const myObject = {};
                                                                                                                                                                                                                                                                                                                                                                                        Error.captureStackTrace(myObject);
                                                                                                                                                                                                                                                                                                                                                                                        myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                        The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                        The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                        The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                        function a() {
                                                                                                                                                                                                                                                                                                                                                                                        b();
                                                                                                                                                                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                                                                                                                                                                        function b() {
                                                                                                                                                                                                                                                                                                                                                                                        c();
                                                                                                                                                                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                                                                                                                                                                        function c() {
                                                                                                                                                                                                                                                                                                                                                                                        // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                                                                                                                                                                                        const { stackTraceLimit } = Error;
                                                                                                                                                                                                                                                                                                                                                                                        Error.stackTraceLimit = 0;
                                                                                                                                                                                                                                                                                                                                                                                        const error = new Error();
                                                                                                                                                                                                                                                                                                                                                                                        Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                                                                                                                                                                                        // Capture the stack trace above function b
                                                                                                                                                                                                                                                                                                                                                                                        Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                                                                                                                                                                                        throw error;
                                                                                                                                                                                                                                                                                                                                                                                        }

                                                                                                                                                                                                                                                                                                                                                                                        a(); +
                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                        Parameters

                                                                                                                                                                                                                                                                                                                                                                                        • targetObject: object
                                                                                                                                                                                                                                                                                                                                                                                        • OptionalconstructorOpt: Function

                                                                                                                                                                                                                                                                                                                                                                                        Returns void

                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/classes/_quatrain_types.UnauthorizedError.html b/docs/public/api-reference/classes/_quatrain_types.UnauthorizedError.html new file mode 100644 index 00000000..8f0d03e6 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_types.UnauthorizedError.html @@ -0,0 +1,36 @@ +UnauthorizedError | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                        Class UnauthorizedError

                                                                                                                                                                                                                                                                                                                                                                                        Indicates missing or invalid authentication credentials (e.g., HTTP 401).

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                        Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                                        Index

                                                                                                                                                                                                                                                                                                                                                                                        Constructors

                                                                                                                                                                                                                                                                                                                                                                                        Properties

                                                                                                                                                                                                                                                                                                                                                                                        cause?: unknown
                                                                                                                                                                                                                                                                                                                                                                                        message: string
                                                                                                                                                                                                                                                                                                                                                                                        name: string
                                                                                                                                                                                                                                                                                                                                                                                        stack?: string
                                                                                                                                                                                                                                                                                                                                                                                        stackTraceLimit: number

                                                                                                                                                                                                                                                                                                                                                                                        The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                        The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                        If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                        Methods

                                                                                                                                                                                                                                                                                                                                                                                        • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                          const myObject = {};
                                                                                                                                                                                                                                                                                                                                                                                          Error.captureStackTrace(myObject);
                                                                                                                                                                                                                                                                                                                                                                                          myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                          The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                          The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                          The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                          function a() {
                                                                                                                                                                                                                                                                                                                                                                                          b();
                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                          function b() {
                                                                                                                                                                                                                                                                                                                                                                                          c();
                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                          function c() {
                                                                                                                                                                                                                                                                                                                                                                                          // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                                                                                                                                                                                          const { stackTraceLimit } = Error;
                                                                                                                                                                                                                                                                                                                                                                                          Error.stackTraceLimit = 0;
                                                                                                                                                                                                                                                                                                                                                                                          const error = new Error();
                                                                                                                                                                                                                                                                                                                                                                                          Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                                                                                                                                                                                          // Capture the stack trace above function b
                                                                                                                                                                                                                                                                                                                                                                                          Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                                                                                                                                                                                          throw error;
                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                          a(); +
                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                          Parameters

                                                                                                                                                                                                                                                                                                                                                                                          • targetObject: object
                                                                                                                                                                                                                                                                                                                                                                                          • OptionalconstructorOpt: Function

                                                                                                                                                                                                                                                                                                                                                                                          Returns void

                                                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/classes/_quatrain_types.ValidationError.html b/docs/public/api-reference/classes/_quatrain_types.ValidationError.html new file mode 100644 index 00000000..1681554d --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_types.ValidationError.html @@ -0,0 +1,39 @@ +ValidationError | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                          Class ValidationError

                                                                                                                                                                                                                                                                                                                                                                                          Indicates property rejection. Holds a payload of granular property-specific validation issues.

                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                          Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                                          Index

                                                                                                                                                                                                                                                                                                                                                                                          Constructors

                                                                                                                                                                                                                                                                                                                                                                                          Properties

                                                                                                                                                                                                                                                                                                                                                                                          cause?: unknown
                                                                                                                                                                                                                                                                                                                                                                                          errors: Record<string, string>

                                                                                                                                                                                                                                                                                                                                                                                          Detailed key-value map linking property names to specific violation causes.

                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                          message: string
                                                                                                                                                                                                                                                                                                                                                                                          name: string
                                                                                                                                                                                                                                                                                                                                                                                          stack?: string
                                                                                                                                                                                                                                                                                                                                                                                          stackTraceLimit: number

                                                                                                                                                                                                                                                                                                                                                                                          The Error.stackTraceLimit property specifies the number of stack frames +collected by a stack trace (whether generated by new Error().stack or +Error.captureStackTrace(obj)).

                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                          The default value is 10 but may be set to any valid JavaScript number. Changes +will affect any stack trace captured after the value has been changed.

                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                          If set to a non-number value, or set to a negative number, stack traces will +not capture any frames.

                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                          Methods

                                                                                                                                                                                                                                                                                                                                                                                          • Creates a .stack property on targetObject, which when accessed returns +a string representing the location in the code at which +Error.captureStackTrace() was called.

                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                            const myObject = {};
                                                                                                                                                                                                                                                                                                                                                                                            Error.captureStackTrace(myObject);
                                                                                                                                                                                                                                                                                                                                                                                            myObject.stack; // Similar to `new Error().stack` +
                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                            The first line of the trace will be prefixed with +${myObject.name}: ${myObject.message}.

                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                            The optional constructorOpt argument accepts a function. If given, all frames +above constructorOpt, including constructorOpt, will be omitted from the +generated stack trace.

                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                            The constructorOpt argument is useful for hiding implementation +details of error generation from the user. For instance:

                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                            function a() {
                                                                                                                                                                                                                                                                                                                                                                                            b();
                                                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                                                            function b() {
                                                                                                                                                                                                                                                                                                                                                                                            c();
                                                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                                                            function c() {
                                                                                                                                                                                                                                                                                                                                                                                            // Create an error without stack trace to avoid calculating the stack trace twice.
                                                                                                                                                                                                                                                                                                                                                                                            const { stackTraceLimit } = Error;
                                                                                                                                                                                                                                                                                                                                                                                            Error.stackTraceLimit = 0;
                                                                                                                                                                                                                                                                                                                                                                                            const error = new Error();
                                                                                                                                                                                                                                                                                                                                                                                            Error.stackTraceLimit = stackTraceLimit;

                                                                                                                                                                                                                                                                                                                                                                                            // Capture the stack trace above function b
                                                                                                                                                                                                                                                                                                                                                                                            Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
                                                                                                                                                                                                                                                                                                                                                                                            throw error;
                                                                                                                                                                                                                                                                                                                                                                                            }

                                                                                                                                                                                                                                                                                                                                                                                            a(); +
                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                            Parameters

                                                                                                                                                                                                                                                                                                                                                                                            • targetObject: object
                                                                                                                                                                                                                                                                                                                                                                                            • OptionalconstructorOpt: Function

                                                                                                                                                                                                                                                                                                                                                                                            Returns void

                                                                                                                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/classes/_quatrain_worker.FileSystem.html b/docs/public/api-reference/classes/_quatrain_worker.FileSystem.html new file mode 100644 index 00000000..ae4e1533 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_worker.FileSystem.html @@ -0,0 +1,32 @@ +FileSystem | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                            Utility class providing synchronous and asynchronous file system operations +specifically tailored for the worker environment (e.g., managing temp folders, downloading remote files).

                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                            Index

                                                                                                                                                                                                                                                                                                                                                                                            Constructors

                                                                                                                                                                                                                                                                                                                                                                                            Methods

                                                                                                                                                                                                                                                                                                                                                                                            • Downloads a file from an external HTTP/HTTPS URL into the local filesystem.

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                                                              • url: string

                                                                                                                                                                                                                                                                                                                                                                                                The remote resource URL.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                              • filepath: string

                                                                                                                                                                                                                                                                                                                                                                                                The local destination path.

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                              Returns Promise<unknown>

                                                                                                                                                                                                                                                                                                                                                                                              A promise resolving when the download finishes.

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              If the HTTP request or stream fails.

                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                            • Return meta data on given file

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                                                              • file: string

                                                                                                                                                                                                                                                                                                                                                                                              Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                                                                            • Synchronously creates a single directory.

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                                                              • folder: string

                                                                                                                                                                                                                                                                                                                                                                                                The directory path.

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                                                                                                                            • Prepares a clean processing directory, creating it along with required subdirectories (images, vecto). +Any existing folder with the same name will be deleted first.

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                                                              • folder: string

                                                                                                                                                                                                                                                                                                                                                                                                The base directory path to set up.

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                                                                                                                            • Recursively and synchronously removes a folder and its entire contents.

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                                                              • folder: string

                                                                                                                                                                                                                                                                                                                                                                                                The target directory to destroy.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                              • recursively: boolean = true

                                                                                                                                                                                                                                                                                                                                                                                                Whether to traverse and delete nested folders. Defaults to true.

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                              Returns void

                                                                                                                                                                                                                                                                                                                                                                                              If recursively is false but nested folders are encountered.

                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                            • Sanitizes a string to be used safely as a filename by replacing spaces with underscores.

                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                              Parameters

                                                                                                                                                                                                                                                                                                                                                                                              • name: string

                                                                                                                                                                                                                                                                                                                                                                                                The original string.

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                              Returns string

                                                                                                                                                                                                                                                                                                                                                                                              The sanitized string.

                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/classes/_quatrain_worker.Helpers.html b/docs/public/api-reference/classes/_quatrain_worker.Helpers.html new file mode 100644 index 00000000..2b0ea0f6 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_worker.Helpers.html @@ -0,0 +1,10 @@ +Helpers | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                              General utility class providing common static helpers for workers.

                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                              Index

                                                                                                                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                                                                                                                              Accessors

                                                                                                                                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                                                                                                                              Constructors

                                                                                                                                                                                                                                                                                                                                                                                              Accessors

                                                                                                                                                                                                                                                                                                                                                                                              • get FFMPEG(): Promise<string>

                                                                                                                                                                                                                                                                                                                                                                                                Default absolute path to the system's FFmpeg binary.

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                Returns Promise<string>

                                                                                                                                                                                                                                                                                                                                                                                              Methods

                                                                                                                                                                                                                                                                                                                                                                                              • Generate a thubnail from a video file at given frame position

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                Parameters

                                                                                                                                                                                                                                                                                                                                                                                                • videoPath: string

                                                                                                                                                                                                                                                                                                                                                                                                  path to video file

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • outputPath: string
                                                                                                                                                                                                                                                                                                                                                                                                • frame: number = 0

                                                                                                                                                                                                                                                                                                                                                                                                  frame to extract thumbnail from

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • width: number = 320

                                                                                                                                                                                                                                                                                                                                                                                                  width of thumbnail (4/3 ratio)

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/classes/_quatrain_worker.Worker.html b/docs/public/api-reference/classes/_quatrain_worker.Worker.html new file mode 100644 index 00000000..052069c4 --- /dev/null +++ b/docs/public/api-reference/classes/_quatrain_worker.Worker.html @@ -0,0 +1,95 @@ +Worker | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                The core orchestration class for background task workers. +Manages event reporting, child process execution, and queue listening.

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                Hierarchy (View Summary)

                                                                                                                                                                                                                                                                                                                                                                                                Index

                                                                                                                                                                                                                                                                                                                                                                                                Constructors

                                                                                                                                                                                                                                                                                                                                                                                                Properties

                                                                                                                                                                                                                                                                                                                                                                                                classRegistry: { [key: string]: any } = {}

                                                                                                                                                                                                                                                                                                                                                                                                Dictionary holding registered active Quatrain models/components.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                endpoint: string = ''

                                                                                                                                                                                                                                                                                                                                                                                                The HTTP endpoint used to push worker status events.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                logger: any = ...

                                                                                                                                                                                                                                                                                                                                                                                                Dedicated logger instance for the worker subsystem.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                logLevel: DEBUG = LogLevel.DEBUG

                                                                                                                                                                                                                                                                                                                                                                                                System-wide base log verbosity.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                me: string = ...

                                                                                                                                                                                                                                                                                                                                                                                                Identifying namespace for this core component.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                storage: typeof NodePersist = persist

                                                                                                                                                                                                                                                                                                                                                                                                Persistent key-value storage engine reference.

                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                storagePrefix: "core" = 'core'

                                                                                                                                                                                                                                                                                                                                                                                                Context prefix string for scoped storage keys.

                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                Accessors

                                                                                                                                                                                                                                                                                                                                                                                                • get userClass(): any

                                                                                                                                                                                                                                                                                                                                                                                                  Returns any

                                                                                                                                                                                                                                                                                                                                                                                                • set userClass(cls: any): void

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • cls: any

                                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                                Methods

                                                                                                                                                                                                                                                                                                                                                                                                • Maps a specific entity class to an active name so the factory reflection can locate it.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • name: string

                                                                                                                                                                                                                                                                                                                                                                                                    Semantic registry name.

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                  • obj: any

                                                                                                                                                                                                                                                                                                                                                                                                    Class constructor.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                                • Stores a primitive value durably in the core storage instance.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • key: string

                                                                                                                                                                                                                                                                                                                                                                                                    Identification string.

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                  • value: any

                                                                                                                                                                                                                                                                                                                                                                                                    Value.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns Promise<void>

                                                                                                                                                                                                                                                                                                                                                                                                • Injects a new logger block under a specific namespace alias.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • alias: string = ...

                                                                                                                                                                                                                                                                                                                                                                                                    The logging context name.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns any

                                                                                                                                                                                                                                                                                                                                                                                                  Instantiated LoggerAdapter.

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • Triggers a debug log on the core logger.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                                • Deprecated: Reserved schema definition hook.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • key: string

                                                                                                                                                                                                                                                                                                                                                                                                    The property block to generate.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns { manifest: { mandatory: boolean; type: StringConstructor } }

                                                                                                                                                                                                                                                                                                                                                                                                  Field definitions block.

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • Triggers an error log on the core logger.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                                • Returns an injected class constructor by its registry identifier.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • name: string

                                                                                                                                                                                                                                                                                                                                                                                                    The semantic name to resolve.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns any

                                                                                                                                                                                                                                                                                                                                                                                                  Class definition.

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • Recovers a durably persisted value from the storage layer.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • key: string

                                                                                                                                                                                                                                                                                                                                                                                                    The target identifier.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns Promise<any>

                                                                                                                                                                                                                                                                                                                                                                                                  The recovered value.

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • Utility lookup to find executable paths in the system using which.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • command: string

                                                                                                                                                                                                                                                                                                                                                                                                    The executable.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns Promise<string>

                                                                                                                                                                                                                                                                                                                                                                                                  The resolved system path.

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • Triggers an info log on the core logger.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                                • Triggers a standard log on the core logger.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                                • Push an event to the backend endpoint, if available

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • event: string

                                                                                                                                                                                                                                                                                                                                                                                                    string

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                  • data: {} = {}
                                                                                                                                                                                                                                                                                                                                                                                                  • ts: number = 0

                                                                                                                                                                                                                                                                                                                                                                                                    timestamp

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                                  boolean

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • Async Push an event to the backend endpoint, if available

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • event: string

                                                                                                                                                                                                                                                                                                                                                                                                    string

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                  • data: {} = {}
                                                                                                                                                                                                                                                                                                                                                                                                  • ts: number = 0

                                                                                                                                                                                                                                                                                                                                                                                                    timestamp

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns Promise<true | undefined>

                                                                                                                                                                                                                                                                                                                                                                                                  boolean

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • Execution suspension utility blocking the event loop context.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • seconds: number = 1

                                                                                                                                                                                                                                                                                                                                                                                                    Duration count.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns Promise<unknown>

                                                                                                                                                                                                                                                                                                                                                                                                  The promise to await.

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                • Triggers a trace log on the core logger.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                                • Triggers a warning log on the core logger.

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  Parameters

                                                                                                                                                                                                                                                                                                                                                                                                  • ...message: any

                                                                                                                                                                                                                                                                                                                                                                                                    Content to log.

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                  Returns void

                                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/documents/api-client_HOWTO.html b/docs/public/api-reference/documents/api-client_HOWTO.html index 47507c38..9ff0e79f 100644 --- a/docs/public/api-reference/documents/api-client_HOWTO.html +++ b/docs/public/api-reference/documents/api-client_HOWTO.html @@ -8,7 +8,7 @@

                                                                                                                                                                                                                                                                                                                                                                                                The client provides helper methods for standard REST operations. All methods return a standard ApiPayload wrapper containing data and meta.

                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                // Fetch a list (with query parameters)
                                                                                                                                                                                                                                                                                                                                                                                                const response = await apiClient.get('models', { offset: 0, batch: 50 });
                                                                                                                                                                                                                                                                                                                                                                                                console.log(response.data);

                                                                                                                                                                                                                                                                                                                                                                                                // Fetch a single item
                                                                                                                                                                                                                                                                                                                                                                                                const model = await apiClient.get(`models/${id}`); +
                                                                                                                                                                                                                                                                                                                                                                                                // Fetch a list (with query parameters)
                                                                                                                                                                                                                                                                                                                                                                                                const response = await apiClient.get('models', { offset: 0, batch: 50 });
                                                                                                                                                                                                                                                                                                                                                                                                console.log(response.data);

                                                                                                                                                                                                                                                                                                                                                                                                // Fetch a single item
                                                                                                                                                                                                                                                                                                                                                                                                const model = await apiClient.get(`models/${id}`);

                                                                                                                                                                                                                                                                                                                                                                                                POST

                                                                                                                                                                                                                                                                                                                                                                                                @@ -25,7 +25,7 @@

                                                                                                                                                                                                                                                                                                                                                                                                If your API requires authentication, you can pass an AuthProvider instance to the ApiClient.

                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                import { AuthProvider } from '@quatrain/api-client';

                                                                                                                                                                                                                                                                                                                                                                                                class MyAuthProvider extends AuthProvider {
                                                                                                                                                                                                                                                                                                                                                                                                getToken() {
                                                                                                                                                                                                                                                                                                                                                                                                return localStorage.getItem('token');
                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                apiClient.authProvider = new MyAuthProvider();
                                                                                                                                                                                                                                                                                                                                                                                                // All subsequent requests will include the 'Authorization: Bearer <token>' header. +
                                                                                                                                                                                                                                                                                                                                                                                                import { AuthProvider } from '@quatrain/api-client';

                                                                                                                                                                                                                                                                                                                                                                                                class MyAuthProvider extends AuthProvider {
                                                                                                                                                                                                                                                                                                                                                                                                getToken() {
                                                                                                                                                                                                                                                                                                                                                                                                return localStorage.getItem('token');
                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                apiClient.authProvider = new MyAuthProvider();
                                                                                                                                                                                                                                                                                                                                                                                                // All subsequent requests will include the 'Authorization: Bearer <token>' header.
                                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/documents/api-server-astro_HOWTO.html b/docs/public/api-reference/documents/api-server-astro_HOWTO.html new file mode 100644 index 00000000..d907cc6b --- /dev/null +++ b/docs/public/api-reference/documents/api-server-astro_HOWTO.html @@ -0,0 +1,14 @@ +api-server-astro/HOWTO | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                  HOWTO: Using @quatrain/api-server-astro

                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                  This document guides you on routing API endpoints through Astro.

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                  + +

                                                                                                                                                                                                                                                                                                                                                                                                  Create a catch-all server endpoint in Astro (e.g. src/pages/api/[...path].ts) and bind the AstroAdapter:

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                  import { AstroAdapter } from '@quatrain/api-server-astro';
                                                                                                                                                                                                                                                                                                                                                                                                  import { setupApiServer } from '../your-api-setup'; // Your API router configuration

                                                                                                                                                                                                                                                                                                                                                                                                  const adapter = new AstroAdapter('/api');
                                                                                                                                                                                                                                                                                                                                                                                                  setupApiServer(adapter);

                                                                                                                                                                                                                                                                                                                                                                                                  // Export Astro APIRoute handlers
                                                                                                                                                                                                                                                                                                                                                                                                  export const ALL = adapter.handle(); +
                                                                                                                                                                                                                                                                                                                                                                                                  + + +

                                                                                                                                                                                                                                                                                                                                                                                                  If you only want to wrap a single Quatrain API handler as an Astro APIRoute:

                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                  import { AstroAdapter } from '@quatrain/api-server-astro';
                                                                                                                                                                                                                                                                                                                                                                                                  import { ApiRequest, ApiResponse } from '@quatrain/api';

                                                                                                                                                                                                                                                                                                                                                                                                  const myHandler = async (req: ApiRequest, res: ApiResponse) => {
                                                                                                                                                                                                                                                                                                                                                                                                  res.json({ message: 'Hello from Astro!' });
                                                                                                                                                                                                                                                                                                                                                                                                  };

                                                                                                                                                                                                                                                                                                                                                                                                  export const GET = AstroAdapter.wrap(myHandler); +
                                                                                                                                                                                                                                                                                                                                                                                                  + +
                                                                                                                                                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/documents/api-server-astro_README.html b/docs/public/api-reference/documents/api-server-astro_README.html new file mode 100644 index 00000000..860790e6 --- /dev/null +++ b/docs/public/api-reference/documents/api-server-astro_README.html @@ -0,0 +1,14 @@ +api-server-astro/README | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                    @quatrain/api-server-astro

                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                    Astro Adapter for the Quatrain API Server. It bridges the Quatrain API server interface with the web standard Request/Response API used natively by Astro endpoints.

                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                    • Standard Astro APIRoute compatibility: Easily host Quatrain API handlers inside Astro server routes.
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • Express-like Route Parsing: Supports catch-all routes and extracts route parameters dynamically.
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    • Response Recording: Records Quatrain API responses and translates them to native Astro standard Responses.
                                                                                                                                                                                                                                                                                                                                                                                                    • +
                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                    Refer to HOWTO.md for integration details.

                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                    AGPL-3.0-only

                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/documents/api-server-express_HOWTO.html b/docs/public/api-reference/documents/api-server-express_HOWTO.html index 6458dc1e..44ccdb38 100644 --- a/docs/public/api-reference/documents/api-server-express_HOWTO.html +++ b/docs/public/api-reference/documents/api-server-express_HOWTO.html @@ -11,7 +11,7 @@
                                                                                                                                                                                                                                                                                                                                                                                                    -
                                                                                                                                                                                                                                                                                                                                                                                                    const PORT = 4000;
                                                                                                                                                                                                                                                                                                                                                                                                    server.start(PORT, () => {
                                                                                                                                                                                                                                                                                                                                                                                                    Api.info(`Server listening on port ${PORT}`);
                                                                                                                                                                                                                                                                                                                                                                                                    }); +
                                                                                                                                                                                                                                                                                                                                                                                                    const PORT = 4000;
                                                                                                                                                                                                                                                                                                                                                                                                    server.start(PORT, () => {
                                                                                                                                                                                                                                                                                                                                                                                                    Api.info(`Server listening on port ${PORT}`);
                                                                                                                                                                                                                                                                                                                                                                                                    });
                                                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/documents/api-xmlrpc_HOWTO.html b/docs/public/api-reference/documents/api-xmlrpc_HOWTO.html new file mode 100644 index 00000000..16bf9379 --- /dev/null +++ b/docs/public/api-reference/documents/api-xmlrpc_HOWTO.html @@ -0,0 +1,14 @@ +api-xmlrpc/HOWTO | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                      HOWTO: Using @quatrain/api-xmlrpc

                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                      This document shows how to initialize and use the XML-RPC client wrapper.

                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                                                                                      Provide target connection options to instantiate XmlRpcClient:

                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                      import { XmlRpcClient } from '@quatrain/api-xmlrpc';

                                                                                                                                                                                                                                                                                                                                                                                                      const client = new XmlRpcClient({
                                                                                                                                                                                                                                                                                                                                                                                                      host: 'odoo.example.com',
                                                                                                                                                                                                                                                                                                                                                                                                      port: 443,
                                                                                                                                                                                                                                                                                                                                                                                                      path: '/xmlrpc/2/common',
                                                                                                                                                                                                                                                                                                                                                                                                      secure: true
                                                                                                                                                                                                                                                                                                                                                                                                      }); +
                                                                                                                                                                                                                                                                                                                                                                                                      + + +

                                                                                                                                                                                                                                                                                                                                                                                                      Use the methodCall method to execute calls asynchronously. It returns a Promise:

                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                      try {
                                                                                                                                                                                                                                                                                                                                                                                                      const version = await client.methodCall('version', []);
                                                                                                                                                                                                                                                                                                                                                                                                      console.log('Odoo Version Details:', version);
                                                                                                                                                                                                                                                                                                                                                                                                      } catch (err) {
                                                                                                                                                                                                                                                                                                                                                                                                      console.error('Connection failed:', err);
                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/documents/api-xmlrpc_README.html b/docs/public/api-reference/documents/api-xmlrpc_README.html new file mode 100644 index 00000000..f8dcd263 --- /dev/null +++ b/docs/public/api-reference/documents/api-xmlrpc_README.html @@ -0,0 +1,14 @@ +api-xmlrpc/README | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                        @quatrain/api-xmlrpc

                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                        An XML-RPC client package designed for the Quatrain Core framework. It provides a simple, Promise-based wrapper around the XML-RPC protocol.

                                                                                                                                                                                                                                                                                                                                                                                                        + +
                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                        • Promise-based API: Replaces node-style callback interfaces with modern async/await patterns.
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • Support for secure connections: Easily toggle secure HTTPS execution.
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        • Seamless integration: Built specifically to connect with external systems utilizing the XML-RPC protocol (e.g. Odoo).
                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                        Refer to the HOWTO.md file for code examples and configuration details.

                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                        AGPL-3.0-only

                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/documents/api_HOWTO.html b/docs/public/api-reference/documents/api_HOWTO.html index 7f52d546..90504c3e 100644 --- a/docs/public/api-reference/documents/api_HOWTO.html +++ b/docs/public/api-reference/documents/api_HOWTO.html @@ -2,7 +2,7 @@

                                                                                                                                                                                                                                                                                                                                                                                                        The @quatrain/api package contains shared types and base classes for all API-related logic in the Quatrain framework.

                                                                                                                                                                                                                                                                                                                                                                                                        When defining custom responses or interacting with data across the network, use the ApiPayload interface:

                                                                                                                                                                                                                                                                                                                                                                                                        -
                                                                                                                                                                                                                                                                                                                                                                                                        import { ApiPayload } from '@quatrain/api';

                                                                                                                                                                                                                                                                                                                                                                                                        const myPayload: ApiPayload = {
                                                                                                                                                                                                                                                                                                                                                                                                        data: [
                                                                                                                                                                                                                                                                                                                                                                                                        { uid: '123', name: 'Test' }
                                                                                                                                                                                                                                                                                                                                                                                                        ],
                                                                                                                                                                                                                                                                                                                                                                                                        meta: {
                                                                                                                                                                                                                                                                                                                                                                                                        count: 1,
                                                                                                                                                                                                                                                                                                                                                                                                        offset: 0,
                                                                                                                                                                                                                                                                                                                                                                                                        batch: 10
                                                                                                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                                                                                                        }; +
                                                                                                                                                                                                                                                                                                                                                                                                        import { ApiPayload } from '@quatrain/api';

                                                                                                                                                                                                                                                                                                                                                                                                        const myPayload: ApiPayload = {
                                                                                                                                                                                                                                                                                                                                                                                                        data: [
                                                                                                                                                                                                                                                                                                                                                                                                        { uid: '123', name: 'Test' }
                                                                                                                                                                                                                                                                                                                                                                                                        ],
                                                                                                                                                                                                                                                                                                                                                                                                        meta: {
                                                                                                                                                                                                                                                                                                                                                                                                        count: 1,
                                                                                                                                                                                                                                                                                                                                                                                                        offset: 0,
                                                                                                                                                                                                                                                                                                                                                                                                        batch: 10
                                                                                                                                                                                                                                                                                                                                                                                                        }
                                                                                                                                                                                                                                                                                                                                                                                                        };
                                                                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/documents/app_HOWTO.html b/docs/public/api-reference/documents/app_HOWTO.html new file mode 100644 index 00000000..f60c810b --- /dev/null +++ b/docs/public/api-reference/documents/app_HOWTO.html @@ -0,0 +1,58 @@ +app/HOWTO | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                          Application Composition & Ports/Adapters Guide (@quatrain/app)

                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                          This document provides a comprehensive guide on the Hexagonal Application Composition Model defined in @quatrain/types and orchestrated via @quatrain/app.

                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                          Quatrain applications strictly follow the Hexagonal Architecture (Ports & Adapters) design pattern:

                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                          • The Deliverable Application Payload (AppContentInterface): Represents the user-facing application deliverable (such as a PWA, a Web Bundle, a CLI tool, or Native Assets). It is 100% agnostic to deployment topology.
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Pivot Classes (Ai, Backend, Storage, Auth, Queue, Messaging): Central registries and lifecycle managers in Quatrain Core that can hold single or multiple named adapter instances.
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Composition (AppCompositionInterface): A typed, isomorphic contract that glues a deliverable application payload with its runtime context of Quatrain infrastructure adapters.
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                          Whether an application runs as a Local Single-User App, an Offline Mobile App (Native WebView Shell), or a Multi-Tenant Cloud SaaS, the application core remains unchanged; only the context of bound infrastructure adapters changes.

                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                          All shared composition contracts reside in @quatrain/types to ensure isomorphic sharing across both frontend (browser/WebView) and backend (Node/Bun) environments with zero bundle bloat:

                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                          import type { 
                                                                                                                                                                                                                                                                                                                                                                                                          AppCompositionInterface,
                                                                                                                                                                                                                                                                                                                                                                                                          PWAContentInterface,
                                                                                                                                                                                                                                                                                                                                                                                                          PivotAdaptersSpec,
                                                                                                                                                                                                                                                                                                                                                                                                          AdapterConfigSpec
                                                                                                                                                                                                                                                                                                                                                                                                          } from '@quatrain/types'; +
                                                                                                                                                                                                                                                                                                                                                                                                          + + +
                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                          • AdapterConfigSpec: Specifies a single adapter package, class, and configuration options.
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • PivotAdaptersSpec: Configures either a single default adapter or a map of named adapters for a pivot class (e.g. ai.default, ai.transcription).
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • AppContentInterface: Base interface describing any deliverable payload (pwa, web-bundle, cli, native).
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • PWAContentInterface: Specialized payload contract for Progressive Web Applications.
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • AppCompositionInterface<TContent>: Isomorphic glue binding TContent with its pivot adapters and domain config.
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                          Modaka is a local-first personal knowledge copilot. It exports its composition using AppCompositionInterface<PWAContentInterface>.

                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                          // modaka/src/composition.ts
                                                                                                                                                                                                                                                                                                                                                                                                          import type { AppCompositionInterface, PWAContentInterface } from '@quatrain/types';

                                                                                                                                                                                                                                                                                                                                                                                                          export const modakaComposition: AppCompositionInterface<PWAContentInterface> = {
                                                                                                                                                                                                                                                                                                                                                                                                          content: {
                                                                                                                                                                                                                                                                                                                                                                                                          type: 'pwa',
                                                                                                                                                                                                                                                                                                                                                                                                          name: 'modaka',
                                                                                                                                                                                                                                                                                                                                                                                                          version: '1.0.0',
                                                                                                                                                                                                                                                                                                                                                                                                          distPath: './dist',
                                                                                                                                                                                                                                                                                                                                                                                                          manifest: {
                                                                                                                                                                                                                                                                                                                                                                                                          name: 'Modaka Second Brain',
                                                                                                                                                                                                                                                                                                                                                                                                          short_name: 'Modaka',
                                                                                                                                                                                                                                                                                                                                                                                                          theme_color: '#090d16',
                                                                                                                                                                                                                                                                                                                                                                                                          background_color: '#090d16'
                                                                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                          },
                                                                                                                                                                                                                                                                                                                                                                                                          adapters: {
                                                                                                                                                                                                                                                                                                                                                                                                          // Pivot class Ai holding Gemini text generation and Whisper audio transcription
                                                                                                                                                                                                                                                                                                                                                                                                          ai: {
                                                                                                                                                                                                                                                                                                                                                                                                          default: { package: '@quatrain/ai-gemini', adapter: 'GeminiAdapter' },
                                                                                                                                                                                                                                                                                                                                                                                                          transcription: { package: '@quatrain/ai-whisper', adapter: 'WhisperAdapter' }
                                                                                                                                                                                                                                                                                                                                                                                                          },
                                                                                                                                                                                                                                                                                                                                                                                                          // Local SQLite backend for desktop/local deployment
                                                                                                                                                                                                                                                                                                                                                                                                          backend: { package: '@quatrain/backend-sqlite', adapter: 'SQLiteAdapter' },
                                                                                                                                                                                                                                                                                                                                                                                                          // Local disk storage for OKF documents
                                                                                                                                                                                                                                                                                                                                                                                                          storage: { package: '@quatrain/storage-local', adapter: 'LocalStorageAdapter' },
                                                                                                                                                                                                                                                                                                                                                                                                          // GitHub OAuth authentication provider
                                                                                                                                                                                                                                                                                                                                                                                                          auth: { package: '@quatrain/auth-github', adapter: 'GitHubAuthAdapter' }
                                                                                                                                                                                                                                                                                                                                                                                                          },
                                                                                                                                                                                                                                                                                                                                                                                                          config: {
                                                                                                                                                                                                                                                                                                                                                                                                          okfRoot: './second-brain-data/content',
                                                                                                                                                                                                                                                                                                                                                                                                          defaultCategory: 'inbox'
                                                                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                          }; +
                                                                                                                                                                                                                                                                                                                                                                                                          + + +
                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                          1. Local Desktop / PWA Mode: Bootstrapped via AppBootloader.bootstrap() with local disk storage and SQLite.
                                                                                                                                                                                                                                                                                                                                                                                                          2. +
                                                                                                                                                                                                                                                                                                                                                                                                          3. Mobile App Mode (modaka-app): Embedded inside an Expo React Native WebView shell. The mobile shell injects a native bridge adapter (expo-sqlite, expo-audio) into the composition context without changing Modaka's UI or domain code.
                                                                                                                                                                                                                                                                                                                                                                                                          4. +
                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                          Hey Brad is a verticalized domain application built for the agricultural sector. It extends the knowledge engine by injecting agricultural system prompts, domain-specific schemas, and agricultural UI styling while connecting to cloud multi-tenant adapters.

                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                          // hey-brad/src/composition.ts
                                                                                                                                                                                                                                                                                                                                                                                                          import type { AppCompositionInterface, PWAContentInterface } from '@quatrain/types';

                                                                                                                                                                                                                                                                                                                                                                                                          export const heyBradComposition: AppCompositionInterface<PWAContentInterface> = {
                                                                                                                                                                                                                                                                                                                                                                                                          content: {
                                                                                                                                                                                                                                                                                                                                                                                                          type: 'pwa',
                                                                                                                                                                                                                                                                                                                                                                                                          name: 'hey-brad',
                                                                                                                                                                                                                                                                                                                                                                                                          version: '1.0.0',
                                                                                                                                                                                                                                                                                                                                                                                                          distPath: './dist',
                                                                                                                                                                                                                                                                                                                                                                                                          theme: {
                                                                                                                                                                                                                                                                                                                                                                                                          primaryColor: '#2e7d32', // Agronomic green
                                                                                                                                                                                                                                                                                                                                                                                                          accentColor: '#81c784'
                                                                                                                                                                                                                                                                                                                                                                                                          },
                                                                                                                                                                                                                                                                                                                                                                                                          manifest: {
                                                                                                                                                                                                                                                                                                                                                                                                          name: 'Hey Brad — Agricultural AI Companion',
                                                                                                                                                                                                                                                                                                                                                                                                          short_name: 'HeyBrad'
                                                                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                          },
                                                                                                                                                                                                                                                                                                                                                                                                          adapters: {
                                                                                                                                                                                                                                                                                                                                                                                                          // Multi-tenant Cloud AI configuration
                                                                                                                                                                                                                                                                                                                                                                                                          ai: {
                                                                                                                                                                                                                                                                                                                                                                                                          default: { package: '@quatrain/ai-gemini', adapter: 'GeminiAdapter' }
                                                                                                                                                                                                                                                                                                                                                                                                          },
                                                                                                                                                                                                                                                                                                                                                                                                          // Cloud PostgreSQL backend for tenant data
                                                                                                                                                                                                                                                                                                                                                                                                          backend: { package: '@quatrain/backend-postgres', adapter: 'PostgreSQLAdapter' },
                                                                                                                                                                                                                                                                                                                                                                                                          // Managed S3 bucket storage for farm documents and images
                                                                                                                                                                                                                                                                                                                                                                                                          storage: { package: '@quatrain/storage-s3', adapter: 'S3StorageAdapter' },
                                                                                                                                                                                                                                                                                                                                                                                                          // Supabase / OIDC authentication for agricultural enterprise tenants
                                                                                                                                                                                                                                                                                                                                                                                                          auth: { package: '@quatrain/auth-supabase', adapter: 'SupabaseAuthAdapter' }
                                                                                                                                                                                                                                                                                                                                                                                                          },
                                                                                                                                                                                                                                                                                                                                                                                                          config: {
                                                                                                                                                                                                                                                                                                                                                                                                          domain: 'agronomy',
                                                                                                                                                                                                                                                                                                                                                                                                          systemPromptPath: './prompts/agronomic-rules.yaml',
                                                                                                                                                                                                                                                                                                                                                                                                          supportedCrops: ['wheat', 'corn', 'vineyard', 'fruit-trees']
                                                                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                          }; +
                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                          To bootstrap any composition at runtime, pass the configuration to AppBootloader:

                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                          import { AppBootloader } from '@quatrain/app';
                                                                                                                                                                                                                                                                                                                                                                                                          import { modakaComposition } from './composition';

                                                                                                                                                                                                                                                                                                                                                                                                          async function main() {
                                                                                                                                                                                                                                                                                                                                                                                                          // Bootstraps all declared adapters into Quatrain Core singletons
                                                                                                                                                                                                                                                                                                                                                                                                          await AppBootloader.bootstrapFromComposition(modakaComposition);
                                                                                                                                                                                                                                                                                                                                                                                                          console.log('Application environment initialized successfully.');
                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                          main(); +
                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                          • Isomorphic Types: Shared contracts reside in @quatrain/types, ensuring zero bundle weight overhead on client builds.
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Multi-Adapter Support: Pivot classes (Ai, Storage, etc.) can host multiple named adapters for specialized sub-tasks.
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          • Total Decoupling: Products (modaka, hey-brad) remain pure PWA/Web deliverables; infrastructure modalities (Mobile, SaaS, Standalone) are simply contexts of adapters glued to the deliverable payload.
                                                                                                                                                                                                                                                                                                                                                                                                          • +
                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/documents/auth-firebase_HOWTO.html b/docs/public/api-reference/documents/auth-firebase_HOWTO.html index ab03e466..5c2c4b49 100644 --- a/docs/public/api-reference/documents/auth-firebase_HOWTO.html +++ b/docs/public/api-reference/documents/auth-firebase_HOWTO.html @@ -7,7 +7,7 @@

                                                                                                                                                                                                                                                                                                                                                                                                          Firebase allows attaching custom claims to a user's token (e.g., for roles). The adapter's verifyToken method will parse these and make them available in the normalized user object.

                                                                                                                                                                                                                                                                                                                                                                                                          -
                                                                                                                                                                                                                                                                                                                                                                                                          import { Auth } from '@quatrain/auth'

                                                                                                                                                                                                                                                                                                                                                                                                          async function checkAdminStatus(token: string) {
                                                                                                                                                                                                                                                                                                                                                                                                          const auth = Auth.getAdapter('firebase')
                                                                                                                                                                                                                                                                                                                                                                                                          const user = await auth.verifyToken(token)

                                                                                                                                                                                                                                                                                                                                                                                                          // User claims are exposed
                                                                                                                                                                                                                                                                                                                                                                                                          if (user.claims && user.claims.admin) {
                                                                                                                                                                                                                                                                                                                                                                                                          console.log('User is an admin')
                                                                                                                                                                                                                                                                                                                                                                                                          } else {
                                                                                                                                                                                                                                                                                                                                                                                                          console.log('Regular user')
                                                                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                          } +
                                                                                                                                                                                                                                                                                                                                                                                                          import { Auth } from '@quatrain/auth'

                                                                                                                                                                                                                                                                                                                                                                                                          async function checkAdminStatus(token: string) {
                                                                                                                                                                                                                                                                                                                                                                                                          const auth = Auth.getAdapter('firebase')
                                                                                                                                                                                                                                                                                                                                                                                                          const user = await auth.verifyToken(token)

                                                                                                                                                                                                                                                                                                                                                                                                          // User claims are exposed
                                                                                                                                                                                                                                                                                                                                                                                                          if (user.claims && user.claims.admin) {
                                                                                                                                                                                                                                                                                                                                                                                                          console.log('User is an admin')
                                                                                                                                                                                                                                                                                                                                                                                                          } else {
                                                                                                                                                                                                                                                                                                                                                                                                          console.log('Regular user')
                                                                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                          }
                                                                                                                                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/documents/auth-github_HOWTO.html b/docs/public/api-reference/documents/auth-github_HOWTO.html new file mode 100644 index 00000000..182ba1df --- /dev/null +++ b/docs/public/api-reference/documents/auth-github_HOWTO.html @@ -0,0 +1,35 @@ +auth-github/HOWTO | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                            HOWTO: Using @quatrain/auth-github

                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                            This guide explains how to configure and use the GitHub OAuth adapter and its associated endpoints.

                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                            First, initialize the adapter using your GitHub OAuth application credentials, and register it to the global Auth manager:

                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                            import { Auth } from '@quatrain/auth'
                                                                                                                                                                                                                                                                                                                                                                                                            import { GithubAuthAdapter } from '@quatrain/auth-github'

                                                                                                                                                                                                                                                                                                                                                                                                            const githubAdapter = GithubAuthAdapter.factory({
                                                                                                                                                                                                                                                                                                                                                                                                            clientId: process.env.GITHUB_CLIENT_ID,
                                                                                                                                                                                                                                                                                                                                                                                                            clientSecret: process.env.GITHUB_CLIENT_SECRET,
                                                                                                                                                                                                                                                                                                                                                                                                            })

                                                                                                                                                                                                                                                                                                                                                                                                            if (githubAdapter) {
                                                                                                                                                                                                                                                                                                                                                                                                            Auth.addProvider(githubAdapter, 'github')
                                                                                                                                                                                                                                                                                                                                                                                                            } +
                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                            To expose the login and callback routes, register them on your ServerAdapter using Auth.registerEndpoints(). This dynamically collects endpoints from all registered adapters and namespaces them.

                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                            import { Auth } from '@quatrain/auth'
                                                                                                                                                                                                                                                                                                                                                                                                            import { AstroAdapter } from '@quatrain/api-server-astro'

                                                                                                                                                                                                                                                                                                                                                                                                            const server = new AstroAdapter()

                                                                                                                                                                                                                                                                                                                                                                                                            // Register all endpoints under /api/auth/[provider_alias]
                                                                                                                                                                                                                                                                                                                                                                                                            Auth.registerEndpoints(server, '/api/auth') +
                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                            This will automatically mount:

                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                            • GET /api/auth/github/login -> Redirects the browser to GitHub login.
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            • GET /api/auth/github/callback -> Handles the OAuth code exchange.
                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                            If the API is consumed by a mobile application, configure the appScheme option during server initialization:

                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                            Auth.addProvider(githubAdapter, 'github')

                                                                                                                                                                                                                                                                                                                                                                                                            // Inside your API setup, specify the target app scheme
                                                                                                                                                                                                                                                                                                                                                                                                            server.addEndpoint(githubAdapter.getEndpointHandler(), '/api/auth/github', {
                                                                                                                                                                                                                                                                                                                                                                                                            appScheme: 'modaka' // Will redirect to modaka://auth/github/callback?token=...
                                                                                                                                                                                                                                                                                                                                                                                                            }) +
                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                            Alternatively, you can pass the app scheme dynamically in the login/callback query string: +GET /api/auth/github/callback?code=CODE&app_scheme=modaka

                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                            The adapter includes helper functions to check and create repositories directly:

                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                            // Check if a repository exists
                                                                                                                                                                                                                                                                                                                                                                                                            const exists = await githubAdapter.checkRepositoryExists(accessToken, 'owner', 'repo-name')

                                                                                                                                                                                                                                                                                                                                                                                                            // Create a new private repository
                                                                                                                                                                                                                                                                                                                                                                                                            if (!exists) {
                                                                                                                                                                                                                                                                                                                                                                                                            const repo = await githubAdapter.createRepository(accessToken, 'repo-name', {
                                                                                                                                                                                                                                                                                                                                                                                                            private: true,
                                                                                                                                                                                                                                                                                                                                                                                                            description: 'Tactile knowledge base repository',
                                                                                                                                                                                                                                                                                                                                                                                                            autoInit: true
                                                                                                                                                                                                                                                                                                                                                                                                            })
                                                                                                                                                                                                                                                                                                                                                                                                            } +
                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/documents/auth-github_README.html b/docs/public/api-reference/documents/auth-github_README.html new file mode 100644 index 00000000..39687cff --- /dev/null +++ b/docs/public/api-reference/documents/auth-github_README.html @@ -0,0 +1,15 @@ +auth-github/README | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                              @quatrain/auth-github

                                                                                                                                                                                                                                                                                                                                                                                                              +

                                                                                                                                                                                                                                                                                                                                                                                                              Authentication adapter and pluggable endpoints for GitHub OAuth 2.0 Web Application Flow.

                                                                                                                                                                                                                                                                                                                                                                                                              + +

                                                                                                                                                                                                                                                                                                                                                                                                              This package is a workspace package within the Quatrain Core monorepo. It depends on @quatrain/auth and @quatrain/api.

                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                              yarn add @quatrain/auth-github
                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                              + + +
                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                              • OAuth 2.0 Flow: Handles authorization URL generation and exchanging code for token.
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • Pluggable API Router: Framework-agnostic GithubAuthApi endpoint handler matching ServerAdapter specification.
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • Deep Linking: Supports generic redirect schemes for mobile contexts.
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              • GitHub API Utilities: Methods to check repository existence and create new repositories.
                                                                                                                                                                                                                                                                                                                                                                                                              • +
                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/documents/auth-http-basic_HOWTO.html b/docs/public/api-reference/documents/auth-http-basic_HOWTO.html new file mode 100644 index 00000000..37e6fe27 --- /dev/null +++ b/docs/public/api-reference/documents/auth-http-basic_HOWTO.html @@ -0,0 +1,14 @@ +auth-http-basic/HOWTO | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                                HOWTO: Using @quatrain/auth-http-basic

                                                                                                                                                                                                                                                                                                                                                                                                                +

                                                                                                                                                                                                                                                                                                                                                                                                                This document shows how to configure and run the Basic Authentication middleware inside your Quatrain API.

                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                + +

                                                                                                                                                                                                                                                                                                                                                                                                                Create a new basic auth verifier manually or via its factory method:

                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                import { AuthBasic } from '@quatrain/auth-http-basic';

                                                                                                                                                                                                                                                                                                                                                                                                                // Manually
                                                                                                                                                                                                                                                                                                                                                                                                                const auth = new AuthBasic('admin', 'super-secret-password');

                                                                                                                                                                                                                                                                                                                                                                                                                // Or from a configuration object
                                                                                                                                                                                                                                                                                                                                                                                                                const configAuth = AuthBasic.factory({
                                                                                                                                                                                                                                                                                                                                                                                                                user: 'admin',
                                                                                                                                                                                                                                                                                                                                                                                                                pass: 'super-secret-password'
                                                                                                                                                                                                                                                                                                                                                                                                                }); +
                                                                                                                                                                                                                                                                                                                                                                                                                + + +

                                                                                                                                                                                                                                                                                                                                                                                                                Register the verifier's middleware on your Quatrain API instance:

                                                                                                                                                                                                                                                                                                                                                                                                                +
                                                                                                                                                                                                                                                                                                                                                                                                                import { Api } from '@quatrain/api';

                                                                                                                                                                                                                                                                                                                                                                                                                const api = new Api();
                                                                                                                                                                                                                                                                                                                                                                                                                api.use(auth.middleware()); +
                                                                                                                                                                                                                                                                                                                                                                                                                + +
                                                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/documents/auth-http-basic_README.html b/docs/public/api-reference/documents/auth-http-basic_README.html new file mode 100644 index 00000000..0ca11484 --- /dev/null +++ b/docs/public/api-reference/documents/auth-http-basic_README.html @@ -0,0 +1,14 @@ +auth-http-basic/README | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                  Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                                  @quatrain/auth-http-basic

                                                                                                                                                                                                                                                                                                                                                                                                                  +

                                                                                                                                                                                                                                                                                                                                                                                                                  Basic HTTP Authentication Adapter (RFC 7617) for the Quatrain API Server.

                                                                                                                                                                                                                                                                                                                                                                                                                  + +
                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Standard RFC 7617 Compliance: Decodes Authorization: Basic <base64> header payloads.
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Isomorphic Support: Works correctly inside standard Express-like contexts and Quatrain API servers.
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  • Simple Configuration: Instantiate with user/password credentials or configuration structures.
                                                                                                                                                                                                                                                                                                                                                                                                                  • +
                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                  + +

                                                                                                                                                                                                                                                                                                                                                                                                                  Refer to HOWTO.md for integration examples.

                                                                                                                                                                                                                                                                                                                                                                                                                  + +

                                                                                                                                                                                                                                                                                                                                                                                                                  AGPL-3.0-only

                                                                                                                                                                                                                                                                                                                                                                                                                  +
                                                                                                                                                                                                                                                                                                                                                                                                                  diff --git a/docs/public/api-reference/documents/auth-rbac_HOWTO.html b/docs/public/api-reference/documents/auth-rbac_HOWTO.html new file mode 100644 index 00000000..e9db671b --- /dev/null +++ b/docs/public/api-reference/documents/auth-rbac_HOWTO.html @@ -0,0 +1,24 @@ +auth-rbac/HOWTO | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                  Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                    Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                                    How-To & Integration Guide : @quatrain/auth-rbac

                                                                                                                                                                                                                                                                                                                                                                                                                    +

                                                                                                                                                                                                                                                                                                                                                                                                                    This guide demonstrates common integration scenarios using @quatrain/auth-rbac across Astro, Express, and headless controllers.

                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                    Declare role hierarchies, entity field rules, and M2M agent tarpit limits:

                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                    import { RbacPolicyEngine, type RoleDefinition } from '@quatrain/auth-rbac'

                                                                                                                                                                                                                                                                                                                                                                                                                    export const appRoles: RoleDefinition[] = [
                                                                                                                                                                                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                                                                                                                                                                                    id: 'reader',
                                                                                                                                                                                                                                                                                                                                                                                                                    name: 'Reader',
                                                                                                                                                                                                                                                                                                                                                                                                                    routes: [
                                                                                                                                                                                                                                                                                                                                                                                                                    { pattern: '/api/curate', methods: ['GET'], access: 'allow' },
                                                                                                                                                                                                                                                                                                                                                                                                                    { pattern: '/public/**', methods: ['*'], access: 'allow' },
                                                                                                                                                                                                                                                                                                                                                                                                                    { pattern: '/**', methods: ['*'], access: 'deny' }
                                                                                                                                                                                                                                                                                                                                                                                                                    ],
                                                                                                                                                                                                                                                                                                                                                                                                                    entities: {
                                                                                                                                                                                                                                                                                                                                                                                                                    'okf-document': {
                                                                                                                                                                                                                                                                                                                                                                                                                    defaultMode: 'readonly',
                                                                                                                                                                                                                                                                                                                                                                                                                    fields: {
                                                                                                                                                                                                                                                                                                                                                                                                                    internalNotes: 'hidden',
                                                                                                                                                                                                                                                                                                                                                                                                                    rawLogs: 'hidden'
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    },
                                                                                                                                                                                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                                                                                                                                                                                    id: 'curator',
                                                                                                                                                                                                                                                                                                                                                                                                                    name: 'Curator',
                                                                                                                                                                                                                                                                                                                                                                                                                    inherits: ['reader'],
                                                                                                                                                                                                                                                                                                                                                                                                                    routes: [
                                                                                                                                                                                                                                                                                                                                                                                                                    { pattern: '/api/curate', methods: ['POST', 'PUT'], access: 'allow' },
                                                                                                                                                                                                                                                                                                                                                                                                                    { pattern: '/api/upload', methods: ['POST'], access: 'allow' }
                                                                                                                                                                                                                                                                                                                                                                                                                    ],
                                                                                                                                                                                                                                                                                                                                                                                                                    entities: {
                                                                                                                                                                                                                                                                                                                                                                                                                    'okf-document': {
                                                                                                                                                                                                                                                                                                                                                                                                                    defaultMode: 'readwrite',
                                                                                                                                                                                                                                                                                                                                                                                                                    fields: {
                                                                                                                                                                                                                                                                                                                                                                                                                    soa: 'readonly',
                                                                                                                                                                                                                                                                                                                                                                                                                    revision: 'readonly',
                                                                                                                                                                                                                                                                                                                                                                                                                    internalNotes: 'hidden'
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    },
                                                                                                                                                                                                                                                                                                                                                                                                                    {
                                                                                                                                                                                                                                                                                                                                                                                                                    id: 'ai-agent',
                                                                                                                                                                                                                                                                                                                                                                                                                    name: 'AI Agent Service',
                                                                                                                                                                                                                                                                                                                                                                                                                    subjectTypes: ['agent', 'service'],
                                                                                                                                                                                                                                                                                                                                                                                                                    routes: [
                                                                                                                                                                                                                                                                                                                                                                                                                    { pattern: '/api/agent/**', methods: ['POST'], access: 'allow' }
                                                                                                                                                                                                                                                                                                                                                                                                                    ],
                                                                                                                                                                                                                                                                                                                                                                                                                    tarpit: {
                                                                                                                                                                                                                                                                                                                                                                                                                    enabled: true,
                                                                                                                                                                                                                                                                                                                                                                                                                    burst: 5,
                                                                                                                                                                                                                                                                                                                                                                                                                    maxRequestsPerMinute: 30,
                                                                                                                                                                                                                                                                                                                                                                                                                    delayMs: 500,
                                                                                                                                                                                                                                                                                                                                                                                                                    blockDurationMs: 60000 // 1 minute temporary lock on abuse
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                                                                                                                                                                                                    ]

                                                                                                                                                                                                                                                                                                                                                                                                                    export const rbacEngine = new RbacPolicyEngine(appRoles) +
                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                    In src/middleware.ts of your Astro application:

                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                    import { sequence } from 'astro:middleware'
                                                                                                                                                                                                                                                                                                                                                                                                                    import { AstroRbacMiddleware } from '@quatrain/auth-rbac'
                                                                                                                                                                                                                                                                                                                                                                                                                    import { rbacEngine } from './lib/rbac'

                                                                                                                                                                                                                                                                                                                                                                                                                    const rbacMiddleware = new AstroRbacMiddleware(rbacEngine, {
                                                                                                                                                                                                                                                                                                                                                                                                                    loginRedirectPath: '/login',
                                                                                                                                                                                                                                                                                                                                                                                                                    forbiddenRedirectPath: '/403',
                                                                                                                                                                                                                                                                                                                                                                                                                    enableTarpitSleep: true
                                                                                                                                                                                                                                                                                                                                                                                                                    })

                                                                                                                                                                                                                                                                                                                                                                                                                    export const onRequest = sequence(
                                                                                                                                                                                                                                                                                                                                                                                                                    // Your auth session middleware setting context.locals.user ...
                                                                                                                                                                                                                                                                                                                                                                                                                    rbacMiddleware.handler()
                                                                                                                                                                                                                                                                                                                                                                                                                    ) +
                                                                                                                                                                                                                                                                                                                                                                                                                    + +

                                                                                                                                                                                                                                                                                                                                                                                                                    Inside an Astro API endpoint (src/pages/api/curate.ts):

                                                                                                                                                                                                                                                                                                                                                                                                                    +
                                                                                                                                                                                                                                                                                                                                                                                                                    import type { APIRoute } from 'astro'

                                                                                                                                                                                                                                                                                                                                                                                                                    export const POST: APIRoute = async ({ request, locals }) => {
                                                                                                                                                                                                                                                                                                                                                                                                                    const rbac = locals.rbac // Injected automatically
                                                                                                                                                                                                                                                                                                                                                                                                                    const body = await request.json()

                                                                                                                                                                                                                                                                                                                                                                                                                    // 1. Sanitize incoming write payload against curator role
                                                                                                                                                                                                                                                                                                                                                                                                                    const safeData = rbac.sanitizeWrite('okf-document', body)

                                                                                                                                                                                                                                                                                                                                                                                                                    // 2. Persist to storage / database
                                                                                                                                                                                                                                                                                                                                                                                                                    const savedItem = await documentService.save(safeData)

                                                                                                                                                                                                                                                                                                                                                                                                                    // 3. Sanitize outgoing read payload
                                                                                                                                                                                                                                                                                                                                                                                                                    const clientResponse = rbac.sanitizeRead('okf-document', savedItem)

                                                                                                                                                                                                                                                                                                                                                                                                                    return new Response(JSON.stringify(clientResponse), {
                                                                                                                                                                                                                                                                                                                                                                                                                    headers: { 'Content-Type': 'application/json' }
                                                                                                                                                                                                                                                                                                                                                                                                                    })
                                                                                                                                                                                                                                                                                                                                                                                                                    } +
                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                    import express from 'express'
                                                                                                                                                                                                                                                                                                                                                                                                                    import { ExpressRbacMiddleware } from '@quatrain/auth-rbac'
                                                                                                                                                                                                                                                                                                                                                                                                                    import { rbacEngine } from './lib/rbac'

                                                                                                                                                                                                                                                                                                                                                                                                                    const app = express()
                                                                                                                                                                                                                                                                                                                                                                                                                    const rbacMiddleware = new ExpressRbacMiddleware(rbacEngine)

                                                                                                                                                                                                                                                                                                                                                                                                                    app.use(express.json())
                                                                                                                                                                                                                                                                                                                                                                                                                    app.use(rbacMiddleware.handler())

                                                                                                                                                                                                                                                                                                                                                                                                                    app.post('/api/curate', (req, res) => {
                                                                                                                                                                                                                                                                                                                                                                                                                    const safeInput = req.rbac.sanitizeWrite('okf-document', req.body)
                                                                                                                                                                                                                                                                                                                                                                                                                    // ... process safeInput
                                                                                                                                                                                                                                                                                                                                                                                                                    res.json(req.rbac.sanitizeRead('okf-document', safeInput))
                                                                                                                                                                                                                                                                                                                                                                                                                    }) +
                                                                                                                                                                                                                                                                                                                                                                                                                    + +
                                                                                                                                                                                                                                                                                                                                                                                                                    diff --git a/docs/public/api-reference/documents/auth-rbac_README.html b/docs/public/api-reference/documents/auth-rbac_README.html new file mode 100644 index 00000000..d905e1c7 --- /dev/null +++ b/docs/public/api-reference/documents/auth-rbac_README.html @@ -0,0 +1,30 @@ +auth-rbac/README | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                    Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                      Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                                      @quatrain/auth-rbac

                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                      License: AGPL-3.0-only
                                                                                                                                                                                                                                                                                                                                                                                                                      +Isomorphic Role-Based Access Control, Field-Level Security, M2M Agent Guards & Tarpitting for Quatrain

                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                      +

                                                                                                                                                                                                                                                                                                                                                                                                                      @quatrain/auth-rbac is an isomorphic, cloud-native authorization engine designed for the Quatrain ecosystem. It provides unified, declarative access control spanning:

                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Macro-Security: Route and endpoint protection (URI patterns + HTTP methods).
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Micro-Security (FLS): Field-Level Security calculating hidden, readonly, and readwrite modes per entity property.
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Automated Payload Sanitization: sanitizeRead() and sanitizeWrite() eliminating schema duplication.
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • M2M & AI Agent Defense: Subject-type separation (human, agent, service) with built-in tarpitting (progressive latency injection and request throttling for automated scraping and runaway agent loops).
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      • Isomorphic Middlewares: Abstract base class with concrete adapters for Express and Astro SSR/API.
                                                                                                                                                                                                                                                                                                                                                                                                                      • +
                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                      + +

                                                                                                                                                                                                                                                                                                                                                                                                                      Within the Quatrain monorepo:

                                                                                                                                                                                                                                                                                                                                                                                                                      +
                                                                                                                                                                                                                                                                                                                                                                                                                      {
                                                                                                                                                                                                                                                                                                                                                                                                                      "dependencies": {
                                                                                                                                                                                                                                                                                                                                                                                                                      "@quatrain/auth-rbac": "workspace:*"
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                      @quatrain/auth-rbac
                                                                                                                                                                                                                                                                                                                                                                                                                      ├── engine/
                                                                                                                                                                                                                                                                                                                                                                                                                      │ ├── RbacPolicyEngine # Resolves role inheritance, route matching, FLS and payload sanitization
                                                                                                                                                                                                                                                                                                                                                                                                                      │ └── TarpitManager # Manages sliding-window request throttling and progressive latency injection
                                                                                                                                                                                                                                                                                                                                                                                                                      ├── middlewares/
                                                                                                                                                                                                                                                                                                                                                                                                                      │ ├── AbstractRbacMiddleware # Agnostic middleware foundation
                                                                                                                                                                                                                                                                                                                                                                                                                      │ ├── ExpressRbacMiddleware # Standard Express (req, res, next) guard
                                                                                                                                                                                                                                                                                                                                                                                                                      │ └── AstroRbacMiddleware # Unified Astro SSR and API guard
                                                                                                                                                                                                                                                                                                                                                                                                                      └── types/ # Strongly typed interfaces and contracts +
                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { RbacPolicyEngine } from '@quatrain/auth-rbac'

                                                                                                                                                                                                                                                                                                                                                                                                                      const engine = new RbacPolicyEngine([
                                                                                                                                                                                                                                                                                                                                                                                                                      {
                                                                                                                                                                                                                                                                                                                                                                                                                      id: 'curator',
                                                                                                                                                                                                                                                                                                                                                                                                                      name: 'Agronomy Curator',
                                                                                                                                                                                                                                                                                                                                                                                                                      routes: [
                                                                                                                                                                                                                                                                                                                                                                                                                      { pattern: '/api/curate', methods: ['GET', 'POST'], access: 'allow' },
                                                                                                                                                                                                                                                                                                                                                                                                                      { pattern: '/**', methods: ['*'], access: 'deny' }
                                                                                                                                                                                                                                                                                                                                                                                                                      ],
                                                                                                                                                                                                                                                                                                                                                                                                                      entities: {
                                                                                                                                                                                                                                                                                                                                                                                                                      'okf-document': {
                                                                                                                                                                                                                                                                                                                                                                                                                      defaultMode: 'readwrite',
                                                                                                                                                                                                                                                                                                                                                                                                                      fields: {
                                                                                                                                                                                                                                                                                                                                                                                                                      soa: 'readonly',
                                                                                                                                                                                                                                                                                                                                                                                                                      internalReviewerNotes: 'hidden'
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      ])

                                                                                                                                                                                                                                                                                                                                                                                                                      const user = { id: 'u1', roles: ['curator'], subjectType: 'human' }

                                                                                                                                                                                                                                                                                                                                                                                                                      // 1. Route check
                                                                                                                                                                                                                                                                                                                                                                                                                      engine.canAccessRoute(user, '/api/curate', 'POST') // true

                                                                                                                                                                                                                                                                                                                                                                                                                      // 2. Field mode check
                                                                                                                                                                                                                                                                                                                                                                                                                      engine.getFieldAccess(user, 'okf-document', 'soa') // 'readonly'
                                                                                                                                                                                                                                                                                                                                                                                                                      engine.getFieldAccess(user, 'okf-document', 'internalReviewerNotes') // 'hidden'

                                                                                                                                                                                                                                                                                                                                                                                                                      // 3. Payload sanitization
                                                                                                                                                                                                                                                                                                                                                                                                                      const cleanPayload = engine.sanitizeWrite(user, 'okf-document', {
                                                                                                                                                                                                                                                                                                                                                                                                                      title: 'Soil Guide',
                                                                                                                                                                                                                                                                                                                                                                                                                      soa: 'malicious/soa', // Stripped automatically
                                                                                                                                                                                                                                                                                                                                                                                                                      internalReviewerNotes: 'Secret' // Stripped automatically
                                                                                                                                                                                                                                                                                                                                                                                                                      }) +
                                                                                                                                                                                                                                                                                                                                                                                                                      + +
                                                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/documents/auth-supabase_HOWTO.html b/docs/public/api-reference/documents/auth-supabase_HOWTO.html index 0aa5a384..42509b5c 100644 --- a/docs/public/api-reference/documents/auth-supabase_HOWTO.html +++ b/docs/public/api-reference/documents/auth-supabase_HOWTO.html @@ -7,7 +7,7 @@

                                                                                                                                                                                                                                                                                                                                                                                                                      Supabase stores user data inside the raw_user_meta_data field. The adapter normalizes this so it's easily accessible after verifying the token.

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      import { Auth } from '@quatrain/auth'

                                                                                                                                                                                                                                                                                                                                                                                                                      async function greetUser(token: string) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const auth = Auth.getAdapter('supabase')
                                                                                                                                                                                                                                                                                                                                                                                                                      const user = await auth.verifyToken(token)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Normalized access to Supabase metadata
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Hello, ${user.metadata.full_name}`)
                                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { Auth } from '@quatrain/auth'

                                                                                                                                                                                                                                                                                                                                                                                                                      async function greetUser(token: string) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const auth = Auth.getAdapter('supabase')
                                                                                                                                                                                                                                                                                                                                                                                                                      const user = await auth.verifyToken(token)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Normalized access to Supabase metadata
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Hello, ${user.metadata.full_name}`)
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/documents/auth_HOWTO.html b/docs/public/api-reference/documents/auth_HOWTO.html index 11471100..072fc4cc 100644 --- a/docs/public/api-reference/documents/auth_HOWTO.html +++ b/docs/public/api-reference/documents/auth_HOWTO.html @@ -13,7 +13,7 @@

                                                                                                                                                                                                                                                                                                                                                                                                                      Use the adapter in your API middleware to protect routes.

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      import { Auth } from '@quatrain/auth'

                                                                                                                                                                                                                                                                                                                                                                                                                      async function authenticateRequest(req, res, next) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const authHeader = req.headers.authorization

                                                                                                                                                                                                                                                                                                                                                                                                                      if (!authHeader || !authHeader.startsWith('Bearer ')) {
                                                                                                                                                                                                                                                                                                                                                                                                                      return res.status(401).send('Unauthorized')
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      const token = authHeader.split(' ')[1]
                                                                                                                                                                                                                                                                                                                                                                                                                      const auth = Auth.getAdapter()

                                                                                                                                                                                                                                                                                                                                                                                                                      try {
                                                                                                                                                                                                                                                                                                                                                                                                                      // verifyToken returns a normalized user object
                                                                                                                                                                                                                                                                                                                                                                                                                      const user = await auth.verifyToken(token)
                                                                                                                                                                                                                                                                                                                                                                                                                      req.user = user // Attach to request context
                                                                                                                                                                                                                                                                                                                                                                                                                      next()
                                                                                                                                                                                                                                                                                                                                                                                                                      } catch (err) {
                                                                                                                                                                                                                                                                                                                                                                                                                      res.status(403).send('Invalid token')
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { Auth } from '@quatrain/auth'

                                                                                                                                                                                                                                                                                                                                                                                                                      async function authenticateRequest(req, res, next) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const authHeader = req.headers.authorization

                                                                                                                                                                                                                                                                                                                                                                                                                      if (!authHeader || !authHeader.startsWith('Bearer ')) {
                                                                                                                                                                                                                                                                                                                                                                                                                      return res.status(401).send('Unauthorized')
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      const token = authHeader.split(' ')[1]
                                                                                                                                                                                                                                                                                                                                                                                                                      const auth = Auth.getAdapter()

                                                                                                                                                                                                                                                                                                                                                                                                                      try {
                                                                                                                                                                                                                                                                                                                                                                                                                      // verifyToken returns a normalized user object
                                                                                                                                                                                                                                                                                                                                                                                                                      const user = await auth.verifyToken(token)
                                                                                                                                                                                                                                                                                                                                                                                                                      req.user = user // Attach to request context
                                                                                                                                                                                                                                                                                                                                                                                                                      next()
                                                                                                                                                                                                                                                                                                                                                                                                                      } catch (err) {
                                                                                                                                                                                                                                                                                                                                                                                                                      res.status(403).send('Invalid token')
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/documents/backend-restapi_README.html b/docs/public/api-reference/documents/backend-restapi_README.html index 072996ed..0608f0ad 100644 --- a/docs/public/api-reference/documents/backend-restapi_README.html +++ b/docs/public/api-reference/documents/backend-restapi_README.html @@ -15,7 +15,7 @@

                                                                                                                                                                                                                                                                                                                                                                                                                      For complex integrations, you can extend the adapter:

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      class CustomRestAdapter extends RestBackendAdapter {
                                                                                                                                                                                                                                                                                                                                                                                                                      protected buildUrl(collectionName: string, uid?: string): string {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Custom URL logic
                                                                                                                                                                                                                                                                                                                                                                                                                      return super.buildUrl(collectionName, uid)
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                                      class CustomRestAdapter extends RestBackendAdapter {
                                                                                                                                                                                                                                                                                                                                                                                                                      protected buildUrl(collectionName: string, uid?: string): string {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Custom URL logic
                                                                                                                                                                                                                                                                                                                                                                                                                      return super.buildUrl(collectionName, uid)
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/documents/backend_HOWTO.html b/docs/public/api-reference/documents/backend_HOWTO.html index b87e24cc..8f17b415 100644 --- a/docs/public/api-reference/documents/backend_HOWTO.html +++ b/docs/public/api-reference/documents/backend_HOWTO.html @@ -5,7 +5,7 @@

                                                                                                                                                                                                                                                                                                                                                                                                                      First, define the InvoiceLine and Invoice models:

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      import { PersistedBaseObject, CollectionProperty } from '@quatrain/backend'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { StringProperty, NumberProperty, ObjectProperty, Core } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                      export class InvoiceLine extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'invoice_lines'
                                                                                                                                                                                                                                                                                                                                                                                                                      static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'description', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'amount', type: NumberProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'category', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'invoice', type: ObjectProperty.TYPE, instanceOf: 'Invoice' }
                                                                                                                                                                                                                                                                                                                                                                                                                      ]
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      export class Invoice extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'invoices'
                                                                                                                                                                                                                                                                                                                                                                                                                      static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'number', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'status', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      {
                                                                                                                                                                                                                                                                                                                                                                                                                      name: 'lines',
                                                                                                                                                                                                                                                                                                                                                                                                                      type: CollectionProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                      instanceOf: InvoiceLine,
                                                                                                                                                                                                                                                                                                                                                                                                                      parentKey: 'invoice'
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      ]
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      // Register models to allow circular object reference resolutions
                                                                                                                                                                                                                                                                                                                                                                                                                      Core.addClass('Invoice', Invoice)
                                                                                                                                                                                                                                                                                                                                                                                                                      Core.addClass('InvoiceLine', InvoiceLine) +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { PersistedBaseObject, CollectionProperty } from '@quatrain/backend'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { StringProperty, NumberProperty, ObjectProperty, Core } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                      export class InvoiceLine extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'invoice_lines'
                                                                                                                                                                                                                                                                                                                                                                                                                      static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'description', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'amount', type: NumberProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'category', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'invoice', type: ObjectProperty.TYPE, instanceOf: 'Invoice' }
                                                                                                                                                                                                                                                                                                                                                                                                                      ]
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      export class Invoice extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'invoices'
                                                                                                                                                                                                                                                                                                                                                                                                                      static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'number', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'status', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      {
                                                                                                                                                                                                                                                                                                                                                                                                                      name: 'lines',
                                                                                                                                                                                                                                                                                                                                                                                                                      type: CollectionProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                      instanceOf: InvoiceLine,
                                                                                                                                                                                                                                                                                                                                                                                                                      parentKey: 'invoice'
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      ]
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      // Register models to allow circular object reference resolutions
                                                                                                                                                                                                                                                                                                                                                                                                                      Core.addClass('Invoice', Invoice)
                                                                                                                                                                                                                                                                                                                                                                                                                      Core.addClass('InvoiceLine', InvoiceLine)

                                                                                                                                                                                                                                                                                                                                                                                                                      @@ -17,36 +17,36 @@

                                                                                                                                                                                                                                                                                                                                                                                                                      When fetching statistics for a dashboard, loading thousands of lines into memory is inefficient. We can query aggregates natively from the database without hydrating any entities.

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      async function printInvoiceSummary(invoiceId: string) {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Load the invoice reference
                                                                                                                                                                                                                                                                                                                                                                                                                      const invoice = await Invoice.fromBackend<Invoice>(invoiceId)
                                                                                                                                                                                                                                                                                                                                                                                                                      const linesProp = invoice.dataObject.get('lines') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // Ensure the collection is not hydrated (toJSON is undefined)
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(linesProp.toJSON()) // -> undefined

                                                                                                                                                                                                                                                                                                                                                                                                                      // 1. Calculate Sum (Total HT)
                                                                                                                                                                                                                                                                                                                                                                                                                      const totalHT = await linesProp.sum('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Total HT: ${totalHT} €`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 2. Calculate Average line amount
                                                                                                                                                                                                                                                                                                                                                                                                                      const averageLine = await linesProp.average('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Average Line Amount: ${averageLine} €`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 3. Find Distinct categories present in invoice lines
                                                                                                                                                                                                                                                                                                                                                                                                                      const categories = await linesProp.distinct('category')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Unique Categories: ${categories.join(', ')}`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 4. Get Min/Max line amounts
                                                                                                                                                                                                                                                                                                                                                                                                                      const minAmount = await linesProp.min('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      const maxAmount = await linesProp.max('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Line Ranges: ${minAmount} € - ${maxAmount} €`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 5. Count total items
                                                                                                                                                                                                                                                                                                                                                                                                                      const totalLinesCount = await linesProp.count()
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Total lines: ${totalLinesCount}`)
                                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                                      async function printInvoiceSummary(invoiceId: string) {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Load the invoice reference
                                                                                                                                                                                                                                                                                                                                                                                                                      const invoice = await Invoice.fromBackend<Invoice>(invoiceId)
                                                                                                                                                                                                                                                                                                                                                                                                                      const linesProp = invoice.dataObject.get('lines') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // Ensure the collection is not hydrated (toJSON is undefined)
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(linesProp.toJSON()) // -> undefined

                                                                                                                                                                                                                                                                                                                                                                                                                      // 1. Calculate Sum (Total HT)
                                                                                                                                                                                                                                                                                                                                                                                                                      const totalHT = await linesProp.sum('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Total HT: ${totalHT} €`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 2. Calculate Average line amount
                                                                                                                                                                                                                                                                                                                                                                                                                      const averageLine = await linesProp.average('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Average Line Amount: ${averageLine} €`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 3. Find Distinct categories present in invoice lines
                                                                                                                                                                                                                                                                                                                                                                                                                      const categories = await linesProp.distinct('category')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Unique Categories: ${categories.join(', ')}`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 4. Get Min/Max line amounts
                                                                                                                                                                                                                                                                                                                                                                                                                      const minAmount = await linesProp.min('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      const maxAmount = await linesProp.max('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Line Ranges: ${minAmount} € - ${maxAmount} €`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 5. Count total items
                                                                                                                                                                                                                                                                                                                                                                                                                      const totalLinesCount = await linesProp.count()
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Total lines: ${totalLinesCount}`)
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      When you need to perform complex business operations on each item of a collection (e.g. applying a discount, adjusting taxes, and calling .save() on each line item to ensure validation middleware runs), use the .apply() method.

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      async function applyGlobalDiscountAndTax(invoiceId: string, discountPercent: number, taxRate: number) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const invoice = await Invoice.fromBackend<Invoice>(invoiceId)
                                                                                                                                                                                                                                                                                                                                                                                                                      const linesProp = invoice.dataObject.get('lines') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // .apply() automatically fetches all related lines from the database,
                                                                                                                                                                                                                                                                                                                                                                                                                      // hydrades them into InvoiceLine active instances, executes the callback,
                                                                                                                                                                                                                                                                                                                                                                                                                      // waits for any asynchronous saving operations to complete, and returns the outcomes.
                                                                                                                                                                                                                                                                                                                                                                                                                      const updatedAmounts = await linesProp.apply(async (line: InvoiceLine) => {
                                                                                                                                                                                                                                                                                                                                                                                                                      const originalAmount = line.val('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      const discountedAmount = originalAmount * (1 - discountPercent / 100)
                                                                                                                                                                                                                                                                                                                                                                                                                      const finalAmount = discountedAmount * (1 + taxRate / 100)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Update property
                                                                                                                                                                                                                                                                                                                                                                                                                      line.set('amount', parseFloat(finalAmount.toFixed(2)))

                                                                                                                                                                                                                                                                                                                                                                                                                      // Save item (persists changes to backend)
                                                                                                                                                                                                                                                                                                                                                                                                                      await line.save()

                                                                                                                                                                                                                                                                                                                                                                                                                      return line.val('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      })

                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Successfully updated invoice lines. New amounts:`, updatedAmounts)
                                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                                      async function applyGlobalDiscountAndTax(invoiceId: string, discountPercent: number, taxRate: number) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const invoice = await Invoice.fromBackend<Invoice>(invoiceId)
                                                                                                                                                                                                                                                                                                                                                                                                                      const linesProp = invoice.dataObject.get('lines') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // .apply() automatically fetches all related lines from the database,
                                                                                                                                                                                                                                                                                                                                                                                                                      // hydrades them into InvoiceLine active instances, executes the callback,
                                                                                                                                                                                                                                                                                                                                                                                                                      // waits for any asynchronous saving operations to complete, and returns the outcomes.
                                                                                                                                                                                                                                                                                                                                                                                                                      const updatedAmounts = await linesProp.apply(async (line: InvoiceLine) => {
                                                                                                                                                                                                                                                                                                                                                                                                                      const originalAmount = line.val('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      const discountedAmount = originalAmount * (1 - discountPercent / 100)
                                                                                                                                                                                                                                                                                                                                                                                                                      const finalAmount = discountedAmount * (1 + taxRate / 100)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Update property
                                                                                                                                                                                                                                                                                                                                                                                                                      line.set('amount', parseFloat(finalAmount.toFixed(2)))

                                                                                                                                                                                                                                                                                                                                                                                                                      // Save item (persists changes to backend)
                                                                                                                                                                                                                                                                                                                                                                                                                      await line.save()

                                                                                                                                                                                                                                                                                                                                                                                                                      return line.val('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      })

                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Successfully updated invoice lines. New amounts:`, updatedAmounts)
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      In this scenario, a Group contains multiple Member instances. We want to organize members by role, pluck their email addresses for newsletters, and perform bulk membership activations.

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      import { PersistedBaseObject, CollectionProperty } from '@quatrain/backend'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { StringProperty, BooleanProperty, ObjectProperty, Core } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                      export class Member extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'members'
                                                                                                                                                                                                                                                                                                                                                                                                                      static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'name', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'email', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'role', type: StringProperty.TYPE }, // 'admin' | 'editor' | 'viewer'
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'isActive', type: BooleanProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'group', type: ObjectProperty.TYPE, instanceOf: 'Group' }
                                                                                                                                                                                                                                                                                                                                                                                                                      ]
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      export class Group extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'groups'
                                                                                                                                                                                                                                                                                                                                                                                                                      static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'name', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      {
                                                                                                                                                                                                                                                                                                                                                                                                                      name: 'members',
                                                                                                                                                                                                                                                                                                                                                                                                                      type: CollectionProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                      instanceOf: Member,
                                                                                                                                                                                                                                                                                                                                                                                                                      parentKey: 'group'
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      ]
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      Core.addClass('Group', Group)
                                                                                                                                                                                                                                                                                                                                                                                                                      Core.addClass('Member', Member) +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { PersistedBaseObject, CollectionProperty } from '@quatrain/backend'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { StringProperty, BooleanProperty, ObjectProperty, Core } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                      export class Member extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'members'
                                                                                                                                                                                                                                                                                                                                                                                                                      static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'name', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'email', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'role', type: StringProperty.TYPE }, // 'admin' | 'editor' | 'viewer'
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'isActive', type: BooleanProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'group', type: ObjectProperty.TYPE, instanceOf: 'Group' }
                                                                                                                                                                                                                                                                                                                                                                                                                      ]
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      export class Group extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'groups'
                                                                                                                                                                                                                                                                                                                                                                                                                      static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                      { name: 'name', type: StringProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                      {
                                                                                                                                                                                                                                                                                                                                                                                                                      name: 'members',
                                                                                                                                                                                                                                                                                                                                                                                                                      type: CollectionProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                      instanceOf: Member,
                                                                                                                                                                                                                                                                                                                                                                                                                      parentKey: 'group'
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      ]
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      Core.addClass('Group', Group)
                                                                                                                                                                                                                                                                                                                                                                                                                      Core.addClass('Member', Member)

                                                                                                                                                                                                                                                                                                                                                                                                                      If a model requires custom domain queries or specialized operations, you can easily extend BaseRepository and bind the subclass to the model using the static REPOSITORY_CLASS property:

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      import { BaseRepository, Query } from '@quatrain/backend'

                                                                                                                                                                                                                                                                                                                                                                                                                      // 1. Define your custom repository
                                                                                                                                                                                                                                                                                                                                                                                                                      export class MemberRepository extends BaseRepository<Member> {
                                                                                                                                                                                                                                                                                                                                                                                                                      async findActiveAdmins() {
                                                                                                                                                                                                                                                                                                                                                                                                                      const query = new Query(Member)
                                                                                                                                                                                                                                                                                                                                                                                                                      .filter('isActive', 'eq', true)
                                                                                                                                                                                                                                                                                                                                                                                                                      .filter('role', 'eq', 'admin')
                                                                                                                                                                                                                                                                                                                                                                                                                      return await this.query(query)
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      // 2. Bind it on your Model class
                                                                                                                                                                                                                                                                                                                                                                                                                      export class Member extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'members'
                                                                                                                                                                                                                                                                                                                                                                                                                      static REPOSITORY_CLASS = MemberRepository
                                                                                                                                                                                                                                                                                                                                                                                                                      // ... PROPS_DEFINITION ...
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      // 3. Member.repository() now automatically returns your custom MemberRepository instance!
                                                                                                                                                                                                                                                                                                                                                                                                                      const activeAdmins = await Member.repository().findActiveAdmins() +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { BaseRepository, Query } from '@quatrain/backend'

                                                                                                                                                                                                                                                                                                                                                                                                                      // 1. Define your custom repository
                                                                                                                                                                                                                                                                                                                                                                                                                      export class MemberRepository extends BaseRepository<Member> {
                                                                                                                                                                                                                                                                                                                                                                                                                      async findActiveAdmins() {
                                                                                                                                                                                                                                                                                                                                                                                                                      const query = new Query(Member)
                                                                                                                                                                                                                                                                                                                                                                                                                      .filter('isActive', 'eq', true)
                                                                                                                                                                                                                                                                                                                                                                                                                      .filter('role', 'eq', 'admin')
                                                                                                                                                                                                                                                                                                                                                                                                                      return await this.query(query)
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      // 2. Bind it on your Model class
                                                                                                                                                                                                                                                                                                                                                                                                                      export class Member extends PersistedBaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                      static COLLECTION = 'members'
                                                                                                                                                                                                                                                                                                                                                                                                                      static REPOSITORY_CLASS = MemberRepository
                                                                                                                                                                                                                                                                                                                                                                                                                      // ... PROPS_DEFINITION ...
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      // 3. Member.repository() now automatically returns your custom MemberRepository instance!
                                                                                                                                                                                                                                                                                                                                                                                                                      const activeAdmins = await Member.repository().findActiveAdmins()

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      async function inspectGroup(groupId: string) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const group = await Group.fromBackend<Group>(groupId)
                                                                                                                                                                                                                                                                                                                                                                                                                      const membersProp = group.dataObject.get('members') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // 1. Pluck all email addresses directly (without manual loops)
                                                                                                                                                                                                                                                                                                                                                                                                                      const emails = await membersProp.pluck('email')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Emails to notify:`, emails)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 2. Count only active members using a predicate callback
                                                                                                                                                                                                                                                                                                                                                                                                                      const activeCount = await membersProp.count((m) => m.val('isActive') === true)
                                                                                                                                                                                                                                                                                                                                                                                                                      const totalCount = await membersProp.count()
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Active members: ${activeCount} / ${totalCount}`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 3. Group members by their role
                                                                                                                                                                                                                                                                                                                                                                                                                      const membersByRole = await membersProp.groupBy('role')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Admins:`, membersByRole['admin']?.map(m => m.val('name')) || [])
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Editors:`, membersByRole['editor']?.map(m => m.val('name')) || [])
                                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                                      async function inspectGroup(groupId: string) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const group = await Group.fromBackend<Group>(groupId)
                                                                                                                                                                                                                                                                                                                                                                                                                      const membersProp = group.dataObject.get('members') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // 1. Pluck all email addresses directly (without manual loops)
                                                                                                                                                                                                                                                                                                                                                                                                                      const emails = await membersProp.pluck('email')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Emails to notify:`, emails)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 2. Count only active members using a predicate callback
                                                                                                                                                                                                                                                                                                                                                                                                                      const activeCount = await membersProp.count((m) => m.val('isActive') === true)
                                                                                                                                                                                                                                                                                                                                                                                                                      const totalCount = await membersProp.count()
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Active members: ${activeCount} / ${totalCount}`)

                                                                                                                                                                                                                                                                                                                                                                                                                      // 3. Group members by their role
                                                                                                                                                                                                                                                                                                                                                                                                                      const membersByRole = await membersProp.groupBy('role')
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Admins:`, membersByRole['admin']?.map(m => m.val('name')) || [])
                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Editors:`, membersByRole['editor']?.map(m => m.val('name')) || [])
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      async function activateAllMembersAndAssignRole(groupId: string, newRole: string) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const group = await Group.fromBackend<Group>(groupId)
                                                                                                                                                                                                                                                                                                                                                                                                                      const membersProp = group.dataObject.get('members') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // Fetch from DB, activate, set role, and delegate saving to the Member object itself
                                                                                                                                                                                                                                                                                                                                                                                                                      const activationResults = await membersProp.apply(async (member: Member) => {
                                                                                                                                                                                                                                                                                                                                                                                                                      member.set('isActive', true)
                                                                                                                                                                                                                                                                                                                                                                                                                      member.set('role', newRole)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Save the record - this guarantees that validation rules,
                                                                                                                                                                                                                                                                                                                                                                                                                      // triggers, and encryption middlewares are fully respected.
                                                                                                                                                                                                                                                                                                                                                                                                                      await member.save()

                                                                                                                                                                                                                                                                                                                                                                                                                      return {
                                                                                                                                                                                                                                                                                                                                                                                                                      name: member.val('name'),
                                                                                                                                                                                                                                                                                                                                                                                                                      isActive: member.val('isActive'),
                                                                                                                                                                                                                                                                                                                                                                                                                      role: member.val('role')
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      })

                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Bulk activation finished:`, activationResults)
                                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                                      async function activateAllMembersAndAssignRole(groupId: string, newRole: string) {
                                                                                                                                                                                                                                                                                                                                                                                                                      const group = await Group.fromBackend<Group>(groupId)
                                                                                                                                                                                                                                                                                                                                                                                                                      const membersProp = group.dataObject.get('members') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // Fetch from DB, activate, set role, and delegate saving to the Member object itself
                                                                                                                                                                                                                                                                                                                                                                                                                      const activationResults = await membersProp.apply(async (member: Member) => {
                                                                                                                                                                                                                                                                                                                                                                                                                      member.set('isActive', true)
                                                                                                                                                                                                                                                                                                                                                                                                                      member.set('role', newRole)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Save the record - this guarantees that validation rules,
                                                                                                                                                                                                                                                                                                                                                                                                                      // triggers, and encryption middlewares are fully respected.
                                                                                                                                                                                                                                                                                                                                                                                                                      await member.save()

                                                                                                                                                                                                                                                                                                                                                                                                                      return {
                                                                                                                                                                                                                                                                                                                                                                                                                      name: member.val('name'),
                                                                                                                                                                                                                                                                                                                                                                                                                      isActive: member.val('isActive'),
                                                                                                                                                                                                                                                                                                                                                                                                                      role: member.val('role')
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      })

                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Bulk activation finished:`, activationResults)
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/documents/backend_README.html b/docs/public/api-reference/documents/backend_README.html index 0b51c530..25953616 100644 --- a/docs/public/api-reference/documents/backend_README.html +++ b/docs/public/api-reference/documents/backend_README.html @@ -17,12 +17,12 @@

                                                                                                                                                                                                                                                                                                                                                                                                                      When performing calculations over huge datasets (like thousands of invoice lines), loading everything into application memory is extremely slow. @quatrain/backend allows you to execute these calculations natively in the database engine:

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      import { Invoice } from './models/Invoice'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { CollectionProperty } from '@quatrain/backend'

                                                                                                                                                                                                                                                                                                                                                                                                                      // Load the invoice parent model
                                                                                                                                                                                                                                                                                                                                                                                                                      const invoice = await Invoice.fromBackend<Invoice>('invoice-uuid')
                                                                                                                                                                                                                                                                                                                                                                                                                      const lines = invoice.dataObject.get('lines') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // Calculate aggregate metrics directly in the database (Zero hydration overhead!)
                                                                                                                                                                                                                                                                                                                                                                                                                      const totalHT = await lines.sum('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      const averageLinePrice = await lines.average('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      const uniqueCategories = await lines.distinct('category')
                                                                                                                                                                                                                                                                                                                                                                                                                      const lineCount = await lines.count()

                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Total HT: ${totalHT} €, Average: ${averageLinePrice} €, Items: ${lineCount}`) +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { Invoice } from './models/Invoice'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { CollectionProperty } from '@quatrain/backend'

                                                                                                                                                                                                                                                                                                                                                                                                                      // Load the invoice parent model
                                                                                                                                                                                                                                                                                                                                                                                                                      const invoice = await Invoice.fromBackend<Invoice>('invoice-uuid')
                                                                                                                                                                                                                                                                                                                                                                                                                      const lines = invoice.dataObject.get('lines') as CollectionProperty

                                                                                                                                                                                                                                                                                                                                                                                                                      // Calculate aggregate metrics directly in the database (Zero hydration overhead!)
                                                                                                                                                                                                                                                                                                                                                                                                                      const totalHT = await lines.sum('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      const averageLinePrice = await lines.average('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      const uniqueCategories = await lines.distinct('category')
                                                                                                                                                                                                                                                                                                                                                                                                                      const lineCount = await lines.count()

                                                                                                                                                                                                                                                                                                                                                                                                                      console.log(`Total HT: ${totalHT} €, Average: ${averageLinePrice} €, Items: ${lineCount}`)

                                                                                                                                                                                                                                                                                                                                                                                                                      For complex business domain calculations where you need to run specific object lifecycle hooks, validation constraints, and database save triggers on each collection element, use .apply(fn):

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      // Apply a discount and persist all items using their own domain model logic
                                                                                                                                                                                                                                                                                                                                                                                                                      const updatedPrices = await lines.apply(async (line) => {
                                                                                                                                                                                                                                                                                                                                                                                                                      const newAmount = line.val('amount') * 0.9 // 10% discount
                                                                                                                                                                                                                                                                                                                                                                                                                      line.set('amount', newAmount)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Save individually to trigger encryption/validation middlewares
                                                                                                                                                                                                                                                                                                                                                                                                                      await line.save()
                                                                                                                                                                                                                                                                                                                                                                                                                      return line.val('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      }) +
                                                                                                                                                                                                                                                                                                                                                                                                                      // Apply a discount and persist all items using their own domain model logic
                                                                                                                                                                                                                                                                                                                                                                                                                      const updatedPrices = await lines.apply(async (line) => {
                                                                                                                                                                                                                                                                                                                                                                                                                      const newAmount = line.val('amount') * 0.9 // 10% discount
                                                                                                                                                                                                                                                                                                                                                                                                                      line.set('amount', newAmount)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Save individually to trigger encryption/validation middlewares
                                                                                                                                                                                                                                                                                                                                                                                                                      await line.save()
                                                                                                                                                                                                                                                                                                                                                                                                                      return line.val('amount')
                                                                                                                                                                                                                                                                                                                                                                                                                      })
                                                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/documents/cache-redis_README.html b/docs/public/api-reference/documents/cache-redis_README.html index 85f6c3ab..a56655e2 100644 --- a/docs/public/api-reference/documents/cache-redis_README.html +++ b/docs/public/api-reference/documents/cache-redis_README.html @@ -20,7 +20,7 @@
                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      import { LocalStorageAdapter } from '@quatrain/storage-local'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { RedisManager, RedisMediaCache } from '@quatrain/cache-redis'

                                                                                                                                                                                                                                                                                                                                                                                                                      const storage = new LocalStorageAdapter(...)
                                                                                                                                                                                                                                                                                                                                                                                                                      const redis = RedisManager.getInstance()

                                                                                                                                                                                                                                                                                                                                                                                                                      // Cache binaries for 10 minutes (600s)
                                                                                                                                                                                                                                                                                                                                                                                                                      const mediaCache = new RedisMediaCache(storage, redis, 600)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Fetching a media file directly buffers it from Redis if available,
                                                                                                                                                                                                                                                                                                                                                                                                                      // or falls back to downloading via the StorageAdapter and storing it in Redis.
                                                                                                                                                                                                                                                                                                                                                                                                                      const buffer = await mediaCache.getMedia({ ref: 'my-file.jpg' }) +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { LocalStorageAdapter } from '@quatrain/storage-local'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { RedisManager, RedisMediaCache } from '@quatrain/cache-redis'

                                                                                                                                                                                                                                                                                                                                                                                                                      const storage = new LocalStorageAdapter(...)
                                                                                                                                                                                                                                                                                                                                                                                                                      const redis = RedisManager.getInstance()

                                                                                                                                                                                                                                                                                                                                                                                                                      // Cache binaries for 10 minutes (600s)
                                                                                                                                                                                                                                                                                                                                                                                                                      const mediaCache = new RedisMediaCache(storage, redis, 600)

                                                                                                                                                                                                                                                                                                                                                                                                                      // Fetching a media file directly buffers it from Redis if available,
                                                                                                                                                                                                                                                                                                                                                                                                                      // or falls back to downloading via the StorageAdapter and storing it in Redis.
                                                                                                                                                                                                                                                                                                                                                                                                                      const buffer = await mediaCache.getMedia({ ref: 'my-file.jpg' })
                                                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/documents/cache_README.html b/docs/public/api-reference/documents/cache_README.html index 29d7d1d0..ed9dba9f 100644 --- a/docs/public/api-reference/documents/cache_README.html +++ b/docs/public/api-reference/documents/cache_README.html @@ -10,12 +10,12 @@

                                                                                                                                                                                                                                                                                                                                                                                                                      Create a new class that implements CacheAdapterInterface:

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      import { CacheAdapterInterface } from '@quatrain/cache'

                                                                                                                                                                                                                                                                                                                                                                                                                      export class MyCustomCacheAdapter implements CacheAdapterInterface {
                                                                                                                                                                                                                                                                                                                                                                                                                      async get(key: string): Promise<string | null> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      async getBuffer(key: string): Promise<Buffer | null> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      async set(key: string, value: string | Buffer, ttlSeconds?: number): Promise<void> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      async del(...keys: string[]): Promise<void> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      async keys(pattern: string): Promise<string[]> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      } +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { CacheAdapterInterface } from '@quatrain/cache'

                                                                                                                                                                                                                                                                                                                                                                                                                      export class MyCustomCacheAdapter implements CacheAdapterInterface {
                                                                                                                                                                                                                                                                                                                                                                                                                      async get(key: string): Promise<string | null> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      async getBuffer(key: string): Promise<Buffer | null> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      async set(key: string, value: string | Buffer, ttlSeconds?: number): Promise<void> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      async del(...keys: string[]): Promise<void> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      async keys(pattern: string): Promise<string[]> {
                                                                                                                                                                                                                                                                                                                                                                                                                      // Implementation
                                                                                                                                                                                                                                                                                                                                                                                                                      }
                                                                                                                                                                                                                                                                                                                                                                                                                      }

                                                                                                                                                                                                                                                                                                                                                                                                                      Combine your adapter with a storage adapter:

                                                                                                                                                                                                                                                                                                                                                                                                                      -
                                                                                                                                                                                                                                                                                                                                                                                                                      import { MediaCacheProxy } from '@quatrain/cache'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { LocalStorageAdapter } from '@quatrain/storage-local'

                                                                                                                                                                                                                                                                                                                                                                                                                      const storage = new LocalStorageAdapter(...)
                                                                                                                                                                                                                                                                                                                                                                                                                      const myCache = new MyCustomCacheAdapter()

                                                                                                                                                                                                                                                                                                                                                                                                                      // Cache for 10 minutes (600s)
                                                                                                                                                                                                                                                                                                                                                                                                                      const proxy = new MediaCacheProxy(storage, myCache, 600)
                                                                                                                                                                                                                                                                                                                                                                                                                      const buffer = await proxy.getMedia({ ref: 'file.jpg' }) +
                                                                                                                                                                                                                                                                                                                                                                                                                      import { MediaCacheProxy } from '@quatrain/cache'
                                                                                                                                                                                                                                                                                                                                                                                                                      import { LocalStorageAdapter } from '@quatrain/storage-local'

                                                                                                                                                                                                                                                                                                                                                                                                                      const storage = new LocalStorageAdapter(...)
                                                                                                                                                                                                                                                                                                                                                                                                                      const myCache = new MyCustomCacheAdapter()

                                                                                                                                                                                                                                                                                                                                                                                                                      // Cache for 10 minutes (600s)
                                                                                                                                                                                                                                                                                                                                                                                                                      const proxy = new MediaCacheProxy(storage, myCache, 600)
                                                                                                                                                                                                                                                                                                                                                                                                                      const buffer = await proxy.getMedia({ ref: 'file.jpg' })
                                                                                                                                                                                                                                                                                                                                                                                                                      diff --git a/docs/public/api-reference/documents/chat_README.html b/docs/public/api-reference/documents/chat_README.html new file mode 100644 index 00000000..9ab82b12 --- /dev/null +++ b/docs/public/api-reference/documents/chat_README.html @@ -0,0 +1,12 @@ +chat/README | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                      Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                        Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                                        @quatrain/chat

                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                        The core conversational engine for the Quatrain framework.

                                                                                                                                                                                                                                                                                                                                                                                                                        +

                                                                                                                                                                                                                                                                                                                                                                                                                        This package provides a headless, UI-agnostic implementation of conversational agents, handling message history, prompt templating, context injection (RAG), and integration with LLM providers (Gemini, OpenAI, Ollama).

                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                        @quatrain/chat is decoupled from the frontend presentation layer.

                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                        • Logical controllers like ChatController manage session state and interactions.
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        • Visual presentation (chat bubbles, input boxes) is managed separately in the CoreUX workspace.
                                                                                                                                                                                                                                                                                                                                                                                                                        • +
                                                                                                                                                                                                                                                                                                                                                                                                                        + +

                                                                                                                                                                                                                                                                                                                                                                                                                        AGPL-3.0-only

                                                                                                                                                                                                                                                                                                                                                                                                                        +
                                                                                                                                                                                                                                                                                                                                                                                                                        diff --git a/docs/public/api-reference/documents/cli_HOWTO.html b/docs/public/api-reference/documents/cli_HOWTO.html new file mode 100644 index 00000000..879e7961 --- /dev/null +++ b/docs/public/api-reference/documents/cli_HOWTO.html @@ -0,0 +1,55 @@ +cli/HOWTO | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                        Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                          Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                                          HOW-TO: Getting Started with @quatrain/cli

                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                          This guide explains how to leverage both the programmatic library utilities and the command line commands of @quatrain/cli.

                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                          Use the exported APIs of @quatrain/cli to build custom runner scripts, sync actions, and integration workflows.

                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                          To execute external commands securely and retrieve their logs:

                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                          import { Command } from '@quatrain/cli';

                                                                                                                                                                                                                                                                                                                                                                                                                          async function listKubectlNamespaces() {
                                                                                                                                                                                                                                                                                                                                                                                                                          const result = await Command.create('kubectl')
                                                                                                                                                                                                                                                                                                                                                                                                                          .args(['get', 'namespaces', '-o', 'json'])
                                                                                                                                                                                                                                                                                                                                                                                                                          .execute();

                                                                                                                                                                                                                                                                                                                                                                                                                          if (!result.success) {
                                                                                                                                                                                                                                                                                                                                                                                                                          throw new Error(`Failed to list namespaces: ${result.stderr}`);
                                                                                                                                                                                                                                                                                                                                                                                                                          }

                                                                                                                                                                                                                                                                                                                                                                                                                          return JSON.parse(result.stdout);
                                                                                                                                                                                                                                                                                                                                                                                                                          } +
                                                                                                                                                                                                                                                                                                                                                                                                                          + + +

                                                                                                                                                                                                                                                                                                                                                                                                                          Ask for confirmations or inputs interactively in your CLI actions:

                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                          import { askConfirm, askInput } from '@quatrain/cli';

                                                                                                                                                                                                                                                                                                                                                                                                                          const cleanDb = await askConfirm('Reset database before starting?', false);
                                                                                                                                                                                                                                                                                                                                                                                                                          if (cleanDb) {
                                                                                                                                                                                                                                                                                                                                                                                                                          const dbName = await askInput('Specify DB name to reset:', 'quatrain_dev');
                                                                                                                                                                                                                                                                                                                                                                                                                          // ... run reset
                                                                                                                                                                                                                                                                                                                                                                                                                          } +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                          The package exposes a core binary to scaffold files and deploy infrastructures.

                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                          npx @quatrain/cli generate scaffold MyNewProject
                                                                                                                                                                                                                                                                                                                                                                                                                          cd MyNewProject
                                                                                                                                                                                                                                                                                                                                                                                                                          bun install +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                          Creates folder directories (apps/, packages/, etc.) and sets up monorepo packages and tsconfig.json.

                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                          npx @quatrain/cli generate config
                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                          Walks through an interactive wizard to configure PostgreSQL, Redis, Queues, and outputs a resolved quatrain.json.

                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                          npx @quatrain/cli generate migration add_profile_fields
                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                          Scaffolds timestamped files under migrations/ containing migration templates.

                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                          npx @quatrain/cli deploy
                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +

                                                                                                                                                                                                                                                                                                                                                                                                                          When making local changes to @quatrain/cli in the Core monorepo:

                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                          # From the root of the Core monorepo
                                                                                                                                                                                                                                                                                                                                                                                                                          yarn workspace @quatrain/cli core deploy +
                                                                                                                                                                                                                                                                                                                                                                                                                          + + +

                                                                                                                                                                                                                                                                                                                                                                                                                          Make sure to re-compile TypeScript code when editing src/ files:

                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                          cd packages/cli
                                                                                                                                                                                                                                                                                                                                                                                                                          yarn build
                                                                                                                                                                                                                                                                                                                                                                                                                          # Or watch mode:
                                                                                                                                                                                                                                                                                                                                                                                                                          yarn wbuild +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                          + +
                                                                                                                                                                                                                                                                                                                                                                                                                          +

                                                                                                                                                                                                                                                                                                                                                                                                                          Recommendation: Ensure all console outputs, instructions, logging, and codebase comments are written in International English to meet Quatrain standards.

                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                          +
                                                                                                                                                                                                                                                                                                                                                                                                                          diff --git a/docs/public/api-reference/documents/cli_README.html b/docs/public/api-reference/documents/cli_README.html new file mode 100644 index 00000000..d35bfa27 --- /dev/null +++ b/docs/public/api-reference/documents/cli_README.html @@ -0,0 +1,57 @@ +cli/README | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                          Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                            Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                                            @quatrain/cli

                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                            The official Command Line Interface (CLI) and script utility library for the Quatrain ecosystem.

                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                            This package serves two distinct purposes:

                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                            1. Programmatic Utilities (Library API): Exported classes and prompt helpers to build interactive scripts and run system subprocesses (e.g. within agent skills).
                                                                                                                                                                                                                                                                                                                                                                                                                            2. +
                                                                                                                                                                                                                                                                                                                                                                                                                            3. Core Command-Line Executable (core): A global terminal command runner to scaffold projects, generate configurations, and manage deployments.
                                                                                                                                                                                                                                                                                                                                                                                                                            4. +
                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                            Import these utilities directly in your TypeScript/JavaScript scripts to interact with the user or run external processes.

                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                            The Command class provides a cross-platform, fluent builder-pattern interface to execute system subprocesses. It simplifies spawning commands, passing arguments, setting working directories, extending environment variables, and supports PowerShell routing.

                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                            import { Command } from '@quatrain/cli';

                                                                                                                                                                                                                                                                                                                                                                                                                            const result = await Command.create('kubectl')
                                                                                                                                                                                                                                                                                                                                                                                                                            .arg('apply')
                                                                                                                                                                                                                                                                                                                                                                                                                            .arg('-f')
                                                                                                                                                                                                                                                                                                                                                                                                                            .arg('deployment.yaml')
                                                                                                                                                                                                                                                                                                                                                                                                                            .cwd('/path/to/project')
                                                                                                                                                                                                                                                                                                                                                                                                                            .env({ KUBECONFIG: '/path/to/config' })
                                                                                                                                                                                                                                                                                                                                                                                                                            .execute();

                                                                                                                                                                                                                                                                                                                                                                                                                            if (result.success) {
                                                                                                                                                                                                                                                                                                                                                                                                                            console.log(`Success: ${result.stdout}`);
                                                                                                                                                                                                                                                                                                                                                                                                                            } else {
                                                                                                                                                                                                                                                                                                                                                                                                                            console.error(`Exit code: ${result.code}, Error: ${result.stderr}`);
                                                                                                                                                                                                                                                                                                                                                                                                                            } +
                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                            Fluent Methods:

                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                            • Command.create(bin) / new Command(bin): Start building a command for the given binary.
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • .arg(value) / .args([values]): Append command-line arguments.
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • .cwd(dir): Set the execution working directory.
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • .env({ KEY: VALUE }): Set or extend environment variables.
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • .inherit(): Direct stdout and stderr to the parent process terminal.
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • .usePowerShell(use, type): Force process execution through PowerShell (powershell.exe or pwsh) with safe quote escaping.
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • .execute(): Run the process asynchronously and return { stdout, stderr, code, success }.
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                            Helpers wrapping inquirer to prompt user inputs cleanly:

                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                            import { askConfirm, askInput, askChoice } from '@quatrain/cli';

                                                                                                                                                                                                                                                                                                                                                                                                                            // Yes/No Confirmations
                                                                                                                                                                                                                                                                                                                                                                                                                            const proceed = await askConfirm('Do you want to deploy now?');

                                                                                                                                                                                                                                                                                                                                                                                                                            // String Inputs
                                                                                                                                                                                                                                                                                                                                                                                                                            const name = await askInput('Enter your username:', 'default_user');

                                                                                                                                                                                                                                                                                                                                                                                                                            // Multi-choice select lists
                                                                                                                                                                                                                                                                                                                                                                                                                            const selected = await askChoice('Select action:', [
                                                                                                                                                                                                                                                                                                                                                                                                                            { name: 'Sync Google Calendar', value: 'sync' },
                                                                                                                                                                                                                                                                                                                                                                                                                            { name: 'Reset Database', value: 'reset' }
                                                                                                                                                                                                                                                                                                                                                                                                                            ]); +
                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                            A global CLI tool invoked via the core command (or quatrain depending on symlinks).

                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                            Install globally or run on-the-fly:

                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                            # Global
                                                                                                                                                                                                                                                                                                                                                                                                                            bun add -g @quatrain/cli

                                                                                                                                                                                                                                                                                                                                                                                                                            # Run on the fly
                                                                                                                                                                                                                                                                                                                                                                                                                            bunx @quatrain/cli <command> +
                                                                                                                                                                                                                                                                                                                                                                                                                            + + + +

                                                                                                                                                                                                                                                                                                                                                                                                                            Manage Kubernetes deployments (create, list, modify, promote, delete namespaces and manifests).

                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                            Initialize a new Quatrain project structure:

                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                              +
                                                                                                                                                                                                                                                                                                                                                                                                                            • Sets up directories: apps/, data/, config/, packages/, migrations/.
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            • Generates a monorepo-ready workspace package.json and a pre-configured tsconfig.json.
                                                                                                                                                                                                                                                                                                                                                                                                                            • +
                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                            Start an interactive wizard to generate the quatrain.json bootloader configuration file.

                                                                                                                                                                                                                                                                                                                                                                                                                            + +

                                                                                                                                                                                                                                                                                                                                                                                                                            Scaffold a timestamped TypeScript migration file (e.g., migrations/20260427_name.ts) with template up() and down() blocks.

                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                            + +
                                                                                                                                                                                                                                                                                                                                                                                                                            +

                                                                                                                                                                                                                                                                                                                                                                                                                            Recommendation: All text contents (logs, console prints, commit messages, comments) within the Quatrain ecosystem must be written in International English to ensure global team maintainability.

                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                            +
                                                                                                                                                                                                                                                                                                                                                                                                                            diff --git a/docs/public/api-reference/documents/core-cli_HOWTO.html b/docs/public/api-reference/documents/core-cli_HOWTO.html deleted file mode 100644 index a9792d30..00000000 --- a/docs/public/api-reference/documents/core-cli_HOWTO.html +++ /dev/null @@ -1,60 +0,0 @@ -core-cli/HOWTO | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                            Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                              Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                                              HOW-TO: Getting Started with @quatrain/core-cli

                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                              This guide explains how to leverage the core CLI to build and structure your Quatrain applications effortlessly.

                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                              To start a new Quatrain project from scratch, use the scaffold command. This will generate a monorepo folder architecture ready to use.

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              npx @quatrain/core-cli scaffold MyProject
                                                                                                                                                                                                                                                                                                                                                                                                                              cd MyProject
                                                                                                                                                                                                                                                                                                                                                                                                                              yarn install -
                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                              What it does:

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                              • Creates a package.json for Yarn Workspaces.
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • Sets up alias paths in tsconfig.json.
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              • Creates placeholder directories for apps, packages, data, and config.
                                                                                                                                                                                                                                                                                                                                                                                                                              • -
                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                              The @quatrain/app bootloader requires a quatrain.json file to auto-instantiate the required adapters.

                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                              Run the interactive wizard from the root of your new project:

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              npx @quatrain/core-cli generate config
                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                              Answer the prompts to select your preferred Backend (e.g., PostgreSQL), Authentication (e.g., Supabase), Storage, and Queue systems.

                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                              Resulting quatrain.json: -The file will contain configurations mapping to environment variables:

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              {
                                                                                                                                                                                                                                                                                                                                                                                                                              "backend": {
                                                                                                                                                                                                                                                                                                                                                                                                                              "adapter": "PostgresAdapter",
                                                                                                                                                                                                                                                                                                                                                                                                                              "package": "@quatrain/backend-postgres",
                                                                                                                                                                                                                                                                                                                                                                                                                              "config": {
                                                                                                                                                                                                                                                                                                                                                                                                                              "host": "env(PG_HOST)",
                                                                                                                                                                                                                                                                                                                                                                                                                              "port": "env(PG_PORT)"
                                                                                                                                                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                                                                                                                                              }
                                                                                                                                                                                                                                                                                                                                                                                                                              } -
                                                                                                                                                                                                                                                                                                                                                                                                                              - - -

                                                                                                                                                                                                                                                                                                                                                                                                                              To safely upgrade the database schema, generate migration files directly from the CLI.

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              npx @quatrain/core-cli generate migration initialize_users
                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                              This generates migrations/20260427XXXXXX_initialize_users.ts. Open this file and fill in the up() and down() functions using the Quatrain Backend singleton.

                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                              When developing or modifying the CLI locally, you can run and test the tool in several ways:

                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                              From the root of the Core monorepo:

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              yarn workspace @quatrain/core-cli core <command>
                                                                                                                                                                                                                                                                                                                                                                                                                              # Example:
                                                                                                                                                                                                                                                                                                                                                                                                                              yarn workspace @quatrain/core-cli core deploy -
                                                                                                                                                                                                                                                                                                                                                                                                                              - - -

                                                                                                                                                                                                                                                                                                                                                                                                                              To use the core command directly from any directory without installing it globally, add an alias to your Zsh configuration (~/.zshrc):

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              echo 'alias core="node /Users/crapougnax/CODE/QUATRAIN/Core/packages/core-cli/bin/core.js"' >> ~/.zshrc
                                                                                                                                                                                                                                                                                                                                                                                                                              source ~/.zshrc -
                                                                                                                                                                                                                                                                                                                                                                                                                              - -

                                                                                                                                                                                                                                                                                                                                                                                                                              You can then run:

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              core deploy
                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              - - -

                                                                                                                                                                                                                                                                                                                                                                                                                              Alternatively, link the package to your global Node bin directory:

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              cd packages/core-cli
                                                                                                                                                                                                                                                                                                                                                                                                                              npm install -g . -
                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                              Note

                                                                                                                                                                                                                                                                                                                                                                                                                              -When modifying TypeScript source files, make sure to compile them with yarn build or keep the compiler in watch mode with yarn wbuild inside the packages/core-cli directory.

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              - -
                                                                                                                                                                                                                                                                                                                                                                                                                              -

                                                                                                                                                                                                                                                                                                                                                                                                                              Recommendation: Ensure that all logs, commit messages, console outputs, and code comments are written in International English. This convention aligns with the official Quatrain standard to support a globally distributed engineering team.

                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              -
                                                                                                                                                                                                                                                                                                                                                                                                                              diff --git a/docs/public/api-reference/documents/core-cli_README.html b/docs/public/api-reference/documents/core-cli_README.html deleted file mode 100644 index a494f74e..00000000 --- a/docs/public/api-reference/documents/core-cli_README.html +++ /dev/null @@ -1,45 +0,0 @@ -core-cli/README | Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                              Quatrain Core Documentation
                                                                                                                                                                                                                                                                                                                                                                                                                                Preparing search index...

                                                                                                                                                                                                                                                                                                                                                                                                                                @quatrain/core-cli

                                                                                                                                                                                                                                                                                                                                                                                                                                -

                                                                                                                                                                                                                                                                                                                                                                                                                                The official Command Line Interface (CLI) for the Quatrain ecosystem. -This CLI provides tools to scaffold projects, generate normalized bootloader configurations, and create migration files.

                                                                                                                                                                                                                                                                                                                                                                                                                                - -

                                                                                                                                                                                                                                                                                                                                                                                                                                You can install the CLI globally via NPM or Yarn, or run it on the fly using npx or bunx.

                                                                                                                                                                                                                                                                                                                                                                                                                                - -
                                                                                                                                                                                                                                                                                                                                                                                                                                npm install -g @quatrain/core-cli
                                                                                                                                                                                                                                                                                                                                                                                                                                # or
                                                                                                                                                                                                                                                                                                                                                                                                                                yarn global add @quatrain/core-cli
                                                                                                                                                                                                                                                                                                                                                                                                                                # or via Bun
                                                                                                                                                                                                                                                                                                                                                                                                                                bun add -g @quatrain/core-cli -
                                                                                                                                                                                                                                                                                                                                                                                                                                - - -
                                                                                                                                                                                                                                                                                                                                                                                                                                npx @quatrain/core-cli <command>
                                                                                                                                                                                                                                                                                                                                                                                                                                # or
                                                                                                                                                                                                                                                                                                                                                                                                                                bunx @quatrain/core-cli <command> -
                                                                                                                                                                                                                                                                                                                                                                                                                                - - - -

                                                                                                                                                                                                                                                                                                                                                                                                                                Quickly initializes a new Quatrain project.

                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Creates a base directory.
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Sets up the apps/, data/, config/, packages/, and migrations/ folders.
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Generates a monorepo-ready package.json utilizing Yarn workspaces.
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Generates a tsconfig.json pre-configured with the required path mappings.
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                - -

                                                                                                                                                                                                                                                                                                                                                                                                                                Starts an interactive wizard to generate a quatrain.json configuration file.

                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Prompts for Backend, Auth, Queue, Storage, and Messaging adapters.
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Generates a normalized JSON configuration.
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • The generated env(...) tokens will be resolved at runtime by the AppBootloader.
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                - -

                                                                                                                                                                                                                                                                                                                                                                                                                                Scaffolds a new migration file.

                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                  -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Creates a migrations/ directory if it does not exist.
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Generates a timestamped TypeScript file (e.g., 20260427184500_init.ts).
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                • Provides boilerplate up() and down() methods.
                                                                                                                                                                                                                                                                                                                                                                                                                                • -
                                                                                                                                                                                                                                                                                                                                                                                                                                - -
                                                                                                                                                                                                                                                                                                                                                                                                                                -

                                                                                                                                                                                                                                                                                                                                                                                                                                Recommendation: All text contents (such as console logs, commit messages, and comments) within the Quatrain ecosystem must be written in International English. This ensures accessibility and maintainability for developers worldwide.

                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                - -
                                                                                                                                                                                                                                                                                                                                                                                                                                # Example of scaffolding a new project
                                                                                                                                                                                                                                                                                                                                                                                                                                yarn global add @quatrain/core-cli
                                                                                                                                                                                                                                                                                                                                                                                                                                quatrain generate scaffold my-app
                                                                                                                                                                                                                                                                                                                                                                                                                                cd my-app
                                                                                                                                                                                                                                                                                                                                                                                                                                yarn install -
                                                                                                                                                                                                                                                                                                                                                                                                                                - -
                                                                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/documents/core_HOWTO.html b/docs/public/api-reference/documents/core_HOWTO.html index 8b271f7d..57299049 100644 --- a/docs/public/api-reference/documents/core_HOWTO.html +++ b/docs/public/api-reference/documents/core_HOWTO.html @@ -11,12 +11,12 @@

                                                                                                                                                                                                                                                                                                                                                                                                                                In Quatrain, any business entity should extend BaseObject. This provides property validation, tracking, and serialization.

                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                import { 
                                                                                                                                                                                                                                                                                                                                                                                                                                BaseObject,
                                                                                                                                                                                                                                                                                                                                                                                                                                StringProperty,
                                                                                                                                                                                                                                                                                                                                                                                                                                NumberProperty,
                                                                                                                                                                                                                                                                                                                                                                                                                                BooleanProperty
                                                                                                                                                                                                                                                                                                                                                                                                                                } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                                export class Customer extends BaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                                static COLLECTION = 'customers'

                                                                                                                                                                                                                                                                                                                                                                                                                                // Define the schema using PROPS_DEFINITION
                                                                                                                                                                                                                                                                                                                                                                                                                                static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'firstName', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'lastName', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'email', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'age', type: NumberProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'isPremium', type: BooleanProperty.TYPE, defaultValue: false }
                                                                                                                                                                                                                                                                                                                                                                                                                                ]
                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                // Usage Example
                                                                                                                                                                                                                                                                                                                                                                                                                                async function createCustomer() {
                                                                                                                                                                                                                                                                                                                                                                                                                                // Always use the factory() method, never new Customer()
                                                                                                                                                                                                                                                                                                                                                                                                                                const customer = await Customer.factory()

                                                                                                                                                                                                                                                                                                                                                                                                                                // Use the `_` proxy to interact with properties
                                                                                                                                                                                                                                                                                                                                                                                                                                customer._.firstName = 'John'
                                                                                                                                                                                                                                                                                                                                                                                                                                customer._.lastName = 'Doe'
                                                                                                                                                                                                                                                                                                                                                                                                                                customer._.email = 'john.doe@example.com'

                                                                                                                                                                                                                                                                                                                                                                                                                                // Check if the object passes all property validations
                                                                                                                                                                                                                                                                                                                                                                                                                                if (customer.isValid()) {
                                                                                                                                                                                                                                                                                                                                                                                                                                console.log('Customer data is valid!')
                                                                                                                                                                                                                                                                                                                                                                                                                                console.log(customer.toJSON())
                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                } +
                                                                                                                                                                                                                                                                                                                                                                                                                                import { 
                                                                                                                                                                                                                                                                                                                                                                                                                                BaseObject,
                                                                                                                                                                                                                                                                                                                                                                                                                                StringProperty,
                                                                                                                                                                                                                                                                                                                                                                                                                                NumberProperty,
                                                                                                                                                                                                                                                                                                                                                                                                                                BooleanProperty
                                                                                                                                                                                                                                                                                                                                                                                                                                } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                                export class Customer extends BaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                                static COLLECTION = 'customers'

                                                                                                                                                                                                                                                                                                                                                                                                                                // Define the schema using PROPS_DEFINITION
                                                                                                                                                                                                                                                                                                                                                                                                                                static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'firstName', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'lastName', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'email', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'age', type: NumberProperty.TYPE },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'isPremium', type: BooleanProperty.TYPE, defaultValue: false }
                                                                                                                                                                                                                                                                                                                                                                                                                                ]
                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                // Usage Example
                                                                                                                                                                                                                                                                                                                                                                                                                                async function createCustomer() {
                                                                                                                                                                                                                                                                                                                                                                                                                                // Always use the factory() method, never new Customer()
                                                                                                                                                                                                                                                                                                                                                                                                                                const customer = await Customer.factory()

                                                                                                                                                                                                                                                                                                                                                                                                                                // Use the `_` proxy to interact with properties
                                                                                                                                                                                                                                                                                                                                                                                                                                customer._.firstName = 'John'
                                                                                                                                                                                                                                                                                                                                                                                                                                customer._.lastName = 'Doe'
                                                                                                                                                                                                                                                                                                                                                                                                                                customer._.email = 'john.doe@example.com'

                                                                                                                                                                                                                                                                                                                                                                                                                                // Check if the object passes all property validations
                                                                                                                                                                                                                                                                                                                                                                                                                                if (customer.isValid()) {
                                                                                                                                                                                                                                                                                                                                                                                                                                console.log('Customer data is valid!')
                                                                                                                                                                                                                                                                                                                                                                                                                                console.log(customer.toJSON())
                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                Properties in Quatrain aren't just types; they enforce constraints automatically.

                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                import { BaseObject, StringProperty, NumberProperty, ArrayProperty } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                                export class Product extends BaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                                static COLLECTION = 'products'
                                                                                                                                                                                                                                                                                                                                                                                                                                static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                                                                                                                                                                                name: 'sku',
                                                                                                                                                                                                                                                                                                                                                                                                                                type: StringProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                                mandatory: true,
                                                                                                                                                                                                                                                                                                                                                                                                                                // You can restrict maximum length
                                                                                                                                                                                                                                                                                                                                                                                                                                length: 12
                                                                                                                                                                                                                                                                                                                                                                                                                                },
                                                                                                                                                                                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                                                                                                                                                                                name: 'price',
                                                                                                                                                                                                                                                                                                                                                                                                                                type: NumberProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                                // You can specify min/max constraints
                                                                                                                                                                                                                                                                                                                                                                                                                                min: 0.01,
                                                                                                                                                                                                                                                                                                                                                                                                                                max: 10000
                                                                                                                                                                                                                                                                                                                                                                                                                                },
                                                                                                                                                                                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                                                                                                                                                                                name: 'tags',
                                                                                                                                                                                                                                                                                                                                                                                                                                type: ArrayProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                                // Initialize with empty array instead of null
                                                                                                                                                                                                                                                                                                                                                                                                                                defaultValue: []
                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                ]
                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                async function updateProduct(productData: any) {
                                                                                                                                                                                                                                                                                                                                                                                                                                const product = await Product.factory()

                                                                                                                                                                                                                                                                                                                                                                                                                                product._.sku = 'VERY-LONG-SKU-NAME-THAT-WILL-FAIL' // Will throw an error on validation
                                                                                                                                                                                                                                                                                                                                                                                                                                product._.price = -5 // Invalid, minimum is 0.01

                                                                                                                                                                                                                                                                                                                                                                                                                                // You can catch specific property errors
                                                                                                                                                                                                                                                                                                                                                                                                                                try {
                                                                                                                                                                                                                                                                                                                                                                                                                                product.validate() // Throws if any mandatory or constrained property fails
                                                                                                                                                                                                                                                                                                                                                                                                                                } catch (err) {
                                                                                                                                                                                                                                                                                                                                                                                                                                console.error("Validation failed:", err.message)
                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                } +
                                                                                                                                                                                                                                                                                                                                                                                                                                import { BaseObject, StringProperty, NumberProperty, ArrayProperty } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                                export class Product extends BaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                                static COLLECTION = 'products'
                                                                                                                                                                                                                                                                                                                                                                                                                                static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                                                                                                                                                                                name: 'sku',
                                                                                                                                                                                                                                                                                                                                                                                                                                type: StringProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                                mandatory: true,
                                                                                                                                                                                                                                                                                                                                                                                                                                // You can restrict maximum length
                                                                                                                                                                                                                                                                                                                                                                                                                                length: 12
                                                                                                                                                                                                                                                                                                                                                                                                                                },
                                                                                                                                                                                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                                                                                                                                                                                name: 'price',
                                                                                                                                                                                                                                                                                                                                                                                                                                type: NumberProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                                // You can specify min/max constraints
                                                                                                                                                                                                                                                                                                                                                                                                                                min: 0.01,
                                                                                                                                                                                                                                                                                                                                                                                                                                max: 10000
                                                                                                                                                                                                                                                                                                                                                                                                                                },
                                                                                                                                                                                                                                                                                                                                                                                                                                {
                                                                                                                                                                                                                                                                                                                                                                                                                                name: 'tags',
                                                                                                                                                                                                                                                                                                                                                                                                                                type: ArrayProperty.TYPE,
                                                                                                                                                                                                                                                                                                                                                                                                                                // Initialize with empty array instead of null
                                                                                                                                                                                                                                                                                                                                                                                                                                defaultValue: []
                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                ]
                                                                                                                                                                                                                                                                                                                                                                                                                                }

                                                                                                                                                                                                                                                                                                                                                                                                                                async function updateProduct(productData: any) {
                                                                                                                                                                                                                                                                                                                                                                                                                                const product = await Product.factory()

                                                                                                                                                                                                                                                                                                                                                                                                                                product._.sku = 'VERY-LONG-SKU-NAME-THAT-WILL-FAIL' // Will throw an error on validation
                                                                                                                                                                                                                                                                                                                                                                                                                                product._.price = -5 // Invalid, minimum is 0.01

                                                                                                                                                                                                                                                                                                                                                                                                                                // You can catch specific property errors
                                                                                                                                                                                                                                                                                                                                                                                                                                try {
                                                                                                                                                                                                                                                                                                                                                                                                                                product.validate() // Throws if any mandatory or constrained property fails
                                                                                                                                                                                                                                                                                                                                                                                                                                } catch (err) {
                                                                                                                                                                                                                                                                                                                                                                                                                                console.error("Validation failed:", err.message)
                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/documents/core_README.html b/docs/public/api-reference/documents/core_README.html index bd890f1b..1a16a788 100644 --- a/docs/public/api-reference/documents/core_README.html +++ b/docs/public/api-reference/documents/core_README.html @@ -14,11 +14,11 @@ -
                                                                                                                                                                                                                                                                                                                                                                                                                                import { BaseObject, StringProperty, NumberProperty } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                                export class Product extends BaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                                static COLLECTION = 'products'
                                                                                                                                                                                                                                                                                                                                                                                                                                static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'name', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'sku', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'price', type: NumberProperty.TYPE, defaultValue: 0 },
                                                                                                                                                                                                                                                                                                                                                                                                                                ]
                                                                                                                                                                                                                                                                                                                                                                                                                                } +
                                                                                                                                                                                                                                                                                                                                                                                                                                import { BaseObject, StringProperty, NumberProperty } from '@quatrain/core'

                                                                                                                                                                                                                                                                                                                                                                                                                                export class Product extends BaseObject {
                                                                                                                                                                                                                                                                                                                                                                                                                                static COLLECTION = 'products'
                                                                                                                                                                                                                                                                                                                                                                                                                                static PROPS_DEFINITION = [
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'name', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'sku', type: StringProperty.TYPE, mandatory: true },
                                                                                                                                                                                                                                                                                                                                                                                                                                { name: 'price', type: NumberProperty.TYPE, defaultValue: 0 },
                                                                                                                                                                                                                                                                                                                                                                                                                                ]
                                                                                                                                                                                                                                                                                                                                                                                                                                }
                                                                                                                                                                                                                                                                                                                                                                                                                                -
                                                                                                                                                                                                                                                                                                                                                                                                                                const product = await Product.factory()
                                                                                                                                                                                                                                                                                                                                                                                                                                product._.name = 'My Awesome Product'
                                                                                                                                                                                                                                                                                                                                                                                                                                product._.sku = 'PROD-001'
                                                                                                                                                                                                                                                                                                                                                                                                                                product._.price = 29.99

                                                                                                                                                                                                                                                                                                                                                                                                                                console.log(product.isValid()) // true
                                                                                                                                                                                                                                                                                                                                                                                                                                console.log(product.toJSON()) // { name: 'My Awesome Product', sku: 'PROD-001', price: 29.99 } +
                                                                                                                                                                                                                                                                                                                                                                                                                                const product = await Product.factory()
                                                                                                                                                                                                                                                                                                                                                                                                                                product._.name = 'My Awesome Product'
                                                                                                                                                                                                                                                                                                                                                                                                                                product._.sku = 'PROD-001'
                                                                                                                                                                                                                                                                                                                                                                                                                                product._.price = 29.99

                                                                                                                                                                                                                                                                                                                                                                                                                                console.log(product.isValid()) // true
                                                                                                                                                                                                                                                                                                                                                                                                                                console.log(product.toJSON()) // { name: 'My Awesome Product', sku: 'PROD-001', price: 29.99 }
                                                                                                                                                                                                                                                                                                                                                                                                                                diff --git a/docs/public/api-reference/documents/gateway-upstream-express_HOWTO.html b/docs/public/api-reference/documents/gateway-upstream-express_HOWTO.html index b7cff435..9b875cdf 100644 --- a/docs/public/api-reference/documents/gateway-upstream-express_HOWTO.html +++ b/docs/public/api-reference/documents/gateway-upstream-express_HOWTO.html @@ -37,7 +37,7 @@