0.3.1 • Published 15 days ago

@ulms/profile v0.3.1

Weekly downloads
224
License
MIT
Repository
github
Last release
15 days ago

ProfileJS

JavaScript API-client for Profile service

Installation

npm install --save @ulms/profile

Example

import {
  FetchHttpClient,
  SimpleTokenProvider,
  HttpProfileResource
} from '@ulms/profile'

const TOKEN = 'jwt-token'
const id = '123'
const ids = ['123', '456', '789']
const scope = '456'

const profile = new HttpProfileResource(
  'https://example.com',
  'api/v1/profile',
  new FetchHttpClient(),
  new SimpleTokenProvider(TOKEN)
)

// retrieving profile data
profile.getProfile(id, scope)
  .then((response) => {
    console.log('[response]', response)
  })
  .catch((error) => {
    console.log('[error]', error)
  })

// retrieving list of profiles
profile.listProfiles(ids, scope)
  .then((response) => {
    console.log('[response]', response)
  })
  .catch((error) => {
    console.log('[error]', error)
  })
  
// updating some attributes
profile.updateAttributes(id, scope, {role: 'user'})
  .then((response) => {
    console.log('[response]', response)
  })
  .catch((error) => {
    console.log('[error]', error)
  })
0.3.1-dev.1

15 days ago

0.3.1-dev.0

2 years ago

0.3.1

2 years ago

0.3.0

3 years ago

0.3.0-dev.0

3 years ago

0.3.0-dev.1

3 years ago

0.2.1

5 years ago

0.2.0

5 years ago

0.2.0-alpha.1

5 years ago

0.2.0-alpha.0

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.1-alpha.2

5 years ago

0.1.1-alpha.1

5 years ago

0.1.0-alpha.1

5 years ago

0.1.0

5 years ago