Built files from Bizgaze WebServer
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

sourcemanager.js 5.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  3. return new (P || (P = Promise))(function (resolve, reject) {
  4. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8. });
  9. };
  10. var Unibase;
  11. (function (Unibase) {
  12. let Platform;
  13. (function (Platform) {
  14. let Sources;
  15. (function (Sources) {
  16. let Managers;
  17. (function (Managers) {
  18. class SourceManager extends Platform.Core.BaseManager {
  19. getSource(sourceId) {
  20. return __awaiter(this, void 0, void 0, function* () {
  21. const url = 'apis/v4/unibase/platform/sources/get/' + sourceId;
  22. return yield this.dataHelper().getAsync(url).then(function (response) {
  23. if (response.result != null) {
  24. response.result = JSON.parse(response.result);
  25. }
  26. return response;
  27. });
  28. });
  29. }
  30. saveSource(obj) {
  31. return __awaiter(this, void 0, void 0, function* () {
  32. const url = 'apis/v4/unibase/platform/sources/save';
  33. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  34. if (response.result != null) {
  35. response.result = JSON.parse(response.result);
  36. }
  37. return response;
  38. });
  39. });
  40. }
  41. getSourceSettings(refGuid) {
  42. return __awaiter(this, void 0, void 0, function* () {
  43. const url = 'apis/v4/unibase/platform/sources/getsourcesettings/' + refGuid;
  44. return yield this.dataHelper().getAsync(url).then(function (response) {
  45. if (response.result != null) {
  46. response.result = JSON.parse(response.result);
  47. }
  48. return response;
  49. });
  50. });
  51. }
  52. getSourceSetting(sourceSettingId) {
  53. return __awaiter(this, void 0, void 0, function* () {
  54. const url = 'apis/v4/unibase/platform/sources/getsetting/' + sourceSettingId;
  55. return yield this.dataHelper().getAsync(url).then(function (response) {
  56. if (response.result != null) {
  57. response.result = JSON.parse(response.result);
  58. }
  59. return response;
  60. });
  61. });
  62. }
  63. addSource(obj) {
  64. return __awaiter(this, void 0, void 0, function* () {
  65. const url = 'apis/v4/unibase/platform/sources/savesourcesetting';
  66. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  67. if (response.result != null) {
  68. response.result = JSON.parse(response.result);
  69. }
  70. return response;
  71. });
  72. });
  73. }
  74. deleteSourceSetting(sourceSettingId) {
  75. return __awaiter(this, void 0, void 0, function* () {
  76. const url = 'apis/v4/unibase/platform/sources/deletesourcesetting/id/' + sourceSettingId;
  77. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  78. if (response.result != null) {
  79. response.result = JSON.parse(response.result);
  80. }
  81. return response;
  82. });
  83. });
  84. }
  85. static Instance() {
  86. if (this._instance === undefined)
  87. this._instance = new SourceManager();
  88. return this._instance;
  89. }
  90. }
  91. Managers.SourceManager = SourceManager;
  92. })(Managers = Sources.Managers || (Sources.Managers = {}));
  93. })(Sources = Platform.Sources || (Platform.Sources = {}));
  94. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  95. })(Unibase || (Unibase = {}));