idmesh-api-sdk-nodejs/test.js

16 lines
485 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' });
2024-05-08 17:09:12 +08:00
console.assert(IDMeshAPI.version() === '1.4.6');
2024-03-15 14:28:51 +08:00
console.assert(resp.data.id === '100124');
console.assert(resp.data.username === 'wanghaifeng1');
};
test();