@sedni/cloud_common 1.1.0 → 2.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.
- package/dist/chunk-NCUZ3O3P.js +152 -0
- package/dist/index.cjs +137 -0
- package/dist/index.d.cts +87 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.js +63 -0
- package/dist/node-entry.cjs +1191 -0
- package/{index.js → dist/node-entry.d.cts} +8 -8
- package/dist/node-entry.d.ts +53 -0
- package/dist/node-entry.js +1078 -0
- package/package.json +16 -3
- package/tsconfig.json +20 -0
- package/tsconfig.node.json +12 -0
- package/app/models/Channel.js +0 -73
- package/app/models/ChannelDataBucket.js +0 -321
- package/app/models/Event.js +0 -90
- package/app/models/History.js +0 -106
- package/app/models/Unit.js +0 -68
- package/app/models/docs/Channel.json +0 -58
- package/app/models/docs/ChannelDataBucket.json +0 -101
- package/app/models/docs/ChannelWithData.json +0 -58
- package/app/models/docs/DataPoint.json +0 -32
- package/app/models/docs/Event.json +0 -78
- package/app/models/docs/History.json +0 -103
- package/app/models/docs/Unit.json +0 -67
- package/app/models/docs/index.js +0 -32
- package/app/types/alarm.types.js +0 -53
- package/app/types/channel.types.js +0 -43
- package/app/types/event.types.js +0 -15
- package/app/types/unit.types.js +0 -15
|
@@ -0,0 +1,1078 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
__require,
|
|
4
|
+
__toCommonJS,
|
|
5
|
+
alarm_types_exports,
|
|
6
|
+
event_types_exports,
|
|
7
|
+
init_alarm_types,
|
|
8
|
+
init_event_types,
|
|
9
|
+
init_unit_types,
|
|
10
|
+
unit_types_exports
|
|
11
|
+
} from "./chunk-NCUZ3O3P.js";
|
|
12
|
+
|
|
13
|
+
// app/models/Channel.cjs
|
|
14
|
+
var require_Channel = __commonJS({
|
|
15
|
+
"app/models/Channel.cjs"(exports, module) {
|
|
16
|
+
"use strict";
|
|
17
|
+
var mongoose = __require("mongoose");
|
|
18
|
+
var mongooseAutopopulate = __require("mongoose-autopopulate");
|
|
19
|
+
var mongoosePaginate = __require("mongoose-paginate-v2");
|
|
20
|
+
var mongooseAggregatePaginate = __require("mongoose-aggregate-paginate-v2");
|
|
21
|
+
var channelSchema = new mongoose.Schema({
|
|
22
|
+
channel_tag: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
channel_description: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: true
|
|
29
|
+
},
|
|
30
|
+
channel_unit_id: {
|
|
31
|
+
type: mongoose.Schema.Types.ObjectId,
|
|
32
|
+
ref: "Unit",
|
|
33
|
+
required: true,
|
|
34
|
+
autopopulate: true
|
|
35
|
+
},
|
|
36
|
+
channel_parsed: {
|
|
37
|
+
type: Object,
|
|
38
|
+
required: true
|
|
39
|
+
},
|
|
40
|
+
channel_last_bucket_sync: {
|
|
41
|
+
type: Date,
|
|
42
|
+
required: false
|
|
43
|
+
}
|
|
44
|
+
}, {
|
|
45
|
+
timestamps: {
|
|
46
|
+
createdAt: true,
|
|
47
|
+
updatedAt: true
|
|
48
|
+
},
|
|
49
|
+
collection: "channels",
|
|
50
|
+
toJSON: {
|
|
51
|
+
transform: function(doc, ret) {
|
|
52
|
+
ret.id = ret._id;
|
|
53
|
+
ret.channel_unit = ret.channel_unit_id;
|
|
54
|
+
ret.channel_unit_id = ret.channel_unit_id.unit_id;
|
|
55
|
+
delete ret._id;
|
|
56
|
+
delete ret.__v;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
channelSchema.index({ "channel_tag": 1 }, { unique: true });
|
|
61
|
+
channelSchema.index({ "channel_description": 1 });
|
|
62
|
+
channelSchema.plugin(mongoosePaginate);
|
|
63
|
+
channelSchema.plugin(mongooseAggregatePaginate);
|
|
64
|
+
channelSchema.plugin(mongooseAutopopulate);
|
|
65
|
+
module.exports = channelSchema;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// app/models/ChannelDataBucket.cjs
|
|
70
|
+
var require_ChannelDataBucket = __commonJS({
|
|
71
|
+
"app/models/ChannelDataBucket.cjs"(exports, module) {
|
|
72
|
+
"use strict";
|
|
73
|
+
var mongoose = __require("mongoose");
|
|
74
|
+
var mongooseAutopopulate = __require("mongoose-autopopulate");
|
|
75
|
+
var mongoosePaginate = __require("mongoose-paginate-v2");
|
|
76
|
+
var mongooseAggregatePaginate = __require("mongoose-aggregate-paginate-v2");
|
|
77
|
+
var dataPointSchema = new mongoose.Schema({
|
|
78
|
+
timestamp: {
|
|
79
|
+
type: Number,
|
|
80
|
+
required: true
|
|
81
|
+
},
|
|
82
|
+
value: {
|
|
83
|
+
type: Number,
|
|
84
|
+
required: true
|
|
85
|
+
}
|
|
86
|
+
}, {
|
|
87
|
+
_id: false
|
|
88
|
+
});
|
|
89
|
+
var channeldataBucketSchema = new mongoose.Schema({
|
|
90
|
+
start_date: {
|
|
91
|
+
type: Date,
|
|
92
|
+
required: true,
|
|
93
|
+
default: Date.now
|
|
94
|
+
},
|
|
95
|
+
end_date: {
|
|
96
|
+
type: Date,
|
|
97
|
+
required: true,
|
|
98
|
+
default: function() {
|
|
99
|
+
return new Date(Date.now() + 1e3 * 60 * 60);
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
data: {
|
|
103
|
+
type: [dataPointSchema],
|
|
104
|
+
required: true,
|
|
105
|
+
default: []
|
|
106
|
+
},
|
|
107
|
+
size: {
|
|
108
|
+
type: Number,
|
|
109
|
+
required: true,
|
|
110
|
+
default: 0
|
|
111
|
+
},
|
|
112
|
+
synced: {
|
|
113
|
+
type: Number,
|
|
114
|
+
required: true,
|
|
115
|
+
default: 0
|
|
116
|
+
},
|
|
117
|
+
sum: {
|
|
118
|
+
type: Number,
|
|
119
|
+
required: true,
|
|
120
|
+
default: 0
|
|
121
|
+
}
|
|
122
|
+
}, {
|
|
123
|
+
toJSON: {
|
|
124
|
+
transform: function(doc, ret) {
|
|
125
|
+
ret.id = ret._id;
|
|
126
|
+
delete ret._id;
|
|
127
|
+
delete ret.__v;
|
|
128
|
+
ret.start_date = ret.start_date.getTime();
|
|
129
|
+
ret.end_date = ret.end_date.getTime();
|
|
130
|
+
ret.avg = ret.sum / ret.size;
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
versionKey: false
|
|
134
|
+
});
|
|
135
|
+
channeldataBucketSchema.index({ start_date: 1, end_date: 1 }, { background: true });
|
|
136
|
+
channeldataBucketSchema.index({ start_date: 1 }, { expireAfterSeconds: 60 * 60 * 24 * 365, background: true });
|
|
137
|
+
channeldataBucketSchema.plugin(mongoosePaginate);
|
|
138
|
+
channeldataBucketSchema.plugin(mongooseAggregatePaginate);
|
|
139
|
+
channeldataBucketSchema.plugin(mongooseAutopopulate);
|
|
140
|
+
channeldataBucketSchema.methods.insertDataPoint = async function(timestamp, value) {
|
|
141
|
+
this.data.push({ timestamp, value });
|
|
142
|
+
this.size++;
|
|
143
|
+
this.sum += value;
|
|
144
|
+
await this.save();
|
|
145
|
+
};
|
|
146
|
+
channeldataBucketSchema.methods.removeDataPointsOutsideDateRange = function(start_date, end_date) {
|
|
147
|
+
start_date = start_date instanceof Date ? start_date.getTime() : start_date;
|
|
148
|
+
end_date = end_date instanceof Date ? end_date.getTime() : end_date;
|
|
149
|
+
this.data = this.data.filter((data_point) => data_point.timestamp >= start_date && data_point.timestamp < end_date);
|
|
150
|
+
this.size = this.data.length;
|
|
151
|
+
this.sum = this.data.reduce((sum, data_point) => sum + data_point.value, 0);
|
|
152
|
+
};
|
|
153
|
+
channeldataBucketSchema.methods.isBucketClosed = function(timestamp = Date.now()) {
|
|
154
|
+
return timestamp >= this.end_date.getTime();
|
|
155
|
+
};
|
|
156
|
+
channeldataBucketSchema.statics.insertDataPoint = async function(timestamp, value) {
|
|
157
|
+
const date = new Date(timestamp);
|
|
158
|
+
date.setMinutes(0);
|
|
159
|
+
date.setSeconds(0);
|
|
160
|
+
date.setMilliseconds(0);
|
|
161
|
+
const bucket = await this.findOneAndUpdate(
|
|
162
|
+
{
|
|
163
|
+
start_date: date
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
$push: {
|
|
167
|
+
data: {
|
|
168
|
+
timestamp,
|
|
169
|
+
value
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
$inc: {
|
|
173
|
+
size: 1,
|
|
174
|
+
sum: value
|
|
175
|
+
},
|
|
176
|
+
$set: {
|
|
177
|
+
end_date: new Date(date.getTime() + 1e3 * 60 * 60)
|
|
178
|
+
}
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
upsert: true,
|
|
182
|
+
new: true
|
|
183
|
+
}
|
|
184
|
+
);
|
|
185
|
+
return bucket;
|
|
186
|
+
};
|
|
187
|
+
channeldataBucketSchema.statics.lastTimeSynced = async function(options) {
|
|
188
|
+
let last_sync = 0;
|
|
189
|
+
if (options?.channel_tag && options?.db) {
|
|
190
|
+
const channel = await options.db.collection("channels").findOne({
|
|
191
|
+
channel_tag: options.channel_tag
|
|
192
|
+
});
|
|
193
|
+
last_sync = channel.channel_last_bucket_sync.getTime();
|
|
194
|
+
}
|
|
195
|
+
return last_sync;
|
|
196
|
+
};
|
|
197
|
+
channeldataBucketSchema.statics.getNotUploadedData = async function(options) {
|
|
198
|
+
const last_sync = options?.last_sync ?? await this.lastTimeSynced(options);
|
|
199
|
+
const buckets = await this.find({
|
|
200
|
+
end_date: {
|
|
201
|
+
$gt: new Date(last_sync)
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
return buckets;
|
|
205
|
+
};
|
|
206
|
+
channeldataBucketSchema.statics.getData = async function(start_date, end_date, plain = false) {
|
|
207
|
+
const date = new Date(start_date);
|
|
208
|
+
date.setMinutes(0);
|
|
209
|
+
date.setSeconds(0);
|
|
210
|
+
date.setMilliseconds(0);
|
|
211
|
+
const data = await this.find({
|
|
212
|
+
start_date: {
|
|
213
|
+
$gte: date,
|
|
214
|
+
$lt: new Date(end_date)
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
if (!data || data.length === 0) {
|
|
218
|
+
return [];
|
|
219
|
+
}
|
|
220
|
+
data[0].removeDataPointsOutsideDateRange(start_date, end_date);
|
|
221
|
+
if (data.length > 1) {
|
|
222
|
+
data[1].removeDataPointsOutsideDateRange(start_date, end_date);
|
|
223
|
+
}
|
|
224
|
+
return plain ? data.flatMap((bucket) => {
|
|
225
|
+
return bucket.data.map((data_point) => {
|
|
226
|
+
return {
|
|
227
|
+
timestamp: data_point.timestamp,
|
|
228
|
+
value: data_point.value
|
|
229
|
+
};
|
|
230
|
+
});
|
|
231
|
+
}) : data;
|
|
232
|
+
};
|
|
233
|
+
channeldataBucketSchema.statics.upsertBucket = async function(bucket) {
|
|
234
|
+
const date = new Date(bucket.start_date);
|
|
235
|
+
date.setMinutes(0);
|
|
236
|
+
date.setSeconds(0);
|
|
237
|
+
date.setMilliseconds(0);
|
|
238
|
+
const result = await this.updateOne(
|
|
239
|
+
{
|
|
240
|
+
start_date: date
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
$set: {
|
|
244
|
+
data: bucket.data,
|
|
245
|
+
size: bucket.size,
|
|
246
|
+
sum: bucket.sum,
|
|
247
|
+
end_date: new Date(date.getTime() + 1e3 * 60 * 60)
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
upsert: true
|
|
252
|
+
}
|
|
253
|
+
);
|
|
254
|
+
return result;
|
|
255
|
+
};
|
|
256
|
+
module.exports = channeldataBucketSchema;
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
|
|
260
|
+
// app/models/Event.cjs
|
|
261
|
+
var require_Event = __commonJS({
|
|
262
|
+
"app/models/Event.cjs"(exports, module) {
|
|
263
|
+
"use strict";
|
|
264
|
+
var mongoose = __require("mongoose");
|
|
265
|
+
var mongooseAutopopulate = __require("mongoose-autopopulate");
|
|
266
|
+
var mongoosePaginate = __require("mongoose-paginate-v2");
|
|
267
|
+
var mongooseAggregatePaginate = __require("mongoose-aggregate-paginate-v2");
|
|
268
|
+
var { EventCategories, EventCriticalities } = (init_event_types(), __toCommonJS(event_types_exports));
|
|
269
|
+
var eventSchema = new mongoose.Schema({
|
|
270
|
+
event_message: {
|
|
271
|
+
type: String,
|
|
272
|
+
required: true
|
|
273
|
+
},
|
|
274
|
+
event_source: {
|
|
275
|
+
type: String,
|
|
276
|
+
required: true
|
|
277
|
+
},
|
|
278
|
+
event_user: {
|
|
279
|
+
type: String,
|
|
280
|
+
required: false
|
|
281
|
+
},
|
|
282
|
+
event_category: {
|
|
283
|
+
type: String,
|
|
284
|
+
required: true,
|
|
285
|
+
enum: Object.values(EventCategories)
|
|
286
|
+
},
|
|
287
|
+
event_criticality: {
|
|
288
|
+
type: String,
|
|
289
|
+
required: true,
|
|
290
|
+
enum: Object.values(EventCriticalities)
|
|
291
|
+
},
|
|
292
|
+
event_type: {
|
|
293
|
+
type: String,
|
|
294
|
+
required: true
|
|
295
|
+
},
|
|
296
|
+
event_timestamp: {
|
|
297
|
+
type: Date,
|
|
298
|
+
default: Date.now
|
|
299
|
+
},
|
|
300
|
+
event_data: {
|
|
301
|
+
type: Object
|
|
302
|
+
}
|
|
303
|
+
}, {
|
|
304
|
+
timestamps: {
|
|
305
|
+
createdAt: true,
|
|
306
|
+
updatedAt: false
|
|
307
|
+
},
|
|
308
|
+
versionKey: false,
|
|
309
|
+
toJSON: {
|
|
310
|
+
transform: function(doc, ret) {
|
|
311
|
+
ret.id = ret._id;
|
|
312
|
+
delete ret._id;
|
|
313
|
+
delete ret.createdAt;
|
|
314
|
+
ret.event_timestamp = ret.event_timestamp.getTime();
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
});
|
|
318
|
+
eventSchema.index({ "event_type": 1 });
|
|
319
|
+
eventSchema.index({ "event_category": 1 });
|
|
320
|
+
var oneYear = 60 * 60 * 24 * 365;
|
|
321
|
+
eventSchema.addTTLIndex = function(ttlField, expirationTimeInSeconds = oneYear) {
|
|
322
|
+
this.index({ [ttlField]: 1 }, { expireAfterSeconds: expirationTimeInSeconds });
|
|
323
|
+
};
|
|
324
|
+
eventSchema.plugin(mongoosePaginate);
|
|
325
|
+
eventSchema.plugin(mongooseAggregatePaginate);
|
|
326
|
+
eventSchema.plugin(mongooseAutopopulate);
|
|
327
|
+
module.exports = eventSchema;
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
// app/models/History.cjs
|
|
332
|
+
var require_History = __commonJS({
|
|
333
|
+
"app/models/History.cjs"(exports, module) {
|
|
334
|
+
"use strict";
|
|
335
|
+
var mongoose = __require("mongoose");
|
|
336
|
+
var mongooseAutopopulate = __require("mongoose-autopopulate");
|
|
337
|
+
var mongoosePaginate = __require("mongoose-paginate-v2");
|
|
338
|
+
var mongooseAggregatePaginate = __require("mongoose-aggregate-paginate-v2");
|
|
339
|
+
var { AlarmTypes, AlarmPriorities, CloudAlarmStates, DiamarAlarmStates } = (init_alarm_types(), __toCommonJS(alarm_types_exports));
|
|
340
|
+
var historySchema = new mongoose.Schema({
|
|
341
|
+
channel_tag: {
|
|
342
|
+
type: String,
|
|
343
|
+
required: true
|
|
344
|
+
},
|
|
345
|
+
alarm_timestamp: {
|
|
346
|
+
type: Date,
|
|
347
|
+
required: true,
|
|
348
|
+
default: Date.now
|
|
349
|
+
},
|
|
350
|
+
alarm_priority: {
|
|
351
|
+
type: String,
|
|
352
|
+
required: true,
|
|
353
|
+
enum: Object.values(AlarmPriorities)
|
|
354
|
+
},
|
|
355
|
+
alarm_original_state: {
|
|
356
|
+
type: String,
|
|
357
|
+
required: true,
|
|
358
|
+
enum: Object.values(DiamarAlarmStates)
|
|
359
|
+
},
|
|
360
|
+
alarm_state: {
|
|
361
|
+
type: String,
|
|
362
|
+
required: true,
|
|
363
|
+
enum: Object.values(CloudAlarmStates)
|
|
364
|
+
},
|
|
365
|
+
alarm_type: {
|
|
366
|
+
type: String,
|
|
367
|
+
required: true,
|
|
368
|
+
enum: Object.values(AlarmTypes)
|
|
369
|
+
},
|
|
370
|
+
alarm_value: {
|
|
371
|
+
type: Number,
|
|
372
|
+
required: false
|
|
373
|
+
},
|
|
374
|
+
alarm_message: {
|
|
375
|
+
type: String,
|
|
376
|
+
required: false
|
|
377
|
+
},
|
|
378
|
+
alarm_data: {
|
|
379
|
+
type: Object,
|
|
380
|
+
required: false
|
|
381
|
+
}
|
|
382
|
+
}, {
|
|
383
|
+
timestamps: {
|
|
384
|
+
createdAt: false,
|
|
385
|
+
updatedAt: false
|
|
386
|
+
},
|
|
387
|
+
versionKey: false,
|
|
388
|
+
collection: "history",
|
|
389
|
+
toJSON: {
|
|
390
|
+
transform: function(doc, ret) {
|
|
391
|
+
ret.id = ret._id;
|
|
392
|
+
delete ret._id;
|
|
393
|
+
delete ret.__v;
|
|
394
|
+
ret.alarm_timestamp = new Date(ret.alarm_timestamp).getTime();
|
|
395
|
+
ret.alarm = {
|
|
396
|
+
alarm_priority: ret.alarm_priority,
|
|
397
|
+
alarm_state: ret.alarm_original_state ?? "Inactive",
|
|
398
|
+
alarm_type: ret.alarm_type,
|
|
399
|
+
alarm_value: ret.alarm_value === null ? "inf" : `${ret.alarm_value}`,
|
|
400
|
+
alarm_timestamp: new Date(ret.alarm_timestamp).getTime()
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
});
|
|
405
|
+
historySchema.index({ "channel_tag": 1 });
|
|
406
|
+
var oneYear = 60 * 60 * 24 * 365;
|
|
407
|
+
historySchema.addTTLIndex = function(ttlField, expirationTimeInSeconds = oneYear) {
|
|
408
|
+
this.index({ [ttlField]: 1 }, { expireAfterSeconds: expirationTimeInSeconds });
|
|
409
|
+
};
|
|
410
|
+
historySchema.plugin(mongoosePaginate);
|
|
411
|
+
historySchema.plugin(mongooseAggregatePaginate);
|
|
412
|
+
historySchema.plugin(mongooseAutopopulate);
|
|
413
|
+
module.exports = historySchema;
|
|
414
|
+
}
|
|
415
|
+
});
|
|
416
|
+
|
|
417
|
+
// app/models/Unit.cjs
|
|
418
|
+
var require_Unit = __commonJS({
|
|
419
|
+
"app/models/Unit.cjs"(exports, module) {
|
|
420
|
+
"use strict";
|
|
421
|
+
var mongoose = __require("mongoose");
|
|
422
|
+
var mongooseAutopopulate = __require("mongoose-autopopulate");
|
|
423
|
+
var mongoosePaginate = __require("mongoose-paginate-v2");
|
|
424
|
+
var mongooseAggregatePaginate = __require("mongoose-aggregate-paginate-v2");
|
|
425
|
+
var { UnitTypes } = (init_unit_types(), __toCommonJS(unit_types_exports));
|
|
426
|
+
var unitSchema = new mongoose.Schema({
|
|
427
|
+
unit_id: {
|
|
428
|
+
type: String,
|
|
429
|
+
required: true
|
|
430
|
+
},
|
|
431
|
+
unit_enabled: {
|
|
432
|
+
type: Boolean,
|
|
433
|
+
required: true
|
|
434
|
+
},
|
|
435
|
+
unit_type: {
|
|
436
|
+
type: String,
|
|
437
|
+
required: true,
|
|
438
|
+
enum: Object.values(UnitTypes)
|
|
439
|
+
},
|
|
440
|
+
unit_internal_description: {
|
|
441
|
+
type: String,
|
|
442
|
+
required: true
|
|
443
|
+
},
|
|
444
|
+
unit_cabinet_id: {
|
|
445
|
+
type: String,
|
|
446
|
+
required: false
|
|
447
|
+
}
|
|
448
|
+
}, {
|
|
449
|
+
timestamps: true,
|
|
450
|
+
collection: "units",
|
|
451
|
+
toJSON: {
|
|
452
|
+
transform: function(doc, ret) {
|
|
453
|
+
ret.id = ret._id;
|
|
454
|
+
delete ret._id;
|
|
455
|
+
delete ret.__v;
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
unitSchema.index({ "unit_id": 1 }, { unique: true });
|
|
460
|
+
unitSchema.index({ "unit_internal_description": 1 });
|
|
461
|
+
unitSchema.plugin(mongoosePaginate);
|
|
462
|
+
unitSchema.plugin(mongooseAggregatePaginate);
|
|
463
|
+
unitSchema.plugin(mongooseAutopopulate);
|
|
464
|
+
module.exports = unitSchema;
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
// app/models/docs/Channel.json
|
|
469
|
+
var require_Channel2 = __commonJS({
|
|
470
|
+
"app/models/docs/Channel.json"(exports, module) {
|
|
471
|
+
module.exports = {
|
|
472
|
+
components: {
|
|
473
|
+
schemas: {
|
|
474
|
+
Channel: {
|
|
475
|
+
type: "object",
|
|
476
|
+
properties: {
|
|
477
|
+
id: {
|
|
478
|
+
type: "string",
|
|
479
|
+
format: "ObjectId",
|
|
480
|
+
description: "MongoDB ObjectId",
|
|
481
|
+
example: "507f1f77bcf86cd799439011",
|
|
482
|
+
readOnly: true
|
|
483
|
+
},
|
|
484
|
+
channel_tag: {
|
|
485
|
+
type: "string",
|
|
486
|
+
description: "Channel tag",
|
|
487
|
+
example: "MOTOR_PS_TEMP",
|
|
488
|
+
readOnly: true
|
|
489
|
+
},
|
|
490
|
+
channel_description: {
|
|
491
|
+
type: "string",
|
|
492
|
+
description: "Channel description",
|
|
493
|
+
example: "Motor Power Supply Temperature",
|
|
494
|
+
readOnly: true
|
|
495
|
+
},
|
|
496
|
+
channel_unit_id: {
|
|
497
|
+
type: "string",
|
|
498
|
+
format: "ObjectId",
|
|
499
|
+
description: "Unit of the channel",
|
|
500
|
+
example: "507f1f77bcf86cd799439011",
|
|
501
|
+
readOnly: true
|
|
502
|
+
},
|
|
503
|
+
channel_parsed: {
|
|
504
|
+
type: "object",
|
|
505
|
+
description: "Parsed channel data",
|
|
506
|
+
readOnly: true
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
required: [
|
|
510
|
+
"channel_tag",
|
|
511
|
+
"channel_description",
|
|
512
|
+
"channel_unit_id",
|
|
513
|
+
"channel_parsed"
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
examples: {
|
|
518
|
+
Channel: {
|
|
519
|
+
value: {
|
|
520
|
+
id: "507f1f77bcf86cd799439011",
|
|
521
|
+
channel_tag: "MOTOR_PS_TEMP",
|
|
522
|
+
channel_description: "Motor Power Supply Temperature",
|
|
523
|
+
channel_type: "Analogic"
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
|
|
532
|
+
// app/models/docs/ChannelDataBucket.json
|
|
533
|
+
var require_ChannelDataBucket2 = __commonJS({
|
|
534
|
+
"app/models/docs/ChannelDataBucket.json"(exports, module) {
|
|
535
|
+
module.exports = {
|
|
536
|
+
components: {
|
|
537
|
+
schemas: {
|
|
538
|
+
ChannelData: {
|
|
539
|
+
type: "object",
|
|
540
|
+
description: "ChannelData object. This is the bucket where the data is stored, in batches of 1 hour.",
|
|
541
|
+
properties: {
|
|
542
|
+
id: {
|
|
543
|
+
type: "string",
|
|
544
|
+
format: "ObjectId",
|
|
545
|
+
description: "MongoDB ObjectId",
|
|
546
|
+
example: "507f1f77bcf86cd799439011",
|
|
547
|
+
readOnly: true
|
|
548
|
+
},
|
|
549
|
+
start_date: {
|
|
550
|
+
type: "string",
|
|
551
|
+
format: "date-time",
|
|
552
|
+
description: "Start date of the data",
|
|
553
|
+
example: "2024-07-03T10:15:30Z",
|
|
554
|
+
readOnly: true
|
|
555
|
+
},
|
|
556
|
+
end_date: {
|
|
557
|
+
type: "string",
|
|
558
|
+
format: "date-time",
|
|
559
|
+
description: "End date of the data",
|
|
560
|
+
example: "2024-07-03T11:15:30Z",
|
|
561
|
+
readOnly: true
|
|
562
|
+
},
|
|
563
|
+
data: {
|
|
564
|
+
type: "array",
|
|
565
|
+
description: "Data array of DataPoint objects",
|
|
566
|
+
items: {
|
|
567
|
+
$ref: "#/components/schemas/DataPoint"
|
|
568
|
+
},
|
|
569
|
+
readOnly: false
|
|
570
|
+
},
|
|
571
|
+
size: {
|
|
572
|
+
type: "integer",
|
|
573
|
+
format: "int64",
|
|
574
|
+
description: "Size of the data array",
|
|
575
|
+
example: 60,
|
|
576
|
+
readOnly: true
|
|
577
|
+
},
|
|
578
|
+
synced: {
|
|
579
|
+
type: "TODO",
|
|
580
|
+
description: "TODO",
|
|
581
|
+
example: "TODO",
|
|
582
|
+
readOnly: true
|
|
583
|
+
},
|
|
584
|
+
sum: {
|
|
585
|
+
type: "number",
|
|
586
|
+
format: "double",
|
|
587
|
+
description: "Sum of the data",
|
|
588
|
+
example: 69.42,
|
|
589
|
+
readOnly: true
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
},
|
|
593
|
+
DataPoint: {
|
|
594
|
+
type: "object",
|
|
595
|
+
description: "DataPoint object. This is the object that is sent to and from the API. It includes only the timestamp and the value. No id is included because the data is stored inside a larger bucket in the database.",
|
|
596
|
+
properties: {
|
|
597
|
+
timestamp: {
|
|
598
|
+
type: "integer",
|
|
599
|
+
format: "int64",
|
|
600
|
+
description: "Timestamp of the data",
|
|
601
|
+
example: 1710251647e3,
|
|
602
|
+
readOnly: true
|
|
603
|
+
},
|
|
604
|
+
value: {
|
|
605
|
+
type: "number",
|
|
606
|
+
format: "double",
|
|
607
|
+
description: "Value of the data",
|
|
608
|
+
example: 69.42,
|
|
609
|
+
readOnly: true
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
},
|
|
614
|
+
examples: {
|
|
615
|
+
ChannelData: {
|
|
616
|
+
id: "507f1f77bcf86cd799439011",
|
|
617
|
+
start_date: "2024-07-03T10:15:30Z",
|
|
618
|
+
end_date: "2024-07-03T11:15:30Z",
|
|
619
|
+
data: [
|
|
620
|
+
{
|
|
621
|
+
timestamp: 1710251647e3,
|
|
622
|
+
value: 69.42
|
|
623
|
+
}
|
|
624
|
+
],
|
|
625
|
+
size: 60,
|
|
626
|
+
synced: "TODO",
|
|
627
|
+
sum: 69.42
|
|
628
|
+
},
|
|
629
|
+
DataPoint: {
|
|
630
|
+
timestamp: 1710251647e3,
|
|
631
|
+
value: 69.42
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
}
|
|
635
|
+
};
|
|
636
|
+
}
|
|
637
|
+
});
|
|
638
|
+
|
|
639
|
+
// app/models/docs/ChannelWithData.json
|
|
640
|
+
var require_ChannelWithData = __commonJS({
|
|
641
|
+
"app/models/docs/ChannelWithData.json"(exports, module) {
|
|
642
|
+
module.exports = {
|
|
643
|
+
components: {
|
|
644
|
+
schemas: {
|
|
645
|
+
ChannelWithData: {
|
|
646
|
+
allOf: [
|
|
647
|
+
{
|
|
648
|
+
$ref: "#/components/schemas/Channel"
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
type: "object",
|
|
652
|
+
properties: {
|
|
653
|
+
channel_latest_value: {
|
|
654
|
+
type: "string",
|
|
655
|
+
description: "Latest value of the channel",
|
|
656
|
+
example: "25.0",
|
|
657
|
+
readOnly: true
|
|
658
|
+
},
|
|
659
|
+
channel_latest_timestamp: {
|
|
660
|
+
type: "string",
|
|
661
|
+
format: "date-time",
|
|
662
|
+
description: "Timestamp of the latest value",
|
|
663
|
+
example: 1700034034,
|
|
664
|
+
readOnly: true
|
|
665
|
+
},
|
|
666
|
+
channel_alarm_state: {
|
|
667
|
+
type: "string",
|
|
668
|
+
description: "Alarm state of the channel",
|
|
669
|
+
example: "NoAlarm",
|
|
670
|
+
readOnly: true
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
],
|
|
675
|
+
required: [
|
|
676
|
+
"channel_tag",
|
|
677
|
+
"channel_description",
|
|
678
|
+
"channel_type",
|
|
679
|
+
"channel_latest_value",
|
|
680
|
+
"channel_latest_timestamp",
|
|
681
|
+
"channel_alarm_state"
|
|
682
|
+
]
|
|
683
|
+
}
|
|
684
|
+
},
|
|
685
|
+
examples: {
|
|
686
|
+
ChannelWithData: {
|
|
687
|
+
value: {
|
|
688
|
+
id: "507f1f77bcf86cd799439011",
|
|
689
|
+
channel_tag: "MOTOR_PS_TEMP",
|
|
690
|
+
channel_description: "Motor Power Supply Temperature",
|
|
691
|
+
channel_type: "Analogic",
|
|
692
|
+
channel_latest_value: 420.69,
|
|
693
|
+
channel_latest_timestamp: 1700034034,
|
|
694
|
+
channel_alarm_state: "NoAlarm"
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
}
|
|
698
|
+
}
|
|
699
|
+
};
|
|
700
|
+
}
|
|
701
|
+
});
|
|
702
|
+
|
|
703
|
+
// app/models/docs/DataPoint.json
|
|
704
|
+
var require_DataPoint = __commonJS({
|
|
705
|
+
"app/models/docs/DataPoint.json"(exports, module) {
|
|
706
|
+
module.exports = {
|
|
707
|
+
components: {
|
|
708
|
+
schemas: {
|
|
709
|
+
DataPoint: {
|
|
710
|
+
type: "object",
|
|
711
|
+
description: "DataPoint object. This is the object that is sent to and from the API. It includes only the timestamp and the value. No id is included because the data is stored inside a larger bucket in the database.",
|
|
712
|
+
properties: {
|
|
713
|
+
timestamp: {
|
|
714
|
+
type: "integer",
|
|
715
|
+
format: "int64",
|
|
716
|
+
description: "Timestamp of the data",
|
|
717
|
+
example: 1710251647e3,
|
|
718
|
+
readOnly: true
|
|
719
|
+
},
|
|
720
|
+
value: {
|
|
721
|
+
type: "number",
|
|
722
|
+
format: "double",
|
|
723
|
+
description: "Value of the data",
|
|
724
|
+
example: 69.42,
|
|
725
|
+
readOnly: true
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
},
|
|
730
|
+
examples: {
|
|
731
|
+
DataPoint: {
|
|
732
|
+
timestamp: 1710251647e3,
|
|
733
|
+
value: 69.42
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
};
|
|
738
|
+
}
|
|
739
|
+
});
|
|
740
|
+
|
|
741
|
+
// app/models/docs/Event.json
|
|
742
|
+
var require_Event2 = __commonJS({
|
|
743
|
+
"app/models/docs/Event.json"(exports, module) {
|
|
744
|
+
module.exports = {
|
|
745
|
+
components: {
|
|
746
|
+
schemas: {
|
|
747
|
+
Event: {
|
|
748
|
+
type: "object",
|
|
749
|
+
description: "Event object. This is the object that is sent to and from the API. It includes the id as a string, the timestamp as a number and the creation timestamp is not included.",
|
|
750
|
+
properties: {
|
|
751
|
+
id: {
|
|
752
|
+
type: "string",
|
|
753
|
+
format: "ObjectId",
|
|
754
|
+
description: "MongoDB ObjectId",
|
|
755
|
+
example: "507f1f77bcf86cd799439011",
|
|
756
|
+
readOnly: true
|
|
757
|
+
},
|
|
758
|
+
event_message: {
|
|
759
|
+
type: "string",
|
|
760
|
+
format: "text",
|
|
761
|
+
description: "Event message",
|
|
762
|
+
example: "Event message"
|
|
763
|
+
},
|
|
764
|
+
event_source: {
|
|
765
|
+
type: "string",
|
|
766
|
+
format: "text",
|
|
767
|
+
description: "Hostname of the source of the event",
|
|
768
|
+
example: "RMS1"
|
|
769
|
+
},
|
|
770
|
+
event_category: {
|
|
771
|
+
type: "string",
|
|
772
|
+
format: "text",
|
|
773
|
+
description: "Event category",
|
|
774
|
+
example: "Login",
|
|
775
|
+
enum: "%%EVENT_CATEGORY_ENUM%%"
|
|
776
|
+
},
|
|
777
|
+
event_type: {
|
|
778
|
+
type: "string",
|
|
779
|
+
format: "text",
|
|
780
|
+
description: "Event type",
|
|
781
|
+
example: "Login"
|
|
782
|
+
},
|
|
783
|
+
event_timestamp: {
|
|
784
|
+
type: "number",
|
|
785
|
+
format: "timestamp",
|
|
786
|
+
description: "Event timestamp",
|
|
787
|
+
example: 1709899759
|
|
788
|
+
},
|
|
789
|
+
event_data: {
|
|
790
|
+
type: "object",
|
|
791
|
+
description: "Event data. Not validated, just stored"
|
|
792
|
+
}
|
|
793
|
+
},
|
|
794
|
+
required: [
|
|
795
|
+
"event_message",
|
|
796
|
+
"event_source",
|
|
797
|
+
"event_category",
|
|
798
|
+
"event_type",
|
|
799
|
+
"event_timestamp"
|
|
800
|
+
]
|
|
801
|
+
}
|
|
802
|
+
},
|
|
803
|
+
examples: {
|
|
804
|
+
Event: {
|
|
805
|
+
value: {
|
|
806
|
+
id: "507f1f77bcf86cd799439011",
|
|
807
|
+
event_message: "Profile Root logged in for the next 600 seconds, replacing profile Root.",
|
|
808
|
+
event_source: "RMS1",
|
|
809
|
+
event_category: "Login",
|
|
810
|
+
event_type: "LoiginSuccessful",
|
|
811
|
+
event_timestamp: 1709899759,
|
|
812
|
+
event_data: {
|
|
813
|
+
profile: "Root",
|
|
814
|
+
duration: 600,
|
|
815
|
+
replaced_profile: "Monitor"
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
};
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
// app/models/docs/History.json
|
|
826
|
+
var require_History2 = __commonJS({
|
|
827
|
+
"app/models/docs/History.json"(exports, module) {
|
|
828
|
+
module.exports = {
|
|
829
|
+
components: {
|
|
830
|
+
schemas: {
|
|
831
|
+
History: {
|
|
832
|
+
type: "object",
|
|
833
|
+
properties: {
|
|
834
|
+
id: {
|
|
835
|
+
type: "string",
|
|
836
|
+
format: "ObjectId",
|
|
837
|
+
description: "MongoDB ObjectId",
|
|
838
|
+
example: "507f1f77bcf86cd799439011",
|
|
839
|
+
readOnly: true
|
|
840
|
+
},
|
|
841
|
+
channel_tag: {
|
|
842
|
+
type: "string",
|
|
843
|
+
format: "text",
|
|
844
|
+
description: "Channel tag",
|
|
845
|
+
example: "Channel tag",
|
|
846
|
+
readOnly: true
|
|
847
|
+
},
|
|
848
|
+
alarm_timestamp: {
|
|
849
|
+
type: "string",
|
|
850
|
+
format: "date-time",
|
|
851
|
+
description: "Alarm timestamp",
|
|
852
|
+
example: "2020-12-31T23:59:59Z",
|
|
853
|
+
readOnly: true
|
|
854
|
+
},
|
|
855
|
+
alarm_priority: {
|
|
856
|
+
type: "string",
|
|
857
|
+
format: "text",
|
|
858
|
+
description: "Alarm priority",
|
|
859
|
+
example: "Alarm",
|
|
860
|
+
enum: "%%ALARM_PRIORITY_ENUM%%",
|
|
861
|
+
readOnly: true
|
|
862
|
+
},
|
|
863
|
+
alarm_original_state: {
|
|
864
|
+
type: "string",
|
|
865
|
+
format: "text",
|
|
866
|
+
description: "Alarm original state",
|
|
867
|
+
example: "Inactive",
|
|
868
|
+
enum: "%%DIAMAR_ALARM_STATE_ENUM%%",
|
|
869
|
+
readOnly: true
|
|
870
|
+
},
|
|
871
|
+
alarm_state: {
|
|
872
|
+
type: "string",
|
|
873
|
+
format: "text",
|
|
874
|
+
description: "Alarm new state",
|
|
875
|
+
example: "Inactive",
|
|
876
|
+
enum: "%%CLOUD_ALARM_STATE_ENUM%%",
|
|
877
|
+
readOnly: true
|
|
878
|
+
},
|
|
879
|
+
alarm_type: {
|
|
880
|
+
type: "string",
|
|
881
|
+
format: "text",
|
|
882
|
+
description: "Alarm type",
|
|
883
|
+
example: "AlarmOpen",
|
|
884
|
+
enum: "%%ALARM_TYPE_ENUM%%",
|
|
885
|
+
readOnly: true
|
|
886
|
+
},
|
|
887
|
+
alarm_value: {
|
|
888
|
+
type: "number",
|
|
889
|
+
format: "double",
|
|
890
|
+
description: "Alarm value",
|
|
891
|
+
example: 0,
|
|
892
|
+
readOnly: true
|
|
893
|
+
},
|
|
894
|
+
alarm_message: {
|
|
895
|
+
type: "string",
|
|
896
|
+
format: "text",
|
|
897
|
+
description: "Alarm message",
|
|
898
|
+
example: "Alarm message",
|
|
899
|
+
readOnly: true
|
|
900
|
+
}
|
|
901
|
+
},
|
|
902
|
+
required: [
|
|
903
|
+
"channel_tag",
|
|
904
|
+
"alarm_timestamp",
|
|
905
|
+
"alarm_priority",
|
|
906
|
+
"alarm_original_state",
|
|
907
|
+
"alarm_state",
|
|
908
|
+
"alarm_type",
|
|
909
|
+
"alarm_value",
|
|
910
|
+
"alarm_message"
|
|
911
|
+
]
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
examples: {
|
|
915
|
+
History: {
|
|
916
|
+
value: {
|
|
917
|
+
id: "507f1f77bcf86cd799439011",
|
|
918
|
+
channel_tag: "Channel tag",
|
|
919
|
+
alarm_timestamp: "2020-12-31T23:59:59Z",
|
|
920
|
+
alarm_priority: "Alarm",
|
|
921
|
+
alarm_original_state: "Inactive",
|
|
922
|
+
alarm_state: "Inactive",
|
|
923
|
+
alarm_type: "AlarmOpen",
|
|
924
|
+
alarm_value: 0,
|
|
925
|
+
alarm_message: "AlarmOpen Value: [OP]"
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
};
|
|
931
|
+
}
|
|
932
|
+
});
|
|
933
|
+
|
|
934
|
+
// app/models/docs/Unit.json
|
|
935
|
+
var require_Unit2 = __commonJS({
|
|
936
|
+
"app/models/docs/Unit.json"(exports, module) {
|
|
937
|
+
module.exports = {
|
|
938
|
+
components: {
|
|
939
|
+
schemas: {
|
|
940
|
+
Unit: {
|
|
941
|
+
type: "object",
|
|
942
|
+
properties: {
|
|
943
|
+
id: {
|
|
944
|
+
type: "string",
|
|
945
|
+
format: "ObjectId",
|
|
946
|
+
description: "MongoDB ObjectId",
|
|
947
|
+
example: "507f1f77bcf86cd799439011",
|
|
948
|
+
readOnly: true
|
|
949
|
+
},
|
|
950
|
+
unit_id: {
|
|
951
|
+
type: "string",
|
|
952
|
+
description: "Unit identifier in Diamar",
|
|
953
|
+
example: "127",
|
|
954
|
+
readOnly: true
|
|
955
|
+
},
|
|
956
|
+
unit_internal_description: {
|
|
957
|
+
type: "string",
|
|
958
|
+
description: "Unit description",
|
|
959
|
+
example: "Motor Power Supply",
|
|
960
|
+
readOnly: true
|
|
961
|
+
},
|
|
962
|
+
unit_enabled: {
|
|
963
|
+
type: "boolean",
|
|
964
|
+
description: "Unit enabled",
|
|
965
|
+
example: true,
|
|
966
|
+
readOnly: true
|
|
967
|
+
},
|
|
968
|
+
unit_type: {
|
|
969
|
+
type: "string",
|
|
970
|
+
description: "Unit type",
|
|
971
|
+
example: "DIM36",
|
|
972
|
+
readOnly: true
|
|
973
|
+
},
|
|
974
|
+
unit_cabinet_id: {
|
|
975
|
+
type: "string",
|
|
976
|
+
description: "Cabinet identifier",
|
|
977
|
+
example: "Cabinet 1",
|
|
978
|
+
readOnly: true
|
|
979
|
+
}
|
|
980
|
+
},
|
|
981
|
+
required: [
|
|
982
|
+
"unit_id",
|
|
983
|
+
"unit_internal_description",
|
|
984
|
+
"unit_enabled",
|
|
985
|
+
"unit_type",
|
|
986
|
+
"unit_cabinet_id"
|
|
987
|
+
]
|
|
988
|
+
}
|
|
989
|
+
},
|
|
990
|
+
examples: {
|
|
991
|
+
Unit: {
|
|
992
|
+
value: {
|
|
993
|
+
id: "507f1f77bcf86cd799439011",
|
|
994
|
+
unit_id: "127",
|
|
995
|
+
unit_internal_description: "Motor Power Supply",
|
|
996
|
+
unit_enabled: true,
|
|
997
|
+
unit_type: "DIM36",
|
|
998
|
+
unit_cabinet_id: "Cabinet 1"
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
};
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
1006
|
+
|
|
1007
|
+
// app/models/docs/index.cjs
|
|
1008
|
+
var require_docs = __commonJS({
|
|
1009
|
+
"app/models/docs/index.cjs"(exports, module) {
|
|
1010
|
+
"use strict";
|
|
1011
|
+
var { AlarmTypes, AlarmPriorities, CloudAlarmStates, DiamarAlarmStates } = (init_alarm_types(), __toCommonJS(alarm_types_exports));
|
|
1012
|
+
var { EventCategories } = (init_event_types(), __toCommonJS(event_types_exports));
|
|
1013
|
+
var ChannelDocs = require_Channel2();
|
|
1014
|
+
var ChannelDataBucketDocs = require_ChannelDataBucket2();
|
|
1015
|
+
var ChannelWithDataDocs = require_ChannelWithData();
|
|
1016
|
+
var DataPointDocs = require_DataPoint();
|
|
1017
|
+
var EventDocs = require_Event2();
|
|
1018
|
+
var HistoryDocs = require_History2();
|
|
1019
|
+
var UnitDocs = require_Unit2();
|
|
1020
|
+
HistoryDocs.components.schemas.History.properties.alarm_priority.enum = Object.values(AlarmPriorities);
|
|
1021
|
+
HistoryDocs.components.schemas.History.properties.alarm_state.enum = Object.values(CloudAlarmStates);
|
|
1022
|
+
HistoryDocs.components.schemas.History.properties.alarm_original_state.enum = Object.values(DiamarAlarmStates);
|
|
1023
|
+
HistoryDocs.components.schemas.History.properties.alarm_type.enum = Object.values(AlarmTypes);
|
|
1024
|
+
EventDocs.components.schemas.Event.properties.event_category.enum = Object.values(EventCategories);
|
|
1025
|
+
var Docs = {
|
|
1026
|
+
ChannelDocs,
|
|
1027
|
+
ChannelDataBucketDocs,
|
|
1028
|
+
ChannelWithDataDocs,
|
|
1029
|
+
DataPointDocs,
|
|
1030
|
+
EventDocs,
|
|
1031
|
+
HistoryDocs,
|
|
1032
|
+
UnitDocs
|
|
1033
|
+
};
|
|
1034
|
+
module.exports = Docs;
|
|
1035
|
+
}
|
|
1036
|
+
});
|
|
1037
|
+
|
|
1038
|
+
// app/node-entry.cjs
|
|
1039
|
+
var require_node_entry = __commonJS({
|
|
1040
|
+
"app/node-entry.cjs"(exports, module) {
|
|
1041
|
+
var Channel = require_Channel();
|
|
1042
|
+
var ChannelDataBucket = require_ChannelDataBucket();
|
|
1043
|
+
var Event = require_Event();
|
|
1044
|
+
var History = require_History();
|
|
1045
|
+
var Unit = require_Unit();
|
|
1046
|
+
var Schemas = {
|
|
1047
|
+
Channel,
|
|
1048
|
+
ChannelDataBucket,
|
|
1049
|
+
Event,
|
|
1050
|
+
History,
|
|
1051
|
+
Unit
|
|
1052
|
+
};
|
|
1053
|
+
var Docs = require_docs();
|
|
1054
|
+
var { AlarmTypes, AlarmPriorities, CloudAlarmStates, DiamarAlarmStates } = (init_alarm_types(), __toCommonJS(alarm_types_exports));
|
|
1055
|
+
var { EventCategories } = (init_event_types(), __toCommonJS(event_types_exports));
|
|
1056
|
+
var Types = {
|
|
1057
|
+
AlarmTypes,
|
|
1058
|
+
AlarmPriorities,
|
|
1059
|
+
CloudAlarmStates,
|
|
1060
|
+
DiamarAlarmStates,
|
|
1061
|
+
EventCategories
|
|
1062
|
+
};
|
|
1063
|
+
var mongoose = __require("mongoose");
|
|
1064
|
+
var mongooseAutopopulate = __require("mongoose-autopopulate");
|
|
1065
|
+
var mongoosePaginate = __require("mongoose-paginate-v2");
|
|
1066
|
+
var mongooseAggregatePaginate = __require("mongoose-aggregate-paginate-v2");
|
|
1067
|
+
module.exports = {
|
|
1068
|
+
Schemas,
|
|
1069
|
+
Docs,
|
|
1070
|
+
Types,
|
|
1071
|
+
mongoose,
|
|
1072
|
+
mongoosePaginate,
|
|
1073
|
+
mongooseAggregatePaginate,
|
|
1074
|
+
mongooseAutopopulate
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
});
|
|
1078
|
+
export default require_node_entry();
|