@sassoftware/viya-serverjs 0.3.0 → 0.4.0

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.
Files changed (81) hide show
  1. package/.babelrc +6 -6
  2. package/.dockerignore +2 -2
  3. package/.env +29 -28
  4. package/.env.proxy +32 -32
  5. package/.env.server +30 -30
  6. package/.eslintignore +3 -3
  7. package/.eslintrc.json +42 -42
  8. package/Dockerfile +44 -44
  9. package/README.md +99 -99
  10. package/cli.js +9 -9
  11. package/lib/config.js +16 -16
  12. package/lib/handlers/appCallback.js +23 -24
  13. package/lib/handlers/codeAuth.js +17 -18
  14. package/lib/handlers/decodeJwt.js +3 -3
  15. package/lib/handlers/favicon.js +22 -25
  16. package/lib/handlers/getApp.js +20 -21
  17. package/lib/handlers/getApp2.js +22 -25
  18. package/lib/handlers/getUser.js +14 -17
  19. package/lib/handlers/index.js +3 -3
  20. package/lib/handlers/keepAlive.js +28 -31
  21. package/lib/handlers/keepAlive2.js +9 -12
  22. package/lib/handlers/logon.js +12 -15
  23. package/lib/handlers/logout.js +24 -28
  24. package/lib/handlers/proxyMapUri.js +6 -11
  25. package/lib/handlers/proxyOnResponse.js +6 -7
  26. package/lib/handlers/reactDev.js +22 -25
  27. package/lib/handlers/setCookies.js +52 -53
  28. package/lib/iService.js +82 -87
  29. package/lib/index.js +23 -21
  30. package/lib/parseDocker.js +3 -3
  31. package/lib/plugins/SASauth.js +30 -32
  32. package/lib/plugins/appCookie.js +36 -38
  33. package/lib/plugins/setContext.js +22 -25
  34. package/lib/plugins/setDefaultRoutes.js +61 -58
  35. package/lib/plugins/setupAuth.js +35 -38
  36. package/lib/plugins/setupUserRoutes.js +16 -16
  37. package/lib/plugins/token.js +9 -10
  38. package/lib/schemes/SASTokenScheme.js +24 -27
  39. package/package.json +85 -79
  40. package/public/data/Cluster_SDOH1.sas +181 -181
  41. package/public/data/Cluster_SDOH6.sas +179 -179
  42. package/public/data/NeuralNetwork_High_med.sas +2408 -2408
  43. package/public/data/NeuralNetwork_high_med1.sas +2408 -2408
  44. package/public/data/cars.csv +429 -429
  45. package/public/data/cmdList.txt +15 -15
  46. package/public/data/iris.csv +151 -151
  47. package/public/index.html +354 -350
  48. package/public/indexProxy.html +351 -351
  49. package/public/simplesubmit.html +233 -0
  50. package/server.js +362 -362
  51. package/src/config.js +90 -90
  52. package/src/handlers/appCallback.js +40 -40
  53. package/src/handlers/codeAuth.js +31 -31
  54. package/src/handlers/decodeJwt.js +10 -10
  55. package/src/handlers/favicon.js +23 -23
  56. package/src/handlers/getApp.js +52 -52
  57. package/src/handlers/getApp2.js +25 -25
  58. package/src/handlers/getUser.js +20 -20
  59. package/src/handlers/index.js +36 -36
  60. package/src/handlers/keepAlive.js +53 -53
  61. package/src/handlers/keepAlive2.js +12 -12
  62. package/src/handlers/logon.js +23 -23
  63. package/src/handlers/logout.js +42 -42
  64. package/src/handlers/proxyMapUri.js +25 -25
  65. package/src/handlers/proxyOnResponse.js +11 -11
  66. package/src/handlers/reactDev.js +29 -29
  67. package/src/handlers/setCookies.js +81 -79
  68. package/src/iService.js +346 -345
  69. package/src/index.js +251 -249
  70. package/src/parseDocker.js +32 -32
  71. package/src/plugins/SASauth.js +78 -78
  72. package/src/plugins/appCookie.js +51 -49
  73. package/src/plugins/setContext.js +33 -33
  74. package/src/plugins/setDefaultRoutes.js +256 -253
  75. package/src/plugins/setupAuth.js +49 -49
  76. package/src/plugins/setupUserRoutes.js +47 -47
  77. package/src/plugins/token.js +10 -10
  78. package/src/schemes/SASTokenScheme.js +43 -43
  79. package/src/visionIndex.html +23 -23
  80. package/start.sh +14 -14
  81. package/tls/viyatls.sh +2 -2
