busroot-sdk 0.0.7-alpha.6 → 0.0.7-alpha.9
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 +337 -39
- package/build/index.js +343 -122
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -3410,6 +3410,35 @@ declare const ProductionViewModel: z.ZodObject<{
|
|
|
3410
3410
|
skuValue?: number | undefined;
|
|
3411
3411
|
}>;
|
|
3412
3412
|
export type ProductionViewModel = z.infer<typeof ProductionViewModel>;
|
|
3413
|
+
declare const AgentPostResponse: z.ZodObject<{
|
|
3414
|
+
message: z.ZodString;
|
|
3415
|
+
actions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
3416
|
+
name: z.ZodString;
|
|
3417
|
+
params: z.ZodString;
|
|
3418
|
+
}, "strip", z.ZodTypeAny, {
|
|
3419
|
+
params: string;
|
|
3420
|
+
name: string;
|
|
3421
|
+
}, {
|
|
3422
|
+
params: string;
|
|
3423
|
+
name: string;
|
|
3424
|
+
}>, "many">>;
|
|
3425
|
+
debugMessage: z.ZodOptional<z.ZodString>;
|
|
3426
|
+
}, "strip", z.ZodTypeAny, {
|
|
3427
|
+
message: string;
|
|
3428
|
+
actions?: {
|
|
3429
|
+
params: string;
|
|
3430
|
+
name: string;
|
|
3431
|
+
}[] | undefined;
|
|
3432
|
+
debugMessage?: string | undefined;
|
|
3433
|
+
}, {
|
|
3434
|
+
message: string;
|
|
3435
|
+
actions?: {
|
|
3436
|
+
params: string;
|
|
3437
|
+
name: string;
|
|
3438
|
+
}[] | undefined;
|
|
3439
|
+
debugMessage?: string | undefined;
|
|
3440
|
+
}>;
|
|
3441
|
+
type AgentPostResponse = z.infer<typeof AgentPostResponse>;
|
|
3413
3442
|
declare const SUPPORTED_DURATION: readonly [
|
|
3414
3443
|
"months",
|
|
3415
3444
|
"days",
|
|
@@ -3740,6 +3769,284 @@ export type ScheduleViewModel = z.infer<typeof ScheduleViewModel>;
|
|
|
3740
3769
|
export interface BusrootSignals extends BusrootSignalsPayload {
|
|
3741
3770
|
sku_code?: string;
|
|
3742
3771
|
}
|
|
3772
|
+
export interface OverviewProductionAmounts {
|
|
3773
|
+
idealQuantityTotal: number;
|
|
3774
|
+
idealQuantityGood: number;
|
|
3775
|
+
idealQuantityBad: number;
|
|
3776
|
+
actualQuantityTotal: number;
|
|
3777
|
+
actualQuantityGood: number;
|
|
3778
|
+
actualQuantityBad: number;
|
|
3779
|
+
idealValueTotal: number;
|
|
3780
|
+
idealValueGood: number;
|
|
3781
|
+
idealValueBad: number;
|
|
3782
|
+
actualValueTotal: number;
|
|
3783
|
+
actualValueGood: number;
|
|
3784
|
+
actualValueBad: number;
|
|
3785
|
+
}
|
|
3786
|
+
export interface OverviewMetrics {
|
|
3787
|
+
schedule: {
|
|
3788
|
+
inShiftDurationMs: number;
|
|
3789
|
+
scheduledProductionDurationMs: number;
|
|
3790
|
+
scheduledNonProductionDurationMs: number;
|
|
3791
|
+
unscheduledDurationMs: number;
|
|
3792
|
+
scheduledNonProductionByReason: {
|
|
3793
|
+
reasonCode: string;
|
|
3794
|
+
durationMs: number;
|
|
3795
|
+
}[];
|
|
3796
|
+
};
|
|
3797
|
+
production: {
|
|
3798
|
+
amounts: OverviewProductionAmounts;
|
|
3799
|
+
byHour: {
|
|
3800
|
+
startHour: string;
|
|
3801
|
+
amounts: OverviewProductionAmounts;
|
|
3802
|
+
}[];
|
|
3803
|
+
bySku: {
|
|
3804
|
+
skuCode: string;
|
|
3805
|
+
amounts: OverviewProductionAmounts;
|
|
3806
|
+
}[];
|
|
3807
|
+
byWoRefAndSku: {
|
|
3808
|
+
woRef: string;
|
|
3809
|
+
scheduledDurationMs: number;
|
|
3810
|
+
amounts: OverviewProductionAmounts;
|
|
3811
|
+
skus: {
|
|
3812
|
+
skuCode: string;
|
|
3813
|
+
scheduledDurationMs: number;
|
|
3814
|
+
amounts: OverviewProductionAmounts;
|
|
3815
|
+
}[];
|
|
3816
|
+
}[];
|
|
3817
|
+
};
|
|
3818
|
+
downtime: {
|
|
3819
|
+
totalDurationMs: number;
|
|
3820
|
+
byReason: {
|
|
3821
|
+
reasonCode: string;
|
|
3822
|
+
durationMs: number;
|
|
3823
|
+
}[];
|
|
3824
|
+
};
|
|
3825
|
+
utilisation: {
|
|
3826
|
+
productiveDurationMs: number;
|
|
3827
|
+
inShiftProductiveDurationMs: number;
|
|
3828
|
+
inScheduleProductiveDurationMs: number;
|
|
3829
|
+
};
|
|
3830
|
+
}
|
|
3831
|
+
export interface OverviewViewModel extends OverviewMetrics {
|
|
3832
|
+
range: {
|
|
3833
|
+
rangeCode: string;
|
|
3834
|
+
duration: number;
|
|
3835
|
+
fromIso: string;
|
|
3836
|
+
toIso: string;
|
|
3837
|
+
};
|
|
3838
|
+
stations: ({
|
|
3839
|
+
code: string;
|
|
3840
|
+
name: string;
|
|
3841
|
+
} & OverviewMetrics)[];
|
|
3842
|
+
}
|
|
3843
|
+
declare const PlantGetParams: z.ZodObject<{
|
|
3844
|
+
plantCode: z.ZodString;
|
|
3845
|
+
}, "strip", z.ZodTypeAny, {
|
|
3846
|
+
plantCode: string;
|
|
3847
|
+
}, {
|
|
3848
|
+
plantCode: string;
|
|
3849
|
+
}>;
|
|
3850
|
+
declare const PlantCreateUpdateParams: z.ZodObject<{
|
|
3851
|
+
code: z.ZodString;
|
|
3852
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3853
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
3854
|
+
dayStartHour: z.ZodOptional<z.ZodNumber>;
|
|
3855
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
3856
|
+
code: z.ZodString;
|
|
3857
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3858
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
3859
|
+
dayStartHour: z.ZodOptional<z.ZodNumber>;
|
|
3860
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
3861
|
+
code: z.ZodString;
|
|
3862
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3863
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
3864
|
+
dayStartHour: z.ZodOptional<z.ZodNumber>;
|
|
3865
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
3866
|
+
declare const StationGetParams: z.ZodObject<{
|
|
3867
|
+
stationCode: z.ZodString;
|
|
3868
|
+
}, "strip", z.ZodTypeAny, {
|
|
3869
|
+
stationCode: string;
|
|
3870
|
+
}, {
|
|
3871
|
+
stationCode: string;
|
|
3872
|
+
}>;
|
|
3873
|
+
declare const StationCreateUpdateParams: z.ZodObject<{
|
|
3874
|
+
code: z.ZodString;
|
|
3875
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3876
|
+
groupCode: z.ZodOptional<z.ZodString>;
|
|
3877
|
+
shiftPatternId: z.ZodOptional<z.ZodNumber>;
|
|
3878
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
3879
|
+
code: z.ZodString;
|
|
3880
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3881
|
+
groupCode: z.ZodOptional<z.ZodString>;
|
|
3882
|
+
shiftPatternId: z.ZodOptional<z.ZodNumber>;
|
|
3883
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
3884
|
+
code: z.ZodString;
|
|
3885
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3886
|
+
groupCode: z.ZodOptional<z.ZodString>;
|
|
3887
|
+
shiftPatternId: z.ZodOptional<z.ZodNumber>;
|
|
3888
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
3889
|
+
declare const StationSignalParams: z.ZodObject<{
|
|
3890
|
+
stationCode: z.ZodString;
|
|
3891
|
+
payload: z.ZodObject<{}, "passthrough", z.ZodTypeAny, z.objectOutputType<{}, z.ZodTypeAny, "passthrough">, z.objectInputType<{}, z.ZodTypeAny, "passthrough">>;
|
|
3892
|
+
}, "strip", z.ZodTypeAny, {
|
|
3893
|
+
stationCode: string;
|
|
3894
|
+
payload: {} & {
|
|
3895
|
+
[k: string]: unknown;
|
|
3896
|
+
};
|
|
3897
|
+
}, {
|
|
3898
|
+
stationCode: string;
|
|
3899
|
+
payload: {} & {
|
|
3900
|
+
[k: string]: unknown;
|
|
3901
|
+
};
|
|
3902
|
+
}>;
|
|
3903
|
+
declare const ProductionGetParams: z.ZodObject<{
|
|
3904
|
+
plantCode: z.ZodString;
|
|
3905
|
+
stationCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3906
|
+
rangeCode: z.ZodString;
|
|
3907
|
+
}, "strip", z.ZodTypeAny, {
|
|
3908
|
+
plantCode: string;
|
|
3909
|
+
rangeCode: string;
|
|
3910
|
+
stationCodes?: string[] | undefined;
|
|
3911
|
+
}, {
|
|
3912
|
+
plantCode: string;
|
|
3913
|
+
rangeCode: string;
|
|
3914
|
+
stationCodes?: string[] | undefined;
|
|
3915
|
+
}>;
|
|
3916
|
+
declare const ProductionGetRawParams: z.ZodObject<{
|
|
3917
|
+
plantCode: z.ZodString;
|
|
3918
|
+
stationCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3919
|
+
rangeCode: z.ZodString;
|
|
3920
|
+
}, "strip", z.ZodTypeAny, {
|
|
3921
|
+
plantCode: string;
|
|
3922
|
+
rangeCode: string;
|
|
3923
|
+
stationCodes?: string[] | undefined;
|
|
3924
|
+
}, {
|
|
3925
|
+
plantCode: string;
|
|
3926
|
+
rangeCode: string;
|
|
3927
|
+
stationCodes?: string[] | undefined;
|
|
3928
|
+
}>;
|
|
3929
|
+
declare const MetricsGetParams: z.ZodObject<{
|
|
3930
|
+
plantCode: z.ZodString;
|
|
3931
|
+
stationCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3932
|
+
rangeCode: z.ZodString;
|
|
3933
|
+
aggregateWindow: z.ZodString;
|
|
3934
|
+
}, "strip", z.ZodTypeAny, {
|
|
3935
|
+
plantCode: string;
|
|
3936
|
+
rangeCode: string;
|
|
3937
|
+
aggregateWindow: string;
|
|
3938
|
+
stationCodes?: string[] | undefined;
|
|
3939
|
+
}, {
|
|
3940
|
+
plantCode: string;
|
|
3941
|
+
rangeCode: string;
|
|
3942
|
+
aggregateWindow: string;
|
|
3943
|
+
stationCodes?: string[] | undefined;
|
|
3944
|
+
}>;
|
|
3945
|
+
declare const DowntimeGetParams: z.ZodObject<{
|
|
3946
|
+
plantCode: z.ZodString;
|
|
3947
|
+
stationCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
3948
|
+
rangeCode: z.ZodString;
|
|
3949
|
+
}, "strip", z.ZodTypeAny, {
|
|
3950
|
+
plantCode: string;
|
|
3951
|
+
rangeCode: string;
|
|
3952
|
+
stationCodes?: string[] | undefined;
|
|
3953
|
+
}, {
|
|
3954
|
+
plantCode: string;
|
|
3955
|
+
rangeCode: string;
|
|
3956
|
+
stationCodes?: string[] | undefined;
|
|
3957
|
+
}>;
|
|
3958
|
+
declare const OverviewGetParams: z.ZodObject<{
|
|
3959
|
+
plantCode: z.ZodString;
|
|
3960
|
+
rangeCode: z.ZodString;
|
|
3961
|
+
rangeFrom: z.ZodOptional<z.ZodString>;
|
|
3962
|
+
rangeTo: z.ZodOptional<z.ZodString>;
|
|
3963
|
+
}, "strip", z.ZodTypeAny, {
|
|
3964
|
+
plantCode: string;
|
|
3965
|
+
rangeCode: string;
|
|
3966
|
+
rangeFrom?: string | undefined;
|
|
3967
|
+
rangeTo?: string | undefined;
|
|
3968
|
+
}, {
|
|
3969
|
+
plantCode: string;
|
|
3970
|
+
rangeCode: string;
|
|
3971
|
+
rangeFrom?: string | undefined;
|
|
3972
|
+
rangeTo?: string | undefined;
|
|
3973
|
+
}>;
|
|
3974
|
+
declare const SkuGetParams: z.ZodObject<{
|
|
3975
|
+
skuCode: z.ZodString;
|
|
3976
|
+
}, "strip", z.ZodTypeAny, {
|
|
3977
|
+
skuCode: string;
|
|
3978
|
+
}, {
|
|
3979
|
+
skuCode: string;
|
|
3980
|
+
}>;
|
|
3981
|
+
declare const SkuCreateUpdateParams: z.ZodObject<{
|
|
3982
|
+
code: z.ZodString;
|
|
3983
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3984
|
+
cycleTime: z.ZodOptional<z.ZodNumber>;
|
|
3985
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
3986
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
3987
|
+
code: z.ZodString;
|
|
3988
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3989
|
+
cycleTime: z.ZodOptional<z.ZodNumber>;
|
|
3990
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
3991
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
3992
|
+
code: z.ZodString;
|
|
3993
|
+
name: z.ZodOptional<z.ZodString>;
|
|
3994
|
+
cycleTime: z.ZodOptional<z.ZodNumber>;
|
|
3995
|
+
value: z.ZodOptional<z.ZodNumber>;
|
|
3996
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
3997
|
+
declare const ScheduleGetParams: z.ZodObject<{
|
|
3998
|
+
scheduleId: z.ZodNumber;
|
|
3999
|
+
}, "strip", z.ZodTypeAny, {
|
|
4000
|
+
scheduleId: number;
|
|
4001
|
+
}, {
|
|
4002
|
+
scheduleId: number;
|
|
4003
|
+
}>;
|
|
4004
|
+
declare const ScheduleCreateUpdateParams: z.ZodObject<{
|
|
4005
|
+
stationCode: z.ZodOptional<z.ZodString>;
|
|
4006
|
+
skuCode: z.ZodOptional<z.ZodString>;
|
|
4007
|
+
plannedStartAt: z.ZodOptional<z.ZodString>;
|
|
4008
|
+
plannedQuantity: z.ZodOptional<z.ZodNumber>;
|
|
4009
|
+
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
4010
|
+
stationCode: z.ZodOptional<z.ZodString>;
|
|
4011
|
+
skuCode: z.ZodOptional<z.ZodString>;
|
|
4012
|
+
plannedStartAt: z.ZodOptional<z.ZodString>;
|
|
4013
|
+
plannedQuantity: z.ZodOptional<z.ZodNumber>;
|
|
4014
|
+
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
4015
|
+
stationCode: z.ZodOptional<z.ZodString>;
|
|
4016
|
+
skuCode: z.ZodOptional<z.ZodString>;
|
|
4017
|
+
plannedStartAt: z.ZodOptional<z.ZodString>;
|
|
4018
|
+
plannedQuantity: z.ZodOptional<z.ZodNumber>;
|
|
4019
|
+
}, z.ZodTypeAny, "passthrough">>;
|
|
4020
|
+
declare const AccountCreateParams: z.ZodObject<{
|
|
4021
|
+
domain: z.ZodString;
|
|
4022
|
+
plantName: z.ZodString;
|
|
4023
|
+
}, "strip", z.ZodTypeAny, {
|
|
4024
|
+
domain: string;
|
|
4025
|
+
plantName: string;
|
|
4026
|
+
}, {
|
|
4027
|
+
domain: string;
|
|
4028
|
+
plantName: string;
|
|
4029
|
+
}>;
|
|
4030
|
+
declare const AgentRequestParams: z.ZodObject<{
|
|
4031
|
+
message: z.ZodString;
|
|
4032
|
+
}, "strip", z.ZodTypeAny, {
|
|
4033
|
+
message: string;
|
|
4034
|
+
}, {
|
|
4035
|
+
message: string;
|
|
4036
|
+
}>;
|
|
4037
|
+
export interface ParamDescriptor {
|
|
4038
|
+
name: string;
|
|
4039
|
+
required: boolean;
|
|
4040
|
+
description: string;
|
|
4041
|
+
type: string;
|
|
4042
|
+
}
|
|
4043
|
+
export interface CapabilityDescriptor {
|
|
4044
|
+
name: string;
|
|
4045
|
+
description: string;
|
|
4046
|
+
method: "GET" | "POST";
|
|
4047
|
+
params: ParamDescriptor[];
|
|
4048
|
+
}
|
|
4049
|
+
export declare function describeCapabilities(): CapabilityDescriptor[];
|
|
3743
4050
|
export declare const MqttEventType: {
|
|
3744
4051
|
StationMetricNew: string;
|
|
3745
4052
|
StationChanged: string;
|
|
@@ -3778,65 +4085,55 @@ export declare class BusrootClient {
|
|
|
3778
4085
|
mqttClient: mqtt.MqttClient | undefined;
|
|
3779
4086
|
listenersByEventType: Map<"StationMetricNew" | "StationChanged" | "ScheduleChanged" | "ScheduleStarted" | "ScheduleEnded" | "ProductionNew", Set<Listener>>;
|
|
3780
4087
|
static version: string;
|
|
4088
|
+
static describe: typeof describeCapabilities;
|
|
3781
4089
|
constructor(config: Config);
|
|
3782
4090
|
destroy(): void;
|
|
3783
4091
|
private get;
|
|
3784
4092
|
private post;
|
|
3785
|
-
|
|
4093
|
+
profile: {
|
|
3786
4094
|
get: () => Promise<any>;
|
|
3787
4095
|
};
|
|
3788
|
-
|
|
3789
|
-
create: (domain
|
|
4096
|
+
account: {
|
|
4097
|
+
create: ({ domain, plantName }: z.infer<typeof AccountCreateParams>) => Promise<{
|
|
3790
4098
|
account: AccountViewModel;
|
|
3791
4099
|
apiKey: string;
|
|
3792
4100
|
}>;
|
|
3793
4101
|
};
|
|
3794
|
-
|
|
4102
|
+
apiKey: {
|
|
3795
4103
|
create: () => Promise<ApiKeySchema>;
|
|
3796
4104
|
};
|
|
3797
|
-
|
|
3798
|
-
get: (plantCode:
|
|
3799
|
-
createUpdate: (plant:
|
|
4105
|
+
plant: {
|
|
4106
|
+
get: ({ plantCode }: z.infer<typeof PlantGetParams>) => Promise<PlantViewModel>;
|
|
4107
|
+
createUpdate: (plant: z.infer<typeof PlantCreateUpdateParams>) => Promise<PlantViewModel>;
|
|
4108
|
+
};
|
|
4109
|
+
station: {
|
|
4110
|
+
get: ({ stationCode }: z.infer<typeof StationGetParams>) => Promise<StationViewModel[]>;
|
|
4111
|
+
createUpdate: (station: z.infer<typeof StationCreateUpdateParams>) => Promise<StationViewModel>;
|
|
4112
|
+
signal: (_params: z.infer<typeof StationSignalParams>) => void;
|
|
3800
4113
|
};
|
|
3801
|
-
|
|
3802
|
-
get: (
|
|
3803
|
-
|
|
3804
|
-
signal: (stationCode: string, payload: BusrootSignals) => void;
|
|
4114
|
+
production: {
|
|
4115
|
+
get: ({ plantCode, stationCodes, rangeCode }: z.infer<typeof ProductionGetParams>) => Promise<ProductionViewModel[]>;
|
|
4116
|
+
getRaw: ({ plantCode, stationCodes, rangeCode }: z.infer<typeof ProductionGetRawParams>) => Promise<ProductionViewModel[]>;
|
|
3805
4117
|
};
|
|
3806
|
-
|
|
3807
|
-
get: ({ plantCode, stationCodes, rangeCode, }:
|
|
3808
|
-
plantCode: string;
|
|
3809
|
-
stationCodes?: string[];
|
|
3810
|
-
rangeCode: string;
|
|
3811
|
-
}) => Promise<ProductionViewModel[]>;
|
|
3812
|
-
getRaw: ({ plantCode, stationCodes, rangeCode, }: {
|
|
3813
|
-
plantCode: string;
|
|
3814
|
-
stationCodes?: string[];
|
|
3815
|
-
rangeCode: string;
|
|
3816
|
-
}) => Promise<ProductionViewModel[]>;
|
|
4118
|
+
metrics: {
|
|
4119
|
+
get: ({ plantCode, stationCodes, rangeCode, aggregateWindow, }: z.infer<typeof MetricsGetParams>) => Promise<AggregatedStationWindowsByStation[]>;
|
|
3817
4120
|
};
|
|
3818
|
-
|
|
3819
|
-
get: ({ plantCode, stationCodes, rangeCode
|
|
3820
|
-
plantCode: string;
|
|
3821
|
-
stationCodes?: string[];
|
|
3822
|
-
rangeCode: string;
|
|
3823
|
-
aggregateWindow: string;
|
|
3824
|
-
}) => Promise<AggregatedStationWindowsByStation[]>;
|
|
4121
|
+
downtime: {
|
|
4122
|
+
get: ({ plantCode, stationCodes, rangeCode }: z.infer<typeof DowntimeGetParams>) => Promise<AggregatedDowntime[]>;
|
|
3825
4123
|
};
|
|
3826
|
-
|
|
3827
|
-
get: ({ plantCode,
|
|
3828
|
-
plantCode: string;
|
|
3829
|
-
stationCodes?: string[];
|
|
3830
|
-
rangeCode: string;
|
|
3831
|
-
}) => Promise<AggregatedDowntime[]>;
|
|
4124
|
+
overview: {
|
|
4125
|
+
get: ({ plantCode, rangeCode, rangeFrom, rangeTo }: z.infer<typeof OverviewGetParams>) => Promise<OverviewViewModel>;
|
|
3832
4126
|
};
|
|
3833
4127
|
sku: {
|
|
3834
|
-
get: (skuCode:
|
|
3835
|
-
createUpdate: (sku:
|
|
4128
|
+
get: ({ skuCode }: z.infer<typeof SkuGetParams>) => Promise<SkuViewModel>;
|
|
4129
|
+
createUpdate: (sku: z.infer<typeof SkuCreateUpdateParams>) => Promise<SkuViewModel>;
|
|
4130
|
+
};
|
|
4131
|
+
agent: {
|
|
4132
|
+
request: ({ message }: z.infer<typeof AgentRequestParams>) => Promise<AgentPostResponse>;
|
|
3836
4133
|
};
|
|
3837
4134
|
schedule: {
|
|
3838
|
-
get: (scheduleId:
|
|
3839
|
-
createUpdate: (schedule:
|
|
4135
|
+
get: ({ scheduleId }: z.infer<typeof ScheduleGetParams>) => Promise<ScheduleViewModel[]>;
|
|
4136
|
+
createUpdate: (schedule: z.infer<typeof ScheduleCreateUpdateParams>) => Promise<ScheduleViewModel>;
|
|
3840
4137
|
};
|
|
3841
4138
|
on(event: MqttEventType, listener: Listener): void;
|
|
3842
4139
|
off(event: MqttEventType, listener: Listener): void;
|
|
@@ -3849,6 +4146,7 @@ export declare function useBusroot(props?: {
|
|
|
3849
4146
|
};
|
|
3850
4147
|
|
|
3851
4148
|
export {
|
|
4149
|
+
AgentPostResponse as AgentResponse,
|
|
3852
4150
|
ApiKeySchema as ApiKeyViewModel,
|
|
3853
4151
|
};
|
|
3854
4152
|
|
package/build/index.js
CHANGED
|
@@ -1096,6 +1096,7 @@ __export(index_exports, {
|
|
|
1096
1096
|
BusrootClient: () => BusrootClient,
|
|
1097
1097
|
Config: () => Config,
|
|
1098
1098
|
MqttEventType: () => MqttEventType,
|
|
1099
|
+
describeCapabilities: () => describeCapabilities,
|
|
1099
1100
|
formattedDateTime: () => import_times.formattedDateTime,
|
|
1100
1101
|
formattedDuration: () => import_times.formattedDuration,
|
|
1101
1102
|
useBusroot: () => useBusroot
|
|
@@ -1103,7 +1104,236 @@ __export(index_exports, {
|
|
|
1103
1104
|
module.exports = __toCommonJS(index_exports);
|
|
1104
1105
|
|
|
1105
1106
|
// src/client.ts
|
|
1107
|
+
var import_zod2 = require("zod");
|
|
1108
|
+
|
|
1109
|
+
// src/capabilities.ts
|
|
1106
1110
|
var import_zod = require("zod");
|
|
1111
|
+
var PlantGetParams = import_zod.z.object({
|
|
1112
|
+
plantCode: import_zod.z.string().describe("Unique plant identifier code")
|
|
1113
|
+
});
|
|
1114
|
+
var PlantCreateUpdateParams = import_zod.z.object({
|
|
1115
|
+
code: import_zod.z.string().describe("Unique plant identifier code"),
|
|
1116
|
+
name: import_zod.z.string().optional().describe("Display name for the plant"),
|
|
1117
|
+
timezone: import_zod.z.string().optional().describe("IANA timezone (e.g. Europe/London)"),
|
|
1118
|
+
dayStartHour: import_zod.z.number().optional().describe("Hour the production day starts (0-23)")
|
|
1119
|
+
}).passthrough();
|
|
1120
|
+
var StationGetParams = import_zod.z.object({
|
|
1121
|
+
stationCode: import_zod.z.string().describe("Unique station identifier code")
|
|
1122
|
+
});
|
|
1123
|
+
var StationCreateUpdateParams = import_zod.z.object({
|
|
1124
|
+
code: import_zod.z.string().describe("Unique station identifier code"),
|
|
1125
|
+
name: import_zod.z.string().optional().describe("Display name for the station"),
|
|
1126
|
+
groupCode: import_zod.z.string().optional().describe("Group code to assign the station to"),
|
|
1127
|
+
shiftPatternId: import_zod.z.number().optional().describe("Shift pattern ID to assign")
|
|
1128
|
+
}).passthrough();
|
|
1129
|
+
var StationSignalParams = import_zod.z.object({
|
|
1130
|
+
stationCode: import_zod.z.string().describe("Target station code"),
|
|
1131
|
+
payload: import_zod.z.object({}).passthrough().describe("Signal payload object")
|
|
1132
|
+
});
|
|
1133
|
+
var ProductionGetParams = import_zod.z.object({
|
|
1134
|
+
plantCode: import_zod.z.string().describe("Plant code to query"),
|
|
1135
|
+
stationCodes: import_zod.z.array(import_zod.z.string()).optional().describe("Filter by station codes"),
|
|
1136
|
+
rangeCode: import_zod.z.string().describe("Time range code (e.g. today, yesterday, last7days)")
|
|
1137
|
+
});
|
|
1138
|
+
var ProductionGetRawParams = import_zod.z.object({
|
|
1139
|
+
plantCode: import_zod.z.string().describe("Plant code to query"),
|
|
1140
|
+
stationCodes: import_zod.z.array(import_zod.z.string()).optional().describe("Filter by station codes"),
|
|
1141
|
+
rangeCode: import_zod.z.string().describe("Time range code (e.g. today, yesterday, last7days)")
|
|
1142
|
+
});
|
|
1143
|
+
var MetricsGetParams = import_zod.z.object({
|
|
1144
|
+
plantCode: import_zod.z.string().describe("Plant code to query"),
|
|
1145
|
+
stationCodes: import_zod.z.array(import_zod.z.string()).optional().describe("Filter by station codes"),
|
|
1146
|
+
rangeCode: import_zod.z.string().describe("Time range code (e.g. today, yesterday, last7days)"),
|
|
1147
|
+
aggregateWindow: import_zod.z.string().describe("Aggregation window (e.g. 1h, 1d)")
|
|
1148
|
+
});
|
|
1149
|
+
var DowntimeGetParams = import_zod.z.object({
|
|
1150
|
+
plantCode: import_zod.z.string().describe("Plant code to query"),
|
|
1151
|
+
stationCodes: import_zod.z.array(import_zod.z.string()).optional().describe("Filter by station codes"),
|
|
1152
|
+
rangeCode: import_zod.z.string().describe("Time range code (e.g. today, yesterday, last7days)")
|
|
1153
|
+
});
|
|
1154
|
+
var OverviewGetParams = import_zod.z.object({
|
|
1155
|
+
plantCode: import_zod.z.string().describe("Plant code to query"),
|
|
1156
|
+
rangeCode: import_zod.z.string().describe("Time range code (e.g. today, yesterday, last7days)"),
|
|
1157
|
+
rangeFrom: import_zod.z.string().optional().describe("Custom range start (ISO 8601)"),
|
|
1158
|
+
rangeTo: import_zod.z.string().optional().describe("Custom range end (ISO 8601)")
|
|
1159
|
+
});
|
|
1160
|
+
var SkuGetParams = import_zod.z.object({
|
|
1161
|
+
skuCode: import_zod.z.string().describe("Unique SKU identifier code")
|
|
1162
|
+
});
|
|
1163
|
+
var SkuCreateUpdateParams = import_zod.z.object({
|
|
1164
|
+
code: import_zod.z.string().describe("Unique SKU identifier code"),
|
|
1165
|
+
name: import_zod.z.string().optional().describe("Display name for the SKU"),
|
|
1166
|
+
cycleTime: import_zod.z.number().optional().describe("Ideal cycle time in seconds"),
|
|
1167
|
+
value: import_zod.z.number().optional().describe("Monetary value per unit")
|
|
1168
|
+
}).passthrough();
|
|
1169
|
+
var ScheduleGetParams = import_zod.z.object({
|
|
1170
|
+
scheduleId: import_zod.z.number().describe("Numeric schedule ID")
|
|
1171
|
+
});
|
|
1172
|
+
var ScheduleCreateUpdateParams = import_zod.z.object({
|
|
1173
|
+
stationCode: import_zod.z.string().optional().describe("Station code to assign the schedule to"),
|
|
1174
|
+
skuCode: import_zod.z.string().optional().describe("SKU code for this schedule"),
|
|
1175
|
+
plannedStartAt: import_zod.z.string().optional().describe("Planned start time (ISO 8601)"),
|
|
1176
|
+
plannedQuantity: import_zod.z.number().optional().describe("Planned production quantity")
|
|
1177
|
+
}).passthrough();
|
|
1178
|
+
var AccountCreateParams = import_zod.z.object({
|
|
1179
|
+
domain: import_zod.z.string().describe("Account domain name"),
|
|
1180
|
+
plantName: import_zod.z.string().describe("Name of the initial plant to create")
|
|
1181
|
+
});
|
|
1182
|
+
var AgentRequestParams = import_zod.z.object({
|
|
1183
|
+
message: import_zod.z.string().describe("Natural language message to send to the agent")
|
|
1184
|
+
});
|
|
1185
|
+
var capabilities = [
|
|
1186
|
+
{
|
|
1187
|
+
name: "profile.get",
|
|
1188
|
+
description: "Get the authenticated user's profile",
|
|
1189
|
+
httpMethod: "GET",
|
|
1190
|
+
params: null
|
|
1191
|
+
},
|
|
1192
|
+
{
|
|
1193
|
+
name: "account.create",
|
|
1194
|
+
description: "Create a new account with an initial plant",
|
|
1195
|
+
httpMethod: "POST",
|
|
1196
|
+
params: AccountCreateParams
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
name: "apiKey.create",
|
|
1200
|
+
description: "Create a new API key for the current account",
|
|
1201
|
+
httpMethod: "POST",
|
|
1202
|
+
params: null
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
name: "plant.get",
|
|
1206
|
+
description: "Get a plant by its code",
|
|
1207
|
+
httpMethod: "GET",
|
|
1208
|
+
params: PlantGetParams
|
|
1209
|
+
},
|
|
1210
|
+
{
|
|
1211
|
+
name: "plant.createUpdate",
|
|
1212
|
+
description: "Create or update a plant",
|
|
1213
|
+
httpMethod: "POST",
|
|
1214
|
+
params: PlantCreateUpdateParams
|
|
1215
|
+
},
|
|
1216
|
+
{
|
|
1217
|
+
name: "station.get",
|
|
1218
|
+
description: "Get stations by station code",
|
|
1219
|
+
httpMethod: "GET",
|
|
1220
|
+
params: StationGetParams
|
|
1221
|
+
},
|
|
1222
|
+
{
|
|
1223
|
+
name: "station.createUpdate",
|
|
1224
|
+
description: "Create or update a station",
|
|
1225
|
+
httpMethod: "POST",
|
|
1226
|
+
params: StationCreateUpdateParams
|
|
1227
|
+
},
|
|
1228
|
+
{
|
|
1229
|
+
name: "station.signal",
|
|
1230
|
+
description: "Send a signal to a station",
|
|
1231
|
+
httpMethod: "POST",
|
|
1232
|
+
params: StationSignalParams
|
|
1233
|
+
},
|
|
1234
|
+
{
|
|
1235
|
+
name: "production.get",
|
|
1236
|
+
description: "Get aggregated production data for a plant and time range",
|
|
1237
|
+
httpMethod: "GET",
|
|
1238
|
+
params: ProductionGetParams
|
|
1239
|
+
},
|
|
1240
|
+
{
|
|
1241
|
+
name: "production.getRaw",
|
|
1242
|
+
description: "Get raw production data for a plant and time range",
|
|
1243
|
+
httpMethod: "GET",
|
|
1244
|
+
params: ProductionGetRawParams
|
|
1245
|
+
},
|
|
1246
|
+
{
|
|
1247
|
+
name: "metrics.get",
|
|
1248
|
+
description: "Get aggregated station metrics (windows) for a plant and time range",
|
|
1249
|
+
httpMethod: "GET",
|
|
1250
|
+
params: MetricsGetParams
|
|
1251
|
+
},
|
|
1252
|
+
{
|
|
1253
|
+
name: "downtime.get",
|
|
1254
|
+
description: "Get aggregated downtime data for a plant and time range",
|
|
1255
|
+
httpMethod: "GET",
|
|
1256
|
+
params: DowntimeGetParams
|
|
1257
|
+
},
|
|
1258
|
+
{
|
|
1259
|
+
name: "overview.get",
|
|
1260
|
+
description: "Get a full overview of plant performance for a time range",
|
|
1261
|
+
httpMethod: "GET",
|
|
1262
|
+
params: OverviewGetParams
|
|
1263
|
+
},
|
|
1264
|
+
{
|
|
1265
|
+
name: "sku.get",
|
|
1266
|
+
description: "Get a SKU by its code",
|
|
1267
|
+
httpMethod: "GET",
|
|
1268
|
+
params: SkuGetParams
|
|
1269
|
+
},
|
|
1270
|
+
{
|
|
1271
|
+
name: "sku.createUpdate",
|
|
1272
|
+
description: "Create or update a SKU",
|
|
1273
|
+
httpMethod: "POST",
|
|
1274
|
+
params: SkuCreateUpdateParams
|
|
1275
|
+
},
|
|
1276
|
+
{
|
|
1277
|
+
name: "schedule.get",
|
|
1278
|
+
description: "Get a schedule by its ID",
|
|
1279
|
+
httpMethod: "GET",
|
|
1280
|
+
params: ScheduleGetParams
|
|
1281
|
+
},
|
|
1282
|
+
{
|
|
1283
|
+
name: "schedule.createUpdate",
|
|
1284
|
+
description: "Create or update a schedule",
|
|
1285
|
+
httpMethod: "POST",
|
|
1286
|
+
params: ScheduleCreateUpdateParams
|
|
1287
|
+
},
|
|
1288
|
+
{
|
|
1289
|
+
name: "agent.request",
|
|
1290
|
+
description: "Send a natural language message to the Busroot AI agent",
|
|
1291
|
+
httpMethod: "POST",
|
|
1292
|
+
params: AgentRequestParams
|
|
1293
|
+
}
|
|
1294
|
+
];
|
|
1295
|
+
function resolveZodType(schema) {
|
|
1296
|
+
if (schema instanceof import_zod.z.ZodOptional || schema instanceof import_zod.z.ZodNullable) {
|
|
1297
|
+
return resolveZodType(schema.unwrap());
|
|
1298
|
+
}
|
|
1299
|
+
if (schema instanceof import_zod.z.ZodString) {
|
|
1300
|
+
return "string";
|
|
1301
|
+
}
|
|
1302
|
+
if (schema instanceof import_zod.z.ZodNumber) {
|
|
1303
|
+
return "number";
|
|
1304
|
+
}
|
|
1305
|
+
if (schema instanceof import_zod.z.ZodBoolean) {
|
|
1306
|
+
return "boolean";
|
|
1307
|
+
}
|
|
1308
|
+
if (schema instanceof import_zod.z.ZodArray) {
|
|
1309
|
+
return "array";
|
|
1310
|
+
}
|
|
1311
|
+
if (schema instanceof import_zod.z.ZodObject) {
|
|
1312
|
+
return "object";
|
|
1313
|
+
}
|
|
1314
|
+
if (schema instanceof import_zod.z.ZodEnum) {
|
|
1315
|
+
return "string";
|
|
1316
|
+
}
|
|
1317
|
+
return "unknown";
|
|
1318
|
+
}
|
|
1319
|
+
function describeCapabilities() {
|
|
1320
|
+
return capabilities.map((cap) => ({
|
|
1321
|
+
name: cap.name,
|
|
1322
|
+
description: cap.description,
|
|
1323
|
+
method: cap.httpMethod,
|
|
1324
|
+
params: cap.params ? Object.entries(cap.params.shape).map(([key, value]) => {
|
|
1325
|
+
const zodValue = value;
|
|
1326
|
+
return {
|
|
1327
|
+
name: key,
|
|
1328
|
+
required: !zodValue.isOptional(),
|
|
1329
|
+
description: zodValue.description ?? "",
|
|
1330
|
+
type: resolveZodType(zodValue)
|
|
1331
|
+
};
|
|
1332
|
+
}) : []
|
|
1333
|
+
}));
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
// src/client.ts
|
|
1107
1337
|
var import_mqtt = __toESM(require("mqtt"));
|
|
1108
1338
|
var MqttEventType = {
|
|
1109
1339
|
StationMetricNew: "STATION_METRIC_NEW",
|
|
@@ -1119,13 +1349,13 @@ var MqttEventType = {
|
|
|
1119
1349
|
ProductionNew: "PRODUCTION_NEW"
|
|
1120
1350
|
// When new production is added. NOT IMPLEMENTED FOR MANUAL PRODUCTION YET.
|
|
1121
1351
|
};
|
|
1122
|
-
var Config =
|
|
1123
|
-
accountId:
|
|
1124
|
-
apiKey:
|
|
1125
|
-
apiEndpoint:
|
|
1126
|
-
mqttHost:
|
|
1127
|
-
enableMqtt:
|
|
1128
|
-
enableDebug:
|
|
1352
|
+
var Config = import_zod2.z.object({
|
|
1353
|
+
accountId: import_zod2.z.string().max(255),
|
|
1354
|
+
apiKey: import_zod2.z.string().max(255),
|
|
1355
|
+
apiEndpoint: import_zod2.z.string().max(255),
|
|
1356
|
+
mqttHost: import_zod2.z.string().max(255),
|
|
1357
|
+
enableMqtt: import_zod2.z.boolean().optional(),
|
|
1358
|
+
enableDebug: import_zod2.z.boolean().optional()
|
|
1129
1359
|
});
|
|
1130
1360
|
var BusrootClient = class {
|
|
1131
1361
|
constructor(config) {
|
|
@@ -1168,6 +1398,7 @@ var BusrootClient = class {
|
|
|
1168
1398
|
mqttClient;
|
|
1169
1399
|
listenersByEventType = /* @__PURE__ */ new Map();
|
|
1170
1400
|
static version = "v0";
|
|
1401
|
+
static describe = describeCapabilities;
|
|
1171
1402
|
destroy() {
|
|
1172
1403
|
if (this.mqttClient != null) {
|
|
1173
1404
|
this.mqttClient.end();
|
|
@@ -1205,121 +1436,104 @@ var BusrootClient = class {
|
|
|
1205
1436
|
const resJson = await res.json();
|
|
1206
1437
|
return resJson;
|
|
1207
1438
|
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
}
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
}
|
|
1305
|
-
get downtime() {
|
|
1306
|
-
return {
|
|
1307
|
-
get: async ({
|
|
1308
|
-
plantCode,
|
|
1309
|
-
stationCodes,
|
|
1310
|
-
rangeCode
|
|
1311
|
-
}) => {
|
|
1312
|
-
const res = await this.get("/downtime", {
|
|
1313
|
-
plantcode: plantCode,
|
|
1314
|
-
stationcodes: stationCodes?.join(","),
|
|
1315
|
-
rangecode: rangeCode
|
|
1316
|
-
});
|
|
1317
|
-
return res.results;
|
|
1318
|
-
}
|
|
1319
|
-
};
|
|
1320
|
-
}
|
|
1439
|
+
profile = {
|
|
1440
|
+
get: async () => {
|
|
1441
|
+
const res = await this.get("/auth/profile");
|
|
1442
|
+
return res.result;
|
|
1443
|
+
}
|
|
1444
|
+
};
|
|
1445
|
+
account = {
|
|
1446
|
+
create: async ({ domain, plantName }) => {
|
|
1447
|
+
const res = await this.post("/account/new", { domain, plantName });
|
|
1448
|
+
return res.result;
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1451
|
+
apiKey = {
|
|
1452
|
+
create: async () => {
|
|
1453
|
+
const res = await this.post("/api-key", {});
|
|
1454
|
+
return res.result;
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
plant = {
|
|
1458
|
+
get: async ({ plantCode }) => {
|
|
1459
|
+
const res = await this.get("/plant", { plantCode });
|
|
1460
|
+
return res.result;
|
|
1461
|
+
},
|
|
1462
|
+
createUpdate: async (plant) => {
|
|
1463
|
+
const res = await this.post("/plant", plant);
|
|
1464
|
+
return res.result;
|
|
1465
|
+
}
|
|
1466
|
+
};
|
|
1467
|
+
station = {
|
|
1468
|
+
get: async ({ stationCode }) => {
|
|
1469
|
+
const res = await this.get("/station", { stationcodes: stationCode });
|
|
1470
|
+
return res.results;
|
|
1471
|
+
},
|
|
1472
|
+
createUpdate: async (station) => {
|
|
1473
|
+
const res = await this.post("/station", station);
|
|
1474
|
+
return res.result;
|
|
1475
|
+
},
|
|
1476
|
+
signal: (_params) => {
|
|
1477
|
+
throw new Error("noop");
|
|
1478
|
+
}
|
|
1479
|
+
};
|
|
1480
|
+
production = {
|
|
1481
|
+
get: async ({ plantCode, stationCodes, rangeCode }) => {
|
|
1482
|
+
const res = await this.get("/production", {
|
|
1483
|
+
plantcode: plantCode,
|
|
1484
|
+
stationcodes: stationCodes?.join(","),
|
|
1485
|
+
rangecode: rangeCode
|
|
1486
|
+
});
|
|
1487
|
+
return res.results;
|
|
1488
|
+
},
|
|
1489
|
+
getRaw: async ({ plantCode, stationCodes, rangeCode }) => {
|
|
1490
|
+
const res = await this.get("/production/raw", {
|
|
1491
|
+
plantcode: plantCode,
|
|
1492
|
+
stationcodes: stationCodes?.join(","),
|
|
1493
|
+
rangecode: rangeCode
|
|
1494
|
+
});
|
|
1495
|
+
return res.results;
|
|
1496
|
+
}
|
|
1497
|
+
};
|
|
1498
|
+
metrics = {
|
|
1499
|
+
get: async ({
|
|
1500
|
+
plantCode,
|
|
1501
|
+
stationCodes,
|
|
1502
|
+
rangeCode,
|
|
1503
|
+
aggregateWindow
|
|
1504
|
+
}) => {
|
|
1505
|
+
const res = await this.get("/station-windows", {
|
|
1506
|
+
plantcode: plantCode,
|
|
1507
|
+
stationcodes: stationCodes?.join(","),
|
|
1508
|
+
rangecode: rangeCode,
|
|
1509
|
+
aggregatewindow: aggregateWindow
|
|
1510
|
+
});
|
|
1511
|
+
return res.results;
|
|
1512
|
+
}
|
|
1513
|
+
};
|
|
1514
|
+
downtime = {
|
|
1515
|
+
get: async ({ plantCode, stationCodes, rangeCode }) => {
|
|
1516
|
+
const res = await this.get("/downtime", {
|
|
1517
|
+
plantcode: plantCode,
|
|
1518
|
+
stationcodes: stationCodes?.join(","),
|
|
1519
|
+
rangecode: rangeCode
|
|
1520
|
+
});
|
|
1521
|
+
return res.results;
|
|
1522
|
+
}
|
|
1523
|
+
};
|
|
1524
|
+
overview = {
|
|
1525
|
+
get: async ({ plantCode, rangeCode, rangeFrom, rangeTo }) => {
|
|
1526
|
+
const res = await this.get("/overview", {
|
|
1527
|
+
plantcode: plantCode,
|
|
1528
|
+
rangecode: rangeCode,
|
|
1529
|
+
rangefrom: rangeFrom,
|
|
1530
|
+
rangeto: rangeTo
|
|
1531
|
+
});
|
|
1532
|
+
return res.result;
|
|
1533
|
+
}
|
|
1534
|
+
};
|
|
1321
1535
|
sku = {
|
|
1322
|
-
get: async (skuCode) => {
|
|
1536
|
+
get: async ({ skuCode }) => {
|
|
1323
1537
|
const res = await this.get("/sku", { skucodes: skuCode });
|
|
1324
1538
|
return res.result;
|
|
1325
1539
|
},
|
|
@@ -1328,8 +1542,14 @@ var BusrootClient = class {
|
|
|
1328
1542
|
return res.result;
|
|
1329
1543
|
}
|
|
1330
1544
|
};
|
|
1545
|
+
agent = {
|
|
1546
|
+
request: async ({ message }) => {
|
|
1547
|
+
const res = await this.post("/agent", { message });
|
|
1548
|
+
return res.result;
|
|
1549
|
+
}
|
|
1550
|
+
};
|
|
1331
1551
|
schedule = {
|
|
1332
|
-
get: async (scheduleId) => {
|
|
1552
|
+
get: async ({ scheduleId }) => {
|
|
1333
1553
|
const res = await this.get("/schedule", { ids: String(scheduleId) });
|
|
1334
1554
|
return res.results;
|
|
1335
1555
|
},
|
|
@@ -1404,6 +1624,7 @@ var import_times = __toESM(require_times());
|
|
|
1404
1624
|
BusrootClient,
|
|
1405
1625
|
Config,
|
|
1406
1626
|
MqttEventType,
|
|
1627
|
+
describeCapabilities,
|
|
1407
1628
|
formattedDateTime,
|
|
1408
1629
|
formattedDuration,
|
|
1409
1630
|
useBusroot
|