Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Arhia API client.
Arhia library provides a few classes which embeds their enumerates.
These classes are not usable as it, only theirs enumerates are.
> var Arhia = require('arhia');
> Arhia.Employee.Gender
{ MAN: 1, WOMAN: 2 }
Arhia class has to be instantiated to be used.
The instance will enclose the connexion parameters and provide a set of classes usable which are children of the original ones including all original enumerates.
> var employee = new arhia.Employee()
undefined
> employee instanceof arhia.Employee
true
> employee instanceof Arhia.Employee
true
> arhia.Employee === Arhia.Employee
true
> arhia.Employee.Gender
{ MAN: 1, WOMAN: 2 }
> Arhia.Employee.Gender
{ MAN: 1, WOMAN: 2 }
> Arhia.Employee.Gender === arhia.Employee.Gender
true
All the code samples below deals with instance of arhia.
This client provides a standardized set of property which is different of the official Arhia one.
To help while integration, each class instance provide the fields
function, a helper to retrieve this mapping.
fields([pattern], [invert])
> var em = new arhia.Employee();
undefined
> em.fields()
id => sal_id
fake => sal_simul
firstname => sal_prenom
lastname => sal_nom_famille
...
var Arhia = require('arhia');
var arhia = new Arhia({
uri: 'http://api.url',
dospayId: 0,
versionAPI: 1,
// your credentials: either username/password or token
username: '', password: '',
token: ''
});
arhia
instance provides a few models which consumes Arhia API.
Each Model embeds some static functions which are usable directly from the models and some methods wich are usable from the instances of the models. Both statics and methods handle promises and callback patterns.
Employee bank account
bic
default
- Either or not this bank account is the default to use for the employeedomiciliation
iban
owner
addressCCpl
-addressCountryISOCode
-addressCpl
-address
-banks
- Arhia.BankAccountbirthCountryISOCode
-birthDate
-birthPlace
-city
-externalId
- Employee id in your applicationfake
- Either or not the employee is a simulated onefirstname
-gender
- Arhia.Employee.Gender - Man or Woman (1 / 2)id
- Arhia index set when saved (would not be manually set)lastname
-maidenName
-nationalityISOCode
-nir
-observation
-paymentMode
- Employee.PaymentModepostalCode
-registrationNumber
-MAN
- 1WOMAN
- 1CHEQUE
- 'CHQ'TRANSFER
- 'VIR'CASH
- 'ESP'Static function to retrieve an employee from the Arhia platform.
arhia.Employee
.findById('507e1f77bcf86cd699439011')
.then(function (employee) {
console.log(employee ? employee.name : '!Unknown user');
})
.catch(function (reason) {
console.log(reason);
});
Function to save a new employee on the Arhia platform.
var em = new arhia.Employee();
// ...
em
.create()
.then(function (result) {
console.log(result);
})
.catch(function (reason) {
console.log(reason);
});
Function to update an existing employee on the Arhia platform
FAQs
Arhia object modeling
The npm package arhia receives a total of 1 weekly downloads. As such, arhia popularity was classified as not popular.
We found that arhia demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.