@@ -1,180 +1,180 @@
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 : 30Jul2019:20:16:16
9
- Locale : en_US
10
- Model Type : Cluster
11
- Interval variable: SDOH_Physically_Unhealthy_Days_(SDOH6 Physically Unhealthy Days)
12
- Interval variable: SDOH_Per_Adults_Bachelors(SDOH2 Education1)
13
- Interval variable: SDOH_Unemployment_Rate(SDOH3 Unemployment Rate)
14
- Interval variable: SDOH_Median_Household_Income(SDOH4 Median Household Income)
15
- ------------------------------------------*/
16
-
17
- length _WARN_ $4;
18
- label _WARN_ = 'Warnings';
19
- label _CLUSTER_ID_ = 'Cluster ID';
20
- label _DISTANCE_ = 'Distance to Centroid';
21
-
22
- _i_ = 0;
23
- _j_ = 0;
24
- _k_ = 0;
25
- _l_ = 0;
26
- _dist_ = 0;
27
- _minDist_ = 0;
28
- _found_ = 0;
29
- _unknown_ = 0;
30
- _unknownflag_ = 0;
31
- _intMindist2cntr_ = 0;
32
- _missingflag4Int_ = 0;
33
- _numberOfIntVars_ = 4;
34
- _minDistInt_ = 0;
35
- label _STANDARDIZED_DISTANCE_ = 'Standardized Distance to Centroid';
36
-
37
- drop _i_;
38
- drop _j_;
39
- drop _k_;
40
- drop _l_;
41
- drop _dist_;
42
- drop _minDist_;
43
- drop _minDistInt_;
44
- drop _unknown_;
45
- drop _unknownflag_;
46
- drop _found_;
47
- drop _intMindist2cntr_;
48
- drop _missingflag4Int_;
49
- drop _numberOfIntVars_;
50
- drop _minDistInt_;
51
-
52
- array _intVals_439{4} _temporary_;
53
- array _intStdVals_439{4} _temporary_;
54
- array _intVars_439[4] _temporary_;
55
- _intVars_439[1] =
56
- SDOH_Physically_Unhealthy_Days_;
57
- _intVars_439[2] =
58
- SDOH_Per_Adults_Bachelors;
59
- _intVars_439[3] =
60
- SDOH_Unemployment_Rate;
61
- _intVars_439[4] =
62
- SDOH_Median_Household_Income;
63
- array _cntrcoordsInt_439{4,4} _temporary_ (
64
- 3.0267344264664
65
- 40.73654855643
66
- 4.5016404199475
67
- 73253.345144357
68
- 3.1748155867421
69
- 23.482869339272
70
- 4.4175018559762
71
- 52859.890126206
72
- 5.0717963953358
73
- 13.894727354664
74
- 9.3289319513294
75
- 35934.982875169
76
- 4.17723170653
77
- 17.079836808704
78
- 6.0463463281958
79
- 42933.089573889
80
- );
81
- array _stdcntrcoordsInt_439 {4,4} _temporary_ (
82
- -0.819627593948
83
- 2.1063188660484
84
- -0.557938370531
85
- 1.9606280602175
86
- -0.667309695546
87
- 0.2473923533712
88
- -0.59384668401
89
- 0.3473109632455
90
- 1.2839454778829
91
- -0.785642463039
92
- 1.5022334387125
93
- -0.991610872631
94
- 0.363786470954
95
- -0.442475980379
96
- 0.1013049225367
97
- -0.437993784529
98
- );
99
- array _stdscaleInt_439 {4} _temporary_ (
100
- 0.9721848963817
101
- 9.2815283979727
102
- 2.3431499789112
103
- 12640.698506466
104
- );
105
- array _stdcenterInt_439 {4} _temporary_ (
106
- 3.8235639939605
107
- 21.186690186017
108
- 5.8089737010904
109
- 48469.63695183
110
- );
111
-
112
- *************** check missing interval value ******************;
113
- _missingflag4Int_ = 0;
114
- do _i_ = 1 to _numberOfIntVars_ until(_missingflag4Int_);
115
- if missing( _intVars_439[_i_] ) then
116
- _missingflag4Int_ = 1;
117
- end;
118
-
119
- if (_missingflag4Int_ = 1) then
120
- substr(_WARN_, 1, 1) = 'M';
121
- ********** prepare interval variable values *********;
122
- do _i_ = 1 to _numberOfIntVars_;
123
- if missing (_intVars_439[_i_] ) then do;
124
- _intVals_439[_i_] = .;
125
- _intStdVals_439[_i_] = .;
126
- end; else do;
127
- if missing (_stdscaleInt_439[_i_] ) then do;
128
- _intStdVals_439[_i_] = ( _intVars_439[_i_] - _stdcenterInt_439[_i_]);
129
- end; else do;
130
- _intStdVals_439[_i_] = ( _intVars_439[_i_] - _stdcenterInt_439[_i_])
131
- / _stdscaleInt_439[_i_];
132
- end;
133
- _intVals_439[_i_] = _intVars_439[_i_];
134
- end;
135
- end;
136
- ****************** find the closest cluster ******************;
137
- if _missingflag4Int_ > 0 then
138
- do;
139
- _CLUSTER_ID_ = .;
140
- _DISTANCE_ = .;
141
- _minDistInt_ = .;
142
- _STANDARDIZED_DISTANCE_ = .;
143
- end;
144
- else
145
- do;
146
- _CLUSTER_ID_ = .;
147
- _minDist_ = 8.988465674E307;
148
- do _i_=1 to 4;
149
- _intMindist2cntr_ = 0;
150
- do _j_=1 to 4;
151
- _dist_ = _intStdVals_439{_j_} - _stdcntrcoordsInt_439{_i_,_j_};
152
- _dist_ = _dist_ ** 2;
153
- _intMindist2cntr_ = _intMindist2cntr_ + _dist_;
154
- end;
155
- _intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
156
- if( _minDist_ > _intMindist2cntr_) then do;
157
- _CLUSTER_ID_ = _i_;
158
- _minDist_ = _intMindist2cntr_;
159
- end;
160
- _STANDARDIZED_DISTANCE_ = _minDist_;
161
- end;
162
- _DISTANCE_ = 8.988465674E307;
163
- _i_ = _CLUSTER_ID_;
164
- _intMindist2cntr_ = 0;
165
- do _j_=1 to 4;
166
- _dist_ = _intVals_439{_j_} - _cntrcoordsInt_439{_i_,_j_};
167
- _dist_ = _dist_ ** 2;
168
- _intMindist2cntr_ = _intMindist2cntr_ + _dist_;
169
- end;
170
- _intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
171
- _DISTANCE_ = _intMindist2cntr_;
172
- end;
173
-
174
- if (MISSING('_CLUSTER_ID_'n))then _CLUSTER_ID_ = -1; /*------------------------------------------*/
175
- drop '_CLUSTER_ID_'n '_DISTANCE_'n '_WARN_'n '_STANDARDIZED_DISTANCE_'n;
176
- '_CLUSTER_ID__439'n='_CLUSTER_ID_'n;
177
- '_DISTANCE__439'n='_DISTANCE_'n;
178
- '_WARN__439'n='_WARN_'n;
179
- '_STANDARDIZED_DISTANCE__439'n='_STANDARDIZED_DISTANCE_'n;
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 : 30Jul2019:20:16:16
9
+ Locale : en_US
10
+ Model Type : Cluster
11
+ Interval variable: SDOH_Physically_Unhealthy_Days_(SDOH6 Physically Unhealthy Days)
12
+ Interval variable: SDOH_Per_Adults_Bachelors(SDOH2 Education1)
13
+ Interval variable: SDOH_Unemployment_Rate(SDOH3 Unemployment Rate)
14
+ Interval variable: SDOH_Median_Household_Income(SDOH4 Median Household Income)
15
+ ------------------------------------------*/
16
+
17
+ length _WARN_ $4;
18
+ label _WARN_ = 'Warnings';
19
+ label _CLUSTER_ID_ = 'Cluster ID';
20
+ label _DISTANCE_ = 'Distance to Centroid';
21
+
22
+ _i_ = 0;
23
+ _j_ = 0;
24
+ _k_ = 0;
25
+ _l_ = 0;
26
+ _dist_ = 0;
27
+ _minDist_ = 0;
28
+ _found_ = 0;
29
+ _unknown_ = 0;
30
+ _unknownflag_ = 0;
31
+ _intMindist2cntr_ = 0;
32
+ _missingflag4Int_ = 0;
33
+ _numberOfIntVars_ = 4;
34
+ _minDistInt_ = 0;
35
+ label _STANDARDIZED_DISTANCE_ = 'Standardized Distance to Centroid';
36
+
37
+ drop _i_;
38
+ drop _j_;
39
+ drop _k_;
40
+ drop _l_;
41
+ drop _dist_;
42
+ drop _minDist_;
43
+ drop _minDistInt_;
44
+ drop _unknown_;
45
+ drop _unknownflag_;
46
+ drop _found_;
47
+ drop _intMindist2cntr_;
48
+ drop _missingflag4Int_;
49
+ drop _numberOfIntVars_;
50
+ drop _minDistInt_;
51
+
52
+ array _intVals_439{4} _temporary_;
53
+ array _intStdVals_439{4} _temporary_;
54
+ array _intVars_439[4] _temporary_;
55
+ _intVars_439[1] =
56
+ SDOH_Physically_Unhealthy_Days_;
57
+ _intVars_439[2] =
58
+ SDOH_Per_Adults_Bachelors;
59
+ _intVars_439[3] =
60
+ SDOH_Unemployment_Rate;
61
+ _intVars_439[4] =
62
+ SDOH_Median_Household_Income;
63
+ array _cntrcoordsInt_439{4,4} _temporary_ (
64
+ 3.0267344264664
65
+ 40.73654855643
66
+ 4.5016404199475
67
+ 73253.345144357
68
+ 3.1748155867421
69
+ 23.482869339272
70
+ 4.4175018559762
71
+ 52859.890126206
72
+ 5.0717963953358
73
+ 13.894727354664
74
+ 9.3289319513294
75
+ 35934.982875169
76
+ 4.17723170653
77
+ 17.079836808704
78
+ 6.0463463281958
79
+ 42933.089573889
80
+ );
81
+ array _stdcntrcoordsInt_439 {4,4} _temporary_ (
82
+ -0.819627593948
83
+ 2.1063188660484
84
+ -0.557938370531
85
+ 1.9606280602175
86
+ -0.667309695546
87
+ 0.2473923533712
88
+ -0.59384668401
89
+ 0.3473109632455
90
+ 1.2839454778829
91
+ -0.785642463039
92
+ 1.5022334387125
93
+ -0.991610872631
94
+ 0.363786470954
95
+ -0.442475980379
96
+ 0.1013049225367
97
+ -0.437993784529
98
+ );
99
+ array _stdscaleInt_439 {4} _temporary_ (
100
+ 0.9721848963817
101
+ 9.2815283979727
102
+ 2.3431499789112
103
+ 12640.698506466
104
+ );
105
+ array _stdcenterInt_439 {4} _temporary_ (
106
+ 3.8235639939605
107
+ 21.186690186017
108
+ 5.8089737010904
109
+ 48469.63695183
110
+ );
111
+
112
+ *************** check missing interval value ******************;
113
+ _missingflag4Int_ = 0;
114
+ do _i_ = 1 to _numberOfIntVars_ until(_missingflag4Int_);
115
+ if missing( _intVars_439[_i_] ) then
116
+ _missingflag4Int_ = 1;
117
+ end;
118
+
119
+ if (_missingflag4Int_ = 1) then
120
+ substr(_WARN_, 1, 1) = 'M';
121
+ ********** prepare interval variable values *********;
122
+ do _i_ = 1 to _numberOfIntVars_;
123
+ if missing (_intVars_439[_i_] ) then do;
124
+ _intVals_439[_i_] = .;
125
+ _intStdVals_439[_i_] = .;
126
+ end; else do;
127
+ if missing (_stdscaleInt_439[_i_] ) then do;
128
+ _intStdVals_439[_i_] = ( _intVars_439[_i_] - _stdcenterInt_439[_i_]);
129
+ end; else do;
130
+ _intStdVals_439[_i_] = ( _intVars_439[_i_] - _stdcenterInt_439[_i_])
131
+ / _stdscaleInt_439[_i_];
132
+ end;
133
+ _intVals_439[_i_] = _intVars_439[_i_];
134
+ end;
135
+ end;
136
+ ****************** find the closest cluster ******************;
137
+ if _missingflag4Int_ > 0 then
138
+ do;
139
+ _CLUSTER_ID_ = .;
140
+ _DISTANCE_ = .;
141
+ _minDistInt_ = .;
142
+ _STANDARDIZED_DISTANCE_ = .;
143
+ end;
144
+ else
145
+ do;
146
+ _CLUSTER_ID_ = .;
147
+ _minDist_ = 8.988465674E307;
148
+ do _i_=1 to 4;
149
+ _intMindist2cntr_ = 0;
150
+ do _j_=1 to 4;
151
+ _dist_ = _intStdVals_439{_j_} - _stdcntrcoordsInt_439{_i_,_j_};
152
+ _dist_ = _dist_ ** 2;
153
+ _intMindist2cntr_ = _intMindist2cntr_ + _dist_;
154
+ end;
155
+ _intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
156
+ if( _minDist_ > _intMindist2cntr_) then do;
157
+ _CLUSTER_ID_ = _i_;
158
+ _minDist_ = _intMindist2cntr_;
159
+ end;
160
+ _STANDARDIZED_DISTANCE_ = _minDist_;
161
+ end;
162
+ _DISTANCE_ = 8.988465674E307;
163
+ _i_ = _CLUSTER_ID_;
164
+ _intMindist2cntr_ = 0;
165
+ do _j_=1 to 4;
166
+ _dist_ = _intVals_439{_j_} - _cntrcoordsInt_439{_i_,_j_};
167
+ _dist_ = _dist_ ** 2;
168
+ _intMindist2cntr_ = _intMindist2cntr_ + _dist_;
169
+ end;
170
+ _intMindist2cntr_ = _intMindist2cntr_ ** 0.5;
171
+ _DISTANCE_ = _intMindist2cntr_;
172
+ end;
173
+
174
+ if (MISSING('_CLUSTER_ID_'n))then _CLUSTER_ID_ = -1; /*------------------------------------------*/
175
+ drop '_CLUSTER_ID_'n '_DISTANCE_'n '_WARN_'n '_STANDARDIZED_DISTANCE_'n;
176
+ '_CLUSTER_ID__439'n='_CLUSTER_ID_'n;
177
+ '_DISTANCE__439'n='_DISTANCE_'n;
178
+ '_WARN__439'n='_WARN_'n;
179
+ '_STANDARDIZED_DISTANCE__439'n='_STANDARDIZED_DISTANCE_'n;
180
180
  /*------------------------------------------*/