mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-07 12:30:06 +00:00
docs: fyxed typos and updated docs
This commit is contained in:
64
src/SASjs.ts
64
src/SASjs.ts
@@ -193,7 +193,7 @@ export default class SASjs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a folder at SAS file system
|
||||
* Creates a folder at SAS file system.
|
||||
* @param folderName - name of the folder to be created.
|
||||
* @param parentFolderPath - the full path (eg `/Public/example/myFolder`) of the parent folder.
|
||||
* @param parentFolderUri - the URI of the parent folder.
|
||||
@@ -311,7 +311,7 @@ export default class SASjs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the _csrf token of the current session for the API approach
|
||||
* Returns the _csrf token of the current session for the API approach.
|
||||
*
|
||||
*/
|
||||
public getCsrfApi() {
|
||||
@@ -328,7 +328,7 @@ export default class SASjs {
|
||||
|
||||
/**
|
||||
* Sets the SASjs configuration.
|
||||
* @param config - SASjsConfig indicating SASjs Configuration
|
||||
* @param config - SASjs configuration.
|
||||
*/
|
||||
public async setSASjsConfig(config: SASjsConfig) {
|
||||
this.sasjsConfig = {
|
||||
@@ -339,17 +339,16 @@ export default class SASjs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the debug state. Turning this on will enable additional logging to
|
||||
* be returned to the adapter.
|
||||
* @param value - Boolean indicating debug state
|
||||
* Sets the debug state. Turning this on will enable additional logging in the adapter.
|
||||
* @param value - boolean indicating debug state (on/off).
|
||||
*/
|
||||
public setDebugState(value: boolean) {
|
||||
this.sasjsConfig.debug = value
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks whether a session is active, or login is required
|
||||
* @returns a promise which resolves with an object containing two values - a boolean `isLoggedIn`, and a string `userName`
|
||||
* Checks whether a session is active, or login is required.
|
||||
* @returns - a promise which resolves with an object containing two values - a boolean `isLoggedIn`, and a string `userName`.
|
||||
*/
|
||||
public async checkSession() {
|
||||
const loginResponse = await fetch(this.loginUrl.replace('.do', ''))
|
||||
@@ -363,9 +362,9 @@ export default class SASjs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs into the SAS server with the supplied credentials
|
||||
* @param username - a string representing the username
|
||||
* @param password - a string representing the password
|
||||
* Logs into the SAS server with the supplied credentials.
|
||||
* @param username - a string representing the username.
|
||||
* @param password - a string representing the password.
|
||||
*/
|
||||
public async logIn(username: string, password: string) {
|
||||
const loginParams: any = {
|
||||
@@ -434,7 +433,7 @@ export default class SASjs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Logs out of the configured SAS server
|
||||
* Logs out of the configured SAS server.
|
||||
*/
|
||||
public logOut() {
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -448,12 +447,12 @@ export default class SASjs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Uploads a file to the given service
|
||||
* @param sasJob - The path to the SAS program (ultimately resolves to
|
||||
* Uploads a file to the given service.
|
||||
* @param sasJob - the path to the SAS program (ultimately resolves to
|
||||
* the SAS `_program` parameter to run a Job Definition or SAS 9 Stored
|
||||
* Process.) Is prepended at runtime with the value of `appLoc`.
|
||||
* @param file - Array of files to be uploaded, including File object and file name.
|
||||
* @param params - Request URL paramaters
|
||||
* Process). Is prepended at runtime with the value of `appLoc`.
|
||||
* @param files - array of files to be uploaded, including File object and file name.
|
||||
* @param params - request URL parameters.
|
||||
*/
|
||||
public uploadFile(sasJob: string, files: UploadFile[], params: any) {
|
||||
const fileUploader =
|
||||
@@ -470,21 +469,21 @@ export default class SASjs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Makes a request to the SAS Service specified in `SASjob`. The response
|
||||
* Makes a request to the SAS Service specified in `SASjob`. The response
|
||||
* object will always contain table names in lowercase, and column names in
|
||||
* uppercase. Values are returned formatted by default, unformatted
|
||||
* uppercase. Values are returned formatted by default, unformatted
|
||||
* values can be configured as an option in the `%webout` macro.
|
||||
*
|
||||
* @param sasJob - The path to the SAS program (ultimately resolves to
|
||||
* @param sasJob - the path to the SAS program (ultimately resolves to
|
||||
* the SAS `_program` parameter to run a Job Definition or SAS 9 Stored
|
||||
* Process.) Is prepended at runtime with the value of `appLoc`.
|
||||
* @param data - A JSON object containing one or more tables to be sent to
|
||||
* SAS. Can be `null` if no inputs required.
|
||||
* @param config - Provide any changes to the config here, for instance to
|
||||
* enable / disable `debug`. Any change provided will override the global config,
|
||||
* Process). Is prepended at runtime with the value of `appLoc`.
|
||||
* @param data - a JSON object containing one or more tables to be sent to
|
||||
* SAS. Can be `null` if no inputs required.
|
||||
* @param config - provide any changes to the config here, for instance to
|
||||
* enable/disable `debug`. Any change provided will override the global config,
|
||||
* for that particular function call.
|
||||
* @param loginRequiredCallback - provide a function here to be called if the
|
||||
* user is not logged in (eg to display a login form). The request will be
|
||||
* user is not logged in (eg to display a login form). The request will be
|
||||
* resubmitted after logon.
|
||||
*/
|
||||
public async request(
|
||||
@@ -538,8 +537,7 @@ export default class SASjs {
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the folders and services in the provided JSON on the given location
|
||||
* (appLoc) on the given server (serverUrl).
|
||||
* Creates the folders and services at the given location `appLoc` on the given server `serverUrl`.
|
||||
* @param serviceJson - the JSON specifying the folders and services to be created.
|
||||
* @param appLoc - the base folder in which to create the new folders and
|
||||
* services. If not provided, is taken from SASjsConfig.
|
||||
@@ -670,7 +668,7 @@ export default class SASjs {
|
||||
resolve(retryResponse)
|
||||
} else {
|
||||
this.retryCountComputeApi = 0
|
||||
reject({ MESSAGE: 'Compute API retry requests limit reached.' }) // FIXME: use ErrorResponse
|
||||
reject({ MESSAGE: 'Compute API retry requests limit reached.' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -681,7 +679,7 @@ export default class SASjs {
|
||||
sasjsWaitingRequest.config = config
|
||||
this.sasjsWaitingRequests.push(sasjsWaitingRequest)
|
||||
} else {
|
||||
reject({ MESSAGE: error || 'Job execution failed.' }) // FIXME: use ErrorResponse
|
||||
reject({ MESSAGE: error || 'Job execution failed.' })
|
||||
}
|
||||
|
||||
this.appendSasjsRequest(response.log, sasJob, null)
|
||||
@@ -763,11 +761,11 @@ export default class SASjs {
|
||||
resolve(retryResponse)
|
||||
} else {
|
||||
this.retryCountJeseApi = 0
|
||||
reject({ MESSAGE: 'JES API retry requests limit reached' }) // FIXME: use ErrorResponse
|
||||
reject({ MESSAGE: 'JES API retry requests limit reached' })
|
||||
}
|
||||
}
|
||||
|
||||
reject({ MESSAGE: (e && e.message) || 'Job execution failed.' }) // FIXME: use ErrorResponse
|
||||
reject({ MESSAGE: (e && e.message) || 'Job execution failed.' })
|
||||
})
|
||||
)
|
||||
}
|
||||
@@ -1058,7 +1056,7 @@ export default class SASjs {
|
||||
resolve(resText)
|
||||
})
|
||||
} else {
|
||||
reject('No debug info found in response.') // FIXME: use ErrorResponse
|
||||
reject('No debug info found in response.')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user