Built files from Bizgaze WebServer
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

remindermanager.js 11KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  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 Communications;
  15. (function (Communications) {
  16. let Managers;
  17. (function (Managers) {
  18. class ReminderManager extends Platform.Core.BaseManager {
  19. static Instance() {
  20. if (this._instance === undefined)
  21. this._instance = new ReminderManager();
  22. return this._instance;
  23. }
  24. getReminders(ReminderType, pagesize) {
  25. return __awaiter(this, void 0, void 0, function* () {
  26. const url = 'apis/v4/unibase/reminders/platform/getunreadreminders/ReminderType/' + ReminderType + '/PageSize/' + pagesize;
  27. return yield this.dataHelper().getAsync(url).then(function (response) {
  28. return JSON.parse(response.result);
  29. });
  30. });
  31. }
  32. changeReminderStatus(reminderid, status) {
  33. return __awaiter(this, void 0, void 0, function* () {
  34. const url = 'apis/v4/unibase/reminders/platform/changereminderstatus/reminderid/' + reminderid + '/status/' + status;
  35. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  36. if (response.result !== null)
  37. response.result = JSON.parse(response.result);
  38. return response;
  39. });
  40. });
  41. }
  42. getUnreadRemindersCount(ReminderType) {
  43. return __awaiter(this, void 0, void 0, function* () {
  44. const url = 'apis/v4/unibase/reminders/platform/unreadreminderscount/remindertype/' + ReminderType;
  45. return yield this.dataHelper().getAsync(url).then(function (response) {
  46. return response;
  47. });
  48. });
  49. }
  50. getUnreadRemindersCountByUserId() {
  51. return __awaiter(this, void 0, void 0, function* () {
  52. const url = 'apis/v4/unibase/reminders/platform/getunreadreminderscount';
  53. return yield this.dataHelper().getAsync(url).then(function (response) {
  54. if (response.result != null) {
  55. response.result = JSON.parse(response.result);
  56. }
  57. return response;
  58. });
  59. });
  60. }
  61. saveInstantReminder(obj) {
  62. return __awaiter(this, void 0, void 0, function* () {
  63. const url = 'apis/v4/unibase/instantreminders/platform/saveinstantreminder';
  64. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  65. if (response.result != null) {
  66. response.result = JSON.parse(response.result);
  67. }
  68. return response;
  69. });
  70. });
  71. }
  72. sendInstantReminder(obj) {
  73. return __awaiter(this, void 0, void 0, function* () {
  74. const url = 'apis/v4/unibase/instantreminders/platform/sendinstantreminder';
  75. return yield this.dataHelper().postAsync(url, obj).then(function (response) {
  76. if (response.result != null) {
  77. response.result = JSON.parse(response.result);
  78. }
  79. return response;
  80. });
  81. });
  82. }
  83. getInstantReminder(instantreminderid) {
  84. return __awaiter(this, void 0, void 0, function* () {
  85. const url = 'apis/v4/unibase/instantreminders/platform/Getinstantreminder/instantreminderid/' + instantreminderid;
  86. return yield this.dataHelper().getAsync(url).then(function (response) {
  87. if (response.result != null) {
  88. response.result = JSON.parse(response.result);
  89. }
  90. return response;
  91. });
  92. });
  93. }
  94. getRemindersWithType(ExecutedActionId, IsTask) {
  95. return __awaiter(this, void 0, void 0, function* () {
  96. const url = 'apis/v4/unibase/reminders/platform/getreminders/executedactionid/' + ExecutedActionId + '/istask/' + IsTask;
  97. return yield this.dataHelper().getAsync(url).then(function (response) {
  98. if (response.result != null) {
  99. response.result = JSON.parse(response.result);
  100. }
  101. return response;
  102. });
  103. });
  104. }
  105. updateIsDuplicate(instantreminderid, Isduplicate) {
  106. return __awaiter(this, void 0, void 0, function* () {
  107. const url = 'apis/v4/unibase/instantreminders/platform/UpdateIsduplicate/instantreminderid/' + instantreminderid + '/Isduplicate/' + Isduplicate;
  108. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  109. if (response.result != null) {
  110. response.result = JSON.parse(response.result);
  111. }
  112. return response;
  113. });
  114. });
  115. }
  116. getRecipients(instantreminderid, isduplicate) {
  117. return __awaiter(this, void 0, void 0, function* () {
  118. const url = 'apis/v4/unibase/instantreminders/platform/Getrecipients/instantreminderid/' + instantreminderid + '/isduplicate/' + isduplicate;
  119. return yield this.dataHelper().getAsync(url).then(function (response) {
  120. if (response.result != null) {
  121. response.result = JSON.parse(response.result);
  122. }
  123. return response;
  124. });
  125. });
  126. }
  127. markAsReadUnreadReminders(reminders) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. const url = 'apis/v4/unibase/reminders/platform/MarkallUnreadreminders';
  130. return yield this.dataHelper().postAsync(url, reminders).then(function (response) {
  131. return response;
  132. });
  133. });
  134. }
  135. ChangeAllReminderStatusAsRead() {
  136. return __awaiter(this, void 0, void 0, function* () {
  137. const url = 'apis/v4/unibase/reminders/platform/ChangeReminderStatusAsRead/np';
  138. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  139. return response;
  140. });
  141. });
  142. }
  143. ExportSingleInstantReminder(Instantreminderid) {
  144. return __awaiter(this, void 0, void 0, function* () {
  145. const url = 'apis/v4/unibase/instantreminders/platform/ExportInstantReminder/InstantReminderId/' + Instantreminderid;
  146. return yield this.dataHelper().getAsync(url).then(function (response) {
  147. if (response.result != null) {
  148. response = response.result;
  149. }
  150. return response;
  151. });
  152. });
  153. }
  154. ExportInstantReminders() {
  155. return __awaiter(this, void 0, void 0, function* () {
  156. const url = 'apis/v4/unibase/instantreminders/platform/ExportAllnstantReminders';
  157. return yield this.dataHelper().getAsync(url).then(function (response) {
  158. if (response.result != null) {
  159. response = response.result;
  160. }
  161. return response;
  162. });
  163. });
  164. }
  165. SendToAll(refguid) {
  166. return __awaiter(this, void 0, void 0, function* () {
  167. const url = 'apis/v4/unibase/instantreminders/platform/SendInstantReminderToAllTenants/RefGuid/' + refguid;
  168. return yield this.dataHelper().postAsync(url, null).then(function (response) {
  169. if (response.result != null) {
  170. response = response.result;
  171. }
  172. return response;
  173. });
  174. });
  175. }
  176. }
  177. Managers.ReminderManager = ReminderManager;
  178. })(Managers = Communications.Managers || (Communications.Managers = {}));
  179. })(Communications = Platform.Communications || (Platform.Communications = {}));
  180. })(Platform = Unibase.Platform || (Unibase.Platform = {}));
  181. })(Unibase || (Unibase = {}));