From cd00c483c51b88f5ff69754dd343c050473b4619 Mon Sep 17 00:00:00 2001 From: Mihajlo Medjedovic Date: Thu, 22 Sep 2022 01:16:10 +0200 Subject: [PATCH] chore: docs --- .../SAS9ApiClient.SAS9ApiClient-1.html | 6 +- .../SASViyaApiClient.SASViyaApiClient-1.html | 58 +++++++-------- docs/classes/SASjs.SASjs-1.html | 70 +++++++++---------- .../SASjsApiClient.SASjsApiClient-1.html | 6 +- docs/classes/types.SASjsConfig.html | 24 +++---- docs/enums/types.LoginMechanism.html | 2 +- .../SASjsApiClient.SASjsAuthResponse.html | 2 +- docs/interfaces/types.Context.html | 2 +- .../types.ContextAllAttributes.html | 2 +- docs/interfaces/types.CsrfToken.html | 2 +- docs/interfaces/types.EditContextInput.html | 2 +- docs/interfaces/types.ExecutionQuery.html | 2 +- docs/interfaces/types.File.html | 2 +- docs/interfaces/types.Folder.html | 2 +- docs/interfaces/types.Job.html | 2 +- docs/interfaces/types.JobDefinition.html | 2 +- docs/interfaces/types.JobResult.html | 2 +- docs/interfaces/types.Link.html | 2 +- docs/interfaces/types.PollOptions.html | 2 +- docs/interfaces/types.SASjsRequest.html | 2 +- docs/interfaces/types.Session.html | 2 +- docs/interfaces/types.SessionVariable.html | 2 +- docs/interfaces/types.UploadFile.html | 2 +- docs/interfaces/types.WriteStream.html | 2 +- 24 files changed, 101 insertions(+), 101 deletions(-) diff --git a/docs/classes/SAS9ApiClient.SAS9ApiClient-1.html b/docs/classes/SAS9ApiClient.SAS9ApiClient-1.html index a56cc74..cb0fcbf 100644 --- a/docs/classes/SAS9ApiClient.SAS9ApiClient-1.html +++ b/docs/classes/SAS9ApiClient.SAS9ApiClient-1.html @@ -1,6 +1,6 @@ SAS9ApiClient | @sasjs/adapter
Options
All
  • Public
  • Public/Protected
  • All
Menu

A client for interfacing with the SAS9 REST API.

-

Hierarchy

  • SAS9ApiClient

Index

Constructors

  • new SAS9ApiClient(serverUrl: string, jobsPath: string, httpsAgentOptions?: AgentOptions): SAS9ApiClient

Methods

  • executeScript(linesOfCode: string[], userName: string, password: string): Promise<string>

Hierarchy

  • SAS9ApiClient

Index

Constructors

  • new SAS9ApiClient(serverUrl: string, jobsPath: string, httpsAgentOptions?: AgentOptions): SAS9ApiClient

Methods

  • executeScript(linesOfCode: string[], userName: string, password: string): Promise<string>
  • Executes code on a SAS9 server.

    Parameters

    • linesOfCode: string[]

      an array of code lines to execute.

      @@ -8,9 +8,9 @@

      the user name to log into the current SAS server.

    • password: string

      the password to log into the current SAS server.

      -

    Returns Promise<string>

  • getConfig(): { serverUrl: string }

Returns Promise<string>

  • getConfig(): { serverUrl: string }
  • Returns an object containing server URL.

    -

    Returns { serverUrl: string }

    • serverUrl: string
  • setConfig(serverUrl: string): void
  • setConfig(serverUrl: string): void
  • createComputeContext(contextName: string, launchContextName: string, sharedAccountId: string, autoExecLines: string[], accessToken?: string, authorizedUsers?: string[]): Promise<Context>
  • Creates a compute context on the given server.

    Parameters

    • contextName: string

      the name of the context to be created.

      @@ -22,7 +22,7 @@

      an access token for an authorized user.

    • Optional authorizedUsers: string[]

      an optional list of authorized user IDs.

      -

    Returns Promise<Context>

  • createFile(fileName: string, contentBuffer: Buffer, parentFolderPath?: string, parentFolderUri?: string, accessToken?: string): Promise<File>

Returns Promise<Context>

  • createFile(fileName: string, contentBuffer: Buffer, parentFolderPath?: string, parentFolderUri?: string, accessToken?: string): Promise<File>
  • Creates a file. Path to or URI of the parent folder is required.

    Parameters

    • fileName: string

      the name of the new file.

      @@ -36,7 +36,7 @@ folder. If not provided, the parentFolderPath must be provided.

    • Optional accessToken: string

      an access token for authorizing the request.

      -

    Returns Promise<File>

  • createFolder(folderName: string, parentFolderPath?: string, parentFolderUri?: string, accessToken?: string, isForced?: boolean): Promise<Folder>

