@sap/xsodata 8.3.0 → 8.3.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.
Files changed (120) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/index.js +2 -2
  3. package/lib/configuration.js +1 -1
  4. package/lib/db/connect.js +1 -1
  5. package/lib/db/dbSegment.js +68 -123
  6. package/lib/db/dbVersionChecks.js +2 -8
  7. package/lib/handlerConfiguration.js +2 -2
  8. package/lib/http/conditionalHttpHandler.js +27 -34
  9. package/lib/http/simpleHttpRequest.js +14 -18
  10. package/lib/http/simpleHttpResponse.js +4 -4
  11. package/lib/http/uriParser.js +9 -9
  12. package/lib/http/validator/httpRequestValidator.js +9 -9
  13. package/lib/model/annotationFactory.js +11 -11
  14. package/lib/model/association.js +3 -3
  15. package/lib/model/entityType.js +33 -67
  16. package/lib/model/metadataReader.js +31 -52
  17. package/lib/model/model.js +0 -1
  18. package/lib/model/validator/xsoDataConcurrencyTokenValidator.js +6 -6
  19. package/lib/model/xsodataReader.js +36 -28
  20. package/lib/processor/authorizationProcessor.js +22 -33
  21. package/lib/processor/batchProcessor.js +22 -33
  22. package/lib/processor/errorProcessor.js +4 -4
  23. package/lib/processor/exitProcessor.js +19 -19
  24. package/lib/processor/processor.js +9 -9
  25. package/lib/processor/resourceProcessor.js +31 -61
  26. package/lib/processor/resourceProcessorDelete.js +16 -16
  27. package/lib/processor/resourceProcessorDeleteLinks.js +25 -25
  28. package/lib/processor/resourceProcessorGet.js +5 -5
  29. package/lib/processor/resourceProcessorPost.js +43 -45
  30. package/lib/processor/resourceProcessorPut.js +35 -39
  31. package/lib/processor/resourceProcessorPutPostLinks.js +38 -39
  32. package/lib/security/securityContext.js +5 -5
  33. package/lib/serializer/atomSerializer.js +54 -55
  34. package/lib/serializer/atomXmlToJsonSerializer.js +32 -44
  35. package/lib/serializer/content.js +5 -5
  36. package/lib/serializer/json.js +31 -33
  37. package/lib/serializer/jsonSerializer.js +4 -4
  38. package/lib/serializer/metadataSerializer.js +32 -35
  39. package/lib/serializer/serializer.js +29 -43
  40. package/lib/serializer/serviceSerializer.js +19 -24
  41. package/lib/serializer/value.js +1 -2
  42. package/lib/serializer/xmlToJsonSerializer.js +18 -18
  43. package/lib/sql/createDeleteLinksStatements.js +10 -10
  44. package/lib/sql/createDeleteStatements.js +12 -12
  45. package/lib/sql/createGetStatements.js +49 -107
  46. package/lib/sql/createLinksSQLStatements_1_n.js +27 -27
  47. package/lib/sql/createPutPostLinksStatements.js +9 -9
  48. package/lib/sql/createPutStatements.js +0 -1
  49. package/lib/sql/dataCollectorDelete.js +9 -9
  50. package/lib/sql/dataCollectorDeleteLinks.js +3 -3
  51. package/lib/sql/dataCollectorGet.js +9 -17
  52. package/lib/sql/dataCollectorLinks.js +23 -27
  53. package/lib/sql/dataCollectorPost.js +20 -20
  54. package/lib/sql/dataCollectorPut.js +36 -36
  55. package/lib/sql/dataCollectorPutPostLinks.js +3 -3
  56. package/lib/sql/sqlStatement.js +81 -128
  57. package/lib/sql/sqlTools.js +3 -7
  58. package/lib/sql/statementProcessor.js +7 -14
  59. package/lib/uri/applyChecks.js +3 -3
  60. package/lib/uri/checks/checkAllowedMethod.js +3 -3
  61. package/lib/uri/checks/checkAllowedMethodForBatch.js +2 -2
  62. package/lib/uri/checks/checkAllowedMethodsForResourcePath.js +3 -3
  63. package/lib/uri/checks/checkFilterOnAggregatedColumn.js +5 -5
  64. package/lib/uri/checks/checkFilterOrderByOnGenKeyColumn.js +6 -6
  65. package/lib/uri/checks/checkGenKeyRestrictions.js +2 -2
  66. package/lib/uri/checks/checkModificationForbidden.js +3 -3
  67. package/lib/uri/checks/checkPostPutDeleteChecks.js +5 -5
  68. package/lib/uri/checks/checkSystemQueryOptions.js +10 -10
  69. package/lib/uri/checks.js +15 -15
  70. package/lib/uri/expandSelectTreeBuilder.js +12 -16
  71. package/lib/uri/oDataUriParser.js +20 -20
  72. package/lib/uri/queryParameterParser.js +25 -33
  73. package/lib/uri/resourcePathParser.js +47 -62
  74. package/lib/uri/uriType.js +4 -4
  75. package/lib/utils/associations.js +4 -4
  76. package/lib/utils/batch/batchExecutor.js +49 -51
  77. package/lib/utils/batch/batchObjects.js +10 -10
  78. package/lib/utils/batch/batchParser.js +27 -28
  79. package/lib/utils/batch/batchWriter.js +1 -1
  80. package/lib/utils/checkContentType.js +34 -39
  81. package/lib/utils/debugView.js +35 -36
  82. package/lib/utils/errors/applicationError.js +2 -2
  83. package/lib/utils/errors/debugInfo.js +2 -2
  84. package/lib/utils/errors/http/badRequest.js +2 -2
  85. package/lib/utils/errors/http/forbidden.js +2 -2
  86. package/lib/utils/errors/http/methodNotAllowed.js +2 -2
  87. package/lib/utils/errors/http/notAcceptable.js +2 -2
  88. package/lib/utils/errors/http/notFound.js +2 -2
  89. package/lib/utils/errors/http/notImplemented.js +2 -2
  90. package/lib/utils/errors/http/notModified.js +2 -2
  91. package/lib/utils/errors/http/notSupported.js +2 -2
  92. package/lib/utils/errors/http/preconditionFailed.js +2 -2
  93. package/lib/utils/errors/http/preconditionRequired.js +2 -2
  94. package/lib/utils/errors/http/unauthorized.js +2 -2
  95. package/lib/utils/errors/http/unsupportedMediaType.js +2 -2
  96. package/lib/utils/errors/httpError.js +2 -2
  97. package/lib/utils/errors/internalError.js +2 -2
  98. package/lib/utils/errors/modelFileError.js +2 -2
  99. package/lib/utils/errors/sqlError.js +2 -2
  100. package/lib/utils/errors/testError.js +2 -2
  101. package/lib/utils/errors/typeError.js +5 -5
  102. package/lib/utils/errors/xsODataError.js +1 -1
  103. package/lib/utils/logger.js +21 -32
  104. package/lib/utils/measurement.js +14 -13
  105. package/lib/utils/requestContext.js +2 -2
  106. package/lib/utils/stateMaschine.js +6 -6
  107. package/lib/utils/tableCleanup.js +3 -3
  108. package/lib/utils/typeConverter.js +21 -21
  109. package/lib/utils/typeConverters/converterTools.js +25 -331
  110. package/lib/utils/typeConverters/dbToJson.js +3 -3
  111. package/lib/utils/typeConverters/dbToUri.js +7 -7
  112. package/lib/utils/typeConverters/dbToXml.js +9 -9
  113. package/lib/utils/typeConverters/jsonToDb.js +20 -27
  114. package/lib/utils/typeConverters/uriToDb.js +45 -92
  115. package/lib/utils/typeConverters/xmlValueToJson.js +9 -13
  116. package/lib/utils/typedObjects.js +11 -79
  117. package/lib/utils/utils.js +20 -23
  118. package/lib/xsodata.js +37 -47
  119. package/package.json +3 -5
  120. package/.npmignore +0 -40
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
- var Big = require("big.js");
3
+ const Big = require("big.js");
4
4
 
