1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-09 13:30:04 +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' } from './types'
import { SASViyaApiClient } from './SASViyaApiClient' import { SASViyaApiClient } from './SASViyaApiClient'
import { SAS9ApiClient } from './SAS9ApiClient' import { SAS9ApiClient } from './SAS9ApiClient'
import { SASBaseApiClient } from './SASBaseApiClient' import { SASjsApiClient } from './SASjsApiClient'
import { AuthManager } from './auth' import { AuthManager } from './auth'
import { import {
ServerType, ServerType,
@@ -33,7 +33,7 @@ import { LoginOptions, LoginResult } from './types/Login'
const defaultConfig: SASjsConfig = { const defaultConfig: SASjsConfig = {
serverUrl: '', serverUrl: '',
pathSASBase: '', pathSASjs: '',
pathSAS9: '/SASStoredProcess/do', pathSAS9: '/SASStoredProcess/do',
pathSASViya: '/SASJobExecution', pathSASViya: '/SASJobExecution',
appLoc: '/Public/seedapp', appLoc: '/Public/seedapp',
@@ -54,7 +54,7 @@ export default class SASjs {
private jobsPath: string = '' private jobsPath: string = ''
private sasViyaApiClient: SASViyaApiClient | null = null private sasViyaApiClient: SASViyaApiClient | null = null
private sas9ApiClient: SAS9ApiClient | null = null private sas9ApiClient: SAS9ApiClient | null = null
private sasBaseApiClient: SASBaseApiClient | null = null private SASjsApiClient: SASjsApiClient | null = null
private fileUploader: FileUploader | null = null private fileUploader: FileUploader | null = null
private authManager: AuthManager | null = null private authManager: AuthManager | null = null
private requestClient: RequestClient | null = null private requestClient: RequestClient | null = null
@@ -830,12 +830,15 @@ export default class SASjs {
) )
} }
public async deployToSASBase(members: [FolderMember, ServiceMember]) { public async deployToSASjs(members: [FolderMember, ServiceMember]) {
return await this.sasBaseApiClient?.deploy(members) return await this.SASjsApiClient?.deploy(
members,
this.sasjsConfig.appLoc
)
} }
public async executeJobSASBase(query: ExecutionQuery) { public async executeJobSASjs(query: ExecutionQuery) {
return await this.sasBaseApiClient?.executeJob(query) return await this.SASjsApiClient?.executeJob(query)
} }
/** /**
@@ -1017,10 +1020,10 @@ export default class SASjs {
} }
if (this.sasjsConfig.serverType === ServerType.Sasjs) { if (this.sasjsConfig.serverType === ServerType.Sasjs) {
if (this.sasBaseApiClient) { if (this.SASjsApiClient) {
this.sasBaseApiClient.setConfig(this.sasjsConfig.serverUrl) this.SASjsApiClient.setConfig(this.sasjsConfig.serverUrl)
} else { } else {
this.sasBaseApiClient = new SASBaseApiClient( this.SASjsApiClient = new SASjsApiClient(
this.sasjsConfig.serverUrl, this.sasjsConfig.serverUrl,
this.requestClient this.requestClient
) )

View File

@@ -1,7 +1,7 @@
import { FolderMember, ServiceMember, ExecutionQuery } from './types' import { FolderMember, ServiceMember, ExecutionQuery } from './types'
import { RequestClient } from './request/RequestClient' import { RequestClient } from './request/RequestClient'
export class SASBaseApiClient { export class SASjsApiClient {
constructor( constructor(
private serverUrl: string, private serverUrl: string,
private requestClient: RequestClient private requestClient: RequestClient
@@ -11,12 +11,12 @@ export class SASBaseApiClient {
if (serverUrl) this.serverUrl = serverUrl 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<{ const { result } = await this.requestClient.post<{
status: string status: string
message: string message: string
example?: {} example?: {}
}>('/deploy', members, undefined) }>('/deploy', { members: members, appLoc: appLoc }, undefined)
return Promise.resolve(result) return Promise.resolve(result)
} }

View File

@@ -21,7 +21,7 @@ export class SASjsConfig {
* will use '/SASJobExecution' on SAS Viya. * will use '/SASJobExecution' on SAS Viya.
*/ */
pathSASViya: string = '' pathSASViya: string = ''
pathSASBase: string = '' pathSASjs: string = ''
/** /**
* The appLoc is the parent folder under which the SAS services (STPs or Job * 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 * Execution Services) are stored. We recommend that each app is stored in