Returns Promise<File>

  • createFolder(folderName: string, parentFolderPath?: string, parentFolderUri?: string, accessToken?: string, isForced?: boolean): Promise<Folder>
  • Creates a folder. Path to or URI of the parent folder is required.

    Parameters

    • folderName: string

      the name of the new folder.

      @@ -50,7 +50,7 @@

      an access token for authorizing the request.

    • Optional isForced: boolean

      flag that indicates if target folder already exists, it and all subfolders have to be deleted.

      -

    Returns Promise<Folder>

  • createJobDefinition(jobName: string, code: string, parentFolderPath?: string, parentFolderUri?: string, accessToken?: string): Promise<{ etag: string; result: Job }>

Returns Promise<Folder>

  • createJobDefinition(jobName: string, code: string, parentFolderPath?: string, parentFolderUri?: string, accessToken?: string): Promise<{ etag: string; result: Job }>
  • Creates a Job in the specified folder (or folder uri).

    Parameters

    • jobName: string

      the name of the new job to be created.

      @@ -61,7 +61,7 @@
    • Optional parentFolderUri: string

      the URI location of the new job. The function is a little faster if the folder URI is supplied instead of the path.

      -
    • Optional accessToken: string

    Returns Promise<{ etag: string; result: Job }>

  • createLauncherContext(contextName: string, description: string, launchType?: string, accessToken?: string): Promise<Context>

Returns Promise<{ etag: string; result: Job }>

  • createLauncherContext(contextName: string, description: string, launchType?: string, accessToken?: string): Promise<Context>
  • Creates a launcher context on the given server.

    Parameters

    • contextName: string

      the name of the context to be created.

      @@ -71,31 +71,31 @@ little faster if the folder URI is supplied instead of the path.

      launch type of the context to be created.

    • Optional accessToken: string

      an access token for an authorized user.

      -

    Returns Promise<Context>

  • createSession(contextName: string, accessToken?: string): Promise<Session>

Returns Promise<Context>

  • createSession(contextName: string, accessToken?: string): Promise<Session>
  • Creates a session on the given context.

    Parameters

    • contextName: string

      the name of the context to create a session on.

    • Optional accessToken: string

      an access token for an authorized user.

      -

    Returns Promise<Session>

  • deleteClient(clientId: string, accessToken?: string): Promise<unknown>

Returns Promise<Session>

  • deleteClient(clientId: string, accessToken?: string): Promise<unknown>
  • Deletes the client representing the supplied ID.

    Parameters

    • clientId: string

      the client ID to authenticate with.

    • Optional accessToken: string

      an access token for authorizing the request.

      -

    Returns Promise<unknown>

  • deleteComputeContext(contextName: string, accessToken?: string): Promise<{ etag: string; result: Context }>

Returns Promise<unknown>

  • deleteComputeContext(contextName: string, accessToken?: string): Promise<{ etag: string; result: Context }>
  • Deletes a compute context on the given server.

    Parameters

    • contextName: string

      the name of the context to be deleted.

    • Optional accessToken: string

      an access token for an authorized user.

      -

    Returns Promise<{ etag: string; result: Context }>

  • deleteFolder(folderPath: string, accessToken: string): Promise<undefined | Folder>

Returns Promise<{ etag: string; result: Context }>

  • deleteFolder(folderPath: string, accessToken: string): Promise<undefined | Folder>
  • 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.

    Parameters

    • folderPath: string

      the full path (eg /Public/example/deleteThis) of the folder to be deleted.

    • accessToken: string

      an access token for authorizing the request.

      -

    Returns Promise<undefined | Folder>

  • editComputeContext(contextName: string, editedContext: EditContextInput, accessToken?: string): Promise<{ etag: string; result: Context }>

Returns Promise<undefined | Folder>

  • editComputeContext(contextName: string, editedContext: EditContextInput, accessToken?: string): Promise<{ etag: string; result: Context }>
  • Updates a compute context on the given server.

    Parameters

    • contextName: string

      the original name of the context to be updated.

      @@ -103,7 +103,7 @@ little faster if the folder URI is supplied instead of the path.

      an object with the properties to be updated.

    • Optional accessToken: string

      an access token for an authorized user.

      -

    Returns Promise<{ etag: string; result: Context }>

  • executeComputeJob(sasJob: string, contextName: string, debug?: boolean, data?: any, authConfig?: AuthConfig, waitForResult?: boolean, expectWebout?: boolean, pollOptions?: PollOptions, printPid?: boolean, variables?: MacroVar): Promise<any>

Returns Promise<{ etag: string; result: Context }>

  • executeComputeJob(sasJob: string, contextName: string, debug?: boolean, data?: any, authConfig?: AuthConfig, waitForResult?: boolean, expectWebout?: boolean, pollOptions?: PollOptions, printPid?: boolean, variables?: MacroVar): Promise<any>
  • Executes a job via the SAS Viya Compute API.

    Parameters

    • sasJob: string

      the relative path to the job.

      @@ -123,7 +123,7 @@ little faster if the folder URI is supplied instead of the path.

      a boolean that indicates whether the function should print (PID) of the started job.

    • Optional variables: MacroVar

      an object that represents macro variables.

      -

    Returns Promise<any>

  • executeJob(sasJob: string, contextName: string, debug: boolean, data?: any, authConfig?: AuthConfig): Promise<{ log: any; result: any }>

