@kohost/api-client 7.24.0 → 7.25.1
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/dist/.tsbuildinfo +1 -1
- package/dist/lib/vendorDocuments.d.ts +23 -0
- package/dist/lib/vendorPrivateDetails.d.ts +35 -0
- package/dist/models/order.d.ts +17 -0
- package/dist/models/system.js +2 -0
- package/dist/models/system.js.map +1 -1
- package/dist/models/vendorProfile.d.ts +17 -0
- package/dist/schemas/order.d.ts +186 -0
- package/dist/schemas/system.d.ts +32 -1
- package/dist/schemas/system.js +24 -1
- package/dist/schemas/system.js.map +1 -1
- package/dist/schemas/thermostat.d.ts +0 -1
- package/dist/schemas/thermostat.js +1 -2
- package/dist/schemas/thermostat.js.map +1 -1
- package/dist/schemas/vendorProfile.d.ts +188 -0
- package/dist/useCases/addVendorDocument.d.ts +36 -0
- package/dist/useCases/addVendorProfileDocument.d.ts +36 -0
- package/dist/useCases/createImageUploadEndpoint.d.ts +27 -0
- package/dist/useCases/createVendorProfile.d.ts +27 -0
- package/dist/useCases/deleteVendorProfile.d.ts +36 -0
- package/dist/useCases/describeConciergeBillsSummary.d.ts +27 -0
- package/dist/useCases/describeVendorProfile.d.ts +36 -0
- package/dist/useCases/listConciergeWorkspaceBillLines.d.ts +27 -0
- package/dist/useCases/listVendorDirectory.d.ts +27 -0
- package/dist/useCases/listVendorProfiles.d.ts +27 -0
- package/dist/useCases/openUnsubscribePage.d.ts +36 -0
- package/dist/useCases/removeVendorDocument.d.ts +39 -0
- package/dist/useCases/removeVendorProfileDocument.d.ts +39 -0
- package/dist/useCases/removeWorkItem.d.ts +39 -0
- package/dist/useCases/unsubscribe.d.ts +36 -0
- package/dist/useCases/updateVendorProfile.d.ts +36 -0
- package/dist/useCases/updateWorkItem.d.ts +39 -0
- package/dist/useCases/uploadImage.d.ts +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The four items a Vendor profile's Documents card asks for. Fixed, in this
|
|
3
|
+
* order, and not a taxonomy anyone edits: the card's job is to make what is
|
|
4
|
+
* missing legible at a glance, which a growing list would defeat. A document's
|
|
5
|
+
* stored `label` is free-form, so a checklist row is the item whose label
|
|
6
|
+
* matches its name.
|
|
7
|
+
*/
|
|
8
|
+
export declare const VENDOR_DOCUMENT_CHECKLIST: readonly ["W-9", "Certificate of Insurance", "Signed Agreement", "Trade License"];
|
|
9
|
+
export type VendorDocumentChecklistItem = (typeof VENDOR_DOCUMENT_CHECKLIST)[number];
|
|
10
|
+
/** How far ahead of an expiry date a document reads as expiring. */
|
|
11
|
+
export declare const VENDOR_DOCUMENT_EXPIRING_SOON_DAYS = 30;
|
|
12
|
+
export type VendorDocumentExpiry = "expired" | "expiringSoon" | "current";
|
|
13
|
+
/**
|
|
14
|
+
* Where a document sits against its own expiry date, computed from
|
|
15
|
+
* `expiresAt` every time it is read and never stored. A stored flag would be
|
|
16
|
+
* wrong the day after it was written and would need a job to keep true; a date
|
|
17
|
+
* and a clock are enough.
|
|
18
|
+
*
|
|
19
|
+
* A document with no expiry has no status — a W-9 does not expire, and
|
|
20
|
+
* inventing "current" for it would put a reassuring badge on a document nobody
|
|
21
|
+
* checked.
|
|
22
|
+
*/
|
|
23
|
+
export declare function vendorDocumentExpiry(expiresAt: string | Date | null | undefined, now?: Date): VendorDocumentExpiry | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The coverages Kohost records against a catalog Vendor. An enum rather than
|
|
3
|
+
* free text because the whole point of the record is answering "is this vendor
|
|
4
|
+
* covered for X" across the catalog, which two spellings of "general liability"
|
|
5
|
+
* would defeat. `other` is the escape hatch, and the carrier/limit fields say
|
|
6
|
+
* what it is.
|
|
7
|
+
*/
|
|
8
|
+
export declare const VENDOR_INSURANCE_TYPES: readonly ["general-liability", "workers-comp", "auto", "umbrella", "professional", "other"];
|
|
9
|
+
export type VendorInsuranceType = (typeof VENDOR_INSURANCE_TYPES)[number];
|
|
10
|
+
export declare const VENDOR_INSURANCE_TYPE_LABELS: Record<VendorInsuranceType, string>;
|
|
11
|
+
export declare function isVendorInsuranceType(value: unknown): value is VendorInsuranceType;
|
|
12
|
+
/**
|
|
13
|
+
* What a complete Private Details record carries, in the order the catalog
|
|
14
|
+
* list reports it missing. Deliberately short: these are the facts Kohost
|
|
15
|
+
* needs before it can put a vendor in front of a campus, not everything the
|
|
16
|
+
* editor can hold.
|
|
17
|
+
*/
|
|
18
|
+
export declare const VENDOR_REQUIRED_DETAILS: readonly ["Legal name", "EIN", "W-9", "Insurance", "License"];
|
|
19
|
+
export type VendorRequiredDetail = (typeof VENDOR_REQUIRED_DETAILS)[number];
|
|
20
|
+
interface VendorPrivateLike {
|
|
21
|
+
legalName?: string | null;
|
|
22
|
+
ein?: string | null;
|
|
23
|
+
w9OnFile?: boolean | null;
|
|
24
|
+
insurance?: readonly unknown[] | null;
|
|
25
|
+
licenses?: readonly unknown[] | null;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Which of {@link VENDOR_REQUIRED_DETAILS} a Vendor has nothing on file for,
|
|
29
|
+
* derived every time it is read. Emptiness is the only test — a record's
|
|
30
|
+
* contents, and whether it has expired, are the editor's business, so a vendor
|
|
31
|
+
* with a lapsed policy reads as having insurance details and an expiry
|
|
32
|
+
* warning rather than as missing them.
|
|
33
|
+
*/
|
|
34
|
+
export declare function missingVendorDetails(privateDetails: VendorPrivateLike | null | undefined): VendorRequiredDetail[];
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Entity } from "./entity.js";
|
|
2
|
+
import { validateOrder as validate } from "../validate.js";
|
|
3
|
+
import { orderSchema, type OrderSchema } from "../schemas/order.js";
|
|
4
|
+
/**
|
|
5
|
+
* Data type for Order constructor - exported for backwards compatibility
|
|
6
|
+
*/
|
|
7
|
+
export type OrderData = OrderSchema;
|
|
8
|
+
/**
|
|
9
|
+
* A purchase order for products or services.
|
|
10
|
+
*/
|
|
11
|
+
export interface Order extends OrderSchema {
|
|
12
|
+
}
|
|
13
|
+
export declare class Order extends Entity {
|
|
14
|
+
schema: typeof orderSchema;
|
|
15
|
+
validator: typeof validate;
|
|
16
|
+
constructor(data: OrderSchema);
|
|
17
|
+
}
|
package/dist/models/system.js
CHANGED
|
@@ -19,6 +19,8 @@ var System = class extends Entity {
|
|
|
19
19
|
if (data.contactInfo !== void 0) this.contactInfo = data.contactInfo;
|
|
20
20
|
if (data.emergency !== void 0) this.emergency = data.emergency;
|
|
21
21
|
if (data.supportedEmergencies !== void 0) this.supportedEmergencies = data.supportedEmergencies;
|
|
22
|
+
if (data.trippedSensors !== void 0) this.trippedSensors = data.trippedSensors;
|
|
23
|
+
if (data.supportedSensors !== void 0) this.supportedSensors = data.supportedSensors;
|
|
22
24
|
if (data.health !== void 0) this.health = data.health;
|
|
23
25
|
if (data.syncedAt !== void 0) this.syncedAt = data.syncedAt;
|
|
24
26
|
if (data.createdAt !== void 0) this.createdAt = data.createdAt;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","names":["validate"],"sources":["../../.generated/models/system.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity.js\";\nimport { validateSystem as validate } from \"../validate.js\";\nimport { systemSchema, type SystemSchema } from \"../schemas/system.js\";\n\n/**\n * Data type for System constructor - exported for backwards compatibility\n */\nexport type SystemData = SystemSchema;\n\n/**\n * System\n */\nexport interface System extends SystemSchema {}\nexport class System extends Entity {\n declare schema: typeof systemSchema;\n declare validator: typeof validate;\n\n constructor(data: SystemSchema) {\n super(data);\n this.id = data.id;\n this.type = data.type;\n if (data.categories !== undefined) this.categories = data.categories;\n if (data.name !== undefined) this.name = data.name;\n this.driver = data.driver;\n if (data.organizationId !== undefined) this.organizationId = data.organizationId;\n if (data.propertyId !== undefined) this.propertyId = data.propertyId;\n this.entities = data.entities;\n if (data.driverApiVersion !== undefined) this.driverApiVersion = data.driverApiVersion;\n if (data.logo !== undefined) this.logo = data.logo;\n if (data.config !== undefined) this.config = data.config;\n if (data.contactInfo !== undefined) this.contactInfo = data.contactInfo;\n if (data.emergency !== undefined) this.emergency = data.emergency;\n if (data.supportedEmergencies !== undefined) this.supportedEmergencies = data.supportedEmergencies;\n if (data.health !== undefined) this.health = data.health;\n if (data.syncedAt !== undefined) this.syncedAt = data.syncedAt;\n if (data.createdAt !== undefined) this.createdAt = data.createdAt;\n if (data.updatedAt !== undefined) this.updatedAt = data.updatedAt;\n if (data.deletedAt !== undefined) this.deletedAt = data.deletedAt;\n }\n\n\n\n\n\n\n\n\n}\n\nObject.defineProperty(System.prototype, \"schema\", {\n value: systemSchema\n});\n\nObject.defineProperty(System.prototype, \"validator\", {\n get: function() { return validate; }\n});\n"],"mappings":";;;;AAeA,IAAa,SAAb,cAA4B,OAAO;CAIjC,YAAY,MAAoB;EAC9B,MAAM,IAAI;EACV,KAAK,KAAK,KAAK;EACf,KAAK,OAAO,KAAK;EACjB,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,KAAK,SAAS,KAAK;EACnB,IAAI,KAAK,mBAAmB,KAAA,GAAW,KAAK,iBAAiB,KAAK;EAClE,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,KAAK,WAAW,KAAK;EACrB,IAAI,KAAK,qBAAqB,KAAA,GAAW,KAAK,mBAAmB,KAAK;EACtE,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,gBAAgB,KAAA,GAAW,KAAK,cAAc,KAAK;EAC5D,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,yBAAyB,KAAA,GAAW,KAAK,uBAAuB,KAAK;EAC9E,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;CAC1D;AASF;AAEA,OAAO,eAAe,OAAO,WAAW,UAAU,EAChD,OAAO,aACT,CAAC;AAED,OAAO,eAAe,OAAO,WAAW,aAAa,EACnD,KAAK,WAAW;CAAE,OAAOA;AAAU,EACrC,CAAC"}
|
|
1
|
+
{"version":3,"file":"system.js","names":["validate"],"sources":["../../.generated/models/system.ts"],"sourcesContent":["/* This file is automatically generated. Do not modify it manually. */\n\nimport { Entity } from \"./entity.js\";\nimport { validateSystem as validate } from \"../validate.js\";\nimport { systemSchema, type SystemSchema } from \"../schemas/system.js\";\n\n/**\n * Data type for System constructor - exported for backwards compatibility\n */\nexport type SystemData = SystemSchema;\n\n/**\n * System\n */\nexport interface System extends SystemSchema {}\nexport class System extends Entity {\n declare schema: typeof systemSchema;\n declare validator: typeof validate;\n\n constructor(data: SystemSchema) {\n super(data);\n this.id = data.id;\n this.type = data.type;\n if (data.categories !== undefined) this.categories = data.categories;\n if (data.name !== undefined) this.name = data.name;\n this.driver = data.driver;\n if (data.organizationId !== undefined) this.organizationId = data.organizationId;\n if (data.propertyId !== undefined) this.propertyId = data.propertyId;\n this.entities = data.entities;\n if (data.driverApiVersion !== undefined) this.driverApiVersion = data.driverApiVersion;\n if (data.logo !== undefined) this.logo = data.logo;\n if (data.config !== undefined) this.config = data.config;\n if (data.contactInfo !== undefined) this.contactInfo = data.contactInfo;\n if (data.emergency !== undefined) this.emergency = data.emergency;\n if (data.supportedEmergencies !== undefined) this.supportedEmergencies = data.supportedEmergencies;\n if (data.trippedSensors !== undefined) this.trippedSensors = data.trippedSensors;\n if (data.supportedSensors !== undefined) this.supportedSensors = data.supportedSensors;\n if (data.health !== undefined) this.health = data.health;\n if (data.syncedAt !== undefined) this.syncedAt = data.syncedAt;\n if (data.createdAt !== undefined) this.createdAt = data.createdAt;\n if (data.updatedAt !== undefined) this.updatedAt = data.updatedAt;\n if (data.deletedAt !== undefined) this.deletedAt = data.deletedAt;\n }\n\n\n\n\n\n\n\n\n}\n\nObject.defineProperty(System.prototype, \"schema\", {\n value: systemSchema\n});\n\nObject.defineProperty(System.prototype, \"validator\", {\n get: function() { return validate; }\n});\n"],"mappings":";;;;AAeA,IAAa,SAAb,cAA4B,OAAO;CAIjC,YAAY,MAAoB;EAC9B,MAAM,IAAI;EACV,KAAK,KAAK,KAAK;EACf,KAAK,OAAO,KAAK;EACjB,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,KAAK,SAAS,KAAK;EACnB,IAAI,KAAK,mBAAmB,KAAA,GAAW,KAAK,iBAAiB,KAAK;EAClE,IAAI,KAAK,eAAe,KAAA,GAAW,KAAK,aAAa,KAAK;EAC1D,KAAK,WAAW,KAAK;EACrB,IAAI,KAAK,qBAAqB,KAAA,GAAW,KAAK,mBAAmB,KAAK;EACtE,IAAI,KAAK,SAAS,KAAA,GAAW,KAAK,OAAO,KAAK;EAC9C,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,gBAAgB,KAAA,GAAW,KAAK,cAAc,KAAK;EAC5D,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,yBAAyB,KAAA,GAAW,KAAK,uBAAuB,KAAK;EAC9E,IAAI,KAAK,mBAAmB,KAAA,GAAW,KAAK,iBAAiB,KAAK;EAClE,IAAI,KAAK,qBAAqB,KAAA,GAAW,KAAK,mBAAmB,KAAK;EACtE,IAAI,KAAK,WAAW,KAAA,GAAW,KAAK,SAAS,KAAK;EAClD,IAAI,KAAK,aAAa,KAAA,GAAW,KAAK,WAAW,KAAK;EACtD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;EACxD,IAAI,KAAK,cAAc,KAAA,GAAW,KAAK,YAAY,KAAK;CAC1D;AASF;AAEA,OAAO,eAAe,OAAO,WAAW,UAAU,EAChD,OAAO,aACT,CAAC;AAED,OAAO,eAAe,OAAO,WAAW,aAAa,EACnD,KAAK,WAAW;CAAE,OAAOA;AAAU,EACrC,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Entity } from "./entity.js";
|
|
2
|
+
import { validateVendorProfile as validate } from "../validate.js";
|
|
3
|
+
import { vendorProfileSchema, type VendorProfileSchema } from "../schemas/vendorProfile.js";
|
|
4
|
+
/**
|
|
5
|
+
* Data type for VendorProfile constructor - exported for backwards compatibility
|
|
6
|
+
*/
|
|
7
|
+
export type VendorProfileData = VendorProfileSchema;
|
|
8
|
+
/**
|
|
9
|
+
* VendorProfile
|
|
10
|
+
*/
|
|
11
|
+
export interface VendorProfile extends VendorProfileSchema {
|
|
12
|
+
}
|
|
13
|
+
export declare class VendorProfile extends Entity {
|
|
14
|
+
schema: typeof vendorProfileSchema;
|
|
15
|
+
validator: typeof validate;
|
|
16
|
+
constructor(data: VendorProfileSchema);
|
|
17
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import defs from "./definitions.js";
|
|
2
|
+
import type { FromSchema } from "json-schema-to-ts";
|
|
3
|
+
export declare const orderSchema: {
|
|
4
|
+
readonly $schema: "http://json-schema.org/draft-07/schema";
|
|
5
|
+
readonly $id: "order.json";
|
|
6
|
+
readonly title: "Order";
|
|
7
|
+
readonly description: "A purchase order for products or services.";
|
|
8
|
+
readonly type: "object";
|
|
9
|
+
readonly required: readonly ["type", "status"];
|
|
10
|
+
readonly additionalProperties: false;
|
|
11
|
+
readonly properties: {
|
|
12
|
+
readonly id: {
|
|
13
|
+
readonly $ref: "definitions.json#/definitions/id";
|
|
14
|
+
};
|
|
15
|
+
readonly propertyId: {
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly description: "ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.";
|
|
18
|
+
};
|
|
19
|
+
readonly type: {
|
|
20
|
+
readonly type: "string";
|
|
21
|
+
readonly default: "order";
|
|
22
|
+
readonly enum: readonly ["order"];
|
|
23
|
+
};
|
|
24
|
+
readonly orderNumber: {
|
|
25
|
+
readonly type: "string";
|
|
26
|
+
};
|
|
27
|
+
readonly status: {
|
|
28
|
+
readonly type: "string";
|
|
29
|
+
readonly enum: readonly ["draft", "pendingPayment", "processing", "outForDelivery", "completed", "paymentFailed", "cancelled", "refunded"];
|
|
30
|
+
};
|
|
31
|
+
readonly userId: {
|
|
32
|
+
readonly $ref: "definitions.json#/definitions/id";
|
|
33
|
+
readonly description: "User id of purchaser";
|
|
34
|
+
};
|
|
35
|
+
readonly reservationId: {
|
|
36
|
+
readonly $ref: "definitions.json#/definitions/id";
|
|
37
|
+
readonly description: "Reservation id if the order is for a reservation";
|
|
38
|
+
};
|
|
39
|
+
readonly date: {
|
|
40
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
41
|
+
};
|
|
42
|
+
readonly items: {
|
|
43
|
+
readonly type: "array";
|
|
44
|
+
readonly default: readonly [];
|
|
45
|
+
readonly items: {
|
|
46
|
+
readonly type: "object";
|
|
47
|
+
readonly required: readonly ["name", "price"];
|
|
48
|
+
readonly properties: {
|
|
49
|
+
readonly additionalProperties: false;
|
|
50
|
+
readonly name: {
|
|
51
|
+
readonly type: "string";
|
|
52
|
+
};
|
|
53
|
+
readonly sku: {
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
};
|
|
56
|
+
readonly quantity: {
|
|
57
|
+
readonly type: "number";
|
|
58
|
+
readonly default: 1;
|
|
59
|
+
};
|
|
60
|
+
readonly price: {
|
|
61
|
+
readonly type: "number";
|
|
62
|
+
};
|
|
63
|
+
readonly taxClass: {
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
};
|
|
66
|
+
readonly deliveryClass: {
|
|
67
|
+
readonly type: "string";
|
|
68
|
+
};
|
|
69
|
+
readonly productId: {
|
|
70
|
+
readonly type: "string";
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
readonly taxes: {
|
|
76
|
+
readonly type: "array";
|
|
77
|
+
readonly default: readonly [];
|
|
78
|
+
readonly items: {
|
|
79
|
+
readonly type: "object";
|
|
80
|
+
readonly required: readonly ["name", "rate"];
|
|
81
|
+
readonly properties: {
|
|
82
|
+
readonly additionalProperties: false;
|
|
83
|
+
readonly name: {
|
|
84
|
+
readonly type: "string";
|
|
85
|
+
};
|
|
86
|
+
readonly class: {
|
|
87
|
+
readonly type: "string";
|
|
88
|
+
};
|
|
89
|
+
readonly rateType: {
|
|
90
|
+
readonly type: "string";
|
|
91
|
+
readonly enum: readonly ["percentage", "flat"];
|
|
92
|
+
readonly default: "percentage";
|
|
93
|
+
};
|
|
94
|
+
readonly rate: {
|
|
95
|
+
readonly type: "number";
|
|
96
|
+
};
|
|
97
|
+
readonly total: {
|
|
98
|
+
readonly type: "number";
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
readonly fees: {
|
|
104
|
+
readonly type: "array";
|
|
105
|
+
readonly default: readonly [];
|
|
106
|
+
readonly items: {
|
|
107
|
+
readonly type: "object";
|
|
108
|
+
readonly required: readonly ["name", "price"];
|
|
109
|
+
readonly properties: {
|
|
110
|
+
readonly additionalProperties: false;
|
|
111
|
+
readonly name: {
|
|
112
|
+
readonly type: "string";
|
|
113
|
+
};
|
|
114
|
+
readonly price: {
|
|
115
|
+
readonly type: "number";
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
};
|
|
120
|
+
readonly delivery: {
|
|
121
|
+
readonly type: "array";
|
|
122
|
+
readonly default: readonly [];
|
|
123
|
+
readonly items: {
|
|
124
|
+
readonly type: "object";
|
|
125
|
+
readonly required: readonly ["name", "rate"];
|
|
126
|
+
readonly properties: {
|
|
127
|
+
readonly additionalProperties: false;
|
|
128
|
+
readonly name: {
|
|
129
|
+
readonly type: "string";
|
|
130
|
+
};
|
|
131
|
+
readonly class: {
|
|
132
|
+
readonly type: "string";
|
|
133
|
+
};
|
|
134
|
+
readonly rateType: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
readonly enum: readonly ["percentage", "flat"];
|
|
137
|
+
readonly default: "percentage";
|
|
138
|
+
};
|
|
139
|
+
readonly rate: {
|
|
140
|
+
readonly type: "number";
|
|
141
|
+
};
|
|
142
|
+
readonly total: {
|
|
143
|
+
readonly type: "number";
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
};
|
|
148
|
+
readonly payments: {
|
|
149
|
+
readonly type: "array";
|
|
150
|
+
readonly default: readonly [];
|
|
151
|
+
readonly items: {
|
|
152
|
+
readonly type: "object";
|
|
153
|
+
readonly properties: {
|
|
154
|
+
readonly method: {
|
|
155
|
+
readonly type: "string";
|
|
156
|
+
readonly enum: readonly ["folio", "invoice", "amex", "visa", "masterCard", "maestro", "discover", "diners", "jcb", "applePay", "alipay", "chinaUnionPay", "vpay"];
|
|
157
|
+
};
|
|
158
|
+
readonly name: {
|
|
159
|
+
readonly type: "string";
|
|
160
|
+
};
|
|
161
|
+
readonly date: {
|
|
162
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
163
|
+
};
|
|
164
|
+
readonly amount: {
|
|
165
|
+
readonly type: "number";
|
|
166
|
+
};
|
|
167
|
+
readonly transactionReference: {
|
|
168
|
+
readonly type: "string";
|
|
169
|
+
};
|
|
170
|
+
};
|
|
171
|
+
};
|
|
172
|
+
};
|
|
173
|
+
readonly createdAt: {
|
|
174
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
175
|
+
};
|
|
176
|
+
readonly updatedAt: {
|
|
177
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
178
|
+
};
|
|
179
|
+
readonly deletedAt: {
|
|
180
|
+
readonly $ref: "definitions.json#/definitions/date";
|
|
181
|
+
};
|
|
182
|
+
};
|
|
183
|
+
};
|
|
184
|
+
export type OrderSchema = FromSchema<typeof orderSchema, {
|
|
185
|
+
references: [typeof defs];
|
|
186
|
+
}>;
|
package/dist/schemas/system.d.ts
CHANGED
|
@@ -117,7 +117,6 @@ export declare const systemSchema: {
|
|
|
117
117
|
readonly emergency: {
|
|
118
118
|
readonly type: readonly ["string", "null"];
|
|
119
119
|
readonly enum: readonly ["lockdown", "evacuate", null];
|
|
120
|
-
readonly default: null;
|
|
121
120
|
readonly description: "Active system wide emergency state";
|
|
122
121
|
};
|
|
123
122
|
readonly supportedEmergencies: {
|
|
@@ -129,6 +128,24 @@ export declare const systemSchema: {
|
|
|
129
128
|
};
|
|
130
129
|
readonly description: "System wide emergencies the system can enter. Omitted means unknown (legacy); an empty array means none are supported.";
|
|
131
130
|
};
|
|
131
|
+
readonly trippedSensors: {
|
|
132
|
+
readonly type: "array";
|
|
133
|
+
readonly uniqueItems: true;
|
|
134
|
+
readonly items: {
|
|
135
|
+
readonly type: "string";
|
|
136
|
+
readonly enum: readonly ["rain"];
|
|
137
|
+
};
|
|
138
|
+
readonly description: "Active sensors";
|
|
139
|
+
};
|
|
140
|
+
readonly supportedSensors: {
|
|
141
|
+
readonly type: "array";
|
|
142
|
+
readonly uniqueItems: true;
|
|
143
|
+
readonly items: {
|
|
144
|
+
readonly type: "string";
|
|
145
|
+
readonly enum: readonly ["rain"];
|
|
146
|
+
};
|
|
147
|
+
readonly description: "System wide supported sensors.";
|
|
148
|
+
};
|
|
132
149
|
readonly health: {
|
|
133
150
|
readonly type: "object";
|
|
134
151
|
readonly properties: {
|
|
@@ -171,6 +188,20 @@ export declare const systemSchema: {
|
|
|
171
188
|
readonly then: {
|
|
172
189
|
readonly required: readonly ["emergency", "supportedEmergencies"];
|
|
173
190
|
};
|
|
191
|
+
}, {
|
|
192
|
+
readonly if: {
|
|
193
|
+
readonly properties: {
|
|
194
|
+
readonly categories: {
|
|
195
|
+
readonly contains: {
|
|
196
|
+
readonly const: "irrigation";
|
|
197
|
+
};
|
|
198
|
+
};
|
|
199
|
+
};
|
|
200
|
+
readonly required: readonly ["categories"];
|
|
201
|
+
};
|
|
202
|
+
readonly then: {
|
|
203
|
+
readonly required: readonly ["trippedSensors", "supportedSensors"];
|
|
204
|
+
};
|
|
174
205
|
}];
|
|
175
206
|
};
|
|
176
207
|
export type SystemSchema = FromSchema<typeof systemSchema, {
|
package/dist/schemas/system.js
CHANGED
|
@@ -122,7 +122,6 @@ const systemSchema = {
|
|
|
122
122
|
"evacuate",
|
|
123
123
|
null
|
|
124
124
|
],
|
|
125
|
-
default: null,
|
|
126
125
|
description: "Active system wide emergency state"
|
|
127
126
|
},
|
|
128
127
|
supportedEmergencies: {
|
|
@@ -134,6 +133,24 @@ const systemSchema = {
|
|
|
134
133
|
},
|
|
135
134
|
description: "System wide emergencies the system can enter. Omitted means unknown (legacy); an empty array means none are supported."
|
|
136
135
|
},
|
|
136
|
+
trippedSensors: {
|
|
137
|
+
type: "array",
|
|
138
|
+
uniqueItems: true,
|
|
139
|
+
items: {
|
|
140
|
+
type: "string",
|
|
141
|
+
enum: ["rain"]
|
|
142
|
+
},
|
|
143
|
+
description: "Active sensors"
|
|
144
|
+
},
|
|
145
|
+
supportedSensors: {
|
|
146
|
+
type: "array",
|
|
147
|
+
uniqueItems: true,
|
|
148
|
+
items: {
|
|
149
|
+
type: "string",
|
|
150
|
+
enum: ["rain"]
|
|
151
|
+
},
|
|
152
|
+
description: "System wide supported sensors."
|
|
153
|
+
},
|
|
137
154
|
health: {
|
|
138
155
|
type: "object",
|
|
139
156
|
properties: {
|
|
@@ -162,6 +179,12 @@ const systemSchema = {
|
|
|
162
179
|
required: ["categories"]
|
|
163
180
|
},
|
|
164
181
|
then: { required: ["emergency", "supportedEmergencies"] }
|
|
182
|
+
}, {
|
|
183
|
+
if: {
|
|
184
|
+
properties: { categories: { contains: { const: "irrigation" } } },
|
|
185
|
+
required: ["categories"]
|
|
186
|
+
},
|
|
187
|
+
then: { required: ["trippedSensors", "supportedSensors"] }
|
|
165
188
|
}]
|
|
166
189
|
};
|
|
167
190
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system.js","names":[],"sources":["../../.generated/schemas/system.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\nimport type { mediaFileSchema } from \"./mediaFile\";\n\nexport const systemSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"system.json\",\n title: \"System\",\n type: \"object\",\n required: [\"id\", \"type\", \"driver\", \"entities\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n default: \"system\",\n enum: [\"system\"],\n },\n categories: {\n type: \"array\",\n uniqueItems: true,\n default: [],\n items: { \n enum: [\"access\", \"climate\", \"irrigation\", \"lighting\", \"media\", \"security\", \"sis\"] \n },\n description: \"The categories of functionality this system provides.\",\n },\n name: {\n type: \"string\",\n },\n driver: {\n $ref: \"definitions.json#/definitions/driver\",\n example: \"salto\",\n description: \"The driver value that implements the system\",\n },\n organizationId: {\n type: \"string\",\n description: \"The id of the organization that uses the system\",\n },\n propertyId: {\n type: \"string\",\n description: \"The id of the property that uses the system\",\n },\n entities: {\n type: \"array\",\n description: \"The entities produced by the system\",\n default: [],\n items: {\n type: \"object\",\n required: [\"systemId\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The id of the entity\",\n },\n systemId: {\n type: \"string\",\n description: \"The id of the entity as known by the system\",\n },\n type: {\n type: \"string\",\n description: \"The type of the entity\",\n },\n discriminator: {\n type: \"string\",\n description: \"The discriminator of the entity\",\n },\n propertyIds: {\n type: \"array\",\n description:\n \"The ids of the properties where the entity is located\",\n items: {\n type: \"string\",\n },\n },\n },\n },\n },\n driverApiVersion: {\n type: \"string\",\n description: \"The version of the driver API used by the system\",\n },\n logo: {\n $ref: \"mediaFile.json#\",\n },\n config: {\n type: \"object\",\n additionalProperties: true,\n description: \"The runtime configuration of the system\",\n },\n contactInfo: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n websiteUrl: {\n type: \"string\",\n description: \"The website URL of the system\",\n },\n email: {\n type: \"string\",\n description: \"The email address of the system\",\n },\n phone: {\n type: \"string\",\n description: \"The phone number of the system\",\n },\n itunesAppId: {\n type: \"string\",\n example: \"807316865\",\n },\n googleAppId: {\n type: \"string\",\n example: \"tw.com.geovision.gvaccesscontrol\",\n },\n },\n },\n emergency: {\n type: [\"string\", \"null\"],\n enum: [\"lockdown\", \"evacuate\", null],\n
|
|
1
|
+
{"version":3,"file":"system.js","names":[],"sources":["../../.generated/schemas/system.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\nimport type { mediaFileSchema } from \"./mediaFile\";\n\nexport const systemSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"system.json\",\n title: \"System\",\n type: \"object\",\n required: [\"id\", \"type\", \"driver\", \"entities\"],\n additionalProperties: false,\n properties: {\n id: {\n type: \"string\",\n },\n type: {\n type: \"string\",\n default: \"system\",\n enum: [\"system\"],\n },\n categories: {\n type: \"array\",\n uniqueItems: true,\n default: [],\n items: { \n enum: [\"access\", \"climate\", \"irrigation\", \"lighting\", \"media\", \"security\", \"sis\"] \n },\n description: \"The categories of functionality this system provides.\",\n },\n name: {\n type: \"string\",\n },\n driver: {\n $ref: \"definitions.json#/definitions/driver\",\n example: \"salto\",\n description: \"The driver value that implements the system\",\n },\n organizationId: {\n type: \"string\",\n description: \"The id of the organization that uses the system\",\n },\n propertyId: {\n type: \"string\",\n description: \"The id of the property that uses the system\",\n },\n entities: {\n type: \"array\",\n description: \"The entities produced by the system\",\n default: [],\n items: {\n type: \"object\",\n required: [\"systemId\"],\n properties: {\n id: {\n type: \"string\",\n description: \"The id of the entity\",\n },\n systemId: {\n type: \"string\",\n description: \"The id of the entity as known by the system\",\n },\n type: {\n type: \"string\",\n description: \"The type of the entity\",\n },\n discriminator: {\n type: \"string\",\n description: \"The discriminator of the entity\",\n },\n propertyIds: {\n type: \"array\",\n description:\n \"The ids of the properties where the entity is located\",\n items: {\n type: \"string\",\n },\n },\n },\n },\n },\n driverApiVersion: {\n type: \"string\",\n description: \"The version of the driver API used by the system\",\n },\n logo: {\n $ref: \"mediaFile.json#\",\n },\n config: {\n type: \"object\",\n additionalProperties: true,\n description: \"The runtime configuration of the system\",\n },\n contactInfo: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n websiteUrl: {\n type: \"string\",\n description: \"The website URL of the system\",\n },\n email: {\n type: \"string\",\n description: \"The email address of the system\",\n },\n phone: {\n type: \"string\",\n description: \"The phone number of the system\",\n },\n itunesAppId: {\n type: \"string\",\n example: \"807316865\",\n },\n googleAppId: {\n type: \"string\",\n example: \"tw.com.geovision.gvaccesscontrol\",\n },\n },\n },\n emergency: {\n type: [\"string\", \"null\"],\n enum: [\"lockdown\", \"evacuate\", null],\n description: \"Active system wide emergency state\",\n },\n supportedEmergencies: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"string\",\n enum: [ \"lockdown\", \"evacuate\" ],\n },\n description: \"System wide emergencies the system can enter. Omitted means unknown (legacy); an empty array means none are supported.\",\n },\n trippedSensors: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"string\",\n enum: [\"rain\"],\n },\n description: \"Active sensors\",\n },\n supportedSensors: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"string\",\n enum: [ \"rain\" ],\n },\n description: \"System wide supported sensors.\",\n },\n health: {\n type: \"object\",\n properties: {\n offline: {\n type: \"boolean\",\n description: \"Whether the system is offline\",\n },\n lastHeartbeatAt: {\n type: \"string\",\n description:\n \"The date and time of the last communication with the system\",\n format: \"date-time\",\n },\n },\n },\n syncedAt: {\n $ref: \"definitions.json#/definitions/date\",\n description:\n \"When the system's roster (people and households) was last synced into the platform.\",\n },\n createdAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n updatedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n deletedAt: {\n $ref: \"definitions.json#/definitions/date\",\n },\n },\n allOf: [\n {\n if: {\n properties: { categories: { contains: { const: \"access\" } } },\n required: [\"categories\"],\n },\n then: { required: [\"emergency\", \"supportedEmergencies\"] },\n },\n {\n if: {\n properties: { categories: { contains: { const: \"irrigation\" } } },\n required: [\"categories\"],\n },\n then: { required: [\"trippedSensors\", \"supportedSensors\"] },\n }\n ]\n} as const;\n\nexport type SystemSchema = FromSchema<\n typeof systemSchema,\n {\n references: [typeof defs, typeof mediaFileSchema];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":"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"}
|
|
@@ -179,7 +179,6 @@ export declare const thermostatSchema: {
|
|
|
179
179
|
readonly uiEnabled: {
|
|
180
180
|
readonly type: "boolean";
|
|
181
181
|
readonly description: "Local thermostat controls active or not";
|
|
182
|
-
readonly default: true;
|
|
183
182
|
};
|
|
184
183
|
readonly equipment: {
|
|
185
184
|
readonly type: "object";
|
|
@@ -211,8 +211,7 @@ const thermostatSchema = {
|
|
|
211
211
|
},
|
|
212
212
|
uiEnabled: {
|
|
213
213
|
type: "boolean",
|
|
214
|
-
description: "Local thermostat controls active or not"
|
|
215
|
-
default: true
|
|
214
|
+
description: "Local thermostat controls active or not"
|
|
216
215
|
},
|
|
217
216
|
equipment: {
|
|
218
217
|
type: "object",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thermostat.js","names":[],"sources":["../../.generated/schemas/thermostat.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const thermostatSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"thermostat.json\",\n title: \"Thermostat\",\n description: \"Any smart thermostat\",\n type: \"object\",\n required: [\n \"id\",\n \"type\",\n \"hvacMode\",\n \"fanMode\",\n \"hvacState\",\n \"fanState\",\n \"setpoints\",\n \"temperatureScale\",\n \"supportedHvacModes\",\n \"supportedFanModes\",\n \"driver\",\n ],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n readOnly: true,\n },\n propertyId: {\n type: \"string\",\n description: \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n name: {\n $ref: \"definitions.json#/definitions/name\",\n },\n type: {\n type: \"string\",\n enum: [\"thermostat\"],\n default: \"thermostat\",\n readOnly: true,\n },\n driver: {\n $ref: \"definitions.json#/definitions/driver\",\n readOnly: true,\n },\n alerts: {\n $ref: \"definitions.json#/definitions/alerts\",\n },\n offline: {\n type: \"boolean\",\n readOnly: true,\n },\n supportedNotifications: {\n $ref: \"definitions.json#/definitions/supportedNotifications\",\n },\n notification: {\n $ref: \"definitions.json#/definitions/notification\",\n },\n currentTemperature: {\n type: \"number\",\n readOnly: true,\n },\n maxSafeCurrentTemp: {\n type: [\"number\", \"null\"],\n description: \"Maximum safe temperature\",\n },\n minSafeCurrentTemp: {\n type: [\"number\", \"null\"],\n description: \"Minimum safe temperature\",\n },\n currentHumidity: {\n type: \"number\",\n minimum: 0,\n readOnly: true,\n },\n maxSafeCurrentHumidity: {\n type: [\"number\", \"null\"],\n description: \"Maximum safe humidity\",\n },\n minSafeCurrentHumidity: {\n type: [\"number\", \"null\"],\n description: \"Minimum safe humidity\",\n },\n hvacMode: {\n type: \"string\",\n enum: [\"cool\", \"heat\", \"auto\", \"off\"],\n },\n hvacState: {\n type: [\"string\", \"null\"],\n enum: [\"cooling\", \"heating\", \"off\", null],\n readOnly: true,\n },\n fanMode: {\n type: \"string\",\n enum: [\"auto\", \"low\", \"medium\", \"high\", \"off\", \"on\"],\n },\n fanState: {\n type: [\"string\", \"null\"],\n enum: [\"off\", \"low\", \"medium\", \"high\", \"on\", null],\n readOnly: true,\n },\n temperatureScale: {\n type: \"string\",\n enum: [\"celsius\", \"fahrenheit\"],\n default: \"fahrenheit\",\n },\n humidityScale: {\n type: [\"string\", \"null\"],\n enum: [\"absolute\", \"relative\", null],\n },\n supportedHvacModes: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"string\",\n enum: [\"cool\", \"heat\", \"auto\", \"off\"],\n },\n readOnly: true,\n },\n supportedFanModes: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"string\",\n enum: [\"auto\", \"low\", \"medium\", \"high\", \"off\", \"on\"],\n },\n readOnly: true,\n },\n setpoints: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n cool: {\n $ref: \"#/definitions/setpoint\",\n },\n heat: {\n $ref: \"#/definitions/setpoint\",\n },\n auto: {\n $ref: \"#/definitions/setpoint\",\n },\n },\n },\n minAutoDelta: {\n type: \"number\",\n default: 3,\n },\n cycleRate: {\n type: \"number\",\n readOnly: true,\n },\n co2: {\n type: [\"number\", \"null\"],\n description: \"Parts per million (ppm)\",\n readOnly: true,\n },\n voc: {\n type: [\"number\", \"null\"],\n description: \"Parts per billion (ppb)\",\n readOnly: true,\n },\n batteryLevel: {\n $ref: \"definitions.json#/definitions/batteryLevel\",\n readOnly: true,\n },\n systemId: {\n $ref: \"definitions.json#/definitions/systemId\",\n },\n watts: {\n $ref: \"definitions.json#/definitions/watts\",\n readOnly: true,\n },\n icon: {\n type: \"string\",\n },\n manufacturer: {\n type: \"string\",\n readOnly: true,\n },\n modelNumber: {\n type: \"string\",\n readOnly: true,\n },\n serialNumber: {\n type: \"string\",\n readOnly: true,\n },\n firmwareVersion: {\n type: \"string\",\n readOnly: true,\n },\n uiEnabled: {\n type: \"boolean\",\n description: \"Local thermostat controls active or not\",\n
|
|
1
|
+
{"version":3,"file":"thermostat.js","names":[],"sources":["../../.generated/schemas/thermostat.ts"],"sourcesContent":["import defs, { ISODateString } from \"./definitions\";\nimport type { FromSchema } from \"json-schema-to-ts\";\n\nexport const thermostatSchema = {\n $schema: \"http://json-schema.org/draft-07/schema\",\n $id: \"thermostat.json\",\n title: \"Thermostat\",\n description: \"Any smart thermostat\",\n type: \"object\",\n required: [\n \"id\",\n \"type\",\n \"hvacMode\",\n \"fanMode\",\n \"hvacState\",\n \"fanState\",\n \"setpoints\",\n \"temperatureScale\",\n \"supportedHvacModes\",\n \"supportedFanModes\",\n \"driver\",\n ],\n additionalProperties: false,\n properties: {\n id: {\n $ref: \"definitions.json#/definitions/id\",\n readOnly: true,\n },\n propertyId: {\n type: \"string\",\n description: \"ID of the property this entity belongs to. Optional — used as a per-document filter inside the org-scoped database.\",\n },\n name: {\n $ref: \"definitions.json#/definitions/name\",\n },\n type: {\n type: \"string\",\n enum: [\"thermostat\"],\n default: \"thermostat\",\n readOnly: true,\n },\n driver: {\n $ref: \"definitions.json#/definitions/driver\",\n readOnly: true,\n },\n alerts: {\n $ref: \"definitions.json#/definitions/alerts\",\n },\n offline: {\n type: \"boolean\",\n readOnly: true,\n },\n supportedNotifications: {\n $ref: \"definitions.json#/definitions/supportedNotifications\",\n },\n notification: {\n $ref: \"definitions.json#/definitions/notification\",\n },\n currentTemperature: {\n type: \"number\",\n readOnly: true,\n },\n maxSafeCurrentTemp: {\n type: [\"number\", \"null\"],\n description: \"Maximum safe temperature\",\n },\n minSafeCurrentTemp: {\n type: [\"number\", \"null\"],\n description: \"Minimum safe temperature\",\n },\n currentHumidity: {\n type: \"number\",\n minimum: 0,\n readOnly: true,\n },\n maxSafeCurrentHumidity: {\n type: [\"number\", \"null\"],\n description: \"Maximum safe humidity\",\n },\n minSafeCurrentHumidity: {\n type: [\"number\", \"null\"],\n description: \"Minimum safe humidity\",\n },\n hvacMode: {\n type: \"string\",\n enum: [\"cool\", \"heat\", \"auto\", \"off\"],\n },\n hvacState: {\n type: [\"string\", \"null\"],\n enum: [\"cooling\", \"heating\", \"off\", null],\n readOnly: true,\n },\n fanMode: {\n type: \"string\",\n enum: [\"auto\", \"low\", \"medium\", \"high\", \"off\", \"on\"],\n },\n fanState: {\n type: [\"string\", \"null\"],\n enum: [\"off\", \"low\", \"medium\", \"high\", \"on\", null],\n readOnly: true,\n },\n temperatureScale: {\n type: \"string\",\n enum: [\"celsius\", \"fahrenheit\"],\n default: \"fahrenheit\",\n },\n humidityScale: {\n type: [\"string\", \"null\"],\n enum: [\"absolute\", \"relative\", null],\n },\n supportedHvacModes: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"string\",\n enum: [\"cool\", \"heat\", \"auto\", \"off\"],\n },\n readOnly: true,\n },\n supportedFanModes: {\n type: \"array\",\n uniqueItems: true,\n items: {\n type: \"string\",\n enum: [\"auto\", \"low\", \"medium\", \"high\", \"off\", \"on\"],\n },\n readOnly: true,\n },\n setpoints: {\n type: \"object\",\n additionalProperties: false,\n properties: {\n cool: {\n $ref: \"#/definitions/setpoint\",\n },\n heat: {\n $ref: \"#/definitions/setpoint\",\n },\n auto: {\n $ref: \"#/definitions/setpoint\",\n },\n },\n },\n minAutoDelta: {\n type: \"number\",\n default: 3,\n },\n cycleRate: {\n type: \"number\",\n readOnly: true,\n },\n co2: {\n type: [\"number\", \"null\"],\n description: \"Parts per million (ppm)\",\n readOnly: true,\n },\n voc: {\n type: [\"number\", \"null\"],\n description: \"Parts per billion (ppb)\",\n readOnly: true,\n },\n batteryLevel: {\n $ref: \"definitions.json#/definitions/batteryLevel\",\n readOnly: true,\n },\n systemId: {\n $ref: \"definitions.json#/definitions/systemId\",\n },\n watts: {\n $ref: \"definitions.json#/definitions/watts\",\n readOnly: true,\n },\n icon: {\n type: \"string\",\n },\n manufacturer: {\n type: \"string\",\n readOnly: true,\n },\n modelNumber: {\n type: \"string\",\n readOnly: true,\n },\n serialNumber: {\n type: \"string\",\n readOnly: true,\n },\n firmwareVersion: {\n type: \"string\",\n readOnly: true,\n },\n uiEnabled: {\n type: \"boolean\",\n description: \"Local thermostat controls active or not\",\n },\n // deprecated, use alerts instead\n equipment: {\n type: \"object\",\n properties: {\n status: {\n type: \"string\",\n enum: [\"Ok\", \"Trouble\"],\n },\n message: {\n type: \"string\",\n },\n },\n required: [\"status\"],\n },\n },\n definitions: {\n setpoint: {\n type: \"object\",\n additionalProperties: false,\n required: [\"value\", \"min\", \"max\"],\n properties: {\n value: {\n type: \"number\",\n minimum: 0,\n maximum: 99,\n },\n min: {\n type: [\"number\", \"null\"],\n minimum: 0,\n maximum: 99,\n },\n max: {\n type: [\"number\", \"null\"],\n minimum: 0,\n maximum: 99,\n },\n },\n },\n },\n} as const;\n\nexport type ThermostatSchema = FromSchema<\n typeof thermostatSchema,\n {\n references: [typeof defs];\n deserialize: [\n {\n pattern: {\n format: \"date-time\";\n };\n output: Date | ISODateString;\n },\n ];\n }\n>;\n"],"mappings":"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"}
|