retold 1.0.6 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/.claude/settings.local.json +58 -0
  2. package/CLAUDE.md +52 -0
  3. package/docs/.nojekyll +0 -0
  4. package/docs/README.md +161 -0
  5. package/docs/_sidebar.md +65 -0
  6. package/docs/_topbar.md +6 -0
  7. package/docs/architecture.md +312 -0
  8. package/docs/cover.md +15 -0
  9. package/docs/css/docuserve.css +73 -0
  10. package/docs/fable.md +198 -0
  11. package/docs/getting-started.md +272 -0
  12. package/docs/index.html +39 -0
  13. package/docs/js/pict.min.js +12 -0
  14. package/docs/js/pict.min.js.map +1 -0
  15. package/docs/meadow.md +211 -0
  16. package/docs/modules.md +96 -0
  17. package/docs/orator.md +164 -0
  18. package/docs/pict-docuserve.min.js +58 -0
  19. package/docs/pict-docuserve.min.js.map +1 -0
  20. package/docs/pict.md +213 -0
  21. package/docs/retold-building-documentation.md +33 -0
  22. package/docs/retold-catalog.json +2826 -0
  23. package/docs/retold-keyword-index.json +161289 -0
  24. package/docs/utility.md +63 -0
  25. package/examples/quickstart/README.md +47 -0
  26. package/examples/quickstart/layer1/README.md +21 -0
  27. package/examples/quickstart/layer1/index.js +49 -0
  28. package/examples/quickstart/layer1/package-lock.json +344 -0
  29. package/examples/quickstart/layer1/package.json +12 -0
  30. package/examples/quickstart/layer2/README.md +34 -0
  31. package/examples/quickstart/layer2/index.js +251 -0
  32. package/examples/quickstart/layer2/package-lock.json +4468 -0
  33. package/examples/quickstart/layer2/package.json +17 -0
  34. package/examples/quickstart/layer2/setup-database.js +61 -0
  35. package/examples/quickstart/layer3/README.md +39 -0
  36. package/examples/quickstart/layer3/index.js +91 -0
  37. package/examples/quickstart/layer3/package-lock.json +1936 -0
  38. package/examples/quickstart/layer3/package.json +14 -0
  39. package/examples/quickstart/layer4/README.md +47 -0
  40. package/examples/quickstart/layer4/generate-build-config.js +18 -0
  41. package/examples/quickstart/layer4/html/index.html +17 -0
  42. package/examples/quickstart/layer4/package-lock.json +13206 -0
  43. package/examples/quickstart/layer4/package.json +38 -0
  44. package/examples/quickstart/layer4/server.js +28 -0
  45. package/examples/quickstart/layer4/source/BookStore-Application-Config.json +15 -0
  46. package/examples/quickstart/layer4/source/BookStore-Application.js +54 -0
  47. package/examples/quickstart/layer4/source/providers/Router-Config.json +18 -0
  48. package/examples/quickstart/layer4/source/views/View-About.js +38 -0
  49. package/examples/quickstart/layer4/source/views/View-Home.js +50 -0
  50. package/examples/quickstart/layer4/source/views/View-Layout.js +60 -0
  51. package/examples/quickstart/layer5/README.md +26 -0
  52. package/examples/quickstart/layer5/index.js +121 -0
  53. package/examples/quickstart/layer5/package-lock.json +345 -0
  54. package/examples/quickstart/layer5/package.json +13 -0
  55. package/modules/.claude/settings.local.json +52 -0
  56. package/modules/CLAUDE.md +60 -0
  57. package/modules/Checkout.sh +42 -0
  58. package/modules/Include-Retold-Module-List.sh +15 -0
  59. package/modules/Retold-Modules.md +24 -0
  60. package/modules/Status.sh +59 -0
  61. package/modules/Update.sh +45 -0
  62. package/modules/fable/Fable.md +2 -0
  63. package/modules/meadow/Meadow.md +1 -0
  64. package/modules/orator/Orator.md +1 -0
  65. package/modules/pict/Pict.md +1 -0
  66. package/package.json +30 -35
  67. package/source/Retold.cjs +2 -0
  68. package/test/Retold_tests.js +23 -41
  69. package/.travis.yml +0 -13
  70. package/source/Retold-Meadow-Macros.js +0 -269
  71. package/source/Retold.js +0 -48
