You are viewing a section of Superface that will be deprecated in Q4 2023. Until then, you can continue to use it as you have before but we recommend that you migrate to our latest version soon. For more details visit superface.ai/docs/migrate.

Repository Files

vcs/repository-files@1.0.0
1 provider

List Files in Directory

List files in a repository on the provided path

Input
Repository
Repository Owner
Directory Path
Reference (branch)
Page
Result
entries
Next page

1.Choose a provider

2.Use ListDirectory with mock in your code

Below instructions are for our Node.js SDK. Use OneService for other languages.
npm i @superfaceai/one-sdk

Structure details

Input (object)

repository
Repository name or identifier, e.g.: `octocat/hello-worId` (without `owner`), or `hello-worId` (if `owner` is set).
owner
Username of the account owning the repository. Optional if provided in `repository`.
path
Path to the directory for listing. Defaults to the root directory (`/`).
reference
Branch name or commit reference. Defaults to the default branch for the repository (e.g. `main` or `master`).
page
For entries pagination, use value from `nextPage`.

Example

Result (object)

entries
name
File name
path
File path
type
Whether the entry is a directory or a file
size
Empty for directories.
rawUrl
Empty for directories.
nextPage
For paginating entries. Pass to `page` parameter.

Example

Implementation details

Provider
mock
Use case
ListDirectory
Author
@superface
Source
Verified