Returns Promise<any>

  • executeJob(sasJob: string, contextName: string, debug: boolean, data?: any, authConfig?: AuthConfig): Promise<{ log: any; result: any }>
  • Executes a job via the SAS Viya Job Execution API

    Parameters

    • sasJob: string

      the relative or absolute path to the job.

      @@ -133,7 +133,7 @@ little faster if the folder URI is supplied instead of the path.

      sets the _debug flag in the job arguments.

    • Optional data: any

      any data to be passed in as input to the job.

      -
    • Optional authConfig: AuthConfig

    Returns Promise<{ log: any; result: any }>

  • executeScript(jobPath: string, linesOfCode: string[], contextName: string, authConfig?: AuthConfig, data?: null, debug?: boolean, expectWebout?: boolean, waitForResult?: boolean, pollOptions?: PollOptions, printPid?: boolean, variables?: MacroVar): Promise<any>

Returns Promise<{ log: any; result: any }>

  • executeScript(jobPath: string, linesOfCode: string[], contextName: string, authConfig?: AuthConfig, data?: null, debug?: boolean, expectWebout?: boolean, waitForResult?: boolean, pollOptions?: PollOptions, printPid?: boolean, variables?: MacroVar): Promise<any>
  • Executes code on the current SAS Viya server.

    Parameters

    • jobPath: string

      the path to the file being submitted for execution.

      @@ -157,7 +157,7 @@ little faster if the folder URI is supplied instead of the path.

      a boolean that indicates whether the function should print (PID) of the started job.

    • Optional variables: MacroVar

      an object that represents macro variables.

      -

    Returns Promise<any>

  • getAccessToken(clientId: string, clientSecret: string, authCode: string): Promise<SasAuthResponse>

Returns Promise<any>

  • getAccessToken(clientId: string, clientSecret: string, authCode: string): Promise<SasAuthResponse>
  • Exchanges the auth code for an access token for the given client.

    Parameters

    • clientId: string

      the client ID to authenticate with.

      @@ -165,54 +165,54 @@ little faster if the folder URI is supplied instead of the path.

      the client secret to authenticate with.

    • authCode: string

      the auth code received from the server.

      -

    Returns Promise<SasAuthResponse>

  • getAuthCode(clientId: string): Promise<null | string>

Returns Promise<SasAuthResponse>

  • getAuthCode(clientId: string): Promise<null | string>
  • Performs a login redirect and returns an auth code for the given client.

    Parameters

    • clientId: string

      the client ID to authenticate with.

      -

    Returns Promise<null | string>

Returns Promise<null | string>

  • Returns a JSON representation of a compute context.

    Parameters

    • contextId: string

      an id of the context to return.

    • Optional accessToken: string

      an access token for an authorized user.

      -

    Returns Promise<ContextAllAttributes>

  • getComputeContextByName(contextName: string, accessToken?: string): Promise<Context>

Returns Promise<ContextAllAttributes>

  • getComputeContextByName(contextName: string, accessToken?: string): Promise<Context>
  • Returns a JSON representation of a compute context.

    example:

    { "createdBy": "admin", "links": [...], "id": "ID", "version": 2, "name": "context1" }

    Parameters

    • contextName: string

      the name of the context to return.

    • Optional accessToken: string

      an access token for an authorized user.

      -

    Returns Promise<Context>

  • getComputeContexts(accessToken?: string): Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

Returns Promise<Context>

  • getComputeContexts(accessToken?: string): Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>
  • Returns all available compute contexts on this server.

    Parameters

    • Optional accessToken: string

      an access token for an authorized user.

      -

    Returns Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

  • getConfig(): { rootFolderName: string; serverUrl: string }

Returns Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

  • getConfig(): { rootFolderName: string; serverUrl: string }
  • Returns an object containing the server URL and root folder name.

    -

    Returns { rootFolderName: string; serverUrl: string }

    • rootFolderName: string
    • serverUrl: string
  • getDefaultComputeContexts(): string[]
  • +

    Returns { rootFolderName: string; serverUrl: string }

    • rootFolderName: string
    • serverUrl: string
  • getDefaultComputeContexts(): string[]
  • getExecutableContexts(authConfig?: AuthConfig): Promise<any[]>
  • getExecutableContexts(authConfig?: AuthConfig): Promise<any[]>
  • Returns all compute contexts on this server that the user has access to.

    Parameters

    • Optional authConfig: AuthConfig

      an access token, refresh token, client and secret for an authorized user.

      -

    Returns Promise<any[]>

  • getFolder(folderPath: string, accessToken?: string): Promise<unknown>

Returns Promise<any[]>

  • getFolder(folderPath: string, accessToken?: string): Promise<unknown>
  • Fetches a folder. Path to the folder is required.

    Parameters

    • folderPath: string

      the absolute path to the folder.

    • Optional accessToken: string

      an access token for authorizing the request.

      -

    Returns Promise<unknown>

  • getJobsInFolder(folderPath: string): Promise<undefined | Job[]>

