List files in a repository on the provided path
npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');
// You can manage tokens here: https://superface.ai/insights
const sdk = new SuperfaceClient({ sdkAuthToken: '<< Login to get your token >>' });
async function run() {
// Load the profile
const profile = await sdk.getProfile('vcs/repository-files@1.0.0');
// Use the profile
const result = await profile
.getUseCase('ListDirectory')
.perform({
repository: '',
owner: '',
path: '',
reference: '',
page: ''
}, {
provider: 'mock'
});
// Handle the result
try {
const data = result.unwrap();
console.log(data);
} catch (error) {
console.error(error);
}
}
run();
{
"repository": "",
"owner": "",
"path": "",
"reference": "",
"page": ""
}
{
"entries": [
{
"name": "",
"path": "",
"type": "file",
"size": 42,
"rawUrl": ""
}
],
"nextPage": ""
}