mirror of
https://github.com/sasjs/core.git
synced 2025-12-11 14:34:35 +00:00
Compare commits
22 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b73bf998da | ||
|
|
c9ad38ee98 | ||
|
|
76b1b951c0 | ||
|
|
996054b17a | ||
|
|
7fca3d4e3f | ||
|
|
c4e599c861 | ||
|
|
0f6ff2cc1e | ||
|
|
7cac4c71fb | ||
|
|
1322bdab92 | ||
|
|
f201df606a | ||
|
|
a56fce86b1 | ||
|
|
41ccc5fdd9 | ||
|
|
b2877bd493 | ||
|
|
df8f8893e7 | ||
|
|
27fbdf193b | ||
|
|
6ae892989d | ||
|
|
39a7b332da | ||
|
|
c81794b542 | ||
|
|
e456da846a | ||
|
|
5c144be05b | ||
|
|
055669c133 | ||
|
|
4b67e13b24 |
18
.git-hooks/commit-msg
Executable file
18
.git-hooks/commit-msg
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
RED="\033[1;31m"
|
||||
GREEN="\033[1;32m"
|
||||
|
||||
# Get the commit message (the parameter we're given is just the path to the
|
||||
# temporary file which holds the message).
|
||||
commit_message=$(cat "$1")
|
||||
|
||||
if (echo "$commit_message" | grep -Eq "^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([a-z \-]+\))?!?: .+$") then
|
||||
echo "${GREEN} ✔ Commit message meets Conventional Commit standards"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "${RED}❌ Commit message does not meet the Conventional Commit standard!"
|
||||
echo "An example of a valid message is:"
|
||||
echo " feat(login): add the 'remember me' button"
|
||||
echo "ℹ More details at: https://www.conventionalcommits.org/en/v1.0.0/#summary"
|
||||
exit 1
|
||||
2
.git-hooks/pre-commit
Executable file
2
.git-hooks/pre-commit
Executable file
@@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
sasjs lint
|
||||
59
.github/workflows/run-tests.yml
vendored
Normal file
59
.github/workflows/run-tests.yml
vendored
Normal file
@@ -0,0 +1,59 @@
|
||||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
|
||||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
|
||||
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [12.x]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- name: Install Doxygen
|
||||
run: sudo apt-get install doxygen
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Check code style
|
||||
run: npm run lint
|
||||
|
||||
- name: Add client
|
||||
run: echo "CLIENT=${{secrets.CLIENT}}"> .env.viya
|
||||
|
||||
- name: Add secret
|
||||
run: echo "SECRET=${{secrets.SECRET}}" >> .env.viya
|
||||
|
||||
- name: Add access token
|
||||
run: echo "ACCESS_TOKEN=${{secrets.ACCESS_TOKEN}}" >> .env.viya
|
||||
|
||||
- name: Add refresh token
|
||||
run: echo "REFRESH_TOKEN=${{secrets.REFRESH_TOKEN}}" >> .env.viya
|
||||
|
||||
- name: Build Project
|
||||
run: npm run build
|
||||
|
||||
- name: Run SASjs tests
|
||||
run: npm run test
|
||||
env:
|
||||
CI: true
|
||||
CLIENT: ${{secrets.CLIENT}}
|
||||
SECRET: ${{secrets.SECRET}}
|
||||
SAS_USERNAME: ${{secrets.SAS_USERNAME}}
|
||||
SAS_PASSWORD: ${{secrets.SAS_PASSWORD}}
|
||||
SERVER_URL: ${{secrets.SERVER_URL}}
|
||||
SERVER_TYPE: ${{secrets.SERVER_TYPE}}
|
||||
ACCESS_TOKEN: ${{secrets.ACCESS_TOKEN}}
|
||||
REFRESH_TOKEN: ${{secrets.REFRESH_TOKEN}}
|
||||
@@ -3,8 +3,9 @@ build.py
|
||||
.gitpod*
|
||||
tests/
|
||||
sasjs/
|
||||
.vscode/
|
||||
.github/
|
||||
.git-hooks/
|
||||
.vscode/
|
||||
main.dox
|
||||
make_singlefile.sh
|
||||
*.md
|
||||
|
||||
33
README.md
33
README.md
@@ -1,9 +1,25 @@
|
||||
 [](/package.json)   
