@ikalogic/at1000 0.1.8 → 0.1.11
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/at1000-Cv2e0hBi.cjs +3 -0
- package/build/at1000-Cv2e0hBi.cjs.map +1 -0
- package/build/at1000-Dt6BT6DI.mjs +3 -0
- package/build/at1000-Dt6BT6DI.mjs.map +1 -0
- package/build/{at1000-BhiyEaDO.d.cts → at1000-KFLhlwg0.d.cts} +8 -8
- package/build/at1000-KFLhlwg0.d.cts.map +1 -0
- package/build/{at1000-CtJGQzs4.d.mts → at1000-q2I1Kzsu.d.mts} +8 -8
- package/build/at1000-q2I1Kzsu.d.mts.map +1 -0
- package/build/browser.cjs +1 -1
- package/build/browser.d.cts +1 -8
- package/build/browser.d.cts.map +1 -1
- package/build/browser.d.mts +6 -6
- package/build/browser.mjs +1 -1
- package/build/com-9S4BYQCi.mjs +2 -0
- package/build/com-9S4BYQCi.mjs.map +1 -0
- package/build/com-C7d5yOIK.cjs +2 -0
- package/build/com-C7d5yOIK.cjs.map +1 -0
- package/build/com-lprUo9DI.d.mts +1155 -0
- package/build/com-lprUo9DI.d.mts.map +1 -0
- package/build/com-n6AxqpLd.d.cts +1155 -0
- package/build/com-n6AxqpLd.d.cts.map +1 -0
- package/build/com.cjs +1 -1
- package/build/com.d.cts +2 -2
- package/build/com.d.mts +2 -2
- package/build/com.mjs +1 -1
- package/build/{common-CZE1OCJG.mjs → common-B_zag9Mq.mjs} +2 -2
- package/build/common-B_zag9Mq.mjs.map +1 -0
- package/build/common-SFHWBeL2.cjs +2 -0
- package/build/common-SFHWBeL2.cjs.map +1 -0
- package/build/{gpio-CvLKWnSo.d.mts → gpio-1DhXwkzs.d.mts} +29 -29
- package/build/gpio-1DhXwkzs.d.mts.map +1 -0
- package/build/{gpio-bjzKV_Vy.mjs → gpio-DkbxnZ_k.mjs} +2 -2
- package/build/gpio-DkbxnZ_k.mjs.map +1 -0
- package/build/{gpio-BnyLCBEg.cjs → gpio-apZVqZ8a.cjs} +2 -2
- package/build/gpio-apZVqZ8a.cjs.map +1 -0
- package/build/{gpio-DGcccQh6.d.cts → gpio-woQ2fDYl.d.cts} +29 -29
- package/build/gpio-woQ2fDYl.d.cts.map +1 -0
- package/build/gpio.cjs +1 -1
- package/build/gpio.d.cts +1 -2
- package/build/gpio.d.mts +2 -2
- package/build/gpio.mjs +1 -1
- package/build/{hmi-C1-vU40b.d.cts → hmi-BqgMEVWu.d.mts} +4 -4
- package/build/{hmi-C1-vU40b.d.cts.map → hmi-BqgMEVWu.d.mts.map} +1 -1
- package/build/{hmi-CIOjZVch.d.mts → hmi-CG5IhN4l.d.cts} +4 -4
- package/build/{hmi-CIOjZVch.d.mts.map → hmi-CG5IhN4l.d.cts.map} +1 -1
- package/build/hmi-CTx2jfxU.mjs.map +1 -1
- package/build/hmi-CnTa8kMx.cjs.map +1 -1
- package/build/hmi.d.cts +1 -1
- package/build/hmi.d.mts +1 -1
- package/build/management-BMEMu2Kx.mjs +2 -0
- package/build/management-BMEMu2Kx.mjs.map +1 -0
- package/build/{management-BIDVdvlQ.d.cts → management-CCwBNLm_.d.cts} +5 -9
- package/build/management-CCwBNLm_.d.cts.map +1 -0
- package/build/{management-CwNeejKZ.d.mts → management-Cw05hjbG.d.mts} +5 -9
- package/build/management-Cw05hjbG.d.mts.map +1 -0
- package/build/management-Lna6AzGK.cjs +2 -0
- package/build/management-Lna6AzGK.cjs.map +1 -0
- package/build/management.cjs +1 -1
- package/build/management.d.cts +2 -2
- package/build/management.d.mts +2 -2
- package/build/management.mjs +1 -1
- package/build/node.cjs +1 -1
- package/build/node.cjs.map +1 -1
- package/build/node.d.cts +1 -8
- package/build/node.d.cts.map +1 -1
- package/build/node.d.mts +6 -6
- package/build/node.mjs +1 -1
- package/build/node.mjs.map +1 -1
- package/build/power-Bz5S5GGr.mjs +2 -0
- package/build/power-Bz5S5GGr.mjs.map +1 -0
- package/build/power-C7KM2zvR.cjs +2 -0
- package/build/power-C7KM2zvR.cjs.map +1 -0
- package/build/{power-Cefqtt9P.d.mts → power-FnX69kqK.d.mts} +29 -29
- package/build/{power-Cefqtt9P.d.mts.map → power-FnX69kqK.d.mts.map} +1 -1
- package/build/{power-CSNvBKgh.d.cts → power-v3DLzhZW.d.cts} +29 -29
- package/build/{power-CSNvBKgh.d.cts.map → power-v3DLzhZW.d.cts.map} +1 -1
- package/build/power.cjs +1 -1
- package/build/power.d.cts +1 -2
- package/build/power.d.mts +2 -2
- package/build/power.mjs +1 -1
- package/build/relays-BK2uL5i_.cjs.map +1 -1
- package/build/relays-CqglfFwF.mjs.map +1 -1
- package/package.json +8 -8
- package/build/at1000-BhiyEaDO.d.cts.map +0 -1
- package/build/at1000-CgxthtV5.cjs +0 -2
- package/build/at1000-CgxthtV5.cjs.map +0 -1
- package/build/at1000-CtJGQzs4.d.mts.map +0 -1
- package/build/at1000-zvuVNh5z.mjs +0 -2
- package/build/at1000-zvuVNh5z.mjs.map +0 -1
- package/build/com-Bau2RVba.d.cts +0 -613
- package/build/com-Bau2RVba.d.cts.map +0 -1
- package/build/com-Bd30LXVW.d.mts +0 -613
- package/build/com-Bd30LXVW.d.mts.map +0 -1
- package/build/com-Bq-d2n2_.mjs +0 -2
- package/build/com-Bq-d2n2_.mjs.map +0 -1
- package/build/com-D6zvDfVV.cjs +0 -2
- package/build/com-D6zvDfVV.cjs.map +0 -1
- package/build/common-CZE1OCJG.mjs.map +0 -1
- package/build/common-D2xOY3nO.cjs +0 -2
- package/build/common-D2xOY3nO.cjs.map +0 -1
- package/build/gpio-BnyLCBEg.cjs.map +0 -1
- package/build/gpio-CvLKWnSo.d.mts.map +0 -1
- package/build/gpio-DGcccQh6.d.cts.map +0 -1
- package/build/gpio-bjzKV_Vy.mjs.map +0 -1
- package/build/management-BIDVdvlQ.d.cts.map +0 -1
- package/build/management-BKLSOMbM.mjs +0 -2
- package/build/management-BKLSOMbM.mjs.map +0 -1
- package/build/management-CwNeejKZ.d.mts.map +0 -1
- package/build/management-DHD60Xrp.cjs +0 -2
- package/build/management-DHD60Xrp.cjs.map +0 -1
- package/build/power-PrmE0ai2.cjs +0 -2
- package/build/power-PrmE0ai2.cjs.map +0 -1
- package/build/power-hwld3j5a.mjs +0 -2
- package/build/power-hwld3j5a.mjs.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AnalogOutputLevel } from "./common-SiysH9tt.mjs";
|
|
2
|
-
import { n as
|
|
2
|
+
import { n as Information } from "./management-Cw05hjbG.mjs";
|
|
3
3
|
import { UpFetch } from "up-fetch";
|
|
4
4
|
import * as v from "valibot";
|
|
5
5
|
|
|
@@ -23,18 +23,18 @@ declare const dutConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
23
23
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
24
24
|
readonly current: v.NumberSchema<undefined>;
|
|
25
25
|
}, "enabled" | "target_voltage">;
|
|
26
|
-
readonly
|
|
26
|
+
readonly "~standard": v.StandardProps<{
|
|
27
27
|
enabled: boolean;
|
|
28
28
|
target_voltage: number;
|
|
29
29
|
}, {
|
|
30
30
|
enabled: boolean;
|
|
31
31
|
target_voltage: number;
|
|
32
32
|
}>;
|
|
33
|
-
readonly
|
|
33
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
34
34
|
enabled: boolean;
|
|
35
35
|
target_voltage: number;
|
|
36
36
|
}, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
|
|
37
|
-
readonly
|
|
37
|
+
readonly "~types"?: {
|
|
38
38
|
readonly input: {
|
|
39
39
|
enabled: boolean;
|
|
40
40
|
target_voltage: number;
|
|
@@ -50,18 +50,18 @@ declare const dutConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
50
50
|
readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
51
51
|
readonly target_voltage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
|
|
52
52
|
};
|
|
53
|
-
readonly
|
|
53
|
+
readonly "~standard": v.StandardProps<{
|
|
54
54
|
enabled?: boolean | undefined;
|
|
55
55
|
target_voltage?: number | undefined;
|
|
56
56
|
}, {
|
|
57
57
|
enabled?: boolean | undefined;
|
|
58
58
|
target_voltage?: number | undefined;
|
|
59
59
|
}>;
|
|
60
|
-
readonly
|
|
60
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
61
61
|
enabled?: boolean | undefined;
|
|
62
62
|
target_voltage?: number | undefined;
|
|
63
63
|
}, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
|
|
64
|
-
readonly
|
|
64
|
+
readonly "~types"?: {
|
|
65
65
|
readonly input: {
|
|
66
66
|
enabled?: boolean | undefined;
|
|
67
67
|
target_voltage?: number | undefined;
|
|
@@ -86,7 +86,7 @@ declare const usbState: Omit<v.ObjectSchema<{
|
|
|
86
86
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
87
87
|
readonly current: v.NumberSchema<undefined>;
|
|
88
88
|
}, "enabled" | "voltage" | "current">;
|
|
89
|
-
readonly
|
|
89
|
+
readonly "~standard": v.StandardProps<{
|
|
90
90
|
enabled: boolean;
|
|
91
91
|
voltage: number;
|
|
92
92
|
current: number;
|
|
@@ -95,12 +95,12 @@ declare const usbState: Omit<v.ObjectSchema<{
|
|
|
95
95
|
voltage: number;
|
|
96
96
|
current: number;
|
|
97
97
|
}>;
|
|
98
|
-
readonly
|
|
98
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
99
99
|
enabled: boolean;
|
|
100
100
|
voltage: number;
|
|
101
101
|
current: number;
|
|
102
102
|
}, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
|
|
103
|
-
readonly
|
|
103
|
+
readonly "~types"?: {
|
|
104
104
|
readonly input: {
|
|
105
105
|
enabled: boolean;
|
|
106
106
|
voltage: number;
|
|
@@ -127,7 +127,7 @@ declare const usbConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
127
127
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
128
128
|
readonly current: v.NumberSchema<undefined>;
|
|
129
129
|
}, "enabled" | "voltage" | "current">;
|
|
130
|
-
readonly
|
|
130
|
+
readonly "~standard": v.StandardProps<{
|
|
131
131
|
enabled: boolean;
|
|
132
132
|
voltage: number;
|
|
133
133
|
current: number;
|
|
@@ -136,12 +136,12 @@ declare const usbConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
136
136
|
voltage: number;
|
|
137
137
|
current: number;
|
|
138
138
|
}>;
|
|
139
|
-
readonly
|
|
139
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
140
140
|
enabled: boolean;
|
|
141
141
|
voltage: number;
|
|
142
142
|
current: number;
|
|
143
143
|
}, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
|
|
144
|
-
readonly
|
|
144
|
+
readonly "~types"?: {
|
|
145
145
|
readonly input: {
|
|
146
146
|
enabled: boolean;
|
|
147
147
|
voltage: number;
|
|
@@ -161,15 +161,15 @@ declare const usbConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
161
161
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
162
162
|
readonly current: v.NumberSchema<undefined>;
|
|
163
163
|
}, "enabled" | "voltage" | "current">, "enabled">;
|
|
164
|
-
readonly
|
|
164
|
+
readonly "~standard": v.StandardProps<{
|
|
165
165
|
enabled: boolean;
|
|
166
166
|
}, {
|
|
167
167
|
enabled: boolean;
|
|
168
168
|
}>;
|
|
169
|
-
readonly
|
|
169
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
170
170
|
enabled: boolean;
|
|
171
171
|
}, v.BooleanIssue | v.ObjectIssue>;
|
|
172
|
-
readonly
|
|
172
|
+
readonly "~types"?: {
|
|
173
173
|
readonly input: {
|
|
174
174
|
enabled: boolean;
|
|
175
175
|
};
|
|
@@ -192,15 +192,15 @@ declare const relayState: Omit<v.ObjectSchema<{
|
|
|
192
192
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
193
193
|
readonly current: v.NumberSchema<undefined>;
|
|
194
194
|
}, "current">;
|
|
195
|
-
readonly
|
|
195
|
+
readonly "~standard": v.StandardProps<{
|
|
196
196
|
current: number;
|
|
197
197
|
}, {
|
|
198
198
|
current: number;
|
|
199
199
|
}>;
|
|
200
|
-
readonly
|
|
200
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
201
201
|
current: number;
|
|
202
202
|
}, v.NumberIssue | v.ObjectIssue>;
|
|
203
|
-
readonly
|
|
203
|
+
readonly "~types"?: {
|
|
204
204
|
readonly input: {
|
|
205
205
|
current: number;
|
|
206
206
|
};
|
|
@@ -216,7 +216,7 @@ declare class PowerApi {
|
|
|
216
216
|
private readonly fetch;
|
|
217
217
|
private readonly usb_count;
|
|
218
218
|
private readonly dut_count;
|
|
219
|
-
constructor(fetch: UpFetch,
|
|
219
|
+
constructor(fetch: UpFetch, info: Information);
|
|
220
220
|
/**
|
|
221
221
|
* Resets the power API.
|
|
222
222
|
*/
|
|
@@ -255,16 +255,16 @@ declare class Dut {
|
|
|
255
255
|
*/
|
|
256
256
|
configure(config: DutConfiguration): Promise<DutState>;
|
|
257
257
|
/**
|
|
258
|
-
*
|
|
258
|
+
* Enables the DUT power supply at the specified voltage.
|
|
259
259
|
* @param voltage The target voltage to set.
|
|
260
260
|
* @returns The updated DUT state.
|
|
261
261
|
*/
|
|
262
|
-
|
|
262
|
+
enable(voltage: AnalogOutputLevel): Promise<DutState>;
|
|
263
263
|
/**
|
|
264
|
-
*
|
|
264
|
+
* Disables the DUT power supply.
|
|
265
265
|
* @returns The updated DUT state.
|
|
266
266
|
*/
|
|
267
|
-
|
|
267
|
+
disable(): Promise<DutState>;
|
|
268
268
|
/**
|
|
269
269
|
* Reads the current DUT state.
|
|
270
270
|
* @returns The current DUT state.
|
|
@@ -297,15 +297,15 @@ declare class Usb {
|
|
|
297
297
|
*/
|
|
298
298
|
configure(config: UsbConfiguration): Promise<UsbState>;
|
|
299
299
|
/**
|
|
300
|
-
*
|
|
300
|
+
* Enables the USB port power.
|
|
301
301
|
* @returns The updated USB state.
|
|
302
302
|
*/
|
|
303
|
-
|
|
303
|
+
enable(): Promise<UsbState>;
|
|
304
304
|
/**
|
|
305
|
-
*
|
|
305
|
+
* Disables the USB port power.
|
|
306
306
|
* @returns The updated USB state.
|
|
307
307
|
*/
|
|
308
|
-
|
|
308
|
+
disable(): Promise<UsbState>;
|
|
309
309
|
/**
|
|
310
310
|
* Reads the current state of the USB port.
|
|
311
311
|
* @returns The current USB state.
|
|
@@ -340,4 +340,4 @@ declare class RelayPower {
|
|
|
340
340
|
}
|
|
341
341
|
//#endregion
|
|
342
342
|
export { RelayPower as a, UsbConfiguration as c, PowerApi as i, UsbState as l, DutConfiguration as n, RelayState as o, DutState as r, Usb as s, Dut as t };
|
|
343
|
-
//# sourceMappingURL=power-
|
|
343
|
+
//# sourceMappingURL=power-FnX69kqK.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"power-
|
|
1
|
+
{"version":3,"file":"power-FnX69kqK.d.mts","names":[],"sources":["../src/api/power.ts"],"sourcesContent":[],"mappings":";;;;;;cAQM,UAAQ,CAAA,CAAA;EAAR,SAAA,OAKJ,iBAAA,CAAA,SAAA,CAAA;;;;;KACU,QAAA,GAAW,CAAA,CAAE,mBAAmB;cAEtC,kBAAgB,KAAA,KAAA,CAAA,CAAA;;;;;CARR,EAAA,SAAA,CAAA,EAAA,WAAA,GAAA,MAAA,GAAA,QAAA,GAAA,SAAA,CAAA,GAAA;EAAA,SAAA,OAAA,MAAA,CAAA;IAMF,SAAQ,OAAA,iBAAK,CAAA,SAAA,CAAW;IAE9B,SAAA,cAA6E,kBAAA,CAAA,SAAA,eAAA,CAAA,SAAA,CAAA,kBAAA,CAAA,MAAA,EAAA,CAAA,EAAA,EAAA,SAAA,CAAA,kBAAA,CAAA,MAAA,EAAA,EAAA,EAAA,SAAA,CAAA,CAAA,CAAA;;;;;;;;;;;EAA7D,SAAA,MAAA,EAAA,CAAA,OAAA,kBAAA,EAAA,MAAA,UAAA,YAAA,CAAA,OAAA,CAAA,CAAA,EAAA,kBAAA,CAAA;IAAA,OAAA,EAAA,OAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAA,OAAA,CAAA,EAAA,OAAA,GAAA,SAAA;;;;;;;;;;;;;;;KACV,gBAAA,GAAmB,CAAA,CAAE,mBAAmB;cAE9C,UAAQ,KAAA,CAAA,CAAA;;;;;;;;IAFF,SAAA,cAAgB,kBAAwB,CAAA,SAAnB,eAAW,CAAA,SAAA,CAAA,kBAAA,CAAA,MAAA,EAAA,CAAA,EAAA,EAAA,SAAA,CAAA,kBAAA,CAAA,MAAA,EAAA,EAAA,EAAA,SAAA,CAAA,CAA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;;;;;;;;;;;KACJ,UAAA,GAAa,CAAA,CAAE,mBAAmB;;cAGjC,QAAA;;;;qBAIyB,eAAe;;;;WAO1C;EAdC;AAGZ;;;;EAoBmB,GAAA,CAAA,EAAA,EAAA,MAAA,CAAA,EAAA,GAAA;EAiBA;;;AAsBnB;;EAMW,GAAA,CAAA,EAAA,EAAA,MAAA,CAAA,EA5BQ,GA4BR;EASS;;;;EAa0B,OAAA,CAAA,CAAA,EAlCjC,UAkCiC;;;AAQjC,cApCA,GAAA,CAoCA;EAQK,iBAAA,KAAA;EAAR,SAAA,EAAA,EAAA,MAAA;EAQc,WAAA,CAAA,KAAA,EAnDc,OAmDd,EAAA,EAAA,EAAA,MAAA;EAQA;;AAMxB;EACsC,KAAA,CAAA,CAAA,EA7D3B,OA6D2B,CAAA,IAAA,CAAA;EAK3B;;;;;EAqBC,SAAA,CAAA,MAAA,EA9EQ,gBA8ER,CAAA,EA9E2B,OA8E3B,CA9EmC,QA8EnC,CAAA;EAQS;;;;;EAwBG,MAAA,CAAA,OAAA,EAjGN,iBAiGM,CAAA,EAjGc,OAiGd,CAjGsB,QAiGtB,CAAA;EAAO;AAM/B;;;EAOU,OAAA,CAAA,CAAA,EAtGG,OAsGH,CAtGW,QAsGX,CAAA;EAQc;;;;UAtGd,QAAQ;;;;;kBAQM;;;;;kBAQA;;;cAMX,GAAA;;;qBACyB;;;;WAK3B;;;;;;oBASS,mBAAmB,QAAQ;;;;;YAYnC,QAAQ;;;;;aAQP,QAAQ;;;;;UAQX,QAAQ;;;;;kBAQM;;;;;kBAQA;;;cAMX,UAAA;;;qBACyB;;;;;UAM5B,QAAQ;;;;;kBAQM"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as AnalogOutputLevel } from "./common-DAOxX-Zx.cjs";
|
|
2
|
-
import { n as
|
|
2
|
+
import { n as Information } from "./management-CCwBNLm_.cjs";
|
|
3
3
|
import { UpFetch } from "up-fetch";
|
|
4
4
|
import * as v from "valibot";
|
|
5
5
|
|
|
@@ -23,18 +23,18 @@ declare const dutConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
23
23
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
24
24
|
readonly current: v.NumberSchema<undefined>;
|
|
25
25
|
}, "enabled" | "target_voltage">;
|
|
26
|
-
readonly
|
|
26
|
+
readonly "~standard": v.StandardProps<{
|
|
27
27
|
enabled: boolean;
|
|
28
28
|
target_voltage: number;
|
|
29
29
|
}, {
|
|
30
30
|
enabled: boolean;
|
|
31
31
|
target_voltage: number;
|
|
32
32
|
}>;
|
|
33
|
-
readonly
|
|
33
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
34
34
|
enabled: boolean;
|
|
35
35
|
target_voltage: number;
|
|
36
36
|
}, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
|
|
37
|
-
readonly
|
|
37
|
+
readonly "~types"?: {
|
|
38
38
|
readonly input: {
|
|
39
39
|
enabled: boolean;
|
|
40
40
|
target_voltage: number;
|
|
@@ -50,18 +50,18 @@ declare const dutConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
50
50
|
readonly enabled: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
|
|
51
51
|
readonly target_voltage: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>, undefined>;
|
|
52
52
|
};
|
|
53
|
-
readonly
|
|
53
|
+
readonly "~standard": v.StandardProps<{
|
|
54
54
|
enabled?: boolean | undefined;
|
|
55
55
|
target_voltage?: number | undefined;
|
|
56
56
|
}, {
|
|
57
57
|
enabled?: boolean | undefined;
|
|
58
58
|
target_voltage?: number | undefined;
|
|
59
59
|
}>;
|
|
60
|
-
readonly
|
|
60
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
61
61
|
enabled?: boolean | undefined;
|
|
62
62
|
target_voltage?: number | undefined;
|
|
63
63
|
}, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
|
|
64
|
-
readonly
|
|
64
|
+
readonly "~types"?: {
|
|
65
65
|
readonly input: {
|
|
66
66
|
enabled?: boolean | undefined;
|
|
67
67
|
target_voltage?: number | undefined;
|
|
@@ -86,7 +86,7 @@ declare const usbState: Omit<v.ObjectSchema<{
|
|
|
86
86
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
87
87
|
readonly current: v.NumberSchema<undefined>;
|
|
88
88
|
}, "enabled" | "voltage" | "current">;
|
|
89
|
-
readonly
|
|
89
|
+
readonly "~standard": v.StandardProps<{
|
|
90
90
|
enabled: boolean;
|
|
91
91
|
voltage: number;
|
|
92
92
|
current: number;
|
|
@@ -95,12 +95,12 @@ declare const usbState: Omit<v.ObjectSchema<{
|
|
|
95
95
|
voltage: number;
|
|
96
96
|
current: number;
|
|
97
97
|
}>;
|
|
98
|
-
readonly
|
|
98
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
99
99
|
enabled: boolean;
|
|
100
100
|
voltage: number;
|
|
101
101
|
current: number;
|
|
102
102
|
}, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
|
|
103
|
-
readonly
|
|
103
|
+
readonly "~types"?: {
|
|
104
104
|
readonly input: {
|
|
105
105
|
enabled: boolean;
|
|
106
106
|
voltage: number;
|
|
@@ -127,7 +127,7 @@ declare const usbConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
127
127
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
128
128
|
readonly current: v.NumberSchema<undefined>;
|
|
129
129
|
}, "enabled" | "voltage" | "current">;
|
|
130
|
-
readonly
|
|
130
|
+
readonly "~standard": v.StandardProps<{
|
|
131
131
|
enabled: boolean;
|
|
132
132
|
voltage: number;
|
|
133
133
|
current: number;
|
|
@@ -136,12 +136,12 @@ declare const usbConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
136
136
|
voltage: number;
|
|
137
137
|
current: number;
|
|
138
138
|
}>;
|
|
139
|
-
readonly
|
|
139
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
140
140
|
enabled: boolean;
|
|
141
141
|
voltage: number;
|
|
142
142
|
current: number;
|
|
143
143
|
}, v.NumberIssue | v.BooleanIssue | v.ObjectIssue | v.MinValueIssue<number, -25> | v.MaxValueIssue<number, 25>>;
|
|
144
|
-
readonly
|
|
144
|
+
readonly "~types"?: {
|
|
145
145
|
readonly input: {
|
|
146
146
|
enabled: boolean;
|
|
147
147
|
voltage: number;
|
|
@@ -161,15 +161,15 @@ declare const usbConfiguration: Omit<Omit<v.ObjectSchema<{
|
|
|
161
161
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
162
162
|
readonly current: v.NumberSchema<undefined>;
|
|
163
163
|
}, "enabled" | "voltage" | "current">, "enabled">;
|
|
164
|
-
readonly
|
|
164
|
+
readonly "~standard": v.StandardProps<{
|
|
165
165
|
enabled: boolean;
|
|
166
166
|
}, {
|
|
167
167
|
enabled: boolean;
|
|
168
168
|
}>;
|
|
169
|
-
readonly
|
|
169
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
170
170
|
enabled: boolean;
|
|
171
171
|
}, v.BooleanIssue | v.ObjectIssue>;
|
|
172
|
-
readonly
|
|
172
|
+
readonly "~types"?: {
|
|
173
173
|
readonly input: {
|
|
174
174
|
enabled: boolean;
|
|
175
175
|
};
|
|
@@ -192,15 +192,15 @@ declare const relayState: Omit<v.ObjectSchema<{
|
|
|
192
192
|
readonly voltage: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.MinValueAction<number, -25, undefined>, v.MaxValueAction<number, 25, undefined>]>;
|
|
193
193
|
readonly current: v.NumberSchema<undefined>;
|
|
194
194
|
}, "current">;
|
|
195
|
-
readonly
|
|
195
|
+
readonly "~standard": v.StandardProps<{
|
|
196
196
|
current: number;
|
|
197
197
|
}, {
|
|
198
198
|
current: number;
|
|
199
199
|
}>;
|
|
200
|
-
readonly
|
|
200
|
+
readonly "~run": (dataset: v.UnknownDataset, config: v.Config<v.BaseIssue<unknown>>) => v.OutputDataset<{
|
|
201
201
|
current: number;
|
|
202
202
|
}, v.NumberIssue | v.ObjectIssue>;
|
|
203
|
-
readonly
|
|
203
|
+
readonly "~types"?: {
|
|
204
204
|
readonly input: {
|
|
205
205
|
current: number;
|
|
206
206
|
};
|
|
@@ -216,7 +216,7 @@ declare class PowerApi {
|
|
|
216
216
|
private readonly fetch;
|
|
217
217
|
private readonly usb_count;
|
|
218
218
|
private readonly dut_count;
|
|
219
|
-
constructor(fetch: UpFetch,
|
|
219
|
+
constructor(fetch: UpFetch, info: Information);
|
|
220
220
|
/**
|
|
221
221
|
* Resets the power API.
|
|
222
222
|
*/
|
|
@@ -255,16 +255,16 @@ declare class Dut {
|
|
|
255
255
|
*/
|
|
256
256
|
configure(config: DutConfiguration): Promise<DutState>;
|
|
257
257
|
/**
|
|
258
|
-
*
|
|
258
|
+
* Enables the DUT power supply at the specified voltage.
|
|
259
259
|
* @param voltage The target voltage to set.
|
|
260
260
|
* @returns The updated DUT state.
|
|
261
261
|
*/
|
|
262
|
-
|
|
262
|
+
enable(voltage: AnalogOutputLevel): Promise<DutState>;
|
|
263
263
|
/**
|
|
264
|
-
*
|
|
264
|
+
* Disables the DUT power supply.
|
|
265
265
|
* @returns The updated DUT state.
|
|
266
266
|
*/
|
|
267
|
-
|
|
267
|
+
disable(): Promise<DutState>;
|
|
268
268
|
/**
|
|
269
269
|
* Reads the current DUT state.
|
|
270
270
|
* @returns The current DUT state.
|
|
@@ -297,15 +297,15 @@ declare class Usb {
|
|
|
297
297
|
*/
|
|
298
298
|
configure(config: UsbConfiguration): Promise<UsbState>;
|
|
299
299
|
/**
|
|
300
|
-
*
|
|
300
|
+
* Enables the USB port power.
|
|
301
301
|
* @returns The updated USB state.
|
|
302
302
|
*/
|
|
303
|
-
|
|
303
|
+
enable(): Promise<UsbState>;
|
|
304
304
|
/**
|
|
305
|
-
*
|
|
305
|
+
* Disables the USB port power.
|
|
306
306
|
* @returns The updated USB state.
|
|
307
307
|
*/
|
|
308
|
-
|
|
308
|
+
disable(): Promise<UsbState>;
|
|
309
309
|
/**
|
|
310
310
|
* Reads the current state of the USB port.
|
|
311
311
|
* @returns The current USB state.
|
|
@@ -340,4 +340,4 @@ declare class RelayPower {
|
|
|
340
340
|
}
|
|
341
341
|
//#endregion
|
|
342
342
|
export { RelayPower as a, UsbConfiguration as c, PowerApi as i, UsbState as l, DutConfiguration as n, RelayState as o, DutState as r, Usb as s, Dut as t };
|
|
343
|
-
//# sourceMappingURL=power-
|
|
343
|
+
//# sourceMappingURL=power-v3DLzhZW.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"power-
|
|
1
|
+
{"version":3,"file":"power-v3DLzhZW.d.cts","names":[],"sources":["../src/api/power.ts"],"sourcesContent":[],"mappings":";;;;;;cAQM,UAAQ,CAAA,CAAA;EAAR,SAAA,OAKJ,iBAAA,CAAA,SAAA,CAAA;;;;;KACU,QAAA,GAAW,CAAA,CAAE,mBAAmB;cAEtC,kBAAgB,KAAA,KAAA,CAAA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A,KAAA,EAnDc,OAmDd,EAAA,EAAA,EAAA,MAAA;EAQA;;AAMxB;EACsC,KAAA,CAAA,CAAA,EA7D3B,OA6D2B,CAAA,IAAA,CAAA;EAK3B;;;;;EAqBC,SAAA,CAAA,MAAA,EA9EQ,gBA8ER,CAAA,EA9E2B,OA8E3B,CA9EmC,QA8EnC,CAAA;EAQS;;;;;EAwBG,MAAA,CAAA,OAAA,EAjGN,iBAiGM,CAAA,EAjGc,OAiGd,CAjGsB,QAiGtB,CAAA;EAAO;AAM/B;;;EAOU,OAAA,CAAA,CAAA,EAtGG,OAsGH,CAtGW,QAsGX,CAAA;EAQc;;;;UAtGd,QAAQ;;;;;kBAQM;;;;;kBAQA;;;cAMX,GAAA;;;qBACyB;;;;WAK3B;;;;;;oBASS,mBAAmB,QAAQ;;;;;YAYnC,QAAQ;;;;;aAQP,QAAQ;;;;;UAQX,QAAQ;;;;;kBAQM;;;;;kBAQA;;;cAMX,UAAA;;;qBACyB;;;;;UAM5B,QAAQ;;;;;kBAQM"}
|
package/build/power.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./common-
|
|
1
|
+
require(`./common-SFHWBeL2.cjs`);const e=require(`./power-C7KM2zvR.cjs`);exports.Dut=e.t,exports.PowerApi=e.n,exports.RelayPower=e.r,exports.Usb=e.i;
|
package/build/power.d.cts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import { t as AnalogOutputLevel } from "./common-DAOxX-Zx.cjs";
|
|
2
|
-
import "./
|
|
3
|
-
import { a as RelayPower, c as UsbConfiguration, i as PowerApi, l as UsbState, n as DutConfiguration, o as RelayState, r as DutState, s as Usb, t as Dut } from "./power-CSNvBKgh.cjs";
|
|
2
|
+
import { a as RelayPower, c as UsbConfiguration, i as PowerApi, l as UsbState, n as DutConfiguration, o as RelayState, r as DutState, s as Usb, t as Dut } from "./power-v3DLzhZW.cjs";
|
|
4
3
|
export { AnalogOutputLevel, Dut, DutConfiguration, DutState, PowerApi, RelayPower, RelayState, Usb, UsbConfiguration, UsbState };
|
package/build/power.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { t as AnalogOutputLevel } from "./common-SiysH9tt.mjs";
|
|
2
|
-
import "./management-
|
|
3
|
-
import { a as RelayPower, c as UsbConfiguration, i as PowerApi, l as UsbState, n as DutConfiguration, o as RelayState, r as DutState, s as Usb, t as Dut } from "./power-
|
|
2
|
+
import "./management-Cw05hjbG.mjs";
|
|
3
|
+
import { a as RelayPower, c as UsbConfiguration, i as PowerApi, l as UsbState, n as DutConfiguration, o as RelayState, r as DutState, s as Usb, t as Dut } from "./power-FnX69kqK.mjs";
|
|
4
4
|
export { AnalogOutputLevel, Dut, DutConfiguration, DutState, PowerApi, RelayPower, RelayState, Usb, UsbConfiguration, UsbState };
|
package/build/power.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./common-
|
|
1
|
+
import"./common-B_zag9Mq.mjs";import{i as e,n as t,r as n,t as r}from"./power-Bz5S5GGr.mjs";export{r as Dut,t as PowerApi,n as RelayPower,e as Usb};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relays-BK2uL5i_.cjs","names":["v"
|
|
1
|
+
{"version":3,"file":"relays-BK2uL5i_.cjs","names":["v"],"sources":["../src/api/relays.ts"],"sourcesContent":["import type { UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nconst state = v.picklist(['open', 'closed']);\nexport type State = v.InferOutput<typeof state>;\nconst states = v.array(state);\nexport type States = v.InferOutput<typeof states>;\nconst relayState = v.object({ state: state });\n\nconst action = v.picklist(['open', 'close']);\nconst relayAction = v.object({ action: action });\ntype RelayAction = v.InferOutput<typeof relayAction>;\n\n/** @hideconstructor */\nexport class RelaysApi {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Resets all relays to their default state.\n */\n reset() {\n return this.fetch('/relays/reset', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Access a specific relay by id.\n * @param id The relay id.\n * @returns The relay instance.\n */\n relay(id: number): Relay {\n return new Relay(this.fetch, id);\n }\n\n /**\n * Reads the state of all relays.\n * @returns The state of all relays.\n */\n read(): Promise<States> {\n return this.fetch(`/relays`, { schema: states });\n }\n\n /**\n * Opens all the relays.\n * @returns The new state of all relays.\n */\n open(): Promise<States> {\n return this.fetch(`/relays`, {\n method: 'POST',\n body: { action: 'open' } satisfies RelayAction,\n schema: states,\n });\n }\n\n /**\n * Closes all the relays.\n * @returns The new state of all relays.\n */\n close(): Promise<States> {\n return this.fetch(`/relays`, {\n method: 'POST',\n body: { action: 'close' } satisfies RelayAction,\n schema: states,\n });\n }\n}\n\n/** @hideconstructor */\nexport class Relay {\n constructor(\n private readonly fetch: UpFetch,\n /**\n * The relay id.\n */\n public readonly id: number,\n ) {}\n\n /**\n * Reads the state of the relay.\n * @returns The relay state.\n */\n async read(): Promise<State> {\n return (await this.fetch(`/relays/${this.id}`, { schema: relayState })).state;\n }\n\n /**\n * Returns whether the relay is open.\n * @returns True if the relay is open, false otherwise.\n */\n async is_open(): Promise<boolean> {\n return (await this.read()) === 'open';\n }\n\n /**\n * Returns whether the relay is closed.\n * @returns True if the relay is closed, false otherwise.\n */\n async is_closed(): Promise<boolean> {\n return (await this.read()) === 'closed';\n }\n\n /**\n * Opens the relay.\n * @returns The new relay state.\n */\n async open(): Promise<State> {\n return (await this.fetch(`/relays/${this.id}`, {\n method: 'POST',\n body: { action: 'open' } satisfies RelayAction,\n schema: relayState,\n }))\n .state;\n }\n\n /**\n * Closes the relay.\n * @returns The new relay state.\n */\n async close(): Promise<State> {\n return (await this.fetch(`/relays/${this.id}`, {\n method: 'POST',\n body: { action: 'close' } satisfies RelayAction,\n schema: relayState,\n }))\n .state;\n }\n}\n"],"mappings":"0EAGA,MAAM,EAAQA,EAAE,SAAS,CAAC,OAAQ,SAAS,CAAC,CAEtC,EAASA,EAAE,MAAM,EAAM,CAEvB,EAAaA,EAAE,OAAO,CAAS,QAAO,CAAC,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"relays-CqglfFwF.mjs","names":[
|
|
1
|
+
{"version":3,"file":"relays-CqglfFwF.mjs","names":[],"sources":["../src/api/relays.ts"],"sourcesContent":["import type { UpFetch } from 'up-fetch';\nimport * as v from 'valibot';\n\nconst state = v.picklist(['open', 'closed']);\nexport type State = v.InferOutput<typeof state>;\nconst states = v.array(state);\nexport type States = v.InferOutput<typeof states>;\nconst relayState = v.object({ state: state });\n\nconst action = v.picklist(['open', 'close']);\nconst relayAction = v.object({ action: action });\ntype RelayAction = v.InferOutput<typeof relayAction>;\n\n/** @hideconstructor */\nexport class RelaysApi {\n constructor(private readonly fetch: UpFetch) {}\n\n /**\n * Resets all relays to their default state.\n */\n reset() {\n return this.fetch('/relays/reset', { method: 'POST', parseResponse: () => {} });\n }\n\n /**\n * Access a specific relay by id.\n * @param id The relay id.\n * @returns The relay instance.\n */\n relay(id: number): Relay {\n return new Relay(this.fetch, id);\n }\n\n /**\n * Reads the state of all relays.\n * @returns The state of all relays.\n */\n read(): Promise<States> {\n return this.fetch(`/relays`, { schema: states });\n }\n\n /**\n * Opens all the relays.\n * @returns The new state of all relays.\n */\n open(): Promise<States> {\n return this.fetch(`/relays`, {\n method: 'POST',\n body: { action: 'open' } satisfies RelayAction,\n schema: states,\n });\n }\n\n /**\n * Closes all the relays.\n * @returns The new state of all relays.\n */\n close(): Promise<States> {\n return this.fetch(`/relays`, {\n method: 'POST',\n body: { action: 'close' } satisfies RelayAction,\n schema: states,\n });\n }\n}\n\n/** @hideconstructor */\nexport class Relay {\n constructor(\n private readonly fetch: UpFetch,\n /**\n * The relay id.\n */\n public readonly id: number,\n ) {}\n\n /**\n * Reads the state of the relay.\n * @returns The relay state.\n */\n async read(): Promise<State> {\n return (await this.fetch(`/relays/${this.id}`, { schema: relayState })).state;\n }\n\n /**\n * Returns whether the relay is open.\n * @returns True if the relay is open, false otherwise.\n */\n async is_open(): Promise<boolean> {\n return (await this.read()) === 'open';\n }\n\n /**\n * Returns whether the relay is closed.\n * @returns True if the relay is closed, false otherwise.\n */\n async is_closed(): Promise<boolean> {\n return (await this.read()) === 'closed';\n }\n\n /**\n * Opens the relay.\n * @returns The new relay state.\n */\n async open(): Promise<State> {\n return (await this.fetch(`/relays/${this.id}`, {\n method: 'POST',\n body: { action: 'open' } satisfies RelayAction,\n schema: relayState,\n }))\n .state;\n }\n\n /**\n * Closes the relay.\n * @returns The new relay state.\n */\n async close(): Promise<State> {\n return (await this.fetch(`/relays/${this.id}`, {\n method: 'POST',\n body: { action: 'close' } satisfies RelayAction,\n schema: relayState,\n }))\n .state;\n }\n}\n"],"mappings":"0BAGA,MAAM,EAAQ,EAAE,SAAS,CAAC,OAAQ,SAAS,CAAC,CAEtC,EAAS,EAAE,MAAM,EAAM,CAEvB,EAAa,EAAE,OAAO,CAAS,QAAO,CAAC,CAEvC,EAAS,EAAE,SAAS,CAAC,OAAQ,QAAQ,CAAC,CACxB,EAAE,OAAO,CAAU,SAAQ,CAAC,CAIhD,IAAa,EAAb,KAAuB,CACrB,YAAY,EAAiC,CAAhB,KAAA,MAAA,EAK7B,OAAQ,CACN,OAAO,KAAK,MAAM,gBAAiB,CAAE,OAAQ,OAAQ,kBAAqB,GAAI,CAAC,CAQjF,MAAM,EAAmB,CACvB,OAAO,IAAI,EAAM,KAAK,MAAO,EAAG,CAOlC,MAAwB,CACtB,OAAO,KAAK,MAAM,UAAW,CAAE,OAAQ,EAAQ,CAAC,CAOlD,MAAwB,CACtB,OAAO,KAAK,MAAM,UAAW,CAC3B,OAAQ,OACR,KAAM,CAAE,OAAQ,OAAQ,CACxB,OAAQ,EACT,CAAC,CAOJ,OAAyB,CACvB,OAAO,KAAK,MAAM,UAAW,CAC3B,OAAQ,OACR,KAAM,CAAE,OAAQ,QAAS,CACzB,OAAQ,EACT,CAAC,GAKO,EAAb,KAAmB,CACjB,YACE,EAIA,EACA,CALiB,KAAA,MAAA,EAID,KAAA,GAAA,EAOlB,MAAM,MAAuB,CAC3B,OAAQ,MAAM,KAAK,MAAM,WAAW,KAAK,KAAM,CAAE,OAAQ,EAAY,CAAC,EAAE,MAO1E,MAAM,SAA4B,CAChC,OAAQ,MAAM,KAAK,MAAM,GAAM,OAOjC,MAAM,WAA8B,CAClC,OAAQ,MAAM,KAAK,MAAM,GAAM,SAOjC,MAAM,MAAuB,CAC3B,OAAQ,MAAM,KAAK,MAAM,WAAW,KAAK,KAAM,CAC7C,OAAQ,OACR,KAAM,CAAE,OAAQ,OAAQ,CACxB,OAAQ,EACT,CAAC,EACC,MAOL,MAAM,OAAwB,CAC5B,OAAQ,MAAM,KAAK,MAAM,WAAW,KAAK,KAAM,CAC7C,OAAQ,OACR,KAAM,CAAE,OAAQ,QAAS,CACzB,OAAQ,EACT,CAAC,EACC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikalogic/at1000",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Ikalogic AT1000 API",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./build/node.cjs",
|
|
@@ -104,18 +104,18 @@
|
|
|
104
104
|
"dependencies": {
|
|
105
105
|
"dns-packet": "^5.6.1",
|
|
106
106
|
"ip-address": "^10.1.0",
|
|
107
|
-
"up-fetch": "^2.5.
|
|
108
|
-
"valibot": "^1.
|
|
107
|
+
"up-fetch": "^2.5.1",
|
|
108
|
+
"valibot": "^1.2.0"
|
|
109
109
|
},
|
|
110
110
|
"devDependencies": {
|
|
111
111
|
"@arethetypeswrong/core": "^0.18.2",
|
|
112
|
-
"@types/bun": "^1.3.
|
|
112
|
+
"@types/bun": "^1.3.6",
|
|
113
113
|
"@types/dns-packet": "^5.6.5",
|
|
114
|
-
"@types/node": "^
|
|
114
|
+
"@types/node": "^25.0.9",
|
|
115
115
|
"@typhonjs-typedoc/typedoc-pkg": "^0.4.0",
|
|
116
|
-
"publint": "^0.3.
|
|
117
|
-
"tsdown": "^0.
|
|
118
|
-
"typedoc": "^0.28.
|
|
116
|
+
"publint": "^0.3.16",
|
|
117
|
+
"tsdown": "^0.19.0",
|
|
118
|
+
"typedoc": "^0.28.16",
|
|
119
119
|
"typescript": "^5.9.3"
|
|
120
120
|
},
|
|
121
121
|
"typedocOptions": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"at1000-BhiyEaDO.d.cts","names":[],"sources":["../src/at1000.ts"],"sourcesContent":[],"mappings":";;;;;;;;;cAUa,UAAA;EAAA;;;EAkBU,SAAA,IAAA,EAAA,MAAA;EAIC;;;EAYE,SAAA,MAAA,EA1BA,MA0BA;EAEU,QAAA,KAAA;EAgDvB;;;EAQyC,SAAA,GAAA,EA9E/B,MA8E+B;;;;gBA1E/B;;;;iBAIC;;;;uBAIM;;;;kBAIL;;;;mBAIC;oCAEU;WAgDvB;mCAQkC,QAAQ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
const e=require(`./chunk-Bmb41Sf3.cjs`),t=require(`./com-D6zvDfVV.cjs`),n=require(`./gpio-BnyLCBEg.cjs`),r=require(`./hmi-CnTa8kMx.cjs`),i=require(`./management-DHD60Xrp.cjs`),a=require(`./power-PrmE0ai2.cjs`),o=require(`./relays-BK2uL5i_.cjs`);let s=require(`up-fetch`);var c=`0.1.8`,l=class e{host;device;fetch;com;hmi;gpio;management;power;relays;constructor(e,c){this.host=e,this.device=c,this.fetch=(0,s.up)(fetch,()=>({baseUrl:`http://${this.host}/v0`,timeout:1e3,parseRejected:async(e,t)=>{let n,r=e.headers.get(`content-type`);try{n=r?.includes(`application/json`)?await e.json():await e.text()}catch{n=`Failed to parse response body`}throw typeof n==`object`&&[`code`,`message`,`suggestion`,`path`].every(e=>e in n)?Error(`${n.message} (${n.code})\n Suggestion: ${n.suggestion}\n Path: ${n.path}`):Error(`API request to ${t.method} ${e.url} failed with status ${e.status}: ${typeof n==`string`?n:JSON.stringify(n)}`)}})),this.com=new t.n(this.fetch),this.hmi=new r.n(this.fetch),this.gpio=new n.r(this.fetch,this.device),this.management=new i.n(this.fetch),this.power=new a.n(this.fetch,this.device),this.relays=new o.n(this.fetch)}async reset(){await this.com.reset(),await this.hmi.reset(),await this.gpio.reset(),await this.power.reset(),await this.relays.reset()}static create=async t=>new e(t,await new i.n((0,s.up)(fetch,()=>({baseUrl:`http://${t}/v0`,timeout:1e3}))).device())};Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return l}});
|
|
2
|
-
//# sourceMappingURL=at1000-CgxthtV5.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"at1000-CgxthtV5.cjs","names":["errorData: any","ComApi","HmiApi","GpioApi","ManagementApi","PowerApi","RelaysApi"],"sources":["../package.json","../src/at1000.ts"],"sourcesContent":["{\n \"name\": \"@ikalogic/at1000\",\n \"version\": \"0.1.8\",\n \"description\": \"Ikalogic AT1000 API\",\n \"type\": \"module\",\n \"main\": \"./build/node.cjs\",\n \"module\": \"./build/node.mjs\",\n \"types\": \"./build/node.d.cts\",\n \"license\": \"MIT\",\n \"homepage\": \"https://ikalogic.com/test-sequencers/at1000/intro/\",\n \"readme\": \"README.md\",\n \"files\": [\n \"build\"\n ],\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./build/node.d.mts\",\n \"browser\": \"./build/browser.mjs\",\n \"node\": \"./build/node.mjs\",\n \"default\": \"./build/node.mjs\"\n },\n \"require\": {\n \"types\": \"./build/node.d.cts\",\n \"browser\": \"./build/browser.cjs\",\n \"node\": \"./build/node.cjs\",\n \"default\": \"./build/node.cjs\"\n }\n },\n \"./com\": {\n \"import\": {\n \"types\": \"./build/com.d.mts\",\n \"default\": \"./build/com.mjs\"\n },\n \"require\": {\n \"types\": \"./build/com.d.cts\",\n \"default\": \"./build/com.cjs\"\n }\n },\n \"./gpio\": {\n \"import\": {\n \"types\": \"./build/gpio.d.mts\",\n \"default\": \"./build/gpio.mjs\"\n },\n \"require\": {\n \"types\": \"./build/gpio.d.cts\",\n \"default\": \"./build/gpio.cjs\"\n }\n },\n \"./hmi\": {\n \"import\": {\n \"types\": \"./build/hmi.d.mts\",\n \"default\": \"./build/hmi.mjs\"\n },\n \"require\": {\n \"types\": \"./build/hmi.d.cts\",\n \"default\": \"./build/hmi.cjs\"\n }\n },\n \"./management\": {\n \"import\": {\n \"types\": \"./build/management.d.mts\",\n \"default\": \"./build/management.mjs\"\n },\n \"require\": {\n \"types\": \"./build/management.d.cts\",\n \"default\": \"./build/management.cjs\"\n }\n },\n \"./power\": {\n \"import\": {\n \"types\": \"./build/power.d.mts\",\n \"default\": \"./build/power.mjs\"\n },\n \"require\": {\n \"types\": \"./build/power.d.cts\",\n \"default\": \"./build/power.cjs\"\n }\n },\n \"./relays\": {\n \"import\": {\n \"types\": \"./build/relays.d.mts\",\n \"default\": \"./build/relays.mjs\"\n },\n \"require\": {\n \"types\": \"./build/relays.d.cts\",\n \"default\": \"./build/relays.cjs\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"scripts\": {\n \"build\": \"bun --bun tsdown && bun --bun publint\",\n \"check\": \"bun run typecheck && bun --bun oxlint --type-aware --deny-warnings\",\n \"dev\": \"bun --bun tsdown --watch\",\n \"typecheck\": \"bun --bun tsc --noEmit\",\n \"release\": \"bun publish\",\n \"test\": \"bun test --coverage\",\n \"docs\": \"bun typedoc-pkg -o build/docs\"\n },\n \"dependencies\": {\n \"dns-packet\": \"^5.6.1\",\n \"ip-address\": \"^10.1.0\",\n \"up-fetch\": \"^2.5.0\",\n \"valibot\": \"^1.1.0\"\n },\n \"devDependencies\": {\n \"@arethetypeswrong/core\": \"^0.18.2\",\n \"@types/bun\": \"^1.3.3\",\n \"@types/dns-packet\": \"^5.6.5\",\n \"@types/node\": \"^24.10.1\",\n \"@typhonjs-typedoc/typedoc-pkg\": \"^0.4.0\",\n \"publint\": \"^0.3.15\",\n \"tsdown\": \"^0.16.6\",\n \"typedoc\": \"^0.28.14\",\n \"typescript\": \"^5.9.3\"\n },\n \"typedocOptions\": {\n \"out\": \"build/docs\",\n \"entryPoints\": [\n \"./src/browser.ts\",\n \"./src/node.ts\",\n \"./src/api/*\"\n ]\n }\n}\n","import { up, type UpFetch } from 'up-fetch';\n\nimport { ComApi } from './api/com';\nimport { GpioApi } from './api/gpio';\nimport { HmiApi } from './api/hmi';\nimport { type Device, ManagementApi } from './api/management';\nimport { PowerApi } from './api/power';\nimport { RelaysApi } from './api/relays';\n\n/** @hideconstructor */\nexport class AT1000Base {\n /**\n * IP address or hostname of the AT1000 device\n */\n public readonly host: string;\n /**\n * Device information\n */\n public readonly device: Device;\n\n private fetch: UpFetch;\n /**\n * COM API\n */\n public readonly com: ComApi;\n /**\n * HMI API\n */\n public readonly hmi: HmiApi;\n /**\n * GPIO API\n */\n public readonly gpio: GpioApi;\n /**\n * Management API\n */\n public readonly management: ManagementApi;\n /**\n * Power management API\n */\n public readonly power: PowerApi;\n /**\n * Relays API\n */\n public readonly relays: RelaysApi;\n\n constructor(host: string, device: Device) {\n this.host = host;\n this.device = device;\n\n this.fetch = up(\n fetch,\n () => ({\n baseUrl: `http://${this.host}/v0`,\n timeout: 1000,\n parseRejected: async (response, request) => {\n let errorData: any;\n const contentType = response.headers.get('content-type');\n try {\n if (contentType?.includes('application/json')) {\n errorData = await response.json();\n } else {\n errorData = await response.text();\n }\n } catch {\n errorData = 'Failed to parse response body';\n }\n\n if (\n typeof errorData === 'object'\n && ['code', 'message', 'suggestion', 'path'].every((key) => key in errorData)\n ) {\n throw new Error(\n `${errorData.message} (${errorData.code})\\n Suggestion: ${errorData.suggestion}\\n Path: ${errorData.path}`,\n );\n }\n\n throw new Error(\n `API request to ${request.method} ${response.url} failed with status ${response.status}: ${\n typeof errorData === 'string' ? errorData : JSON.stringify(errorData)\n }`,\n );\n },\n }),\n );\n\n this.com = new ComApi(this.fetch);\n this.hmi = new HmiApi(this.fetch);\n this.gpio = new GpioApi(this.fetch, this.device);\n this.management = new ManagementApi(this.fetch);\n this.power = new PowerApi(this.fetch, this.device);\n this.relays = new RelaysApi(this.fetch);\n }\n\n async reset() {\n await this.com.reset();\n await this.hmi.reset();\n await this.gpio.reset();\n await this.power.reset();\n await this.relays.reset();\n }\n\n public static create = async (host: string): Promise<AT1000Base> => {\n // Create a temporary client to fetch device info\n const management = new ManagementApi(\n up(fetch, () => ({ baseUrl: `http://${host}/v0`, timeout: 1000 })),\n );\n const device = await management.device();\n\n return new AT1000Base(host, device);\n };\n}\n"],"mappings":"qRAEa,QCQA,EAAb,MAAa,CAAW,CAItB,KAIA,OAEA,MAIA,IAIA,IAIA,KAIA,WAIA,MAIA,OAEA,YAAY,EAAc,EAAgB,CACxC,KAAK,KAAO,EACZ,KAAK,OAAS,EAEd,KAAK,OAAA,EAAA,EAAA,IACH,WACO,CACL,QAAS,UAAU,KAAK,KAAK,KAC7B,QAAS,IACT,cAAe,MAAO,EAAU,IAAY,CAC1C,IAAIA,EACE,EAAc,EAAS,QAAQ,IAAI,eAAe,CACxD,GAAI,CACF,AAGE,EAHE,GAAa,SAAS,mBAAmB,CAC/B,MAAM,EAAS,MAAM,CAErB,MAAM,EAAS,MAAM,MAE7B,CACN,EAAY,gCAYd,MARE,OAAO,GAAc,UAClB,CAAC,OAAQ,UAAW,aAAc,OAAO,CAAC,MAAO,GAAQ,KAAO,EAAU,CAEnE,MACR,GAAG,EAAU,QAAQ,IAAI,EAAU,KAAK,qBAAqB,EAAU,WAAW,cAAc,EAAU,OAC3G,CAGO,MACR,kBAAkB,EAAQ,OAAO,GAAG,EAAS,IAAI,sBAAsB,EAAS,OAAO,IACrF,OAAO,GAAc,SAAW,EAAY,KAAK,UAAU,EAAU,GAExE,EAEJ,EACF,CAED,KAAK,IAAM,IAAIC,EAAAA,EAAO,KAAK,MAAM,CACjC,KAAK,IAAM,IAAIC,EAAAA,EAAO,KAAK,MAAM,CACjC,KAAK,KAAO,IAAIC,EAAAA,EAAQ,KAAK,MAAO,KAAK,OAAO,CAChD,KAAK,WAAa,IAAIC,EAAAA,EAAc,KAAK,MAAM,CAC/C,KAAK,MAAQ,IAAIC,EAAAA,EAAS,KAAK,MAAO,KAAK,OAAO,CAClD,KAAK,OAAS,IAAIC,EAAAA,EAAU,KAAK,MAAM,CAGzC,MAAM,OAAQ,CACZ,MAAM,KAAK,IAAI,OAAO,CACtB,MAAM,KAAK,IAAI,OAAO,CACtB,MAAM,KAAK,KAAK,OAAO,CACvB,MAAM,KAAK,MAAM,OAAO,CACxB,MAAM,KAAK,OAAO,OAAO,CAG3B,OAAc,OAAS,KAAO,IAOrB,IAAI,EAAW,EAFP,MAHI,IAAIF,EAAAA,GAAAA,EAAAA,EAAAA,IAClB,WAAc,CAAE,QAAS,UAAU,EAAK,KAAM,QAAS,IAAM,EAAE,CACnE,CAC+B,QAAQ,CAEL"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"at1000-CtJGQzs4.d.mts","names":[],"sources":["../src/at1000.ts"],"sourcesContent":[],"mappings":";;;;;;;;;cAUa,UAAA;EAAA;;;EAkBU,SAAA,IAAA,EAAA,MAAA;EAIC;;;EAYE,SAAA,MAAA,EA1BA,MA0BA;EAEU,QAAA,KAAA;EAgDvB;;;EAQyC,SAAA,GAAA,EA9E/B,MA8E+B;;;;gBA1E/B;;;;iBAIC;;;;uBAIM;;;;kBAIL;;;;mBAIC;oCAEU;WAgDvB;mCAQkC,QAAQ"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{n as e}from"./com-Bq-d2n2_.mjs";import{r as t}from"./gpio-bjzKV_Vy.mjs";import{n}from"./hmi-CTx2jfxU.mjs";import{n as r}from"./management-BKLSOMbM.mjs";import{n as i}from"./power-hwld3j5a.mjs";import{n as a}from"./relays-CqglfFwF.mjs";import{up as o}from"up-fetch";var s=`0.1.8`,c=class s{host;device;fetch;com;hmi;gpio;management;power;relays;constructor(s,c){this.host=s,this.device=c,this.fetch=o(fetch,()=>({baseUrl:`http://${this.host}/v0`,timeout:1e3,parseRejected:async(e,t)=>{let n,r=e.headers.get(`content-type`);try{n=r?.includes(`application/json`)?await e.json():await e.text()}catch{n=`Failed to parse response body`}throw typeof n==`object`&&[`code`,`message`,`suggestion`,`path`].every(e=>e in n)?Error(`${n.message} (${n.code})\n Suggestion: ${n.suggestion}\n Path: ${n.path}`):Error(`API request to ${t.method} ${e.url} failed with status ${e.status}: ${typeof n==`string`?n:JSON.stringify(n)}`)}})),this.com=new e(this.fetch),this.hmi=new n(this.fetch),this.gpio=new t(this.fetch,this.device),this.management=new r(this.fetch),this.power=new i(this.fetch,this.device),this.relays=new a(this.fetch)}async reset(){await this.com.reset(),await this.hmi.reset(),await this.gpio.reset(),await this.power.reset(),await this.relays.reset()}static create=async e=>new s(e,await new r(o(fetch,()=>({baseUrl:`http://${e}/v0`,timeout:1e3}))).device())};export{s as n,c as t};
|
|
2
|
-
//# sourceMappingURL=at1000-zvuVNh5z.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"at1000-zvuVNh5z.mjs","names":["errorData: any"],"sources":["../package.json","../src/at1000.ts"],"sourcesContent":["{\n \"name\": \"@ikalogic/at1000\",\n \"version\": \"0.1.8\",\n \"description\": \"Ikalogic AT1000 API\",\n \"type\": \"module\",\n \"main\": \"./build/node.cjs\",\n \"module\": \"./build/node.mjs\",\n \"types\": \"./build/node.d.cts\",\n \"license\": \"MIT\",\n \"homepage\": \"https://ikalogic.com/test-sequencers/at1000/intro/\",\n \"readme\": \"README.md\",\n \"files\": [\n \"build\"\n ],\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"exports\": {\n \".\": {\n \"import\": {\n \"types\": \"./build/node.d.mts\",\n \"browser\": \"./build/browser.mjs\",\n \"node\": \"./build/node.mjs\",\n \"default\": \"./build/node.mjs\"\n },\n \"require\": {\n \"types\": \"./build/node.d.cts\",\n \"browser\": \"./build/browser.cjs\",\n \"node\": \"./build/node.cjs\",\n \"default\": \"./build/node.cjs\"\n }\n },\n \"./com\": {\n \"import\": {\n \"types\": \"./build/com.d.mts\",\n \"default\": \"./build/com.mjs\"\n },\n \"require\": {\n \"types\": \"./build/com.d.cts\",\n \"default\": \"./build/com.cjs\"\n }\n },\n \"./gpio\": {\n \"import\": {\n \"types\": \"./build/gpio.d.mts\",\n \"default\": \"./build/gpio.mjs\"\n },\n \"require\": {\n \"types\": \"./build/gpio.d.cts\",\n \"default\": \"./build/gpio.cjs\"\n }\n },\n \"./hmi\": {\n \"import\": {\n \"types\": \"./build/hmi.d.mts\",\n \"default\": \"./build/hmi.mjs\"\n },\n \"require\": {\n \"types\": \"./build/hmi.d.cts\",\n \"default\": \"./build/hmi.cjs\"\n }\n },\n \"./management\": {\n \"import\": {\n \"types\": \"./build/management.d.mts\",\n \"default\": \"./build/management.mjs\"\n },\n \"require\": {\n \"types\": \"./build/management.d.cts\",\n \"default\": \"./build/management.cjs\"\n }\n },\n \"./power\": {\n \"import\": {\n \"types\": \"./build/power.d.mts\",\n \"default\": \"./build/power.mjs\"\n },\n \"require\": {\n \"types\": \"./build/power.d.cts\",\n \"default\": \"./build/power.cjs\"\n }\n },\n \"./relays\": {\n \"import\": {\n \"types\": \"./build/relays.d.mts\",\n \"default\": \"./build/relays.mjs\"\n },\n \"require\": {\n \"types\": \"./build/relays.d.cts\",\n \"default\": \"./build/relays.cjs\"\n }\n },\n \"./package.json\": \"./package.json\"\n },\n \"scripts\": {\n \"build\": \"bun --bun tsdown && bun --bun publint\",\n \"check\": \"bun run typecheck && bun --bun oxlint --type-aware --deny-warnings\",\n \"dev\": \"bun --bun tsdown --watch\",\n \"typecheck\": \"bun --bun tsc --noEmit\",\n \"release\": \"bun publish\",\n \"test\": \"bun test --coverage\",\n \"docs\": \"bun typedoc-pkg -o build/docs\"\n },\n \"dependencies\": {\n \"dns-packet\": \"^5.6.1\",\n \"ip-address\": \"^10.1.0\",\n \"up-fetch\": \"^2.5.0\",\n \"valibot\": \"^1.1.0\"\n },\n \"devDependencies\": {\n \"@arethetypeswrong/core\": \"^0.18.2\",\n \"@types/bun\": \"^1.3.3\",\n \"@types/dns-packet\": \"^5.6.5\",\n \"@types/node\": \"^24.10.1\",\n \"@typhonjs-typedoc/typedoc-pkg\": \"^0.4.0\",\n \"publint\": \"^0.3.15\",\n \"tsdown\": \"^0.16.6\",\n \"typedoc\": \"^0.28.14\",\n \"typescript\": \"^5.9.3\"\n },\n \"typedocOptions\": {\n \"out\": \"build/docs\",\n \"entryPoints\": [\n \"./src/browser.ts\",\n \"./src/node.ts\",\n \"./src/api/*\"\n ]\n }\n}\n","import { up, type UpFetch } from 'up-fetch';\n\nimport { ComApi } from './api/com';\nimport { GpioApi } from './api/gpio';\nimport { HmiApi } from './api/hmi';\nimport { type Device, ManagementApi } from './api/management';\nimport { PowerApi } from './api/power';\nimport { RelaysApi } from './api/relays';\n\n/** @hideconstructor */\nexport class AT1000Base {\n /**\n * IP address or hostname of the AT1000 device\n */\n public readonly host: string;\n /**\n * Device information\n */\n public readonly device: Device;\n\n private fetch: UpFetch;\n /**\n * COM API\n */\n public readonly com: ComApi;\n /**\n * HMI API\n */\n public readonly hmi: HmiApi;\n /**\n * GPIO API\n */\n public readonly gpio: GpioApi;\n /**\n * Management API\n */\n public readonly management: ManagementApi;\n /**\n * Power management API\n */\n public readonly power: PowerApi;\n /**\n * Relays API\n */\n public readonly relays: RelaysApi;\n\n constructor(host: string, device: Device) {\n this.host = host;\n this.device = device;\n\n this.fetch = up(\n fetch,\n () => ({\n baseUrl: `http://${this.host}/v0`,\n timeout: 1000,\n parseRejected: async (response, request) => {\n let errorData: any;\n const contentType = response.headers.get('content-type');\n try {\n if (contentType?.includes('application/json')) {\n errorData = await response.json();\n } else {\n errorData = await response.text();\n }\n } catch {\n errorData = 'Failed to parse response body';\n }\n\n if (\n typeof errorData === 'object'\n && ['code', 'message', 'suggestion', 'path'].every((key) => key in errorData)\n ) {\n throw new Error(\n `${errorData.message} (${errorData.code})\\n Suggestion: ${errorData.suggestion}\\n Path: ${errorData.path}`,\n );\n }\n\n throw new Error(\n `API request to ${request.method} ${response.url} failed with status ${response.status}: ${\n typeof errorData === 'string' ? errorData : JSON.stringify(errorData)\n }`,\n );\n },\n }),\n );\n\n this.com = new ComApi(this.fetch);\n this.hmi = new HmiApi(this.fetch);\n this.gpio = new GpioApi(this.fetch, this.device);\n this.management = new ManagementApi(this.fetch);\n this.power = new PowerApi(this.fetch, this.device);\n this.relays = new RelaysApi(this.fetch);\n }\n\n async reset() {\n await this.com.reset();\n await this.hmi.reset();\n await this.gpio.reset();\n await this.power.reset();\n await this.relays.reset();\n }\n\n public static create = async (host: string): Promise<AT1000Base> => {\n // Create a temporary client to fetch device info\n const management = new ManagementApi(\n up(fetch, () => ({ baseUrl: `http://${host}/v0`, timeout: 1000 })),\n );\n const device = await management.device();\n\n return new AT1000Base(host, device);\n };\n}\n"],"mappings":"sRAEa,QCQA,EAAb,MAAa,CAAW,CAItB,KAIA,OAEA,MAIA,IAIA,IAIA,KAIA,WAIA,MAIA,OAEA,YAAY,EAAc,EAAgB,CACxC,KAAK,KAAO,EACZ,KAAK,OAAS,EAEd,KAAK,MAAQ,EACX,WACO,CACL,QAAS,UAAU,KAAK,KAAK,KAC7B,QAAS,IACT,cAAe,MAAO,EAAU,IAAY,CAC1C,IAAIA,EACE,EAAc,EAAS,QAAQ,IAAI,eAAe,CACxD,GAAI,CACF,AAGE,EAHE,GAAa,SAAS,mBAAmB,CAC/B,MAAM,EAAS,MAAM,CAErB,MAAM,EAAS,MAAM,MAE7B,CACN,EAAY,gCAYd,MARE,OAAO,GAAc,UAClB,CAAC,OAAQ,UAAW,aAAc,OAAO,CAAC,MAAO,GAAQ,KAAO,EAAU,CAEnE,MACR,GAAG,EAAU,QAAQ,IAAI,EAAU,KAAK,qBAAqB,EAAU,WAAW,cAAc,EAAU,OAC3G,CAGO,MACR,kBAAkB,EAAQ,OAAO,GAAG,EAAS,IAAI,sBAAsB,EAAS,OAAO,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