1
0
mirror of https://github.com/sasjs/adapter.git synced 2025-12-11 01:14:36 +00:00

chore: change 'SASBase' to 'SASjs'

This commit is contained in:
Yury Shkoda
2021-10-20 15:00:52 +03:00
parent 8dce9f3e48
commit 397bc4524f
3 changed files with 17 additions and 14 deletions

View File

@@ -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
)

View File

@@ -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)
}

View File

@@ -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