@sedni/cloud_common 3.0.0 → 3.0.1

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.
package/dist/index.js CHANGED
@@ -2,104 +2,194 @@ import {
2
2
  ActivationModes,
3
3
  AddedAlarmsJson,
4
4
  AlarmIndicatorJson,
5
+ AlarmIndicatorRequest,
6
+ AlarmIndicatorResponse,
5
7
  AlarmPriorities,
6
8
  AlarmStates,
7
9
  AlarmTypes,
10
+ AutoSemiAutoStates,
8
11
  AutomaticSemiAutoJson,
12
+ AutomaticSemiAutoRequest,
9
13
  BackgroundJson,
10
14
  BreakerJson,
11
15
  BreakerPmsJson,
16
+ BreakerPmsRequest,
17
+ BreakerPmsResponse,
18
+ BreakerRequest,
19
+ BreakerResponse,
12
20
  CabinetDesigns,
13
21
  CabinetJson,
22
+ CabinetRequest,
23
+ CabinetResponse,
24
+ ChannelBaseTypes,
14
25
  ChannelJson,
26
+ ChannelRequest,
27
+ ChannelSpecificTypes,
15
28
  CloudAlarmStates,
16
29
  CommandJson,
30
+ CommandRequest,
31
+ CommandResponse,
17
32
  CommandsOpClJson,
33
+ CommandsOpClRequest,
18
34
  CommandsStartStopJson,
35
+ CommandsStartStopRequest,
19
36
  CompressorDesigns,
20
37
  CompressorJson,
38
+ CompressorRequest,
39
+ CompressorResponse,
21
40
  ControlLockJson,
41
+ ControlLockRequest,
22
42
  DamperAutomatedJson,
43
+ DamperAutomatedRequest,
44
+ DamperAutomatedResponse,
23
45
  DamperJson,
46
+ DamperRequest,
47
+ DamperResponse,
24
48
  DialJson,
49
+ DialRequest,
50
+ DialResponse,
25
51
  DiamarAlarmStates,
26
52
  DigitalAlarmStates,
27
53
  DigitalJson,
54
+ DigitalRequest,
55
+ DigitalResponse,
28
56
  DigitalStates,
29
57
  DisplayJson,
58
+ DisplayRequest,
59
+ DisplayResponse,
30
60
  DynamicTextJson,
61
+ DynamicTextRequest,
62
+ DynamicTextResponse,
31
63
  EventCategories,
32
64
  EventCriticalities,
33
65
  FanDesigns,
34
66
  FanDirections,
35
67
  FanJson,
68
+ FanRequest,
69
+ FanResponse,
36
70
  FanRunStates,
37
71
  FanTypes,
38
72
  FeedbackOpClJson,
73
+ FeedbackOpClRequest,
39
74
  FeedbackRunningStoppedJson,
75
+ FeedbackRunningStoppedRequest,
40
76
  GeneratorJson,
41
77
  GeneratorPmsJson,
78
+ GeneratorPmsRequest,
79
+ GeneratorPmsResponse,
80
+ GeneratorRequest,
81
+ GeneratorResponse,
42
82
  ImageAuxiliaryJson,
83
+ ImageAuxiliaryRequest,
84
+ ImageAuxiliaryResponse,
43
85
  InfoLocations,
44
86
  LedTypes,
45
87
  LevelBarJson,
46
88
  LevelBarOrientations,
89
+ LevelBarRequest,
90
+ LevelBarResponse,
47
91
  LineAuxiliaryJson,
92
+ LineAuxiliaryRequest,
93
+ LineAuxiliaryResponse,
48
94
  LineJson,
49
95
  LinkAuxiliaryJson,
96
+ LinkAuxiliaryRequest,
97
+ LinkAuxiliaryResponse,
50
98
  LinkDesigns,
51
99
  LocalizedTextJson,
52
100
  LocationJson,
53
101
  LogicExpressionJson,
54
102
  LogicExpressionsJson,
55
103
  MarkTypes,
104
+ MimicAlarmStates,
105
+ MimicControlStates,
56
106
  MimicElementTypes,
57
107
  OpClStates,
58
108
  OperationModeStates,
59
109
  OperationModesJson,
110
+ OperationModesRequest,
111
+ OperationModesResponse,
60
112
  OrderOpClJson,
113
+ OrderOpClRequest,
61
114
  OrderStartStopJson,
115
+ OrderStartStopRequest,
62
116
  PolylineAuxiliaryJson,
117
+ PolylineAuxiliaryRequest,
118
+ PolylineAuxiliaryResponse,
63
119
  PrioritiesJson,
120
+ PrioritiesRequest,
121
+ PrioritiesResponse,
64
122
  PriorityDataJson,
123
+ PriorityDataRequest,
65
124
  PumpAutomatedJson,
125
+ PumpAutomatedRequest,
126
+ PumpAutomatedResponse,
66
127
  PumpJson,
128
+ PumpRequest,
129
+ PumpResponse,
67
130
  RemoteLocalJson,
131
+ RemoteLocalRequest,
132
+ RemoteLocalStates,
68
133
  RepeaterDesigns,
69
134
  RepeaterJson,
135
+ RepeaterRequest,
136
+ RepeaterResponse,
70
137
  RunningStoppedStates,
71
138
  ScaleJson,
72
139
  ScalePositions,
73
140
  ShaftJson,
141
+ ShaftRequest,
142
+ ShaftResponse,
74
143
  SliderJson,
75
144
  SliderOrientations,
145
+ SliderRequest,
146
+ SliderResponse,
76
147
  SquareAuxiliaryJson,
148
+ SquareAuxiliaryRequest,
149
+ SquareAuxiliaryResponse,
77
150
  StationDesigns,
78
151
  StationJson,
152
+ StationRequest,
153
+ StationResponse,
79
154
  TankJson,
155
+ TankRequest,
156
+ TankResponse,
80
157
  TextAnchorPoints,
81
158
  TextAttributesJson,
82
159
  TextAuxiliaryJson,
160
+ TextAuxiliaryRequest,
161
+ TextAuxiliaryResponse,
83
162
  TextChannelJson,
163
+ TextChannelRequest,
164
+ TextChannelResponse,
84
165
  TitleAligns,
85
166
  TitleJson,
86
167
  ToggleJson,
168
+ ToggleRequest,
169
+ ToggleResponse,
87
170
  TripResetJson,
171
+ TripResetRequest,
88
172
  UnitDesigns,
89
173
  UnitJson,
174
+ UnitRequest,
175
+ UnitResponse,
90
176
  UnitTypes,
91
177
  ValueTypes,
92
178
  ValveAutomatedJson,
179
+ ValveAutomatedRequest,
180
+ ValveAutomatedResponse,
93
181
  ValveDesigns,
94
182
  ValveJson,
183
+ ValveRequest,
184
+ ValveResponse,
95
185
  ZDepths
96
- } from "./chunk-FO3TASV6.js";
186
+ } from "./chunk-K5VO2MYI.js";
97
187
 
