@sedni/cloud_common 1.0.2 → 1.0.4

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.
@@ -29,7 +29,7 @@
29
29
  "format": "text",
30
30
  "description": "Event category",
31
31
  "example": "Login",
32
- "enum": ["Login", "Backup", "Config", "Control"]
32
+ "enum": "%%EVENT_CATEGORY_ENUM%%"
33
33
  },
34
34
  "event_type": {
35
35
  "type": "string",
@@ -0,0 +1,32 @@
1
+ const { AlarmTypes, AlarmPriorities, CloudAlarmStates, DiamarAlarmStates } = require("../../types/alarm.types");
2
+ const { EventCategories } = require("../../types/event.types");
3
+
4
+ /**
5
+ * DOCS
6
+ */
7
+ const ChannelDocs = require("./Channel.json");
8
+ const ChannelDataBucketDocs = require("./ChannelDataBucket.json");
9
+ const ChannelWithDataDocs = require("./ChannelWithData.json");
10
+ const DataPointDocs = require("./DataPoint.json");
11
+ const EventDocs = require("./Event.json");
12
+ const HistoryDocs = require("./History.json");
13
+ const UnitDocs = require("./Unit.json");
14
+
15
+ HistoryDocs.components.schemas.History.properties.alarm_priority.enum = Object.values(AlarmPriorities);
16
+ HistoryDocs.components.schemas.History.properties.alarm_state.enum = Object.values(CloudAlarmStates);
17
+ HistoryDocs.components.schemas.History.properties.alarm_original_state.enum = Object.values(DiamarAlarmStates);
18
+ HistoryDocs.components.schemas.History.properties.alarm_type.enum = Object.values(AlarmTypes);
19
+
20
+ EventDocs.components.schemas.Event.properties.event_category.enum = Object.values(EventCategories);
21
+
22
+ const Docs = {
23
+ ChannelDocs,
24
+ ChannelDataBucketDocs,
25
+ ChannelWithDataDocs,
26
+ DataPointDocs,
27
+ EventDocs,
28
+ HistoryDocs,
29
+ UnitDocs,
30
+ };
31
+
32
+ module.exports = Docs;
package/index.js CHANGED
@@ -18,19 +18,7 @@ const Schemas = {
18
18
  /**
19
19
  * DOCS
20
20
  */
21
- const ChannelDocs = require("./app/models/docs/Channel.json");
22
- const ChannelDataBucketDocs = require("./app/models/docs/ChannelDataBucket.json");
23
- const EventDocs = require("./app/models/docs/Event.json");
24
- const HistoryDocs = require("./app/models/docs/History.json");
25
- const UnitDocs = require("./app/models/docs/Unit.json");
26
-
27
- const Docs = {
28
- ChannelDocs,
29
- ChannelDataBucketDocs,
30
- EventDocs,
31
- HistoryDocs,
32
- UnitDocs,
33
- };
21
+ const Docs = require("./app/models/docs");
34
22
 
35
23
  /**
36
24
  * TYPES
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sedni/cloud_common",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "Common package for all types, resources and tools of Diamar Cloud",
5
5
  "main": "index.js",
6
6
  "scripts": {