Returns Promise<unknown>

  • getJobsInFolder(folderPath: string): Promise<undefined | Job[]>
  • Returns a list of jobs in the currently set root folder.

    -

    Parameters

    • folderPath: string

    Returns Promise<undefined | Job[]>

  • getLauncherContexts(accessToken?: string): Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>
  • getLauncherContexts(accessToken?: string): Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>
  • Returns all available launcher contexts on this server.

    Parameters

    • Optional accessToken: string

      an access token for an authorized user.

      -

    Returns Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

  • listFolder(sourceFolder: string, accessToken?: string, limit?: number): Promise<any[]>

Returns Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

  • listFolder(sourceFolder: string, accessToken?: string, limit?: number): Promise<any[]>
  • Lists children folders for given Viya folder.

    Parameters

    • sourceFolder: string

      the full path (eg /Public/example/myFolder) or URI of the source folder listed. Providing URI instead of path will save one extra request.

    • Optional accessToken: string

      an access token for authorizing the request.

      -
    • limit: number = 20

    Returns Promise<any[]>

  • moveFolder(sourceFolder: string, targetParentFolder: string, targetFolderName: string, accessToken: string): Promise<undefined | Folder>

Returns Promise<any[]>

  • moveFolder(sourceFolder: string, targetParentFolder: string, targetFolderName: string, accessToken: string): Promise<undefined | Folder>
  • Moves Viya folder to a new location. The folder may be renamed at the same time.

    Parameters

    • sourceFolder: string

      the full path (eg /Public/example/myFolder) or URI of the source folder to be moved. Providing URI instead of path will save one extra request.

      @@ -222,7 +222,7 @@ little faster if the folder URI is supplied instead of the path.

      the name of the "moved" folder. If left blank, the original folder name will be used (eg myFolder in /Public/newDestination/myFolder for the example above). Optional field.

    • accessToken: string

      an access token for authorizing the request.

      -

    Returns Promise<undefined | Folder>

  • refreshTokens(clientId: string, clientSecret: string, refreshToken: string): Promise<SasAuthResponse>

Returns Promise<undefined | Folder>

  • refreshTokens(clientId: string, clientSecret: string, refreshToken: string): Promise<SasAuthResponse>
  • Exchanges the refresh token for an access token for the given client.

    Parameters

    • clientId: string

      the client ID to authenticate with.

      @@ -230,7 +230,7 @@ little faster if the folder URI is supplied instead of the path.

      the client secret to authenticate with.

    • refreshToken: string

      the refresh token received from the server.

      -

    Returns Promise<SasAuthResponse>

  • setConfig(serverUrl: string, rootFolderName: string): void

Returns Promise<SasAuthResponse>

  • setConfig(serverUrl: string, rootFolderName: string): void
  • createFile(fileName: string, content: Buffer, parentFolderPath: string, parentFolderUri?: string, accessToken?: string, sasApiClient?: SASViyaApiClient): Promise<File>
  • Creates a file in the logical SAS folder tree

    Parameters

    • fileName: string

      name of the file to be created.

      @@ -33,7 +33,7 @@

      the access token to authorizing the request.

    • Optional sasApiClient: SASViyaApiClient

      a client for interfacing with SAS API.

      -

    Returns Promise<File>

  • createFolder(folderName: string, parentFolderPath: string, parentFolderUri?: string, accessToken?: string, sasApiClient?: SASViyaApiClient, isForced?: boolean): Promise<Folder>

Returns Promise<File>

  • createFolder(folderName: string, parentFolderPath: string, parentFolderUri?: string, accessToken?: string, sasApiClient?: SASViyaApiClient, isForced?: boolean): Promise<Folder>
  • Creates a folder in the logical SAS folder tree

    Parameters

    • folderName: string

      name of the folder to be created.

      @@ -47,7 +47,7 @@

      a client for interfacing with SAS API.

    • Optional isForced: boolean

      flag that indicates if target folder already exists, it and all subfolders have to be deleted. Applicable for SAS VIYA only.

      -

    Returns Promise<Folder>

  • createJobDefinition(jobName: string, code: string, parentFolderPath?: string, parentFolderUri?: string, accessToken?: string, sasApiClient?: SASViyaApiClient): Promise<{ etag: string; result: Job }>
  • Parameters

    • jobName: string
    • code: string
    • Optional parentFolderPath: string
    • Optional parentFolderUri: string
    • Optional accessToken: string
    • Optional sasApiClient: SASViyaApiClient

    Returns Promise<{ etag: string; result: Job }>

  • createLauncherContext(contextName: string, description: string, launchType: string, accessToken: string): Promise<Context>

