@openinc/parse-server-opendash 2.4.21 → 2.4.23

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 (252) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +31 -31
  3. package/dist/config.js +8 -0
  4. package/dist/featuremap.json +2 -0
  5. package/dist/functions/_init.js +1 -2
  6. package/dist/functions/getAdminConfig.js +1 -2
  7. package/dist/functions/getSchemaForAdmin.js +1 -2
  8. package/dist/functions/opendash-geo-features.js +1 -2
  9. package/dist/functions/opendash-geo-google-autocomplete.d.ts +1 -0
  10. package/dist/functions/opendash-geo-google-autocomplete.js +66 -0
  11. package/dist/functions/opendash-geo-graphhopper-geocode-reverse.d.ts +1 -0
  12. package/dist/functions/opendash-geo-graphhopper-geocode-reverse.js +37 -0
  13. package/dist/functions/opendash-geo-graphhopper-geocode.d.ts +2 -0
  14. package/dist/functions/opendash-geo-graphhopper-geocode.js +65 -0
  15. package/dist/functions/openinc-auth-change-password.js +1 -2
  16. package/dist/functions/openinc-auth-confirm-email.js +1 -2
  17. package/dist/functions/openinc-auth-email-confirmation-request.js +1 -2
  18. package/dist/functions/openinc-auth-email-confirmation.js +1 -2
  19. package/dist/functions/openinc-auth-login-admin.js +1 -2
  20. package/dist/functions/openinc-auth-login-passwordless.js +1 -2
  21. package/dist/functions/openinc-auth-login.js +1 -2
  22. package/dist/functions/openinc-auth-password-reset-request.js +1 -2
  23. package/dist/functions/openinc-auth-password-reset.js +1 -2
  24. package/dist/functions/openinc-auth-signup.js +1 -2
  25. package/dist/functions/openinc-auth-validate-token.js +1 -2
  26. package/dist/functions/openinc-auth.common.d.ts +0 -1
  27. package/dist/functions/openinc-auth.common.js +5 -6
  28. package/dist/functions/openinc-config.js +1 -2
  29. package/dist/functions/openinc-geo-google-autocomplete.js +1 -2
  30. package/dist/functions/openinc-geo-google.common.js +2 -3
  31. package/dist/functions/openinc-geo-graphhopper-geocode-reverse-raw.js +1 -2
  32. package/dist/functions/openinc-geo-graphhopper-geocode-reverse.js +1 -2
  33. package/dist/functions/openinc-geo-graphhopper-geocode.js +1 -2
  34. package/dist/functions/openinc-geo-graphhopper-route-simple.js +1 -2
  35. package/dist/functions/openinc-geo-graphhopper.common.js +2 -3
  36. package/dist/functions/openinc-user-roles.d.ts +1 -0
  37. package/dist/functions/openinc-user-roles.js +19 -0
  38. package/dist/functions/openservice-tickets-sorter.d.ts +1 -0
  39. package/dist/functions/openservice-tickets-sorter.js +7 -0
  40. package/dist/helper/pdf2img.js +1 -2
  41. package/dist/helper/transformLogin.js +1 -2
  42. package/dist/hooks/Alarm.js +1 -2
  43. package/dist/hooks/AlarmAction.js +1 -2
  44. package/dist/hooks/AlarmWebhook.js +1 -2
  45. package/dist/hooks/Attachment.js +1 -2
  46. package/dist/hooks/BDE_Form.js +1 -2
  47. package/dist/hooks/BDE_List.js +1 -2
  48. package/dist/hooks/BDE_ListEntry.js +1 -2
  49. package/dist/hooks/BDE_Page.js +1 -2
  50. package/dist/hooks/BDE_Result.js +1 -2
  51. package/dist/hooks/BDE_Unit.js +1 -2
  52. package/dist/hooks/Company.d.ts +1 -0
  53. package/dist/hooks/Company.js +15 -0
  54. package/dist/hooks/Config.js +1 -2
  55. package/dist/hooks/Contact.d.ts +1 -0
  56. package/dist/hooks/Contact.js +15 -0
  57. package/dist/hooks/Core_Email.js +4 -5
  58. package/dist/hooks/Core_Token.js +1 -2
  59. package/dist/hooks/Dashboard.js +1 -2
  60. package/dist/hooks/GTFS_Agency.js +1 -2
  61. package/dist/hooks/GTFS_Bikes_Allowed.js +1 -2
  62. package/dist/hooks/GTFS_Calendar.js +1 -2
  63. package/dist/hooks/GTFS_Direction.js +1 -2
  64. package/dist/hooks/GTFS_Level.js +1 -2
  65. package/dist/hooks/GTFS_Location_Type.js +1 -2
  66. package/dist/hooks/GTFS_Route.js +1 -2
  67. package/dist/hooks/GTFS_Route_Type.js +1 -2
  68. package/dist/hooks/GTFS_Stop.js +1 -2
  69. package/dist/hooks/GTFS_Stop_Times.js +1 -2
  70. package/dist/hooks/GTFS_Trip.js +1 -2
  71. package/dist/hooks/GTFS_Wheelchair_Accessible.js +1 -2
  72. package/dist/hooks/GTFS_Wheelchair_Boarding.js +1 -2
  73. package/dist/hooks/Group.js +1 -2
  74. package/dist/hooks/Knowledge_Article.js +1 -2
  75. package/dist/hooks/Knowledge_Category.js +1 -2
  76. package/dist/hooks/Knowledge_Document.js +1 -2
  77. package/dist/hooks/Knowledge_DocumentPage.js +1 -2
  78. package/dist/hooks/Knowledge_Video.js +1 -2
  79. package/dist/hooks/Language.js +1 -2
  80. package/dist/hooks/Log.js +1 -2
  81. package/dist/hooks/MIAAS_MDSEndpoint.js +1 -2
  82. package/dist/hooks/MailTemplate.js +1 -2
  83. package/dist/hooks/Maintenance_Article.js +1 -2
  84. package/dist/hooks/Maintenance_DailySchedule.js +1 -2
  85. package/dist/hooks/Maintenance_Downtime.js +1 -2
  86. package/dist/hooks/Maintenance_Duedate.js +1 -2
  87. package/dist/hooks/Maintenance_Frequency.js +1 -2
  88. package/dist/hooks/Maintenance_Issuecategory.js +1 -2
  89. package/dist/hooks/Maintenance_Item.js +1 -2
  90. package/dist/hooks/Maintenance_Kanban_State.js +1 -2
  91. package/dist/hooks/Maintenance_Media.js +1 -2
  92. package/dist/hooks/Maintenance_Message.js +1 -2
  93. package/dist/hooks/Maintenance_Message_Body.js +1 -2
  94. package/dist/hooks/Maintenance_Order.js +1 -2
  95. package/dist/hooks/Maintenance_Priority.js +1 -2
  96. package/dist/hooks/Maintenance_Restriction.js +1 -2
  97. package/dist/hooks/Maintenance_Schedule.js +1 -2
  98. package/dist/hooks/Maintenance_Schedule_Execution.js +1 -2
  99. package/dist/hooks/Maintenance_Schedule_Execution_Step.js +1 -2
  100. package/dist/hooks/Maintenance_Schedule_Step.js +1 -2
  101. package/dist/hooks/Maintenance_SourceMeta.js +1 -2
  102. package/dist/hooks/Maintenance_Ticket.js +1 -2
  103. package/dist/hooks/Maintenance_Ticket_Issuecategory.js +1 -2
  104. package/dist/hooks/Maintenance_Ticket_Kanban_State.js +1 -2
  105. package/dist/hooks/Maintenance_Ticket_Source.js +1 -2
  106. package/dist/hooks/Monitoring_DataHierachies.js +1 -2
  107. package/dist/hooks/Monitoring_Jobs.js +1 -2
  108. package/dist/hooks/Monitoring_ReportImage.js +1 -2
  109. package/dist/hooks/Monitoring_Slideshow.js +1 -2
  110. package/dist/hooks/NavigationGroup.js +1 -2
  111. package/dist/hooks/NavigationItem.js +1 -2
  112. package/dist/hooks/Notification.js +1 -2
  113. package/dist/hooks/Permission.js +1 -2
  114. package/dist/hooks/Push.js +1 -2
  115. package/dist/hooks/Report.js +1 -2
  116. package/dist/hooks/Share.js +1 -2
  117. package/dist/hooks/Source.js +1 -2
  118. package/dist/hooks/SourceMeta.js +14 -4
  119. package/dist/hooks/Tenant.js +1 -2
  120. package/dist/hooks/TenantMeta.js +1 -2
  121. package/dist/hooks/TenantTrustedDomain.js +1 -2
  122. package/dist/hooks/UserData.js +1 -2
  123. package/dist/hooks/VirtualKPI.js +1 -2
  124. package/dist/hooks/WebPush.js +1 -2
  125. package/dist/hooks/Widget.js +1 -2
  126. package/dist/hooks/WidgetPreset.js +1 -2
  127. package/dist/hooks/_User.js +1 -2
  128. package/dist/hooks/_beforeLogin.js +1 -2
  129. package/dist/hooks/_init.js +1 -2
  130. package/dist/index.js +17 -17
  131. package/dist/ow.js +2 -3
  132. package/dist/types/Alarm.d.ts +3 -1
  133. package/dist/types/Alarm.js +6 -0
  134. package/dist/types/AlarmAction.d.ts +0 -1
  135. package/dist/types/AlarmWebhook.d.ts +0 -1
  136. package/dist/types/Attachment.d.ts +0 -1
  137. package/dist/types/BDE_Form.d.ts +0 -1
  138. package/dist/types/BDE_List.d.ts +0 -1
  139. package/dist/types/BDE_ListEntry.d.ts +0 -1
  140. package/dist/types/BDE_Page.d.ts +0 -1
  141. package/dist/types/BDE_Result.d.ts +0 -1
  142. package/dist/types/BDE_Unit.d.ts +0 -1
  143. package/dist/types/Company.d.ts +23 -0
  144. package/dist/types/Company.js +29 -0
  145. package/dist/types/Config.d.ts +0 -1
  146. package/dist/types/Contact.d.ts +54 -0
  147. package/dist/types/Contact.js +95 -0
  148. package/dist/types/Core_Email.d.ts +0 -1
  149. package/dist/types/Core_Token.d.ts +0 -1
  150. package/dist/types/Dashboard.d.ts +0 -1
  151. package/dist/types/GTFS_Agency.d.ts +0 -1
  152. package/dist/types/GTFS_Bikes_Allowed.d.ts +0 -1
  153. package/dist/types/GTFS_Calendar.d.ts +0 -1
  154. package/dist/types/GTFS_Direction.d.ts +0 -1
  155. package/dist/types/GTFS_Level.d.ts +0 -1
  156. package/dist/types/GTFS_Location_Type.d.ts +0 -1
  157. package/dist/types/GTFS_Route.d.ts +0 -1
  158. package/dist/types/GTFS_Route_Type.d.ts +0 -1
  159. package/dist/types/GTFS_Stop.d.ts +0 -1
  160. package/dist/types/GTFS_Stop_Times.d.ts +0 -1
  161. package/dist/types/GTFS_Trip.d.ts +0 -1
  162. package/dist/types/GTFS_Wheelchair_Accessible.d.ts +0 -1
  163. package/dist/types/GTFS_Wheelchair_Boarding.d.ts +0 -1
  164. package/dist/types/Group.d.ts +0 -1
  165. package/dist/types/Knowledge_Article.d.ts +0 -1
  166. package/dist/types/Knowledge_Category.d.ts +0 -1
  167. package/dist/types/Knowledge_Document.d.ts +0 -1
  168. package/dist/types/Knowledge_DocumentPage.d.ts +0 -1
  169. package/dist/types/Knowledge_Video.d.ts +0 -1
  170. package/dist/types/Language.d.ts +0 -1
  171. package/dist/types/Log.d.ts +0 -1
  172. package/dist/types/MIAAS_MDSEndpoint.d.ts +0 -1
  173. package/dist/types/MailTemplate.d.ts +0 -1
  174. package/dist/types/Maintenance_Article.d.ts +0 -1
  175. package/dist/types/Maintenance_DailySchedule.d.ts +10 -1
  176. package/dist/types/Maintenance_DailySchedule.js +15 -0
  177. package/dist/types/Maintenance_Downtime.d.ts +0 -1
  178. package/dist/types/Maintenance_Duedate.d.ts +0 -1
  179. package/dist/types/Maintenance_File.d.ts +24 -0
  180. package/dist/types/Maintenance_File.js +35 -0
  181. package/dist/types/Maintenance_Frequency.d.ts +0 -1
  182. package/dist/types/Maintenance_Issuecategory.d.ts +0 -1
  183. package/dist/types/Maintenance_Item.d.ts +30 -1
  184. package/dist/types/Maintenance_Item.js +57 -0
  185. package/dist/types/Maintenance_Kanban_State.d.ts +0 -1
  186. package/dist/types/Maintenance_Media.d.ts +0 -1
  187. package/dist/types/Maintenance_Message.d.ts +0 -1
  188. package/dist/types/Maintenance_Message_Body.d.ts +0 -1
  189. package/dist/types/Maintenance_Order.d.ts +0 -1
  190. package/dist/types/Maintenance_Priority.d.ts +0 -1
  191. package/dist/types/Maintenance_Restriction.d.ts +0 -1
  192. package/dist/types/Maintenance_Schedule.d.ts +0 -1
  193. package/dist/types/Maintenance_Schedule_Execution.d.ts +0 -1
  194. package/dist/types/Maintenance_Schedule_Execution_Step.d.ts +4 -5
  195. package/dist/types/Maintenance_Schedule_Execution_Step.js +6 -6
  196. package/dist/types/Maintenance_Schedule_Step.d.ts +4 -5
  197. package/dist/types/Maintenance_Schedule_Step.js +6 -6
  198. package/dist/types/Maintenance_SourceMeta.d.ts +0 -1
  199. package/dist/types/Maintenance_Source_File.d.ts +25 -0
  200. package/dist/types/Maintenance_Source_File.js +32 -0
  201. package/dist/types/Maintenance_Ticket.d.ts +6 -1
  202. package/dist/types/Maintenance_Ticket.js +9 -0
  203. package/dist/types/Maintenance_Ticket_Issuecategory.d.ts +0 -1
  204. package/dist/types/Maintenance_Ticket_Kanban_State.d.ts +0 -1
  205. package/dist/types/Maintenance_Ticket_Source.d.ts +0 -1
  206. package/dist/types/Monitoring_DataHierachies.d.ts +0 -1
  207. package/dist/types/Monitoring_Jobs.d.ts +0 -1
  208. package/dist/types/Monitoring_ReportImage.d.ts +0 -1
  209. package/dist/types/Monitoring_Slideshow.d.ts +0 -1
  210. package/dist/types/NavigationGroup.d.ts +0 -1
  211. package/dist/types/NavigationItem.d.ts +0 -1
  212. package/dist/types/Notification.d.ts +0 -1
  213. package/dist/types/Permission.d.ts +6 -1
  214. package/dist/types/Permission.js +12 -0
  215. package/dist/types/Push.d.ts +0 -1
  216. package/dist/types/Report.d.ts +0 -1
  217. package/dist/types/Share.d.ts +0 -1
  218. package/dist/types/Source.d.ts +0 -1
  219. package/dist/types/SourceMeta.d.ts +13 -1
  220. package/dist/types/SourceMeta.js +24 -0
  221. package/dist/types/Tenant.d.ts +0 -1
  222. package/dist/types/TenantMeta.d.ts +0 -1
  223. package/dist/types/TenantTrustedDomain.d.ts +0 -1
  224. package/dist/types/UserData.d.ts +0 -1
  225. package/dist/types/VirtualKPI.d.ts +0 -1
  226. package/dist/types/WebPush.d.ts +0 -1
  227. package/dist/types/Widget.d.ts +0 -1
  228. package/dist/types/WidgetPreset.d.ts +0 -1
  229. package/dist/types/_Role.d.ts +0 -1
  230. package/dist/types/_Session.d.ts +0 -1
  231. package/dist/types/_User.d.ts +0 -1
  232. package/dist/types/index.d.ts +8 -0
  233. package/dist/types/index.js +10 -2
  234. package/package.json +8 -8
  235. package/schema/BDE_Form.json +52 -52
  236. package/schema/GTFS_Route.json +78 -78
  237. package/schema/GTFS_Trip.json +70 -70
  238. package/schema/MailTemplate.json +52 -52
  239. package/schema/Maintenance_DailySchedule.json +49 -49
  240. package/schema/Maintenance_Message.json +54 -54
  241. package/schema/Maintenance_Message_Body.json +51 -51
  242. package/schema/Maintenance_Ticket.json +62 -62
  243. package/schema/Monitoring_DataHierachies.json +49 -49
  244. package/schema/Monitoring_Jobs.json +54 -54
  245. package/schema/Monitoring_ReportImage.json +52 -52
  246. package/schema/Report.json +73 -73
  247. package/schema/Source.json +52 -52
  248. package/schema/SourceMeta.json +34 -34
  249. package/schema/Tenant.json +81 -81
  250. package/schema/TenantMeta.json +30 -30
  251. package/schema/VirtualKPI.json +50 -50
  252. package/schema/WebPush.json +42 -42
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.init = void 0;
3
+ exports.init = init;
4
4
  const __1 = require("..");
