@openinc/parse-server-opendash 2.4.103 → 3.0.0

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 (128) hide show
  1. package/dist/featuremap.json +4 -1
  2. package/dist/features/config/helper/baseOptions.d.ts +2 -0
  3. package/dist/features/config/helper/baseOptions.js +50 -0
  4. package/dist/features/config/helper/customOptions.d.ts +2 -0
  5. package/dist/{config.js → features/config/helper/customOptions.js} +2 -4
  6. package/dist/features/config/index.d.ts +6 -0
  7. package/dist/features/config/index.js +16 -0
  8. package/dist/features/config/services/ConfigInstance.d.ts +5 -0
  9. package/dist/features/config/services/ConfigInstance.js +13 -0
  10. package/dist/features/config/states/Config.d.ts +20 -0
  11. package/dist/{helper → features/config/states}/Config.js +86 -52
  12. package/dist/features/config/types/configTypes.d.ts +35 -0
  13. package/dist/features/cron/index.d.ts +1 -0
  14. package/dist/features/notifications/index.d.ts +4 -0
  15. package/dist/features/notifications/index.js +13 -0
  16. package/dist/features/notifications/services/registerNotification.d.ts +7 -0
  17. package/dist/features/notifications/services/registerNotification.js +80 -0
  18. package/dist/features/notifications/states/NotificationClass.d.ts +12 -0
  19. package/dist/features/notifications/states/NotificationClass.js +21 -0
  20. package/dist/features/notifications/types/NotificationTypes.d.ts +11 -0
  21. package/dist/features/notifications/types/NotificationTypes.js +2 -0
  22. package/dist/features/openservice/index.d.ts +2 -0
  23. package/dist/features/openservice/index.js +5 -0
  24. package/dist/{helper/TranslationKeys.d.ts → features/openservice/types/OpenserviceTranslationKeys.d.ts} +1 -1
  25. package/dist/{helper/TranslationKeys.js → features/openservice/types/OpenserviceTranslationKeys.js} +5 -5
  26. package/dist/{helper → features/openservice/types}/TicketData.d.ts +1 -1
  27. package/dist/features/openservice/types/TicketData.js +2 -0
  28. package/dist/features/openware/helper/getToken.d.ts +1 -0
  29. package/dist/features/openware/helper/getToken.js +25 -0
  30. package/dist/features/openware/index.d.ts +7 -0
  31. package/dist/features/openware/index.js +7 -0
  32. package/dist/features/openware/services/publishDataItem.d.ts +2 -0
  33. package/dist/{ow.js → features/openware/services/publishDataItem.js} +5 -23
  34. package/dist/features/openware/types/DataItemInterface.d.ts +10 -0
  35. package/dist/features/openware/types/DataItemInterface.js +2 -0
  36. package/dist/features/openware/types/DataItemValueInterface.d.ts +4 -0
  37. package/dist/features/openware/types/DataItemValueInterface.js +2 -0
  38. package/dist/features/openware/types/DataItemValueTypeInterface.d.ts +6 -0
  39. package/dist/features/openware/types/DataItemValueTypeInterface.js +2 -0
  40. package/dist/features/openware/types/DataItemValueTypeTypeField.d.ts +1 -0
  41. package/dist/features/openware/types/DataItemValueTypeTypeField.js +2 -0
  42. package/dist/{app_types → features/openware/types}/OpenWareTicketObject.d.ts +1 -1
  43. package/dist/features/openware/types/OpenWareTicketObject.js +2 -0
  44. package/dist/features/permissions/index.d.ts +4 -0
  45. package/dist/features/permissions/index.js +13 -0
  46. package/dist/features/permissions/services/registerPermissions.d.ts +7 -0
  47. package/dist/features/permissions/services/registerPermissions.js +80 -0
  48. package/dist/{helper/registerPermissions.d.ts → features/permissions/states/PermissionClass.d.ts} +2 -12
  49. package/dist/features/permissions/states/PermissionClass.js +21 -0
  50. package/dist/features/permissions/types/PermissionTypes.d.ts +11 -0
  51. package/dist/features/permissions/types/PermissionTypes.js +2 -0
  52. package/dist/functions/opendash-geo-features.js +5 -5
  53. package/dist/functions/openinc-auth-signup.js +6 -5
  54. package/dist/functions/openinc-auth.common.js +3 -3
  55. package/dist/functions/openinc-config.js +2 -2
  56. package/dist/functions/openinc-geo-google.common.d.ts +1 -1
  57. package/dist/functions/openinc-geo-google.common.js +3 -4
  58. package/dist/functions/openinc-geo-graphhopper.common.d.ts +1 -1
  59. package/dist/functions/openinc-geo-graphhopper.common.js +4 -4
  60. package/dist/functions/openinc-openservice-save-ticket-data.js +45 -7
  61. package/dist/hooks/Alarm.js +3 -3
  62. package/dist/hooks/BDE_Result.js +2 -2
  63. package/dist/hooks/Core_Email.js +10 -10
  64. package/dist/hooks/MES_Order.js +8 -12
  65. package/dist/hooks/ML_DataSelection.d.ts +1 -0
  66. package/dist/hooks/ML_DataSelection.js +17 -0
  67. package/dist/hooks/Maintenance_Downtime.js +5 -5
  68. package/dist/hooks/Maintenance_Duedate.js +5 -5
  69. package/dist/hooks/Maintenance_Frequency.js +5 -5
  70. package/dist/hooks/Maintenance_Message.js +29 -29
  71. package/dist/hooks/Maintenance_Priority.js +5 -5
  72. package/dist/hooks/Maintenance_Restriction.js +5 -5
  73. package/dist/hooks/Maintenance_Schedule_Execution.js +3 -3
  74. package/dist/hooks/Maintenance_Ticket.js +1 -1
  75. package/dist/hooks/Maintenance_Ticket_FormConfig.d.ts +1 -0
  76. package/dist/hooks/Maintenance_Ticket_FormConfig.js +34 -0
  77. package/dist/hooks/Maintenance_Ticket_Issuecategory.js +5 -5
  78. package/dist/hooks/Maintenance_Ticket_Kanban_State.js +5 -5
  79. package/dist/hooks/Maintenance_Ticket_Material.js +5 -5
  80. package/dist/hooks/Maintenance_Ticket_Project.js +5 -5
  81. package/dist/hooks/Maintenance_Ticket_Source.js +5 -5
  82. package/dist/hooks/Maintenance_Ticket_Title.js +5 -5
  83. package/dist/hooks/Notification.js +4 -4
  84. package/dist/hooks/Notification_Setting.js +0 -38
  85. package/dist/hooks/OWPlcDevice.d.ts +1 -0
  86. package/dist/hooks/OWPlcDevice.js +17 -0
  87. package/dist/hooks/OWPlcItem.d.ts +1 -0
  88. package/dist/hooks/OWPlcItem.js +17 -0
  89. package/dist/hooks/_User.js +2 -2
  90. package/dist/hooks/_beforeLogin.js +3 -3
  91. package/dist/index.js +23 -56
  92. package/dist/jobs/open_service_notifyOnSchedule.js +4 -4
  93. package/dist/types/Maintenance_Project.d.ts +3 -0
  94. package/dist/types/Maintenance_Project.js +6 -0
  95. package/dist/types/Maintenance_Schedule_Step.d.ts +3 -17
  96. package/dist/types/Maintenance_Ticket_FormConfig.d.ts +19 -0
  97. package/dist/types/Maintenance_Ticket_FormConfig.js +26 -0
  98. package/dist/types/OWPlcDevice.d.ts +28 -0
  99. package/dist/types/OWPlcDevice.js +47 -0
  100. package/dist/types/OWPlcItem.d.ts +42 -0
  101. package/dist/types/OWPlcItem.js +71 -0
  102. package/dist/types/index.d.ts +6 -0
  103. package/dist/types/index.js +8 -1
  104. package/package.json +33 -11
  105. package/schema/Maintenance_Project.json +5 -0
  106. package/schema/Maintenance_Ticket_FormConfig.json +44 -0
  107. package/schema/OWPlcDevice.json +56 -0
  108. package/schema/OWPlcItem.json +75 -0
  109. package/dist/app_types/index.d.ts +0 -5
  110. package/dist/app_types/index.js +0 -9
  111. package/dist/config.d.ts +0 -2
  112. package/dist/helper/Config.d.ts +0 -33
  113. package/dist/helper/pdf2img.d.ts +0 -15
  114. package/dist/helper/pdf2img.js +0 -157
  115. package/dist/helper/registerNotification.d.ts +0 -25
  116. package/dist/helper/registerNotification.js +0 -61
  117. package/dist/helper/registerPermissions.js +0 -58
  118. package/dist/ow.d.ts +0 -21
  119. package/dist/{app_types → features/config/types}/ConfigKeys.d.ts +0 -0
  120. package/dist/{app_types → features/config/types}/ConfigKeys.js +0 -0
  121. package/dist/{app_types/CRON_Types.js → features/config/types/configTypes.js} +0 -0
  122. package/dist/{app_types/OpenWareTicketObject.js → features/cron/index.js} +0 -0
  123. package/dist/{app_types → features/cron/types}/CRON_Types.d.ts +0 -0
  124. package/dist/{helper/TicketData.js → features/cron/types/CRON_Types.js} +0 -0
  125. package/dist/{app_types → features/notifications/types}/Notifications.d.ts +0 -0
  126. package/dist/{app_types → features/notifications/types}/Notifications.js +2 -2
  127. /package/dist/{app_types → features/permissions/types}/Permissions.d.ts +0 -0
  128. /package/dist/{app_types → features/permissions/types}/Permissions.js +0 -0
