mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-08 13:00:05 +00:00
fix(*): expose CSRF token, add getFolder API
This commit is contained in:
14
src/SASjs.ts
14
src/SASjs.ts
@@ -50,6 +50,10 @@ export default class SASjs {
|
||||
this.setupConfiguration()
|
||||
}
|
||||
|
||||
public getCsrfToken(type: 'general' | 'file' = 'general') {
|
||||
return this.requestClient?.getCsrfToken(type)
|
||||
}
|
||||
|
||||
public async executeScriptSAS9(
|
||||
linesOfCode: string[],
|
||||
serverName: string,
|
||||
@@ -292,6 +296,16 @@ export default class SASjs {
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetches a folder from the SAS file system.
|
||||
* @param folderPath - path of the folder to be fetched.
|
||||
* @param accessToken - the access token to authorize the request.
|
||||
*/
|
||||
public async getFolder(folderPath: string, accessToken?: string) {
|
||||
this.isMethodSupported('getFolder', ServerType.SasViya)
|
||||
return await this.sasViyaApiClient!.getFolder(folderPath, accessToken)
|
||||
}
|
||||
|
||||
/**
|
||||
* For performance (and in case of accidental error) the `deleteFolder` function does not actually delete the folder (and all its content and subfolder content). Instead the folder is simply moved to the recycle bin. Deletion time will be added to the folder name.
|
||||
* @param folderPath - the full path (eg `/Public/example/deleteThis`) of the folder to be deleted.
|
||||
|
||||
Reference in New Issue
Block a user