package/docs/meadow.md ADDED
@@ -0,0 +1,211 @@
1
+ # Meadow — Data Access Layer
2
+
3
+ Meadow provides provider-agnostic data access for Retold applications. Define your entities once, and Meadow handles CRUD operations, query generation, schema management, and audit tracking across MySQL, MSSQL, SQLite, or in-browser ALASQL.
4
+
5
+ ## How the Pieces Fit
6
+
7
+ ```mermaid
8
+ graph LR
9
+ app["Application Code"] --> meadow["Meadow<br/>(ORM)"]
10
+ meadow --> foxhound["FoxHound<br/>(Query DSL)"]
11
+ foxhound --> conn["Connection<br/>(mysql/mssql/sqlite)"]
12
+ conn --> db[("Database")]
13
+ meadow --> stricture["Stricture<br/>(Schema)"]
14
+ stricture --> output["JSON Schema<br/>DDL<br/>Documentation"]
15
+
16
+ style app fill:#e8f5e9,stroke:#43a047,color:#333
17
+ style meadow fill:#fff3e0,stroke:#ffa726,color:#333
18
+ style foxhound fill:#fff3e0,stroke:#ffcc80,color:#333
19
+ style conn fill:#fff3e0,stroke:#ffcc80,color:#333
20
+ style stricture fill:#fff3e0,stroke:#ffcc80,color:#333
21
+ style db fill:#ffebee,stroke:#ef5350,color:#333
22
+ style output fill:#f5f5f5,stroke:#bdbdbd,color:#666
23
+ ```
24
+
25
+ **Meadow** is the data broker — it exposes CRUD methods, handles audit columns, and delegates query building and execution to FoxHound and the connection provider.
26
+
27
+ **FoxHound** generates SQL from a fluent API. Write one query definition; get correct SQL for any supported dialect.
28
+
29
+ **Stricture** defines schemas in a simple MicroDDL format and generates JSON, SQL DDL, documentation, and Meadow schema files from a single source of truth.
30
+
31
+ ## Core Modules
32
+
33
+ ### [Meadow](/meadow/meadow/)
34
+
35
+ The central data broker. Each Meadow instance represents one data entity (table).
36
+
37
+ ```javascript
38
+ const libFable = require('fable');
39
+ const libMeadow = require('meadow');
40
+
41
+ let _Fable = new libFable({
42
+ Product: 'BookStore',
43
+ MySQL: { Server: 'localhost', User: 'root', Database: 'bookstore' }
44
+ });
45
+
46
+ let _BookMeadow = _Fable.instantiateServiceProvider('Meadow',
47
+ {
48
+ Scope: 'Book',
49
+ DefaultSchema: require('./Book-Schema.json')
50
+ });
51
+ ```
52
+
53
+ **Built-in operations:**
54
+
55
+ | Operation | Method | Description |
56
+ |-----------|--------|-------------|
57
+ | Create | `.doCreate(record, callback)` | Insert a new record |
58
+ | Read | `.doRead(id, callback)` | Get one record by ID |
59
+ | Reads | `.doReads(query, callback)` | Get multiple records with filtering |
60
+ | Update | `.doUpdate(record, callback)` | Update an existing record |
61
+ | Delete | `.doDelete(id, callback)` | Soft-delete a record |
62
+ | Undelete | `.doUndelete(id, callback)` | Restore a soft-deleted record |
63
+ | Count | `.doCount(query, callback)` | Count matching records |
64
+
65
+ **Automatic features:** audit columns (CreatingIDUser, UpdatingIDUser, CreateDate, UpdateDate), soft deletes (Deleted flag + DeleteDate), GUID uniqueness (GUIDBook column), and data marshalling.
66
+
67
+ **npm:** `meadow` · **Version:** 2.0.x
68
+
69
+ ---
70
+
71
+ ### [FoxHound](/meadow/foxhound/)
72
+
73
+ A fluent query DSL that generates dialect-specific SQL.
74
+
75
+ ```javascript
76
+ let tmpQuery = _Fable.instantiateServiceProvider('FoxHound')
77
+ .setScope('Book')
78
+ .addFilter('Author', 'Tolkien')
79
+ .addFilter('YearPublished', '1954', '>=')
80
+ .setSort('Title')
81
+ .setBegin(0).setCap(10)
82
+ .buildReadQuery();
83
+
84
+ // MySQL: SELECT * FROM Book WHERE Author = 'Tolkien'
85
+ // AND YearPublished >= '1954' ORDER BY Title LIMIT 0,10
86
+ // MSSQL: SELECT TOP 10 * FROM Book WHERE Author = 'Tolkien' ...
87
+ // SQLite: SELECT * FROM Book WHERE Author = 'Tolkien' ... LIMIT 10 OFFSET 0
88
+ ```
89
+
90
+ **Supported dialects:** MySQL, MSSQL, SQLite, ALASQL (in-browser)
91
+
92
+ **Operations:** Create, Read, Update, Delete, Count — each generates the correct SQL for the configured dialect with parameterized queries to prevent injection.
93
+
94
+ **npm:** `foxhound` · **Version:** 2.0.x
95
+
96
+ ---
97
+
98
+ ### [Stricture](/meadow/stricture/)
99
+
100
+ A MicroDDL for rapid data model definition.
101
+
102
+ ```
103
+ # Book entity
104
+ Book
105
+ IDBook | int | identity | primary
106
+ GUIDBook | guid | unique
107
+ Title | string(200)
108
+ Author | string(200)
109
+ YearPublished | int
110
+ ISBN | string(20)
111
+ ```
112
+
113
+ From this definition, Stricture generates:
114
+
115
+ - **JSON schema** — For Meadow entity configuration
116
+ - **MySQL CREATE TABLE** — Database DDL with indexes
117
+ - **Meadow schema** — Column definitions for the data broker
118
+ - **Documentation** — Human-readable data model docs
119
+
120
+ **npm:** `stricture` · **Version:** 1.0.x
121
+
122
+ ---
123
+
124
+ ### [Meadow-Endpoints](/meadow/meadow-endpoints/)
125
+
126
+ Auto-generates a full REST API from a Meadow entity. Given a "Book" entity, you get:
127
+
128
+ | Route | Method | Operation |
129
+ |-------|--------|-----------|
130
+ | `GET /Books` | Reads | List with filtering and pagination |
131
+ | `GET /Books/Count` | Count | Record count |
132
+ | `GET /Book/:id` | Read | Single record by ID |
133
+ | `GET /Book/Schema` | Schema | Entity schema definition |
134
+ | `POST /Book` | Create | Insert new record |
135
+ | `PUT /Book` | Update | Modify existing record |
136
+ | `DEL /Book/:id` | Delete | Soft-delete record |
137
+ | `DEL /Book/:id/Undelete` | Undelete | Restore record |
138
+
139
+ **Behavior injection** lets you add hooks at any lifecycle point:
140
+
141
+ ```javascript
142
+ _Endpoints.BehaviorModifications.setBehavior('Read-Authorize',
143
+ function(pRequest, fCallback)
144
+ {
145
+ // Check permissions before allowing the read
146
+ if (!pRequest.UserSession.authenticated)
147
+ {
148
+ pRequest.CommonServices.log.warn('Unauthorized access attempt');
149
+ return fCallback('Unauthorized');
150
+ }
151
+ return fCallback();
152
+ });
153
+ ```
154
+
155
+ **npm:** `meadow-endpoints` · **Version:** 4.0.x
156
+
157
+ ---
158
+
159
+ ### [Retold-Data-Service](/meadow/retold-data-service/)
160
+
161
+ An all-in-one Fable service that assembles a Stricture schema into a complete REST API — Meadow entity, endpoints, and connection — in a single service instantiation.
162
+
163
+ ```javascript
164
+ let _BookService = _Fable.instantiateServiceProvider('RetoldDataService',
165
+ {
166
+ Scope: 'Book',
167
+ Schema: BookSchema
168
+ });
169
+
170
+ // That's it — full CRUD REST API is ready to be wired to Orator
171
+ ```
172
+
173
+ **npm:** `retold-data-service` · **Version:** 2.0.x
174
+
175
+ ## Connection Modules
176
+
177
+ | Module | Database | npm |
178
+ |--------|----------|-----|
179
+ | [meadow-connection-mysql](/meadow/meadow-connection-mysql/) | MySQL / MariaDB | `meadow-connection-mysql` |
180
+ | [meadow-connection-mssql](/meadow/meadow-connection-mssql/) | Microsoft SQL Server | `meadow-connection-mssql` |
181
+ | [meadow-connection-sqlite](/meadow/meadow-connection-sqlite/) | SQLite (via better-sqlite3) | `meadow-connection-sqlite` |
182
+
183
+ Each connection module provides a pooled database connection as a Fable service. Swap between databases by changing which connection module you install — no application code changes needed.
184
+
185
+ ## Supporting Modules
186
+
187
+ | Module | Purpose | npm |
188
+ |--------|---------|-----|
189
+ | [bibliograph](/meadow/bibliograph/) | Key-value record comprehension for change tracking in ingestion pipelines | `bibliograph` |
190
+ | [parime](/meadow/parime/) | Generic data lake behaviors and services | `parime` |
191
+ | [retold-harness](/meadow/retold-harness/) | Pre-built API harness with a bookstore demo (8 entities, 10,000+ records) | `retold-harness` |
192
+ | [meadow-integration](/meadow/meadow-integration/) | Data integration tools for CSV import and schema mapping | `meadow-integration` |
193
+ | [meadow-graph-client](/meadow/meadow-graph-client/) | Client for pulling related record sets from relational database graphs | `meadow-graph-client` |
194
+
195
+ ## All Meadow Modules
196
+
197
+ | Module | Description |
198
+ |--------|-------------|
199
+ | [meadow](/meadow/meadow/) | Provider-agnostic data broker and ORM |
200
+ | [foxhound](/meadow/foxhound/) | Fluent query DSL with multi-dialect SQL generation |
201
+ | [stricture](/meadow/stricture/) | MicroDDL schema definition and code generation |
202
+ | [meadow-endpoints](/meadow/meadow-endpoints/) | Automatic RESTful CRUD endpoint generation |
203
+ | [meadow-connection-mysql](/meadow/meadow-connection-mysql/) | MySQL connection provider |
204
+ | [meadow-connection-mssql](/meadow/meadow-connection-mssql/) | MSSQL connection provider |
205
+ | [meadow-connection-sqlite](/meadow/meadow-connection-sqlite/) | SQLite connection provider |
206
+ | [retold-data-service](/meadow/retold-data-service/) | All-in-one schema-to-REST-API service |
207
+ | [retold-harness](/meadow/retold-harness/) | Demo API harness with bookstore dataset |
208
+ | [bibliograph](/meadow/bibliograph/) | Record-level change tracking |
209
+ | [parime](/meadow/parime/) | Data lake behaviors |
210
+ | [meadow-integration](/meadow/meadow-integration/) | Data integration and CSV import |
211
+ | [meadow-graph-client](/meadow/meadow-graph-client/) | Relational graph record fetching |
@@ -0,0 +1,96 @@
1
+ # All Modules
2
+
3
+ An exhaustive list of every repository in the Retold suite, organized by group. Each module is its own git repository hosted at `github.com/stevenvelozo/<module-name>`.
4
+
5
+ ## Fable — Core Ecosystem (6 modules)
6
+
7
+ | Module | npm | Description |
8
+ |--------|-----|-------------|
9
+ | [fable](/fable/fable/) | `fable` | Service dependency injection, configuration, and logging library — the foundation of every Retold application |
10
+ | [fable-serviceproviderbase](/fable/fable-serviceproviderbase/) | `fable-serviceproviderbase` | Base classes for Fable services providing registration, DI, and lifecycle |
11
+ | [fable-settings](/fable/fable-settings/) | `fable-settings` | Tolerant configuration chain for loading and merging application settings |
12
+ | [fable-log](/fable/fable-log/) | `fable-log` | Flexible logging wrapper with six levels and extensible output streams |
13
+ | [fable-uuid](/fable/fable-uuid/) | `fable-uuid` | UUID generator supporting RFC 4122 v4 and configurable random strings |
14
+ | [fable-log-logger-bunyan](/fable/fable-log-logger-bunyan/) | `fable-log-logger-bunyan` | Bunyan structured logging provider for Fable-Log |
15
+
16
+ ## Meadow — Data Access Layer (13 modules)
17
+
18
+ | Module | npm | Description |
19
+ |--------|-----|-------------|
20
+ | [meadow](/meadow/meadow/) | `meadow` | Provider-agnostic data broker with CRUD operations, audit tracking, and soft deletes |
21
+ | [foxhound](/meadow/foxhound/) | `foxhound` | Fluent query DSL generating dialect-specific SQL for MySQL, MSSQL, SQLite, and ALASQL |
22
+ | [stricture](/meadow/stricture/) | `stricture` | MicroDDL schema definition language generating JSON, SQL DDL, and documentation |
23
+ | [meadow-endpoints](/meadow/meadow-endpoints/) | `meadow-endpoints` | Automatic RESTful CRUD endpoint generation from Meadow entities with behavior injection |
24
+ | [meadow-connection-mysql](/meadow/meadow-connection-mysql/) | `meadow-connection-mysql` | MySQL/MariaDB pooled connection provider for Meadow |
25
+ | [meadow-connection-mssql](/meadow/meadow-connection-mssql/) | `meadow-connection-mssql` | Microsoft SQL Server connection provider for Meadow |
26
+ | [meadow-connection-sqlite](/meadow/meadow-connection-sqlite/) | `meadow-connection-sqlite` | SQLite connection provider for Meadow via better-sqlite3 |
27
+ | [retold-data-service](/meadow/retold-data-service/) | `retold-data-service` | All-in-one Fable service assembling schema → entity → endpoints → REST API |
28
+ | [retold-harness](/meadow/retold-harness/) | `retold-harness` | Pre-built API harness with a bookstore demo (8 entities, 10,000+ records) |
29
+ | [bibliograph](/meadow/bibliograph/) | `bibliograph` | Key-value record comprehension for change tracking in data ingestion pipelines |
30
+ | [parime](/meadow/parime/) | `parime` | Generic data lake behaviors and services |
31
+ | [meadow-integration](/meadow/meadow-integration/) | `meadow-integration` | Data integration tools for CSV import, schema mapping, and centralized formats |
32
+ | [meadow-graph-client](/meadow/meadow-graph-client/) | `meadow-graph-client` | Client for pulling related record sets from relational database graphs |
33
+
34
+ ## Orator — API Server (6 modules)
35
+
36
+ | Module | npm | Description |
37
+ |--------|-----|-------------|
38
+ | [orator](/orator/orator/) | `orator` | Unopinionated HTTP server abstraction with lifecycle hooks and route management |
39
+ | [orator-serviceserver-restify](/orator/orator-serviceserver-restify/) | `orator-serviceserver-restify` | Production HTTP server implementation powered by Restify |
40
+ | [orator-static-server](/orator/orator-static-server/) | `orator-static-server` | Static file serving with MIME detection, default files, and subdomain routing |
41
+ | [orator-http-proxy](/orator/orator-http-proxy/) | `orator-http-proxy` | HTTP reverse proxy for forwarding requests to backend services |
42
+ | [tidings](/orator/tidings/) | `tidings` | Extensible reporting system for generating HTML, PDF, and other format reports |
43
+ | [orator-endpoint](/orator/orator-endpoint/) | `orator-endpoint` | Pluggable API endpoint base class for reusable route handlers |
44
+
45
+ ## Pict — MVC Tools (15 modules)
46
+
47
+ | Module | npm | Description |
48
+ |--------|-----|-------------|
49
+ | [pict](/pict/pict/) | `pict` | Non-opinionated MVC module with template expression engine for text-based UIs |
50
+ | [pict-view](/pict/pict-view/) | `pict-view` | View base class with full lifecycle (init, render, solve, marshal), renderables, and CSS |
51
+ | [pict-template](/pict/pict-template/) | `pict-template` | Template handler base class for custom expression types |
52
+ | [pict-provider](/pict/pict-provider/) | `pict-provider` | Data provider base class for delivering data to views |
53
+ | [pict-application](/pict/pict-application/) | `pict-application` | Application base class coordinating views, state, and lifecycle |
54
+ | [pict-section-form](/pict/pict-section-form/) | `pict-section-form` | Configuration-driven dynamic forms with 13+ input types and data marshaling |
55
+ | [pict-section-recordset](/pict/pict-section-recordset/) | `pict-section-recordset` | CRUD record management views from Meadow endpoint schemas |
56
+ | [pict-section-tuigrid](/pict/pict-section-tuigrid/) | `pict-section-tuigrid` | Toast UI Grid integration for tabular data display and editing |
57
+ | [pict-section-content](/pict/pict-section-content/) | `pict-section-content` | Content display sections for static and dynamic content blocks |
58
+ | [pict-panel](/pict/pict-panel/) | `pict-panel` | Hot-loadable control panel component for browser applications |
59
+ | [pict-router](/pict/pict-router/) | `pict-router` | Hash-based URL routing via Navigo with template string route functions |
60
+ | [informary](/pict/informary/) | `informary` | Dependency-free browser form marshaling with undo/redo and field-level deltas |
61
+ | [cryptbrau](/pict/cryptbrau/) | `cryptbrau` | Simple in-browser symmetric encryption |
62
+ | [pict-serviceproviderbase](/pict/pict-serviceproviderbase/) | `pict-serviceproviderbase` | Base classes for Pict services with pre-initialization support |
63
+ | [pict-service-commandlineutility](/pict/pict-service-commandlineutility/) | `pict-service-commandlineutility` | CLI utility module built on Commander for Pict-based command-line tools |
64
+
65
+ ## Utility — Build & Documentation Tools (5 modules)
66
+
67
+ | Module | npm | Description |
68
+ |--------|-----|-------------|
69
+ | [indoctrinate](/utility/indoctrinate/) | `indoctrinate` | Documentation scaffolding with content cataloging, label-based filtering, and multi-format output |
70
+ | [manyfest](/utility/manyfest/) | `manyfest` | JSON manifest for consistent data description, validation, and address-based access across layers |
71
+ | [quackage](/utility/quackage/) | `quackage` | Standardized build tool for browser bundles, transpilation, testing, and packaging |
72
+ | [choreographic](/utility/choreographic/) | `choreographic` | Scaffolding for single-run data processing scripts with organized output |
73
+ | [ultravisor](/utility/ultravisor/) | `ultravisor` | Process supervision with scheduled tasks, distributed nodes, and LLM integration |
74
+
75
+ ## Summary
76
+
77
+ | Group | Count | Focus |
78
+ |-------|-------|-------|
79
+ | Fable | 6 | Core ecosystem, DI, configuration, logging |
80
+ | Meadow | 13 | Data access, ORM, query DSL, schema, connectors |
81
+ | Orator | 6 | API server, HTTP, static files, proxy, reporting |
82
+ | Pict | 15 | MVC, views, templates, forms, grids, routing |
83
+ | Utility | 5 | Build tools, manifests, docs, process supervision |
84
+ | **Total** | **45** | |
85
+
86
+ ## GitHub Repositories
87
+
88
+ All modules are hosted at `github.com/stevenvelozo/<module-name>`:
89
+
90
+ - [github.com/stevenvelozo/retold](https://github.com/stevenvelozo/retold) — This meta-repository
91
+ - [github.com/stevenvelozo/fable](https://github.com/stevenvelozo/fable) — Core ecosystem
92
+ - [github.com/stevenvelozo/meadow](https://github.com/stevenvelozo/meadow) — Data access
93
+ - [github.com/stevenvelozo/orator](https://github.com/stevenvelozo/orator) — API server
94
+ - [github.com/stevenvelozo/pict](https://github.com/stevenvelozo/pict) — MVC tools
95
+
96
+ Each module follows the same structure: `package.json`, `source/`, `test/` (Mocha TDD), and optionally `docs/` (Docsify).
package/docs/orator.md ADDED
@@ -0,0 +1,164 @@
1
+ # Orator — API Server
2
+
3
+ Orator provides an unopinionated HTTP server abstraction for Retold applications. It wraps service server implementations (Restify for production, IPC for testing) behind a consistent interface, so your application code does not depend on any specific HTTP library.
4
+
5
+ ## How It Works
6
+
7
+ ```mermaid
8
+ graph TB
9
+ app["Your Application<br/>(routes, middleware, etc.)"]
10
+ app --> core["Orator Core<br/>Lifecycle, content types,<br/>route registration"]
11
+ core --> restify["Restify Server<br/>(Production)"]
12
+ core --> ipc["IPC Server<br/>(Testing)"]
13
+ core --> other["(Other servers)"]
14
+
15
+ style app fill:#e8f5e9,stroke:#43a047,color:#333
16
+ style core fill:#e3f2fd,stroke:#42a5f5,color:#333
17
+ style restify fill:#fff,stroke:#90caf9,color:#333
18
+ style ipc fill:#fff,stroke:#90caf9,color:#333
19
+ style other fill:#f5f5f5,stroke:#bdbdbd,color:#666
20
+ ```
21
+
22
+ Your application registers routes, middleware, and lifecycle hooks with Orator. Orator delegates to whichever service server implementation is configured — Restify for real HTTP, IPC for in-process testing.
23
+
24
+ ## Core Modules
25
+
26
+ ### [Orator](/orator/orator/)
27
+
28
+ The main server abstraction. Manages lifecycle, route registration, and service server delegation.
29
+
30
+ ```javascript
31
+ const libFable = require('fable');
32
+ const libOrator = require('orator');
33
+
34
+ let _Fable = new libFable({
35
+ Product: 'MyAPI',
36
+ APIServerPort: 8080
37
+ });
38
+
39
+ let _Orator = _Fable.instantiateServiceProvider('Orator');
40
+
41
+ // Register routes
42
+ _Orator.addRoute('GET', '/health', function(pRequest, pResponse, fNext)
43
+ {
44
+ pResponse.send({ status: 'ok' });
45
+ return fNext();
46
+ });
47
+
48
+ // Start the server
49
+ _Orator.startService(function(pError)
50
+ {
51
+ _Fable.log.info('Server listening on port 8080');
52
+ });
53
+ ```
54
+
55
+ **Lifecycle hooks** let you inject behavior at server startup, before/after route handling, and at shutdown:
56
+
57
+ ```javascript
58
+ _Orator.addPreStartFunction(function(fCallback) { /* ... */ return fCallback(); });
59
+ _Orator.addPreRouteFunction(function(pRequest, pResponse, fNext) { /* ... */ return fNext(); });
60
+ ```
61
+
62
+ **npm:** `orator` · **Version:** 5.0.x
63
+
64
+ ---
65
+
66
+ ### [Orator-ServiceServer-Restify](/orator/orator-serviceserver-restify/)
67
+
68
+ Production HTTP server powered by Restify. Provides full HTTP support, body parsing, CORS, middleware, and configurable listen options.
69
+
70
+ This is the server implementation used for real deployments. Install it alongside Orator and it registers itself automatically.
71
+
72
+ ```javascript
73
+ const libOrator = require('orator');
74
+ require('orator-serviceserver-restify');
75
+
76
+ // Restify server is now the active service server
77
+ ```
78
+
79
+ **npm:** `orator-serviceserver-restify` · **Version:** 2.0.x
80
+
81
+ ---
82
+
83
+ ### [Orator-Static-Server](/orator/orator-static-server/)
84
+
85
+ Static file serving for Orator with MIME type detection, default file support, subdomain-based folder routing, and configurable route prefix stripping.
86
+
87
+ ```javascript
88
+ _Orator.addStaticRoute('/app', '/var/www/app/dist');
89
+ ```
90
+
91
+ **npm:** `orator-static-server` · **Version:** 1.0.x
92
+
93
+ ---
94
+
95
+ ### [Orator-HTTP-Proxy](/orator/orator-http-proxy/)
96
+
97
+ Reverse proxy for forwarding requests to backend services. Supports multiple HTTP verbs and handles HTTP-to-HTTPS translation.
98
+
99
+ ```javascript
100
+ _Orator.addProxyRoute('/api/external', 'https://backend.example.com/api');
101
+ ```
102
+
103
+ **npm:** `orator-http-proxy` · **Version:** 1.0.x
104
+
105
+ ---
106
+
107
+ ### [Tidings](/orator/tidings/)
108
+
109
+ An extensible reporting system for generating HTML, PDF, and other format reports. Provides asset collection, templating, and rasterization in a micro-service-friendly pattern.
110
+
111
+ **npm:** `tidings` · **Version:** 1.0.x
112
+
113
+ ---
114
+
115
+ ### [Orator-Endpoint](/orator/orator-endpoint/)
116
+
117
+ A base class for creating reusable, pluggable API endpoint handlers that can be shared across Orator applications.
118
+
119
+ **npm:** `orator-endpoint` · **Version:** 1.0.x
120
+
121
+ ## Typical Setup
122
+
123
+ A standard API server combines Orator with Meadow-Endpoints:
124
+
125
+ ```javascript
126
+ const libFable = require('fable');
127
+ const libOrator = require('orator');
128
+ const libMeadowEndpoints = require('meadow-endpoints');
129
+ require('orator-serviceserver-restify');
130
+
131
+ let _Fable = new libFable({
132
+ Product: 'BookAPI',
133
+ APIServerPort: 8086,
134
+ MySQL: { Server: 'localhost', User: 'root', Database: 'bookstore' }
135
+ });
136
+
137
+ let _Orator = _Fable.instantiateServiceProvider('Orator');
138
+
139
+ // Create a data entity and wire its endpoints to Orator
140
+ let _BookEntity = _Fable.instantiateServiceProvider('Meadow',
141
+ { Scope: 'Book', DefaultSchema: BookSchema });
142
+ let _BookEndpoints = _Fable.instantiateServiceProvider('MeadowEndpoints',
143
+ { Entity: _BookEntity });
144
+ _BookEndpoints.connectRoutes(_Orator);
145
+
146
+ // Start serving
147
+ _Orator.startService((pError) =>
148
+ {
149
+ _Fable.log.info('BookAPI running on :8086');
150
+ });
151
+ ```
152
+
153
+ This gives you a full REST API with Create, Read, Reads, Update, Delete, Undelete, Count, and Schema endpoints for the Book entity — all auto-generated.
154
+
155
+ ## All Orator Modules
156
+
157
+ | Module | Description |
158
+ |--------|-------------|
159
+ | [orator](/orator/orator/) | HTTP server abstraction with lifecycle hooks |
160
+ | [orator-serviceserver-restify](/orator/orator-serviceserver-restify/) | Production HTTP server via Restify |
161
+ | [orator-static-server](/orator/orator-static-server/) | Static file serving with MIME detection |
162
+ | [orator-http-proxy](/orator/orator-http-proxy/) | HTTP reverse proxy pass-through |
163
+ | [tidings](/orator/tidings/) | Reporting scaffolding for HTML/PDF output |
164
+ | [orator-endpoint](/orator/orator-endpoint/) | Reusable endpoint base class |