Closed rockacola closed 4 years ago
I'll be dubbed its mature release to be 0.1.0
, which should include following efforts:
planetoid-sdk-js
, planetoid-sdk-js-examples
asteroid-api-tests
into a new repo, say, asteroid-sdk-js-examples
asteroid-testing
to merge into asteroid-sdk-js-examples
asteroid-worker-neo-claim
to make the implending API changes fromasteroid-sdk-js
@lllwvlvwlll @birmas Documentations along with asteroid-sdk-js-examples
will be available in-time, as for now, here's a quick summary on my vision of the API:
The API comes in 2 flavours: class-based and functional-based.
// ES6
const AsteroidDomainUser = require('../dist').AsteroidDomainUser
const config = { networkType: 'stage' }
const adu = new AsteroidDomainUser(config)
// Noticed that the instance has no credential information at the moment
await adu.loginEmail('test@moonlight.io', 'testpassword')
// Access code and refresh code are now been stored in the instance
const res = await adu.getAttributeHeadersByTypes(['name'])
// Wait for 10 minutes so that the access code expires...
// Below will work as the instance will refresh access code automatically when needed
await adu.updatePasswordJwt('newTestPassword')
// ES6
const rpc = require('../dist').rpc
const url = 'https://stage-user.asteroid.moonlight.io/rpc'
const params = {
email: 'test@moonlight.io',
password: 'testpassword',
}
const res = await rpc.user.registerEmail(url, params)
console.log('access code:', res.access_code)
console.log('refresh code:', res.refresh_code)
This works well for me. for internal use cases, we will also need to implement the User
class since the JWT tokens are representative of a user and shared across all asteroid platforms (adu and adw).
Regarding the merging of our system testing
and the examples branches, I'm alright with this idea as long as the example are all written in a way that supports our test framework since this code is used by our CICD workflows.
All implementations are now complete in edge
branch as per https://github.com/Moonlight-io/asteroid-sdk-js/tree/c2d739ee0aa9fd3d2287d924bd92f7afb70ed89a onward.
Do you want to merge this in so we can start using this as the default architecture?
Do you want to merge this in so we can start using this as the default architecture?
Not quite yet, this will happen after preliminary tests are complete.
Per previous discussions, we will not take action regards to migrate effort of asteroid-testing
into asteroid-sdk-js-examples
edge
branch now merged into master
and released as 0.1.0
.
Examples and regression tests available on asteroid-sdk-js-examples
.
Purpose of this ticket is for open discussion on feature roadmap and vision of
edge
branch ofasteroid-sdk-js
project.Overview on intentions:
vega
anddeimos
related APIs