tfk-360-unwrap-contact
Module for unwrapping a contact from Public360's GetPrivatePersonsResult
Installation
From npm
$ npm install tfk-360-unwrap-contact
From GitHub
$ git clone git@github.com:telemark/tfk-360-unwrap-contact.git
cd into directory and run setup
$ npm run setup
Usage
Pass a result from GetPrivatePersonsResult
'use strict'
var unwrapContact = require('tfk-360-unwrap-contact')
var result = {
GetPrivatePersonsResult: {
Successful: true,
PrivatePersons: {
PrivatePersonBase: [
{
Email: 'xxx',
FirstName: 'xxx',
LastName: 'xxx',
PersonalIdNumber: 'xxx',
PhoneNumber: 'xxx',
PrivateAddress: {
Area: '',
Country: 'NOR',
County: '',
State: '',
StreetAddress: '<HEMMELIG ADRESSE>',
ZipCode: '',
ZipPlace: ''
}
}
]
}
}
}
}
var contact = unwrapContact(result)
console.log(contact)
returns
{
Email: 'xxx',
FirstName: 'xxx',
LastName: 'xxx',
PersonalIdNumber: 'xxx',
PhoneNumber: 'xxx',
PrivateAddress: {
Area: '',
Country: 'NOR',
County: '',
State: '',
StreetAddress: '<HEMMELIG ADRESSE>',
ZipCode: '',
ZipPlace: ''
}
}
##License
MIT