ng2-rest 13.0.34 → 13.1.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.
Files changed (59) hide show
  1. package/app.d.ts +1 -1
  2. package/app.js +4 -4
  3. package/app.js.map +1 -1
  4. package/browser/esm2020/lib/mapping.mjs +1 -4
  5. package/browser/esm2020/lib/models.mjs +7 -1
  6. package/browser/esm2020/lib/rest-headers.mjs +2 -2
  7. package/browser/fesm2015/ng2-rest.mjs +8 -4
  8. package/browser/fesm2015/ng2-rest.mjs.map +1 -1
  9. package/browser/fesm2020/ng2-rest.mjs +8 -4
  10. package/browser/fesm2020/ng2-rest.mjs.map +1 -1
  11. package/browser/lib/models.d.ts +2 -2
  12. package/client/esm2020/lib/mapping.mjs +1 -4
  13. package/client/esm2020/lib/models.mjs +7 -1
  14. package/client/esm2020/lib/rest-headers.mjs +2 -2
  15. package/client/fesm2015/ng2-rest.mjs +8 -4
  16. package/client/fesm2015/ng2-rest.mjs.map +1 -1
  17. package/client/fesm2020/ng2-rest.mjs +8 -4
  18. package/client/fesm2020/ng2-rest.mjs.map +1 -1
  19. package/client/lib/models.d.ts +2 -2
  20. package/index.js +2 -2
  21. package/index.js.map +1 -1
  22. package/lib/content-type.js +1 -1
  23. package/lib/content-type.js.map +1 -1
  24. package/lib/cookie.js +1 -1
  25. package/lib/cookie.js.map +1 -1
  26. package/lib/helpers.js +2 -2
  27. package/lib/helpers.js.map +1 -1
  28. package/lib/index.js +9 -9
  29. package/lib/index.js.map +1 -1
  30. package/lib/mapping.js +1 -4
  31. package/lib/mapping.js.map +1 -1
  32. package/lib/models.d.ts +2 -2
  33. package/lib/models.js +11 -5
  34. package/lib/models.js.map +1 -1
  35. package/lib/other/simple-resource.js +1 -1
  36. package/lib/other/simple-resource.js.map +1 -1
  37. package/lib/params.js +1 -1
  38. package/lib/params.js.map +1 -1
  39. package/lib/request-cache.js +1 -1
  40. package/lib/request-cache.js.map +1 -1
  41. package/lib/resource.service.js +1 -1
  42. package/lib/resource.service.js.map +1 -1
  43. package/lib/rest-headers.js +4 -3
  44. package/lib/rest-headers.js.map +1 -1
  45. package/lib/rest-request.js +3 -3
  46. package/lib/rest-request.js.map +1 -1
  47. package/lib/rest.class.js +1 -1
  48. package/lib/rest.class.js.map +1 -1
  49. package/package.json +4 -4
  50. package/package.json_tnp.json5 +9 -0
  51. package/tmp-environment.json +56 -52
  52. package/websql/esm2020/lib/mapping.mjs +1 -4
  53. package/websql/esm2020/lib/models.mjs +7 -1
  54. package/websql/esm2020/lib/rest-headers.mjs +2 -2
  55. package/websql/fesm2015/ng2-rest.mjs +8 -4
  56. package/websql/fesm2015/ng2-rest.mjs.map +1 -1
  57. package/websql/fesm2020/ng2-rest.mjs +8 -4
  58. package/websql/fesm2020/ng2-rest.mjs.map +1 -1
  59. package/websql/lib/models.d.ts +2 -2
@@ -1,7 +1,7 @@
1
1
  import { Subject, Observable, firstValueFrom } from 'rxjs';
2
2
  import { Log, Level } from 'ng2-logger/browser';
3
3
  import { diffChars } from 'diff';
4
- import { Helpers as Helpers$1, _, CoreHelpers } from 'tnp-core/browser';
4
+ import { _, Helpers as Helpers$1, CoreHelpers } from 'tnp-core/browser';
5
5
  import { walk } from 'lodash-walk-object/browser';
6
6
  import { CLASS, SYMBOL, Models as Models$1 } from 'typescript-class-helpers/browser';
7
7
  import { JSON10 } from 'json10/browser';
@@ -10,7 +10,6 @@ import axios from 'axios';
10
10
  var Mapping;
11
11
  (function (Mapping) {
12
12
  function decode(json, autodetect = false) {
13
- Helpers$1.simulateBrowser = true;
14
13
  // console.log('DECODE isBrowser', HelpersLog.isBrowser)
15
14
  if (_.isUndefined(json)) {
16
15
  return void 0;
@@ -19,7 +18,6 @@ var Mapping;
19
18
  if (autodetect) {
20
19
  mapping = _.merge(getMappingNaive(json), mapping);
21
20
  }
22
- Helpers$1.simulateBrowser = false;
23
21
  return mapping;
24
22
  }
25
23
  Mapping.decode = decode;
@@ -699,7 +697,7 @@ class RestHeaders {
699
697
  toJSON() {
700
698
  const serialized = {};
701
699
  if (!this._headers) {
702
- debugger;
700
+ // debugger
703
701
  }
704
702
  this._headers.forEach((values, name) => {
705
703
  const split = [];
@@ -1017,6 +1015,9 @@ var Models;
1017
1015
  return res;
1018
1016
  }
1019
1017
  get json() {
1018
+ if (this.entity && typeof this.entity === 'function') {
1019
+ return this.entity(); // @LAST
1020
+ }
1020
1021
  if (this.entity && typeof this.entity === 'object') {
1021
1022
  const json = this.toJSON(this.body, this.isArray);
1022
1023
  return Mapping.encode(json, this.entity, this.circular);
@@ -1069,6 +1070,9 @@ var Models;
1069
1070
  this.circular = circular;
1070
1071
  this.jobid = jobid;
1071
1072
  this.isArray = isArray;
1073
+ // console.log({
1074
+ // sourceRequest, responseText, headers, statusCode, entity, circular, jobid, isArray
1075
+ // })
1072
1076
  this.init();
1073
1077
  }
1074
1078
  init() {