1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-06 04:00:05 +00:00

fix(*): expose CSRF token, add getFolder API

This commit is contained in:
Krishna Acondy
2021-02-10 08:19:48 +00:00
parent 1b251f1cea
commit 269514a44f
3 changed files with 26 additions and 7 deletions

View File

@@ -495,6 +495,17 @@ export class SASViyaApiClient {
}
}
/**
* Fetches a folder. Path to the folder is required.
* @param folderPath - the absolute path to the folder.
* @param accessToken - an access token for authorizing the request.
*/
public async getFolder(folderPath: string, accessToken?: string) {
return await this.requestClient
.get(`/folders/folders/@item?path=${folderPath}`, accessToken)
.then((res) => res.result)
}
/**
* Creates a folder. Path to or URI of the parent folder is required.
* @param folderName - the name of the new folder.