@or-sdk/tables
v0.30.2
Published
OneReach SDK client for Tables
Readme
@or-sdk/tables
OneReach SDK client for Tables.
When to use
- Use this package when integrating with the Tables capability on the OneReach platform.
- Use its typed client and exported models instead of hand-writing requests to that service.
When not to use
- Do not use it for a different platform capability; choose the dedicated
@or-sdk/*package instead. - Do not use it for generic third-party HTTP calls.
Installation
$ npm i @or-sdk/tablesUsage
import { Tables } from '@or-sdk/tables'
// with direct api url
const tables = new Tables({
token: 'my-account-token-string',
tablesUrl: 'http://example.tables/endpoint'
});
// with service discovery(slower)
const tables = new Tables({
token: 'my-account-token-string',
discoveryUrl: 'http://example.discovery/endpoint'
});
const tableList = await tables.listTables();Configuration
- Prefer
tablesUrlwhen the service URL is known; it avoids a discovery request. - Use
discoveryUrlonly when the service URL is not available. - Provide
tokenas a bearer-token string or getter where supported.
Common pitfalls
- Keep the client token current when it can expire; a token getter is preferable where the constructor accepts one.
- Treat the generated TypeScript types as the authoritative contract for optional parameters and response shapes.
Method map
| Method | Purpose |
|---|---|
| makeApiUrl(...) | See the exported TypeScript signature for parameters and result. |
| listTables(...) | See the exported TypeScript signature for parameters and result. |
| createTable(...) | See the exported TypeScript signature for parameters and result. |
| deleteTable(...) | See the exported TypeScript signature for parameters and result. |
| getTableColumns(...) | See the exported TypeScript signature for parameters and result. |
| listTableRows(...) | See the exported TypeScript signature for parameters and result. |
| upsertTableRows(...) | See the exported TypeScript signature for parameters and result. |
| updateByQuery(...) | See the exported TypeScript signature for parameters and result. |
| deleteTableRows(...) | See the exported TypeScript signature for parameters and result. |
| deleteByQuery(...) | See the exported TypeScript signature for parameters and result. |
| getTableFilters(...) | See the exported TypeScript signature for parameters and result. |
More detail
Full signatures and exported types are available in src/ and dist/types/.
Additional API reference
Methods below were missing from the package guide. Signatures and return types are taken directly from the exported source API.
Tables
| Method | Returns | Purpose |
|---|---|---|
| saveTableFilters(name: string, filters: Filter[]) | Promise<void> | Save table filters |
