Sunbird Client Services
In order to facilitate Adopters to connect with Sunbird System. Typescript based library to connect with APIs. It can facilitate the adopters with readily available data models.
Current Release Branch
release-4.5.0
NPM Published version (Latest)
4.5.1
NPM Package Name
@project-sunbird/client-services
Works
Across All JavaScript Based Projects
Overview
The library is grouped into Modules and SubModules as shown below -
@project-sunbird/client-services
βββ /core
β βββ /http-service
β βββ /utilities
β βββ /interceptors
βββ /models
β βββ /channel
β βββ /content
β βββ /course
β βββ /device
β βββ /faq
β βββ /form
β βββ /group
β βββ /organisation
β βββ /page
β βββ /user
βββ /services
βββ /content
β βββ /utilities
β βββ /content-group-generator
βββ /groupThe public facing API is prefixed with 'Cs' namespace, as in -
CsModule
CsConfig
CsGroupService
...
For instance,
CsModule is part of the root module
CsContentsGroupGenerator is a utlility within content service
Their respective imports would be -
Installation
To install the package
The package requires the consumer to have rxjs@6.x.x installed as the only peerDependency
Getting Started
To use the library CsModule, it needs to be initialised with basic configuration. CsModule is a singleton and it would be best to check if it has already been initialised before attempting to initialise -
Adapters
If the client for the library is a cordova project, use the 'HttpClientCordovaAdapter' adapter or use 'HttpClientBrowserAdapter'. 'HttpClientBrowserAdapter' is the default if not specified.
Update Configuration
The configuration can be dynamically reset after initialisation
Accessing a service
The CsModule being a singleton, every service within would also be a singleton, To access any service -
Services
Every service by default will utilise the optional configuration declared during init() or updateConfig()
Additionally, methods of the service may have an optional argument that can override the global configuration explicitly just for that method call
CsGroupService
This service deals with user group management and has the following interface -
CsFrameworkService
CsLocationService
CsLocationService
Last updated
Was this helpful?