Returns Promise<Folder>

  • createJobDefinition(jobName: string, code: string, parentFolderPath?: string, parentFolderUri?: string, accessToken?: string, sasApiClient?: SASViyaApiClient): Promise<{ etag: string; result: Job }>
  • Parameters

    • jobName: string
    • code: string
    • Optional parentFolderPath: string
    • Optional parentFolderUri: string
    • Optional accessToken: string
    • Optional sasApiClient: SASViyaApiClient

    Returns Promise<{ etag: string; result: Job }>

  • createLauncherContext(contextName: string, description: string, launchType: string, accessToken: string): Promise<Context>
  • Creates a launcher context on the given server.

    Parameters

    • contextName: string

      the name of the context to be created.

      @@ -57,19 +57,19 @@

      launch type of the context to be created.

    • accessToken: string

      an access token for an authorised user.

      -

    Returns Promise<Context>

  • createSession(contextName: string, accessToken: string): Promise<Session>
  • Parameters

    • contextName: string
    • accessToken: string

    Returns Promise<Session>

  • deleteClient(clientId: string, accessToken: string): Promise<unknown>
  • Parameters

    • clientId: string
    • accessToken: string

    Returns Promise<unknown>

  • deleteComputeContext(contextName: string, accessToken?: string): Promise<{ etag: string; result: Context }>

Returns Promise<Context>

  • createSession(contextName: string, accessToken: string): Promise<Session>
  • Parameters

    • contextName: string
    • accessToken: string

    Returns Promise<Session>

  • deleteClient(clientId: string, accessToken: string): Promise<unknown>
  • Parameters

    • clientId: string
    • accessToken: string

    Returns Promise<unknown>

  • deleteComputeContext(contextName: string, accessToken?: string): Promise<{ etag: string; result: Context }>
  • Deletes a compute context on the given server.

    Parameters

    • contextName: string

      the name of the context to be deleted.

    • Optional accessToken: string

      an access token for an authorised user.

      -

    Returns Promise<{ etag: string; result: Context }>

  • deleteFolder(folderPath: string, accessToken: string): Promise<undefined | Folder>

Returns Promise<{ etag: string; result: Context }>

  • deleteFolder(folderPath: string, accessToken: string): Promise<undefined | Folder>
  • 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.

    Parameters

    • folderPath: string

      the full path (eg /Public/example/deleteThis) of the folder to be deleted.

    • accessToken: string

      an access token for authorizing the request.

      -

    Returns Promise<undefined | Folder>

  • deployServicePack(serviceJson: any, appLoc?: string, serverUrl?: string, accessToken?: string, isForced?: boolean): Promise<void>

Returns Promise<undefined | Folder>

  • deployServicePack(serviceJson: any, appLoc?: string, serverUrl?: string, accessToken?: string, isForced?: boolean): Promise<void>
  • Creates the folders and services at the given location appLoc on the given server serverUrl.

    Parameters

    • serviceJson: any

      the JSON specifying the folders and services to be created.

      @@ -84,7 +84,7 @@ If not provided, is taken from SASjsConfig.

      using this function from the command line.

    • isForced: boolean = false

      flag that indicates if target folder already exists, it and all subfolders have to be deleted.

      -

    Returns Promise<void>

  • deployToSASjs(dataJson: ServicePackSASjs, appLoc?: string, authConfig?: AuthConfig): Promise<undefined | { example?: {}; message: string; status: string; streamServiceName?: string }>

Returns Promise<void>

  • deployToSASjs(dataJson: ServicePackSASjs, appLoc?: string, authConfig?: AuthConfig): Promise<undefined | { example?: {}; message: string; status: string; streamServiceName?: string }>
  • Creates the folders and services at the given location appLoc on the given server serverUrl.

    Parameters

    • dataJson: ServicePackSASjs

      the JSON specifying the folders and files to be created, can also includes @@ -94,7 +94,7 @@ appLoc, streamServiceName, streamWebFolder, streamLogo

      services. If not provided, is taken from SASjsConfig. Precedence will be of appLoc present in dataJson.

    • Optional authConfig: AuthConfig

      (optional) a valid client, secret, refresh and access tokens that are authorised to execute compute jobs.

      -

    Returns Promise<undefined | { example?: {}; message: string; status: string; streamServiceName?: string }>

  • editComputeContext(contextName: string, editedContext: EditContextInput, accessToken?: string): Promise<{ etag: string; result: Context }>

Returns Promise<undefined | { example?: {}; message: string; status: string; streamServiceName?: string }>

  • editComputeContext(contextName: string, editedContext: EditContextInput, accessToken?: string): Promise<{ etag: string; result: Context }>
  • Updates a compute context on the given server.

    Parameters

    • contextName: string

      the original name of the context to be deleted.

      @@ -102,14 +102,14 @@ services. If not provided, is taken from SASjsConfig. Precedence will be of app

      an object with the properties to be updated.

    • Optional accessToken: string

      an access token for an authorised user.

      -

    Returns Promise<{ etag: string; result: Context }>

  • executeJobSASjs(query: ExecutionQuery, authConfig?: AuthConfig): Promise<undefined | { _webout?: string; error?: {}; log?: string; logPath?: string; message: string; status: string }>
  • Parameters

    Returns Promise<undefined | { _webout?: string; error?: {}; log?: string; logPath?: string; message: string; status: string }>

  • executeScriptSAS9(linesOfCode: string[], userName: string, password: string): Promise<undefined | string>

