@sap/async-xsjs 1.0.2
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/CHANGELOG.md +26 -0
- package/LICENSE +37 -0
- package/README.md +445 -0
- package/differences.md +162 -0
- package/docs/$.Application.html +262 -0
- package/docs/$.Session.html +674 -0
- package/docs/$.db.CallableStatement.html +2524 -0
- package/docs/$.db.Connection.html +511 -0
- package/docs/$.db.ParameterMetaData.html +805 -0
- package/docs/$.db.PreparedStatement.html +1796 -0
- package/docs/$.db.ResultSet.html +1308 -0
- package/docs/$.db.ResultSetMetaData.html +800 -0
- package/docs/$.db.SQLException.html +259 -0
- package/docs/$.db.html +773 -0
- package/docs/$.hdb.ColumnMetadata.html +438 -0
- package/docs/$.hdb.Connection.html +663 -0
- package/docs/$.hdb.ProcedureResult.html +280 -0
- package/docs/$.hdb.ResultSet.html +324 -0
- package/docs/$.hdb.ResultSetIterator.html +315 -0
- package/docs/$.hdb.ResultSetMetaData.html +259 -0
- package/docs/$.hdb.SQLException.html +259 -0
- package/docs/$.hdb.html +557 -0
- package/docs/$.html +471 -0
- package/docs/$.jobs.Job.html +783 -0
- package/docs/$.jobs.JobLog.html +380 -0
- package/docs/$.jobs.JobSchedules.html +852 -0
- package/docs/$.jobs.html +238 -0
- package/docs/$.net.Destination.html +304 -0
- package/docs/$.net.Mail.Part.html +510 -0
- package/docs/$.net.Mail.html +504 -0
- package/docs/$.net.SMTPConnection.html +347 -0
- package/docs/$.net.html +749 -0
- package/docs/$.net.http.Client.html +562 -0
- package/docs/$.net.http.Destination.html +237 -0
- package/docs/$.net.http.Request.html +567 -0
- package/docs/$.net.http.html +292 -0
- package/docs/$.security.AntiVirus.html +361 -0
- package/docs/$.security.Store.html +636 -0
- package/docs/$.security.crypto.html +414 -0
- package/docs/$.security.html +247 -0
- package/docs/$.security.x509.html +373 -0
- package/docs/$.text.analysis.Session.html +983 -0
- package/docs/$.text.analysis.html +242 -0
- package/docs/$.text.html +246 -0
- package/docs/$.text.mining.Session.html +2018 -0
- package/docs/$.text.mining.html +242 -0
- package/docs/$.trace.html +525 -0
- package/docs/$.util.SAXParser.html +955 -0
- package/docs/$.util.Zip.html +474 -0
- package/docs/$.util.codec.html +414 -0
- package/docs/$.util.compression.html +357 -0
- package/docs/$.util.html +325 -0
- package/docs/$.util.sql.html +290 -0
- package/docs/$.web.Body.html +333 -0
- package/docs/$.web.EntityList.html +296 -0
- package/docs/$.web.TupelList.html +496 -0
- package/docs/$.web.WebEntityRequest.html +393 -0
- package/docs/$.web.WebEntityResponse.html +392 -0
- package/docs/$.web.WebRequest.html +560 -0
- package/docs/$.web.WebResponse.html +609 -0
- package/docs/$.web.html +246 -0
- package/docs/Copyright-SAP.html +39 -0
- package/docs/Disclaimer-SAP.html +55 -0
- package/docs/index.html +232 -0
- package/docs/styles/jsdoc-default.css +382 -0
- package/lib/AppConfig.js +36 -0
- package/lib/AuditLogger.js +41 -0
- package/lib/cacert.js +26 -0
- package/lib/ctypes.js +153 -0
- package/lib/destinations/dest-provider.js +57 -0
- package/lib/index.js +235 -0
- package/lib/jobs/Action.js +40 -0
- package/lib/jobs/Job.js +100 -0
- package/lib/jobs/JobManager.js +150 -0
- package/lib/jobs/JobsRuntime.js +133 -0
- package/lib/jobs/SqlScriptJobRunner.js +36 -0
- package/lib/jobs/XsjsJobRunner.js +78 -0
- package/lib/jobs/index.js +11 -0
- package/lib/logging.js +16 -0
- package/lib/middleware.js +125 -0
- package/lib/odata/ODataService.js +125 -0
- package/lib/odata/index.js +7 -0
- package/lib/odata/service-factory.js +26 -0
- package/lib/passport-noauth.js +17 -0
- package/lib/routes.js +115 -0
- package/lib/runtime.js +740 -0
- package/lib/sandbox.js +40 -0
- package/lib/utils/XsJsFunctionRunner.js +57 -0
- package/lib/utils/XsJsLibFunctionRunner.js +57 -0
- package/lib/utils/buffer-utils.js +77 -0
- package/lib/utils/compression-utils.js +14 -0
- package/lib/utils/date-utils.js +104 -0
- package/lib/utils/errors/HttpError.js +20 -0
- package/lib/utils/errors/wrap-app-error.js +18 -0
- package/lib/utils/index.js +17 -0
- package/lib/utils/xs-function-runner.js +51 -0
- package/lib/utils/xs-types.js +21 -0
- package/lib/utils/xspath.js +36 -0
- package/lib/utils/xsstack.js +28 -0
- package/lib/views/error.html +28 -0
- package/lib/xsjs/Application.js +28 -0
- package/lib/xsjs/Locale.js +53 -0
- package/lib/xsjs/Session.js +31 -0
- package/lib/xsjs/constants.js +71 -0
- package/lib/xsjs/db/common/DbBase.js +85 -0
- package/lib/xsjs/db/common/DbOptions.js +163 -0
- package/lib/xsjs/db/common/arguments-validation.js +102 -0
- package/lib/xsjs/db/common/connection.js +12 -0
- package/lib/xsjs/db/common/enums.js +93 -0
- package/lib/xsjs/db/common/execute-batch.js +38 -0
- package/lib/xsjs/db/common/parse-time.js +139 -0
- package/lib/xsjs/db/dbapi/CallableStatement.js +192 -0
- package/lib/xsjs/db/dbapi/Connection.js +78 -0
- package/lib/xsjs/db/dbapi/DB.js +39 -0
- package/lib/xsjs/db/dbapi/ParameterMetaData.js +118 -0
- package/lib/xsjs/db/dbapi/PreparedStatement.js +78 -0
- package/lib/xsjs/db/dbapi/ResultSet.js +220 -0
- package/lib/xsjs/db/dbapi/ResultSetMetaData.js +116 -0
- package/lib/xsjs/db/dbapi/Statement.js +514 -0
- package/lib/xsjs/db/dbapi/conversions.js +113 -0
- package/lib/xsjs/db/dbapi/fetch-rows.js +32 -0
- package/lib/xsjs/db/hdbapi/Connection.js +525 -0
- package/lib/xsjs/db/hdbapi/HDB.js +32 -0
- package/lib/xsjs/db/hdbapi/ResultSetIterator.js +40 -0
- package/lib/xsjs/db/hdbapi/convert.js +77 -0
- package/lib/xsjs/db/hdbapi/table-string-parser.js +52 -0
- package/lib/xsjs/db/index.js +4 -0
- package/lib/xsjs/index.js +13 -0
- package/lib/xsjs/jobs/Job.js +228 -0
- package/lib/xsjs/jobs/Jobs.js +11 -0
- package/lib/xsjs/jobs/Logs.js +127 -0
- package/lib/xsjs/jobs/Schedule.js +110 -0
- package/lib/xsjs/jobs/Schedules.js +108 -0
- package/lib/xsjs/net/Destination.js +43 -0
- package/lib/xsjs/net/http/Client.js +220 -0
- package/lib/xsjs/net/http/HTTP.js +72 -0
- package/lib/xsjs/net/index.js +5 -0
- package/lib/xsjs/net/smtp/Mail.js +38 -0
- package/lib/xsjs/net/smtp/Part.js +30 -0
- package/lib/xsjs/net/smtp/SMTPConnection.js +39 -0
- package/lib/xsjs/net/smtp/index.js +18 -0
- package/lib/xsjs/net/smtp/nodemailer-util.js +77 -0
- package/lib/xsjs/require.js +39 -0
- package/lib/xsjs/security/AntiVirus.js +31 -0
- package/lib/xsjs/security/Store.js +119 -0
- package/lib/xsjs/security/crypto.js +23 -0
- package/lib/xsjs/security/index.js +5 -0
- package/lib/xsjs/security/x509.js +12 -0
- package/lib/xsjs/text/analysis/Session.js +128 -0
- package/lib/xsjs/text/index.js +30 -0
- package/lib/xsjs/text/mining/Session.js +82 -0
- package/lib/xsjs/trace/trace.js +41 -0
- package/lib/xsjs/util/SAXParser.js +174 -0
- package/lib/xsjs/util/Zip.js +220 -0
- package/lib/xsjs/util/codec.js +33 -0
- package/lib/xsjs/util/compression.js +24 -0
- package/lib/xsjs/util/index.js +22 -0
- package/lib/xsjs/web/BasicWebEntity.js +41 -0
- package/lib/xsjs/web/EntityList.js +11 -0
- package/lib/xsjs/web/TupelLists/CookiesTupelList.js +47 -0
- package/lib/xsjs/web/TupelLists/HeadersTupelList.js +55 -0
- package/lib/xsjs/web/TupelLists/ParametersTupelList.js +83 -0
- package/lib/xsjs/web/TupelLists/TupelListBase.js +45 -0
- package/lib/xsjs/web/WebBody.js +135 -0
- package/lib/xsjs/web/WebEntityRequest.js +40 -0
- package/lib/xsjs/web/WebEntityResponse.js +26 -0
- package/lib/xsjs/web/WebRequest.js +209 -0
- package/lib/xsjs/web/WebResponse.js +183 -0
- package/lib/xsjs/web/index.js +4 -0
- package/lib/xsjs/web/utils/HeadersParser.js +53 -0
- package/lib/xsjs/web/utils/HttpRequestParser.js +93 -0
- package/lib/xsjs/web/utils/MultipartParser.js +163 -0
- package/lib/xsjs/web/utils/MultipartResponseBuilder.js +73 -0
- package/lib/xsjs/web/utils/SetCookieParser.js +32 -0
- package/lib/xsjslib/TextBundleWrapper.js +46 -0
- package/lib/xsjslib/index.js +11 -0
- package/npm-shrinkwrap.json +11540 -0
- package/package.json +84 -0
|
@@ -0,0 +1,382 @@
|
|
|
1
|
+
html{
|
|
2
|
+
overflow: auto;
|
|
3
|
+
background-color: #fff;}
|
|
4
|
+
|
|
5
|
+
body{
|
|
6
|
+
font: 14px "DejaVu Sans Condensed", "Liberation Sans", "Nimbus Sans L", Tahoma, Geneva, "Helvetica Neue", Helvetica, Arial, sans serif;
|
|
7
|
+
line-height: 130%;
|
|
8
|
+
color: #000;
|
|
9
|
+
background-color: #fff;}
|
|
10
|
+
|
|
11
|
+
a{
|
|
12
|
+
color: #444;}
|
|
13
|
+
|
|
14
|
+
a:visited{
|
|
15
|
+
color: #444;}
|
|
16
|
+
|
|
17
|
+
a:active{
|
|
18
|
+
color: #444;}
|
|
19
|
+
|
|
20
|
+
header{
|
|
21
|
+
display: block;
|
|
22
|
+
padding: 6px 4px;}
|
|
23
|
+
|
|
24
|
+
.class-description{
|
|
25
|
+
font-style: italic;
|
|
26
|
+
font-family: Palatino, 'Palatino Linotype', serif;
|
|
27
|
+
font-size: 130%;
|
|
28
|
+
line-height: 140%;
|
|
29
|
+
margin-bottom: 1em;
|
|
30
|
+
margin-top: 1em;}
|
|
31
|
+
|
|
32
|
+
#main{
|
|
33
|
+
float: left;
|
|
34
|
+
width: 100%;}
|
|
35
|
+
|
|
36
|
+
.oblique{
|
|
37
|
+
color: #888;
|
|
38
|
+
font-size: 85%;}
|
|
39
|
+
|
|
40
|
+
section{
|
|
41
|
+
display: block;
|
|
42
|
+
background-color: #fff;
|
|
43
|
+
padding: 12px 24px;
|
|
44
|
+
border-bottom: 1px solid #ccc;
|
|
45
|
+
margin-right: 240px;}
|
|
46
|
+
|
|
47
|
+
.optional:after{
|
|
48
|
+
content: "opt";
|
|
49
|
+
font-size: 60%;
|
|
50
|
+
color: #aaa;
|
|
51
|
+
font-style: italic;
|
|
52
|
+
font-weight: lighter;}
|
|
53
|
+
|
|
54
|
+
nav{
|
|
55
|
+
display: block;
|
|
56
|
+
float: left;
|
|
57
|
+
margin-left: -230px;
|
|
58
|
+
margin-top: 28px;
|
|
59
|
+
width: 220px;
|
|
60
|
+
border-left: 1px solid #ccc;
|
|
61
|
+
padding-left: 9px;}
|
|
62
|
+
|
|
63
|
+
nav ul{
|
|
64
|
+
font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
|
|
65
|
+
font-size: 100%;
|
|
66
|
+
line-height: 17px;
|
|
67
|
+
padding:0;
|
|
68
|
+
margin:0;
|
|
69
|
+
list-style-type:none;}
|
|
70
|
+
|
|
71
|
+
nav h2 a, nav h2 a:visited{
|
|
72
|
+
color: #A35A00;
|
|
73
|
+
text-decoration: none;}
|
|
74
|
+
|
|
75
|
+
nav h3{
|
|
76
|
+
margin-top: 12px;}
|
|
77
|
+
|
|
78
|
+
nav li{
|
|
79
|
+
margin-top: 6px;}
|
|
80
|
+
|
|
81
|
+
nav a{
|
|
82
|
+
color: #2C2924;}
|
|
83
|
+
|
|
84
|
+
nav a:visited{
|
|
85
|
+
color: #5D5954;}
|
|
86
|
+
|
|
87
|
+
nav a:active{
|
|
88
|
+
color: #5D5954;}
|
|
89
|
+
|
|
90
|
+
footer{
|
|
91
|
+
display: block;
|
|
92
|
+
padding: 6px;
|
|
93
|
+
margin-top: 12px;
|
|
94
|
+
font-style: italic;
|
|
95
|
+
font-size: 90%;}
|
|
96
|
+
|
|
97
|
+
h1{
|
|
98
|
+
font-size: 200%;
|
|
99
|
+
font-weight: bold;
|
|
100
|
+
letter-spacing: -0.01em;
|
|
101
|
+
margin: 6px 0 9px 0;}
|
|
102
|
+
|
|
103
|
+
h2{
|
|
104
|
+
font-size: 170%;
|
|
105
|
+
font-weight: bold;
|
|
106
|
+
letter-spacing: -0.01em;
|
|
107
|
+
margin: 6px 0 3px 0;}
|
|
108
|
+
|
|
109
|
+
h3{
|
|
110
|
+
font-size: 150%;
|
|
111
|
+
font-weight: bold;
|
|
112
|
+
letter-spacing: -0.01em;
|
|
113
|
+
margin-top: 16px;
|
|
114
|
+
margin: 6px 0 3px 0;}
|
|
115
|
+
|
|
116
|
+
h4{
|
|
117
|
+
font-size: 130%;
|
|
118
|
+
font-weight: bold;
|
|
119
|
+
letter-spacing: -0.01em;
|
|
120
|
+
margin-top: 16px;
|
|
121
|
+
margin: 18px 0 3px 0;
|
|
122
|
+
color: #A35A00;}
|
|
123
|
+
|
|
124
|
+
h5, .container-overview .subsection-title{
|
|
125
|
+
font-size: 120%;
|
|
126
|
+
font-weight: bold;
|
|
127
|
+
letter-spacing: -0.01em;
|
|
128
|
+
margin: 8px 0 3px -16px;}
|
|
129
|
+
|
|
130
|
+
h6{
|
|
131
|
+
font-size: 100%;
|
|
132
|
+
letter-spacing: -0.01em;
|
|
133
|
+
margin: 6px 0 3px 0;
|
|
134
|
+
font-style: italic;}
|
|
135
|
+
|
|
136
|
+
.ancestors{ color: #999; }
|
|
137
|
+
.ancestors a{
|
|
138
|
+
color: #999 !important;
|
|
139
|
+
text-decoration: none;}
|
|
140
|
+
|
|
141
|
+
.important{
|
|
142
|
+
font-weight: bold;
|
|
143
|
+
color: #950B02;}
|
|
144
|
+
|
|
145
|
+
.yes-def{
|
|
146
|
+
text-indent: -1000px;}
|
|
147
|
+
|
|
148
|
+
.type-signature{
|
|
149
|
+
color: #aaa;}
|
|
150
|
+
|
|
151
|
+
.name, .signature{
|
|
152
|
+
font-family: Consolas, "Lucida Console", Monaco, monospace;}
|
|
153
|
+
|
|
154
|
+
.details{ margin-top: 14px;}
|
|
155
|
+
.details dt{ width:100px; float:left; border-left: 2px solid #DDD; padding-left: 10px; padding-top: 6px;}
|
|
156
|
+
.details dd{ margin-left: 50px;}
|
|
157
|
+
.details ul{ margin: 0;}
|
|
158
|
+
.details ul{ list-style-type: none;}
|
|
159
|
+
.details li{ margin-left: 30px; padding-top: 6px;}
|
|
160
|
+
|
|
161
|
+
.description{
|
|
162
|
+
margin-bottom: 1em;
|
|
163
|
+
margin-left: -16px;
|
|
164
|
+
margin-top: 1em;}
|
|
165
|
+
|
|
166
|
+
.code-caption{
|
|
167
|
+
font-style: italic;
|
|
168
|
+
font-family: Palatino, 'Palatino Linotype', serif;
|
|
169
|
+
font-size: 107%;
|
|
170
|
+
margin: 0;}
|
|
171
|
+
|
|
172
|
+
.prettyprint{
|
|
173
|
+
border: 1px solid #ddd;
|
|
174
|
+
width: 80%;
|
|
175
|
+
overflow: auto;
|
|
176
|
+
padding-left: 2em;}
|
|
177
|
+
|
|
178
|
+
.prettyprint.source{
|
|
179
|
+
width: inherit;}
|
|
180
|
+
|
|
181
|
+
.prettyprint code{
|
|
182
|
+
font-family: Consolas, 'Lucida Console', Monaco, monospace;
|
|
183
|
+
font-size: 100%;
|
|
184
|
+
line-height: 18px;
|
|
185
|
+
display: block;
|
|
186
|
+
padding-left: 0.5em;
|
|
187
|
+
background-color: #fff;
|
|
188
|
+
color: #000;
|
|
189
|
+
border-left: 3px #ddd solid;}
|
|
190
|
+
|
|
191
|
+
.prettyprint code span.line-numbers{
|
|
192
|
+
color: #888;
|
|
193
|
+
pointer-events: none;
|
|
194
|
+
font-size: 85%;
|
|
195
|
+
display: inline-block;
|
|
196
|
+
width: 0em; /* works for line-numbers below 1000 lines */
|
|
197
|
+
letter-spacing: -1px;
|
|
198
|
+
-webkit-user-select: none;
|
|
199
|
+
-khtml-user-select: none;
|
|
200
|
+
-moz-user-select: none;
|
|
201
|
+
-ms-user-select: none;
|
|
202
|
+
-o-user-select: none;
|
|
203
|
+
user-select: none;}
|
|
204
|
+
|
|
205
|
+
span.line-numbers:after{
|
|
206
|
+
display: inline-block;
|
|
207
|
+
text-align: right;
|
|
208
|
+
content: attr(rowId);
|
|
209
|
+
position: relative;
|
|
210
|
+
left: -4em;
|
|
211
|
+
width: 2em;
|
|
212
|
+
padding: 0 0.5em;}
|
|
213
|
+
|
|
214
|
+
.params, .props{
|
|
215
|
+
border-spacing: 0;
|
|
216
|
+
border: 0;
|
|
217
|
+
border-collapse: collapse;}
|
|
218
|
+
|
|
219
|
+
.params .name, .props .name, .name code{
|
|
220
|
+
color: #A35A00;
|
|
221
|
+
font-family: Consolas, 'Lucida Console', Monaco, monospace;
|
|
222
|
+
font-size: 100%;}
|
|
223
|
+
|
|
224
|
+
.params td, .params th, .props td, .props th{
|
|
225
|
+
border: 1px solid #ddd;
|
|
226
|
+
margin: 0px;
|
|
227
|
+
text-align: left;
|
|
228
|
+
vertical-align: top;
|
|
229
|
+
padding: 4px 6px;
|
|
230
|
+
display: table-cell;}
|
|
231
|
+
|
|
232
|
+
.params thead tr, .props thead tr{
|
|
233
|
+
background-color: #ddd;
|
|
234
|
+
font-weight: bold;}
|
|
235
|
+
|
|
236
|
+
.params .params thead tr, .props .props thead tr{
|
|
237
|
+
background-color: #fff;
|
|
238
|
+
font-weight: bold;}
|
|
239
|
+
|
|
240
|
+
.params th, .props th{ border-right: 1px solid #aaa;}
|
|
241
|
+
.params thead .last, .props thead .last{ border-right: 1px solid #ddd;}
|
|
242
|
+
|
|
243
|
+
.disabled{
|
|
244
|
+
color: #454545;}
|
|
245
|
+
|
|
246
|
+
.message{
|
|
247
|
+
-webkit-background-size: 40px 40px;
|
|
248
|
+
-moz-background-size: 40px 40px;
|
|
249
|
+
background-size: 40px 40px;
|
|
250
|
+
background-image: -webkit-gradient(linear, left top, right bottom,
|
|
251
|
+
color-stop(.25, rgba(255, 255, 255, .075)), color-stop(.25, transparent),
|
|
252
|
+
color-stop(.5, transparent), color-stop(.5, rgba(255, 255, 255, .075)),
|
|
253
|
+
color-stop(.75, rgba(255, 255, 255, .075)), color-stop(.75, transparent),
|
|
254
|
+
to(transparent));
|
|
255
|
+
background-image: -webkit-linear-gradient(135deg, rgba(255, 255, 255, .075) 25%, transparent 25%,
|
|
256
|
+
transparent 50%, rgba(255, 255, 255, .075) 50%, rgba(255, 255, 255, .075) 75%,
|
|
257
|
+
transparent 75%, transparent);
|
|
258
|
+
background-image: -moz-linear-gradient(135deg, rgba(255, 255, 255, .075) 25%, transparent 25%,
|
|
259
|
+
transparent 50%, rgba(255, 255, 255, .075) 50%, rgba(255, 255, 255, .075) 75%,
|
|
260
|
+
transparent 75%, transparent);
|
|
261
|
+
background-image: -ms-linear-gradient(135deg, rgba(255, 255, 255, .075) 25%, transparent 25%,
|
|
262
|
+
transparent 50%, rgba(255, 255, 255, .075) 50%, rgba(255, 255, 255, .075) 75%,
|
|
263
|
+
transparent 75%, transparent);
|
|
264
|
+
background-image: -o-linear-gradient(135deg, rgba(255, 255, 255, .075) 25%, transparent 25%,
|
|
265
|
+
transparent 50%, rgba(255, 255, 255, .075) 50%, rgba(255, 255, 255, .075) 75%,
|
|
266
|
+
transparent 75%, transparent);
|
|
267
|
+
background-image: linear-gradient(135deg, rgba(255, 255, 255, .075) 25%, transparent 25%,
|
|
268
|
+
transparent 50%, rgba(255, 255, 255, .075) 50%, rgba(255, 255, 255, .075) 75%,
|
|
269
|
+
transparent 75%, transparent);
|
|
270
|
+
box-shadow: 3px 3px 2px rgba(0,0,0,.4);
|
|
271
|
+
border: 1px solid;
|
|
272
|
+
color: #fff;
|
|
273
|
+
padding: 15px;
|
|
274
|
+
text-shadow: 1px 2px 0 rgba(0,0,0,.5);}
|
|
275
|
+
|
|
276
|
+
.warning{
|
|
277
|
+
background-color: #A35A00;
|
|
278
|
+
border-color: #713C00;}
|
|
279
|
+
|
|
280
|
+
|
|
281
|
+
/* Tomorrow Theme */
|
|
282
|
+
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
|
|
283
|
+
/* Pretty printing styles. Used with prettify.js. */
|
|
284
|
+
/* SPAN elements with the classes below are added by prettyprint. */
|
|
285
|
+
/* plain text */
|
|
286
|
+
.pln{
|
|
287
|
+
color: #4d4d4c;}
|
|
288
|
+
|
|
289
|
+
@media screen{
|
|
290
|
+
/* string content */
|
|
291
|
+
.str{
|
|
292
|
+
color: #718c00;}
|
|
293
|
+
|
|
294
|
+
/* a keyword */
|
|
295
|
+
.kwd{
|
|
296
|
+
color: #8959a8;}
|
|
297
|
+
|
|
298
|
+
/* a comment */
|
|
299
|
+
.com{
|
|
300
|
+
color: #8e908c;}
|
|
301
|
+
|
|
302
|
+
/* a type name */
|
|
303
|
+
.typ{
|
|
304
|
+
color: #4271ae;}
|
|
305
|
+
|
|
306
|
+
/* a literal value */
|
|
307
|
+
.lit{
|
|
308
|
+
color: #f5871f;}
|
|
309
|
+
|
|
310
|
+
/* punctuation */
|
|
311
|
+
.pun{
|
|
312
|
+
color: #4d4d4c;}
|
|
313
|
+
|
|
314
|
+
/* lisp open bracket */
|
|
315
|
+
.opn{
|
|
316
|
+
color: #4d4d4c;}
|
|
317
|
+
|
|
318
|
+
/* lisp close bracket */
|
|
319
|
+
.clo{
|
|
320
|
+
color: #4d4d4c;}
|
|
321
|
+
|
|
322
|
+
/* a markup tag name */
|
|
323
|
+
.tag{
|
|
324
|
+
color: #c82829;}
|
|
325
|
+
|
|
326
|
+
/* a markup attribute name */
|
|
327
|
+
.atn{
|
|
328
|
+
color: #f5871f;}
|
|
329
|
+
|
|
330
|
+
/* a markup attribute value */
|
|
331
|
+
.atv{
|
|
332
|
+
color: #3e999f;}
|
|
333
|
+
|
|
334
|
+
/* a declaration */
|
|
335
|
+
.dec{
|
|
336
|
+
color: #f5871f;}
|
|
337
|
+
|
|
338
|
+
/* a variable name */
|
|
339
|
+
.var{
|
|
340
|
+
color: #c82829;}
|
|
341
|
+
|
|
342
|
+
/* a function name */
|
|
343
|
+
.fun{
|
|
344
|
+
color: #4271ae;} }
|
|
345
|
+
/* Use higher contrast and text-weight for printable form. */
|
|
346
|
+
@media print, projection{
|
|
347
|
+
.str{
|
|
348
|
+
color: #060;}
|
|
349
|
+
|
|
350
|
+
.kwd{
|
|
351
|
+
color: #006;
|
|
352
|
+
font-weight: bold;}
|
|
353
|
+
|
|
354
|
+
.com{
|
|
355
|
+
color: #600;
|
|
356
|
+
font-style: italic;}
|
|
357
|
+
|
|
358
|
+
.typ{
|
|
359
|
+
color: #404;
|
|
360
|
+
font-weight: bold;}
|
|
361
|
+
|
|
362
|
+
.lit{
|
|
363
|
+
color: #044;}
|
|
364
|
+
|
|
365
|
+
.pun, .opn, .clo{
|
|
366
|
+
color: #440;}
|
|
367
|
+
|
|
368
|
+
.tag{
|
|
369
|
+
color: #006;
|
|
370
|
+
font-weight: bold;}
|
|
371
|
+
|
|
372
|
+
.atn{
|
|
373
|
+
color: #404;}
|
|
374
|
+
|
|
375
|
+
.atv{
|
|
376
|
+
color: #060;} }
|
|
377
|
+
|
|
378
|
+
/* Specify class=linenums on a pre to get line numbering */
|
|
379
|
+
ol.linenums{
|
|
380
|
+
margin-top: 0;
|
|
381
|
+
margin-bottom: 0;}
|
|
382
|
+
|
package/lib/AppConfig.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var os = require('os');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
module.exports = AppConfig;
|
|
7
|
+
|
|
8
|
+
function AppConfig(port) {
|
|
9
|
+
var vcapApplication = process.env.VCAP_APPLICATION && JSON.parse(process.env.VCAP_APPLICATION);
|
|
10
|
+
|
|
11
|
+
this.port = port || process.env.PORT;
|
|
12
|
+
this.host = cfHost(vcapApplication) || os.hostname(); // may contain port if running on the tub
|
|
13
|
+
this.url = getAppUrl(vcapApplication, this.port);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function cfHost(vcapApplication) {
|
|
17
|
+
if (vcapApplication) {
|
|
18
|
+
var uris = vcapApplication.uris;
|
|
19
|
+
if (uris.length > 0 && uris[0]) {
|
|
20
|
+
return uris[0];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getAppUrl(vcapApplication, port) {
|
|
26
|
+
if (vcapApplication) {
|
|
27
|
+
if (vcapApplication.full_application_uris && vcapApplication.full_application_uris[0]) {
|
|
28
|
+
return vcapApplication.full_application_uris[0];
|
|
29
|
+
}
|
|
30
|
+
if (vcapApplication.uris && vcapApplication.uris[0]) {
|
|
31
|
+
return 'https://' + vcapApplication.uris[0];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return os.hostname() + ':' + port;
|
|
36
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var auditLog = require('@sap/audit-logging');
|
|
4
|
+
|
|
5
|
+
module.exports = AuditLogger;
|
|
6
|
+
|
|
7
|
+
function AuditLogger(credentials) {
|
|
8
|
+
this._credentials = credentials;
|
|
9
|
+
this._client = null;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
AuditLogger.prototype.getClient = function (cb) {
|
|
13
|
+
if (this._client) {
|
|
14
|
+
return cb(null, this._client);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
var self = this;
|
|
18
|
+
var credentials = this._credentials;
|
|
19
|
+
auditLog.v2(credentials, function (err, auditLogV2) {
|
|
20
|
+
// the client might have already been set by another call to this method,
|
|
21
|
+
// let's not overwrite what have been set
|
|
22
|
+
if (!self._client) {
|
|
23
|
+
var client = err ? auditLog(credentials) : auditLogV2;
|
|
24
|
+
self._client = client;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
cb(null, self._client);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
AuditLogger.prototype.logSecurityEvent = function (req, message, user, cb) {
|
|
32
|
+
var ip = req.headers['x-forwarded-for'] || req.connection.remoteAddress;
|
|
33
|
+
ip = ip.split(',')[0];
|
|
34
|
+
|
|
35
|
+
this.getClient(function (err, client) {
|
|
36
|
+
client.securityMessage(message)
|
|
37
|
+
.by(user)
|
|
38
|
+
.externalIP(ip)
|
|
39
|
+
.log(cb);
|
|
40
|
+
});
|
|
41
|
+
};
|
package/lib/cacert.js
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var https = require('https');
|
|
4
|
+
var assert = require('assert');
|
|
5
|
+
var xsenv = require('@sap/xsenv');
|
|
6
|
+
var logger = require('./logging').logger;
|
|
7
|
+
|
|
8
|
+
exports.loadCertificates = loadCertificates;
|
|
9
|
+
|
|
10
|
+
function loadCertificates(options) {
|
|
11
|
+
assert(!options.ca || Array.isArray(options.ca), 'ca option should be an array');
|
|
12
|
+
|
|
13
|
+
// options object is already cloned so it is ok to modify it here
|
|
14
|
+
options.ca = options.ca || xsenv.loadCertificates();
|
|
15
|
+
if (options.ca) {
|
|
16
|
+
https.globalAgent.options.ca = options.ca;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (options.hana) {
|
|
20
|
+
if (options.hana.ca || options.hana.certificate) {
|
|
21
|
+
logger.info('Using encrypted HANA connection.');
|
|
22
|
+
} else {
|
|
23
|
+
logger.warn('Using unencrypted HANA connection.');
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
package/lib/ctypes.js
ADDED
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var bigNumber = require('big.js');
|
|
4
|
+
|
|
5
|
+
var MAX_INT64 = '9223372036854775807'; // 2^64 / 2 - 1
|
|
6
|
+
var MIN_INT64 = '-9223372036854775808'; // -(2^64 / 2)
|
|
7
|
+
var MAX_UINT64 = '18446744073709551615'; // 2^64 - 1
|
|
8
|
+
|
|
9
|
+
var ctypes = {};
|
|
10
|
+
function Int64(val) {
|
|
11
|
+
var sVal = val;
|
|
12
|
+
if (val instanceof ctypes.Int64 || val instanceof ctypes.UInt64) {
|
|
13
|
+
sVal = val.valueOf();
|
|
14
|
+
}
|
|
15
|
+
if (typeof sVal === 'string' && (sVal.indexOf('0x') === 0 || sVal.indexOf('-0x') === 0)) {
|
|
16
|
+
sVal = parseInt(sVal, 16);
|
|
17
|
+
}
|
|
18
|
+
_validateInt64(sVal);
|
|
19
|
+
|
|
20
|
+
if (!(this instanceof ctypes.Int64 || this instanceof ctypes.UInt64)) {
|
|
21
|
+
return new ctypes.Int64(sVal);
|
|
22
|
+
}
|
|
23
|
+
this._val = sVal;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function UInt64(val) {
|
|
27
|
+
var sVal = val;
|
|
28
|
+
if (val instanceof ctypes.Int64 || val instanceof ctypes.UInt64) {
|
|
29
|
+
sVal = val.valueOf();
|
|
30
|
+
}
|
|
31
|
+
if (typeof sVal === 'string' && (sVal.indexOf('0x') === 0 || sVal.indexOf('-0x') === 0)) {
|
|
32
|
+
sVal = parseInt(sVal, 16);
|
|
33
|
+
}
|
|
34
|
+
_validateUInt64(sVal);
|
|
35
|
+
|
|
36
|
+
if (!(this instanceof ctypes.Int64 || this instanceof ctypes.UInt64)) {
|
|
37
|
+
return new ctypes.UInt64(sVal);
|
|
38
|
+
}
|
|
39
|
+
this._val = sVal;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function valueOf() {
|
|
43
|
+
return this._val.toString();
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function _compare(n1, n2) {
|
|
47
|
+
var a = bigNumber(n1.valueOf());
|
|
48
|
+
var b = bigNumber(n2.valueOf());
|
|
49
|
+
|
|
50
|
+
if (a.gt(b)) {
|
|
51
|
+
return 1;
|
|
52
|
+
} else if (a.eq(b)) {
|
|
53
|
+
return 0;
|
|
54
|
+
} else {
|
|
55
|
+
return -1;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function _validateInt64(val) {
|
|
60
|
+
var isInt64String = isInteger(val) && _compareNumericStrings(val, MAX_INT64) <= 0 && _compareNumericStrings(val, MIN_INT64) >= 0;
|
|
61
|
+
|
|
62
|
+
if (!isInt64String) {
|
|
63
|
+
throw new Error('expected type int64, got ' + JSON.stringify(val));
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function _validateUInt64(val) {
|
|
68
|
+
var isUInt64String = isInteger(val) && _compareNumericStrings(val, MAX_UINT64) <= 0 && _compareNumericStrings(val, '0') >= 0;
|
|
69
|
+
|
|
70
|
+
if (!isUInt64String) {
|
|
71
|
+
throw new Error('expected type uint64, got ' + JSON.stringify(val));
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function _compareInt64(n1, n2) {
|
|
76
|
+
if (!(n1 instanceof ctypes.Int64) || !(n2 instanceof ctypes.Int64)) {
|
|
77
|
+
throw new Error('compare takes two Int64 arguments');
|
|
78
|
+
}
|
|
79
|
+
return _compare(n1, n2);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
function _compareUInt64(n1, n2) {
|
|
83
|
+
if (!(n1 instanceof ctypes.UInt64) || !(n2 instanceof ctypes.UInt64)) {
|
|
84
|
+
throw new Error('compare takes two UInt64 arguments');
|
|
85
|
+
}
|
|
86
|
+
return _compare(n1, n2);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function _compareNumericStrings(n1, n2) {
|
|
90
|
+
n1 = n1.toString();
|
|
91
|
+
n2 = n2.toString();
|
|
92
|
+
var normalizedPair;
|
|
93
|
+
if (n1.indexOf('-') === -1 && n2.indexOf('-') === -1) {
|
|
94
|
+
normalizedPair = _normalizePairWithLeadingZeros(n1, n2);
|
|
95
|
+
n1 = normalizedPair.n1;
|
|
96
|
+
n2 = normalizedPair.n2;
|
|
97
|
+
return (n1 > n2) ? 1 : (n1 === n2) ? 0 : -1;
|
|
98
|
+
} else if (n1.indexOf('-') === 0 && n2.indexOf('-') === -1) {
|
|
99
|
+
return -1;
|
|
100
|
+
} else if (n1.indexOf('-') === -1 && n2.indexOf('-') === 0) {
|
|
101
|
+
return 1;
|
|
102
|
+
} else if (n1.indexOf('-') === 0 && n2.indexOf('-') === 0) {
|
|
103
|
+
n1 = n1.substring(1, n1.length);
|
|
104
|
+
n2 = n2.substring(1, n2.length);
|
|
105
|
+
normalizedPair = _normalizePairWithLeadingZeros(n1, n2);
|
|
106
|
+
n1 = normalizedPair.n1;
|
|
107
|
+
n2 = normalizedPair.n2;
|
|
108
|
+
return (n1 < n2) ? 1 : (n1 === n2) ? 0 : -1;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function _normalizePairWithLeadingZeros(n1, n2) {
|
|
113
|
+
var diff;
|
|
114
|
+
var prefix;
|
|
115
|
+
if (n1.length > n2.length) {
|
|
116
|
+
diff = n1.length - n2.length;
|
|
117
|
+
prefix = new Array(diff + 1).join('0');
|
|
118
|
+
n2 = prefix.concat(n2);
|
|
119
|
+
} else if (n1.length < n2.length) {
|
|
120
|
+
diff = n2.length - n1.length;
|
|
121
|
+
prefix = new Array(diff + 1).join('0');
|
|
122
|
+
n1 = prefix.concat(n1);
|
|
123
|
+
}
|
|
124
|
+
return {n1: n1, n2: n2};
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function toJSON() {
|
|
128
|
+
return this._val;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
function isInteger(value) {
|
|
132
|
+
if (isNaN(value)) {
|
|
133
|
+
return false;
|
|
134
|
+
}
|
|
135
|
+
value = parseFloat(value);
|
|
136
|
+
return Number(value) === value && value % 1 === 0;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
Int64.prototype.toJSON = toJSON;
|
|
140
|
+
UInt64.prototype.toJSON = toJSON;
|
|
141
|
+
Int64.prototype.valueOf = valueOf;
|
|
142
|
+
UInt64.prototype.valueOf = valueOf;
|
|
143
|
+
Int64.prototype.toString = valueOf;
|
|
144
|
+
UInt64.prototype.toString = valueOf;
|
|
145
|
+
ctypes.Int64 = Int64;
|
|
146
|
+
ctypes.UInt64 = UInt64;
|
|
147
|
+
ctypes.Int64.compare = _compareInt64;
|
|
148
|
+
ctypes.UInt64.compare = _compareUInt64;
|
|
149
|
+
ctypes.MAX_INT64 = MAX_INT64;
|
|
150
|
+
ctypes.MIN_INT64 = MIN_INT64;
|
|
151
|
+
ctypes.MAX_UINT64 = MAX_UINT64;
|
|
152
|
+
|
|
153
|
+
module.exports = ctypes;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var _ = require('lodash');
|
|
4
|
+
var assert = require('assert');
|
|
5
|
+
var VError = require('verror');
|
|
6
|
+
var xsenv = require('@sap/xsenv');
|
|
7
|
+
var utils = require('../utils');
|
|
8
|
+
|
|
9
|
+
exports.defineDestinationProviderFunction = defineDestinationProviderFunction;
|
|
10
|
+
exports.createDestinationProviderFunction = createDestinationProviderFunction;
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @param readServiceFunction - synchronous CF service read function accepting
|
|
14
|
+
* one argument the service name and returning the service details
|
|
15
|
+
* @returns {Function}
|
|
16
|
+
*/
|
|
17
|
+
function createDestinationProviderFunction(readServiceFunction) {
|
|
18
|
+
assert(_.isFunction(readServiceFunction),
|
|
19
|
+
'Valid service reader function should be provided');
|
|
20
|
+
|
|
21
|
+
return function getDestination(packagename, objectname, dtDescriptor) {
|
|
22
|
+
var destinationName = utils.toXSObjectId(packagename, objectname);
|
|
23
|
+
assert(destinationName,
|
|
24
|
+
'Valid destination packagename or objectname should be provided');
|
|
25
|
+
|
|
26
|
+
var rtDestination = readServiceFunction(destinationName);
|
|
27
|
+
|
|
28
|
+
if (!rtDestination) {
|
|
29
|
+
throw new VError(
|
|
30
|
+
'Configuration was not found for destination with name "%s"',
|
|
31
|
+
destinationName);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
if (!dtDescriptor) {
|
|
35
|
+
return rtDestination;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
return _.extend({}, dtDescriptor, rtDestination);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function defineDestinationProviderFunction(rt) {
|
|
43
|
+
assert(rt && rt.get, 'Valid runtime object should be provided');
|
|
44
|
+
var customProvider = rt.get('destinationProvider');
|
|
45
|
+
|
|
46
|
+
return (customProvider) ?
|
|
47
|
+
customProvider :
|
|
48
|
+
createDestinationProviderFunction(readService);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
function readService(serviceName) {
|
|
52
|
+
var services = xsenv.filterCFServices(serviceName);
|
|
53
|
+
if (services.length > 0) {
|
|
54
|
+
return services[0].credentials;
|
|
55
|
+
}
|
|
56
|
+
return;
|
|
57
|
+
}
|