@sassoftware/viya-serverjs 0.1.2 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.babelrc +6 -0
- package/.dockerignore +2 -0
- package/.env +29 -0
- package/.env.proxy +31 -0
- package/.env.server +29 -0
- package/.eslintignore +4 -0
- package/.eslintrc.json +42 -0
- package/Dockerfile +44 -0
- package/README.md +6 -4
- package/cli.js +9 -0
- package/images/viya-apiserverjs.png +0 -0
- package/lib/{core/config.js → config.js} +6 -25
- package/lib/handlers/appCallback.js +62 -0
- package/lib/handlers/codeAuth.js +61 -0
- package/lib/{core/handlers → handlers}/decodeJwt.js +1 -1
- package/lib/handlers/favicon.js +45 -0
- package/lib/handlers/getApp.js +77 -0
- package/lib/handlers/getApp2.js +48 -0
- package/lib/handlers/getUser.js +49 -0
- package/lib/{core/handlers → handlers}/index.js +1 -1
- package/lib/handlers/keepAlive.js +99 -0
- package/lib/handlers/keepAlive2.js +33 -0
- package/lib/handlers/logon.js +43 -0
- package/lib/handlers/logout.js +88 -0
- package/lib/handlers/proxyMapUri.js +76 -0
- package/lib/handlers/proxyOnResponse.js +26 -0
- package/lib/handlers/reactDev.js +52 -0
- package/lib/handlers/setCookies.js +112 -0
- package/lib/{core/iService.js → iService.js} +45 -30
- package/lib/index.js +184 -10
- package/lib/plugins/SASauth.js +101 -0
- package/lib/plugins/appCookie.js +99 -0
- package/lib/plugins/setContext.js +56 -0
- package/lib/plugins/setDefaultRoutes.js +248 -0
- package/lib/plugins/setupAuth.js +87 -0
- package/lib/{core/plugins → plugins}/setupUserRoutes.js +21 -12
- package/lib/plugins/token.js +31 -0
- package/lib/schemes/SASTokenScheme.js +71 -0
- package/package.json +56 -14
- package/packages/core/config.js +86 -0
- package/packages/core/handlers/appCallback.js +40 -0
- package/packages/core/handlers/codeAuth.js +31 -0
- package/packages/core/handlers/decodeJwt.js +11 -0
- package/packages/core/handlers/favicon.js +24 -0
- package/packages/core/handlers/getApp.js +41 -0
- package/packages/core/handlers/getApp2.js +26 -0
- package/packages/core/handlers/getUser.js +20 -0
- package/packages/core/handlers/index.js +36 -0
- package/packages/core/handlers/keepAlive.js +54 -0
- package/packages/core/handlers/keepAlive2.js +13 -0
- package/packages/core/handlers/logon.js +24 -0
- package/packages/core/handlers/logout.js +43 -0
- package/{lib → packages}/core/handlers/proxyMapUri.js +25 -36
- package/packages/core/handlers/proxyOnResponse.js +12 -0
- package/packages/core/handlers/reactDev.js +30 -0
- package/packages/core/handlers/setCookies.js +78 -0
- package/packages/core/iService.js +369 -0
- package/packages/core/index.js +249 -0
- package/packages/core/parseDocker.js +33 -0
- package/packages/core/plugins/SASauth.js +79 -0
- package/packages/core/plugins/appCookie.js +49 -0
- package/packages/core/plugins/setContext.js +34 -0
- package/packages/core/plugins/setDefaultRoutes.js +262 -0
- package/packages/core/plugins/setupAuth.js +48 -0
- package/packages/core/plugins/setupUserRoutes.js +48 -0
- package/packages/core/plugins/token.js +10 -0
- package/packages/core/schemes/SASTokenScheme.js +43 -0
- package/packages/core/visionIndex.html +24 -0
- package/packages/examples/apitest/.env +11 -0
- package/packages/examples/apitest/.eslintrc.json +42 -0
- package/packages/examples/apitest/Dockerfile +41 -0
- package/packages/examples/apitest/api.js +88 -0
- package/packages/examples/apitest/appenv.js +6 -0
- package/packages/examples/apitest/docker-compose.yml +10 -0
- package/packages/examples/apitest/package.json +19 -0
- package/packages/examples/apitest/public/data/Cluster_SDOH1.sas +182 -0
- package/packages/examples/apitest/public/data/Cluster_SDOH6.sas +180 -0
- package/packages/examples/apitest/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/apitest/public/data/NeuralNetwork_High_med.sas +2409 -0
- package/packages/examples/apitest/public/data/NeuralNetwork_high_med1.sas +2409 -0
- package/packages/examples/apitest/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/apitest/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/apitest/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/apitest/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/apitest/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/apitest/public/data/cars.csv +429 -0
- package/packages/examples/apitest/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/apitest/public/data/cmdList.txt +15 -0
- package/packages/examples/apitest/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/apitest/public/data/iris.csv +151 -0
- package/packages/examples/apitest/public/data/model1.sas7bdat +0 -0
- package/packages/examples/apitest/public/favicon.ico +0 -0
- package/packages/examples/apitest/public/index.html +316 -0
- package/packages/examples/apitest/public/index2.html +102 -0
- package/packages/examples/apitest/public/logon.html +42 -0
- package/packages/examples/apitest/public/myapp/secondary.html +1 -0
- package/packages/examples/apitest/public/myapp/test.js +2 -0
- package/packages/examples/apitest/public/onlogoff.html +53 -0
- package/packages/examples/apitest/start.sh +15 -0
- package/packages/examples/app/.env +32 -0
- package/packages/examples/app/.envProxy +19 -0
- package/packages/examples/app/.envimpl +12 -0
- package/packages/examples/app/.eslintrc.json +42 -0
- package/packages/examples/app/Dockerfile +42 -0
- package/packages/examples/app/appenv.js +6 -0
- package/packages/examples/app/certs/ca.crt +19 -0
- package/packages/examples/app/certs/tls.crt +25 -0
- package/packages/examples/app/certs/tls.key +28 -0
- package/packages/examples/app/certs/tls.sh +5 -0
- package/packages/examples/app/docker-compose.yml +12 -0
- package/packages/examples/app/index.js +15 -0
- package/packages/examples/app/package.json +20 -0
- package/packages/examples/app/public/casread.html +324 -0
- package/packages/examples/app/public/data/Cluster_SDOH1.sas +182 -0
- package/packages/examples/app/public/data/Cluster_SDOH6.sas +180 -0
- package/packages/examples/app/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/app/public/data/NeuralNetwork_High_med.sas +2409 -0
- package/packages/examples/app/public/data/NeuralNetwork_high_med1.sas +2409 -0
- package/packages/examples/app/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/app/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/app/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/app/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/app/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/app/public/data/cars.csv +429 -0
- package/packages/examples/app/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/app/public/data/cmdList.txt +15 -0
- package/packages/examples/app/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/app/public/data/iris.csv +151 -0
- package/packages/examples/app/public/data/model1.sas7bdat +0 -0
- package/packages/examples/app/public/favicon.ico +0 -0
- package/packages/examples/app/public/index.html +332 -0
- package/packages/examples/app/public/indexProxy.html +346 -0
- package/packages/examples/app/public/indextest.html +316 -0
- package/packages/examples/app/public/logon.html +44 -0
- package/packages/examples/app/public/micburger.html +345 -0
- package/packages/examples/app/public/micburger.txt.html +311 -0
- package/packages/examples/app/public/myapp/secondary.html +1 -0
- package/packages/examples/app/public/myapp/test.js +2 -0
- package/packages/examples/app/public/sara.txt +345 -0
- package/packages/examples/app/public/testva2.html +311 -0
- package/packages/examples/app/startup.sh +15 -0
- package/packages/examples/appdocker/.env +21 -0
- package/packages/examples/appdocker/.envProxy +22 -0
- package/packages/examples/appdocker/.envimpl +12 -0
- package/packages/examples/appdocker/.eslintrc.json +42 -0
- package/packages/examples/appdocker/Dockerfile +43 -0
- package/packages/examples/appdocker/appenv.js +6 -0
- package/packages/examples/appdocker/certs/ca.crt +19 -0
- package/packages/examples/appdocker/certs/tls.crt +25 -0
- package/packages/examples/appdocker/certs/tls.key +28 -0
- package/packages/examples/appdocker/certs/tls.sh +5 -0
- package/packages/examples/appdocker/docker-compose.yml +12 -0
- package/packages/examples/appdocker/index.js +15 -0
- package/packages/examples/appdocker/package.json +20 -0
- package/packages/examples/appdocker/public/data/Cluster_SDOH1.sas +182 -0
- package/packages/examples/appdocker/public/data/Cluster_SDOH6.sas +180 -0
- package/packages/examples/appdocker/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/appdocker/public/data/NeuralNetwork_High_med.sas +2409 -0
- package/packages/examples/appdocker/public/data/NeuralNetwork_high_med1.sas +2409 -0
- package/packages/examples/appdocker/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/appdocker/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/appdocker/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/appdocker/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/appdocker/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/appdocker/public/data/cars.csv +429 -0
- package/packages/examples/appdocker/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/appdocker/public/data/cmdList.txt +15 -0
- package/packages/examples/appdocker/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/appdocker/public/data/iris.csv +151 -0
- package/packages/examples/appdocker/public/data/model1.sas7bdat +0 -0
- package/packages/examples/appdocker/public/favicon.ico +0 -0
- package/packages/examples/appdocker/public/index.html +346 -0
- package/packages/examples/appdocker/public/indexProxy.html +346 -0
- package/packages/examples/appdocker/public/indextest.html +316 -0
- package/packages/examples/appdocker/public/logon.html +44 -0
- package/packages/examples/appdocker/public/myapp/secondary.html +1 -0
- package/packages/examples/appdocker/public/myapp/test.js +2 -0
- package/packages/examples/appdocker/startup.sh +15 -0
- package/packages/examples/apptest/.env +28 -0
- package/packages/examples/apptest/.envProxy +22 -0
- package/packages/examples/apptest/.envimpl +12 -0
- package/packages/examples/apptest/.eslintrc.json +42 -0
- package/packages/examples/apptest/Dockerfile +44 -0
- package/packages/examples/apptest/appDir/app1/design.html +350 -0
- package/packages/examples/apptest/appDir/app1/index.html +353 -0
- package/packages/examples/apptest/appDir/index.html +350 -0
- package/packages/examples/apptest/appenv.js +6 -0
- package/packages/examples/apptest/docker-compose.yml +12 -0
- package/packages/examples/apptest/index.js +444 -0
- package/packages/examples/apptest/package.json +24 -0
- package/packages/examples/apptest/public/casread2.html +321 -0
- package/packages/examples/apptest/public/data/Cluster_SDOH1.sas +182 -0
- package/packages/examples/apptest/public/data/Cluster_SDOH6.sas +180 -0
- package/packages/examples/apptest/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/apptest/public/data/NeuralNetwork_High_med.sas +2409 -0
- package/packages/examples/apptest/public/data/NeuralNetwork_high_med1.sas +2409 -0
- package/packages/examples/apptest/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/apptest/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/apptest/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/apptest/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/apptest/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/apptest/public/data/cars.csv +429 -0
- package/packages/examples/apptest/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/apptest/public/data/cmdList.txt +15 -0
- package/packages/examples/apptest/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/apptest/public/data/iris.csv +151 -0
- package/packages/examples/apptest/public/data/model1.sas7bdat +0 -0
- package/packages/examples/apptest/public/design.html +349 -0
- package/packages/examples/apptest/public/favicon.ico +0 -0
- package/packages/examples/apptest/public/help.html +1 -0
- package/packages/examples/apptest/public/index.html +353 -0
- package/packages/examples/apptest/public/index2.html +353 -0
- package/packages/examples/apptest/public/indexProxy.html +346 -0
- package/packages/examples/apptest/public/indextest.html +316 -0
- package/packages/examples/apptest/public/logon.html +44 -0
- package/packages/examples/apptest/public/myapp/q.html +349 -0
- package/packages/examples/apptest/public/myapp/secondary.html +1 -0
- package/packages/examples/apptest/public/myapp/test.js +2 -0
- package/packages/examples/apptest/public/push1.html +187 -0
- package/packages/examples/apptest/startup.sh +15 -0
- package/packages/examples/apptesti/.env +13 -0
- package/packages/examples/apptesti/.eslintrc.json +42 -0
- package/packages/examples/apptesti/Dockerfile +42 -0
- package/packages/examples/apptesti/appenv.js +6 -0
- package/packages/examples/apptesti/certs/ca.crt +19 -0
- package/packages/examples/apptesti/certs/tls.crt +25 -0
- package/packages/examples/apptesti/certs/tls.key +28 -0
- package/packages/examples/apptesti/certs/tls.sh +5 -0
- package/packages/examples/apptesti/docker-compose.yml +12 -0
- package/{lib/cli.js → packages/examples/apptesti/index.js} +4 -6
- package/packages/examples/apptesti/package.json +20 -0
- package/packages/examples/apptesti/public/data/Cluster_SDOH1.sas +182 -0
- package/packages/examples/apptesti/public/data/Cluster_SDOH6.sas +180 -0
- package/packages/examples/apptesti/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/apptesti/public/data/NeuralNetwork_High_med.sas +2409 -0
- package/packages/examples/apptesti/public/data/NeuralNetwork_high_med1.sas +2409 -0
- package/packages/examples/apptesti/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/apptesti/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/apptesti/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/apptesti/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/apptesti/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/apptesti/public/data/cars.csv +429 -0
- package/packages/examples/apptesti/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/apptesti/public/data/cmdList.txt +15 -0
- package/packages/examples/apptesti/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/apptesti/public/data/iris.csv +151 -0
- package/packages/examples/apptesti/public/data/model1.sas7bdat +0 -0
- package/packages/examples/apptesti/public/favicon.ico +0 -0
- package/packages/examples/apptesti/public/index.html +346 -0
- package/packages/examples/apptesti/public/indexProxy.html +346 -0
- package/packages/examples/apptesti/public/indextest.html +316 -0
- package/packages/examples/apptesti/public/logon.html +44 -0
- package/packages/examples/apptesti/public/main.html +346 -0
- package/packages/examples/apptesti/public/myapp/secondary.html +1 -0
- package/packages/examples/apptesti/public/myapp/test.js +2 -0
- package/packages/examples/apptesti/startup.sh +15 -0
- package/packages/examples/basic/.env +10 -0
- package/packages/examples/basic/.eslintrc.json +42 -0
- package/packages/examples/basic/Dockerfile +41 -0
- package/packages/examples/basic/api.js +88 -0
- package/packages/examples/basic/appenv.js +6 -0
- package/packages/examples/basic/docker-compose.yml +10 -0
- package/packages/examples/basic/package.json +19 -0
- package/packages/examples/basic/public/data/Cluster_SDOH1.sas +182 -0
- package/packages/examples/basic/public/data/Cluster_SDOH6.sas +180 -0
- package/packages/examples/basic/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/basic/public/data/NeuralNetwork_High_med.sas +2409 -0
- package/packages/examples/basic/public/data/NeuralNetwork_high_med1.sas +2409 -0
- package/packages/examples/basic/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/basic/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/basic/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/basic/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/basic/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/basic/public/data/cars.csv +429 -0
- package/packages/examples/basic/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/basic/public/data/cmdList.txt +15 -0
- package/packages/examples/basic/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/basic/public/data/iris.csv +151 -0
- package/packages/examples/basic/public/data/model1.sas7bdat +0 -0
- package/packages/examples/basic/public/favicon.ico +0 -0
- package/packages/examples/basic/public/index.html +29 -0
- package/packages/examples/basic/public/index2.html +102 -0
- package/packages/examples/basic/public/logon.html +42 -0
- package/packages/examples/basic/public/myapp/secondary.html +1 -0
- package/packages/examples/basic/public/myapp/test.js +2 -0
- package/packages/examples/basic/public/onlogoff.html +53 -0
- package/packages/examples/basic/start.sh +15 -0
- package/packages/examples/proxytest/.env +23 -0
- package/packages/examples/proxytest/.envimpl +11 -0
- package/packages/examples/proxytest/.eslintrc.json +42 -0
- package/packages/examples/proxytest/Dockerfile +42 -0
- package/packages/examples/proxytest/appenv.js +6 -0
- package/packages/examples/proxytest/docker-compose.yml +12 -0
- package/packages/examples/proxytest/index.js +57 -0
- package/packages/examples/proxytest/package.json +18 -0
- package/packages/examples/proxytest/public/data/Cluster_SDOH1.sas +182 -0
- package/packages/examples/proxytest/public/data/Cluster_SDOH6.sas +180 -0
- package/packages/examples/proxytest/public/data/LeNet_snzrle.astore +0 -0
- package/packages/examples/proxytest/public/data/NeuralNetwork_High_med.sas +2409 -0
- package/packages/examples/proxytest/public/data/NeuralNetwork_high_med1.sas +2409 -0
- package/packages/examples/proxytest/public/data/ast/GBlocalcopy.sasast +0 -0
- package/packages/examples/proxytest/public/data/ast/LeNet_snzrle.astore +0 -0
- package/packages/examples/proxytest/public/data/ast/gb_IrisGB.sasast +0 -0
- package/packages/examples/proxytest/public/data/ast/paysimsvdd.sasast +0 -0
- package/packages/examples/proxytest/public/data/ast/svmlocalcopy.sasast +0 -0
- package/packages/examples/proxytest/public/data/cars.csv +429 -0
- package/packages/examples/proxytest/public/data/cluster_test2.sas7bdat +0 -0
- package/packages/examples/proxytest/public/data/cmdList.txt +15 -0
- package/packages/examples/proxytest/public/data/gradBoost.sashdat +0 -0
- package/packages/examples/proxytest/public/data/iris.csv +151 -0
- package/packages/examples/proxytest/public/data/model1.sas7bdat +0 -0
- package/packages/examples/proxytest/public/favicon.ico +0 -0
- package/packages/examples/proxytest/public/index.html +357 -0
- package/packages/examples/proxytest/public/index.js +57 -0
- package/packages/examples/proxytest/public/indextest.html +316 -0
- package/packages/examples/proxytest/public/logon.html +44 -0
- package/packages/examples/proxytest/public/main.html +357 -0
- package/packages/examples/proxytest/public/myapp/secondary.html +1 -0
- package/packages/examples/proxytest/public/myapp/test.js +2 -0
- package/packages/examples/proxytest/public/restaf.js +2461 -0
- package/packages/examples/proxytest/public/restaf.min.js +11 -0
- package/packages/examples/proxytest/public/sas/iris.txt +10 -0
- package/packages/examples/proxytest/startup.sh +15 -0
- package/public/casread2.html +321 -0
- package/public/data/Cluster_SDOH1.sas +182 -0
- package/public/data/Cluster_SDOH6.sas +180 -0
- package/public/data/LeNet_snzrle.astore +0 -0
- package/public/data/NeuralNetwork_High_med.sas +2409 -0
- package/public/data/NeuralNetwork_high_med1.sas +2409 -0
- package/public/data/ast/GBlocalcopy.sasast +0 -0
- package/public/data/ast/LeNet_snzrle.astore +0 -0
- package/public/data/ast/gb_IrisGB.sasast +0 -0
- package/public/data/ast/paysimsvdd.sasast +0 -0
- package/public/data/ast/svmlocalcopy.sasast +0 -0
- package/public/data/cars.csv +429 -0
- package/public/data/cluster_test2.sas7bdat +0 -0
- package/public/data/cmdList.txt +15 -0
- package/public/data/gradBoost.sashdat +0 -0
- package/public/data/iris.csv +151 -0
- package/public/data/model1.sas7bdat +0 -0
- package/public/design.html +350 -0
- package/public/display.html +354 -0
- package/public/favicon.ico +0 -0
- package/public/help.html +1 -0
- package/public/index.html +354 -0
- package/public/index2.html +353 -0
- package/public/indexProxy.html +350 -0
- package/public/indextest.html +316 -0
- package/public/logon.html +44 -0
- package/public/myapp/q.html +349 -0
- package/public/myapp/secondary.html +1 -0
- package/public/myapp/test.js +2 -0
- package/public/push1.html +187 -0
- package/server.js +474 -0
- package/src/config.js +90 -0
- package/src/handlers/appCallback.js +40 -0
- package/src/handlers/codeAuth.js +31 -0
- package/src/handlers/decodeJwt.js +11 -0
- package/src/handlers/favicon.js +24 -0
- package/src/handlers/getApp.js +52 -0
- package/src/handlers/getApp2.js +26 -0
- package/src/handlers/getUser.js +20 -0
- package/src/handlers/index.js +36 -0
- package/src/handlers/keepAlive.js +54 -0
- package/src/handlers/keepAlive2.js +13 -0
- package/src/handlers/logon.js +24 -0
- package/src/handlers/logout.js +43 -0
- package/src/handlers/proxyMapUri.js +53 -0
- package/src/handlers/proxyOnResponse.js +12 -0
- package/src/handlers/reactDev.js +30 -0
- package/src/handlers/setCookies.js +78 -0
- package/src/iService.js +369 -0
- package/src/index.js +249 -0
- package/src/parseDocker.js +32 -0
- package/src/plugins/SASauth.js +79 -0
- package/src/plugins/appCookie.js +49 -0
- package/src/plugins/setContext.js +34 -0
- package/src/plugins/setDefaultRoutes.js +260 -0
- package/src/plugins/setupAuth.js +48 -0
- package/src/plugins/setupUserRoutes.js +48 -0
- package/src/plugins/token.js +10 -0
- package/src/schemes/SASTokenScheme.js +43 -0
- package/src/visionIndex.html +24 -0
- package/start.sh +15 -0
- package/lib/core/handlers/appCallback.js +0 -51
- package/lib/core/handlers/codeAuth.js +0 -61
- package/lib/core/handlers/favicon.js +0 -45
- package/lib/core/handlers/getApp.js +0 -67
- package/lib/core/handlers/getApp2.js +0 -48
- package/lib/core/handlers/getUser.js +0 -49
- package/lib/core/handlers/keepAlive.js +0 -96
- package/lib/core/handlers/keepAlive2.js +0 -33
- package/lib/core/handlers/logon.js +0 -44
- package/lib/core/handlers/logout.js +0 -88
- package/lib/core/handlers/proxyOnResponse.js +0 -26
- package/lib/core/handlers/reactDev.js +0 -52
- package/lib/core/handlers/setCookies.js +0 -116
- package/lib/core/index.js +0 -195
- package/lib/core/plugins/SASauth.js +0 -100
- package/lib/core/plugins/appCookie.js +0 -98
- package/lib/core/plugins/setContext.js +0 -55
- package/lib/core/plugins/setDefaultRoutes.js +0 -239
- package/lib/core/plugins/setupAuth.js +0 -86
- package/lib/core/plugins/token.js +0 -31
- package/lib/core/schemes/SASTokenScheme.js +0 -71
- /package/lib/{core/parseDocker.js → parseDocker.js} +0 -0
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
<html lang="en"><head>
|
|
2
|
+
<meta charset="utf-8">
|
|
3
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
4
|
+
<title>appBuilder</title>
|
|
5
|
+
|
|
6
|
+
<script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
|
|
7
|
+
<script src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
|
|
8
|
+
<script src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
|
|
9
|
+
<script async="" src="https://cdn.developer.sas.com/packages/va-report-components/latest/dist/umd/va-report-components.js"></script>
|
|
10
|
+
|
|
11
|
+
<script type="text/javascript" src="https://unpkg.com/@sassoftware/react-app-builder"></script>
|
|
12
|
+
|
|
13
|
+
<script type="text/javascript" src="https://unpkg.com/@sassoftware/smart-controls-mui"></script>
|
|
14
|
+
<script>
|
|
15
|
+
debugger;
|
|
16
|
+
let LOGONPAYLOAD = {
|
|
17
|
+
host: "https://viya.kumar-zv1-azure-nginx-84560a6e.unx.sas.com",
|
|
18
|
+
authType: "server",
|
|
19
|
+
appName: "appBuilder",
|
|
20
|
+
};
|
|
21
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
22
|
+
debugger;
|
|
23
|
+
console.log(urlParams);
|
|
24
|
+
let APPENV={};
|
|
25
|
+
urlParams.forEach((value, key) => {
|
|
26
|
+
console.log(key, value);
|
|
27
|
+
APPENV[key.toUpperCase()] = value;
|
|
28
|
+
})
|
|
29
|
+
if (APPENV.HOST != null) {
|
|
30
|
+
LOGONPAYLOAD.host = APPENV.HOST;
|
|
31
|
+
}
|
|
32
|
+
let USERCONTROLS = {
|
|
33
|
+
controls: smartControls.controls,
|
|
34
|
+
defaultControls: {
|
|
35
|
+
numeric: 'Input',
|
|
36
|
+
char: 'InputText',
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
let userData = {};
|
|
40
|
+
|
|
41
|
+
let APPCONFIG = {
|
|
42
|
+
sasServer: "viya",
|
|
43
|
+
source: "cas",
|
|
44
|
+
saveLocation: 'local',/* only valid value is 'local'. github is coming */
|
|
45
|
+
logonPayload: LOGONPAYLOAD, /* logon information or null */
|
|
46
|
+
computeContext: "",
|
|
47
|
+
sessionID: null, /* an existing sessionID or null - for react component scenario*/
|
|
48
|
+
table: null, /* only for building forms for a table */
|
|
49
|
+
model: null, /* only for building forms for a model */
|
|
50
|
+
callbacks: null,
|
|
51
|
+
proxyServer: null,
|
|
52
|
+
passContext: "YES",
|
|
53
|
+
userData: {},
|
|
54
|
+
USERCONTROLS: "https://unpkg.com/@sassoftware/smart-controls-mui",
|
|
55
|
+
USERCONTROLSVAR: "smartControls",
|
|
56
|
+
USERCONTROLSPACKAGE: "@sassoftware/smart-controls-mui",
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
59
|
+
<script type="text/babel">
|
|
60
|
+
function _display(viewMode) {
|
|
61
|
+
console.log(reactAppBuilder);
|
|
62
|
+
let MAINENTRY=(viewMode === 'design') ? reactAppBuilder.DesignApp : reactAppBuilder.DisplayApp;
|
|
63
|
+
const createRoot = ReactDOM.createRoot;
|
|
64
|
+
const container = document.getElementById('container1');
|
|
65
|
+
const root = createRoot(container);
|
|
66
|
+
let style = {};
|
|
67
|
+
root.render(
|
|
68
|
+
<MAINENTRY form={FORM} userControls={USERCONTROLS} appConfig={APPCONFIG} htmlTemplate={PAGESOURCE} style={style}/>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<script>
|
|
74
|
+
function _setup (viewMode) {
|
|
75
|
+
_display(viewMode);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
</script>
|
|
79
|
+
|
|
80
|
+
<!--------------------------------------------------------------------------------------------------->
|
|
81
|
+
<!-- PAGESOURCE is used as the html for the output -------------------------------------------------->
|
|
82
|
+
<!-- By default this uses the current html --------------------------------------------------------->
|
|
83
|
+
<!-- You can replace PAGESOURCE with your custom HTML ----------------------------------------------->
|
|
84
|
+
<!--------------------------------------------------------------------------------------------------->
|
|
85
|
+
|
|
86
|
+
<script>
|
|
87
|
+
let PAGESOURCE = document.documentElement.outerHTML;
|
|
88
|
+
</script></head>
|
|
89
|
+
<body onload="_display('design')">
|
|
90
|
+
<script type="text/javascript">
|
|
91
|
+
function getForm() {
|
|
92
|
+
return { version:1,
|
|
93
|
+
label:"push1.form",
|
|
94
|
+
viewType:"form",
|
|
95
|
+
source:"cas",
|
|
96
|
+
table:null,
|
|
97
|
+
byvars:[ ],
|
|
98
|
+
preamble:null,
|
|
99
|
+
sessionID:null,
|
|
100
|
+
userSessionID:null,
|
|
101
|
+
servers:null,
|
|
102
|
+
computeContext:"SAS Job Execution compute context",
|
|
103
|
+
casServerName:"cas-shared-default",
|
|
104
|
+
serverContext:undefined,
|
|
105
|
+
initialFetch:{ qs:{ start:0,
|
|
106
|
+
limit:1,
|
|
107
|
+
format:false,
|
|
108
|
+
where:"",
|
|
109
|
+
includeIndex:true } },
|
|
110
|
+
customColumns:{ _c1:{ Column:"_c1",
|
|
111
|
+
Label:"_c1",
|
|
112
|
+
Type:"number",
|
|
113
|
+
FormattedLength:12,
|
|
114
|
+
value:0 } },
|
|
115
|
+
editControl:{ autoSave:true,
|
|
116
|
+
autoSaveTable:true,
|
|
117
|
+
handlers:{ initApp:async (appEnv) => {
|
|
118
|
+
return {
|
|
119
|
+
statusCode: 0,
|
|
120
|
+
msg: ' '
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
init:async (data, rowno, appEnv) => data,
|
|
124
|
+
main:async (data, rowno, appEnv) => data,
|
|
125
|
+
term:async (data, rowno, appEnv) => data } },
|
|
126
|
+
viewerOptions:{ show:[ ],
|
|
127
|
+
drop:[ ],
|
|
128
|
+
disabled:[ "_index_" ],
|
|
129
|
+
cellStyles:{},
|
|
130
|
+
userMenus:{},
|
|
131
|
+
domLayout:"autoHeight",
|
|
132
|
+
agGridTheme:"ag-theme-alpine-custom" },
|
|
133
|
+
formControl:{ version:"v3",
|
|
134
|
+
status:"saved",
|
|
135
|
+
drop:[ ],
|
|
136
|
+
show:[ ],
|
|
137
|
+
defaultComponent:"Input",
|
|
138
|
+
itemCounter:1,
|
|
139
|
+
currentItems:[ "_c1" ],
|
|
140
|
+
items:[ { x:60,
|
|
141
|
+
y:62.727272033691406,
|
|
142
|
+
width:200,
|
|
143
|
+
height:30,
|
|
144
|
+
backgroundColor:"none",
|
|
145
|
+
touchAction:"None",
|
|
146
|
+
zIndex:2,
|
|
147
|
+
position:"absolute",
|
|
148
|
+
id:1,
|
|
149
|
+
name:"_c1" } ],
|
|
150
|
+
visuals:[ { id:1,
|
|
151
|
+
name:"_c1",
|
|
152
|
+
component:"Input",
|
|
153
|
+
label:"Input",
|
|
154
|
+
hide:false,
|
|
155
|
+
custom:true,
|
|
156
|
+
props:{ name:"_c1",
|
|
157
|
+
type:"number",
|
|
158
|
+
value:0,
|
|
159
|
+
label:"_c1",
|
|
160
|
+
length:12,
|
|
161
|
+
dataProps:"",
|
|
162
|
+
onEdit:"",
|
|
163
|
+
props:"{ name:\" \",\n label:\"\",\n align:\"right\" }",
|
|
164
|
+
"export":false,
|
|
165
|
+
visible:true,
|
|
166
|
+
handlerType:"sync",
|
|
167
|
+
handlers:{ props:(data,name, row, appEnv) => {return { name:" ",
|
|
168
|
+
label:"",
|
|
169
|
+
align:"right" };},
|
|
170
|
+
dataProps:null,
|
|
171
|
+
onEdit:null } },
|
|
172
|
+
propDetails:{},
|
|
173
|
+
grow:"horizontal" } ],
|
|
174
|
+
style:{ height:761.491455078125,
|
|
175
|
+
width:906.3635864257812,
|
|
176
|
+
overflow:"hidden",
|
|
177
|
+
border:"1px",
|
|
178
|
+
resize:"both",
|
|
179
|
+
borderStyle:"solid",
|
|
180
|
+
borderColor:"black" } } }};
|
|
181
|
+
</script>
|
|
182
|
+
<script>
|
|
183
|
+
let FORM=getForm();
|
|
184
|
+
// let MAINENTRY=reactAppBuilder.DesignApp;
|
|
185
|
+
</script>
|
|
186
|
+
<div id="container1" class="main" > </div>
|
|
187
|
+
</body></html>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#
|
|
2
|
+
# Azure wants to prefix the app env
|
|
3
|
+
# Use this to set the env that this server expects
|
|
4
|
+
|
|
5
|
+
# https://docs.microsoft.com/en-us/azure/app-service/reference-app-settings?tabs=kudu%2Cdotnet
|
|
6
|
+
env | grep APPSETTING_
|
|
7
|
+
|
|
8
|
+
if [[ ! -z "$APPSETTING_VIYA_SERVER" ]];
|
|
9
|
+
then
|
|
10
|
+
export VIYA_SERVER=$APPSETTING_VIYA_SERVER
|
|
11
|
+
echo VIYA SERVER= $VIYA_SERVER
|
|
12
|
+
else
|
|
13
|
+
echo "No custom application overrides"
|
|
14
|
+
fi
|
|
15
|
+
node index.js
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"root": true,
|
|
3
|
+
"env": {
|
|
4
|
+
"browser": true,
|
|
5
|
+
"node": true,
|
|
6
|
+
"es6": true
|
|
7
|
+
},
|
|
8
|
+
"parser": "@babel/eslint-parser",
|
|
9
|
+
"extends": ["eslint:recommended", "prettier"],
|
|
10
|
+
"parserOptions": {
|
|
11
|
+
"requireConfigFile": false,
|
|
12
|
+
"babelOptions": {"configFile": "./.babelrc"},
|
|
13
|
+
"ecmaVersion": 6,
|
|
14
|
+
"sourceType": "module",
|
|
15
|
+
"ecmaFeatures": {
|
|
16
|
+
"jsx": true
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"rules": {
|
|
20
|
+
"key-spacing": [
|
|
21
|
+
2,
|
|
22
|
+
{
|
|
23
|
+
"align": "colon"
|
|
24
|
+
}
|
|
25
|
+
],
|
|
26
|
+
"jsx-quotes": [2, "prefer-double"],
|
|
27
|
+
"no-console": 0,
|
|
28
|
+
"no-unused-vars": [
|
|
29
|
+
1,
|
|
30
|
+
{
|
|
31
|
+
"args": "none"
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
"no-debugger": 0,
|
|
35
|
+
"react/prop-types": 0,
|
|
36
|
+
"array-bracket-spacing": [2, "never"],
|
|
37
|
+
"space-in-parens": [2, "never"],
|
|
38
|
+
"space-before-function-paren": [2, "always"],
|
|
39
|
+
"semi": [2, "always"],
|
|
40
|
+
"no-prototype-builtins": 0
|
|
41
|
+
}
|
|
42
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
FROM node:12.16.1-alpine
|
|
2
|
+
LABEL maintainer="deva.kumar@sas.com"
|
|
3
|
+
WORKDIR /usr/src/app
|
|
4
|
+
COPY . .
|
|
5
|
+
# COPY package*.json ./
|
|
6
|
+
RUN npm install
|
|
7
|
+
# RUN npm run build
|
|
8
|
+
|
|
9
|
+
# will auto change to localhost in non-docker environments
|
|
10
|
+
ENV APPHOST=0.0.0.0
|
|
11
|
+
ENV PORT=8080
|
|
12
|
+
EXPOSE $PORT
|
|
13
|
+
#######################################################################
|
|
14
|
+
# You can override these(but in container leave APPHOST as shown below)
|
|
15
|
+
########################################################################
|
|
16
|
+
|
|
17
|
+
# set this the same as EXPOSE here and override in env or as -p option in dockerrun
|
|
18
|
+
# ENV APPPORT=8080
|
|
19
|
+
|
|
20
|
+
ENV APPNAME=viyaapp
|
|
21
|
+
# ENV AUTHFLOW=code
|
|
22
|
+
# ENV CLIENTID=clientapp
|
|
23
|
+
# ENV CLIENTSECRET=secret
|
|
24
|
+
# ENV HAPIDEBUG=YES
|
|
25
|
+
# ENV LOGLEVEL=info
|
|
26
|
+
# ENV USETOKEN=YES
|
|
27
|
+
|
|
28
|
+
#sample setup for creating a temporary cert and key
|
|
29
|
+
ENV TLS_CREATE="C:US,ST:NC,L:Cary,O:SAS Institute,OU:STO,CN:localhost"
|
|
30
|
+
|
|
31
|
+
# You can specify your own cet and key
|
|
32
|
+
# ENV TLS_CERT=../../../certs/cert64.cer
|
|
33
|
+
# ENV TLS_KEY=../../../certs/pubkey64.pem
|
|
34
|
+
|
|
35
|
+
# Samesite specification
|
|
36
|
+
ENV SAMESITE=None,secure
|
|
37
|
+
|
|
38
|
+
# If your Viya instance still has a unsigned certificate set this value prior to invoking the server
|
|
39
|
+
ENV NODE_TLS_REJECT_UNAUTHORIZED=0
|
|
40
|
+
|
|
41
|
+
#####################################################################
|
|
42
|
+
CMD ["npm", "run", "indocker"]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
|
2
|
+
MIIDIjCCAgqgAwIBAgIIXK9uCGkAZEcwDQYJKoZIhvcNAQELBQAwLzEtMCsGA1UE
|
|
3
|
+
AxMkU0F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
|
|
19
|
+
RqmMn5OEZQKBgQDnq7wk5qDr3C6+soF267M+xsEpTdga+6j0iK6rD+7mSviq3nuZ
|
|
20
|
+
BKzmQ2hIXSFIaIyBpMD7f+jHPXwM4tI4VUyNz8aVXEs21liHaCcpuVrXCAJ66Exp
|
|
21
|
+
54sYyT1JZKyqFSARyb9LF3LyVt5b8BN/CfCT1hWuxZGEPg7YfdKt5VizowKBgQCk
|
|
22
|
+
YZaliKztDpXfcgMlwOSZjYP5rZrBise/4rymQQK7WArwKcSi+8G7YOKiuuMrWEt7
|
|
23
|
+
JBPfeRV3u3PE1xHQzarosYt+yuOioJKHvMrJzEQ4u5teJje+kPdoxMZvlAO0BbKw
|
|
24
|
+
uo+wF2leVN7igFyhNz6ahKuSAZTbI3N3+uVrT7ZfyQKBgE/9OiCsqmcPUvy4dT6o
|
|
25
|
+
sCXHFTPii54vZLvL3/GhfJUPW21+XHuLrwhsi8MbRU5Wk51409noY3W8h41TPPFV
|
|
26
|
+
r2HirPAxW4Om3AhsWo1522pVt/nXxm0OT59ICAENIvYE56EX4UjwVlFxkSEcL8Jz
|
|
27
|
+
FSnXxmP5vCQXGx09r3Rd025y
|
|
28
|
+
-----END PRIVATE KEY-----
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
kubectl cp $(kubectl get pod | grep "sas-consul-server-0" | awk -F" " '{print $1}'):security/ca.crt ./ca.crt
|
|
2
|
+
|
|
3
|
+
kubectl cp $(kubectl get pod | grep "sas-consul-server-0" | awk -F" " '{print $1}'):security/tls.crt ./tls.crt
|
|
4
|
+
|
|
5
|
+
kubectl cp $(kubectl get pod | grep "sas-consul-server-0" | awk -F" " '{print $1}'):security/tls.key ./tls.key
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
/*
|
|
3
2
|
* Copyright © 2019, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
|
|
4
3
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
icli(null, true, null);
|
|
4
|
+
*/
|
|
5
|
+
const api = require('./api');
|
|
6
|
+
let server = require('@sassoftware/viya-apiserverjs');
|
|
7
|
+
server.icli (api);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "apptest",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "app.js",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"start": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node index.js --env=./.env --docker=./Dockerfile",
|
|
8
|
+
"starti": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node index.js --env=./.envimpl --docker=./Dockerfile",
|
|
9
|
+
"proxy": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node index.js --env=./.envproxy --docker=./Dockerfile",
|
|
10
|
+
|
|
11
|
+
"debug": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node --inspect-brk index.js --env=./.env --docker=./Dockerfile",
|
|
12
|
+
"indocker": "cross-env NODE_TLS_REJECT_UNAUTHORIZED=0 node index.js"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [],
|
|
15
|
+
"author": "",
|
|
16
|
+
"license": "ISC",
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"cross-env": ">=7.0.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
/*--------------------------------------------------
|
|
2
|
+
The options statement below should be placed
|
|
3
|
+
before the data step when submitting this code.
|
|
4
|
+
--------------------------------------------------*/
|
|
5
|
+
/*options VALIDMEMNAME=EXTEND VALIDVARNAME=ANY;*/
|
|
6
|
+
/*------------------------------------------
|
|
7
|
+
Generated SAS Scoring Code
|
|
8
|
+
Date : 02Jul2019:21:19:56
|
|
9
|
+
Locale : en_US
|
|
10
|
+
Model Type : Cluster
|
|
11
|
+
Interval variable: SDOH_PMU(SDOH1 Physically Mentally Unhealthy)
|
|
12
|
+
Interval variable: SDOH_Per_Adults_Bachelors(SDOH2 Education)
|
|
13
|
+
Interval variable: SDOH_Unemployment_Rate(SDOH4 Unemployment Rate)
|
|
14
|
+
Interval variable: SDOH_Median_Household_Income(SDOH3 Median Household Income)
|
|
15
|
+
------------------------------------------*/
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
length _WARN_ $4;
|
|
19
|
+
label _WARN_ = 'Warnings';
|
|
20
|
+
label _CLUSTER_ID_ = 'Cluster ID';
|
|
21
|
+
label _DISTANCE_ = 'Distance to Centroid';
|
|
22
|
+
|
|
23
|
+
_i_ = 0;
|
|
24
|
+
_j_ = 0;
|
|
25
|
+
_k_ = 0;
|
|
26
|
+
_l_ = 0;
|
|
27
|
+
_dist_ = 0;
|
|
28
|
+
_minDist_ = 0;
|
|
29
|
+
_found_ = 0;
|
|
30
|
+
_unknown_ = 0;
|
|
31
|
+
_unknownflag_ = 0;
|
|
32
|
+
_intMindist2cntr_ = 0;
|
|
33
|
+
_missingflag4Int_ = 0;
|
|
34
|
+
_numberOfIntVars_ = 4;
|
|
35
|
+
_minDistInt_ = 0;
|
|
36
|
+
label _STANDARDIZED_DISTANCE_ = 'Standardized Distance to Centroid';
|
|
37
|
+
|
|
38
|
+
drop _i_;
|
|
39
|
+
drop _j_;
|
|
40
|
+
drop _k_;
|
|
41
|
+
drop _l_;
|
|
42
|
+
drop _dist_;
|
|
43
|
+
drop _minDist_;
|
|
44
|
+
drop _minDistInt_;
|
|
45
|
+
drop _unknown_;
|
|
46
|
+
drop _unknownflag_;
|
|
47
|
+
drop _found_;
|
|
48
|
+
drop _intMindist2cntr_;
|
|
49
|
+
drop _missingflag4Int_;
|
|
50
|
+
drop _numberOfIntVars_;
|
|
51
|
+
drop _minDistInt_;
|
|
52
|
+
|
|
53
|
+
array _intVals_67{4} _temporary_;
|
|
54
|
+
array _intStdVals_67{4} _temporary_;
|
|
55
|
+
array _intVars_67[4] _temporary_;
|
|
56
|
+
_intVars_67[1] =
|
|
57
|
+
SDOH_PMU;
|
|
58
|
+
_intVars_67[2] =
|
|
59
|
+
SDOH_Per_Adults_Bachelors;
|
|
60
|
+
_intVars_67[3] =
|
|
61
|
+
SDOH_Unemployment_Rate;
|
|
62
|
+
_intVars_67[4] =
|
|
63
|
+
SDOH_Median_Household_Income;
|
|
64
|
+
array _cntrcoordsInt_67{4,4} _temporary_ (
|
|
65
|
+
5.6752109618776
|
|
66
|
+
34.574068577069
|
|
67
|
+
5.5249572649573
|
|
68
|
+
65162.262238794
|
|
69
|
+
6.1728412355737
|
|
70
|
+
28.076500921419
|
|
71
|
+
8.4815044247788
|
|
72
|
+
50250.811599193
|
|
73
|
+
5.5563377592335
|
|
74
|
+
27.69585347275
|
|
75
|
+
3.586724137931
|
|
76
|
+
55456.199169472
|
|
77
|
+
7.1425816544567
|
|
78
|
+
23.193113163492
|
|
79
|
+
5.9483653846154
|
|
80
|
+
45013.481439879
|
|
81
|
+
);
|
|
82
|
+
array _stdcntrcoordsInt_67 {4,4} _temporary_ (
|
|
83
|
+
-0.545947986801
|
|
84
|
+
1.2465170251288
|
|
85
|
+
-0.140043320021
|
|
86
|
+
1.2424484776721
|
|
87
|
+
0.080847377302
|
|
88
|
+
-0.09555849286
|
|
89
|
+
1.0754374093924
|
|
90
|
+
-0.456774851619
|
|
91
|
+
-0.695675960102
|
|
92
|
+
-0.17418139437
|
|
93
|
+
-0.936879929639
|
|
94
|
+
0.1364012391051
|
|
95
|
+
1.3022939633885
|
|
96
|
+
-1.104224427884
|
|
97
|
+
0.0340260867236
|
|
98
|
+
-1.053590936451
|
|
99
|
+
);
|
|
100
|
+
array _stdscaleInt_67 {4} _temporary_ (
|
|
101
|
+
0.7939278147152
|
|
102
|
+
4.8414322208822
|
|
103
|
+
2.4324097357342
|
|
104
|
+
8775.4507500947
|
|
105
|
+
);
|
|
106
|
+
array _stdcenterInt_67 {4} _temporary_ (
|
|
107
|
+
6.1086542539869
|
|
108
|
+
28.539140887732
|
|
109
|
+
5.8656
|
|
110
|
+
54259.216813453
|
|
111
|
+
);
|
|
112
|
+
|
|
113
|
+
*************** check missing interval value ******************;
|
|
114
|
+
_missingflag4Int_ = 0;
|
|
115
|
+
do _i_ = 1 to _numberOfIntVars_ until(_missingflag4Int_);
|
|
116
|
+
if missing( _intVars_67[_i_] ) then
|
|
117
|
+
_missingflag4Int_ = 1;
|
|
118
|
+
end;
|
|
119
|
+
|
|
120
|
+
if (_missingflag4Int_ = 1) then
|
|
121
|
+
substr(_WARN_, 1, 1) = 'M';
|
|
122
|
+
********** prepare interval variable values *********;
|
|
123
|
+
do _i_ = 1 to _numberOfIntVars_;
|
|
124
|
+
if missing (_intVars_67[_i_] ) then do;
|
|
125
|
+
_intVals_67[_i_] = .;
|
|
126
|
+
_intStdVals_67[_i_] = .;
|
|
127
|
+
end; else do;
|
|
128
|
+
if missing (_stdscaleInt_67[_i_] ) then do;
|
|
129
|
+
_intStdVals_67[_i_] = ( _intVars_67[_i_] - _stdcenterInt_67[_i_]);
|
|
130
|
+
end; else do;
|
|
131
|
+
_intStdVals_67[_i_] = ( _intVars_67[_i_] - _stdcenterInt_67[_i_])
|
|
132
|
+
/ _stdscaleInt_67[_i_];
|
|
133
|
+
end;
|
|
134
|
+
_intVals_67[_i_] = _intVars_67[_i_];
|
|
135
|
+
end;
|
|
136
|
+
end;
|
|
137
|
+
****************** find the closest cluster ******************;
|
|
138
|
+
if _missingflag4Int_ > 0 then
|
|
139
|
+
do;
|
|
140
|
+
_CLUSTER_ID_ = .;
|
|
141
|
+
_DISTANCE_ = .;
|
|
142
|
+
_minDistInt_ = .;
|
|
143
|
+
_STANDARDIZED_DISTANCE_ = .;
|
|
144
|
+
end;
|
|
145
|
+
else
|
|
146
|
+
do;
|
|
147
|
+
_CLUSTER_ID_ = .;
|
|
148
|
+
_minDist_ = 8.988465674E307;
|
|
149
|
+
do _i_=1 to 4;
|
|
150
|
+
_intMindist2cntr_ = 0;
|
|
151
|
+
do _j_=1 to 4;
|
|
152
|
+
_dist_ = _intStdVals_67{_j_} - _stdcntrcoordsInt_67{_i_,_j_};
|
|
153
|
+
_dist_ = _dist_ ** 2;
|
|
154
|
+
_intMindist2cntr_ = _intMindist2cntr_ + _dist_;
|
|
155
|
+
end;
|
|
156
|
+
_intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
|
|
157
|
+
if( _minDist_ > _intMindist2cntr_) then do;
|
|
158
|
+
_CLUSTER_ID_ = _i_;
|
|
159
|
+
_minDist_ = _intMindist2cntr_;
|
|
160
|
+
end;
|
|
161
|
+
_STANDARDIZED_DISTANCE_ = _minDist_;
|
|
162
|
+
end;
|
|
163
|
+
_DISTANCE_ = 8.988465674E307;
|
|
164
|
+
_i_ = _CLUSTER_ID_;
|
|
165
|
+
_intMindist2cntr_ = 0;
|
|
166
|
+
do _j_=1 to 4;
|
|
167
|
+
_dist_ = _intVals_67{_j_} - _cntrcoordsInt_67{_i_,_j_};
|
|
168
|
+
_dist_ = _dist_ ** 2;
|
|
169
|
+
_intMindist2cntr_ = _intMindist2cntr_ + _dist_;
|
|
170
|
+
end;
|
|
171
|
+
_intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
|
|
172
|
+
_DISTANCE_ = _intMindist2cntr_;
|
|
173
|
+
end;
|
|
174
|
+
|
|
175
|
+
if (MISSING('_CLUSTER_ID_'n))then _CLUSTER_ID_ = -1; /*------------------------------------------*/
|
|
176
|
+
drop '_CLUSTER_ID_'n '_DISTANCE_'n '_WARN_'n '_STANDARDIZED_DISTANCE_'n;
|
|
177
|
+
'_CLUSTER_ID__67'n='_CLUSTER_ID_'n;
|
|
178
|
+
'_DISTANCE__67'n='_DISTANCE_'n;
|
|
179
|
+
'_WARN__67'n='_WARN_'n;
|
|
180
|
+
'_STANDARDIZED_DISTANCE__67'n='_STANDARDIZED_DISTANCE_'n;
|
|
181
|
+
/*------------------------------------------*/
|
|
182
|
+
run;
|