idmesh-api-sdk-nodejs/test.js

16 lines
485 B
JavaScript

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(IDMeshAPI.version() === '1.4.6');
console.assert(resp.data.id === '100124');
console.assert(resp.data.username === 'wanghaifeng1');
};
test();