API Reference
Complete export reference for the four Atscript OData packages, one page per package. The Guide explains how they fit together; these pages hold the exact signatures.
Preview release
The packages are a preview (0.0.x): their APIs may still change between releases.
| Package | Entry points | What it does | Reference |
|---|---|---|---|
@atscript/odata | . (browser and Node) | Core: live source, $metadata parser, service engine, query and write translation, codecs, transport, errors | @atscript/odata |
./plugin (Node), CLI atscript-odata | Atscript plugin that generates .as models, fetchODataMetadata, the fetch command | @atscript/odata/plugin and CLI | |
@atscript/odata-client | . | Browser client: a ClientLike of @atscript/db-client that talks OData directly | @atscript/odata-client |
@atscript/db-odata | . | Atscript DB adapter that uses an OData service as the database, its space and sessions | @atscript/db-odata |
@atscript/moost-odata | . | Moost controllers, credentials strategies and error mapping for a Moost server | @atscript/moost-odata |
./client (browser) | operationsClient: a page's typed caller of the operations routes | /client |
Which page for which task
| You want to | Start at |
|---|---|
Generate .as models from a saved $metadata | odataPlugin, atscript-odata fetch |
| Connect the live service over the generated models | the hosts below; createODataSource for a host of your own |
| Build everything at runtime, without a build step | a registration without model (LiveServiceRegistration), createODataSource |
| Point atscript-ui tables and forms at OData from the browser | createODataClientFactory |
| Serve an OData service through a Moost server | createODataSpace, ODataTableController |
| Give the server its credentials for the service | basicAuth, bearerAuth, combineAuth; sessions: ODataSessionOptions |
| Call a function import or an action from code of your own | the model module's ops (ODataOperationRef) with the host's typed call: odata.call in the browser, space.callOperation on a server, operationsClient on a Moost page; in a controller, the bases' runOperation() method |
| Handle errors | Errors guide, then each package's error classes |
Dependencies between the packages
@atscript/odata core, browser + Node; ./plugin is Node only
├── @atscript/odata-client + @atscript/db-client
└── @atscript/db-odata + @atscript/db
└── @atscript/moost-odata + @atscript/moost-db, moost, @moostjs/event-httpEach package depends on the one above it; the + names its main peer dependencies. See Installation for the full install command of each setup.