From 397bc4524f7227f0ebbebf94b0b78f0bd5f06725 Mon Sep 17 00:00:00 2001 From: Yury Shkoda Date: Wed, 20 Oct 2021 15:00:52 +0300 Subject: [PATCH] chore: change 'SASBase' to 'SASjs' --- src/SASjs.ts | 23 +++++++++++-------- ...{SASBaseApiClient.ts => SASjsApiClient.ts} | 6 ++--- src/types/SASjsConfig.ts | 2 +- 3 files changed, 17 insertions(+), 14 deletions(-) rename src/{SASBaseApiClient.ts => SASjsApiClient.ts} (81%) diff --git a/src/SASjs.ts b/src/SASjs.ts index aea66a8..92dd80e 100644 --- a/src/SASjs.ts +++ b/src/SASjs.ts @@ -11,7 +11,7 @@ import { } from './types' import { SASViyaApiClient } from './SASViyaApiClient' import { SAS9ApiClient } from './SAS9ApiClient' -import { SASBaseApiClient } from './SASBaseApiClient' +import { SASjsApiClient } from './SASjsApiClient' import { AuthManager } from './auth' import { ServerType, @@ -33,7 +33,7 @@ import { LoginOptions, LoginResult } from './types/Login' const defaultConfig: SASjsConfig = { serverUrl: '', - pathSASBase: '', + pathSASjs: '', pathSAS9: '/SASStoredProcess/do', pathSASViya: '/SASJobExecution', appLoc: '/Public/seedapp', @@ -54,7 +54,7 @@ export default class SASjs { private jobsPath: string = '' private sasViyaApiClient: SASViyaApiClient | null = null private sas9ApiClient: SAS9ApiClient | null = null - private sasBaseApiClient: SASBaseApiClient | null = null + private SASjsApiClient: SASjsApiClient | null = null private fileUploader: FileUploader | null = null private authManager: AuthManager | null = null private requestClient: RequestClient | null = null @@ -830,12 +830,15 @@ export default class SASjs { ) } - public async deployToSASBase(members: [FolderMember, ServiceMember]) { - return await this.sasBaseApiClient?.deploy(members) + public async deployToSASjs(members: [FolderMember, ServiceMember]) { + return await this.SASjsApiClient?.deploy( + members, + this.sasjsConfig.appLoc + ) } - public async executeJobSASBase(query: ExecutionQuery) { - return await this.sasBaseApiClient?.executeJob(query) + public async executeJobSASjs(query: ExecutionQuery) { + return await this.SASjsApiClient?.executeJob(query) } /** @@ -1017,10 +1020,10 @@ export default class SASjs { } if (this.sasjsConfig.serverType === ServerType.Sasjs) { - if (this.sasBaseApiClient) { - this.sasBaseApiClient.setConfig(this.sasjsConfig.serverUrl) + if (this.SASjsApiClient) { + this.SASjsApiClient.setConfig(this.sasjsConfig.serverUrl) } else { - this.sasBaseApiClient = new SASBaseApiClient( + this.SASjsApiClient = new SASjsApiClient( this.sasjsConfig.serverUrl, this.requestClient ) diff --git a/src/SASBaseApiClient.ts b/src/SASjsApiClient.ts similarity index 81% rename from src/SASBaseApiClient.ts rename to src/SASjsApiClient.ts index 45159ce..10ffbba 100644 --- a/src/SASBaseApiClient.ts +++ b/src/SASjsApiClient.ts @@ -1,7 +1,7 @@ import { FolderMember, ServiceMember, ExecutionQuery } from './types' import { RequestClient } from './request/RequestClient' -export class SASBaseApiClient { +export class SASjsApiClient { constructor( private serverUrl: string, private requestClient: RequestClient @@ -11,12 +11,12 @@ export class SASBaseApiClient { if (serverUrl) this.serverUrl = serverUrl } - public async deploy(members: [FolderMember, ServiceMember]) { + public async deploy(members: [FolderMember, ServiceMember], appLoc: string) { const { result } = await this.requestClient.post<{ status: string message: string example?: {} - }>('/deploy', members, undefined) + }>('/deploy', { members: members, appLoc: appLoc }, undefined) return Promise.resolve(result) } diff --git a/src/types/SASjsConfig.ts b/src/types/SASjsConfig.ts index f08590c..b3e75ff 100644 --- a/src/types/SASjsConfig.ts +++ b/src/types/SASjsConfig.ts @@ -21,7 +21,7 @@ export class SASjsConfig { * will use '/SASJobExecution' on SAS Viya. */ pathSASViya: string = '' - pathSASBase: string = '' + pathSASjs: 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