|
||||
|
||||
[](/LICENSE)  [](https://gitpod.io/#https://github.com/sasjs/core)
|
||||
|
||||
|
||||
# Macro Core
|
||||
[![npm package][npm-image]][npm-url]
|
||||
[![Github Workflow][githubworkflow-image]][githubworkflow-url]
|
||||
[![Dependency Status][dependency-image]][dependency-url]
|
||||
[]()
|
||||

|
||||
[](/LICENSE)
|
||||

|
||||
[](https://github.com/sasjs/core/issues?q=is%3Aissue+is%3Aclosed)
|
||||
[](https://github.com/sasjs/core/issues)
|
||||

|
||||
[](https://gitpod.io/#https://github.com/sasjs/core)
|
||||
|
||||
|
||||
[npm-image]:https://img.shields.io/npm/v/@sasjs/core.svg
|
||||
[npm-url]:http://npmjs.org/package/@sasjs/core
|
||||
[githubworkflow-image]:https://github.com/sasjs/core/actions/workflows/main.yml/badge.svg
|
||||
[githubworkflow-url]:https://github.com/sasjs/core/blob/main/.github/workflows/main.yml
|
||||
[dependency-image]:https://david-dm.org/sasjs/core.svg
|
||||
[dependency-url]:https://github.com/sasjs/core/blob/main/package.json
|
||||
|
||||
|
||||
|
||||
Much quality. Many standards. The **Macro Core** library exists to save time and development effort! Herein ye shall find a veritable host of MIT-licenced, production quality SAS macros. These are a mix of tools, utilities, functions and code generators that are useful in the context of [Application Development](https://sasapps.io) on the SAS platform (eg https://datacontroller.io). [Contributions](https://github.com/sasjs/core/blob/main/CONTRIBUTING.md) are welcomed.
|
||||
|
||||
@@ -157,6 +173,9 @@ When contributing to this library, it is therefore important to ensure that all
|
||||
|
||||
## Star Gazing
|
||||
|
||||
If you find this library useful, help us grow our star graph!
|
||||
If you find this library useful, please leave a [star](https://github.com/sasjs/core/stargazers) and help us grow our star graph!
|
||||
|
||||

|
||||
|
||||
|
||||
|
||||

|
||||
18
SECURITY.md
Normal file
18
SECURITY.md
Normal file
@@ -0,0 +1,18 @@
|
||||
# Security Policy
|
||||
|
||||
Security is an extremely high priority when it comes to the SASjs product suite. We take a number of steps across all repositories to minimise risk, such as:
|
||||
|
||||
* Regular dependabot updates
|
||||
* Snyk reports
|
||||
* Minimising dependencies, especially production dependencies (sasjs/core has NONE)
|
||||
* Testing & Code review process
|
||||
|
||||
## Supported Versions
|
||||
|
||||
We support only the latest version
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
We welcome disclosures of all kinds in relation to all the SASjs libraries. You can submit them here: [https://sasapps.io/contact-us](https://sasapps.io/contact-us)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
Usage:
|
||||
|
||||
%mm_getusers()
|
||||
%mm_getusers()
|
||||
|
||||
@param outds the dataset to create that contains the list of libraries
|
||||
|
||||
@@ -68,4 +68,4 @@ filename sxlemap clear;
|
||||
filename response clear;
|
||||
libname _XML_ clear;
|
||||
|
||||
%mend;
|
||||
%mend mm_getusers;
|
||||
|
||||
@@ -26,7 +26,8 @@
|
||||
@param action Either FETCH, OPEN, ARR, OBJ or CLOSE
|
||||
@param ds The dataset to send back to the frontend
|
||||
@param dslabel= value to use instead of the real name for sending to JSON
|
||||
@param fmt= set to N to send back unformatted values
|
||||
@param fmt=(Y) Set to N to send back unformatted values
|
||||
@param fref=(_webout) The fileref to which to write the JSON
|
||||
|
||||
@version 9.3
|
||||
@author Allan Bowe
|
||||
@@ -91,7 +92,7 @@
|
||||
%end;
|
||||
|
||||
%else %if &action=ARR or &action=OBJ %then %do;
|
||||
%mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt
|
||||
%mp_jsonout(&action,&ds,dslabel=&dslabel,fmt=&fmt,jref=&fref
|
||||
,engine=DATASTEP,dbg=%str(&_debug)
|
||||
)
|
||||
%end;
|
||||
@@ -150,6 +151,8 @@
|
||||
put ",""SYSHOSTNAME"" : ""&syshostname"" ";
|
||||
put ",""SYSJOBID"" : ""&sysjobid"" ";
|
||||
put ",""SYSSITE"" : ""&syssite"" ";
|
||||
sysvlong=quote(trim(symget('sysvlong')));
|
||||
put ',"SYSVLONG" : ' sysvlong;
|
||||
put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" ";
|
||||
put ',"END_DTTM" : "' "%sysfunc(datetime(),datetime20.3)" '" ';
|
||||
put "}" @;
|
||||
@@ -159,4 +162,4 @@
|
||||
run;
|
||||
%end;
|
||||
|
||||
%mend;
|
||||
%mend mm_webout;
|
||||
|
||||
146
package-lock.json
generated
146
package-lock.json
generated
@@ -4,9 +4,9 @@
|
||||
"lockfileVersion": 1,
|
||||
"dependencies": {
|
||||
"@sasjs/adapter": {
|
||||
"version": "2.2.18",
|
||||
"resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-2.2.18.tgz",
|
||||
"integrity": "sha512-Em4cojWXK07ePhR3ovHEwSl2zTWRjJQfeR/2k/iL8uQ7uFSsknKgE9095+MaYDhwseN+heDEMoU8+Q8QB8qU1A==",
|
||||
"version": "2.2.19",
|
||||
"resolved": "https://registry.npmjs.org/@sasjs/adapter/-/adapter-2.2.19.tgz",
|
||||
"integrity": "sha512-M5G9V7GmhNmUOCEEiiPq8WeR9BTcvE1fmyEKFQDfJYuuJF7fG0OC+bZjZ/++qWkW8r3IFteu5y+Id9KswxkNCw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@sasjs/utils": "^2.10.2",
|
||||
@@ -16,13 +16,13 @@
|
||||
}
|
||||
},
|
||||
"@sasjs/cli": {
|
||||
"version": "2.19.3",
|
||||
"resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-2.19.3.tgz",
|
||||
"integrity": "sha512-H5CmYVHqHqa2jhNW0xKIzUvZcAHomOg20AHUSETrccVdVALAsEschICnhz5PwD2ebga8UzWhwqHhGnBPjYy18A==",
|
||||
"version": "2.22.2",
|
||||
"resolved": "https://registry.npmjs.org/@sasjs/cli/-/cli-2.22.2.tgz",
|
||||
"integrity": "sha512-FdQUWVJ0bAj1HOwfMtChMD8v9I0r49BBcYarJ4lSMMbFWwvVgnUmuD2s5sf6quKdyPP12XM06kz3gMYO++NlPg==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@sasjs/adapter": "2.2.18",
|
||||
"@sasjs/core": "2.26.0",
|
||||
"@sasjs/adapter": "2.2.19",
|
||||
"@sasjs/core": "^2.30.6",
|
||||
"@sasjs/lint": "1.8.0",
|
||||
"@sasjs/utils": "2.12.1",
|
||||
"@types/url-parse": "1.4.3",
|
||||
@@ -47,9 +47,9 @@
|
||||
}
|
||||
},
|
||||
"@sasjs/core": {
|
||||
"version": "2.26.0",
|
||||
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-2.26.0.tgz",
|
||||
"integrity": "sha512-CTuRksG9XSKY5nkBB+Z7Fd4pR606ZzZaPw8IcKFtJp0csPZjLEDrc/qQ91jeB6znRbMjF7/WY+JtK/Sg5ZnEDg==",
|
||||
"version": "2.30.6",
|
||||
"resolved": "https://registry.npmjs.org/@sasjs/core/-/core-2.30.6.tgz",
|
||||
"integrity": "sha512-OqXEGQ58Ex/6O3OHx9IVcxPAkP17H9NpX6L1/ccAKQ3alBeLKf6xXayUSuM7NtgxumxA9rKYf5R7Ijnfn4H2ow==",
|
||||
"dev": true
|
||||
},
|
||||
"@sasjs/lint": {
|
||||
@@ -82,9 +82,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"@types/prompts": {
|
||||
"version": "2.0.11",
|
||||
"resolved": "https://registry.npmjs.org/@types/prompts/-/prompts-2.0.11.tgz",
|
||||
"integrity": "sha512-dcF5L3rU9VfpLEJIV++FEyhGhuIpJllNEwllVuJ5g8eoVqjf048tW9+spivIwjzgPbtaGAl7mIZW3cmhDAq2UQ==",
|
||||
"version": "2.0.12",
|
||||
"resolved": "https://registry.npmjs.org/@types/prompts/-/prompts-2.0.12.tgz",
|
||||
"integrity": "sha512-Hr6osqfNg3IcQT3pJDXCsSnb0KnldY/hXeJCKJriwbZLnedN9n1e8kcZwLc25GIWULDb6h5aEyOBbf33XpZBXQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "*"
|
||||
@@ -309,14 +309,6 @@
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"colors": "1.0.3"
|
||||
},
|
||||
"dependencies": {
|
||||
"colors": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
|
||||
"integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"clone": {
|
||||
@@ -341,9 +333,9 @@
|
||||
"dev": true
|
||||
},
|
||||
"colors": {
|
||||
"version": "0.6.2",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-0.6.2.tgz",
|
||||
"integrity": "sha1-JCP+ZnisDF2uiFLl0OW+CMmXq8w=",
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/colors/-/colors-1.0.3.tgz",
|
||||
"integrity": "sha1-BDP0TYCWgP3rYO0mDxsMJi6CpAs=",
|
||||
"dev": true
|
||||
},
|
||||
"combined-stream": {
|
||||
@@ -355,12 +347,6 @@
|
||||
"delayed-stream": "~1.0.0"
|
||||
}
|
||||
},
|
||||
"commander": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz",
|
||||
"integrity": "sha1-0SG7roYNmZKj1Re6lvVliOR8Z4E=",
|
||||
"dev": true
|
||||
},
|
||||
"concat-map": {
|
||||
"version": "0.0.1",
|
||||
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
|
||||
@@ -573,16 +559,6 @@
|
||||
"traverse-chain": "~0.1.0"
|
||||
}
|
||||
},
|
||||
"findup": {
|
||||
"version": "0.1.5",
|
||||
"resolved": "https://registry.npmjs.org/findup/-/findup-0.1.5.tgz",
|
||||
"integrity": "sha1-itkpozk7rGJ5V6fl3kYjsGsOLOs=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"colors": "~0.6.0-1",
|
||||
"commander": "~2.1.0"
|
||||
}
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.14.1",
|
||||
"resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz",
|
||||
@@ -654,20 +630,6 @@
|
||||
"assert-plus": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"ghooks": {
|
||||
"version": "2.0.4",
|
||||
"resolved": "https://registry.npmjs.org/ghooks/-/ghooks-2.0.4.tgz",
|
||||
"integrity": "sha1-/VDgQP9UiQauQstReToBv+JFZ7k=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"findup": "0.1.5",
|
||||
"lodash.clone": "4.5.0",
|
||||
"manage-path": "2.0.0",
|
||||
"opt-cli": "1.5.1",
|
||||
"path-exists": "3.0.0",
|
||||
"spawn-command": "0.0.2"
|
||||
}
|
||||
},
|
||||
"glob": {
|
||||
"version": "7.1.7",
|
||||
"resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz",
|
||||
@@ -712,12 +674,6 @@
|
||||
"integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==",
|
||||
"dev": true
|
||||
},
|
||||
"graceful-readlink": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
|
||||
"integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=",
|
||||
"dev": true
|
||||
},
|
||||
"har-schema": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz",
|
||||
@@ -986,18 +942,6 @@
|
||||
"integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==",
|
||||
"dev": true
|
||||
},
|
||||
"lodash._baseclone": {
|
||||
"version": "4.5.7",
|
||||
"resolved": "https://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-4.5.7.tgz",
|
||||
"integrity": "sha1-zkKt4IOE711i+nfDD2GkbmhvhDQ=",
|
||||
"dev": true
|
||||
},
|
||||
"lodash.clone": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.5.0.tgz",
|
||||
"integrity": "sha1-GVhwRQ9aExkkeN9Lw9I9LeoZB7Y=",
|
||||
"dev": true
|
||||
},
|
||||
"lodash.groupby": {
|
||||
"version": "4.6.0",
|
||||
"resolved": "https://registry.npmjs.org/lodash.groupby/-/lodash.groupby-4.6.0.tgz",
|
||||
@@ -1020,12 +964,6 @@
|
||||
"is-unicode-supported": "^0.1.0"
|
||||
}
|
||||
},
|
||||
"manage-path": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/manage-path/-/manage-path-2.0.0.tgz",
|
||||
"integrity": "sha1-9M+EV7km7u4qg7FzUBQUvHbrlZc=",
|
||||
"dev": true
|
||||
},
|
||||
"mime-db": {
|
||||
"version": "1.47.0",
|
||||
"resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.47.0.tgz",
|
||||
@@ -1092,44 +1030,6 @@
|
||||
"mimic-fn": "^2.1.0"
|
||||
}
|
||||
},
|
||||
"opt-cli": {
|
||||
"version": "1.5.1",
|
||||
"resolved": "https://registry.npmjs.org/opt-cli/-/opt-cli-1.5.1.tgz",
|
||||
"integrity": "sha1-BNtEexPJa5kusxaFJm9O0NlzbcI=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "2.9.0",
|
||||
"lodash.clone": "4.3.2",
|
||||
"manage-path": "2.0.0",
|
||||
"spawn-command": "0.0.2-1"
|
||||
},
|
||||
"dependencies": {
|
||||
"commander": {
|
||||
"version": "2.9.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
|
||||
"integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"graceful-readlink": ">= 1.0.0"
|
||||
}
|
||||
},
|
||||
"lodash.clone": {
|
||||
"version": "4.3.2",
|
||||
"resolved": "https://registry.npmjs.org/lodash.clone/-/lodash.clone-4.3.2.tgz",
|
||||
"integrity": "sha1-5WsXa2gjp93jj38r9Y3n1ZcSAOk=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"lodash._baseclone": "~4.5.0"
|
||||
}
|
||||
},
|
||||
"spawn-command": {
|
||||
"version": "0.0.2-1",
|
||||
"resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2-1.tgz",
|
||||
"integrity": "sha1-YvXpRmmBwbeW3Fkpk34RycaSG9A=",
|
||||
"dev": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"optionator": {
|
||||
"version": "0.8.3",
|
||||
"resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz",
|
||||
@@ -1173,12 +1073,6 @@
|
||||
"integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==",
|
||||
"dev": true
|
||||
},
|
||||
"path-exists": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz",
|
||||
"integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=",
|
||||
"dev": true
|
||||
},
|
||||
"path-is-absolute": {
|
||||
"version": "1.0.1",
|
||||
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
|
||||
@@ -1436,12 +1330,6 @@
|
||||
"dev": true,
|
||||
"optional": true
|
||||
},
|
||||
"spawn-command": {
|
||||
"version": "0.0.2",
|
||||
"resolved": "https://registry.npmjs.org/spawn-command/-/spawn-command-0.0.2.tgz",
|
||||
"integrity": "sha1-lUThpDygRfhTGqwaSMspva5iM44=",
|
||||
"dev": true
|
||||
},
|
||||
"sshpk": {
|
||||
"version": "1.16.1",
|
||||
"resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz",
|
||||
|
||||
@@ -26,12 +26,14 @@
|
||||
"homepage": "https://core.sasjs.io",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "sasjs cbd -t viya",
|
||||
"docs": "sasjs doc && ./sasjs/utils/build.sh",
|
||||
"test": "sasjs test -t viya",
|
||||
"docs": "sasjs doc && ./sasjs/utils/build.sh"
|
||||
"lint": "sasjs lint",
|
||||
"postinstall": "[ -d .git ] && git config core.hooksPath ./.git-hooks || true"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sasjs/cli": "^2.19.3",
|
||||
"ghooks": "^2.0.4"
|
||||
"@sasjs/cli": "^2.22.2"
|
||||
},
|
||||
"config": {
|
||||
"ghooks": {
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
"meta",
|
||||
"metax",
|
||||
"viya",
|
||||
"lua"
|
||||
"lua",
|
||||
"tests/base"
|
||||
],
|
||||
"docConfig": {
|
||||
"displayMacroCore": false,
|
||||
@@ -16,6 +17,13 @@
|
||||
"readMe": "../../README.md"
|
||||
}
|
||||
},
|
||||
"testConfig": {
|
||||
"initProgram": "tests/testinit.sas",
|
||||
"termProgram": "tests/testterm.sas",
|
||||
"macroVars": {
|
||||
"mcTestAppLoc": "/Public/temp/macrocore"
|
||||
}
|
||||
},
|
||||
"defaultTarget": "viya",
|
||||
"targets": [
|
||||
{
|
||||
@@ -27,22 +35,18 @@
|
||||
"deployServicePack": true
|
||||
},
|
||||
"macroFolders": [
|
||||
"base",
|
||||
"meta",
|
||||
"metax",
|
||||
"viya",
|
||||
"lua",
|
||||
"tests/base",
|
||||
"tests/viya"
|
||||
],
|
||||
"contextName": "SAS Job Execution compute context",
|
||||
"testConfig": {
|
||||
"initProgram": "tests/testinit.sas",
|
||||
"termProgram": "tests/testterm.sas",
|
||||
"macroVars": {
|
||||
"mcTestAppLoc": "/Public/temp/macrocore"
|
||||
}
|
||||
}
|
||||
"contextName": "SAS Job Execution compute context"
|
||||
},
|
||||
{
|
||||
"name": "sas9",
|
||||
"serverUrl": "https://sas.analytium.co.uk:8343",
|
||||
"serverType": "SAS9",
|
||||
"appLoc": "/Shared Data/temp/macrocore",
|
||||
"macroFolders": [
|
||||
"tests/meta"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
35
tests/meta/mm_webout.test.sas
Normal file
35
tests/meta/mm_webout.test.sas
Normal file
@@ -0,0 +1,35 @@
|
||||
/**
|
||||
@file
|
||||
@brief Testing mm_webout macro
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mf_getuniquefileref.sas
|
||||
@li mm_webout.sas
|
||||
@li mp_assert.sas
|
||||
|
||||
**/
|
||||
|
||||
|
||||
%let fref=%mf_getuniquefileref();
|
||||
%global _metaperson;
|
||||
data some datasets;
|
||||
x=1;
|
||||
run;
|
||||
%mm_webout(OPEN,fref=&fref)
|
||||
%mm_webout(ARR,some,fref=&fref)
|
||||
%mm_webout(OBJ,datasets,fref=&fref)
|
||||
%mm_webout(CLOSE,fref=&fref)
|
||||
|
||||
libname test JSON (&fref);
|
||||
data root;
|
||||
set test.root;
|
||||
call symputx('checkval',sysvlong);
|
||||
run;
|
||||
data alldata;
|
||||
set test.alldata;
|
||||
run;
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(%str(&checkval)=%str(&sysvlong)),
|
||||
desc=Check if the sysvlong value was created
|
||||
)
|
||||
41
tests/viya/mv_webout.test.sas
Normal file
41
tests/viya/mv_webout.test.sas
Normal file
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
@file
|
||||
@brief Testing mm_webout macro
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mf_getuniquefileref.sas
|
||||
@li mv_webout.sas
|
||||
@li mp_assert.sas
|
||||
|
||||
**/
|
||||
|
||||
|
||||
%let fref=%mf_getuniquefileref();
|
||||
%global _metaperson;
|
||||
data some datasets;
|
||||
x=1;
|
||||
run;
|
||||
%mv_webout(OPEN,fref=&fref,stream=N)
|
||||
%mv_webout(ARR,some,fref=&fref,stream=N)
|
||||
%mv_webout(OBJ,datasets,fref=&fref,stream=N)
|
||||
%mv_webout(CLOSE,fref=&fref,stream=N)
|
||||
|
||||
data _null_;
|
||||
infile &fref;
|
||||
input;
|
||||
putlog _infile_;
|
||||
run;
|
||||
|
||||
libname test JSON (&fref);
|
||||
data root;
|
||||
set test.root;
|
||||
call symputx('checkval',sysvlong);
|
||||
run;
|
||||
data alldata;
|
||||
set test.alldata;
|
||||
run;
|
||||
|
||||
%mp_assert(
|
||||
iftrue=(%str(&checkval)=%str(&sysvlong)),
|
||||
desc=Check if the sysvlong value was created
|
||||
)
|
||||
@@ -23,9 +23,10 @@
|
||||
@param action Either OPEN, ARR, OBJ or CLOSE
|
||||
@param ds The dataset to send back to the frontend
|
||||
@param _webout= fileref for returning the json
|
||||
@param fref= temp fref
|
||||
@param fref=(_mvwtemp) Temp fileref to which to write the output
|
||||
@param dslabel= value to use instead of the real name for sending to JSON
|
||||
@param fmt= change to N to strip formats from output
|
||||
@param fmt=(Y) change to N to strip formats from output
|
||||
@param stream=(Y) Change to N if not streaming to _webout
|
||||
|
||||
<h4> SAS Macros </h4>
|
||||
@li mp_jsonout.sas
|
||||
@@ -35,7 +36,7 @@
|
||||
@author Allan Bowe, source: https://github.com/sasjs/core
|
||||
|
||||
**/
|
||||
%macro mv_webout(action,ds,fref=_mvwtemp,dslabel=,fmt=Y);
|
||||
%macro mv_webout(action,ds,fref=_mvwtemp,dslabel=,fmt=Y,stream=Y);
|
||||
%global _webin_file_count _webin_fileuri _debug _omittextlog _webin_name
|
||||
sasjs_tables SYS_JES_JOB_URI;
|
||||
%if %index("&_debug",log) %then %let _debug=131;
|
||||
@@ -214,14 +215,16 @@
|
||||
put ",""SYSERRORTEXT"" : ""&syserrortext"" ";
|
||||
put ",""SYSHOSTNAME"" : ""&syshostname"" ";
|
||||
put ",""SYSSITE"" : ""&syssite"" ";
|
||||
sysvlong=quote(trim(symget('sysvlong')));
|
||||
put ',"SYSVLONG" : ' sysvlong;
|
||||
put ",""SYSWARNINGTEXT"" : ""&syswarningtext"" ";
|
||||
put ',"END_DTTM" : "' "%sysfunc(datetime(),datetime20.3)" '" ';
|
||||
put "}";
|
||||
|
||||
%if %upcase(&fref) ne _WEBOUT %then %do;
|
||||
%if %upcase(&fref) ne _WEBOUT and &stream=Y %then %do;
|
||||
data _null_; rc=fcopy("&fref","_webout");run;
|
||||
%end;
|
||||
|
||||
%end;
|
||||
|
||||
%mend;
|
||||
%mend mv_webout;
|
||||
|
||||
Reference in New Issue
Block a user