Comparing version 0.5.0 to 0.5.1
@@ -39,6 +39,8 @@ /* eslint-disable max-len */ | ||
this.options = { | ||
uris: { | ||
social: 'id.elarian.com:443', | ||
state: 'api.elarian.com:443', | ||
this.config = { | ||
options: { | ||
uris: { | ||
social: 'id.elarian.com:443', | ||
state: 'api.elarian.com:443', | ||
}, | ||
}, | ||
@@ -108,3 +110,4 @@ ...opts, | ||
const uri = this.options.uris.state; | ||
const { options } = this.config; | ||
const uri = options.uris.state; | ||
const def = protoLoader.loadSync( | ||
@@ -121,3 +124,4 @@ utils.SERVICE_PROTO.APP_STATE, | ||
const pd = grpc.loadPackageDefinition(def); | ||
this._appStateService = new pd.com.elarian.hera.proto.AppStateService(uri, grpc.credentials.createSsl()); | ||
const credentials = options.dev ? grpc.credentials.createInsecure() : grpc.credentials.createSsl(); | ||
this._appStateService = new pd.com.elarian.hera.proto.AppStateService(uri, credentials); | ||
return this._appStateService; | ||
@@ -132,3 +136,4 @@ }; | ||
const uri = this.options.uris.social; | ||
const { options } = this.config; | ||
const uri = options.uris.social; | ||
const def = protoLoader.loadSync( | ||
@@ -145,3 +150,4 @@ utils.SERVICE_PROTO.SOCIAL, | ||
const pd = grpc.loadPackageDefinition(def); | ||
this._socialService = new pd.com.elarian.hera.proto.SocialService(uri, grpc.credentials.createSsl()); | ||
const credentials = options.dev ? grpc.credentials.createInsecure() : grpc.credentials.createSsl(); | ||
this._socialService = new pd.com.elarian.hera.proto.SocialService(uri, credentials); | ||
return this._socialService; | ||
@@ -148,0 +154,0 @@ }; |
@@ -38,7 +38,8 @@ /* eslint-disable no-underscore-dangle */ | ||
Elarian.prototype.fetchAppState = function fetchAppState() { | ||
const { appId, sessionId } = this.config; | ||
const service = this._getAppStateService(); | ||
return new Promise((resolve, reject) => { | ||
const params = { | ||
appId: this.options.appId, | ||
sessionId: this.options.sessionId, | ||
appId, | ||
sessionId, | ||
}; | ||
@@ -66,2 +67,3 @@ service.GetAppState(params, (error, result) => { | ||
const { appId, sessionId } = this.config; | ||
const service = this._getAppStateService(); | ||
@@ -72,4 +74,4 @@ | ||
state: { | ||
appId: this.options.appId, | ||
sessionId: this.options.sessionId, | ||
appId, | ||
sessionId, | ||
state: data, | ||
@@ -76,0 +78,0 @@ }, |
@@ -8,2 +8,3 @@ /* eslint-disable max-len */ | ||
* @property {string} appId | ||
* @property {Object} [options] | ||
*/ | ||
@@ -10,0 +11,0 @@ |
{ | ||
"name": "elarian", | ||
"version": "0.5.0", | ||
"version": "0.5.1", | ||
"description": "Elarian JavaScript SDK", | ||
@@ -36,2 +36,3 @@ "main": "index.js", | ||
"devDependencies": { | ||
"@alenon/grpc-mock-server": "^3.1.8", | ||
"dotenv": "^16.3.1", | ||
@@ -38,0 +39,0 @@ "eslint": "^8.55.0", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1097898
945
1
19