Returns Promise<{ etag: string; result: Context }>

  • executeJobSASjs(query: ExecutionQuery, authConfig?: AuthConfig): Promise<undefined | { _webout?: string; error?: {}; log?: string; logPath?: string; message: string; status: string }>
  • Parameters

    Returns Promise<undefined | { _webout?: string; error?: {}; log?: string; logPath?: string; message: string; status: string }>

  • executeScriptSAS9(linesOfCode: string[], userName: string, password: string): Promise<undefined | string>
  • Executes SAS code on a SAS 9 server. Requires a runner to be present in the users home directory in metadata.

    Parameters

    • linesOfCode: string[]

      lines of sas code from the file to run.

    • userName: string
    • password: string

      a string representing the password.

      -

    Returns Promise<undefined | string>

  • executeScriptSASViya(fileName: string, linesOfCode: string[], contextName: string, authConfig?: AuthConfig, debug?: boolean): Promise<any>

Returns Promise<undefined | string>

  • executeScriptSASViya(fileName: string, linesOfCode: string[], contextName: string, authConfig?: AuthConfig, debug?: boolean): Promise<any>
  • Executes sas code in a SAS Viya compute session.

    Parameters

    • fileName: string

      name of the file to run. It will be converted to path to the file being submitted for execution.

      @@ -121,19 +121,19 @@ the users home directory in metadata.

      (optional) the access token, refresh token, client and secret for authorizing the request.

    • Optional debug: boolean

      (optional) if true, global debug config will be overriden

      -

    Returns Promise<any>

  • executeScriptSASjs(code: string, runTime?: string, authConfig?: AuthConfig): Promise<undefined | string>

Returns Promise<any>

  • executeScriptSASjs(code: string, runTime?: string, authConfig?: AuthConfig): Promise<undefined | string>
  • Executes SAS code on a SASJS server

    Parameters

    • code: string

      a string of code from the file to run.

    • Optional runTime: string
    • Optional authConfig: AuthConfig

      (optional) a valid client, secret, refresh and access tokens that are authorised to execute scripts.

      -

    Returns Promise<undefined | string>

  • fetchLogFileContent(logUrl: string, accessToken?: string): Promise<string>

Returns Promise<undefined | string>

  • fetchLogFileContent(logUrl: string, accessToken?: string): Promise<string>
  • Fetches content of the log file

    Parameters

    • logUrl: string

      url of the log file.

    • Optional accessToken: string

      an access token for an authorised user.

      -

    Returns Promise<string>

  • getAccessToken(clientId: string, clientSecret: string, authCode: string): Promise<SasAuthResponse | SASjsAuthResponse>

Returns Promise<string>

  • getAccessToken(clientId: string, clientSecret: string, authCode: string): Promise<SasAuthResponse | SASjsAuthResponse>
  • Exchanges the auth code for an access token for the given client.

    Parameters

    • clientId: string

      the client ID to authenticate with.

      @@ -141,53 +141,53 @@ the users home directory in metadata.

      the client secret to authenticate with.

    • authCode: string

      the auth code received from the server.

      -

    Returns Promise<SasAuthResponse | SASjsAuthResponse>

  • getAuthCode(clientId: string): Promise<null | string>
  • Parameters

    • clientId: string

    Returns Promise<null | string>

Returns Promise<SasAuthResponse | SASjsAuthResponse>

  • getAuthCode(clientId: string): Promise<null | string>
  • Parameters

    • clientId: string

    Returns Promise<null | string>

  • Returns a JSON representation of a compute context.

    Parameters

    • contextId: string

      an id of the context to return.

    • Optional accessToken: string

      an access token for an authorised user.

      -

    Returns Promise<ContextAllAttributes>

  • getComputeContextByName(contextName: string, accessToken?: string): Promise<Context>

Returns Promise<ContextAllAttributes>

  • getComputeContextByName(contextName: string, accessToken?: string): Promise<Context>
  • Returns a JSON representation of a compute context.

    example:

    { "createdBy": "admin", "links": [...], "id": "ID", "version": 2, "name": "context1" }

    Parameters

    • contextName: string

      the name of the context to return.

    • Optional accessToken: string

      an access token for an authorised user.

      -

    Returns Promise<Context>

  • getComputeContexts(accessToken: string): Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

Returns Promise<Context>

  • getComputeContexts(accessToken: string): Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>
  • Gets compute contexts.

    Parameters

    • accessToken: string

      an access token for an authorised user.

      -

    Returns Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

  • getCsrfToken(type?: "general" | "file"): undefined | CsrfToken
  • getDefaultComputeContexts(): string[]

Returns Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

  • getCsrfToken(type?: "general" | "file"): undefined | CsrfToken
  • getDefaultComputeContexts(): string[]
  • Gets default(system) launcher contexts.

    -

    Returns string[]

  • getExecutableContexts(authConfig: AuthConfig): Promise<any[]>
  • getExecutableContexts(authConfig: AuthConfig): Promise<any[]>
  • Gets executable compute contexts.

    Parameters

    • authConfig: AuthConfig

      an access token, refresh token, client and secret for an authorised user.

      -

    Returns Promise<any[]>

  • getFolder(folderPath: string, accessToken?: string): Promise<unknown>