5
5
  const config_1 = require("../config");
6
6
  const transformLogin_1 = require("../helper/transformLogin");
@@ -145,4 +145,3 @@ async function init() {
145
145
  });
146
146
  }
147
147
  }
148
- exports.init = init;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.init = void 0;
3
+ exports.init = init;
4
4
  const config_1 = require("../config");
5
5
  async function init() {
6
6
  Parse.Cloud.beforeLogin(async ({ object }) => {
@@ -19,4 +19,3 @@ async function init() {
19
19
  }
20
20
  });
21
21
  }
22
- exports.init = init;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.init = void 0;
6
+ exports.init = init;
7
7
  const fs_1 = __importDefault(require("fs"));
8
8
  async function init() {
9
9
  const classNames = [
@@ -20,4 +20,3 @@ async function init() {
20
20
  await init().catch((e) => console.error(e));
21
21
  }
22
22
  }
23
- exports.init = init;
package/dist/index.js CHANGED
@@ -3,7 +3,23 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.ensurePermission = exports.autoloadCloudCode = exports.afterDeleteHook = exports.beforeDeleteHook = exports.afterSaveHook = exports.beforeSaveHook = exports.defaultAclHandler = exports.defaultHandler = exports.immutableField = exports.ensureUserRole = exports.ensureRole = exports.getConfigBoolean = exports.getConfig = exports.requirePermission = exports.hasPermission = exports.init = exports.sendTemplateEmail = exports.sendSimpleEmail = void 0;
6
+ exports.sendTemplateEmail = exports.sendSimpleEmail = void 0;
7
+ exports.init = init;
8
+ exports.hasPermission = hasPermission;
9
+ exports.requirePermission = requirePermission;
10
+ exports.getConfig = getConfig;
11
+ exports.getConfigBoolean = getConfigBoolean;
12
+ exports.ensureRole = ensureRole;
13
+ exports.ensureUserRole = ensureUserRole;
14
+ exports.immutableField = immutableField;
15
+ exports.defaultHandler = defaultHandler;
16
+ exports.defaultAclHandler = defaultAclHandler;
17
+ exports.beforeSaveHook = beforeSaveHook;
18
+ exports.afterSaveHook = afterSaveHook;
19
+ exports.beforeDeleteHook = beforeDeleteHook;
20
+ exports.afterDeleteHook = afterDeleteHook;
21
+ exports.autoloadCloudCode = autoloadCloudCode;
22
+ exports.ensurePermission = ensurePermission;
7
23
  const parse_server_schema_1 = require("@openinc/parse-server-schema");
8
24
  const fast_equals_1 = require("fast-equals");
9
25
  const fs_1 = __importDefault(require("fs"));
@@ -46,7 +62,6 @@ async function init() {
46
62
  await (0, _init_1.init)();
47
63
  await initAutoload();
48
64
  }
49
- exports.init = init;
50
65
  async function initWebPush() {
51
66
  try {
52
67
  if (config_1.config.getBoolean("WEB_PUSH_ENABLED")) {
@@ -142,7 +157,6 @@ async function hasPermission(sessionToken, key) {
142
157
  .first({ sessionToken });
143
158
  return !!result;
144
159
  }
145
- exports.hasPermission = hasPermission;
146
160
  /**
147
161
  * Checks if the user has the required permission to perform an operation using hasPermission().
148
162
  * If the user does not have the required permission, an error is thrown.
@@ -167,7 +181,6 @@ async function requirePermission(request, key, message) {
167
181
  throw new Parse.Error(119, "Missing Permission (3): " + (message || key || "Master Key Only"));
168
182
  }
169
183
  }
170
- exports.requirePermission = requirePermission;
171
184
  /**
172
185
  * Retrieves the value of a configuration key from OD3_Config.
173
186
  * @param key - The key of the configuration to retrieve.
@@ -181,7 +194,6 @@ async function getConfig(key) {
181
194
  console.log("[@openinc/parse-server-opendash][Config]", key, value);
182
195
  return value || "";
183
196
  }
184
- exports.getConfig = getConfig;
185
197
  /**
186
198
  * Retrieves the value of a configuration key from OD3_Config as a boolean
187
199
  * Converts the string value to a boolean value using the following rules:
@@ -200,7 +212,6 @@ async function getConfigBoolean(key) {
200
212
  }
201
213
  return true;
202
214
  }
203
- exports.getConfigBoolean = getConfigBoolean;
204
215
  /**
205
216
  * Ensures the existence of a role with the specified name.
206
217
  * If the role does not exist, it creates a new role with the given name and options.
@@ -260,7 +271,6 @@ async function ensureRole(name, options) {
260
271
  await role.save(null, { useMasterKey: true });
261
272
  }
262
273
  }
263
- exports.ensureRole = ensureRole;
264
274
  /**
265
275
  * Ensures that a user has a specific role.
266
276
  * @param user The user to assign the role to.
@@ -283,7 +293,6 @@ async function ensureUserRole(user, roleName, add = false) {
283
293
  console.log("userRole", user.get("username"), roleName, add);
284
294
  }
285
295
  }
286
- exports.ensureUserRole = ensureUserRole;
287
296
  /**
288
297
  * Checks if a field is immutable and throws an error if an attempt is made to edit it in a beforeSave hook.
289
298
  *
@@ -305,7 +314,6 @@ async function immutableField(request, fieldName, permissionName = "parse:edit-i
305
314
  }
306
315
  await requirePermission(request, permissionName, `You are not allowed to edit the '${fieldName}' field.`);
307
316
  }
308
- exports.immutableField = immutableField;
309
317
  /**
310
318
  * Handles the default beforeSave() logic for a Parse.Object.
311
319
  *
@@ -350,7 +358,6 @@ async function defaultHandler(request) {
350
358
  }
351
359
  }
352
360
  }
353
- exports.defaultHandler = defaultHandler;
354
361
  /**
355
362
  * Handles the default Parse.ACL beforeSave() logic for a Parse.Object.
356
363
  *
@@ -398,7 +405,6 @@ async function defaultAclHandler(request, options) {
398
405
  }
399
406
  }
400
407
  }
401
- exports.defaultAclHandler = defaultAclHandler;
402
408
  const beforeSaveHooks = {};
403
409
  /**
404
410
  * Registers a beforeSave hook for a Parse class. In comparison to Parse.Cloud.beforeSave(), this function allows multiple beforeSave hooks to be registered for the same class.
@@ -423,7 +429,6 @@ function beforeSaveHook(target, callback) {
423
429
  }
424
430
  beforeSaveHooks[className].push(callback);
425
431
  }
426
- exports.beforeSaveHook = beforeSaveHook;
427
432
  const afterSaveHooks = {};
428
433
  /**
429
434
  * Registers a afterSave hook for a Parse class. In comparison to Parse.Cloud.afterSave(), this function allows multiple beforeSave hooks to be registered for the same class.
@@ -448,7 +453,6 @@ function afterSaveHook(target, callback) {
448
453
  }
449
454
  afterSaveHooks[className].push(callback);
450
455
  }
451
- exports.afterSaveHook = afterSaveHook;
452
456
  const beforeDeleteHooks = {};
453
457
  /**
454
458
  * Registers a beforeDelete hook for a Parse class. In comparison to Parse.Cloud.beforeDelete(), this function allows multiple beforeSave hooks to be registered for the same class.
@@ -472,7 +476,6 @@ function beforeDeleteHook(target, callback) {
472
476
  }
473
477
  beforeDeleteHooks[className].push(callback);
474
478
  }
475
- exports.beforeDeleteHook = beforeDeleteHook;
476
479
  const afterDeleteHooks = {};
477
480
  /**
478
481
  * Registers a afterDelete hook for a Parse class. In comparison to Parse.Cloud.afterDelete(), this function allows multiple beforeSave hooks to be registered for the same class.
@@ -497,7 +500,6 @@ function afterDeleteHook(target, callback) {
497
500
  }
498
501
  afterDeleteHooks[className].push(callback);
499
502
  }
500
- exports.afterDeleteHook = afterDeleteHook;
501
503
  /**
502
504
  * Autoloads cloud code files from the specified path. Each file MUST export an init() function that takes the file name (without it's extension) as an argument.
503
505
  *
@@ -516,7 +518,6 @@ async function autoloadCloudCode(path, regex = /^[a-zA-Z0-9]+(?:-[a-zA-Z0-9]+)*$
516
518
  await init(name).catch((e) => console.error(e));
517
519
  }
518
520
  }
519
- exports.autoloadCloudCode = autoloadCloudCode;
520
521
  async function initAutoload() {
521
522
  const path = config_1.config.get("AUTOLOAD_DIR");
522
523
  if (path) {
@@ -583,7 +584,6 @@ async function ensurePermission(key, acl) {
583
584
  return await newPermission.save(null, { useMasterKey: true });
584
585
  }
585
586
  }
586
- exports.ensurePermission = ensurePermission;
587
587
  async function createRandomPassword() {
588
588
  const length = 32;
589
589
  const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
package/dist/ow.js CHANGED
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.publishDataItem = exports.getToken = void 0;
6
+ exports.getToken = getToken;
7
+ exports.publishDataItem = publishDataItem;
7
8
  const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
8
9
  const node_fetch_1 = __importDefault(require("node-fetch"));
9
10
  const config_1 = require("./config");
@@ -25,7 +26,6 @@ async function getToken(usermail) {
25
26
  }
26
27
  return null;
27
28
  }
28
- exports.getToken = getToken;
29
29
  async function publishDataItem(dataItem, usermail) {
30
30
  const active = config_1.config.getBoolean("OPENWARE");
31
31
  if (!active) {
@@ -85,4 +85,3 @@ async function publishDataItem(dataItem, usermail) {
85
85
  }
86
86
  console.log(LOG_PREFIX + "PUBLISH SUCCESS " + (await response.text()));
87
87
  }
88
- exports.publishDataItem = publishDataItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { _User } from "./_User";
3
2
  export interface AlarmAttributes {
4
3
  id: string;
@@ -11,6 +10,7 @@ export interface AlarmAttributes {
11
10
  item_id?: string;
12
11
  item_source?: string;
13
12
  name?: string;
13
+ sent?: number;
14
14
  trigger?: any;
15
15
  user: _User;
16
16
  }
@@ -29,6 +29,8 @@ export declare class Alarm extends Parse.Object<AlarmAttributes> {
29
29
  set item_source(value: string | undefined);
30
30
  get name(): string | undefined;
31
31
  set name(value: string | undefined);
32
+ get sent(): number | undefined;
33
+ set sent(value: number | undefined);
32
34
  get trigger(): any | undefined;
33
35
  set trigger(value: any | undefined);
34
36
  get user(): _User;
@@ -41,6 +41,12 @@ class Alarm extends Parse.Object {
41
41
  set name(value) {
42
42
  super.set("name", value);
43
43
  }
44
+ get sent() {
45
+ return super.get("sent");
46
+ }
47
+ set sent(value) {
48
+ super.set("sent", value);
49
+ }
44
50
  get trigger() {
45
51
  return super.get("trigger");
46
52
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface AlarmActionAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  import type { _User } from "./_User";
4
3
  export interface AlarmWebhookAttributes {
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { _User } from "./_User";
3
2
  export interface AttachmentAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  export interface BDE_FormAttributes {
3
2
  id: string;
4
3
  objectId: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  export interface BDE_ListAttributes {
3
2
  id: string;
4
3
  objectId: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { BDE_List } from "./BDE_List";
3
2
  export interface BDE_ListEntryAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  export interface BDE_PageAttributes {
3
2
  id: string;
4
3
  objectId: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  export interface BDE_ResultAttributes {
3
2
  id: string;
4
3
  objectId: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { BDE_Form } from "./BDE_Form";
3
2
  export interface BDE_UnitAttributes {
4
3
  id: string;
@@ -0,0 +1,23 @@
1
+ import type { Contact } from "./Contact";
2
+ import type { Source } from "./Source";
3
+ import type { Tenant } from "./Tenant";
4
+ export interface CompanyAttributes {
5
+ id: string;
6
+ objectId: string;
7
+ createdAt: Date;
8
+ updatedAt: Date;
9
+ contacts: Parse.Relation<Company, Contact>;
10
+ name?: string;
11
+ sources: Parse.Relation<Company, Source>;
12
+ tenant?: Tenant;
13
+ }
14
+ export declare class Company extends Parse.Object<CompanyAttributes> {
15
+ static className: string;
16
+ constructor(data?: Partial<CompanyAttributes>);
17
+ get contacts(): Parse.Relation<Company, Contact>;
18
+ get name(): string | undefined;
19
+ set name(value: string | undefined);
20
+ get sources(): Parse.Relation<Company, Source>;
21
+ get tenant(): Tenant | undefined;
22
+ set tenant(value: Tenant | undefined);
23
+ }
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Company = void 0;
4
+ class Company extends Parse.Object {
5
+ constructor(data) {
6
+ super("OD3_Company", data);
7
+ }
8
+ get contacts() {
9
+ return super.relation("contacts");
10
+ }
11
+ get name() {
12
+ return super.get("name");
13
+ }
14
+ set name(value) {
15
+ super.set("name", value);
16
+ }
17
+ get sources() {
18
+ return super.relation("sources");
19
+ }
20
+ get tenant() {
21
+ return super.get("tenant");
22
+ }
23
+ set tenant(value) {
24
+ super.set("tenant", value);
25
+ }
26
+ }
27
+ exports.Company = Company;
28
+ Company.className = "OD3_Company";
29
+ Parse.Object.registerSubclass("OD3_Company", Company);
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface ConfigAttributes {
4
3
  id: string;
@@ -0,0 +1,54 @@
1
+ import type { Tenant } from "./Tenant";
2
+ import type { _User } from "./_User";
3
+ export interface ContactAttributes {
4
+ id: string;
5
+ objectId: string;
6
+ createdAt: Date;
7
+ updatedAt: Date;
8
+ city?: string;
9
+ company?: string;
10
+ department?: string;
11
+ description?: string;
12
+ email?: string;
13
+ firstname?: string;
14
+ lastname?: string;
15
+ phone?: string;
16
+ position?: string;
17
+ postal?: string;
18
+ street?: string;
19
+ tenant?: Tenant;
20
+ user?: _User;
21
+ website?: string;
22
+ }
23
+ export declare class Contact extends Parse.Object<ContactAttributes> {
24
+ static className: string;
25
+ constructor(data?: Partial<ContactAttributes>);
26
+ get city(): string | undefined;
27
+ set city(value: string | undefined);
28
+ get company(): string | undefined;
29
+ set company(value: string | undefined);
30
+ get department(): string | undefined;
31
+ set department(value: string | undefined);
32
+ get description(): string | undefined;
33
+ set description(value: string | undefined);
34
+ get email(): string | undefined;
35
+ set email(value: string | undefined);
36
+ get firstname(): string | undefined;
37
+ set firstname(value: string | undefined);
38
+ get lastname(): string | undefined;
39
+ set lastname(value: string | undefined);
40
+ get phone(): string | undefined;
41
+ set phone(value: string | undefined);
42
+ get position(): string | undefined;
43
+ set position(value: string | undefined);
44
+ get postal(): string | undefined;
45
+ set postal(value: string | undefined);
46
+ get street(): string | undefined;
47
+ set street(value: string | undefined);
48
+ get tenant(): Tenant | undefined;
49
+ set tenant(value: Tenant | undefined);
50
+ get user(): _User | undefined;
51
+ set user(value: _User | undefined);
52
+ get website(): string | undefined;
53
+ set website(value: string | undefined);
54
+ }
@@ -0,0 +1,95 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Contact = void 0;
4
+ class Contact extends Parse.Object {
5
+ constructor(data) {
6
+ super("OD3_Contact", data);
7
+ }
8
+ get city() {
9
+ return super.get("city");
10
+ }
11
+ set city(value) {
12
+ super.set("city", value);
13
+ }
14
+ get company() {
15
+ return super.get("company");
16
+ }
17
+ set company(value) {
18
+ super.set("company", value);
19
+ }
20
+ get department() {
21
+ return super.get("department");
22
+ }
23
+ set department(value) {
24
+ super.set("department", value);
25
+ }
26
+ get description() {
27
+ return super.get("description");
28
+ }
29
+ set description(value) {
30
+ super.set("description", value);
31
+ }
32
+ get email() {
33
+ return super.get("email");
34
+ }
35
+ set email(value) {
36
+ super.set("email", value);
37
+ }
38
+ get firstname() {
39
+ return super.get("firstname");
40
+ }
41
+ set firstname(value) {
42
+ super.set("firstname", value);
43
+ }
44
+ get lastname() {
45
+ return super.get("lastname");
46
+ }
47
+ set lastname(value) {
48
+ super.set("lastname", value);
49
+ }
50
+ get phone() {
51
+ return super.get("phone");
52
+ }
53
+ set phone(value) {
54
+ super.set("phone", value);
55
+ }
56
+ get position() {
57
+ return super.get("position");
58
+ }
59
+ set position(value) {
60
+ super.set("position", value);
61
+ }
62
+ get postal() {
63
+ return super.get("postal");
64
+ }
65
+ set postal(value) {
66
+ super.set("postal", value);
67
+ }
68
+ get street() {
69
+ return super.get("street");
70
+ }
71
+ set street(value) {
72
+ super.set("street", value);
73
+ }
74
+ get tenant() {
75
+ return super.get("tenant");
76
+ }
77
+ set tenant(value) {
78
+ super.set("tenant", value);
79
+ }
80
+ get user() {
81
+ return super.get("user");
82
+ }
83
+ set user(value) {
84
+ super.set("user", value);
85
+ }
86
+ get website() {
87
+ return super.get("website");
88
+ }
89
+ set website(value) {
90
+ super.set("website", value);
91
+ }
92
+ }
93
+ exports.Contact = Contact;
94
+ Contact.className = "OD3_Contact";
95
+ Parse.Object.registerSubclass("OD3_Contact", Contact);
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  export interface Core_EmailAttributes {
3
2
  id: string;
4
3
  objectId: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  export interface Core_TokenAttributes {
3
2
  id: string;
4
3
  objectId: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Source } from "./Source";
3
2
  import type { _User } from "./_User";
4
3
  export interface DashboardAttributes {
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface GTFS_AgencyAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface GTFS_Bikes_AllowedAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface GTFS_CalendarAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface GTFS_DirectionAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface GTFS_LevelAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface GTFS_Location_TypeAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { GTFS_Agency } from "./GTFS_Agency";
3
2
  import type { Tenant } from "./Tenant";
4
3
  export interface GTFS_RouteAttributes {
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface GTFS_Route_TypeAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { GTFS_Level } from "./GTFS_Level";
3
2
  import type { GTFS_Location_Type } from "./GTFS_Location_Type";
4
3
  import type { GTFS_Wheelchair_Boarding } from "./GTFS_Wheelchair_Boarding";
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { GTFS_Stop } from "./GTFS_Stop";
3
2
  import type { GTFS_Trip } from "./GTFS_Trip";
4
3
  import type { Tenant } from "./Tenant";
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { GTFS_Bikes_Allowed } from "./GTFS_Bikes_Allowed";
3
2
  import type { GTFS_Calendar } from "./GTFS_Calendar";
4
3
  import type { GTFS_Direction } from "./GTFS_Direction";
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface GTFS_Wheelchair_AccessibleAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  export interface GTFS_Wheelchair_BoardingAttributes {
4
3
  id: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Tenant } from "./Tenant";
3
2
  import type { _User } from "./_User";
4
3
  export interface GroupAttributes {
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Knowledge_Category } from "./Knowledge_Category";
3
2
  import type { Language } from "./Language";
4
3
  import type { Tenant } from "./Tenant";
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Language } from "./Language";
3
2
  import type { Tenant } from "./Tenant";
4
3
  export interface Knowledge_CategoryAttributes {
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Knowledge_Category } from "./Knowledge_Category";
3
2
  import type { Language } from "./Language";
4
3
  import type { Tenant } from "./Tenant";
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Knowledge_Document } from "./Knowledge_Document";
3
2
  import type { Tenant } from "./Tenant";
4
3
  export interface Knowledge_DocumentPageAttributes {
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  import type { Knowledge_Category } from "./Knowledge_Category";
3
2
  import type { Language } from "./Language";
4
3
  import type { Tenant } from "./Tenant";
@@ -1,4 +1,3 @@
1
- /// <reference types="parse" />
2
1
  export interface LanguageAttributes {
3
2
  id: string;
4
3
  objectId: string;