busroot-sdk 0.0.2 → 0.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.
- package/build/busroot.d.ts +816 -0
- package/build/client.d.ts +20 -9
- package/build/client.js +60 -40
- package/build/hooks.d.ts +11 -6
- package/build/hooks.js +13 -3
- package/build/index.d.ts +2 -0
- package/build/index.js +4 -0
- package/package.json +3 -3
- package/build/common.d.ts +0 -276
- package/build/example.d.ts +0 -1
- package/build/example.js +0 -31
|
@@ -0,0 +1,816 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
declare enum RagStatus {
|
|
4
|
+
Red = "#cc3311",
|
|
5
|
+
Amber = "#ee7733",
|
|
6
|
+
Green = "#009988",
|
|
7
|
+
Blue = "#33bbee",
|
|
8
|
+
NA = "#CCCCCC",
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare const StationStatus = {
|
|
12
|
+
outOfShift: { label: "Out of Shift", colour: chroma("#DDDDDD") },
|
|
13
|
+
futureOutOfShift: { label: "Out of Shift (Future)", colour: chroma("#DDDDDD").darken(2) },
|
|
14
|
+
futureInShift: { label: "In Shift (Future)", colour: chroma("#DDDDDD").darken(1) },
|
|
15
|
+
noSchedule: { label: "No Schedule", colour: chroma("#ee7733") },
|
|
16
|
+
futureNoSchedule: { label: "Not Scheduled (Future)", colour: chroma("#ee7733").darken(1) },
|
|
17
|
+
nonProductionSchedule: { label: "Scheduled Non-Production", colour: chroma("#33bbee") },
|
|
18
|
+
futureNonProductionSchedule: { label: "Scheduled Non-Production (Future)", colour: chroma("#33bbee").darken(1) },
|
|
19
|
+
productionSchedule: { label: "Scheduled Production", colour: chroma("#009988") },
|
|
20
|
+
futureProductionSchedule: { label: "Scheduled Production (Future)", colour: chroma("#009988").darken(1) },
|
|
21
|
+
downtime: { label: "Unplanned Downtime", colour: chroma("#cc3311") },
|
|
22
|
+
disconnected: { label: "Connection Lost", colour: chroma("#8338ec") },
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
declare enum DowntimeType {
|
|
26
|
+
Stop = "stop",
|
|
27
|
+
Slow = "slow",
|
|
28
|
+
Manual = "manual",
|
|
29
|
+
StopUtilisation = "stop_utilisation",
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
declare enum DowntimeEventType {
|
|
33
|
+
Acknowledge = "acknowledge",
|
|
34
|
+
Estimate = "estimate",
|
|
35
|
+
Escalate = "escalate",
|
|
36
|
+
Cause = "cause",
|
|
37
|
+
Exclude = "exclude",
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
declare enum DowntimeFilterState {
|
|
41
|
+
Ongoing = "ongoing",
|
|
42
|
+
NotStartNotified = "not_start_notified",
|
|
43
|
+
NotEndNotified = "not_end_notified",
|
|
44
|
+
EscalatedOnly = "Escalated_only",
|
|
45
|
+
WithinADay = "day",
|
|
46
|
+
WithinAWeek = "week",
|
|
47
|
+
NoCause = "no_cause",
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
declare const GROUP_TAG_PREFIX = "group";
|
|
51
|
+
|
|
52
|
+
declare enum MessageType {
|
|
53
|
+
intouch = "intouch",
|
|
54
|
+
kepware = "iotgateway",
|
|
55
|
+
dau = "dau",
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
declare enum PRODUCTION_TYPE {
|
|
59
|
+
MANUAL = "manual",
|
|
60
|
+
TIMESERIES = "timeseries",
|
|
61
|
+
FROM_SPEED = "from-speed",
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare enum SCHEDULE_TYPE {
|
|
65
|
+
NON_PRODUCTION = "non_production",
|
|
66
|
+
PRODUCTION = "production",
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
declare enum UserRole {
|
|
70
|
+
customer = "customer",
|
|
71
|
+
oi = "oi",
|
|
72
|
+
blocked = "blocked",
|
|
73
|
+
partner = "partner",
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
declare enum AccountRole {
|
|
77
|
+
member = "member",
|
|
78
|
+
admin = "admin",
|
|
79
|
+
blocked = "blocked",
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
declare enum AuthType {
|
|
83
|
+
ui = "ui",
|
|
84
|
+
api = "api",
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
declare enum WeekDay {
|
|
88
|
+
Monday = "1",
|
|
89
|
+
Tuesday = "2",
|
|
90
|
+
Wednesday = "3",
|
|
91
|
+
Thursday = "4",
|
|
92
|
+
Friday = "5",
|
|
93
|
+
Saturday = "6",
|
|
94
|
+
Sunday = "7",
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
declare enum NOTIFICATION_PREFERENCE {
|
|
98
|
+
NONE = "none",
|
|
99
|
+
ALL = "all_issues",
|
|
100
|
+
DOWNTIME_SUMMARY = "downtime_summary",
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
declare enum DOWNTIME_DETECTION_MODE {
|
|
104
|
+
OFF = "off",
|
|
105
|
+
PRODUCTION_CYCLE_TIME = "production",
|
|
106
|
+
UTILISATION = "utilisation", // TODO: Rename this to PRODUCTIVE_STATUS
|
|
107
|
+
LINE_SPEED = "line_speed",
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
declare enum PRODUCTIVE_STATUS_MODE {
|
|
111
|
+
PRODUCTIVE_SIGNAL = "productive_signal",
|
|
112
|
+
ELECTRICAL_USAGE = "electrical_usage",
|
|
113
|
+
LINE_SPEED = "line_speed",
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
declare enum TIMESERIES_MESSAGE_TYPE {
|
|
117
|
+
BAD_PRODUCTION_COMPLETE = "BAD_PRODUCTION_COMPLETE",
|
|
118
|
+
BAD_PRODUCTION_COUNT = "BAD_PRODUCTION_COUNT",
|
|
119
|
+
PRODUCTION_COMPLETE = "PRODUCTION_COMPLETE",
|
|
120
|
+
PRODUCTION_COUNT = "PRODUCTION_COUNT",
|
|
121
|
+
PRODUCTIVE = "PRODUCTIVE",
|
|
122
|
+
LINE_SPEED = "LINE_SPEED",
|
|
123
|
+
SPEED = "SPEED",
|
|
124
|
+
ELECTRICAL_KWH = "ELECTRICAL_KWH",
|
|
125
|
+
ELECTRICAL_KWH_INTERVAL = "ELECTRICAL_KWH_INTERVAL",
|
|
126
|
+
ELECTRICAL_A = "ELECTRICAL_A",
|
|
127
|
+
ELECTRICAL_V = "ELECTRICAL_V",
|
|
128
|
+
ELECTRICAL_HZ = "ELECTRICAL_HZ",
|
|
129
|
+
ELECTRICAL_KW = "ELECTRICAL_KW",
|
|
130
|
+
ELECTRICAL_PF = "ELECTRICAL_PF",
|
|
131
|
+
STATUS_CODE = "STATUS_CODE",
|
|
132
|
+
RSSI = "RSSI",
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
declare enum CursorType {
|
|
136
|
+
production = "production",
|
|
137
|
+
stops = "stops",
|
|
138
|
+
slowLineSpeed = "slow_line_speed",
|
|
139
|
+
lastStatusCode = "last_status_code",
|
|
140
|
+
stationWindows = "station_windows",
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
declare enum ALERT_ISSUE_TYPE {
|
|
144
|
+
STOP = "stop",
|
|
145
|
+
RESOLVED = "resolved",
|
|
146
|
+
ESCALATED = "escalated",
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare enum STATION_MODULE_VISIBILITY {
|
|
150
|
+
UTILISATION = "utilisation",
|
|
151
|
+
ELECTRICAL = "electrical",
|
|
152
|
+
LINE_SPEED = "line_speed",
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
declare enum EMAIL_HARNESS_TYPE {
|
|
156
|
+
LOGIN = "login",
|
|
157
|
+
DOWNTIME_DETECTION = "downtime_detection",
|
|
158
|
+
DAILY_SUMMARY = "daily_summary",
|
|
159
|
+
DAILY_SUMMARY_REAL_ACCOUNT = "daily_summary_real_account",
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
declare const PERFORMANCE_MODE_TYPE = {
|
|
163
|
+
cycleTime: "cycle-time",
|
|
164
|
+
unitsPerMinute: "units-per-minute",
|
|
165
|
+
unitsPerHour: "units-per-hour",
|
|
166
|
+
lineSpeed: "line-speed",
|
|
167
|
+
none: "none",
|
|
168
|
+
} as const;
|
|
169
|
+
|
|
170
|
+
type PERFORMANCE_MODE_TYPE = (typeof PERFORMANCE_MODE_TYPE)[keyof typeof PERFORMANCE_MODE_TYPE];
|
|
171
|
+
|
|
172
|
+
declare const REASON_TYPE = {
|
|
173
|
+
downtime: "downtime",
|
|
174
|
+
non_production: "non-production",
|
|
175
|
+
} as const;
|
|
176
|
+
|
|
177
|
+
type REASON_TYPE = (typeof REASON_TYPE)[keyof typeof REASON_TYPE];
|
|
178
|
+
|
|
179
|
+
declare const MqttEventType = {
|
|
180
|
+
StationMetricNew: "STATION_METRIC_NEW", // When a new station window is created and saved to DB.
|
|
181
|
+
StationChanged: "STATION_CHANGED", // When a station is added or edited. NOT IMPLEMENTED.
|
|
182
|
+
ScheduleChanged: "SCHEDULE_CHANGED", // When a schedule is added or edited. NOT IMPLEMENTED.
|
|
183
|
+
ScheduleStarted: "SCHEDULE_STARTED", // When a schedule starts (actualStartAt). NOT IMPLEMENTED.
|
|
184
|
+
ScheduleEnded: "SCHEDULE_ENDED", // When a schedule ends (actualEndAt). NOT IMPLEMENTED.
|
|
185
|
+
ProductionNew: "PRODUCTION_NEW", // When new production is added. NOT IMPLEMENTED FOR MANUAL PRODUCTION YET.
|
|
186
|
+
};
|
|
187
|
+
|
|
188
|
+
type MqttEventType = keyof typeof MqttEventType;
|
|
189
|
+
|
|
190
|
+
interface BusrootSignals {
|
|
191
|
+
timestamp?: number;
|
|
192
|
+
production_complete?: number;
|
|
193
|
+
bad_production_complete?: number;
|
|
194
|
+
production_count?: number;
|
|
195
|
+
production_count_good?: number;
|
|
196
|
+
bad_production_count?: number;
|
|
197
|
+
production_count_bad?: number;
|
|
198
|
+
sku_code?: string;
|
|
199
|
+
productive?: number;
|
|
200
|
+
line_speed?: number;
|
|
201
|
+
speed?: number;
|
|
202
|
+
status_code?: string;
|
|
203
|
+
electrical_kwh?: number;
|
|
204
|
+
electrical_kwh_interval?: number;
|
|
205
|
+
electrical_v?: number;
|
|
206
|
+
electrical_a?: number;
|
|
207
|
+
electrical_kw?: number;
|
|
208
|
+
electrical_hz?: number;
|
|
209
|
+
electrical_pf?: number;
|
|
210
|
+
rssi?: number;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
interface PlantSchema {
|
|
214
|
+
code: string;
|
|
215
|
+
name: string;
|
|
216
|
+
timezone: string;
|
|
217
|
+
accountId: string;
|
|
218
|
+
dayStartHour: number;
|
|
219
|
+
createdAt?: string;
|
|
220
|
+
updatedAt?: string;
|
|
221
|
+
archivedAt?: string;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
declare const StationSchema = z.object({
|
|
225
|
+
// Basics
|
|
226
|
+
accountId: z.string(),
|
|
227
|
+
code: z.string().describe("Code: Assign a Code to the Station, this cannot be changed once set."),
|
|
228
|
+
name: z.string().trim().min(1).max(32).describe("Name: Assign a Name to the Station."),
|
|
229
|
+
description: z.string().nullish(),
|
|
230
|
+
groupCode: z.string().describe("Group: Assign the station to a group of stations."),
|
|
231
|
+
shiftPatternId: z.number().int().positive().nullish().describe("Shift Pattern: Select which Shift Pattern the station will follow."),
|
|
232
|
+
moduleVisibility: z.array(z.nativeEnum(STATION_MODULE_VISIBILITY)).nullish(),
|
|
233
|
+
minimumCycleTime: z
|
|
234
|
+
.number()
|
|
235
|
+
.int()
|
|
236
|
+
.gte(0)
|
|
237
|
+
.lte(TimeIntervals["12h"].ms)
|
|
238
|
+
.nullish()
|
|
239
|
+
.describe(
|
|
240
|
+
"Minimum Cycle Time (secs): Set a minimum cycle-time for the station. If more than one signal is received in this period, Busroot will only count one unit. This allows filtering of signals during setup process for example.",
|
|
241
|
+
),
|
|
242
|
+
speedScale: z
|
|
243
|
+
.number()
|
|
244
|
+
.gte(-9999)
|
|
245
|
+
.lte(9999)
|
|
246
|
+
.nullish()
|
|
247
|
+
.describe(
|
|
248
|
+
"Speed scale: If the value on the Performance Chart doesn't reflect actual running speed, it can be calibrated by setting this value. For example current value = 20, but actual speed = 10, scale should be set to 0.5.",
|
|
249
|
+
),
|
|
250
|
+
speedOffset: z
|
|
251
|
+
.number()
|
|
252
|
+
.gte(-9999)
|
|
253
|
+
.lte(9999)
|
|
254
|
+
.nullish()
|
|
255
|
+
.describe(
|
|
256
|
+
"Speed offset: This can be set to fine tune a Speed value. For example if a Stations speed is showing as 0.5 when stopped, set the value to -0.5.",
|
|
257
|
+
),
|
|
258
|
+
speedToProductionRatio: z
|
|
259
|
+
.number()
|
|
260
|
+
.gte(0)
|
|
261
|
+
.lte(99999)
|
|
262
|
+
.nullish()
|
|
263
|
+
.describe(
|
|
264
|
+
"Speed to Production Ratio: A speed value can be converted into a production count. Set the conversion ratio, this can be a decimal if required. (if left blank no production units will be counted)",
|
|
265
|
+
),
|
|
266
|
+
electricalPowerNominalKw: z
|
|
267
|
+
.number()
|
|
268
|
+
.gte(0)
|
|
269
|
+
.nullish()
|
|
270
|
+
.describe("Electrical Power Nominal (kW): The expected power usage in kW during normal operation."),
|
|
271
|
+
|
|
272
|
+
// Defaults
|
|
273
|
+
idleCostPerMinute: z
|
|
274
|
+
.number()
|
|
275
|
+
.gte(0)
|
|
276
|
+
.lte(99999)
|
|
277
|
+
.nullish()
|
|
278
|
+
.describe(
|
|
279
|
+
"Idle Cost (£/min): Assign a cost per minute for any idle time. This will be used for scheduling losses, planned non-production losses and downtime losses where the SKU does not have a value set.",
|
|
280
|
+
),
|
|
281
|
+
|
|
282
|
+
// Downtime Settings
|
|
283
|
+
downtimeDetectionMode: z
|
|
284
|
+
.nativeEnum(DOWNTIME_DETECTION_MODE)
|
|
285
|
+
.default(DOWNTIME_DETECTION_MODE.UTILISATION)
|
|
286
|
+
.optional()
|
|
287
|
+
.describe(
|
|
288
|
+
"Downtime Detection Mode: Busroot will report downtime for a station using either Utilisation, Production Cycle data or Line Speed Monitoring. (relevant signals must be connected)",
|
|
289
|
+
),
|
|
290
|
+
utilisationDowntimeThreshold: z
|
|
291
|
+
.preprocess((val) => (val === null ? TimeIntervals["1h"].ms : val), z.number().int().gte(0).optional())
|
|
292
|
+
.describe(
|
|
293
|
+
"Utilisation Downtime Threshold (mins): This controls the minimum period before Busroot will register downtime. ie. with a threshold of 10mins, only stops of 10 mins or longer will be recorded.",
|
|
294
|
+
),
|
|
295
|
+
|
|
296
|
+
slowDurationThreshold: z.number().int().gte(0).nullish(),
|
|
297
|
+
forceAllShiftTimeAsPlannedProduction: z.boolean().default(true),
|
|
298
|
+
|
|
299
|
+
// Productive Settings
|
|
300
|
+
productiveStatusMode: z
|
|
301
|
+
.nativeEnum(PRODUCTIVE_STATUS_MODE)
|
|
302
|
+
.default(PRODUCTIVE_STATUS_MODE.PRODUCTIVE_SIGNAL)
|
|
303
|
+
.optional()
|
|
304
|
+
.describe("Productive Status Mode: Select one of the following to measure when the station is engaged in a value-adding-activity."),
|
|
305
|
+
electricalUsageStoppedThresholdKw: z
|
|
306
|
+
.number()
|
|
307
|
+
.gte(0)
|
|
308
|
+
.nullish()
|
|
309
|
+
.describe(
|
|
310
|
+
"Stopped Threshold (kW): Set the minimum kW consumption that indicates the station active, below this Busroot will regard as downtime.",
|
|
311
|
+
),
|
|
312
|
+
lineSpeedStoppedThreshold: z
|
|
313
|
+
.number()
|
|
314
|
+
.gte(0)
|
|
315
|
+
.nullish()
|
|
316
|
+
.describe(
|
|
317
|
+
"Line Speed Stopped Threshold: Set the minimum speed that the indicates the station is running, below this Busroot will regard as downtime.",
|
|
318
|
+
),
|
|
319
|
+
productiveHoldOnTime: z
|
|
320
|
+
.number()
|
|
321
|
+
.int()
|
|
322
|
+
.gte(0)
|
|
323
|
+
.lte(TimeIntervals["1d"].ms)
|
|
324
|
+
.nullish()
|
|
325
|
+
.describe(
|
|
326
|
+
"Productive Hold on Time (mins): This controls the length of time a station is considered active after a productive signal. Each time a new signal is received the hold on time will restart.",
|
|
327
|
+
),
|
|
328
|
+
|
|
329
|
+
// Flags
|
|
330
|
+
allowInterruptionMode: z
|
|
331
|
+
.boolean()
|
|
332
|
+
.default(false)
|
|
333
|
+
.optional()
|
|
334
|
+
.describe(
|
|
335
|
+
"Allow Interruption Mode: Enable the Interruption tool. The tool provides an intuitive way to capture downtime from human-lead manufacturing processes where digital data capture is impossible.",
|
|
336
|
+
),
|
|
337
|
+
allowManualProduction: z
|
|
338
|
+
.boolean()
|
|
339
|
+
.default(false)
|
|
340
|
+
.optional()
|
|
341
|
+
.describe(
|
|
342
|
+
"Allow Manual Production: This enables the production entry module on the tablet, allowing operators to count production manually.",
|
|
343
|
+
),
|
|
344
|
+
allowQuickScheduleStart: z
|
|
345
|
+
.boolean()
|
|
346
|
+
.default(false)
|
|
347
|
+
.optional()
|
|
348
|
+
.describe("Allow Ad Hoc Schedules: This allows operators with tablets to start new schedules directly from the tablet."),
|
|
349
|
+
allowScheduleCutShort: z
|
|
350
|
+
.boolean()
|
|
351
|
+
.default(false)
|
|
352
|
+
.optional()
|
|
353
|
+
.describe(
|
|
354
|
+
"Allow Schedule Cut Short: This enables a button in Schedule Management, to allow a schedule to be ended early. The remaining quantity will be added to a new schedule with the same Work Order Ref.",
|
|
355
|
+
),
|
|
356
|
+
|
|
357
|
+
// Current State
|
|
358
|
+
currentOperatorInitials: z.string().min(3).max(3).nullish(),
|
|
359
|
+
statusCode: z.string().nullish(),
|
|
360
|
+
statusCodeUpdatedAt: z.string().nullish(),
|
|
361
|
+
|
|
362
|
+
// Performance Mode
|
|
363
|
+
cycleTime: z
|
|
364
|
+
.number()
|
|
365
|
+
.int()
|
|
366
|
+
.gt(0)
|
|
367
|
+
.lte(TimeIntervals["12h"].ms)
|
|
368
|
+
.nullish()
|
|
369
|
+
.describe("Cycle Time (secs): Set a standard cycle-time for the station."),
|
|
370
|
+
unitsPerMinute: z.number().int().gt(0).nullish().describe("Units Per Minute: Set the expected production rate in units/min."),
|
|
371
|
+
unitsPerHour: z.number().int().gt(0).nullish().describe("Units Per Hour: Set the expected production rate in units/hr."),
|
|
372
|
+
lineSpeedTarget: z.number().gt(0).lte(99999).nullish().describe("Line Speed Target: Set a target speed for the station."),
|
|
373
|
+
|
|
374
|
+
// System info
|
|
375
|
+
createdAt: z.string().nullish(),
|
|
376
|
+
updatedAt: z.string().nullish(),
|
|
377
|
+
archivedAt: z.string().nullish(),
|
|
378
|
+
});
|
|
379
|
+
|
|
380
|
+
type StationSchema = z.infer<typeof StationSchema>;
|
|
381
|
+
|
|
382
|
+
declare const AccountSchema = z.object({
|
|
383
|
+
id: z.string(),
|
|
384
|
+
domain: z.string(),
|
|
385
|
+
stationCountLimit: z.number().nullish(),
|
|
386
|
+
electricalPricePerKwh: z.number().nullish(),
|
|
387
|
+
electricalCo2PerKwh: z.number().nullish(),
|
|
388
|
+
currency: z.string().nullish(),
|
|
389
|
+
enableLostProductionCost: z.boolean().nullish(),
|
|
390
|
+
dashboardConfig: z.record(z.string(), z.any()).nullish(),
|
|
391
|
+
redshiftPassword: z.string().nullish(),
|
|
392
|
+
uploadTransforms: z.string().nullish(),
|
|
393
|
+
defaultAutoEndOnQuantityComplete: z.boolean().nullish(),
|
|
394
|
+
appUrls: z.string().nullish(),
|
|
395
|
+
createdAt: z.string().nullish(),
|
|
396
|
+
updatedAt: z.string().nullish(),
|
|
397
|
+
});
|
|
398
|
+
|
|
399
|
+
type AccountSchema = z.infer<typeof AccountSchema>;
|
|
400
|
+
|
|
401
|
+
// OEE Availability = (scheduledProductionMs - downtimeMs) / scheduledProductionMs
|
|
402
|
+
// OEE Performance = (productionTargetCount - (productionTargetCount - (productionGoodCount + productionBadCount)) / productionTargetCount
|
|
403
|
+
// OEE Quality = (productionGoodCount - productionBadCount) / productionGoodCount
|
|
404
|
+
|
|
405
|
+
declare const StationWindowSchema = z.object({
|
|
406
|
+
accountId: z.string().describe(""),
|
|
407
|
+
stationCode: z.string().describe("A code that uniquely identifies this station within this account."),
|
|
408
|
+
windowStartAt: z.string().describe("The start time of this window in ISO 8601 format."),
|
|
409
|
+
windowEndAt: z.string().describe("The end time of this window in ISO 8601 format."),
|
|
410
|
+
totalMs: z.number().describe("The total number milliseconds covered by this window. Shortcut for windowEndAt - windowStartAt."),
|
|
411
|
+
shiftMs: z.number().describe("The number of milliseconds that were in shift.").optional(),
|
|
412
|
+
shiftName: z.string().describe("The name of the shift at this time.").optional(),
|
|
413
|
+
scheduledProductionMs: z.number().describe("The number of milliseconds that were scheduled production.").optional(),
|
|
414
|
+
scheduledNonProductionMs: z.number().describe("The number of milliseconds that were scheduled non-production.").optional(),
|
|
415
|
+
productiveMs: z.number().describe("The number of milliseconds that the station was in a productive state.").optional(),
|
|
416
|
+
downtimeId: z.number().describe("The ID of the current downtime.").optional(),
|
|
417
|
+
downtimeMs: z.number().describe("The number of milliseconds that the station was in downtime.").optional(),
|
|
418
|
+
downtimeReasonCode: z.string().describe("The reason code assigned to the current downtime.").optional(),
|
|
419
|
+
downtimeSince: z.string().describe("The time this downtime started, in ISO 8601 format.").optional(),
|
|
420
|
+
rssiAvg: z
|
|
421
|
+
.number()
|
|
422
|
+
.optional()
|
|
423
|
+
.describe("The received signal strength of the wireless device. -70dBm to -80dBm is good. <-90dBm is bad.")
|
|
424
|
+
.optional(),
|
|
425
|
+
productionGoodCount: z.number().describe("The number of good quality units produced.").optional(),
|
|
426
|
+
productionBadCount: z.number().describe("The number of bad quality units produced.").optional(),
|
|
427
|
+
productionIdealCount: z
|
|
428
|
+
.number()
|
|
429
|
+
.optional()
|
|
430
|
+
.describe(
|
|
431
|
+
"The number of production units that should have been produced according to the SKU/part's cycle-time. WITH consideration for downtime.",
|
|
432
|
+
)
|
|
433
|
+
.optional(),
|
|
434
|
+
productionTargetCount: z
|
|
435
|
+
.number()
|
|
436
|
+
.describe(
|
|
437
|
+
"The number of production units that should have been produced according to the SKU/part's cycle-time. WITHOUT consideration for downtime.",
|
|
438
|
+
)
|
|
439
|
+
.optional(),
|
|
440
|
+
speed: z
|
|
441
|
+
.number()
|
|
442
|
+
.describe(
|
|
443
|
+
"The average line speed. Line speed is an arbitrary value that relates to this station's manufacturing process. i.e. Motor RPM.",
|
|
444
|
+
)
|
|
445
|
+
.optional(),
|
|
446
|
+
errorCode: z.string().describe("The error code that was flagged.").optional(),
|
|
447
|
+
scheduleId: z.number().describe("The ID of the current schedule.").optional(),
|
|
448
|
+
skuCode: z.string().describe("The SKU code taken from the current schedule.").optional(),
|
|
449
|
+
isAlive: z
|
|
450
|
+
.boolean()
|
|
451
|
+
.describe(
|
|
452
|
+
"A boolean value indicating if any signal was recieved from this station. Useful for detemining if the device has been disconnected from the network.",
|
|
453
|
+
)
|
|
454
|
+
.optional(),
|
|
455
|
+
electricalVoltsAvg: z.number().describe("The average voltage of the electrical supply.").optional(),
|
|
456
|
+
electricalAmpsAvg: z.number().describe("The average current draw.").optional(),
|
|
457
|
+
electricalHzAvg: z.number().describe("The average frequency of the electrical supply.").optional(),
|
|
458
|
+
electricalPfAvg: z.number().describe("The average Power Factor.").optional(),
|
|
459
|
+
electricalKwAvg: z.number().describe("The average power used.").optional(),
|
|
460
|
+
electricalKwh: z.number().describe("The total energy consumed.").optional(),
|
|
461
|
+
statusCode: z.string().describe("").optional(),
|
|
462
|
+
nonProductionReasonCode: z.string().describe("The non-production reason code for the current schedule.").optional(),
|
|
463
|
+
skuGroupCode: z.string().describe("").optional(),
|
|
464
|
+
electricalCost: z.number().describe("The cost of the electricity used.").optional(),
|
|
465
|
+
costCurrency: z.string().describe("The currency of any costs.").optional(),
|
|
466
|
+
electricalCo2: z.number().describe("The amount of CO2 associated with the electricity used.").optional(),
|
|
467
|
+
workOrderReference: z.string().describe("The work order reference of the current schedule.").optional(),
|
|
468
|
+
|
|
469
|
+
lostProductionCostNonProduction: z.number().describe("The cost of the time lost to scheduled non-production.").optional(),
|
|
470
|
+
lostProductionCostDowntime: z.number().describe("The cost of the time lost to downtime.").optional(),
|
|
471
|
+
lostProductionCostSpeed: z.number().describe("The cost of the shortfall units lost due to under performance.").optional(),
|
|
472
|
+
lostProductionCostQuality: z.number().describe("The cost of the bad quality units produced.").optional(),
|
|
473
|
+
|
|
474
|
+
// Performance Mode
|
|
475
|
+
performanceModeFrom: z.string().describe("").optional(),
|
|
476
|
+
performanceModeType: z.string().describe("").optional(),
|
|
477
|
+
|
|
478
|
+
productionGoodValue: z.number().describe("The value of the good quality units produced.").optional(),
|
|
479
|
+
productionBadValue: z.number().describe("The value of the bad quality units produced.").optional(),
|
|
480
|
+
|
|
481
|
+
createdAt: z.string().describe("").optional(),
|
|
482
|
+
updatedAt: z.string().describe("").optional(),
|
|
483
|
+
});
|
|
484
|
+
|
|
485
|
+
type StationWindowSchema = z.infer<typeof StationWindowSchema>;
|
|
486
|
+
|
|
487
|
+
declare const ApiKeySchema = z.object({
|
|
488
|
+
accountId: z.string(),
|
|
489
|
+
key: z.string(),
|
|
490
|
+
createdByUserId: z.number(),
|
|
491
|
+
expiresAt: z.string(),
|
|
492
|
+
createdAt: z.string().optional(),
|
|
493
|
+
updatedAt: z.string().optional(),
|
|
494
|
+
});
|
|
495
|
+
type ApiKeySchema = z.infer<typeof ApiKeySchema>;
|
|
496
|
+
|
|
497
|
+
declare const AccountViewModel = AccountSchema.merge(
|
|
498
|
+
z.object({
|
|
499
|
+
cursors: z
|
|
500
|
+
.array(
|
|
501
|
+
z.object({
|
|
502
|
+
type: z.string(),
|
|
503
|
+
timestamp: z.number(),
|
|
504
|
+
value: z.string(),
|
|
505
|
+
valueAgo: z.string(),
|
|
506
|
+
}),
|
|
507
|
+
)
|
|
508
|
+
.optional(),
|
|
509
|
+
redshiftConfig: z
|
|
510
|
+
.object({
|
|
511
|
+
host: z.string(),
|
|
512
|
+
port: z.number(),
|
|
513
|
+
username: z.string(),
|
|
514
|
+
})
|
|
515
|
+
.optional(),
|
|
516
|
+
}),
|
|
517
|
+
);
|
|
518
|
+
|
|
519
|
+
type AccountViewModel = z.infer<typeof AccountViewModel>;
|
|
520
|
+
|
|
521
|
+
declare const PlantViewModel = z.object({
|
|
522
|
+
code: z.string(),
|
|
523
|
+
name: z.string(),
|
|
524
|
+
timezone: z.string(),
|
|
525
|
+
now: z.string(),
|
|
526
|
+
stationGroups: z.array(StationGroupSchema.omit({ accountId: true })),
|
|
527
|
+
dayStartHour: z.number(),
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
type PlantViewModel = z.infer<typeof PlantViewModel>;
|
|
531
|
+
|
|
532
|
+
declare const SkuViewModel = z.object({
|
|
533
|
+
code: z.string(),
|
|
534
|
+
name: z.string(),
|
|
535
|
+
cycleTime: z.number().nullish(),
|
|
536
|
+
specifications: z.object({ name: z.string(), value: z.string() }).array().nullish(),
|
|
537
|
+
instructionsUrl: z.string().nullish(),
|
|
538
|
+
lineSpeedTarget: z.number().nullish(),
|
|
539
|
+
downtimeDurationThresholdMultiplier: z.number().nullish(),
|
|
540
|
+
allowUseInQuickSchedule: z.boolean().nullish(),
|
|
541
|
+
unitsPerMinute: z.number().nullish(),
|
|
542
|
+
unitsPerHour: z.number().nullish(),
|
|
543
|
+
batchSize: z.number().nullish(),
|
|
544
|
+
value: z.number().nullish(),
|
|
545
|
+
minimumCycleTime: z.number().nullish(),
|
|
546
|
+
});
|
|
547
|
+
type SkuViewModel = z.infer<typeof SkuViewModel>;
|
|
548
|
+
|
|
549
|
+
declare const OeeViewModel = z.object({
|
|
550
|
+
scheduleMs: z.number().describe("The number of milliseconds spent on any schedule."), // production and non-production scheduled time combined.
|
|
551
|
+
scheduleLossMs: z.number().describe("The number of milliseconds lost to unscheduled time in shift."), // The amount of in shift time not schedule in either way.
|
|
552
|
+
schedulePerc: z.number().describe("The ratio of scheduled to unscheduled time."),
|
|
553
|
+
|
|
554
|
+
productionScheduleMs: z.number().describe("The number of milliseconds spent in a production schedule."), // In simplified OEE, this is shift time minus scheduled non-production time. In full OEE, this would be only scheduled production time.
|
|
555
|
+
productionScheduleLossMs: z.number().describe("The number of milliseconds lost to non-production schedules."),
|
|
556
|
+
productionSchedulePerc: z.number().describe("The ratio of production to non-production scheduled time."),
|
|
557
|
+
|
|
558
|
+
availabilityMs: z.number().describe("The number of milliseconds spent running."), // The planned production time minus stop time.
|
|
559
|
+
availabilityLossMs: z.number().describe("The number of milliseconds spend stopped."), // The amount of time the station is stopped during planned production time ()
|
|
560
|
+
availabilityPerc: z.number().describe("The ratio of running to stopped time aka OEE Availability."),
|
|
561
|
+
|
|
562
|
+
performanceMs: z
|
|
563
|
+
.number()
|
|
564
|
+
.describe("The number of milliseconds spend producing under ideal circumstances (production count * ideal cycle time)."),
|
|
565
|
+
performanceLossMs: z.number().describe("The number of milliseconds lost to under-production vs ideal cycle times."),
|
|
566
|
+
performancePerc: z.number().describe("OEE Performance."),
|
|
567
|
+
|
|
568
|
+
goodQualityCount: z.number().describe("The number of good quality units produced."),
|
|
569
|
+
goodQualityLossCount: z.number().describe("The number of bad quality units produced."),
|
|
570
|
+
goodQualityPerc: z.number().describe("The ratio of good units to bad units aka OEE Quality."),
|
|
571
|
+
|
|
572
|
+
scheduledNonProduction: z.array(OeeStop),
|
|
573
|
+
stops: z.array(OeeStop),
|
|
574
|
+
|
|
575
|
+
oee: z.number(),
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
type OeeViewModel = z.infer<typeof OeeViewModel>;
|
|
579
|
+
|
|
580
|
+
type ApiKeyViewModel = ApiKeySchema;
|
|
581
|
+
|
|
582
|
+
declare const ScheduleViewModel = z.object({
|
|
583
|
+
id: z.number(),
|
|
584
|
+
stationCode: z.string(),
|
|
585
|
+
stationName: z.string().optional(),
|
|
586
|
+
accountId: z.string(),
|
|
587
|
+
plannedStartAt: z.string(),
|
|
588
|
+
plannedStartAtTimestamp: z.number(),
|
|
589
|
+
plannedEndAt: z.string().optional(),
|
|
590
|
+
plannedEndAtTimestamp: z.number().optional(),
|
|
591
|
+
workOrderReference: z.string().optional(),
|
|
592
|
+
plannedDuration: z.number().optional(),
|
|
593
|
+
plannedQuantity: z.number().optional(),
|
|
594
|
+
nonProductionReasonCode: z.string().optional(),
|
|
595
|
+
nonProductionReasonDescription: z.string().optional(),
|
|
596
|
+
skuCode: z.string().optional(),
|
|
597
|
+
skuName: z.string().optional(),
|
|
598
|
+
skuValue: z.number().optional(),
|
|
599
|
+
batchSize: z.number().optional(),
|
|
600
|
+
autoEndOnQuantityComplete: z.boolean().optional(),
|
|
601
|
+
|
|
602
|
+
cycleTime: z.number().optional(),
|
|
603
|
+
unitsPerMinute: z.number().optional(),
|
|
604
|
+
unitsPerHour: z.number().optional(),
|
|
605
|
+
lineSpeedTarget: z.number().optional(),
|
|
606
|
+
|
|
607
|
+
effectiveCycleTime: z.number().optional(),
|
|
608
|
+
effectiveUnitsPerMinute: z.number().optional(),
|
|
609
|
+
effectiveUnitsPerHour: z.number().optional(),
|
|
610
|
+
effectiveLineSpeedTarget: z.number().optional(),
|
|
611
|
+
normalisedCycleTime: z
|
|
612
|
+
.number()
|
|
613
|
+
.optional()
|
|
614
|
+
.describe("The effective performance mode, convered back into a cycle time (aka the time in millis required to make 1 unit."),
|
|
615
|
+
effectiveBatchSize: z.number().optional(),
|
|
616
|
+
effectiveMinimumCycleTime: z.number().optional(),
|
|
617
|
+
|
|
618
|
+
remainingTime: z.number().optional(),
|
|
619
|
+
quantityIdeal: z.number().optional(),
|
|
620
|
+
quantityIdealDelta: z.number().optional(),
|
|
621
|
+
|
|
622
|
+
deletedAt: z.string().optional(),
|
|
623
|
+
actualStartAt: z.string().optional(),
|
|
624
|
+
actualStartAtTimestamp: z.number().optional(),
|
|
625
|
+
actualEndAt: z.string().optional(),
|
|
626
|
+
actualEndAtTimestamp: z.number().optional(),
|
|
627
|
+
idealEndAt: z.string().optional(),
|
|
628
|
+
idealEndAtTimestamp: z.number().optional(),
|
|
629
|
+
idealDuration: z.number().optional(),
|
|
630
|
+
quantityGood: z.number().optional(),
|
|
631
|
+
quantityBad: z.number().optional(),
|
|
632
|
+
quantityTotal: z.number().optional(),
|
|
633
|
+
skuGroupCode: z.string().optional(),
|
|
634
|
+
skuGroupName: z.string().optional(),
|
|
635
|
+
extendShift: z.boolean().optional(),
|
|
636
|
+
downtimeDurationThresholdMultiplier: z.number().optional(),
|
|
637
|
+
isStarted: z.boolean(),
|
|
638
|
+
isEnded: z.boolean(),
|
|
639
|
+
status: z.enum(["running", "planned", "deleted", "completed"]),
|
|
640
|
+
allowScheduleCutShort: z.boolean().optional(),
|
|
641
|
+
performanceModeFrom: z.enum(["schedule", "sku", "station", "none"]).optional(),
|
|
642
|
+
logs: z.array(z.string()).optional(),
|
|
643
|
+
priorityAt: z.string().optional(),
|
|
644
|
+
});
|
|
645
|
+
|
|
646
|
+
type ScheduleViewModel = z.infer<typeof ScheduleViewModel>;
|
|
647
|
+
|
|
648
|
+
declare const StationWindowViewModel = StationWindowSchema.omit({
|
|
649
|
+
skuCode: true,
|
|
650
|
+
skuGroupCode: true,
|
|
651
|
+
nonProductionReasonCode: true,
|
|
652
|
+
downtimeReasonCode: true,
|
|
653
|
+
downtimeId: true,
|
|
654
|
+
errorCode: true,
|
|
655
|
+
scheduleId: true,
|
|
656
|
+
workOrderReference: true,
|
|
657
|
+
shiftName: true,
|
|
658
|
+
})
|
|
659
|
+
.required({ isAlive: true })
|
|
660
|
+
.merge(
|
|
661
|
+
z.object({
|
|
662
|
+
stationName: z.string().describe("The name of the station."),
|
|
663
|
+
scheduleIds: z.array(z.number()).describe("The IDs of the schedules that ran.").optional(),
|
|
664
|
+
workOrderReferences: z.array(z.string()).describe("The WO refs of the schedules that ran.").optional(),
|
|
665
|
+
errorCodes: z.array(z.string()).describe("The error codes that were flagged.").optional(),
|
|
666
|
+
downtimeIds: z.array(z.number()).describe("The IDs of the downtimes that occured.").optional(),
|
|
667
|
+
downtimeReasonCodes: z.array(z.string()).describe("The reason codes of the downtimes that occured.").optional(),
|
|
668
|
+
nonProductionReasonCodes: z
|
|
669
|
+
.array(z.string())
|
|
670
|
+
.optional()
|
|
671
|
+
.describe("The reason codes for the non-production schedules that ran.")
|
|
672
|
+
.optional(),
|
|
673
|
+
windowStartAtTimestamp: z.number().describe("The start time of this window as a UNIX timestamp."),
|
|
674
|
+
windowEndAtTimestamp: z.number().describe("The end time of this window as a UNIX timestamp."),
|
|
675
|
+
isFuture: z.boolean().describe("A boolean value indicating if this is a placeholder station window for future time.").optional(),
|
|
676
|
+
skuName: z.string().describe("The name of the SKU from the current schedule.").optional(),
|
|
677
|
+
skuCodes: z.array(z.string()).describe("The code of the SKUs from the schedules that ran.").optional(),
|
|
678
|
+
shiftNames: z.array(z.string()).describe("The shift names during this time.").optional(),
|
|
679
|
+
skuGroupCodes: z.array(z.string()).describe("The code of the SKU Groups from the schedules that ran.").optional(),
|
|
680
|
+
lostProductionCostTotal: z.number().describe("The total cost of lost production output.").optional(),
|
|
681
|
+
productionTotalCount: z.number().describe("The total number of units produced, both good and bad.").optional(),
|
|
682
|
+
productionRatePerHour: z.number().describe("The average rate of production in units per hour.").optional(),
|
|
683
|
+
productionRatePerHourIdeal: z.number().describe("The ideal rate of production in units per hour.").optional(),
|
|
684
|
+
productionMs: z
|
|
685
|
+
.number()
|
|
686
|
+
.describe("The number of milliseconds of actual production achieved (production count * ideal cycle time).")
|
|
687
|
+
.optional(),
|
|
688
|
+
}),
|
|
689
|
+
);
|
|
690
|
+
|
|
691
|
+
type StationWindowViewModel = z.infer<typeof StationWindowViewModel>;
|
|
692
|
+
|
|
693
|
+
declare const StationViewModel = z.object({
|
|
694
|
+
code: z.string(), // from station table
|
|
695
|
+
name: z.string(), // from station table
|
|
696
|
+
description: z.string().nullish(),
|
|
697
|
+
groupCode: z.string().nullish(), // from station table
|
|
698
|
+
groupName: z.string().nullish(), // from join with group table
|
|
699
|
+
allowScheduleStationFlexibility: z.boolean().nullish(), // from join with group table
|
|
700
|
+
plantCode: z.string(), // from station table
|
|
701
|
+
timezone: z.string(), // from join with plant table
|
|
702
|
+
accountId: z.string(), // from station table
|
|
703
|
+
currentOperatorInitials: z.string().nullish(), // from station table
|
|
704
|
+
|
|
705
|
+
cycleTime: z.number().nullish(), // from station table
|
|
706
|
+
unitsPerMinute: z.number().nullish(),
|
|
707
|
+
unitsPerHour: z.number().nullish(),
|
|
708
|
+
lineSpeedTarget: z.number().nullish(), // from station table
|
|
709
|
+
|
|
710
|
+
allowInterruptionMode: z.boolean().nullish(),
|
|
711
|
+
allowManualProduction: z.boolean().nullish(),
|
|
712
|
+
downtimeDetectionMode: z.nativeEnum(DOWNTIME_DETECTION_MODE), // from station table
|
|
713
|
+
utilisationDowntimeThreshold: z.number().nullish(), // from station table
|
|
714
|
+
slowDurationThreshold: z.number().nullish(), // from station table
|
|
715
|
+
electricalUsageStoppedThresholdKw: z.number().nullish(), // from station table
|
|
716
|
+
allowScheduleCutShort: z.boolean().nullish(), // from station table
|
|
717
|
+
productiveStatusMode: z.nativeEnum(PRODUCTIVE_STATUS_MODE), // from station table
|
|
718
|
+
lineSpeedStoppedThreshold: z.number().nullish(), // from station table
|
|
719
|
+
shiftPatternId: z.number().nullish(), // from station table
|
|
720
|
+
productiveHoldOnTime: z.number(), // from station table
|
|
721
|
+
minimumCycleTime: z.number().nullish(), // from station table
|
|
722
|
+
statusCode: z.string().nullish(), // from station table
|
|
723
|
+
statusCodeUpdatedAt: z.string().nullish(), // from station table
|
|
724
|
+
electricalPowerNominalKw: z.number().nullish(), // from station table
|
|
725
|
+
|
|
726
|
+
shiftPattern: ShiftPatternViewModel.optional(),
|
|
727
|
+
shifts: z.array(ShiftSchema), // from join with shift table. station.shiftPatternId or if null, stationGroup.shiftPatternId
|
|
728
|
+
|
|
729
|
+
currentShift: ShiftSchema.optional(), // the shift calculated to be in now. Null if not in any shift.
|
|
730
|
+
|
|
731
|
+
currentStopReasonCode: z.string().nullish(), // The reason code for the 'stop' type issue that is ongoing for this station. unknown if no reason given. null if no ongoing 'stop' type issue.
|
|
732
|
+
stoppedSince: z.number().nullish(), // The startAt of the ongoing 'stop' type issue. null if no ongoing issue.
|
|
733
|
+
|
|
734
|
+
// TODO: Change this to stateCode. It doesn't match our API style to return the entire state object.
|
|
735
|
+
state: StationState,
|
|
736
|
+
idleCostPerMinute: z.number().nullish(),
|
|
737
|
+
moduleVisibility: z.array(z.nativeEnum(STATION_MODULE_VISIBILITY)).nullish(),
|
|
738
|
+
cachedAt: z.number().nullish(),
|
|
739
|
+
allowQuickScheduleStart: z.boolean().nullish(),
|
|
740
|
+
speedScale: z.number().nullish(),
|
|
741
|
+
speedOffset: z.number().nullish(),
|
|
742
|
+
speedToProductionRatio: z.number().nullish(),
|
|
743
|
+
|
|
744
|
+
forceAllShiftTimeAsPlannedProduction: z.boolean(), // This will cause any in shift time to be treated as planned production time for the sake of downtime detection and OEE.
|
|
745
|
+
|
|
746
|
+
lastStationWindow: StationWindowViewModel.nullish(),
|
|
747
|
+
});
|
|
748
|
+
|
|
749
|
+
type StationViewModel = z.infer<typeof StationViewModel>;
|
|
750
|
+
|
|
751
|
+
declare const ReliabilityData = z.object({
|
|
752
|
+
runningsCount: z.number(),
|
|
753
|
+
stopsCount: z.number(),
|
|
754
|
+
totalRunningTime: z.number(),
|
|
755
|
+
totalStoppedTime: z.number(),
|
|
756
|
+
});
|
|
757
|
+
|
|
758
|
+
type ReliabilityData = z.infer<typeof ReliabilityData>;
|
|
759
|
+
|
|
760
|
+
declare const StationWindowViewModelTrimmed = StationWindowViewModel.omit({
|
|
761
|
+
accountId: true,
|
|
762
|
+
createdAt: true,
|
|
763
|
+
updatedAt: true,
|
|
764
|
+
})
|
|
765
|
+
.partial({ stationCode: true, stationName: true })
|
|
766
|
+
.merge(
|
|
767
|
+
z.object({
|
|
768
|
+
//TODO: Reasons don't have name, they have descriptions. This needs to be updated.
|
|
769
|
+
nonProductionReasonNames: z.array(z.string()).optional(),
|
|
770
|
+
}),
|
|
771
|
+
);
|
|
772
|
+
|
|
773
|
+
type StationWindowViewModelTrimmed = z.infer<typeof StationWindowViewModelTrimmed>;
|
|
774
|
+
|
|
775
|
+
declare const CycleTimeAnalysis = z.object({
|
|
776
|
+
avg: z.number(),
|
|
777
|
+
min: z.number(),
|
|
778
|
+
max: z.number(),
|
|
779
|
+
quantity: z.number(),
|
|
780
|
+
default: z.number().optional(),
|
|
781
|
+
stations: z
|
|
782
|
+
.object({
|
|
783
|
+
stationCode: z.string(),
|
|
784
|
+
stationName: z.string(),
|
|
785
|
+
avg: z.number(),
|
|
786
|
+
min: z.number(),
|
|
787
|
+
max: z.number(),
|
|
788
|
+
quantity: z.number(),
|
|
789
|
+
})
|
|
790
|
+
.array(),
|
|
791
|
+
});
|
|
792
|
+
|
|
793
|
+
type CycleTimeAnalysis = z.infer<typeof CycleTimeAnalysis>;
|
|
794
|
+
|
|
795
|
+
declare const NominalValue = z.object({
|
|
796
|
+
electricalPowerNominalKw: z.number(),
|
|
797
|
+
});
|
|
798
|
+
|
|
799
|
+
type NominalValue = z.infer<typeof NominalValue>;
|
|
800
|
+
|
|
801
|
+
declare const AggregatedStationWindowsByStation = z.object({
|
|
802
|
+
stationCode: z.string(),
|
|
803
|
+
stationName: z.string(),
|
|
804
|
+
stationGroupCode: z.string(),
|
|
805
|
+
stationGroupName: z.string(),
|
|
806
|
+
windows: z.array(StationWindowViewModelTrimmed),
|
|
807
|
+
reliabilityData: ReliabilityData,
|
|
808
|
+
cycleTimeAnalysis: CycleTimeAnalysis.optional(),
|
|
809
|
+
oee: OeeViewModel,
|
|
810
|
+
nominal: NominalValue,
|
|
811
|
+
});
|
|
812
|
+
|
|
813
|
+
type AggregatedStationWindowsByStation = z.infer<typeof AggregatedStationWindowsByStation>;
|
|
814
|
+
|
|
815
|
+
export { ALERT_ISSUE_TYPE, AccountRole, AccountSchema, AccountViewModel, AggregatedStationWindowsByStation, AuthType, CursorType, CycleTimeAnalysis, DOWNTIME_DETECTION_MODE, DowntimeEventType, DowntimeFilterState, DowntimeType, EMAIL_HARNESS_TYPE, GROUP_TAG_PREFIX, MessageType, MqttEventType, NOTIFICATION_PREFERENCE, NominalValue, OeeViewModel, PERFORMANCE_MODE_TYPE, PRODUCTION_TYPE, PRODUCTIVE_STATUS_MODE, PlantViewModel, REASON_TYPE, RagStatus, ReliabilityData, SCHEDULE_TYPE, STATION_MODULE_VISIBILITY, ScheduleViewModel, SkuViewModel, StationSchema, StationStatus, StationViewModel, StationWindowSchema, StationWindowViewModel, StationWindowViewModelTrimmed, TIMESERIES_MESSAGE_TYPE, UserRole, WeekDay };
|
|
816
|
+
export type { ApiKeyViewModel, BusrootSignals, PlantSchema };
|