busroot-sdk 0.0.8-dev.2705647560 → 0.0.8-dev.2705659883
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/index.d.ts +5 -0
- package/build/index.js +11 -6
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -3038,6 +3038,7 @@ declare class BusrootClient {
|
|
|
3038
3038
|
effectiveCycleTime?: number | null | undefined;
|
|
3039
3039
|
scheduleId?: number | null | undefined;
|
|
3040
3040
|
operatorInitials?: string | null | undefined;
|
|
3041
|
+
badReasonCode?: string | null | undefined;
|
|
3041
3042
|
skuValue?: number | null | undefined;
|
|
3042
3043
|
}[]>;
|
|
3043
3044
|
"production.getEntries": (args_0: {
|
|
@@ -3060,6 +3061,7 @@ declare class BusrootClient {
|
|
|
3060
3061
|
effectiveCycleTime?: number | null | undefined;
|
|
3061
3062
|
scheduleId?: number | null | undefined;
|
|
3062
3063
|
operatorInitials?: string | null | undefined;
|
|
3064
|
+
badReasonCode?: string | null | undefined;
|
|
3063
3065
|
skuValue?: number | null | undefined;
|
|
3064
3066
|
}[]>;
|
|
3065
3067
|
"metrics.get": (args_0: {
|
|
@@ -3592,6 +3594,7 @@ declare const BusrootSignalsPayload: z.ZodObject<{
|
|
|
3592
3594
|
production_count: z.ZodOptional<z.ZodNumber>;
|
|
3593
3595
|
production_count_bad: z.ZodOptional<z.ZodNumber>;
|
|
3594
3596
|
bad_production_count: z.ZodOptional<z.ZodNumber>;
|
|
3597
|
+
bad_production_reason: z.ZodOptional<z.ZodString>;
|
|
3595
3598
|
productive: z.ZodOptional<z.ZodNumber>;
|
|
3596
3599
|
line_speed: z.ZodOptional<z.ZodNumber>;
|
|
3597
3600
|
speed: z.ZodOptional<z.ZodNumber>;
|
|
@@ -3616,6 +3619,7 @@ declare const BusrootSignalsPayload: z.ZodObject<{
|
|
|
3616
3619
|
production_count?: number | undefined;
|
|
3617
3620
|
production_count_bad?: number | undefined;
|
|
3618
3621
|
bad_production_count?: number | undefined;
|
|
3622
|
+
bad_production_reason?: string | undefined;
|
|
3619
3623
|
productive?: number | undefined;
|
|
3620
3624
|
status_code?: string | undefined;
|
|
3621
3625
|
electrical_kwh?: number | undefined;
|
|
@@ -3638,6 +3642,7 @@ declare const BusrootSignalsPayload: z.ZodObject<{
|
|
|
3638
3642
|
production_count?: number | undefined;
|
|
3639
3643
|
production_count_bad?: number | undefined;
|
|
3640
3644
|
bad_production_count?: number | undefined;
|
|
3645
|
+
bad_production_reason?: string | undefined;
|
|
3641
3646
|
productive?: number | undefined;
|
|
3642
3647
|
status_code?: string | undefined;
|
|
3643
3648
|
electrical_kwh?: number | undefined;
|
package/build/index.js
CHANGED
|
@@ -478,6 +478,7 @@ var require_enums = __commonJS({
|
|
|
478
478
|
(function(REASON_TYPE2) {
|
|
479
479
|
REASON_TYPE2["downtime"] = "downtime";
|
|
480
480
|
REASON_TYPE2["non_production"] = "non-production";
|
|
481
|
+
REASON_TYPE2["quality"] = "quality";
|
|
481
482
|
})(REASON_TYPE || (exports2.REASON_TYPE = REASON_TYPE = {}));
|
|
482
483
|
exports2.MqttEventType = {
|
|
483
484
|
StationMetricNew: "STATION_METRIC_NEW",
|
|
@@ -1835,12 +1836,12 @@ var require_base_reason = __commonJS({
|
|
|
1835
1836
|
exports2.BaseReasonSchema = zod_1.z.object({
|
|
1836
1837
|
code: exports2.ReasonCodeSchema,
|
|
1837
1838
|
description: zod_1.z.string().describe("Human-readable description of this reason (e.g., 'Planned maintenance', 'Equipment breakdown', 'Material shortage')"),
|
|
1838
|
-
type: zod_1.z.array(zod_1.z.nativeEnum(enums_1.REASON_TYPE)).min(1).describe("Array of reason types this code applies to. Options: 'downtime' (for unplanned stoppages), 'non-production' (for planned activities). A reason can have multiple types. Example: ['downtime'], ['non-production'], ['downtime', 'non-production']")
|
|
1839
|
+
type: zod_1.z.array(zod_1.z.nativeEnum(enums_1.REASON_TYPE)).min(1).describe("Array of reason types this code applies to. Options: 'downtime' (for unplanned stoppages), 'non-production' (for planned activities), 'quality' (for bad/rejected production). A reason can have multiple types. Example: ['downtime'], ['non-production'], ['downtime', 'non-production']")
|
|
1839
1840
|
}).strict();
|
|
1840
1841
|
exports2.ManifestReasonSchema = zod_1.z.object({
|
|
1841
1842
|
code: zod_1.z.string().describe("Unique reason code used to reference this reason (e.g., 'MAINTENANCE', 'BREAKDOWN', 'PLANNED-PM'). Must be unique within the account."),
|
|
1842
1843
|
description: zod_1.z.string().describe("Human-readable description of this reason (e.g., 'Planned maintenance', 'Equipment breakdown', 'Material shortage')"),
|
|
1843
|
-
type: zod_1.z.array(zod_1.z.nativeEnum(enums_1.REASON_TYPE)).min(1).describe("Array of reason types this code applies to. Options: 'downtime' (for unplanned stoppages), 'non-production' (for planned activities). A reason can have multiple types. Example: ['downtime'], ['non-production'], ['downtime', 'non-production']"),
|
|
1844
|
+
type: zod_1.z.array(zod_1.z.nativeEnum(enums_1.REASON_TYPE)).min(1).describe("Array of reason types this code applies to. Options: 'downtime' (for unplanned stoppages), 'non-production' (for planned activities), 'quality' (for bad/rejected production). A reason can have multiple types. Example: ['downtime'], ['non-production'], ['downtime', 'non-production']"),
|
|
1844
1845
|
reasons: zod_1.z.lazy(() => zod_1.z.array(exports2.ManifestReasonSchema)).optional().describe("Optional array of child reasons that are subcategories of this reason. Used to create hierarchical reason structures (e.g., 'Maintenance' \u2192 'Preventive Maintenance' \u2192 'PM Check').")
|
|
1845
1846
|
}).strict().openapi({ ref: "ManifestReason" });
|
|
1846
1847
|
}
|
|
@@ -2247,6 +2248,7 @@ var require_shared = __commonJS({
|
|
|
2247
2248
|
production_count: zod_1.z.number().optional().describe("Alias for production_count_good."),
|
|
2248
2249
|
production_count_bad: zod_1.z.number().optional().describe("The cumulative number of bad production cycles complete."),
|
|
2249
2250
|
bad_production_count: zod_1.z.number().optional().describe("Alias for production_count_bad."),
|
|
2251
|
+
bad_production_reason: zod_1.z.string().optional().describe("Quality reason code for the bad production reported in this message. Must match a reason code of type 'quality' configured on the account; unknown or missing codes are recorded as bad production with no reason."),
|
|
2250
2252
|
productive: zod_1.z.number().optional().describe("An indication that this station is productive. Any number greater than 0 is considered true."),
|
|
2251
2253
|
line_speed: zod_1.z.number().optional().describe("A number indicating the speed of the station. No units are assumed, so could be percentage or speed such as m/s."),
|
|
2252
2254
|
speed: zod_1.z.number().optional().describe("Alias for line_speed."),
|
|
@@ -6098,7 +6100,8 @@ var require_production2 = __commonJS({
|
|
|
6098
6100
|
quantityBad: zod_1.z.number().int().optional(),
|
|
6099
6101
|
lastUnitAt: zod_1.z.string().datetime().optional(),
|
|
6100
6102
|
lastUnitAtTimestamp: zod_1.z.number().int().gte(0).optional(),
|
|
6101
|
-
operatorInitials: zod_1.z.string().trim().min(1).optional()
|
|
6103
|
+
operatorInitials: zod_1.z.string().trim().min(1).optional(),
|
|
6104
|
+
badReasonCode: schemas_1.ReasonCodeSchema.optional()
|
|
6102
6105
|
});
|
|
6103
6106
|
exports2.ProductionManualPostRequest = ProductionSchema.omit({ id: true });
|
|
6104
6107
|
exports2.ProductionAggregateWindowGetRequest = zod_1.z.object({
|
|
@@ -7799,7 +7802,7 @@ var require_production3 = __commonJS({
|
|
|
7799
7802
|
var enums_1 = require_enums();
|
|
7800
7803
|
var time_1 = require_time();
|
|
7801
7804
|
var _1 = require_utils();
|
|
7802
|
-
function processProduction(accountId, stationCode, schedule, timestamp, quantityGood = 0, quantityBad = 0, type, existedProduction) {
|
|
7805
|
+
function processProduction(accountId, stationCode, schedule, timestamp, quantityGood = 0, quantityBad = 0, type, existedProduction, badReasonCode) {
|
|
7803
7806
|
const nowIso = (0, moment_timezone_1.default)().toISOString();
|
|
7804
7807
|
const momentIsoString = (0, moment_timezone_1.default)(timestamp).toISOString();
|
|
7805
7808
|
let partsPerCycle = 1;
|
|
@@ -7820,7 +7823,8 @@ var require_production3 = __commonJS({
|
|
|
7820
7823
|
type,
|
|
7821
7824
|
createdAt: nowIso,
|
|
7822
7825
|
updatedAt: nowIso,
|
|
7823
|
-
partsPerCycle
|
|
7826
|
+
partsPerCycle,
|
|
7827
|
+
badReasonCode: badReasonCode ?? null
|
|
7824
7828
|
}
|
|
7825
7829
|
];
|
|
7826
7830
|
return productions;
|
|
@@ -8744,7 +8748,8 @@ var require_production4 = __commonJS({
|
|
|
8744
8748
|
lastUnitAtTimestamp: zod_1.z.number(),
|
|
8745
8749
|
operatorInitials: zod_1.z.string().nullish(),
|
|
8746
8750
|
type: zod_1.z.nativeEnum(enums_1.PRODUCTION_TYPE).nullish(),
|
|
8747
|
-
partsPerCycle: zod_1.z.number().nullish()
|
|
8751
|
+
partsPerCycle: zod_1.z.number().nullish(),
|
|
8752
|
+
badReasonCode: zod_1.z.string().nullish()
|
|
8748
8753
|
});
|
|
8749
8754
|
exports2.ProductionAggregateWindowViewModel = zod_1.z.object({
|
|
8750
8755
|
windowStart: zod_1.z.string(),
|
package/package.json
CHANGED