@or-sdk/views
v3.3.2
Published
OneReach SDK client for Views
Downloads
1,631
Readme
@or-sdk/views
OneReach SDK client for Views.
When to use
- Use this package when integrating with the Views 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/viewsUsage
import { Views } from '@or-sdk/views'
// with direct api url
const views = new Views({
token: 'my-account-token-string',
dataHubSvcUrl: 'http://example.data-hub-svc/endpoint'
});
// with service discovery(slower)
const views = new Views({
token: 'my-account-token-string',
discoveryUrl: 'http://example.discovery/endpoint'
});Configuration
- Prefer
dataHubSvcUrlwhen 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 |
|---|---|
| listViews(...) | See the exported TypeScript signature for parameters and result. |
| getView(...) | See the exported TypeScript signature for parameters and result. |
| saveView(...) | See the exported TypeScript signature for parameters and result. |
| return(...) | See the exported TypeScript signature for parameters and result. |
| createView(...) | See the exported TypeScript signature for parameters and result. |
| createLinkedView(...) | See the exported TypeScript signature for parameters and result. |
| updateView(...) | See the exported TypeScript signature for parameters and result. |
| deleteView(...) | See the exported TypeScript signature for parameters and result. |
| recoverView(...) | See the exported TypeScript signature for parameters and result. |
| addTags(...) | See the exported TypeScript signature for parameters and result. |
| removeTags(...) | 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.
Views
| Method | Returns | Purpose |
|---|---|---|
| listOfDownloadableViews(params: ListOfDownloadableViewsParams = {}, paginationOptions: PaginationOptions = {}) | Promise<List<View>> | List of downloadable views |
| download(viewId: string, options: DownloadOptions = {}) | Promise<View> | Download view |
