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.

filemanager.js 7.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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 Files;
  15. (function (Files) {
  16. let Managers;
  17. (function (Managers) {
  18. class FileManager extends Platform.Core.BaseManager {
  19. validateDocument(Id, InstalledAppId) {
  20. return __awaiter(this, void 0, void 0, function* () {
  21. const url = 'apis/v4/unibase/platform/files/validatedocument/pkid/' + Id + '/installedappid/' + InstalledAppId;
  22. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  23. if (response.result !== null)
  24. response.result = JSON.parse(response.result);
  25. return response;
  26. });
  27. });
  28. }
  29. validateDocumentByGroup(Id, InstalledAppId) {
  30. return __awaiter(this, void 0, void 0, function* () {
  31. const url = 'apis/v4/unibase/platform/files/validatedocumentbygroup/pkid/' + Id + '/installedappid/' + InstalledAppId;
  32. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  33. if (response.result !== null)
  34. response.result = JSON.parse(response.result);
  35. return response;
  36. });
  37. });
  38. }
  39. getDocumentTypes() {
  40. return __awaiter(this, void 0, void 0, function* () {
  41. const url = 'apis/v4/unibase/platform/files/documenttypes';
  42. return yield this.dataHelper().getAsync(url).then(function (response) {
  43. if (response.result !== null)
  44. response.result = JSON.parse(response.result);
  45. return response;
  46. });
  47. });
  48. }
  49. getDocumentFile(Id) {
  50. return __awaiter(this, void 0, void 0, function* () {
  51. const url = 'apis/v4/unibase/platform/files/getdocumentfile/fileid/' + Id;
  52. return yield this.dataHelper().getAsync(url).then(function (response) {
  53. if (response.result !== null)
  54. response.result = JSON.parse(response.result);
  55. return response;
  56. });
  57. });
  58. }
  59. getDocumentBase64File(Id) {
  60. return __awaiter(this, void 0, void 0, function* () {
  61. const url = 'apis/v4/unibase/platform/files/getebase64documentfile/id/' + Id;
  62. return yield this.dataHelper().getAsync(url).then(function (response) {
  63. if (response.result !== null)
  64. response.result = JSON.parse(response.result);
  65. return response;
  66. });
  67. });
  68. }
  69. getDocumentByRefId(refid, formpropertyid) {
  70. return __awaiter(this, void 0, void 0, function* () {
  71. const url = 'apis/v4/unibase/platform/files/getdocumentbyrefid/refid/' + refid + '/formpropertyid/' + formpropertyid;
  72. return yield this.dataHelper().getAsync(url).then(function (response) {
  73. if (response.result !== null && response.result !== "")
  74. response.result = JSON.parse(response.result);
  75. return response;
  76. });
  77. });
  78. }
  79. deleteDocumentFile(DocumentFileId) {
  80. return __awaiter(this, void 0, void 0, function* () {
  81. const url = 'apis/v4/unibase/platform/files/deletedocumentfile/documentfileid/' + DocumentFileId;
  82. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  83. return response;
  84. });
  85. });
  86. }
  87. updateFileProvider(fileproviderid) {
  88. return __awaiter(this, void 0, void 0, function* () {
  89. const url = 'apis/v4/unibase/platform/files/updatefileprovider/fileproviderid/' + fileproviderid;
  90. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  91. return response;
  92. });
  93. });
  94. }
  95. getfileprovider() {
  96. return __awaiter(this, void 0, void 0, function* () {
  97. const url = 'apis/v4/unibase/platform/files/gettenant';
  98. return yield this.dataHelper().getAsync(url).then(function (response) {
  99. if (response.result !== null)
  100. response.result = JSON.parse(response.result);
  101. return response;
  102. });
  103. });
  104. }
  105. _tempFileSave(postData) {
  106. return __awaiter(this, void 0, void 0, function* () {
  107. const url = 'apis/v4/unibase/platform/forms/uploadfile';
  108. return yield this.dataHelper().postAsync(url, postData).then(function (response) {
  109. return response;
  110. });
  111. });
  112. }
  113. getDocumentByRefIdApi(RefId) {
  114. return __awaiter(this, void 0, void 0, function* () {
  115. const url = 'apis/v4/unibase/platform/files/getdocumentbyrefidapi/refid/' + RefId;
  116. return yield this.dataHelper().getAsync(url).then(function (response) {
  117. if (response.result !== null && response.result !== "")
  118. response.result = JSON.parse(response.result);
  119. return response;
  120. });
  121. });
  122. }
  123. static Instance() {
  124. if (this.instance === undefined) {
  125. this.instance = new FileManager();
  126. }
  127. return this.instance;
  128. }
  129. }
  130. Managers.FileManager = FileManager;
  131. })(Managers = Files.Managers || (Files.Managers = {}));
  132. })(Files = Platform.Files || (Platform.Files = {}));
  133. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  134. })(Unibase || (Unibase = {}));