/
SASjsConfig.ts
87 lines (85 loc) · 3.09 KB
/
SASjsConfig.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import * as https from 'https'
import { ServerType } from '@sasjs/utils/types'
import { VerboseMode } from '../types'
/**
* Specifies the configuration for the SASjs instance - eg where and how to
* connect to SAS.
*/
export class SASjsConfig {
/**
* The location (including http protocol and port) of the SAS Server.
* Can be omitted, eg if serving directly from the SAS Web Server or being
* streamed.
*/
serverUrl: string = ''
/**
* The location of the STP Process Web Application. By default the adapter
* will use '/SASjsApi/stp/execute' on SAS JS.
*/
pathSASJS: string = ''
/**
* The location of the Stored Process Web Application. By default the adapter
* will use '/SASStoredProcess/do' on SAS 9.
*/
pathSAS9: string = ''
/**
* The location of the Job Execution Web Application. By default the adapter
* will use '/SASJobExecution' on SAS Viya.
*/
pathSASViya: string = ''
/**
* The appLoc is the parent folder under which the SAS services (STPs or Job
* Execution Services) are stored. We recommend that each app is stored in
* a dedicated parent folder (the appLoc) and the services are grouped inside
* subfolders within the appLoc - allowing functionality to be restricted
* according to those groups at backend.
* When using appLoc, the paths provided in the `request` function should be
* _without_ a leading slash (/).
*/
appLoc: string = ''
/**
* Can be `SAS9` or `SASVIYA`.
*/
serverType: ServerType | null = null
/**
* Set to `true` to enable additional debugging.
*/
debug: boolean = true
/**
* Set to `true` to enable verbose mode that will log a summary of every HTTP response.
*/
verbose?: VerboseMode = true
/**
* The name of the compute context to use when calling the Viya services directly.
* Example value: 'SAS Job Execution compute context'
*/
contextName: string = ''
/**
* If it's `false` adapter will use the JES API as connection approach. To enhance VIYA
* performance, set to `true` and provide a `contextName` on which to run
* the code. When running on a named context, the code executes under the
* user identity. When running as a Job Execution service, the code runs
* under the identity in the JES context. If `useComputeApi` is `null` or `undefined`, the service will run as a Job, except
* triggered using the APIs instead of the Job Execution Web Service broker.
*/
useComputeApi: boolean | null = null
/**
* Optional setting to configure HTTPS Agent.
* By providing `key`, `cert`, `ca` to connect with server
* Other options can be set `rejectUnauthorized` and `requestCert`
*/
httpsAgentOptions?: https.AgentOptions
/**
* Supported login mechanisms are - Redirected and Default
*/
loginMechanism: LoginMechanism = LoginMechanism.Default
/**
* Optional setting to configure request history limit. Increasing this limit
* may affect browser performance, especially with debug (logs) enabled.
*/
requestHistoryLimit?: number = 10
}
export enum LoginMechanism {
Default = 'Default',
Redirected = 'Redirected'
}