Returns Promise<any[]>

  • getFolder(folderPath: string, accessToken?: string): Promise<unknown>
  • Fetches a folder from the SAS file system.

    Parameters

    • folderPath: string

      path of the folder to be fetched.

    • Optional accessToken: string

      the access token to authorize the request.

      -

    Returns Promise<unknown>

  • getLauncherContexts(accessToken: string): Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

Returns Promise<unknown>

  • getLauncherContexts(accessToken: string): Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>
  • Gets launcher contexts.

    Parameters

    • accessToken: string

      an access token for an authorised user.

      -

    Returns Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

Returns Promise<{ attributes: {}; createdBy: any; id: any; name: any; version: any }[]>

  • getUserName(): string
  • getUserName(): string
  • Returns the username of the user currently logged in.

    -

    Returns string

  • listFolder(sourceFolder: string, accessToken?: string, limit?: number): Promise<undefined | any[]>
  • listFolder(sourceFolder: string, accessToken?: string, limit?: number): Promise<undefined | any[]>
  • Lists children folders for given Viya folder.

    Parameters

    • sourceFolder: string

      the full path (eg /Public/example/myFolder) or URI of the source folder listed. Providing URI instead of path will save one extra request.

    • Optional accessToken: string

      an access token for authorizing the request.

      -
    • Optional limit: number

    Returns Promise<undefined | any[]>

  • logIn(username?: string, password?: string, clientId?: string, options?: LoginOptions): Promise<LoginResult>

Returns Promise<undefined | any[]>

  • logIn(username?: string, password?: string, clientId?: string, options?: LoginOptions): Promise<LoginResult>
  • Logs into the SAS server with the supplied credentials.

    Parameters

    • Optional username: string

      a string representing the username.

      @@ -195,9 +195,9 @@ the users home directory in metadata.

      a string representing the password.

    • Optional clientId: string

      a string representing the client ID.

      -
    • options: LoginOptions = {}

    Returns Promise<LoginResult>

  • logOut(): Promise<boolean>

Returns Promise<LoginResult>

  • logOut(): Promise<boolean>
  • Logs out of the configured SAS server.

    -

    Returns Promise<boolean>

  • moveFolder(sourceFolder: string, targetParentFolder: string, targetFolderName: string, accessToken: string): Promise<undefined | Folder>
  • moveFolder(sourceFolder: string, targetParentFolder: string, targetFolderName: string, accessToken: string): Promise<undefined | Folder>
  • Moves folder to a new location. The folder may be renamed at the same time.

    Parameters

    • sourceFolder: string

      the full path (eg /Public/example/myFolder) or URI of the source folder to be moved. Providing URI instead of path will save one extra request.

      @@ -207,7 +207,7 @@ the users home directory in metadata.

      the name of the "moved" folder. If left blank, the original folder name will be used (eg myFolder in /Public/newDestination/myFolder for the example above). Optional field.

    • accessToken: string

      an access token for authorizing the request.

      -

    Returns Promise<undefined | Folder>

  • refreshTokens(clientId: string, clientSecret: string, refreshToken: string): Promise<SasAuthResponse | SASjsAuthResponse>

Returns Promise<undefined | Folder>

  • refreshTokens(clientId: string, clientSecret: string, refreshToken: string): Promise<SasAuthResponse | SASjsAuthResponse>
  • Exchanges the refresh token for an access token for the given client.

    Parameters

    • clientId: string

      the client ID to authenticate with.

      @@ -215,7 +215,7 @@ the users home directory in metadata.

      the client secret to authenticate with.

    • refreshToken: string

      the refresh token received from the server.

      -

    Returns Promise<SasAuthResponse | SASjsAuthResponse>

  • request(sasJob: string, data: null | {}, config?: {}, loginRequiredCallback?: () => any, authConfig?: AuthConfig, extraResponseAttributes?: ExtraResponseAttributes[]): Promise<any>

Returns Promise<SasAuthResponse | SASjsAuthResponse>

  • request(sasJob: string, data: null | {}, config?: {}, loginRequiredCallback?: () => any, authConfig?: AuthConfig, extraResponseAttributes?: ExtraResponseAttributes[]): Promise<any>
  • Makes a request to program specified in SASjob (could be a Viya Job, a SAS 9 Stored Process, or a SASjs Server Stored Program). The response object will always contain table names in lowercase, and column names in @@ -245,15 +245,15 @@ If you are not passing in any data and configuration, it will look like so:

    a array of predefined values that are used to provide extra attributes (same names as those values) to be added in response Supported values are declared in ExtraResponseAttributes type.

    -

Returns Promise<any>

  • setDebugState(value: boolean): void

Returns Promise<any>

  • setDebugState(value: boolean): void
  • Sets the debug state. Turning this on will enable additional logging in the adapter.

    Parameters

    • value: boolean

      boolean indicating debug state (on/off).

      -

    Returns void

Returns void

  • Sets the SASjs configuration.

    Parameters

    Returns Promise<void>

  • startComputeJob(sasJob: string, data: any, config?: any, authConfig?: AuthConfig, waitForResult?: boolean, pollOptions?: PollOptions, printPid?: boolean, variables?: MacroVar): Promise<any>

