UNPKG

database-all

Version:

MIMS Drug Database integration

60 lines 1.7 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class BaseData { // set client id in base data static setClientId(clientId) { this.clientId = clientId; } // set client secret in base data static setClientSecret(clientSecret) { this.clientSecret = clientSecret; } // set grant type in base data static setGrantType(grantType) { this.grantType = grantType; } // set api key in base data static setAPIKey(key) { this.apiKey = key; } // set generated token in base data static setAccessTokenData(authResponseData) { let createdAt = new Date(); createdAt.setHours(createdAt.getHours() + 3); this.tokenData = { tokenType: authResponseData['token_type'], expiresIn: createdAt.getTime(), accessToken: authResponseData['access_token'], }; } // reset access token data static resetAccessTokenData() { this.tokenData = { tokenType: '', expiresIn: 0, accessToken: '' }; } // get client id from base data static getClientId() { return this.clientId; } // get client secret from base data static getClientSecret() { return this.clientSecret; } // get client grant type from base data static getGrantType() { return this.grantType; } // get api key from base data static getAPIKey() { return this.apiKey; } // get generated token from base data static getAccessTokenData() { return this.tokenData; } } exports.default = BaseData; //# sourceMappingURL=baseData.js.map