@agm-as/bridge
v3.5.1
Published
agm services bridge
Downloads
133
Readme
@agm-as/bridge
provides easy access to agm-services
and their data.
npm install @agm-as/bridge
Publishing
Update the version
in package.json
according to the best practices of semantic versioning, and commit (the version change) as :bookmark: Update bridge version
, then run npm publish
to realise the changes.
Notes
organization
is a filtering object that takes eitherfirebaseId
,titleId
,environmentId
,hostname
, ortitleCode
.user
is a filtering object that takes eitheremailAddress
,customerId
, orcustomerNumber
.lilypadsOptions
is an object sent to thelilypads
npm module.
Methods
orgs
import * as orgs from '@agm-as/bridge/orgs';
orgs.getOrganizations({hostname: 'varden.no'})
.then(console.log);
getOrganizations
(organization, lilypadsOptions)
import getOrganizations from '@agm-as/bridge/orgs';
getOrganizations().then((organizations) => console.log(organizations));
users
import * as users from '@agm-as/bridge/users';
users.getUserConstellation({emailAddress: '[email protected]'})
.then(console.log);
authenticateUser
(username, password, organization)
import authenticateUser from '@agm-as/bridge/users/authenticate';
// or import {authenticateUser} from '@agm-as/bridge/users';
authenticateUser('[email protected]', 'DemoUser5678', {titleId: 1})
.then((result) => console.log(result));
logoutUser
(token)
import logoutUser from '@agm-as/bridge/users/logout';
// or import {logoutUser} from '@agm-as/bridge/users';
logoutUser(token)
.then(() => console.log('logged out'));
validateUserAccess
(token, organization, requestOptions)
requestOptions
requestOptions.url
(string)
: resource urlrequestOptions.cxenseUserId
(string)
: cxense user idrequestOptions.ipAddress
(string)
: client ip addressrequestOptions.referrer
(string)
: client referrer
import validateUserAccess from '@agm-as/bridge/users/validate-access';
// or import {validateUserAccess} from '@agm-as/bridge/users';
validateUserAccess(token, {titleId: 1}, {url: 'https://agderposten.no'})
.then((result) => console.log(result));
getUserConstellation
(user, organization, requestOptions, lilypadsOptions)
requestOptions
requestOptions.token
(string)
: user authentication token
import getUserConstellation from '@agm-as/bridge/users/constellation';
// or import {getUserConstellation} from '@agm-as/bridge/users';
getUserConstellation({customerId: '920538'})
.then((constellation) => console.log(constellation));
news
import * as news from '@agm-as/bridge/news';
news.getNews({url: 'https://www.agderposten.no/trafikk/oppdaget-feil-pa-23-km-midtdeler-pa-e18'})
.then(console.log);
getNews
(news, lilypadsOptions)
import getNews from '@agm-as/bridge/news';
getNews({url: 'https://www.agderposten.no/trafikk/oppdaget-feil-pa-23-km-midtdeler-pa-e18'})
.then((news) => console.log(news));