@sasjs/adapter 2.11.3 → 2.11.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -36,7 +36,7 @@ Ok ok. Deploy this [example.html](https://raw.githubusercontent.com/sasjs/adapte
36
36
 
37
37
  The backend part can be deployed as follows:
38
38
 
39
- ```
39
+ ```sas
40
40
  %let appLoc=/Public/app/readme; /* Metadata or Viya Folder per SASjs config */
41
41
  filename mc url "https://raw.githubusercontent.com/sasjs/core/main/all.sas";
42
42
  %inc mc; /* compile macros (can also be downloaded & compiled seperately) */
@@ -85,11 +85,11 @@ let sasJs = new SASjs.default(
85
85
  );
86
86
  ```
87
87
  If you've installed it via NPM, you can import it as a default import like so:
88
- ```
88
+ ```js
89
89
  import SASjs from '@sasjs/adapter';
90
90
  ```
91
91
  You can then instantiate it with:
92
- ```
92
+ ```js
93
93
  const sasJs = new SASjs({your config})
94
94
  ```
95
95
 
@@ -119,6 +119,7 @@ sasJs.request("/path/to/my/service", dataObject)
119
119
  console.log(response.tablewith2cols1row[0].COL1.value)
120
120
  })
121
121
  ```
122
+
122
123
  We supply the path to the SAS service, and a data object. The data object can be null (for services with no input), or can contain one or more tables in the following format:
123
124
 
124
125
  ```javascript
@@ -146,6 +147,7 @@ The adapter will also cache the logs (if debug enabled) and even the work tables
146
147
  The SAS side is handled by a number of macros in the [macro core](https://github.com/sasjs/core) library.
147
148
 
148
149
  The following snippet shows the process of SAS tables arriving / leaving:
150
+
149
151
  ```sas
150
152
  /* fetch all input tables sent from frontend - they arrive as work tables */
151
153
  %webout(FETCH)
@@ -161,7 +163,6 @@ run;
161
163
  %webout(OBJ,tables,fmt=N) /* unformatted (raw) data */
162
164
  %webout(OBJ,tables,label=newtable) /* rename tables on export */
163
165
  %webout(CLOSE) /* close the JSON and send some extra useful variables too */
164
-
165
166
  ```
166
167
 
167
168
  ## Configuration
@@ -172,6 +173,7 @@ Configuration on the client side involves passing an object on startup, which ca
172
173
  * `serverType` - either `SAS9` or `SASVIYA`.
173
174
  * `serverUrl` - the location (including http protocol and port) of the SAS Server. Can be omitted, eg if serving directly from the SAS Web Server, or in streaming mode.
174
175
  * `debug` - if `true` then SAS Logs and extra debug information is returned.
176
+ * `LoginMechanism` - either `Default` or `Redirected`. If `Redirected` then authentication occurs through the injection of an additional screen, which contains the SASLogon prompt. This allows for more complex authentication flows (such as 2FA) and avoids the need to handle passwords in the application itself. The styling of the redirect flow can also be modified. If left at "Default" then the developer must capture the username and password and use these with the `.login()` method.
175
177
  * `useComputeApi` - Only relevant when the serverType is `SASVIYA`. If `true` the [Compute API](#using-the-compute-api) is used. If `false` the [JES API](#using-the-jes-api) is used. If `null` or `undefined` the [Web](#using-jes-web-app) approach is used.
176
178
  * `contextName` - Compute context on which the requests will be called. If missing or not provided, defaults to `Job Execution Compute context`.
177
179
 
@@ -196,7 +198,7 @@ Here we are running Jobs using the Job Execution Service except this time we are
196
198
 
197
199
  This approach (`useComputeApi: false`) also ensures that jobs are displayed in Environment Manager.
198
200
 
199
- ```
201
+ ```json
200
202
  {
201
203
  appLoc:"/Your/Path",
202
204
  serverType:"SASVIYA",
@@ -210,12 +212,12 @@ This approach is by far the fastest, as a result of the optimisations we have bu
210
212
 
211
213
  With this approach (`useComputeApi: true`), the requests/logs will _not_ appear in the list in Environment manager.
212
214
 
213
- ```
215
+ ```json
214
216
  {
215
217
  appLoc:"/Your/Path",
216
218
  serverType:"SASVIYA",
217
219
  useComputeApi: true,
218
- contextName: 'yourComputeContext'
220
+ contextName: "yourComputeContext"
219
221
  }
220
222
  ```
221
223