@@ -1,58 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RegisteredPermission = void 0;
4
- exports.getAllPermissions = getAllPermissions;
5
- const app_types_1 = require("../app_types");
6
- /**
7
- * Returns all permissions from the OpenService plugin defined in types/config.ts as an array of Permission objects.
8
- * @returns all permissions from the OpenService plugin
9
- */
10
- function getAllPermissions() {
11
- const permissions = []; // stores all permissions
12
- for (const key in app_types_1.Permissions) {
13
- // iterate over the objects / enums of the Permissions namespace
14
- if (Object.prototype.hasOwnProperty.call(app_types_1.Permissions, key)) {
15
- const element = app_types_1.Permissions[key]; // get the object / enum
16
- const createdPermissions = createPermission(element); // create Permission objects recursively
17
- permissions.push(...createdPermissions);
18
- }
19
- }
20
- return permissions;
21
- }
22
- class RegisteredPermission {
23
- constructor(key, label, description) {
24
- this.key = key;
25
- this.label = label;
26
- this.description = description;
27
- }
28
- get(attribute) {
29
- return this[attribute];
30
- }
31
- set(attribute, value) {
32
- this[attribute] = value;
33
- return this;
34
- }
35
- }
36
- exports.RegisteredPermission = RegisteredPermission;
37
- /**
38
- * Recursively creates Permission objects from the input object.
39
- * @param input a string from an enum or an enum itself
40
- * @returns an array of Permission objects
41
- */
42
- function createPermission(input) {
43
- const permissions = []; // all permission objects created from the input
44
- if (typeof input === "string") {
45
- // if the input is a string, create a Permission object from it
46
- permissions.push(new RegisteredPermission(input, input + ".label", input + ".description"));
47
- }
48
- else {
49
- // if the input is an object, iterate over its keys and create Permission objects from the values
50
- for (const key in input) {
51
- if (Object.prototype.hasOwnProperty.call(input, key)) {
52
- const element = input[key];
53
- permissions.push(...createPermission(element));
54
- }
55
- }
56
- }
57
- return permissions;
58
- }
package/dist/ow.d.ts DELETED
@@ -1,21 +0,0 @@
1
- export interface DataItemInterface {
2
- id: string;
3
- name: string;
4
- source: string;
5
- reference?: string;
6
- meta: Record<string, any>;
7
- valueTypes: DataItemValueTypeInterface[];
8
- values: DataItemValueInterface[];
9
- }
10
- export type DataItemValueTypeTypeField = "Number" | "String" | "Boolean" | "Geo" | "Object";
11
- export interface DataItemValueTypeInterface {
12
- unit: string;
13
- name: string;
14
- type: DataItemValueTypeTypeField;
15
- }
16
- export interface DataItemValueInterface {
17
- date: number;
18
- value: any[];
19
- }
20
- export declare function getToken(usermail?: string): Promise<string | null>;
21
- export declare function publishDataItem(dataItem: DataItemInterface, usermail?: string, update?: boolean): Promise<void>;
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Notifications = void 0;
2
4
  /**
3
5
  * Notifications that should be registered in the database by default when the server starts.
4
6
  * The ACLs are set to od-admin only.
5
7
  * Adding new Notification here requires the server to restart for registering those.
6
8
  */
7
- Object.defineProperty(exports, "__esModule", { value: true });
8
- exports.Notifications = void 0;
9
9
  var Notifications;
10
10
  (function (Notifications) {
11
11
  // needs to be exported for getAllNotifications() to work