Returns Promise<void>

  • startComputeJob(sasJob: string, data: any, config?: any, authConfig?: AuthConfig, waitForResult?: boolean, pollOptions?: PollOptions, printPid?: boolean, variables?: MacroVar): Promise<any>
  • Kicks off execution of the given job via the compute API.

    Parameters

    • sasJob: string

      the path to the SAS program (ultimately resolves to @@ -278,7 +278,7 @@ The access token is not required when the user is authenticated via the browser.

    • Optional variables: MacroVar

      an object that represents macro variables.

    Returns Promise<any>

    an object representing the compute session created for the given job.

    -
  • uploadFile(sasJob: string, files: UploadFile[], params: null | {}, config?: {}, loginRequiredCallback?: () => any): Promise<unknown>
  • uploadFile(sasJob: string, files: UploadFile[], params: null | {}, config?: {}, loginRequiredCallback?: () => any): Promise<unknown>
  • Uploads a file to the given service.

    Parameters

    • sasJob: string

      the path to the SAS program (ultimately resolves to diff --git a/docs/classes/SASjsApiClient.SASjsApiClient-1.html b/docs/classes/SASjsApiClient.SASjsApiClient-1.html index 8267ee8..6be44d7 100644 --- a/docs/classes/SASjsApiClient.SASjsApiClient-1.html +++ b/docs/classes/SASjsApiClient.SASjsApiClient-1.html @@ -1,4 +1,4 @@ -SASjsApiClient | @sasjs/adapter

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Hierarchy

      • SASjsApiClient

      Index

      Constructors

      Methods

      • deploy(dataJson: ServicePackSASjs, appLoc: string, authConfig?: AuthConfig): Promise<{ example?: {}; message: string; status: string; streamServiceName?: string }>
      • Parameters

        • dataJson: ServicePackSASjs
        • appLoc: string
        • Optional authConfig: AuthConfig

        Returns Promise<{ example?: {}; message: string; status: string; streamServiceName?: string }>

      • executeJob(query: ExecutionQuery, authConfig?: AuthConfig): Promise<{ _webout?: string; error?: {}; log?: string; logPath?: string; message: string; status: string }>
      • Parameters

        Returns Promise<{ _webout?: string; error?: {}; log?: string; logPath?: string; message: string; status: string }>

      • executeScript(code: string, runTime?: string, authConfig?: AuthConfig): Promise<string>
      • +SASjsApiClient | @sasjs/adapter
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Hierarchy

        • SASjsApiClient

        Index

        Constructors

        Methods

        • deploy(dataJson: ServicePackSASjs, appLoc: string, authConfig?: AuthConfig): Promise<{ example?: {}; message: string; status: string; streamServiceName?: string }>
        • Parameters

          • dataJson: ServicePackSASjs
          • appLoc: string
          • Optional authConfig: AuthConfig

          Returns Promise<{ example?: {}; message: string; status: string; streamServiceName?: string }>

        • executeJob(query: ExecutionQuery, authConfig?: AuthConfig): Promise<{ _webout?: string; error?: {}; log?: string; logPath?: string; message: string; status: string }>
        • Parameters

          Returns Promise<{ _webout?: string; error?: {}; log?: string; logPath?: string; message: string; status: string }>

        • executeScript(code: string, runTime?: string, authConfig?: AuthConfig): Promise<string>
        • Executes code on a SASJS server.

          Parameters

          • code: string

            a string of code to execute.

            @@ -6,13 +6,13 @@

            a string to representing runTime for code execution

          • Optional authConfig: AuthConfig

            an object for authentication.

            -

          Returns Promise<string>

        Returns Promise<string>

      • Exchanges the auth code for an access token for the given client.

        Parameters

        • clientId: string

          the client ID to authenticate with.

        • authCode: string

          the auth code received from the server.

          -

        Returns Promise<SASjsAuthResponse>

      Returns Promise<SASjsAuthResponse>

Hierarchy

  • UploadFile

Index

Properties

Properties

file: File
fileName: string

Generated using TypeDoc

\ No newline at end of file diff --git a/docs/interfaces/types.WriteStream.html b/docs/interfaces/types.WriteStream.html index 48e0432..f48108a 100644 --- a/docs/interfaces/types.WriteStream.html +++ b/docs/interfaces/types.WriteStream.html @@ -1 +1 @@ -WriteStream | @sasjs/adapter
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WriteStream

Hierarchy

  • WriteStream

Index

Properties

Methods

Properties

path: string

Methods

  • write(content: string, callback: (err?: Error) => any): void
  • Parameters

    • content: string
    • callback: (err?: Error) => any
        • (err?: Error): any
        • Parameters

          • Optional err: Error

          Returns any

    Returns void

Generated using TypeDoc

\ No newline at end of file +WriteStream | @sasjs/adapter
Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface WriteStream

Hierarchy

  • WriteStream

Index

Properties

Methods

Properties

path: string

Methods

  • write(content: string, callback: (err?: Error) => any): void
  • Parameters

    • content: string
    • callback: (err?: Error) => any
        • (err?: Error): any
        • Parameters

          • Optional err: Error

          Returns any

    Returns void

Generated using TypeDoc

\ No newline at end of file