5
- var timeRegexObj = /^P((\d+)Y)?((\d+)M)?((\d+)D)?T((\d+)H)?((\d+)M)?((\d+)(?:\.(\d*))?S)?$/i;
6
- var timeRegexObjTime = /^time'P((\d+)Y)?((\d+)M)?((\d+)D)?T((\d+)H)?((\d+)M)?((\d+)(?:\.(\d*))?S)?'$/i;
7
- var Type_Error = require('./../errors/typeError');
5
+ const timeRegexObj = /^P((\d+)Y)?((\d+)M)?((\d+)D)?T((\d+)H)?((\d+)M)?((\d+)(?:\.(\d*))?S)?$/i;
6
+ const timeRegexObjTime = /^time'P((\d+)Y)?((\d+)M)?((\d+)D)?T((\d+)H)?((\d+)M)?((\d+)(?:\.(\d*))?S)?'$/i;
7
+ const XsODataTypeError = require('./../errors/typeError');
8
8
 
9
9
  function padZero(string, len) {
10
10
  if (string.length < len) {
@@ -23,20 +23,20 @@ exports.checkEdmTime = function (value, dbDataType, withTimePrefix, YMDmustBeZer
23
23
 
24
24
  if (!allowFractions) {
25
25
  if (matches[13] && Number.parseInt(matches[13]) !== 0) {
26
- throw new Type_Error(`Fractional part for OData type Edm.Time not supported`);
26
+ throw new XsODataTypeError(`Fractional part for OData type Edm.Time not supported`);
27
27
  }
28
28
  }
29
29
 
30
30
 
31
31
  if (YMDmustBeZero) {
32
32
  if (matches[1] && Number.parseInt(matches[1]) !== 0) {
33
- throw new Type_Error(`value must be compatible to hana type ${dbDataType} (check year)`);
33
+ throw new XsODataTypeError(`value must be compatible to hana type ${dbDataType} (check year)`);
34
34
  }
35
35
  if (matches[3] && Number.parseInt(matches[3]) !== 0) {
36
- throw new Type_Error(`value must be compatible to hana type ${dbDataType} (check month)`);
36
+ throw new XsODataTypeError(`value must be compatible to hana type ${dbDataType} (check month)`);
37
37
  }
38
38
  if (matches[5] && Number.parseInt(matches[5]) !== 0) {
39
- throw new Type_Error(`value must be compatible to hana type ${dbDataType} (check day)`);
39
+ throw new XsODataTypeError(`value must be compatible to hana type ${dbDataType} (check day)`);
40
40
  }
41
41
  }
42
42
 
@@ -51,13 +51,13 @@ exports.checkEdmTime = function (value, dbDataType, withTimePrefix, YMDmustBeZer
51
51
  // for range see https://help.sap.com/viewer/4fe29514fd584807ac9f2a04f6754767/2.0.03/en-US/3f81ccc7e35d44cbbc595c7d552c202a.html
52
52
  // minimal value is 0001-01-01 00:00:01
53
53
  if (!matches[2] || Number.parseInt(matches[2]) <= 0) {
54
- throw new Type_Error('value must be compatible to hana type SECONDTIME (check year)');
54
+ throw new XsODataTypeError('value must be compatible to hana type SECONDTIME (check year)');
55
55
  }
56
56
  if (!matches[4] || Number.parseInt(matches[4]) <= 0) {
57
- throw new Type_Error('value must be compatible to hana type SECONDTIME (check month)');
57
+ throw new XsODataTypeError('value must be compatible to hana type SECONDTIME (check month)');
58
58
  }
59
59
  if (!matches[6] || Number.parseInt(matches[6]) <= 0) {
60
- throw new Type_Error('value must be compatible to hana type SECONDTIME (check day)');
60
+ throw new XsODataTypeError('value must be compatible to hana type SECONDTIME (check day)');
61
61
  }
62
62
 
63
63
  let dateParts = [];
@@ -111,7 +111,7 @@ exports.datetime7 = function (dbValue, addLetterTbehindDate) {
111
111
  * @returns {string} decimal value in the decimal notation.
112
112
  */
113
113
  exports.formatDecimal = function formatDecimal(decimalString) {
114
- var decimalValue;
114
+ let decimalValue;
115
115
 
116
116
  if (!decimalString) {
117
117
  return decimalString;
@@ -126,7 +126,7 @@ exports.formatDecimal = function formatDecimal(decimalString) {
126
126
  };
127
127
 
128
128
  exports.decimal_db_to_uri = function (decimalAsString) {
129
- var arr = decimalAsString.split(/[eE]/);
129
+ const arr = decimalAsString.split(/[eE]/);
130
130
  if (arr.length === 1) {
131
131
  // input was "3"
132
132
  return decimalAsString;
@@ -137,34 +137,32 @@ exports.decimal_db_to_uri = function (decimalAsString) {
137
137
  return decimalAsString.substr(0, decimalAsString.length - 1);
138
138
  }
139
139
 
140
- var man = arr[0];
141
- var exp = arr[1];
140
+ let man = arr[0];
141
+ const exp = arr[1];
142
142
 
143
- var sign = '';
143
+ let sign = '';
144
144
  if (man[0] === '+' || man[0] === '-') {
145
145
  sign = man[0];
146
146
  man = man.substr(1);
147
147
  }
148
148
 
149
- var point = man.indexOf('.');
149
+ let point = man.indexOf('.');
150
150
  if (point === -1) {
151
151
  point = man.length;
152
152
  }
153
153
 
154
- var expInt = parseInt(exp);
155
- var out = sign;
156
-
154
+ let expInt = parseInt(exp);
155
+ let out = sign;
157
156
 
158
157
  //move comma left
159
- var pre = 0;
158
+ let pre = 0;
160
159
  while (pre < point && man[pre] !== '0') {
161
160
  pre++;
162
161
  }
163
- var post = (man.length === point) ? 0 : man.length - point - 1;
164
- var spre = man.substr(point - pre, pre);
165
- var spost = man.substr(point + 1, post);
166
- //return spost;
167
- // out = '(' + pre + ' ' + post + ')';
162
+ const post = (man.length === point) ? 0 : man.length - point - 1;
163
+ const spre = man.substr(point - pre, pre);
164
+ const spost = man.substr(point + 1, post);
165
+
168
166
  if (expInt === 0) {
169
167
  out += (pre === 0) ? '0' : spre;
170
168
  if (post !== 0) {
@@ -174,8 +172,6 @@ exports.decimal_db_to_uri = function (decimalAsString) {
174
172
  return out;
175
173
  }
176
174
 
177
- //var pn = point + expInt;
178
- //return pn;
179
175
  if (expInt > 0) {
180
176
 
181
177
  out += spre;
@@ -212,308 +208,6 @@ exports.decimal_db_to_uri = function (decimalAsString) {
212
208
  out += spre.substr(pre - expInt);
213
209
  }
214
210
 
215
- /*
216
- if (pre) {
217
- if (expInt <= pre) {
218
- out += spre;
219
- expInt -= pre;
220
- } else {
221
- out +=
222
- }
223
- }*/
224
211
  return out;
225
212
  }
226
- };
227
-
228
-
229
- /*TODO future: Add automatic tests for this */
230
- /*
231
- print('1');
232
- print('1.5');
233
- print('123.5');
234
- print('123.56');
235
- print('123.567');
236
- print('123.567e');
237
- print('123.567e-5');
238
- print('123.567e-4');
239
- print('123.567e-3');
240
- print('123.567e-2');
241
- print('123.567e-1');
242
- print('123.567e-0');
243
- print('123.567e0');
244
- print('123.567e1');
245
- print('123.567e2');
246
- print('123.567e3');
247
- print('123.567e4');
248
- print('123.567e5');
249
- print('123.567e+0');
250
- print('123.567e+1');
251
- print('123.567e+2');
252
- print('123.567e+3');
253
- print('123.567e+4');
254
- print('123.567e+5');
255
- print('123e-5');
256
- print('123e-4');
257
- print('123e-3');
258
- print('123e-2');
259
- print('123e-1');
260
- print('123e-0');
261
- print('123e0');
262
- print('123e1');
263
- print('123e2');
264
- print('123e3');
265
- print('123e4');
266
- print('123e5');
267
- print('123e+0');
268
- print('123e+1');
269
- print('123e+2');
270
- print('123e+3');
271
- print('123e+4');
272
- print('123e+5');
273
- print('0.1e-5');
274
- print('0.1e-4');
275
- print('0.1e-3');
276
- print('0.1e-2');
277
- print('0.1e-1');
278
- print('0.1e-0');
279
- print('0.1e0');
280
- print('0.1e1');
281
- print('0.1e2');
282
- print('0.1e3');
283
- print('0.1e4');
284
- print('0.1e5');
285
- print('0.1e+0');
286
- print('0.1e+1');
287
- print('0.1e+2');
288
- print('0.1e+3');
289
- print('0.1e+4');
290
- print('0.1e+5');
291
- print('.1e-5');
292
- print('.1e-4');
293
- print('.1e-3');
294
- print('.1e-2');
295
- print('.1e-1');
296
- print('.1e-0');
297
- print('.1e0');
298
- print('.1e1');
299
- print('.1e2');
300
- print('.1e3');
301
- print('.1e4');
302
- print('.1e5');
303
- print('.1e+0');
304
- print('.1e+1');
305
- print('.1e+2');
306
- print('.1e+3');
307
- print('.1e+4');
308
- print('.1e+5');
309
- print('1.e-5');
310
- print('1.e-4');
311
- print('1.e-3');
312
- print('1.e-2');
313
- print('1.e-1');
314
- print('1.e-0');
315
- print('1.e0');
316
- print('1.e1');
317
- print('1.e2');
318
- print('1.e3');
319
- print('1.e4');
320
- print('1.e5');
321
- print('1.e-0');
322
- print('1.e-1');
323
- print('1.e-2');
324
- print('1.e-3');
325
- print('1.e-4');
326
- print('1.e-5');
327
-
328
- print('-1');
329
- print('-1.5');
330
- print('-123.5');
331
- print('-123.56');
332
- print('-123.567');
333
- print('-123.567e');
334
- print('-123.567e-5');
335
- print('-123.567e-4');
336
- print('-123.567e-3');
337
- print('-123.567e-2');
338
- print('-123.567e-1');
339
- print('-123.567e-0');
340
- print('-123.567e0');
341
- print('-123.567e1');
342
- print('-123.567e2');
343
- print('-123.567e3');
344
- print('-123.567e4');
345
- print('-123.567e5');
346
- print('-123.567e+0');
347
- print('-123.567e+1');
348
- print('-123.567e+2');
349
- print('-123.567e+3');
350
- print('-123.567e+4');
351
- print('-123.567e+5');
352
- print('-123e-5');
353
- print('-123e-4');
354
- print('-123e-3');
355
- print('-123e-2');
356
- print('-123e-1');
357
- print('-123e-0');
358
- print('-123e0');
359
- print('-123e1');
360
- print('-123e2');
361
- print('-123e3');
362
- print('-123e4');
363
- print('-123e5');
364
- print('-123e+0');
365
- print('-123e+1');
366
- print('-123e+2');
367
- print('-123e+3');
368
- print('-123e+4');
369
- print('-123e+5');
370
- print('-0.1e-5');
371
- print('-0.1e-4');
372
- print('-0.1e-3');
373
- print('-0.1e-2');
374
- print('-0.1e-1');
375
- print('-0.1e-0');
376
- print('-0.1e0');
377
- print('-0.1e1');
378
- print('-0.1e2');
379
- print('-0.1e3');
380
- print('-0.1e4');
381
- print('-0.1e5');
382
- print('-0.1e+0');
383
- print('-0.1e+1');
384
- print('-0.1e+2');
385
- print('-0.1e+3');
386
- print('-0.1e+4');
387
- print('-0.1e+5');
388
- print('-.1e-5');
389
- print('-.1e-4');
390
- print('-.1e-3');
391
- print('-.1e-2');
392
- print('-.1e-1');
393
- print('-.1e-0');
394
- print('-.1e0');
395
- print('-.1e1');
396
- print('-.1e2');
397
- print('-.1e3');
398
- print('-.1e4');
399
- print('-.1e5');
400
- print('-.1e+0');
401
- print('-.1e+1');
402
- print('-.1e+2');
403
- print('-.1e+3');
404
- print('-.1e+4');
405
- print('-.1e+5');
406
- print('-1.e-5');
407
- print('-1.e-4');
408
- print('-1.e-3');
409
- print('-1.e-2');
410
- print('-1.e-1');
411
- print('-1.e-0');
412
- print('-1.e0');
413
- print('-1.e1');
414
- print('-1.e2');
415
- print('-1.e3');
416
- print('-1.e4');
417
- print('-1.e5');
418
- print('-1.e+0');
419
- print('-1.e+1');
420
- print('-1.e+2');
421
- print('-1.e+3');
422
- print('-1.e+4');
423
- print('-1.e+5');
424
- print('+1');
425
- print('+1.5');
426
- print('+123.5');
427
- print('+123.56');
428
- print('+123.567');
429
- print('+123.567e');
430
- print('+123.567e-5');
431
- print('+123.567e-4');
432
- print('+123.567e-3');
433
- print('+123.567e-2');
434
- print('+123.567e-1');
435
- print('+123.567e-0');
436
- print('+123.567e0');
437
- print('+123.567e1');
438
- print('+123.567e2');
439
- print('+123.567e3');
440
- print('+123.567e4');
441
- print('+123.567e5');
442
- print('+123.567e+0');
443
- print('+123.567e+1');
444
- print('+123.567e+2');
445
- print('+123.567e+3');
446
- print('+123.567e+4');
447
- print('+123.567e+5');
448
- print('+123e-5');
449
- print('+123e-4');
450
- print('+123e-3');
451
- print('+123e-2');
452
- print('+123e-1');
453
- print('+123e-0');
454
- print('+123e0');
455
- print('+123e1');
456
- print('+123e2');
457
- print('+123e3');
458
- print('+123e4');
459
- print('+123e5');
460
- print('+123e+0');
461
- print('+123e+1');
462
- print('+123e+2');
463
- print('+123e+3');
464
- print('+123e+4');
465
- print('+123e+5');
466
- print('+0.1e-5');
467
- print('+0.1e-4');
468
- print('+0.1e-3');
469
- print('+0.1e-2');
470
- print('+0.1e-1');
471
- print('+0.1e-0');
472
- print('+0.1e0');
473
- print('+0.1e1');
474
- print('+0.1e2');
475
- print('+0.1e3');
476
- print('+0.1e4');
477
- print('+0.1e5');
478
- print('+0.1e+0');
479
- print('+0.1e+1');
480
- print('+0.1e+2');
481
- print('+0.1e+3');
482
- print('+0.1e+4');
483
- print('+0.1e+5');
484
- print('+.1e-5');
485
- print('+.1e-4');
486
- print('+.1e-3');
487
- print('+.1e-2');
488
- print('+.1e-1');
489
- print('+.1e-0');
490
- print('+.1e0');
491
- print('+.1e1');
492
- print('+.1e2');
493
- print('+.1e3');
494
- print('+.1e4');
495
- print('+.1e5');
496
- print('+.1e+0');
497
- print('+.1e+1');
498
- print('+.1e+2');
499
- print('+.1e+3');
500
- print('+.1e+4');
501
- print('+.1e+5');
502
- print('+1.e-5');
503
- print('+1.e-4');
504
- print('+1.e-3');
505
- print('+1.e-2');
506
- print('+1.e-1');
507
- print('+1.e-0');
508
- print('+1.e0');
509
- print('+1.e1');
510
- print('+1.e2');
511
- print('+1.e3');
512
- print('+1.e4');
513
- print('+1.e5');
514
- print('+1.e+0');
515
- print('+1.e+1');
516
- print('+1.e+2');
517
- print('+1.e+3');
518
- print('+1.e+4');
519
- print('+1.e+5');*/
213
+ };
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  let dbToJson = exports.dbToJson = {};
5
- const Type_Error = require("./../errors/typeError");
5
+ const XsODataTypeError = require("./../errors/typeError");
6
6
  const converterTools = require('./converterTools');
7
7
  const NUMBER_OF_DIGITS_IN_MILLIS = 3;
8
8
 
@@ -249,7 +249,7 @@ dbToJson.NCLOB = function dbToJsonNCLOB(dbValue) {
249
249
  };
250
250
 
251
251
  dbToJson.BINARY = function dbToJsonBINARY(/*dbValue*/) {
252
- throw new Type_Error("db type BINARY is not supported");
252
+ throw new XsODataTypeError("db type BINARY is not supported");
253
253
  };
254
254
 
255
255
  dbToJson.VARBINARY = function dbToJsonVARBINARY(dbValue) {
@@ -265,5 +265,5 @@ dbToJson.VARBINARY = function dbToJsonVARBINARY(dbValue) {
265
265
  dbToJson.LONGDATE = function dbToUriLONGDATE(/*dbValue*/) {
266
266
  /* in */
267
267
  /* out */
268
- throw new Type_Error("db type LONGDATE is not supported");
268
+ throw new XsODataTypeError("db type LONGDATE is not supported");
269
269
  };
@@ -1,17 +1,17 @@
1
1
  'use strict';
2
2
 
3
3
 
4
- var dbToUri = exports.dbToUri = {};
5
- var querystring = require("querystring");
6
- var converterTools = require('./converterTools');
7
- var Type_Error = require("./../errors/typeError");
4
+ const dbToUri = exports.dbToUri = {};
5
+ const querystring = require("querystring");
6
+ const converterTools = require('./converterTools');
7
+ const XsODataTypeError = require("./../errors/typeError");
8
8
 
9
9
  function enDoubleQuote(valueString) {
10
10
  return valueString.replace(/'/g, "''");
11
11
  }
12
12
 
13
13
  function stringToUri(valueString) {
14
- var s1 = querystring.escape(valueString);
14
+ const s1 = querystring.escape(valueString);
15
15
  return enDoubleQuote(s1);
16
16
  }
17
17
 
@@ -200,7 +200,7 @@ dbToUri.NCLOB = function dbToUriNCLOB(dbValue) {
200
200
  };
201
201
 
202
202
  dbToUri.BINARY = function dbToUriBINARY(/*dbValue*/) {
203
- throw new Type_Error("db type BINARY is not supported");
203
+ throw new XsODataTypeError("db type BINARY is not supported");
204
204
  };
205
205
 
206
206
  dbToUri.VARBINARY = function dbToUriVARBINARY(dbValue) {
@@ -213,5 +213,5 @@ dbToUri.VARBINARY = function dbToUriVARBINARY(dbValue) {
213
213
  dbToUri.LONGDATE = function dbToUriLONGDATE(/*dbValue*/) {
214
214
  /* in */
215
215
  /* out */
216
- throw new Type_Error("db type LONGDATE is not supported");
216
+ throw new XsODataTypeError("db type LONGDATE is not supported");
217
217
  };
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var dbToXml = exports.dbToXml = {};
4
- var converterTools = require('./converterTools');
5
- var Type_Error = require("./../errors/typeError");
3
+ const dbToXml = exports.dbToXml = {};
4
+ const converterTools = require('./converterTools');
5
+ const XsODataTypeError = require("./../errors/typeError");
6
6
 
7
7
  dbToXml.DATE = dbToXml.DAYDATE = function dbToXmlDATE(dbValue) {
8
8
  /*in 9999-12-31*/
@@ -133,8 +133,8 @@ dbToXml.BLOB = function dbToXmlBLOB(dbValue) {
133
133
 
134
134
  dbToXml.CLOB = function dbToXmlCLOB(dbValue) {
135
135
  //TODO atom format not supported yet
136
- //var decoder = new StringDecoder('utf8');
137
- //var c = decoder.write(dbValue);
136
+ //const decoder = new StringDecoder('utf8');
137
+ //const c = decoder.write(dbValue);
138
138
  //return "'" + c + "'";
139
139
  if (dbValue === null) {
140
140
  return null;
@@ -143,8 +143,8 @@ dbToXml.CLOB = function dbToXmlCLOB(dbValue) {
143
143
  };
144
144
  dbToXml.NCLOB = function dbToXmlNCLOB(dbValue) {
145
145
  //TODO atom format not supported yet
146
- //var decoder = new StringDecoder('utf8');
147
- //var c = decoder.write(dbValue);
146
+ //const decoder = new StringDecoder('utf8');
147
+ //const c = decoder.write(dbValue);
148
148
  //return "'" + c + "'";
149
149
  if (dbValue === null) {
150
150
  return null;
@@ -153,7 +153,7 @@ dbToXml.NCLOB = function dbToXmlNCLOB(dbValue) {
153
153
  };
154
154
 
155
155
  dbToXml.BINARY = function dbToXmlBINARY(/*dbValue*/) {
156
- throw new Type_Error("db type BINARY is not supported");
156
+ throw new XsODataTypeError("db type BINARY is not supported");
157
157
  };
158
158
  dbToXml.VARBINARY = function dbToXmlVARBINARY(dbValue) {
159
159
  //TODO atom format not supported yet
@@ -165,5 +165,5 @@ dbToXml.VARBINARY = function dbToXmlVARBINARY(dbValue) {
165
165
  };
166
166
 
167
167
  dbToXml.LONGDATE = function dbToUriLONGDATE(/*dbValue*/) {
168
- throw new Type_Error("db type LONGDATE is not supported");
168
+ throw new XsODataTypeError("db type LONGDATE is not supported");
169
169
  };