busroot-sdk 0.0.1 → 0.0.2
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/client.d.ts +1 -2
- package/build/client.test.d.ts +0 -1
- package/build/common.d.ts +8 -705
- package/build/example.d.ts +0 -1
- package/build/hooks.d.ts +2 -3
- package/build/index.d.ts +0 -1
- package/package.json +3 -3
- package/build/client.d.ts.map +0 -1
- package/build/client.test.d.ts.map +0 -1
- package/build/example.d.ts.map +0 -1
- package/build/hooks.d.ts.map +0 -1
- package/build/index.d.ts.map +0 -1
package/build/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PlantSchema, PlantViewModel, ScheduleViewModel, BusrootSignals, SkuViewModel, StationSchema, StationViewModel, AccountViewModel, ApiKeyViewModel } from "
|
|
1
|
+
import { PlantSchema, PlantViewModel, ScheduleViewModel, BusrootSignals, SkuViewModel, StationSchema, StationViewModel, AccountViewModel, ApiKeyViewModel } from "./common";
|
|
2
2
|
import mqtt from "mqtt/dist/mqtt.esm";
|
|
3
3
|
export declare const MqttEventType: {
|
|
4
4
|
StationMetricNew: string;
|
|
@@ -60,4 +60,3 @@ declare class Client {
|
|
|
60
60
|
off(event: MqttEventType, listener: Listener): void;
|
|
61
61
|
}
|
|
62
62
|
export { Client };
|
|
63
|
-
//# sourceMappingURL=client.d.ts.map
|
package/build/client.test.d.ts
CHANGED
package/build/common.d.ts
CHANGED
|
@@ -1,701 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
declare namespace util {
|
|
4
|
-
type AssertEqual<T, U> = (<V>() => V extends T ? 1 : 2) extends <V>() => V extends U ? 1 : 2 ? true : false;
|
|
5
|
-
export type isAny<T> = 0 extends 1 & T ? true : false;
|
|
6
|
-
export const assertEqual: <A, B>(_: AssertEqual<A, B>) => void;
|
|
7
|
-
export function assertIs<T>(_arg: T): void;
|
|
8
|
-
export function assertNever(_x: never): never;
|
|
9
|
-
export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
10
|
-
export type OmitKeys<T, K extends string> = Pick<T, Exclude<keyof T, K>>;
|
|
11
|
-
export type MakePartial<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
|
|
12
|
-
export type Exactly<T, X> = T & Record<Exclude<keyof X, keyof T>, never>;
|
|
13
|
-
export type InexactPartial<T> = {
|
|
14
|
-
[k in keyof T]?: T[k] | undefined;
|
|
15
|
-
};
|
|
16
|
-
export const arrayToEnum: <T extends string, U extends [T, ...T[]]>(items: U) => { [k in U[number]]: k; };
|
|
17
|
-
export const getValidEnumValues: (obj: any) => any[];
|
|
18
|
-
export const objectValues: (obj: any) => any[];
|
|
19
|
-
export const objectKeys: ObjectConstructor["keys"];
|
|
20
|
-
export const find: <T>(arr: T[], checker: (arg: T) => any) => T | undefined;
|
|
21
|
-
export type identity<T> = objectUtil.identity<T>;
|
|
22
|
-
export type flatten<T> = objectUtil.flatten<T>;
|
|
23
|
-
export type noUndefined<T> = T extends undefined ? never : T;
|
|
24
|
-
export const isInteger: NumberConstructor["isInteger"];
|
|
25
|
-
export function joinValues<T extends any[]>(array: T, separator?: string): string;
|
|
26
|
-
export const jsonStringifyReplacer: (_: string, value: any) => any;
|
|
27
|
-
export {};
|
|
28
|
-
}
|
|
29
|
-
declare namespace objectUtil {
|
|
30
|
-
export type MergeShapes<U, V> = keyof U & keyof V extends never ? U & V : {
|
|
31
|
-
[k in Exclude<keyof U, keyof V>]: U[k];
|
|
32
|
-
} & V;
|
|
33
|
-
type optionalKeys<T extends object> = {
|
|
34
|
-
[k in keyof T]: undefined extends T[k] ? k : never;
|
|
35
|
-
}[keyof T];
|
|
36
|
-
type requiredKeys<T extends object> = {
|
|
37
|
-
[k in keyof T]: undefined extends T[k] ? never : k;
|
|
38
|
-
}[keyof T];
|
|
39
|
-
export type addQuestionMarks<T extends object, _O = any> = {
|
|
40
|
-
[K in requiredKeys<T>]: T[K];
|
|
41
|
-
} & {
|
|
42
|
-
[K in optionalKeys<T>]?: T[K];
|
|
43
|
-
} & {
|
|
44
|
-
[k in keyof T]?: unknown;
|
|
45
|
-
};
|
|
46
|
-
export type identity<T> = T;
|
|
47
|
-
export type flatten<T> = identity<{
|
|
48
|
-
[k in keyof T]: T[k];
|
|
49
|
-
}>;
|
|
50
|
-
export type noNeverKeys<T> = {
|
|
51
|
-
[k in keyof T]: [T[k]] extends [never] ? never : k;
|
|
52
|
-
}[keyof T];
|
|
53
|
-
export type noNever<T> = identity<{
|
|
54
|
-
[k in noNeverKeys<T>]: k extends keyof T ? T[k] : never;
|
|
55
|
-
}>;
|
|
56
|
-
export const mergeShapes: <U, T>(first: U, second: T) => T & U;
|
|
57
|
-
export type extendShape<A extends object, B extends object> = keyof A & keyof B extends never ? A & B : {
|
|
58
|
-
[K in keyof A as K extends keyof B ? never : K]: A[K];
|
|
59
|
-
} & {
|
|
60
|
-
[K in keyof B]: B[K];
|
|
61
|
-
};
|
|
62
|
-
export {};
|
|
63
|
-
}
|
|
64
|
-
declare const ZodParsedType: {
|
|
65
|
-
string: "string";
|
|
66
|
-
nan: "nan";
|
|
67
|
-
number: "number";
|
|
68
|
-
integer: "integer";
|
|
69
|
-
float: "float";
|
|
70
|
-
boolean: "boolean";
|
|
71
|
-
date: "date";
|
|
72
|
-
bigint: "bigint";
|
|
73
|
-
symbol: "symbol";
|
|
74
|
-
function: "function";
|
|
75
|
-
undefined: "undefined";
|
|
76
|
-
null: "null";
|
|
77
|
-
array: "array";
|
|
78
|
-
object: "object";
|
|
79
|
-
unknown: "unknown";
|
|
80
|
-
promise: "promise";
|
|
81
|
-
void: "void";
|
|
82
|
-
never: "never";
|
|
83
|
-
map: "map";
|
|
84
|
-
set: "set";
|
|
85
|
-
};
|
|
86
|
-
type ZodParsedType = keyof typeof ZodParsedType;
|
|
87
|
-
|
|
88
|
-
type allKeys<T> = T extends any ? keyof T : never;
|
|
89
|
-
type typeToFlattenedError<T, U = string> = {
|
|
90
|
-
formErrors: U[];
|
|
91
|
-
fieldErrors: {
|
|
92
|
-
[P in allKeys<T>]?: U[];
|
|
93
|
-
};
|
|
94
|
-
};
|
|
95
|
-
declare const ZodIssueCode: {
|
|
96
|
-
invalid_type: "invalid_type";
|
|
97
|
-
invalid_literal: "invalid_literal";
|
|
98
|
-
custom: "custom";
|
|
99
|
-
invalid_union: "invalid_union";
|
|
100
|
-
invalid_union_discriminator: "invalid_union_discriminator";
|
|
101
|
-
invalid_enum_value: "invalid_enum_value";
|
|
102
|
-
unrecognized_keys: "unrecognized_keys";
|
|
103
|
-
invalid_arguments: "invalid_arguments";
|
|
104
|
-
invalid_return_type: "invalid_return_type";
|
|
105
|
-
invalid_date: "invalid_date";
|
|
106
|
-
invalid_string: "invalid_string";
|
|
107
|
-
too_small: "too_small";
|
|
108
|
-
too_big: "too_big";
|
|
109
|
-
invalid_intersection_types: "invalid_intersection_types";
|
|
110
|
-
not_multiple_of: "not_multiple_of";
|
|
111
|
-
not_finite: "not_finite";
|
|
112
|
-
};
|
|
113
|
-
type ZodIssueCode = keyof typeof ZodIssueCode;
|
|
114
|
-
type ZodIssueBase = {
|
|
115
|
-
path: (string | number)[];
|
|
116
|
-
message?: string | undefined;
|
|
117
|
-
};
|
|
118
|
-
interface ZodInvalidTypeIssue extends ZodIssueBase {
|
|
119
|
-
code: typeof ZodIssueCode.invalid_type;
|
|
120
|
-
expected: ZodParsedType;
|
|
121
|
-
received: ZodParsedType;
|
|
122
|
-
}
|
|
123
|
-
interface ZodInvalidLiteralIssue extends ZodIssueBase {
|
|
124
|
-
code: typeof ZodIssueCode.invalid_literal;
|
|
125
|
-
expected: unknown;
|
|
126
|
-
received: unknown;
|
|
127
|
-
}
|
|
128
|
-
interface ZodUnrecognizedKeysIssue extends ZodIssueBase {
|
|
129
|
-
code: typeof ZodIssueCode.unrecognized_keys;
|
|
130
|
-
keys: string[];
|
|
131
|
-
}
|
|
132
|
-
interface ZodInvalidUnionIssue extends ZodIssueBase {
|
|
133
|
-
code: typeof ZodIssueCode.invalid_union;
|
|
134
|
-
unionErrors: ZodError[];
|
|
135
|
-
}
|
|
136
|
-
interface ZodInvalidUnionDiscriminatorIssue extends ZodIssueBase {
|
|
137
|
-
code: typeof ZodIssueCode.invalid_union_discriminator;
|
|
138
|
-
options: Primitive[];
|
|
139
|
-
}
|
|
140
|
-
interface ZodInvalidEnumValueIssue extends ZodIssueBase {
|
|
141
|
-
received: string | number;
|
|
142
|
-
code: typeof ZodIssueCode.invalid_enum_value;
|
|
143
|
-
options: (string | number)[];
|
|
144
|
-
}
|
|
145
|
-
interface ZodInvalidArgumentsIssue extends ZodIssueBase {
|
|
146
|
-
code: typeof ZodIssueCode.invalid_arguments;
|
|
147
|
-
argumentsError: ZodError;
|
|
148
|
-
}
|
|
149
|
-
interface ZodInvalidReturnTypeIssue extends ZodIssueBase {
|
|
150
|
-
code: typeof ZodIssueCode.invalid_return_type;
|
|
151
|
-
returnTypeError: ZodError;
|
|
152
|
-
}
|
|
153
|
-
interface ZodInvalidDateIssue extends ZodIssueBase {
|
|
154
|
-
code: typeof ZodIssueCode.invalid_date;
|
|
155
|
-
}
|
|
156
|
-
type StringValidation = "email" | "url" | "emoji" | "uuid" | "nanoid" | "regex" | "cuid" | "cuid2" | "ulid" | "datetime" | "date" | "time" | "duration" | "ip" | "cidr" | "base64" | "jwt" | "base64url" | {
|
|
157
|
-
includes: string;
|
|
158
|
-
position?: number | undefined;
|
|
159
|
-
} | {
|
|
160
|
-
startsWith: string;
|
|
161
|
-
} | {
|
|
162
|
-
endsWith: string;
|
|
163
|
-
};
|
|
164
|
-
interface ZodInvalidStringIssue extends ZodIssueBase {
|
|
165
|
-
code: typeof ZodIssueCode.invalid_string;
|
|
166
|
-
validation: StringValidation;
|
|
167
|
-
}
|
|
168
|
-
interface ZodTooSmallIssue extends ZodIssueBase {
|
|
169
|
-
code: typeof ZodIssueCode.too_small;
|
|
170
|
-
minimum: number | bigint;
|
|
171
|
-
inclusive: boolean;
|
|
172
|
-
exact?: boolean;
|
|
173
|
-
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
174
|
-
}
|
|
175
|
-
interface ZodTooBigIssue extends ZodIssueBase {
|
|
176
|
-
code: typeof ZodIssueCode.too_big;
|
|
177
|
-
maximum: number | bigint;
|
|
178
|
-
inclusive: boolean;
|
|
179
|
-
exact?: boolean;
|
|
180
|
-
type: "array" | "string" | "number" | "set" | "date" | "bigint";
|
|
181
|
-
}
|
|
182
|
-
interface ZodInvalidIntersectionTypesIssue extends ZodIssueBase {
|
|
183
|
-
code: typeof ZodIssueCode.invalid_intersection_types;
|
|
184
|
-
}
|
|
185
|
-
interface ZodNotMultipleOfIssue extends ZodIssueBase {
|
|
186
|
-
code: typeof ZodIssueCode.not_multiple_of;
|
|
187
|
-
multipleOf: number | bigint;
|
|
188
|
-
}
|
|
189
|
-
interface ZodNotFiniteIssue extends ZodIssueBase {
|
|
190
|
-
code: typeof ZodIssueCode.not_finite;
|
|
191
|
-
}
|
|
192
|
-
interface ZodCustomIssue extends ZodIssueBase {
|
|
193
|
-
code: typeof ZodIssueCode.custom;
|
|
194
|
-
params?: {
|
|
195
|
-
[k: string]: any;
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
type ZodIssueOptionalMessage = ZodInvalidTypeIssue | ZodInvalidLiteralIssue | ZodUnrecognizedKeysIssue | ZodInvalidUnionIssue | ZodInvalidUnionDiscriminatorIssue | ZodInvalidEnumValueIssue | ZodInvalidArgumentsIssue | ZodInvalidReturnTypeIssue | ZodInvalidDateIssue | ZodInvalidStringIssue | ZodTooSmallIssue | ZodTooBigIssue | ZodInvalidIntersectionTypesIssue | ZodNotMultipleOfIssue | ZodNotFiniteIssue | ZodCustomIssue;
|
|
199
|
-
type ZodIssue = ZodIssueOptionalMessage & {
|
|
200
|
-
fatal?: boolean | undefined;
|
|
201
|
-
message: string;
|
|
202
|
-
};
|
|
203
|
-
type recursiveZodFormattedError<T> = T extends [any, ...any[]] ? {
|
|
204
|
-
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
205
|
-
} : T extends any[] ? {
|
|
206
|
-
[k: number]: ZodFormattedError<T[number]>;
|
|
207
|
-
} : T extends object ? {
|
|
208
|
-
[K in keyof T]?: ZodFormattedError<T[K]>;
|
|
209
|
-
} : unknown;
|
|
210
|
-
type ZodFormattedError<T, U = string> = {
|
|
211
|
-
_errors: U[];
|
|
212
|
-
} & recursiveZodFormattedError<NonNullable<T>>;
|
|
213
|
-
declare class ZodError<T = any> extends Error {
|
|
214
|
-
issues: ZodIssue[];
|
|
215
|
-
get errors(): ZodIssue[];
|
|
216
|
-
constructor(issues: ZodIssue[]);
|
|
217
|
-
format(): ZodFormattedError<T>;
|
|
218
|
-
format<U>(mapper: (issue: ZodIssue) => U): ZodFormattedError<T, U>;
|
|
219
|
-
static create: (issues: ZodIssue[]) => ZodError<any>;
|
|
220
|
-
static assert(value: unknown): asserts value is ZodError;
|
|
221
|
-
toString(): string;
|
|
222
|
-
get message(): string;
|
|
223
|
-
get isEmpty(): boolean;
|
|
224
|
-
addIssue: (sub: ZodIssue) => void;
|
|
225
|
-
addIssues: (subs?: ZodIssue[]) => void;
|
|
226
|
-
flatten(): typeToFlattenedError<T>;
|
|
227
|
-
flatten<U>(mapper?: (issue: ZodIssue) => U): typeToFlattenedError<T, U>;
|
|
228
|
-
get formErrors(): typeToFlattenedError<T, string>;
|
|
229
|
-
}
|
|
230
|
-
type stripPath<T extends object> = T extends any ? util.OmitKeys<T, "path"> : never;
|
|
231
|
-
type IssueData = stripPath<ZodIssueOptionalMessage> & {
|
|
232
|
-
path?: (string | number)[];
|
|
233
|
-
fatal?: boolean | undefined;
|
|
234
|
-
};
|
|
235
|
-
type ErrorMapCtx = {
|
|
236
|
-
defaultError: string;
|
|
237
|
-
data: any;
|
|
238
|
-
};
|
|
239
|
-
type ZodErrorMap = (issue: ZodIssueOptionalMessage, _ctx: ErrorMapCtx) => {
|
|
240
|
-
message: string;
|
|
241
|
-
};
|
|
242
|
-
|
|
243
|
-
type ParseParams = {
|
|
244
|
-
path: (string | number)[];
|
|
245
|
-
errorMap: ZodErrorMap;
|
|
246
|
-
async: boolean;
|
|
247
|
-
};
|
|
248
|
-
type ParsePathComponent = string | number;
|
|
249
|
-
type ParsePath = ParsePathComponent[];
|
|
250
|
-
interface ParseContext {
|
|
251
|
-
readonly common: {
|
|
252
|
-
readonly issues: ZodIssue[];
|
|
253
|
-
readonly contextualErrorMap?: ZodErrorMap | undefined;
|
|
254
|
-
readonly async: boolean;
|
|
255
|
-
};
|
|
256
|
-
readonly path: ParsePath;
|
|
257
|
-
readonly schemaErrorMap?: ZodErrorMap | undefined;
|
|
258
|
-
readonly parent: ParseContext | null;
|
|
259
|
-
readonly data: any;
|
|
260
|
-
readonly parsedType: ZodParsedType;
|
|
261
|
-
}
|
|
262
|
-
type ParseInput = {
|
|
263
|
-
data: any;
|
|
264
|
-
path: (string | number)[];
|
|
265
|
-
parent: ParseContext;
|
|
266
|
-
};
|
|
267
|
-
declare class ParseStatus {
|
|
268
|
-
value: "aborted" | "dirty" | "valid";
|
|
269
|
-
dirty(): void;
|
|
270
|
-
abort(): void;
|
|
271
|
-
static mergeArray(status: ParseStatus, results: SyncParseReturnType<any>[]): SyncParseReturnType;
|
|
272
|
-
static mergeObjectAsync(status: ParseStatus, pairs: {
|
|
273
|
-
key: ParseReturnType<any>;
|
|
274
|
-
value: ParseReturnType<any>;
|
|
275
|
-
}[]): Promise<SyncParseReturnType<any>>;
|
|
276
|
-
static mergeObjectSync(status: ParseStatus, pairs: {
|
|
277
|
-
key: SyncParseReturnType<any>;
|
|
278
|
-
value: SyncParseReturnType<any>;
|
|
279
|
-
alwaysSet?: boolean;
|
|
280
|
-
}[]): SyncParseReturnType;
|
|
281
|
-
}
|
|
282
|
-
type INVALID = {
|
|
283
|
-
status: "aborted";
|
|
284
|
-
};
|
|
285
|
-
declare const INVALID: INVALID;
|
|
286
|
-
type DIRTY<T> = {
|
|
287
|
-
status: "dirty";
|
|
288
|
-
value: T;
|
|
289
|
-
};
|
|
290
|
-
declare const DIRTY: <T>(value: T) => DIRTY<T>;
|
|
291
|
-
type OK<T> = {
|
|
292
|
-
status: "valid";
|
|
293
|
-
value: T;
|
|
294
|
-
};
|
|
295
|
-
declare const OK: <T>(value: T) => OK<T>;
|
|
296
|
-
type SyncParseReturnType<T = any> = OK<T> | DIRTY<T> | INVALID;
|
|
297
|
-
type AsyncParseReturnType<T> = Promise<SyncParseReturnType<T>>;
|
|
298
|
-
type ParseReturnType<T> = SyncParseReturnType<T> | AsyncParseReturnType<T>;
|
|
299
|
-
|
|
300
|
-
declare namespace errorUtil {
|
|
301
|
-
type ErrMessage = string | {
|
|
302
|
-
message?: string | undefined;
|
|
303
|
-
};
|
|
304
|
-
const errToObj: (message?: ErrMessage) => {
|
|
305
|
-
message?: string | undefined;
|
|
306
|
-
};
|
|
307
|
-
const toString: (message?: ErrMessage) => string | undefined;
|
|
308
|
-
}
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* The Standard Schema interface.
|
|
312
|
-
*/
|
|
313
|
-
type StandardSchemaV1<Input = unknown, Output = Input> = {
|
|
314
|
-
/**
|
|
315
|
-
* The Standard Schema properties.
|
|
316
|
-
*/
|
|
317
|
-
readonly "~standard": StandardSchemaV1.Props<Input, Output>;
|
|
318
|
-
};
|
|
319
|
-
declare namespace StandardSchemaV1 {
|
|
320
|
-
/**
|
|
321
|
-
* The Standard Schema properties interface.
|
|
322
|
-
*/
|
|
323
|
-
export interface Props<Input = unknown, Output = Input> {
|
|
324
|
-
/**
|
|
325
|
-
* The version number of the standard.
|
|
326
|
-
*/
|
|
327
|
-
readonly version: 1;
|
|
328
|
-
/**
|
|
329
|
-
* The vendor name of the schema library.
|
|
330
|
-
*/
|
|
331
|
-
readonly vendor: string;
|
|
332
|
-
/**
|
|
333
|
-
* Validates unknown input values.
|
|
334
|
-
*/
|
|
335
|
-
readonly validate: (value: unknown) => Result<Output> | Promise<Result<Output>>;
|
|
336
|
-
/**
|
|
337
|
-
* Inferred types associated with the schema.
|
|
338
|
-
*/
|
|
339
|
-
readonly types?: Types<Input, Output> | undefined;
|
|
340
|
-
}
|
|
341
|
-
/**
|
|
342
|
-
* The result interface of the validate function.
|
|
343
|
-
*/
|
|
344
|
-
export type Result<Output> = SuccessResult<Output> | FailureResult;
|
|
345
|
-
/**
|
|
346
|
-
* The result interface if validation succeeds.
|
|
347
|
-
*/
|
|
348
|
-
export interface SuccessResult<Output> {
|
|
349
|
-
/**
|
|
350
|
-
* The typed output value.
|
|
351
|
-
*/
|
|
352
|
-
readonly value: Output;
|
|
353
|
-
/**
|
|
354
|
-
* The non-existent issues.
|
|
355
|
-
*/
|
|
356
|
-
readonly issues?: undefined;
|
|
357
|
-
}
|
|
358
|
-
/**
|
|
359
|
-
* The result interface if validation fails.
|
|
360
|
-
*/
|
|
361
|
-
export interface FailureResult {
|
|
362
|
-
/**
|
|
363
|
-
* The issues of failed validation.
|
|
364
|
-
*/
|
|
365
|
-
readonly issues: ReadonlyArray<Issue>;
|
|
366
|
-
}
|
|
367
|
-
/**
|
|
368
|
-
* The issue interface of the failure output.
|
|
369
|
-
*/
|
|
370
|
-
export interface Issue {
|
|
371
|
-
/**
|
|
372
|
-
* The error message of the issue.
|
|
373
|
-
*/
|
|
374
|
-
readonly message: string;
|
|
375
|
-
/**
|
|
376
|
-
* The path of the issue, if any.
|
|
377
|
-
*/
|
|
378
|
-
readonly path?: ReadonlyArray<PropertyKey | PathSegment> | undefined;
|
|
379
|
-
}
|
|
380
|
-
/**
|
|
381
|
-
* The path segment interface of the issue.
|
|
382
|
-
*/
|
|
383
|
-
export interface PathSegment {
|
|
384
|
-
/**
|
|
385
|
-
* The key representing a path segment.
|
|
386
|
-
*/
|
|
387
|
-
readonly key: PropertyKey;
|
|
388
|
-
}
|
|
389
|
-
/**
|
|
390
|
-
* The Standard Schema types interface.
|
|
391
|
-
*/
|
|
392
|
-
export interface Types<Input = unknown, Output = Input> {
|
|
393
|
-
/**
|
|
394
|
-
* The input type of the schema.
|
|
395
|
-
*/
|
|
396
|
-
readonly input: Input;
|
|
397
|
-
/**
|
|
398
|
-
* The output type of the schema.
|
|
399
|
-
*/
|
|
400
|
-
readonly output: Output;
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Infers the input type of a Standard Schema.
|
|
404
|
-
*/
|
|
405
|
-
export type InferInput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["input"];
|
|
406
|
-
/**
|
|
407
|
-
* Infers the output type of a Standard Schema.
|
|
408
|
-
*/
|
|
409
|
-
export type InferOutput<Schema extends StandardSchemaV1> = NonNullable<Schema["~standard"]["types"]>["output"];
|
|
410
|
-
export {};
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
interface RefinementCtx {
|
|
414
|
-
addIssue: (arg: IssueData) => void;
|
|
415
|
-
path: (string | number)[];
|
|
416
|
-
}
|
|
417
|
-
type ZodTypeAny = ZodType<any, any, any>;
|
|
418
|
-
type TypeOf<T extends ZodType<any, any, any>> = T["_output"];
|
|
419
|
-
type input<T extends ZodType<any, any, any>> = T["_input"];
|
|
420
|
-
type output<T extends ZodType<any, any, any>> = T["_output"];
|
|
421
|
-
|
|
422
|
-
type CustomErrorParams = Partial<util.Omit<ZodCustomIssue, "code">>;
|
|
423
|
-
interface ZodTypeDef {
|
|
424
|
-
errorMap?: ZodErrorMap | undefined;
|
|
425
|
-
description?: string | undefined;
|
|
426
|
-
}
|
|
427
|
-
type RawCreateParams = {
|
|
428
|
-
errorMap?: ZodErrorMap | undefined;
|
|
429
|
-
invalid_type_error?: string | undefined;
|
|
430
|
-
required_error?: string | undefined;
|
|
431
|
-
message?: string | undefined;
|
|
432
|
-
description?: string | undefined;
|
|
433
|
-
} | undefined;
|
|
434
|
-
type SafeParseSuccess<Output> = {
|
|
435
|
-
success: true;
|
|
436
|
-
data: Output;
|
|
437
|
-
error?: never;
|
|
438
|
-
};
|
|
439
|
-
type SafeParseError<Input> = {
|
|
440
|
-
success: false;
|
|
441
|
-
error: ZodError<Input>;
|
|
442
|
-
data?: never;
|
|
443
|
-
};
|
|
444
|
-
type SafeParseReturnType<Input, Output> = SafeParseSuccess<Output> | SafeParseError<Input>;
|
|
445
|
-
declare abstract class ZodType<Output = any, Def extends ZodTypeDef = ZodTypeDef, Input = Output> {
|
|
446
|
-
readonly _type: Output;
|
|
447
|
-
readonly _output: Output;
|
|
448
|
-
readonly _input: Input;
|
|
449
|
-
readonly _def: Def;
|
|
450
|
-
get description(): string | undefined;
|
|
451
|
-
"~standard": StandardSchemaV1.Props<Input, Output>;
|
|
452
|
-
abstract _parse(input: ParseInput): ParseReturnType<Output>;
|
|
453
|
-
_getType(input: ParseInput): string;
|
|
454
|
-
_getOrReturnCtx(input: ParseInput, ctx?: ParseContext | undefined): ParseContext;
|
|
455
|
-
_processInputParams(input: ParseInput): {
|
|
456
|
-
status: ParseStatus;
|
|
457
|
-
ctx: ParseContext;
|
|
458
|
-
};
|
|
459
|
-
_parseSync(input: ParseInput): SyncParseReturnType<Output>;
|
|
460
|
-
_parseAsync(input: ParseInput): AsyncParseReturnType<Output>;
|
|
461
|
-
parse(data: unknown, params?: util.InexactPartial<ParseParams>): Output;
|
|
462
|
-
safeParse(data: unknown, params?: util.InexactPartial<ParseParams>): SafeParseReturnType<Input, Output>;
|
|
463
|
-
"~validate"(data: unknown): StandardSchemaV1.Result<Output> | Promise<StandardSchemaV1.Result<Output>>;
|
|
464
|
-
parseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<Output>;
|
|
465
|
-
safeParseAsync(data: unknown, params?: util.InexactPartial<ParseParams>): Promise<SafeParseReturnType<Input, Output>>;
|
|
466
|
-
/** Alias of safeParseAsync */
|
|
467
|
-
spa: (data: unknown, params?: util.InexactPartial<ParseParams>) => Promise<SafeParseReturnType<Input, Output>>;
|
|
468
|
-
refine<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, RefinedOutput, Input>;
|
|
469
|
-
refine(check: (arg: Output) => unknown | Promise<unknown>, message?: string | CustomErrorParams | ((arg: Output) => CustomErrorParams)): ZodEffects<this, Output, Input>;
|
|
470
|
-
refinement<RefinedOutput extends Output>(check: (arg: Output) => arg is RefinedOutput, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, RefinedOutput, Input>;
|
|
471
|
-
refinement(check: (arg: Output) => boolean, refinementData: IssueData | ((arg: Output, ctx: RefinementCtx) => IssueData)): ZodEffects<this, Output, Input>;
|
|
472
|
-
_refinement(refinement: RefinementEffect<Output>["refinement"]): ZodEffects<this, Output, Input>;
|
|
473
|
-
superRefine<RefinedOutput extends Output>(refinement: (arg: Output, ctx: RefinementCtx) => arg is RefinedOutput): ZodEffects<this, RefinedOutput, Input>;
|
|
474
|
-
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => void): ZodEffects<this, Output, Input>;
|
|
475
|
-
superRefine(refinement: (arg: Output, ctx: RefinementCtx) => Promise<void>): ZodEffects<this, Output, Input>;
|
|
476
|
-
constructor(def: Def);
|
|
477
|
-
optional(): ZodOptional<this>;
|
|
478
|
-
nullable(): ZodNullable<this>;
|
|
479
|
-
nullish(): ZodOptional<ZodNullable<this>>;
|
|
480
|
-
array(): ZodArray<this>;
|
|
481
|
-
promise(): ZodPromise<this>;
|
|
482
|
-
or<T extends ZodTypeAny>(option: T): ZodUnion<[this, T]>;
|
|
483
|
-
and<T extends ZodTypeAny>(incoming: T): ZodIntersection<this, T>;
|
|
484
|
-
transform<NewOut>(transform: (arg: Output, ctx: RefinementCtx) => NewOut | Promise<NewOut>): ZodEffects<this, NewOut>;
|
|
485
|
-
default(def: util.noUndefined<Input>): ZodDefault<this>;
|
|
486
|
-
default(def: () => util.noUndefined<Input>): ZodDefault<this>;
|
|
487
|
-
brand<B extends string | number | symbol>(brand?: B): ZodBranded<this, B>;
|
|
488
|
-
catch(def: Output): ZodCatch<this>;
|
|
489
|
-
catch(def: (ctx: {
|
|
490
|
-
error: ZodError;
|
|
491
|
-
input: Input;
|
|
492
|
-
}) => Output): ZodCatch<this>;
|
|
493
|
-
describe(description: string): this;
|
|
494
|
-
pipe<T extends ZodTypeAny>(target: T): ZodPipeline<this, T>;
|
|
495
|
-
readonly(): ZodReadonly<this>;
|
|
496
|
-
isOptional(): boolean;
|
|
497
|
-
isNullable(): boolean;
|
|
498
|
-
}
|
|
499
|
-
interface ZodArrayDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
500
|
-
type: T;
|
|
501
|
-
typeName: ZodFirstPartyTypeKind.ZodArray;
|
|
502
|
-
exactLength: {
|
|
503
|
-
value: number;
|
|
504
|
-
message?: string | undefined;
|
|
505
|
-
} | null;
|
|
506
|
-
minLength: {
|
|
507
|
-
value: number;
|
|
508
|
-
message?: string | undefined;
|
|
509
|
-
} | null;
|
|
510
|
-
maxLength: {
|
|
511
|
-
value: number;
|
|
512
|
-
message?: string | undefined;
|
|
513
|
-
} | null;
|
|
514
|
-
}
|
|
515
|
-
type ArrayCardinality = "many" | "atleastone";
|
|
516
|
-
type arrayOutputType<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> = Cardinality extends "atleastone" ? [T["_output"], ...T["_output"][]] : T["_output"][];
|
|
517
|
-
declare class ZodArray<T extends ZodTypeAny, Cardinality extends ArrayCardinality = "many"> extends ZodType<arrayOutputType<T, Cardinality>, ZodArrayDef<T>, Cardinality extends "atleastone" ? [T["_input"], ...T["_input"][]] : T["_input"][]> {
|
|
518
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
519
|
-
get element(): T;
|
|
520
|
-
min(minLength: number, message?: errorUtil.ErrMessage): this;
|
|
521
|
-
max(maxLength: number, message?: errorUtil.ErrMessage): this;
|
|
522
|
-
length(len: number, message?: errorUtil.ErrMessage): this;
|
|
523
|
-
nonempty(message?: errorUtil.ErrMessage): ZodArray<T, "atleastone">;
|
|
524
|
-
static create: <El extends ZodTypeAny>(schema: El, params?: RawCreateParams) => ZodArray<El>;
|
|
525
|
-
}
|
|
526
|
-
type ZodUnionOptions = Readonly<[ZodTypeAny, ...ZodTypeAny[]]>;
|
|
527
|
-
interface ZodUnionDef<T extends ZodUnionOptions = Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>> extends ZodTypeDef {
|
|
528
|
-
options: T;
|
|
529
|
-
typeName: ZodFirstPartyTypeKind.ZodUnion;
|
|
530
|
-
}
|
|
531
|
-
declare class ZodUnion<T extends ZodUnionOptions> extends ZodType<T[number]["_output"], ZodUnionDef<T>, T[number]["_input"]> {
|
|
532
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
533
|
-
get options(): T;
|
|
534
|
-
static create: <Options extends Readonly<[ZodTypeAny, ZodTypeAny, ...ZodTypeAny[]]>>(types: Options, params?: RawCreateParams) => ZodUnion<Options>;
|
|
535
|
-
}
|
|
536
|
-
interface ZodIntersectionDef<T extends ZodTypeAny = ZodTypeAny, U extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
537
|
-
left: T;
|
|
538
|
-
right: U;
|
|
539
|
-
typeName: ZodFirstPartyTypeKind.ZodIntersection;
|
|
540
|
-
}
|
|
541
|
-
declare class ZodIntersection<T extends ZodTypeAny, U extends ZodTypeAny> extends ZodType<T["_output"] & U["_output"], ZodIntersectionDef<T, U>, T["_input"] & U["_input"]> {
|
|
542
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
543
|
-
static create: <TSchema extends ZodTypeAny, USchema extends ZodTypeAny>(left: TSchema, right: USchema, params?: RawCreateParams) => ZodIntersection<TSchema, USchema>;
|
|
544
|
-
}
|
|
545
|
-
interface ZodPromiseDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
546
|
-
type: T;
|
|
547
|
-
typeName: ZodFirstPartyTypeKind.ZodPromise;
|
|
548
|
-
}
|
|
549
|
-
declare class ZodPromise<T extends ZodTypeAny> extends ZodType<Promise<T["_output"]>, ZodPromiseDef<T>, Promise<T["_input"]>> {
|
|
550
|
-
unwrap(): T;
|
|
551
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
552
|
-
static create: <Inner extends ZodTypeAny>(schema: Inner, params?: RawCreateParams) => ZodPromise<Inner>;
|
|
553
|
-
}
|
|
554
|
-
type RefinementEffect<T> = {
|
|
555
|
-
type: "refinement";
|
|
556
|
-
refinement: (arg: T, ctx: RefinementCtx) => any;
|
|
557
|
-
};
|
|
558
|
-
type TransformEffect<T> = {
|
|
559
|
-
type: "transform";
|
|
560
|
-
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
561
|
-
};
|
|
562
|
-
type PreprocessEffect<T> = {
|
|
563
|
-
type: "preprocess";
|
|
564
|
-
transform: (arg: T, ctx: RefinementCtx) => any;
|
|
565
|
-
};
|
|
566
|
-
type Effect<T> = RefinementEffect<T> | TransformEffect<T> | PreprocessEffect<T>;
|
|
567
|
-
interface ZodEffectsDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
568
|
-
schema: T;
|
|
569
|
-
typeName: ZodFirstPartyTypeKind.ZodEffects;
|
|
570
|
-
effect: Effect<any>;
|
|
571
|
-
}
|
|
572
|
-
declare class ZodEffects<T extends ZodTypeAny, Output = output<T>, Input = input<T>> extends ZodType<Output, ZodEffectsDef<T>, Input> {
|
|
573
|
-
innerType(): T;
|
|
574
|
-
sourceType(): T;
|
|
575
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
576
|
-
static create: <I extends ZodTypeAny>(schema: I, effect: Effect<I["_output"]>, params?: RawCreateParams) => ZodEffects<I, I["_output"]>;
|
|
577
|
-
static createWithPreprocess: <I extends ZodTypeAny>(preprocess: (arg: unknown, ctx: RefinementCtx) => unknown, schema: I, params?: RawCreateParams) => ZodEffects<I, I["_output"], unknown>;
|
|
578
|
-
}
|
|
579
|
-
|
|
580
|
-
interface ZodOptionalDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
581
|
-
innerType: T;
|
|
582
|
-
typeName: ZodFirstPartyTypeKind.ZodOptional;
|
|
583
|
-
}
|
|
584
|
-
declare class ZodOptional<T extends ZodTypeAny> extends ZodType<T["_output"] | undefined, ZodOptionalDef<T>, T["_input"] | undefined> {
|
|
585
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
586
|
-
unwrap(): T;
|
|
587
|
-
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodOptional<Inner>;
|
|
588
|
-
}
|
|
589
|
-
interface ZodNullableDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
590
|
-
innerType: T;
|
|
591
|
-
typeName: ZodFirstPartyTypeKind.ZodNullable;
|
|
592
|
-
}
|
|
593
|
-
declare class ZodNullable<T extends ZodTypeAny> extends ZodType<T["_output"] | null, ZodNullableDef<T>, T["_input"] | null> {
|
|
594
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
595
|
-
unwrap(): T;
|
|
596
|
-
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodNullable<Inner>;
|
|
597
|
-
}
|
|
598
|
-
interface ZodDefaultDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
599
|
-
innerType: T;
|
|
600
|
-
defaultValue: () => util.noUndefined<T["_input"]>;
|
|
601
|
-
typeName: ZodFirstPartyTypeKind.ZodDefault;
|
|
602
|
-
}
|
|
603
|
-
declare class ZodDefault<T extends ZodTypeAny> extends ZodType<util.noUndefined<T["_output"]>, ZodDefaultDef<T>, T["_input"] | undefined> {
|
|
604
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
605
|
-
removeDefault(): T;
|
|
606
|
-
static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
|
|
607
|
-
default: Inner["_input"] | (() => util.noUndefined<Inner["_input"]>);
|
|
608
|
-
}) => ZodDefault<Inner>;
|
|
609
|
-
}
|
|
610
|
-
interface ZodCatchDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
611
|
-
innerType: T;
|
|
612
|
-
catchValue: (ctx: {
|
|
613
|
-
error: ZodError;
|
|
614
|
-
input: unknown;
|
|
615
|
-
}) => T["_input"];
|
|
616
|
-
typeName: ZodFirstPartyTypeKind.ZodCatch;
|
|
617
|
-
}
|
|
618
|
-
declare class ZodCatch<T extends ZodTypeAny> extends ZodType<T["_output"], ZodCatchDef<T>, unknown> {
|
|
619
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
620
|
-
removeCatch(): T;
|
|
621
|
-
static create: <Inner extends ZodTypeAny>(type: Inner, params: RawCreateParams & {
|
|
622
|
-
catch: Inner["_output"] | (() => Inner["_output"]);
|
|
623
|
-
}) => ZodCatch<Inner>;
|
|
624
|
-
}
|
|
625
|
-
interface ZodBrandedDef<T extends ZodTypeAny> extends ZodTypeDef {
|
|
626
|
-
type: T;
|
|
627
|
-
typeName: ZodFirstPartyTypeKind.ZodBranded;
|
|
628
|
-
}
|
|
629
|
-
declare const BRAND: unique symbol;
|
|
630
|
-
type BRAND<T extends string | number | symbol> = {
|
|
631
|
-
[BRAND]: {
|
|
632
|
-
[k in T]: true;
|
|
633
|
-
};
|
|
634
|
-
};
|
|
635
|
-
declare class ZodBranded<T extends ZodTypeAny, B extends string | number | symbol> extends ZodType<T["_output"] & BRAND<B>, ZodBrandedDef<T>, T["_input"]> {
|
|
636
|
-
_parse(input: ParseInput): ParseReturnType<any>;
|
|
637
|
-
unwrap(): T;
|
|
638
|
-
}
|
|
639
|
-
interface ZodPipelineDef<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodTypeDef {
|
|
640
|
-
in: A;
|
|
641
|
-
out: B;
|
|
642
|
-
typeName: ZodFirstPartyTypeKind.ZodPipeline;
|
|
643
|
-
}
|
|
644
|
-
declare class ZodPipeline<A extends ZodTypeAny, B extends ZodTypeAny> extends ZodType<B["_output"], ZodPipelineDef<A, B>, A["_input"]> {
|
|
645
|
-
_parse(input: ParseInput): ParseReturnType<any>;
|
|
646
|
-
static create<ASchema extends ZodTypeAny, BSchema extends ZodTypeAny>(a: ASchema, b: BSchema): ZodPipeline<ASchema, BSchema>;
|
|
647
|
-
}
|
|
648
|
-
type BuiltIn = (((...args: any[]) => any) | (new (...args: any[]) => any)) | {
|
|
649
|
-
readonly [Symbol.toStringTag]: string;
|
|
650
|
-
} | Date | Error | Generator | Promise<unknown> | RegExp;
|
|
651
|
-
type MakeReadonly<T> = T extends Map<infer K, infer V> ? ReadonlyMap<K, V> : T extends Set<infer V> ? ReadonlySet<V> : T extends [infer Head, ...infer Tail] ? readonly [Head, ...Tail] : T extends Array<infer V> ? ReadonlyArray<V> : T extends BuiltIn ? T : Readonly<T>;
|
|
652
|
-
interface ZodReadonlyDef<T extends ZodTypeAny = ZodTypeAny> extends ZodTypeDef {
|
|
653
|
-
innerType: T;
|
|
654
|
-
typeName: ZodFirstPartyTypeKind.ZodReadonly;
|
|
655
|
-
}
|
|
656
|
-
declare class ZodReadonly<T extends ZodTypeAny> extends ZodType<MakeReadonly<T["_output"]>, ZodReadonlyDef<T>, MakeReadonly<T["_input"]>> {
|
|
657
|
-
_parse(input: ParseInput): ParseReturnType<this["_output"]>;
|
|
658
|
-
static create: <Inner extends ZodTypeAny>(type: Inner, params?: RawCreateParams) => ZodReadonly<Inner>;
|
|
659
|
-
unwrap(): T;
|
|
660
|
-
}
|
|
661
|
-
declare enum ZodFirstPartyTypeKind {
|
|
662
|
-
ZodString = "ZodString",
|
|
663
|
-
ZodNumber = "ZodNumber",
|
|
664
|
-
ZodNaN = "ZodNaN",
|
|
665
|
-
ZodBigInt = "ZodBigInt",
|
|
666
|
-
ZodBoolean = "ZodBoolean",
|
|
667
|
-
ZodDate = "ZodDate",
|
|
668
|
-
ZodSymbol = "ZodSymbol",
|
|
669
|
-
ZodUndefined = "ZodUndefined",
|
|
670
|
-
ZodNull = "ZodNull",
|
|
671
|
-
ZodAny = "ZodAny",
|
|
672
|
-
ZodUnknown = "ZodUnknown",
|
|
673
|
-
ZodNever = "ZodNever",
|
|
674
|
-
ZodVoid = "ZodVoid",
|
|
675
|
-
ZodArray = "ZodArray",
|
|
676
|
-
ZodObject = "ZodObject",
|
|
677
|
-
ZodUnion = "ZodUnion",
|
|
678
|
-
ZodDiscriminatedUnion = "ZodDiscriminatedUnion",
|
|
679
|
-
ZodIntersection = "ZodIntersection",
|
|
680
|
-
ZodTuple = "ZodTuple",
|
|
681
|
-
ZodRecord = "ZodRecord",
|
|
682
|
-
ZodMap = "ZodMap",
|
|
683
|
-
ZodSet = "ZodSet",
|
|
684
|
-
ZodFunction = "ZodFunction",
|
|
685
|
-
ZodLazy = "ZodLazy",
|
|
686
|
-
ZodLiteral = "ZodLiteral",
|
|
687
|
-
ZodEnum = "ZodEnum",
|
|
688
|
-
ZodEffects = "ZodEffects",
|
|
689
|
-
ZodNativeEnum = "ZodNativeEnum",
|
|
690
|
-
ZodOptional = "ZodOptional",
|
|
691
|
-
ZodNullable = "ZodNullable",
|
|
692
|
-
ZodDefault = "ZodDefault",
|
|
693
|
-
ZodCatch = "ZodCatch",
|
|
694
|
-
ZodPromise = "ZodPromise",
|
|
695
|
-
ZodBranded = "ZodBranded",
|
|
696
|
-
ZodPipeline = "ZodPipeline",
|
|
697
|
-
ZodReadonly = "ZodReadonly"
|
|
698
|
-
}
|
|
1
|
+
import { z } from 'zod';
|
|
699
2
|
|
|
700
3
|
interface BusrootSignals {
|
|
701
4
|
timestamp?: number;
|
|
@@ -784,7 +87,7 @@ declare const StationSchema = z.object({
|
|
|
784
87
|
archivedAt: z.string().nullish(),
|
|
785
88
|
});
|
|
786
89
|
|
|
787
|
-
type StationSchema =
|
|
90
|
+
type StationSchema = z.infer<typeof StationSchema>;
|
|
788
91
|
|
|
789
92
|
declare const ApiKeySchema = z.object({
|
|
790
93
|
accountId: z.string(),
|
|
@@ -794,7 +97,7 @@ declare const ApiKeySchema = z.object({
|
|
|
794
97
|
createdAt: z.string().optional(),
|
|
795
98
|
updatedAt: z.string().optional(),
|
|
796
99
|
});
|
|
797
|
-
type ApiKeySchema =
|
|
100
|
+
type ApiKeySchema = z.infer<typeof ApiKeySchema>;
|
|
798
101
|
|
|
799
102
|
declare const PlantViewModel = z.object({
|
|
800
103
|
code: z.string(),
|
|
@@ -805,7 +108,7 @@ declare const PlantViewModel = z.object({
|
|
|
805
108
|
dayStartHour: z.number(),
|
|
806
109
|
});
|
|
807
110
|
|
|
808
|
-
type PlantViewModel =
|
|
111
|
+
type PlantViewModel = z.infer<typeof PlantViewModel>;
|
|
809
112
|
|
|
810
113
|
declare const SkuViewModel = z.object({
|
|
811
114
|
code: z.string(),
|
|
@@ -822,7 +125,7 @@ declare const SkuViewModel = z.object({
|
|
|
822
125
|
value: z.number().nullish(),
|
|
823
126
|
minimumCycleTime: z.number().nullish(),
|
|
824
127
|
});
|
|
825
|
-
type SkuViewModel =
|
|
128
|
+
type SkuViewModel = z.infer<typeof SkuViewModel>;
|
|
826
129
|
|
|
827
130
|
type ApiKeyViewModel = ApiKeySchema;
|
|
828
131
|
|
|
@@ -881,7 +184,7 @@ declare const ScheduleViewModel = z.object({
|
|
|
881
184
|
priorityAt: z.string().optional(),
|
|
882
185
|
});
|
|
883
186
|
|
|
884
|
-
type ScheduleViewModel =
|
|
187
|
+
type ScheduleViewModel = z.infer<typeof ScheduleViewModel>;
|
|
885
188
|
|
|
886
189
|
declare const StationViewModel = z.object({
|
|
887
190
|
code: z.string(), // from station table
|
|
@@ -943,7 +246,7 @@ declare const StationViewModel = z.object({
|
|
|
943
246
|
lastStationWindow: StationWindowViewModel.nullish(),
|
|
944
247
|
});
|
|
945
248
|
|
|
946
|
-
type StationViewModel =
|
|
249
|
+
type StationViewModel = z.infer<typeof StationViewModel>;
|
|
947
250
|
|
|
948
251
|
declare const AccountViewModel = AccountSchema.merge(
|
|
949
252
|
z.object({
|
|
@@ -967,7 +270,7 @@ declare const AccountViewModel = AccountSchema.merge(
|
|
|
967
270
|
}),
|
|
968
271
|
);
|
|
969
272
|
|
|
970
|
-
type AccountViewModel =
|
|
273
|
+
type AccountViewModel = z.infer<typeof AccountViewModel>;
|
|
971
274
|
|
|
972
275
|
export { AccountViewModel, PlantViewModel, ScheduleViewModel, SkuViewModel, StationSchema, StationViewModel };
|
|
973
276
|
export type { ApiKeyViewModel, BusrootSignals, PlantSchema };
|
package/build/example.d.ts
CHANGED
package/build/hooks.d.ts
CHANGED
|
@@ -5,16 +5,15 @@ export declare const ConfigPayloadSchema: z.ZodObject<{
|
|
|
5
5
|
apiKey: z.ZodString;
|
|
6
6
|
host: z.ZodString;
|
|
7
7
|
}, "strip", z.ZodTypeAny, {
|
|
8
|
-
host: string;
|
|
9
8
|
accountId: string;
|
|
9
|
+
host: string;
|
|
10
10
|
apiKey: string;
|
|
11
11
|
}, {
|
|
12
|
-
host: string;
|
|
13
12
|
accountId: string;
|
|
13
|
+
host: string;
|
|
14
14
|
apiKey: string;
|
|
15
15
|
}>;
|
|
16
16
|
export declare function useBusroot(): {
|
|
17
17
|
client: Client | undefined;
|
|
18
18
|
logout: () => void;
|
|
19
19
|
};
|
|
20
|
-
//# sourceMappingURL=hooks.d.ts.map
|
package/build/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "busroot-sdk",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "An SDK for accessing Busroot.",
|
|
3
|
+
"version": "0.0.2",
|
|
4
|
+
"description": "An SDK for accessing Busroot from output.industries",
|
|
5
5
|
"homepage": "https://www.output.industries",
|
|
6
6
|
"main": "./build/index.js",
|
|
7
7
|
"types": "./build/index.d.ts",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"scripts": {
|
|
10
10
|
"example": "ts-node -r dotenv-expand/config ./src/example.ts",
|
|
11
11
|
"dev": "pnpm run lint && tsc -b --watch",
|
|
12
|
-
"build": "pnpm
|
|
12
|
+
"build": "pnpm run lint && tsc --build --clean && tsc --build && pnpm run rollup",
|
|
13
13
|
"lint": "eslint 'src/**/*.ts'",
|
|
14
14
|
"test": "jest",
|
|
15
15
|
"rollup": "rollup -c"
|
package/build/client.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,cAAc,EACd,iBAAiB,EACjB,cAAc,EACd,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EAChB,MAAM,iBAAiB,CAAC;AACzB,OAAO,IAAI,MAAM,oBAAoB,CAAC;AAEtC,eAAO,MAAM,aAAa;;;;;;;CAOzB,CAAC;AACF,MAAM,MAAM,aAAa,GAAG,MAAM,OAAO,aAAa,CAAC;AAEvD,MAAM,MAAM,QAAQ,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;AAS1C,cAAM,MAAM;IAKS,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;IAJ9E,UAAU,EAAE,IAAI,CAAC,UAAU,CAAC;IAC5B,oBAAoB,wIAAwD;IAC5E,MAAM,EAAE,MAAM,CAAC;gBAEI,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE;IA4C9E,OAAO;YAIO,GAAG;YAyBH,IAAI;IAYlB,IAAI,OAAO;;MAQV;IAED,IAAI,OAAO;yBAEgB,MAAM,aAAa,MAAM,KAAG,OAAO,CAAC;YAAE,OAAO,EAAE,gBAAgB,CAAC;YAAC,MAAM,EAAE,MAAM,CAAA;SAAE,CAAC;MAM5G;IAED,IAAI,MAAM;sBAEY,OAAO,CAAC,eAAe,CAAC;MAM7C;IAED,IAAI,KAAK;yBAEkB,MAAM,KAAG,OAAO,CAAC,cAAc,CAAC;gCAKzB,OAAO,CAAC,WAAW,CAAC,KAAG,OAAO,CAAC,cAAc,CAAC;MAM/E;IAED,IAAI,OAAO;2BAEkB,MAAM,KAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;gCAK/B,OAAO,CAAC,aAAa,CAAC,KAAG,OAAO,CAAC,gBAAgB,CAAC;8BAK1D,MAAM,WAAW,cAAc,KAAG,IAAI;MAI/D;IAED,GAAG;uBACoB,MAAM,KAAG,OAAO,CAAC,YAAY,CAAC;4BAKzB,OAAO,CAAC,YAAY,CAAC,KAAG,OAAO,CAAC,YAAY,CAAC;MAKvE;IAEF,QAAQ;0BACkB,MAAM,KAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;iCAK9B,OAAO,CAAC,iBAAiB,CAAC,KAAG,OAAO,CAAC,iBAAiB,CAAC;MAKtF;IAEF,EAAE,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ;IAU3C,GAAG,CAAC,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,QAAQ;CAW7C;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.test.d.ts","sourceRoot":"","sources":["../src/client.test.ts"],"names":[],"mappings":""}
|
package/build/example.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":""}
|
package/build/hooks.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["../src/hooks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,eAAO,MAAM,mBAAmB;;;;;;;;;;;;EAI9B,CAAC;AAEH,wBAAgB,UAAU;;;EA6BzB"}
|
package/build/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|