idmesh-api-sdk-nodejs/test.js

15 lines
433 B
JavaScript
Raw Normal View History

2024-03-15 14:28:51 +08:00
const { IDMeshAPI } = require('./dist/index.js');
const test = async () => {
const api = new IDMeshAPI({
authMethod: 'aksk',
basePath: 'https://idaas.idmesh.site/api',
ak: 'wo1l2qXHLVZ2r7tfa7chpUZP',
sk: 'ev1g39d3oiu41uE8taPg1zL0CcpifX15',
});
const resp = await api.user.get({ id: '100124' });
console.assert(resp.data.id === '100124');
console.assert(resp.data.username === 'wanghaifeng1');
};
test();