@kelvininc/js-client-sdk
v7.21.0
Published
Kelvin SDK Client creates a communication layer that abstract all business logic
Downloads
16
Readme
Kelvin SDK Client - JavaScript Overview
Kelvin SDK Client abstracts all the communication layer with the KICS Platform, so the developers can be more focused on building what provides value for their applications - the user experience (UX) and business logic. This approach increases developer productivity and aims to enable higher quality apps by leveraging the server communication with this library.
Supported Platforms
We currently support the following JavaScript platforms:
Kelvin SDK Client API Documentation
You can find the full Client API reference here.
Kelvin Resource Name (KRN) Parsing methods
KRN Parsing
You can parse a KRN resource by using our KRNParser.
const textToParse = 'krn:asset:test';
const result = KvKRNParser.parseKRN(textToParse)
If the krn is valid, the expected result should return the content of the resource asset.
export type KrnParseSuccessResult<T> = {
parseState: EKrnParseState.ValidKRN;
resource: EKrnResource;
resourceContent: T;
};
Where T is from type IAssetKrnResource, represented by:
export interface IAssetKrnResource {
name: string;
}
If the krn is invalid, the result is going to be represented by the type:
export type IKrnParseError = {
parseState: EKrnParseState.InvalidKRN;
errorMessage: string;
};
KRN Creation
const name = 'api-name';
const version = '1.0.0';
const userType = EKrnUserType.User;
const user = '[email protected]';
const apiKRN = KvKRNParser.buildKRN<EKrnResource.Api>(EKrnResource.Api, apiKRN)
The constant apiKRN, should contain the string krn:api:api-name:1.0.0:user/[email protected]