@sasjs/adapter 4.11.2 → 4.12.0
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/SASViyaApiClient.d.ts +25 -2
- package/SASjs.d.ts +20 -2
- package/api/viya/writeStream.d.ts +1 -1
- package/auth/getTokenRequestErrorPrefix.d.ts +2 -2
- package/file/generateFileUploadForm.d.ts +1 -1
- package/file/generateTableUploadForm.d.ts +1 -1
- package/index-dev.js +77153 -3
- package/index.js +77153 -2
- package/job-execution/JobExecutor.d.ts +1 -1
- package/minified_sas9.js +16558 -2
- package/node/SASViyaApiClient.d.ts +25 -2
- package/node/SASjs.d.ts +20 -2
- package/node/api/viya/writeStream.d.ts +1 -1
- package/node/auth/getTokenRequestErrorPrefix.d.ts +2 -2
- package/node/file/generateFileUploadForm.d.ts +1 -1
- package/node/file/generateTableUploadForm.d.ts +1 -1
- package/node/index.js +28247 -2
- package/node/job-execution/JobExecutor.d.ts +1 -1
- package/node/request/RequestClient.d.ts +11 -2
- package/node/types/FileResource.d.ts +32 -0
- package/node/types/PollOptions.d.ts +1 -1
- package/node/types/RequestClient.d.ts +1 -1
- package/node/types/WriteStream.d.ts +6 -3
- package/node/utils/getFormData.d.ts +1 -1
- package/package.json +12 -9
- package/request/RequestClient.d.ts +11 -2
- package/spec/SAS9ApiClient.spec.d.ts +1 -0
- package/spec/SASjsApiClient.spec.d.ts +1 -0
- package/src/SAS9ApiClient.ts +1 -1
- package/src/SASViyaApiClient.ts +124 -6
- package/src/SASjs.ts +54 -4
- package/src/SASjsApiClient.ts +1 -1
- package/src/api/viya/writeStream.ts +10 -5
- package/src/auth/refreshTokensForViya.ts +1 -1
- package/src/file/generateFileUploadForm.ts +1 -1
- package/src/file/generateTableUploadForm.ts +1 -1
- package/src/job-execution/Sas9JobExecutor.ts +1 -1
- package/src/job-execution/SasjsJobExecutor.ts +5 -3
- package/src/job-execution/WebJobExecutor.ts +5 -3
- package/src/request/RequestClient.ts +73 -81
- package/src/request/Sas9RequestClient.ts +5 -5
- package/src/test/SAS_server_app.ts +10 -2
- package/src/types/FileResource.ts +33 -0
- package/src/types/WriteStream.ts +9 -3
- package/src/utils/convertToCsv.ts +5 -1
- package/src/utils/getFormData.ts +2 -2
- package/src/utils/validateInput.ts +16 -13
- package/types/FileResource.d.ts +32 -0
- package/types/PollOptions.d.ts +1 -1
- package/types/RequestClient.d.ts +1 -1
- package/types/WriteStream.d.ts +6 -3
- package/types/errors/spec/SAS9AuthError.spec.d.ts +1 -0
- package/utils/getFormData.d.ts +1 -1
- package/utils/spec/parseSasViyaLog.spec.d.ts +1 -0
- package/utils/spec/parseViyaDebugResponse.spec.d.ts +1 -0
- package/index-dev.js.LICENSE.txt +0 -110
- package/index.js.LICENSE.txt +0 -110
- package/minified_sas9.js.LICENSE.txt +0 -15
- package/node/index.js.LICENSE.txt +0 -106
package/SASViyaApiClient.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Job, Session, Context, ContextAllAttributes, Folder, File, EditContextInput, PollOptions } from './types';
|
|
3
3
|
import { SasAuthResponse, MacroVar, AuthConfig } from '@sasjs/utils/types';
|
|
4
4
|
import { RequestClient } from './request/RequestClient';
|
|
5
|
+
import { FileResource } from './types/FileResource';
|
|
5
6
|
interface JobExecutionResult {
|
|
6
7
|
result?: {
|
|
7
8
|
result: object;
|
|
@@ -138,6 +139,23 @@ export declare class SASViyaApiClient {
|
|
|
138
139
|
* @param variables - an object that represents macro variables.
|
|
139
140
|
*/
|
|
140
141
|
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>;
|
|
142
|
+
/**
|
|
143
|
+
* Fetches the file content for a file in the specified folder.
|
|
144
|
+
*
|
|
145
|
+
* @param folderPath - the full path to the folder containing the file. eg: /Public/folder1/folder2
|
|
146
|
+
* @param fileName - the name of the file in the `folderPath`
|
|
147
|
+
* @param accessToken - an access token for authorizing the request
|
|
148
|
+
*/
|
|
149
|
+
getFileContent(folderPath: string, fileName: string, accessToken?: string): Promise<string>;
|
|
150
|
+
/**
|
|
151
|
+
* Updates the file content for a file in the specified folder.
|
|
152
|
+
*
|
|
153
|
+
* @param folderPath - the full path to the folder containing the file. eg: /Public/folder1/folder2
|
|
154
|
+
* @param fileName - the name of the file in the `folderPath`
|
|
155
|
+
* @param content - the new content to be written to the file
|
|
156
|
+
* @param accessToken - an access token for authorizing the request
|
|
157
|
+
*/
|
|
158
|
+
updateFileContent(folderPath: string, fileName: string, content: string, accessToken?: string): Promise<FileResource>;
|
|
141
159
|
/**
|
|
142
160
|
* Fetches a folder. Path to the folder is required.
|
|
143
161
|
* @param folderPath - the absolute path to the folder.
|
|
@@ -232,6 +250,7 @@ export declare class SASViyaApiClient {
|
|
|
232
250
|
private uploadTables;
|
|
233
251
|
private getFolderDetails;
|
|
234
252
|
private getFolderUri;
|
|
253
|
+
private getFileUri;
|
|
235
254
|
private getRecycleBinUri;
|
|
236
255
|
/**
|
|
237
256
|
* Returns a JSON representation of a compute context.
|
|
@@ -247,11 +266,15 @@ export declare class SASViyaApiClient {
|
|
|
247
266
|
*/
|
|
248
267
|
getComputeContextById(contextId: string, accessToken?: string): Promise<ContextAllAttributes>;
|
|
249
268
|
/**
|
|
250
|
-
* Lists children folders for given Viya folder.
|
|
269
|
+
* Lists children folders/files for given Viya folder.
|
|
251
270
|
* @param sourceFolder - the full path (eg `/Public/example/myFolder`) or URI of the source folder listed. Providing URI instead of path will save one extra request.
|
|
252
271
|
* @param accessToken - an access token for authorizing the request.
|
|
272
|
+
* @param {Object} [options] - Additional options.
|
|
273
|
+
* @param {boolean} [options.returnDetails=false] - when set to true, the function will return an array of objects with member details, otherwise it will return an array of member names.
|
|
253
274
|
*/
|
|
254
|
-
listFolder(sourceFolder: string, accessToken?: string, limit?: number
|
|
275
|
+
listFolder(sourceFolder: string, accessToken?: string, limit?: number, options?: {
|
|
276
|
+
returnDetails?: boolean;
|
|
277
|
+
}): Promise<any[]>;
|
|
255
278
|
/**
|
|
256
279
|
* Moves Viya folder to a new location. The folder may be renamed at the same time.
|
|
257
280
|
* @param sourceFolder - 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.
|
package/SASjs.d.ts
CHANGED
|
@@ -157,6 +157,23 @@ export default class SASjs {
|
|
|
157
157
|
* @param sasApiClient - a client for interfacing with SAS API.
|
|
158
158
|
*/
|
|
159
159
|
createFile(fileName: string, content: Buffer, parentFolderPath: string, parentFolderUri?: string, accessToken?: string, sasApiClient?: SASViyaApiClient): Promise<import("./types").File>;
|
|
160
|
+
/**
|
|
161
|
+
* Fetches the file content for a file in the specified folder.
|
|
162
|
+
*
|
|
163
|
+
* @param folderPath - the full path to the folder containing the file. eg: /Public/folder1/folder2
|
|
164
|
+
* @param fileName - the name of the file in the `folderPath`
|
|
165
|
+
* @param accessToken - an access token for authorizing the request
|
|
166
|
+
*/
|
|
167
|
+
getFileContent(folderPath: string, fileName: string, accessToken?: string): Promise<string>;
|
|
168
|
+
/**
|
|
169
|
+
* Updates the file content for a file in the specified folder.
|
|
170
|
+
*
|
|
171
|
+
* @param folderPath - the full path to the folder containing the file. eg: /Public/folder1/folder2
|
|
172
|
+
* @param fileName - the name of the file in the `folderPath`
|
|
173
|
+
* @param content - the new content to be written to the file
|
|
174
|
+
* @param accessToken - an access token for authorizing the request
|
|
175
|
+
*/
|
|
176
|
+
updateFileContent(folderPath: string, fileName: string, content: string, accessToken?: string): Promise<import("./types/FileResource").FileResource>;
|
|
160
177
|
/**
|
|
161
178
|
* Fetches a folder from the SAS file system.
|
|
162
179
|
* @param folderPath - path of the folder to be fetched.
|
|
@@ -173,8 +190,9 @@ export default class SASjs {
|
|
|
173
190
|
* Lists children folders for given Viya folder.
|
|
174
191
|
* @param sourceFolder - the full path (eg `/Public/example/myFolder`) or URI of the source folder listed. Providing URI instead of path will save one extra request.
|
|
175
192
|
* @param accessToken - an access token for authorizing the request.
|
|
193
|
+
* @param returnDetails - when set to true, the function will return an array of objects with member details, otherwise it will return an array of member names.
|
|
176
194
|
*/
|
|
177
|
-
listFolder(sourceFolder: string, accessToken?: string, limit?: number): Promise<any[] | undefined>;
|
|
195
|
+
listFolder(sourceFolder: string, accessToken?: string, limit?: number, returnDetails?: boolean): Promise<any[] | undefined>;
|
|
178
196
|
/**
|
|
179
197
|
* Moves folder to a new location. The folder may be renamed at the same time.
|
|
180
198
|
* @param sourceFolder - 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.
|
|
@@ -343,7 +361,7 @@ export default class SASjs {
|
|
|
343
361
|
* @param successCallBack - function that should be triggered on every HTTP response with the status 2**.
|
|
344
362
|
* @param errorCallBack - function that should be triggered on every HTTP response with the status different from 2**.
|
|
345
363
|
*/
|
|
346
|
-
enableVerboseMode(successCallBack?: (response: AxiosResponse
|
|
364
|
+
enableVerboseMode(successCallBack?: (response: AxiosResponse) => AxiosResponse, errorCallBack?: (response: AxiosError) => AxiosError): void;
|
|
347
365
|
/**
|
|
348
366
|
* Turns off verbose mode to log every HTTP response.
|
|
349
367
|
*/
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WriteStream } from '../../types';
|
|
2
|
-
export declare const writeStream: (stream: WriteStream, content: string) => Promise<
|
|
2
|
+
export declare const writeStream: (stream: WriteStream, content: string) => Promise<boolean>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ServerType } from '@sasjs/utils/types';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type Server = ServerType.SasViya | ServerType.Sasjs;
|
|
3
|
+
type Operation = 'fetching access token' | 'refreshing tokens';
|
|
4
4
|
/**
|
|
5
5
|
* Forms error prefix for requests related to token operations.
|
|
6
6
|
* @param operation - string describing operation ('fetching access token' or 'refreshing tokens').
|