1
0
mirror of https://github.com/sasjs/server.git synced 2025-12-11 19:44:35 +00:00

Compare commits

..

7 Commits

Author SHA1 Message Date
semantic-release-bot
6b666d5554 chore(release): 0.27.0 [skip ci]
# [0.27.0](https://github.com/sasjs/server/compare/v0.26.2...v0.27.0) (2022-11-17)

### Features

* on startup add webout.sas file in sasautos folder ([200f6c5](200f6c596a))
2022-11-17 13:21:44 +00:00
Allan Bowe
b5f0911858 Merge pull request #321 from sasjs/issue-318
feat: on startup add webout.sas file in sasautos folder
2022-11-17 13:17:35 +00:00
b86ba5b8a3 chore: lint fix 2022-11-17 17:49:00 +05:00
200f6c596a feat: on startup add webout.sas file in sasautos folder 2022-11-17 17:03:23 +05:00
semantic-release-bot
1b7ccda6e9 chore(release): 0.26.2 [skip ci]
## [0.26.2](https://github.com/sasjs/server/compare/v0.26.1...v0.26.2) (2022-11-15)

### Bug Fixes

* comments ([7ae862c](7ae862c5ce))
2022-11-15 13:06:36 +00:00
Allan Bowe
532035d835 Merge pull request #317 from sasjs/docfix
fix: comments
2022-11-15 13:01:45 +00:00
Allan Bowe
7ae862c5ce fix: comments 2022-11-15 13:01:13 +00:00
7 changed files with 56 additions and 13 deletions

View File

@@ -1,3 +1,17 @@
# [0.27.0](https://github.com/sasjs/server/compare/v0.26.2...v0.27.0) (2022-11-17)
### Features
* on startup add webout.sas file in sasautos folder ([200f6c5](https://github.com/sasjs/server/commit/200f6c596a6e732d799ed408f1f0fd92f216ba58))
## [0.26.2](https://github.com/sasjs/server/compare/v0.26.1...v0.26.2) (2022-11-15)
### Bug Fixes
* comments ([7ae862c](https://github.com/sasjs/server/commit/7ae862c5ce720e9483d4728f4295dede4f849436))
## [0.26.1](https://github.com/sasjs/server/compare/v0.26.0...v0.26.1) (2022-11-15) ## [0.26.1](https://github.com/sasjs/server/compare/v0.26.0...v0.26.1) (2022-11-15)

View File

@@ -689,12 +689,8 @@ paths:
$ref: '#/components/schemas/ClientPayload' $ref: '#/components/schemas/ClientPayload'
examples: examples:
'Example 1': 'Example 1':
value: {clientId: someFormattedClientID1234, clientSecret: someRandomCryptoString}
'Example 2':
value: {clientId: someFormattedClientID1234, clientSecret: someRandomCryptoString, accessTokenExpiration: 86400} value: {clientId: someFormattedClientID1234, clientSecret: someRandomCryptoString, accessTokenExpiration: 86400}
'Example 3': summary: "Admin only task. Create client with the following attributes:\nClientId,\nClientSecret,\naccessTokenExpiration (optional),\nrefreshTokenExpiration (optional)"
value: {clientId: someFormattedClientID1234, clientSecret: someRandomCryptoString, accessTokenExpiration: 86400}
summary: "Admin only task. Create client with the following attributes:\nClientId,\nClientSecret,\naccessTokenExpiryDays (optional),\nrefreshTokenExpiryDays (optional)"
tags: tags:
- Client - Client
security: security:

View File

@@ -5,12 +5,16 @@ import dotenv from 'dotenv'
import { import {
copySASjsCore, copySASjsCore,
createWeboutSasFile,
getFilesFolder,
getPackagesFolder,
getWebBuildFolder, getWebBuildFolder,
instantiateLogger, instantiateLogger,
loadAppStreamConfig, loadAppStreamConfig,
ReturnCode, ReturnCode,
setProcessVariables, setProcessVariables,
setupFolders, setupFilesFolder,
setupPackagesFolder,
setupUserAutoExec, setupUserAutoExec,
verifyEnvVariables verifyEnvVariables
} from './utils' } from './utils'
@@ -20,6 +24,7 @@ import {
configureLogger, configureLogger,
configureSecurity configureSecurity
} from './app-modules' } from './app-modules'
import { folderExists } from '@sasjs/utils'
dotenv.config() dotenv.config()
@@ -65,9 +70,18 @@ export default setProcessVariables().then(async () => {
await setupUserAutoExec() await setupUserAutoExec()
if (process.driveLoc === path.join(process.sasjsRoot, 'drive')) { if (!(await folderExists(getFilesFolder()))) await setupFilesFolder()
await setupFolders()
if (!(await folderExists(getPackagesFolder()))) await setupPackagesFolder()
const sasautosPath = path.join(process.driveLoc, 'sas', 'sasautos')
if (await folderExists(sasautosPath)) {
console.log(
`SASAUTOS was not refreshed. To force a refresh, delete the ${sasautosPath} folder`
)
} else {
await copySASjsCore() await copySASjsCore()
await createWeboutSasFile()
} }
// loading these modules after setting up variables due to // loading these modules after setting up variables due to

View File

@@ -13,8 +13,8 @@ export class ClientController {
* @summary Admin only task. Create client with the following attributes: * @summary Admin only task. Create client with the following attributes:
* ClientId, * ClientId,
* ClientSecret, * ClientSecret,
* accessTokenExpiryDays (optional), * accessTokenExpiration (optional),
* refreshTokenExpiryDays (optional) * refreshTokenExpiration (optional)
* *
*/ */
@Example<ClientPayload>({ @Example<ClientPayload>({

View File

@@ -0,0 +1,18 @@
import path from 'path'
import { createFile } from '@sasjs/utils'
import { getMacrosFolder } from './file'
const fileContent = `%macro webout(action,ds,dslabel=,fmt=,missing=NULL,showmeta=NO,maxobs=MAX);
%ms_webout(&action,ds=&ds,dslabel=&dslabel,fmt=&fmt
,missing=&missing
,showmeta=&showmeta
,maxobs=&maxobs
)
%mend;`
export const createWeboutSasFile = async () => {
const macrosDrivePath = getMacrosFolder()
console.log(`Creating webout.sas at ${macrosDrivePath}`)
const filePath = path.join(macrosDrivePath, 'webout.sas')
await createFile(filePath, fileContent)
}

View File

@@ -1,6 +1,7 @@
export * from './appStreamConfig' export * from './appStreamConfig'
export * from './connectDB' export * from './connectDB'
export * from './copySASjsCore' export * from './copySASjsCore'
export * from './createWeboutSasFile'
export * from './desktopAutoExec' export * from './desktopAutoExec'
export * from './extractHeaders' export * from './extractHeaders'
export * from './extractName' export * from './extractName'

View File

@@ -1,7 +1,7 @@
import { createFolder } from '@sasjs/utils' import { createFolder } from '@sasjs/utils'
import { getFilesFolder, getPackagesFolder } from './file' import { getFilesFolder, getPackagesFolder } from './file'
export const setupFolders = async () => { export const setupFilesFolder = async () => await createFolder(getFilesFolder())
await createFolder(getFilesFolder())
export const setupPackagesFolder = async () =>
await createFolder(getPackagesFolder()) await createFolder(getPackagesFolder())
}