forked from adempiere/adempiere-vue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add grpc core client support. (adempiere#495)
* feat: Add grpc core client support. * export instances and catching error.
- Loading branch information
Edwin Betancourt
authored
May 15, 2020
1 parent
cfc03c6
commit 8727bee
Showing
30 changed files
with
191 additions
and
298 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
// Instance for connection Access (or Security) | ||
export const AccessInstance = () => { | ||
const Access = require('@adempiere/grpc-access-client') | ||
const { ACCESS_ADDRESS } = require('@/api/ADempiere/constants') | ||
const { getLanguage } = require('@/lang/index') | ||
|
||
return new Access({ | ||
host: ACCESS_ADDRESS, | ||
version: 'Version Epale', | ||
language: getLanguage() || 'en_US' | ||
}) | ||
} | ||
|
||
// Instance for connection Business Data | ||
export const BusinessDataInstance = () => { | ||
const BusinessData = require('@adempiere/grpc-data-client') | ||
const { BUSINESS_DATA_ADDRESS } = require('@/api/ADempiere/constants') | ||
const { getLanguage } = require('@/lang/index') | ||
const { getToken, getCurrentOrganization, getCurrentWarehouse } = require('@/utils/auth') | ||
|
||
return new BusinessData({ | ||
host: BUSINESS_DATA_ADDRESS, | ||
sessionUuid: getToken(), | ||
organizationUuid: getCurrentOrganization(), | ||
warehouseUuid: getCurrentWarehouse(), | ||
language: getLanguage() || 'en_US' | ||
}) | ||
} | ||
|
||
// Get Instance for connection | ||
export const DictionaryInstance = () => { | ||
const Dictionary = require('@adempiere/grpc-dictionary-client') | ||
const { DICTIONARY_ADDRESS } = require('@/api/ADempiere/constants') | ||
const { getLanguage } = require('@/lang/index') | ||
const { getToken } = require('@/utils/auth') | ||
|
||
return new Dictionary( | ||
DICTIONARY_ADDRESS, | ||
getToken(), | ||
getLanguage() || 'en_US' | ||
) | ||
} | ||
|
||
// Instance for connection Enrollment | ||
export const EnrollmentInstance = () => { | ||
const Enrollment = require('@adempiere/grpc-enrollment-client') | ||
const { ENROLLMENT_ADDRESS } = require('@/api/ADempiere/constants') | ||
|
||
return new Enrollment( | ||
ENROLLMENT_ADDRESS, | ||
3.9, | ||
'ADempiere-Vue' | ||
) | ||
} | ||
|
||
export const POSInstance = () => { | ||
const POS = require('@adempiere/grpc-pos-client') | ||
const { BUSINESS_DATA_ADDRESS } = require('@/api/ADempiere/constants') | ||
const { getLanguage } = require('@/lang/index') | ||
const { getToken, getCurrentOrganization, getCurrentWarehouse } = require('@/utils/auth') | ||
|
||
return new POS({ | ||
host: BUSINESS_DATA_ADDRESS, | ||
sessionUuid: getToken(), | ||
organizationUuid: getCurrentOrganization(), | ||
warehouseUuid: getCurrentWarehouse(), | ||
language: getLanguage() || 'en_US' | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.