98
188
  // app/models/Channel.ts
99
189
  import mongoose from "mongoose";
190
+ import mongooseAggregatePaginate from "mongoose-aggregate-paginate-v2";
100
191
  import mongooseAutopopulate from "mongoose-autopopulate";
101
192
  import mongoosePaginate from "mongoose-paginate-v2";
102
- import mongooseAggregatePaginate from "mongoose-aggregate-paginate-v2";
103
193
  var channelSchema = new mongoose.Schema({
104
194
  channel_tag: {
105
195
  type: String,
@@ -130,7 +220,7 @@ var channelSchema = new mongoose.Schema({
130
220
  },
131
221
  collection: "channels",
132
222
  toJSON: {
133
- transform: function(doc, ret) {
223
+ transform: function(_doc, ret) {
134
224
  ret.id = ret._id;
135
225
  ret.channel_unit = ret.channel_unit_id;
136
226
  ret.channel_unit_id = ret.channel_unit_id.unit_id;
@@ -139,8 +229,8 @@ var channelSchema = new mongoose.Schema({
139
229
  }
140
230
  }
141
231
  });
142
- channelSchema.index({ "channel_tag": 1 }, { unique: true });
143
- channelSchema.index({ "channel_description": 1 });
232
+ channelSchema.index({ channel_tag: 1 }, { unique: true });
233
+ channelSchema.index({ channel_description: 1 });
144
234
  channelSchema.plugin(mongoosePaginate);
145
235
  channelSchema.plugin(mongooseAggregatePaginate);
146
236
  channelSchema.plugin(mongooseAutopopulate);
@@ -214,7 +304,7 @@ var channeldataBucketSchema = new mongoose2.Schema({
214
304
  versionKey: false
215
305
  });
216
306
  channeldataBucketSchema.index({ start_date: 1, end_date: 1 }, { background: true });
217
- channeldataBucketSchema.index({ start_date: 1, end_date: 1, "data.channel_id": 1 }, { background: true });
307
+ channeldataBucketSchema.index({ "start_date": 1, "end_date": 1, "data.channel_id": 1 }, { background: true });
218
308
  channeldataBucketSchema.index({ start_date: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 365, background: true });
219
309
  channeldataBucketSchema.plugin(mongoosePaginate2);
220
310
  channeldataBucketSchema.plugin(mongooseAggregatePaginate2);
@@ -325,8 +415,8 @@ var eventSchema = new mongoose4.Schema({
325
415
  }
326
416
  }
327
417
  });
328
- eventSchema.index({ "event_type": 1 });
329
- eventSchema.index({ "event_category": 1 });
418
+ eventSchema.index({ event_type: 1 });
419
+ eventSchema.index({ event_category: 1 });
330
420
  var oneYear2 = 60 * 60 * 24 * 365;
331
421
  eventSchema.addTTLIndex = function(expirationTimeInSeconds = oneYear2, ttlField = "event_timestamp") {
332
422
  this.index({ [ttlField]: 1 }, { expireAfterSeconds: expirationTimeInSeconds });
@@ -404,7 +494,7 @@ var historySchema = new mongoose5.Schema({
404
494
  }
405
495
  }
406
496
  });
407
- historySchema.index({ "channel_tag": 1 });
497
+ historySchema.index({ channel_tag: 1 });
408
498
  var oneYear3 = 60 * 60 * 24 * 365;
409
499
  historySchema.addTTLIndex = function(expirationTimeInSeconds = oneYear3, ttlField = "alarm_timestamp") {
410
500
  this.index({ [ttlField]: 1 }, { expireAfterSeconds: expirationTimeInSeconds });
@@ -450,8 +540,8 @@ var unitSchema = new mongoose6.Schema({
450
540
  }
451
541
  }
452
542
  });
453
- unitSchema.index({ "unit_id": 1 }, { unique: true });
454
- unitSchema.index({ "unit_internal_description": 1 });
543
+ unitSchema.index({ unit_id: 1 }, { unique: true });
544
+ unitSchema.index({ unit_internal_description: 1 });
455
545
  unitSchema.plugin(mongoosePaginate6);
456
546
  unitSchema.plugin(mongooseAggregatePaginate6);
457
547
  var Unit_default = unitSchema;
@@ -969,9 +1059,9 @@ var docs_default = Docs;
969
1059
 
970
1060
  // app/index.ts
971
1061
  import mongoose7 from "mongoose";
1062
+ import mongooseAggregatePaginate7 from "mongoose-aggregate-paginate-v2";
972
1063
  import mongooseAutopopulate2 from "mongoose-autopopulate";
973
1064
  import mongoosePaginate7 from "mongoose-paginate-v2";
974
- import mongooseAggregatePaginate7 from "mongoose-aggregate-paginate-v2";
975
1065
  var Schemas = {
976
1066
  Channel: Channel_default,
977
1067
  ChannelDataBucket: ChannelDataBucket_default,
@@ -1048,6 +1138,106 @@ var Mimics = {
1048
1138
  PrioritiesJson,
1049
1139
  ShaftJson
1050
1140
  };
1141
+ var MimicsRequest = {
1142
+ // Auxiliary
1143
+ ImageAuxiliaryRequest,
1144
+ LineAuxiliaryRequest,
1145
+ LinkAuxiliaryRequest,
1146
+ PolylineAuxiliaryRequest,
1147
+ SquareAuxiliaryRequest,
1148
+ TextAuxiliaryRequest,
1149
+ // Channel
1150
+ ChannelRequest,
1151
+ // Control elements
1152
+ CompressorRequest,
1153
+ DamperRequest,
1154
+ DamperAutomatedRequest,
1155
+ FanRequest,
1156
+ PumpRequest,
1157
+ PumpAutomatedRequest,
1158
+ TankRequest,
1159
+ ValveRequest,
1160
+ ValveAutomatedRequest,
1161
+ // Elements
1162
+ AlarmIndicatorRequest,
1163
+ CommandRequest,
1164
+ DialRequest,
1165
+ DigitalRequest,
1166
+ DisplayRequest,
1167
+ DynamicTextRequest,
1168
+ LevelBarRequest,
1169
+ SliderRequest,
1170
+ TextChannelRequest,
1171
+ ToggleRequest,
1172
+ // IAS elements
1173
+ CabinetRequest,
1174
+ RepeaterRequest,
1175
+ StationRequest,
1176
+ UnitRequest,
1177
+ // Traits
1178
+ AutomaticSemiAutoRequest,
1179
+ CommandsOpClRequest,
1180
+ CommandsStartStopRequest,
1181
+ ControlLockRequest,
1182
+ FeedbackOpClRequest,
1183
+ FeedbackRunningStoppedRequest,
1184
+ OrderOpClRequest,
1185
+ OrderStartStopRequest,
1186
+ RemoteLocalRequest,
1187
+ TripResetRequest,
1188
+ // PMS elements
1189
+ BreakerRequest,
1190
+ BreakerPmsRequest,
1191
+ GeneratorRequest,
1192
+ GeneratorPmsRequest,
1193
+ OperationModesRequest,
1194
+ PriorityDataRequest,
1195
+ PrioritiesRequest,
1196
+ ShaftRequest
1197
+ };
1198
+ var MimicsResponse = {
1199
+ // Auxiliary
1200
+ ImageAuxiliaryResponse,
1201
+ LineAuxiliaryResponse,
1202
+ LinkAuxiliaryResponse,
1203
+ PolylineAuxiliaryResponse,
1204
+ SquareAuxiliaryResponse,
1205
+ TextAuxiliaryResponse,
1206
+ // Control elements
1207
+ CompressorResponse,
1208
+ DamperResponse,
1209
+ DamperAutomatedResponse,
1210
+ FanResponse,
1211
+ PumpResponse,
1212
+ PumpAutomatedResponse,
1213
+ TankResponse,
1214
+ ValveResponse,
1215
+ ValveAutomatedResponse,
1216
+ // Elements
1217
+ AlarmIndicatorResponse,
1218
+ CommandResponse,
1219
+ DialResponse,
1220
+ DigitalResponse,
1221
+ DisplayResponse,
1222
+ DynamicTextResponse,
1223
+ LevelBarResponse,
1224
+ SliderResponse,
1225
+ TextChannelResponse,
1226
+ ToggleResponse,
1227
+ // IAS elements
1228
+ CabinetResponse,
1229
+ RepeaterResponse,
1230
+ StationResponse,
1231
+ UnitResponse,
1232
+ // PMS elements
1233
+ BreakerResponse,
1234
+ BreakerPmsResponse,
1235
+ GeneratorResponse,
1236
+ GeneratorPmsResponse,
1237
+ OperationModesResponse,
1238
+ PrioritiesResponse,
1239
+ ShaftResponse
1240
+ };
1051
1241
  var MimicsTypes = {
1052
1242
  MimicElementTypes,
1053
1243
  ZDepths,
@@ -1055,6 +1245,8 @@ var MimicsTypes = {
1055
1245
  DigitalStates,
1056
1246
  DigitalAlarmStates,
1057
1247
  AlarmStates,
1248
+ MimicAlarmStates,
1249
+ MimicControlStates,
1058
1250
  ActivationModes,
1059
1251
  TextAnchorPoints,
1060
1252
  ValveDesigns,
@@ -1077,26 +1269,34 @@ var MimicsTypes = {
1077
1269
  CabinetDesigns,
1078
1270
  LinkDesigns,
1079
1271
  OpClStates,
1080
- RunningStoppedStates
1272
+ RunningStoppedStates,
1273
+ AutoSemiAutoStates,
1274
+ RemoteLocalStates
1081
1275
  };
1082
1276
  var Types = {
1083
1277
  AlarmTypes,
1084
1278
  AlarmPriorities,
1085
1279
  CloudAlarmStates,
1086
1280
  DiamarAlarmStates,
1281
+ ChannelBaseTypes,
1282
+ ChannelSpecificTypes,
1087
1283
  EventCategories,
1284
+ EventCriticalities,
1285
+ UnitTypes,
1088
1286
  Mimics: MimicsTypes
1089
1287
  };
1090
1288
  var index_default = {
1091
- Schemas,
1092
- Docs: docs_default,
1093
- Mimics,
1094
- Types,
1095
1289
  mongoose: mongoose7,
1096
1290
  mongoosePaginate: mongoosePaginate7,
1097
1291
  mongooseAggregatePaginate: mongooseAggregatePaginate7,
1098
1292
  mongooseAutopopulate: mongooseAutopopulate2
1099
1293
  };
1100
1294
  export {
1295
+ docs_default as Docs,
1296
+ Mimics,
1297
+ MimicsRequest,
1298
+ MimicsResponse,
1299
+ Schemas,
1300
+ Types,
1101
1301
  index_default as default
1102
1302
  };