@seamapi/types 1.187.0 → 1.188.0
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/connect.cjs +843 -0
- package/dist/connect.cjs.map +1 -1
- package/dist/connect.d.cts +4221 -2
- package/dist/devicedb.d.cts +20 -20
- package/lib/seam/connect/internal/model-types.d.ts +1 -1
- package/lib/seam/connect/internal/model-types.js.map +1 -1
- package/lib/seam/connect/internal/schemas.d.ts +1 -1
- package/lib/seam/connect/internal/schemas.js +1 -1
- package/lib/seam/connect/internal/schemas.js.map +1 -1
- package/lib/seam/connect/model-types.d.ts +1 -1
- package/lib/seam/connect/models/access-codes/managed-access-code.d.ts +2 -2
- package/lib/seam/connect/models/access-codes/managed-access-code.js +1 -1
- package/lib/seam/connect/models/access-codes/managed-access-code.js.map +1 -1
- package/lib/seam/connect/models/access-codes/unmanaged-access-code.js +2 -2
- package/lib/seam/connect/models/access-codes/unmanaged-access-code.js.map +1 -1
- package/lib/seam/connect/models/devices/device-metadata.d.ts +12 -12
- package/lib/seam/connect/models/devices/{managed-device.d.ts → device.d.ts} +26 -26
- package/lib/seam/connect/models/devices/{managed-device.js → device.js} +2 -2
- package/lib/seam/connect/models/devices/device.js.map +1 -0
- package/lib/seam/connect/models/devices/index.d.ts +1 -1
- package/lib/seam/connect/models/devices/index.js +1 -1
- package/lib/seam/connect/models/devices/index.js.map +1 -1
- package/lib/seam/connect/models/devices/phone.js +2 -2
- package/lib/seam/connect/models/devices/phone.js.map +1 -1
- package/lib/seam/connect/models/devices/unmanaged-device.d.ts +5 -5
- package/lib/seam/connect/models/devices/unmanaged-device.js +2 -2
- package/lib/seam/connect/models/devices/unmanaged-device.js.map +1 -1
- package/lib/seam/connect/schemas.d.ts +1 -1
- package/lib/seam/connect/schemas.js +1 -1
- package/lib/seam/connect/schemas.js.map +1 -1
- package/lib/seam/devicedb/models/device-model.d.ts +8 -8
- package/lib/seam/devicedb/route-specs.d.ts +12 -12
- package/package.json +1 -1
- package/src/lib/seam/connect/internal/model-types.ts +4 -1
- package/src/lib/seam/connect/internal/schemas.ts +2 -2
- package/src/lib/seam/connect/model-types.ts +4 -0
- package/src/lib/seam/connect/models/access-codes/managed-access-code.ts +2 -2
- package/src/lib/seam/connect/models/access-codes/unmanaged-access-code.ts +2 -2
- package/src/lib/seam/connect/models/devices/{managed-device.ts → device.ts} +2 -2
- package/src/lib/seam/connect/models/devices/index.ts +1 -1
- package/src/lib/seam/connect/models/devices/phone.ts +2 -2
- package/src/lib/seam/connect/models/devices/unmanaged-device.ts +3 -3
- package/src/lib/seam/connect/schemas.ts +4 -0
- package/lib/seam/connect/models/devices/managed-device.js.map +0 -1
package/dist/connect.cjs
CHANGED
|
@@ -11,6 +11,7 @@ var __export = (target, all) => {
|
|
|
11
11
|
// src/lib/seam/connect/schemas.ts
|
|
12
12
|
var schemas_exports = {};
|
|
13
13
|
__export(schemas_exports, {
|
|
14
|
+
access_code: () => access_code,
|
|
14
15
|
acs_access_group: () => acs_access_group,
|
|
15
16
|
acs_credential: () => acs_credential,
|
|
16
17
|
acs_entrance: () => acs_entrance,
|
|
@@ -21,11 +22,87 @@ __export(schemas_exports, {
|
|
|
21
22
|
connect_webview: () => connect_webview,
|
|
22
23
|
connected_account: () => connected_account,
|
|
23
24
|
custom_metadata: () => custom_metadata,
|
|
25
|
+
device: () => device,
|
|
24
26
|
seam_event: () => seam_event,
|
|
27
|
+
unmanaged_access_code: () => unmanaged_access_code,
|
|
28
|
+
unmanaged_device: () => unmanaged_device,
|
|
25
29
|
user_identity: () => user_identity,
|
|
26
30
|
webhook: () => webhook,
|
|
27
31
|
workspace: () => workspace
|
|
28
32
|
});
|
|
33
|
+
var access_code = zod.z.object({
|
|
34
|
+
common_code_key: zod.z.string().nullable().describe(
|
|
35
|
+
"Unique identifier for a group of access codes that share the same code."
|
|
36
|
+
),
|
|
37
|
+
is_scheduled_on_device: zod.z.boolean().optional().describe(
|
|
38
|
+
"Indicates whether the code is set on the device according to a preconfigured schedule."
|
|
39
|
+
),
|
|
40
|
+
type: zod.z.enum(["time_bound", "ongoing"]).describe(
|
|
41
|
+
'Nature of the access code. Values are "ongoing" for access codes that are active continuously until deactivated manually or "time_bound" for access codes that have a specific duration.'
|
|
42
|
+
),
|
|
43
|
+
is_waiting_for_code_assignment: zod.z.boolean().optional().describe(
|
|
44
|
+
"Indicates whether the access code is waiting for a code assignment."
|
|
45
|
+
),
|
|
46
|
+
access_code_id: zod.z.string().uuid().describe("Unique identifier for the access code."),
|
|
47
|
+
device_id: zod.z.string().uuid().describe(
|
|
48
|
+
"Unique identifier for the device associated with the access code."
|
|
49
|
+
),
|
|
50
|
+
name: zod.z.string().nullable().describe(
|
|
51
|
+
"Name of the access code. Enables administrators and users to identify the access code easily, especially when there are numerous access codes."
|
|
52
|
+
),
|
|
53
|
+
code: zod.z.string().nullable().describe(
|
|
54
|
+
"Code used for access. Typically, a numeric or alphanumeric string."
|
|
55
|
+
),
|
|
56
|
+
created_at: zod.z.string().datetime().describe("Date and time at which the access code was created."),
|
|
57
|
+
errors: zod.z.any().describe(
|
|
58
|
+
'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.'
|
|
59
|
+
),
|
|
60
|
+
warnings: zod.z.any().describe(
|
|
61
|
+
'Collection of warnings associated with the access code, structured in a dictionary format. A unique "warning_code" keys each warning. Each warning entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the warning. "created_at" is a date that indicates when the warning was generated. This structure enables detailed tracking and timely response to potential issues that are not critical but that may require attention.'
|
|
62
|
+
),
|
|
63
|
+
is_managed: zod.z.literal(true).describe("Indicates whether Seam manages the access code."),
|
|
64
|
+
starts_at: zod.z.string().datetime().nullable().optional().describe(
|
|
65
|
+
"Date and time at which the time-bound access code becomes active."
|
|
66
|
+
),
|
|
67
|
+
ends_at: zod.z.string().datetime().nullable().optional().describe(
|
|
68
|
+
"Date and time after which the time-bound access code becomes inactive."
|
|
69
|
+
),
|
|
70
|
+
status: zod.z.enum(["setting", "set", "unset", "removing", "unknown"]).describe(`
|
|
71
|
+
Current status of the access code within the operational lifecycle. Values are "setting," a transitional phase that indicates that the code is being configured or activated; "set", which indicates that the code is active and operational; "unset," which indicates a deactivated or unused state, either before activation or after deliberate deactivation; "removing," which indicates a transitional period in which the code is being deleted or made inactive; and "unknown," which indicates an indeterminate state, due to reasons such as system errors or incomplete data, that highlights a potential need for system review or troubleshooting.
|
|
72
|
+
`),
|
|
73
|
+
is_backup_access_code_available: zod.z.boolean().describe(
|
|
74
|
+
"Indicates whether a backup access code is available for use if the primary access code is lost or compromised."
|
|
75
|
+
),
|
|
76
|
+
is_backup: zod.z.boolean().optional().describe("Indicates whether the access code is a backup code."),
|
|
77
|
+
pulled_backup_access_code_id: zod.z.string().uuid().nullable().optional().describe(
|
|
78
|
+
"Identifier of the pulled backup access code. Used to associate the pulled backup access code with the original access code."
|
|
79
|
+
),
|
|
80
|
+
is_external_modification_allowed: zod.z.boolean().describe(
|
|
81
|
+
"Indicates whether changes to the access code from external sources are permitted."
|
|
82
|
+
),
|
|
83
|
+
is_one_time_use: zod.z.boolean().describe(
|
|
84
|
+
'Indicates whether the access code can only be used once. If "true," the code becomes invalid after the first use.'
|
|
85
|
+
),
|
|
86
|
+
is_offline_access_code: zod.z.boolean().describe(
|
|
87
|
+
'Indicates whether the access code is intended for use in offline scenarios. If "true," this code can be created on a device without a network connection.'
|
|
88
|
+
)
|
|
89
|
+
});
|
|
90
|
+
var unmanaged_access_code = access_code.pick({
|
|
91
|
+
type: true,
|
|
92
|
+
access_code_id: true,
|
|
93
|
+
device_id: true,
|
|
94
|
+
name: true,
|
|
95
|
+
code: true,
|
|
96
|
+
created_at: true,
|
|
97
|
+
errors: true,
|
|
98
|
+
warnings: true,
|
|
99
|
+
is_managed: true,
|
|
100
|
+
starts_at: true,
|
|
101
|
+
ends_at: true
|
|
102
|
+
}).extend({
|
|
103
|
+
is_managed: zod.z.literal(false),
|
|
104
|
+
status: zod.z.enum(["set"])
|
|
105
|
+
});
|
|
29
106
|
var acs_access_group_external_type = zod.z.enum([
|
|
30
107
|
"pti_unit",
|
|
31
108
|
"pti_access_level",
|
|
@@ -606,6 +683,772 @@ var connected_account = zod.z.object({
|
|
|
606
683
|
custom_metadata,
|
|
607
684
|
automatically_manage_new_devices: zod.z.boolean()
|
|
608
685
|
});
|
|
686
|
+
var capabilities = zod.z.enum([
|
|
687
|
+
"access_code",
|
|
688
|
+
"lock",
|
|
689
|
+
"noise_detection",
|
|
690
|
+
"thermostat",
|
|
691
|
+
"battery",
|
|
692
|
+
"phone"
|
|
693
|
+
]);
|
|
694
|
+
var access_code_code_constraint = zod.z.object({
|
|
695
|
+
constraint_type: zod.z.enum([
|
|
696
|
+
"no_zeros",
|
|
697
|
+
// Nuki
|
|
698
|
+
"cannot_start_with_12",
|
|
699
|
+
// Nuki
|
|
700
|
+
"no_triple_consecutive_ints",
|
|
701
|
+
// Brivo
|
|
702
|
+
"cannot_specify_pin_code",
|
|
703
|
+
// Lockly
|
|
704
|
+
"pin_code_matches_existing_set",
|
|
705
|
+
// Salto
|
|
706
|
+
"start_date_in_future",
|
|
707
|
+
// Kwikset
|
|
708
|
+
"no_ascending_or_descending_sequence",
|
|
709
|
+
// Tedee
|
|
710
|
+
"at_least_three_unique_digits",
|
|
711
|
+
// Tedee
|
|
712
|
+
"cannot_contain_089"
|
|
713
|
+
// TTLock (for some cylinder devices only)
|
|
714
|
+
])
|
|
715
|
+
});
|
|
716
|
+
var access_code_name_constraint = zod.z.object({
|
|
717
|
+
constraint_type: zod.z.enum(["name_length", "name_must_be_unique"]),
|
|
718
|
+
// Nuki, Kwikset
|
|
719
|
+
min_length: zod.z.number().optional(),
|
|
720
|
+
max_length: zod.z.number().optional()
|
|
721
|
+
});
|
|
722
|
+
var access_code_constraint = zod.z.union([
|
|
723
|
+
access_code_code_constraint,
|
|
724
|
+
access_code_name_constraint
|
|
725
|
+
]);
|
|
726
|
+
var access_code_capability_properties = zod.z.object({
|
|
727
|
+
_experimental_supported_code_from_access_codes_lengths: zod.z.array(zod.z.number()).optional(),
|
|
728
|
+
code_constraints: zod.z.array(access_code_constraint).optional(),
|
|
729
|
+
supported_code_lengths: zod.z.array(zod.z.number()).optional(),
|
|
730
|
+
max_active_codes_supported: zod.z.number().optional(),
|
|
731
|
+
supports_backup_access_code_pool: zod.z.boolean().optional(),
|
|
732
|
+
has_native_entry_events: zod.z.boolean().optional()
|
|
733
|
+
});
|
|
734
|
+
var lock_capability_properties = zod.z.object({
|
|
735
|
+
locked: zod.z.boolean().optional(),
|
|
736
|
+
keypad_battery: zod.z.object({
|
|
737
|
+
level: zod.z.number()
|
|
738
|
+
}).optional(),
|
|
739
|
+
door_open: zod.z.boolean().optional()
|
|
740
|
+
});
|
|
741
|
+
var hvac_mode_setting = zod.z.enum(["off", "heat", "cool", "heat_cool"]);
|
|
742
|
+
var fan_mode_setting = zod.z.enum(["auto", "on"]);
|
|
743
|
+
var climate_setting = zod.z.object({
|
|
744
|
+
automatic_heating_enabled: zod.z.boolean(),
|
|
745
|
+
automatic_cooling_enabled: zod.z.boolean(),
|
|
746
|
+
hvac_mode_setting,
|
|
747
|
+
cooling_set_point_celsius: zod.z.number().optional(),
|
|
748
|
+
heating_set_point_celsius: zod.z.number().optional(),
|
|
749
|
+
cooling_set_point_fahrenheit: zod.z.number().optional(),
|
|
750
|
+
heating_set_point_fahrenheit: zod.z.number().optional(),
|
|
751
|
+
manual_override_allowed: zod.z.boolean()
|
|
752
|
+
});
|
|
753
|
+
var climate_setting_schedule = zod.z.object({
|
|
754
|
+
climate_setting_schedule_id: zod.z.string().uuid(),
|
|
755
|
+
schedule_type: zod.z.literal("time_bound"),
|
|
756
|
+
device_id: zod.z.string().uuid(),
|
|
757
|
+
name: zod.z.string().optional(),
|
|
758
|
+
schedule_starts_at: zod.z.string(),
|
|
759
|
+
schedule_ends_at: zod.z.string(),
|
|
760
|
+
created_at: zod.z.string().datetime(),
|
|
761
|
+
errors: zod.z.any().describe(
|
|
762
|
+
'Collection of errors associated with the access code, structured in a dictionary format. A unique "error_code" keys each error. Each error entry is an object containing two fields: "message" and "created_at." "message" is a string that describes the error. "created_at" is a date that indicates when the error was generated. This structure enables detailed tracking and timely response to critical issues.'
|
|
763
|
+
)
|
|
764
|
+
}).merge(climate_setting.partial());
|
|
765
|
+
var base_thermostat_capability_properties = zod.z.object({
|
|
766
|
+
temperature_fahrenheit: zod.z.number(),
|
|
767
|
+
temperature_celsius: zod.z.number(),
|
|
768
|
+
relative_humidity: zod.z.number().min(0).max(1),
|
|
769
|
+
can_enable_automatic_heating: zod.z.boolean(),
|
|
770
|
+
can_enable_automatic_cooling: zod.z.boolean(),
|
|
771
|
+
available_hvac_mode_settings: zod.z.array(hvac_mode_setting),
|
|
772
|
+
is_heating_available: zod.z.literal(false),
|
|
773
|
+
is_cooling_available: zod.z.literal(false),
|
|
774
|
+
is_heating: zod.z.boolean(),
|
|
775
|
+
is_cooling: zod.z.boolean(),
|
|
776
|
+
is_fan_running: zod.z.boolean(),
|
|
777
|
+
fan_mode_setting,
|
|
778
|
+
/**
|
|
779
|
+
* this is true if the current thermostat settings differ that what is on seam, and `current_climate_setting.manual_override_allowed: true`
|
|
780
|
+
*/
|
|
781
|
+
is_temporary_manual_override_active: zod.z.boolean(),
|
|
782
|
+
/**
|
|
783
|
+
* can be derived from `default_climate_setting`, or `active_climate_setting_schedule` if one is active
|
|
784
|
+
*/
|
|
785
|
+
current_climate_setting: climate_setting,
|
|
786
|
+
default_climate_setting: climate_setting.optional(),
|
|
787
|
+
is_climate_setting_schedule_active: zod.z.boolean(),
|
|
788
|
+
active_climate_setting_schedule: climate_setting_schedule.optional()
|
|
789
|
+
});
|
|
790
|
+
var cooling_thermostat_capability_properties = base_thermostat_capability_properties.merge(
|
|
791
|
+
zod.z.object({
|
|
792
|
+
min_cooling_set_point_celsius: zod.z.number(),
|
|
793
|
+
min_cooling_set_point_fahrenheit: zod.z.number(),
|
|
794
|
+
max_cooling_set_point_celsius: zod.z.number(),
|
|
795
|
+
max_cooling_set_point_fahrenheit: zod.z.number(),
|
|
796
|
+
is_cooling_available: zod.z.literal(true)
|
|
797
|
+
})
|
|
798
|
+
);
|
|
799
|
+
var heating_thermostat_capability_properties = base_thermostat_capability_properties.merge(
|
|
800
|
+
zod.z.object({
|
|
801
|
+
min_heating_set_point_celsius: zod.z.number(),
|
|
802
|
+
min_heating_set_point_fahrenheit: zod.z.number(),
|
|
803
|
+
max_heating_set_point_celsius: zod.z.number(),
|
|
804
|
+
max_heating_set_point_fahrenheit: zod.z.number(),
|
|
805
|
+
is_heating_available: zod.z.literal(true)
|
|
806
|
+
})
|
|
807
|
+
);
|
|
808
|
+
var heating_cooling_thermostat_capability_properties = cooling_thermostat_capability_properties.merge(heating_thermostat_capability_properties).merge(
|
|
809
|
+
zod.z.object({
|
|
810
|
+
is_cooling_available: zod.z.literal(true),
|
|
811
|
+
is_heating_available: zod.z.literal(true),
|
|
812
|
+
min_heating_cooling_delta_celsius: zod.z.number(),
|
|
813
|
+
min_heating_cooling_delta_fahrenheit: zod.z.number()
|
|
814
|
+
})
|
|
815
|
+
);
|
|
816
|
+
var thermostat_capability_properties = zod.z.union([
|
|
817
|
+
heating_cooling_thermostat_capability_properties.partial(),
|
|
818
|
+
heating_thermostat_capability_properties.partial(),
|
|
819
|
+
cooling_thermostat_capability_properties.partial()
|
|
820
|
+
]);
|
|
821
|
+
|
|
822
|
+
// src/lib/seam/connect/models/devices/capability-properties/index.ts
|
|
823
|
+
var capability_properties = zod.z.intersection(
|
|
824
|
+
access_code_capability_properties.partial().merge(lock_capability_properties.partial()),
|
|
825
|
+
thermostat_capability_properties
|
|
826
|
+
);
|
|
827
|
+
|
|
828
|
+
// src/lib/seam/devicedb/models/index.ts
|
|
829
|
+
var models_exports = {};
|
|
830
|
+
__export(models_exports, {
|
|
831
|
+
base_device_model_v1: () => base_device_model_v1,
|
|
832
|
+
device_capability_flags: () => device_capability_flags,
|
|
833
|
+
device_category: () => device_category,
|
|
834
|
+
device_connection_type: () => device_connection_type,
|
|
835
|
+
device_model_category_specific_properties: () => device_model_category_specific_properties,
|
|
836
|
+
device_model_v1: () => device_model_v1,
|
|
837
|
+
image_reference: () => image_reference,
|
|
838
|
+
manufacturer: () => manufacturer,
|
|
839
|
+
manufacturer_annotation: () => manufacturer_annotation,
|
|
840
|
+
manufacturer_annotation_code: () => manufacturer_annotation_code,
|
|
841
|
+
manufacturer_integration_support_level: () => manufacturer_integration_support_level,
|
|
842
|
+
thermostat: () => thermostat
|
|
843
|
+
});
|
|
844
|
+
var device_capability_flags = zod.z.object({
|
|
845
|
+
can_remotely_unlock: zod.z.boolean(),
|
|
846
|
+
can_remotely_lock: zod.z.boolean(),
|
|
847
|
+
can_program_offline_access_codes: zod.z.boolean(),
|
|
848
|
+
can_program_online_access_codes: zod.z.boolean()
|
|
849
|
+
}).partial();
|
|
850
|
+
var device_model_capability_flags_map = {
|
|
851
|
+
can_remotely_lock: zod.z.literal(true),
|
|
852
|
+
can_remotely_unlock: zod.z.literal(true),
|
|
853
|
+
can_program_offline_access_codes: zod.z.literal(true),
|
|
854
|
+
can_program_online_access_codes: zod.z.literal(true)
|
|
855
|
+
};
|
|
856
|
+
var device_model_capability_flags = zod.z.object(device_model_capability_flags_map).partial();
|
|
857
|
+
var hardware = zod.z.object({
|
|
858
|
+
has_physical_key: zod.z.boolean()
|
|
859
|
+
}).partial();
|
|
860
|
+
var image_reference = zod.z.object({
|
|
861
|
+
url: zod.z.string().url(),
|
|
862
|
+
width: zod.z.number(),
|
|
863
|
+
height: zod.z.number()
|
|
864
|
+
});
|
|
865
|
+
var manufacturer_integration_support_level = zod.z.enum([
|
|
866
|
+
"stable",
|
|
867
|
+
"beta",
|
|
868
|
+
"planned",
|
|
869
|
+
"unsupported",
|
|
870
|
+
"inquire"
|
|
871
|
+
]);
|
|
872
|
+
var manufacturer_annotation_code = zod.z.enum(["subscription_required"]);
|
|
873
|
+
var manufacturer_annotation = zod.z.object({
|
|
874
|
+
annotation_code: manufacturer_annotation_code,
|
|
875
|
+
message: zod.z.string().trim().nonempty()
|
|
876
|
+
});
|
|
877
|
+
var manufacturer = zod.z.object({
|
|
878
|
+
manufacturer_id: zod.z.string().uuid(),
|
|
879
|
+
display_name: zod.z.string(),
|
|
880
|
+
logo: image_reference.optional(),
|
|
881
|
+
/** @deprecated */
|
|
882
|
+
integration: manufacturer_integration_support_level,
|
|
883
|
+
integration_support_level: manufacturer_integration_support_level,
|
|
884
|
+
is_connect_webview_supported: zod.z.boolean(),
|
|
885
|
+
requires_seam_support_to_add_account: zod.z.boolean(),
|
|
886
|
+
device_model_count: zod.z.number(),
|
|
887
|
+
annotations: zod.z.array(manufacturer_annotation),
|
|
888
|
+
website: zod.z.string().url().optional(),
|
|
889
|
+
legal_name: zod.z.string().optional(),
|
|
890
|
+
parent_organization: zod.z.string().optional(),
|
|
891
|
+
headquarters: zod.z.array(zod.z.string()).optional(),
|
|
892
|
+
countries_of_origin: zod.z.array(zod.z.string()).optional(),
|
|
893
|
+
founding_year: zod.z.string().optional(),
|
|
894
|
+
us_customer_support_tel: zod.z.string().optional(),
|
|
895
|
+
us_customer_support_email: zod.z.string().email().optional(),
|
|
896
|
+
us_customer_support_contact_url: zod.z.string().url().optional(),
|
|
897
|
+
seam_api_guide: zod.z.string().optional(),
|
|
898
|
+
description: zod.z.string().optional()
|
|
899
|
+
});
|
|
900
|
+
|
|
901
|
+
// src/lib/seam/devicedb/models/device-model.ts
|
|
902
|
+
var device_category = zod.z.enum([
|
|
903
|
+
"smartlock",
|
|
904
|
+
"sensor",
|
|
905
|
+
"thermostat",
|
|
906
|
+
"relay",
|
|
907
|
+
"intercom",
|
|
908
|
+
"accessory"
|
|
909
|
+
]);
|
|
910
|
+
var device_connection_type = zod.z.enum([
|
|
911
|
+
"wifi",
|
|
912
|
+
"zwave",
|
|
913
|
+
"zigbee",
|
|
914
|
+
"unknown"
|
|
915
|
+
]);
|
|
916
|
+
var smartlock = zod.z.object({
|
|
917
|
+
main_category: zod.z.literal(device_category.enum.smartlock),
|
|
918
|
+
physical_properties: zod.z.object({
|
|
919
|
+
lock_type: zod.z.enum([
|
|
920
|
+
"deadbolt",
|
|
921
|
+
"lever",
|
|
922
|
+
"mortise",
|
|
923
|
+
"lockbox",
|
|
924
|
+
"cylinder",
|
|
925
|
+
"padlock",
|
|
926
|
+
"locker",
|
|
927
|
+
"unknown"
|
|
928
|
+
]),
|
|
929
|
+
has_physical_key: zod.z.boolean(),
|
|
930
|
+
has_camera: zod.z.boolean()
|
|
931
|
+
}),
|
|
932
|
+
software_features: zod.z.object({
|
|
933
|
+
can_remotely_unlock: zod.z.boolean(),
|
|
934
|
+
can_program_access_codes: zod.z.boolean(),
|
|
935
|
+
can_program_access_schedules: zod.z.boolean(),
|
|
936
|
+
can_program_access_codes_offline: zod.z.boolean()
|
|
937
|
+
})
|
|
938
|
+
}).merge(
|
|
939
|
+
device_model_capability_flags.pick({
|
|
940
|
+
can_remotely_lock: true,
|
|
941
|
+
can_remotely_unlock: true,
|
|
942
|
+
can_program_offline_access_codes: true,
|
|
943
|
+
can_program_online_access_codes: true
|
|
944
|
+
})
|
|
945
|
+
);
|
|
946
|
+
var sensor = zod.z.object({
|
|
947
|
+
main_category: zod.z.literal(device_category.enum.sensor),
|
|
948
|
+
physical_properties: zod.z.object({
|
|
949
|
+
has_noise_sensor: zod.z.boolean(),
|
|
950
|
+
has_humidity_sensor: zod.z.boolean(),
|
|
951
|
+
has_temperature_sensor: zod.z.boolean(),
|
|
952
|
+
has_occupancy_detection: zod.z.boolean()
|
|
953
|
+
})
|
|
954
|
+
});
|
|
955
|
+
var thermostat = zod.z.object({
|
|
956
|
+
main_category: zod.z.literal(device_category.enum.thermostat),
|
|
957
|
+
physical_properties: zod.z.object({
|
|
958
|
+
available_modes: zod.z.enum(["heat", "cool", "fan", "eco"]).array(),
|
|
959
|
+
is_heat_pump_compatible: zod.z.boolean(),
|
|
960
|
+
has_occupancy_detection: zod.z.boolean(),
|
|
961
|
+
supports_demand_response: zod.z.boolean(),
|
|
962
|
+
has_humidity_sensor: zod.z.boolean(),
|
|
963
|
+
has_temperature_sensor: zod.z.boolean(),
|
|
964
|
+
supports_emergency_heating_mode: zod.z.boolean()
|
|
965
|
+
}),
|
|
966
|
+
software_features: zod.z.object({
|
|
967
|
+
can_program_climate_schedules: zod.z.boolean()
|
|
968
|
+
})
|
|
969
|
+
});
|
|
970
|
+
var relay = zod.z.object({
|
|
971
|
+
main_category: zod.z.literal(device_category.enum.relay)
|
|
972
|
+
});
|
|
973
|
+
var intercom = zod.z.object({
|
|
974
|
+
main_category: zod.z.literal(device_category.enum.intercom),
|
|
975
|
+
physical_properties: zod.z.object({
|
|
976
|
+
has_camera: zod.z.boolean(),
|
|
977
|
+
has_rfid_reader: zod.z.boolean().default(false),
|
|
978
|
+
has_nfc_reader: zod.z.boolean().default(false),
|
|
979
|
+
has_wiegand_interface: zod.z.boolean().default(false)
|
|
980
|
+
}),
|
|
981
|
+
software_features: zod.z.object({
|
|
982
|
+
can_remotely_unlock: zod.z.boolean(),
|
|
983
|
+
can_program_access_codes: zod.z.boolean(),
|
|
984
|
+
can_unlock_with_face_recognition: zod.z.boolean().default(false),
|
|
985
|
+
supports_onvif: zod.z.boolean().default(false)
|
|
986
|
+
})
|
|
987
|
+
});
|
|
988
|
+
var accessory = zod.z.object({
|
|
989
|
+
main_category: zod.z.literal(device_category.enum.accessory)
|
|
990
|
+
});
|
|
991
|
+
var device_model_category_specific_properties = zod.z.discriminatedUnion(
|
|
992
|
+
"main_category",
|
|
993
|
+
[smartlock, sensor, thermostat, relay, intercom, accessory]
|
|
994
|
+
);
|
|
995
|
+
var base_device_model_v1 = zod.z.object({
|
|
996
|
+
device_model_id: zod.z.string().uuid(),
|
|
997
|
+
manufacturer: manufacturer.omit({
|
|
998
|
+
device_model_count: true
|
|
999
|
+
}),
|
|
1000
|
+
is_device_supported: zod.z.boolean(),
|
|
1001
|
+
display_name: zod.z.string(),
|
|
1002
|
+
description: zod.z.string(),
|
|
1003
|
+
product_url: zod.z.string().optional(),
|
|
1004
|
+
main_connection_type: device_connection_type,
|
|
1005
|
+
hardware,
|
|
1006
|
+
aesthetic_variants: zod.z.object({
|
|
1007
|
+
slug: zod.z.string(),
|
|
1008
|
+
display_name: zod.z.string(),
|
|
1009
|
+
primary_color_hex: zod.z.string().optional(),
|
|
1010
|
+
manufacturer_sku: zod.z.string().optional(),
|
|
1011
|
+
front_image: image_reference.optional(),
|
|
1012
|
+
back_image: image_reference.optional(),
|
|
1013
|
+
images: image_reference.array()
|
|
1014
|
+
}).array(),
|
|
1015
|
+
power_sources: zod.z.enum([
|
|
1016
|
+
"battery",
|
|
1017
|
+
"hardwired",
|
|
1018
|
+
"mechanical_harvesting",
|
|
1019
|
+
"wireless",
|
|
1020
|
+
"ethernet"
|
|
1021
|
+
]).array()
|
|
1022
|
+
});
|
|
1023
|
+
var device_model_v1 = base_device_model_v1.and(
|
|
1024
|
+
device_model_category_specific_properties
|
|
1025
|
+
);
|
|
1026
|
+
var dormakaba_oracode_time_slot = zod.z.object({
|
|
1027
|
+
name: zod.z.string(),
|
|
1028
|
+
prefix: zod.z.number(),
|
|
1029
|
+
// Seam TOD
|
|
1030
|
+
check_in_time: zod.z.string(),
|
|
1031
|
+
// Seam TOD
|
|
1032
|
+
check_out_time: zod.z.string(),
|
|
1033
|
+
is_24_hour: zod.z.boolean(),
|
|
1034
|
+
is_biweekly_mode: zod.z.boolean(),
|
|
1035
|
+
is_one_shot: zod.z.boolean(),
|
|
1036
|
+
is_master: zod.z.boolean(),
|
|
1037
|
+
ext_dormakaba_oracode_user_level_prefix: zod.z.number(),
|
|
1038
|
+
dormakaba_oracode_user_level_id: zod.z.string().uuid()
|
|
1039
|
+
});
|
|
1040
|
+
var device_metadata = zod.z.object({
|
|
1041
|
+
august_metadata: zod.z.object({
|
|
1042
|
+
lock_id: zod.z.string(),
|
|
1043
|
+
lock_name: zod.z.string(),
|
|
1044
|
+
house_name: zod.z.string(),
|
|
1045
|
+
has_keypad: zod.z.boolean(),
|
|
1046
|
+
keypad_battery_level: zod.z.string().optional(),
|
|
1047
|
+
model: zod.z.string().optional(),
|
|
1048
|
+
house_id: zod.z.string().optional()
|
|
1049
|
+
}),
|
|
1050
|
+
avigilon_alta_metadata: zod.z.object({
|
|
1051
|
+
entry_name: zod.z.string(),
|
|
1052
|
+
org_name: zod.z.string(),
|
|
1053
|
+
zone_id: zod.z.number(),
|
|
1054
|
+
zone_name: zod.z.string(),
|
|
1055
|
+
site_id: zod.z.number(),
|
|
1056
|
+
site_name: zod.z.string(),
|
|
1057
|
+
entry_relays_total_count: zod.z.number()
|
|
1058
|
+
}),
|
|
1059
|
+
schlage_metadata: zod.z.object({
|
|
1060
|
+
device_id: zod.z.string(),
|
|
1061
|
+
device_name: zod.z.string(),
|
|
1062
|
+
access_code_length: zod.z.number().nullable(),
|
|
1063
|
+
model: zod.z.string().optional()
|
|
1064
|
+
}),
|
|
1065
|
+
smartthings_metadata: zod.z.object({
|
|
1066
|
+
device_id: zod.z.string(),
|
|
1067
|
+
device_name: zod.z.string(),
|
|
1068
|
+
model: zod.z.string().optional(),
|
|
1069
|
+
location_id: zod.z.string().optional()
|
|
1070
|
+
}),
|
|
1071
|
+
lockly_metadata: zod.z.object({
|
|
1072
|
+
device_id: zod.z.string(),
|
|
1073
|
+
device_name: zod.z.string(),
|
|
1074
|
+
model: zod.z.string().optional()
|
|
1075
|
+
}),
|
|
1076
|
+
nuki_metadata: zod.z.object({
|
|
1077
|
+
device_id: zod.z.string(),
|
|
1078
|
+
device_name: zod.z.string(),
|
|
1079
|
+
keypad_battery_critical: zod.z.boolean().optional(),
|
|
1080
|
+
keypad_paired: zod.z.boolean().optional(),
|
|
1081
|
+
keypad_2_paired: zod.z.boolean().optional()
|
|
1082
|
+
}),
|
|
1083
|
+
kwikset_metadata: zod.z.object({
|
|
1084
|
+
device_id: zod.z.string(),
|
|
1085
|
+
device_name: zod.z.string(),
|
|
1086
|
+
model_number: zod.z.string()
|
|
1087
|
+
}),
|
|
1088
|
+
salto_metadata: zod.z.object({
|
|
1089
|
+
lock_id: zod.z.string(),
|
|
1090
|
+
customer_reference: zod.z.string(),
|
|
1091
|
+
lock_type: zod.z.string(),
|
|
1092
|
+
battery_level: zod.z.string(),
|
|
1093
|
+
locked_state: zod.z.string(),
|
|
1094
|
+
model: zod.z.string().optional()
|
|
1095
|
+
}),
|
|
1096
|
+
genie_metadata: zod.z.object({
|
|
1097
|
+
device_name: zod.z.string(),
|
|
1098
|
+
door_name: zod.z.string()
|
|
1099
|
+
}),
|
|
1100
|
+
brivo_metadata: zod.z.object({
|
|
1101
|
+
device_name: zod.z.string()
|
|
1102
|
+
}),
|
|
1103
|
+
igloo_metadata: zod.z.object({
|
|
1104
|
+
device_id: zod.z.string(),
|
|
1105
|
+
bridge_id: zod.z.string(),
|
|
1106
|
+
model: zod.z.string().optional()
|
|
1107
|
+
}),
|
|
1108
|
+
noiseaware_metadata: zod.z.object({
|
|
1109
|
+
device_model: zod.z.enum(["indoor", "outdoor"]),
|
|
1110
|
+
noise_level_nrs: zod.z.number(),
|
|
1111
|
+
noise_level_decibel: zod.z.number(),
|
|
1112
|
+
device_name: zod.z.string(),
|
|
1113
|
+
device_id: zod.z.string()
|
|
1114
|
+
}),
|
|
1115
|
+
minut_metadata: zod.z.object({
|
|
1116
|
+
device_id: zod.z.string(),
|
|
1117
|
+
device_name: zod.z.string(),
|
|
1118
|
+
latest_sensor_values: zod.z.object({
|
|
1119
|
+
temperature: zod.z.object({
|
|
1120
|
+
time: zod.z.string(),
|
|
1121
|
+
value: zod.z.number()
|
|
1122
|
+
}),
|
|
1123
|
+
sound: zod.z.object({
|
|
1124
|
+
time: zod.z.string(),
|
|
1125
|
+
value: zod.z.number()
|
|
1126
|
+
}),
|
|
1127
|
+
humidity: zod.z.object({
|
|
1128
|
+
time: zod.z.string(),
|
|
1129
|
+
value: zod.z.number()
|
|
1130
|
+
}),
|
|
1131
|
+
pressure: zod.z.object({
|
|
1132
|
+
time: zod.z.string(),
|
|
1133
|
+
value: zod.z.number()
|
|
1134
|
+
}),
|
|
1135
|
+
accelerometer_z: zod.z.object({
|
|
1136
|
+
time: zod.z.string(),
|
|
1137
|
+
value: zod.z.number()
|
|
1138
|
+
})
|
|
1139
|
+
})
|
|
1140
|
+
}),
|
|
1141
|
+
four_suites_metadata: zod.z.object({
|
|
1142
|
+
device_id: zod.z.number(),
|
|
1143
|
+
device_name: zod.z.string(),
|
|
1144
|
+
reclose_delay_in_seconds: zod.z.number()
|
|
1145
|
+
}),
|
|
1146
|
+
two_n_metadata: zod.z.object({
|
|
1147
|
+
device_id: zod.z.number(),
|
|
1148
|
+
device_name: zod.z.string()
|
|
1149
|
+
}),
|
|
1150
|
+
controlbyweb_metadata: zod.z.object({
|
|
1151
|
+
device_id: zod.z.string(),
|
|
1152
|
+
device_name: zod.z.string(),
|
|
1153
|
+
relay_name: zod.z.string().nullable()
|
|
1154
|
+
}),
|
|
1155
|
+
ttlock_metadata: zod.z.object({
|
|
1156
|
+
lock_id: zod.z.number(),
|
|
1157
|
+
lock_alias: zod.z.string(),
|
|
1158
|
+
feature_value: zod.z.string()
|
|
1159
|
+
}),
|
|
1160
|
+
seam_bridge_metadata: zod.z.object({
|
|
1161
|
+
unlock_method: zod.z.enum(["bridge", "doorking"]).optional(),
|
|
1162
|
+
device_num: zod.z.number(),
|
|
1163
|
+
name: zod.z.string()
|
|
1164
|
+
}),
|
|
1165
|
+
igloohome_metadata: zod.z.object({
|
|
1166
|
+
device_id: zod.z.string(),
|
|
1167
|
+
device_name: zod.z.string(),
|
|
1168
|
+
bridge_id: zod.z.string().optional(),
|
|
1169
|
+
bridge_name: zod.z.string().optional(),
|
|
1170
|
+
keypad_id: zod.z.string().optional()
|
|
1171
|
+
}),
|
|
1172
|
+
nest_metadata: zod.z.object({
|
|
1173
|
+
nest_device_id: zod.z.string(),
|
|
1174
|
+
device_name: zod.z.string(),
|
|
1175
|
+
// set by Google
|
|
1176
|
+
custom_name: zod.z.string()
|
|
1177
|
+
// set by device owner
|
|
1178
|
+
}),
|
|
1179
|
+
ecobee_metadata: zod.z.object({
|
|
1180
|
+
ecobee_device_id: zod.z.string(),
|
|
1181
|
+
device_name: zod.z.string()
|
|
1182
|
+
}),
|
|
1183
|
+
honeywell_resideo_metadata: zod.z.object({
|
|
1184
|
+
honeywell_resideo_device_id: zod.z.string(),
|
|
1185
|
+
device_name: zod.z.string()
|
|
1186
|
+
}),
|
|
1187
|
+
hubitat_metadata: zod.z.object({
|
|
1188
|
+
device_id: zod.z.string(),
|
|
1189
|
+
device_name: zod.z.string(),
|
|
1190
|
+
device_label: zod.z.string()
|
|
1191
|
+
}),
|
|
1192
|
+
dormakaba_oracode_metadata: zod.z.object({
|
|
1193
|
+
door_id: zod.z.number(),
|
|
1194
|
+
door_name: zod.z.string(),
|
|
1195
|
+
device_id: zod.z.number().optional(),
|
|
1196
|
+
door_is_wireless: zod.z.boolean(),
|
|
1197
|
+
site_id: zod.z.number(),
|
|
1198
|
+
site_name: zod.z.string(),
|
|
1199
|
+
iana_timezone: zod.z.string().optional(),
|
|
1200
|
+
predefined_time_slots: zod.z.array(dormakaba_oracode_time_slot).optional()
|
|
1201
|
+
}),
|
|
1202
|
+
wyze_metadata: zod.z.object({
|
|
1203
|
+
device_id: zod.z.string(),
|
|
1204
|
+
device_name: zod.z.string(),
|
|
1205
|
+
product_name: zod.z.string(),
|
|
1206
|
+
product_type: zod.z.string(),
|
|
1207
|
+
product_model: zod.z.string(),
|
|
1208
|
+
device_info_model: zod.z.string(),
|
|
1209
|
+
keypad_uuid: zod.z.string().optional(),
|
|
1210
|
+
locker_status_hardlock: zod.z.number().optional()
|
|
1211
|
+
}),
|
|
1212
|
+
tedee_metadata: zod.z.object({
|
|
1213
|
+
device_id: zod.z.number(),
|
|
1214
|
+
serial_number: zod.z.string(),
|
|
1215
|
+
device_name: zod.z.string(),
|
|
1216
|
+
device_model: zod.z.string(),
|
|
1217
|
+
bridge_id: zod.z.number(),
|
|
1218
|
+
bridge_name: zod.z.string(),
|
|
1219
|
+
keypad_id: zod.z.number().optional()
|
|
1220
|
+
})
|
|
1221
|
+
}).partial();
|
|
1222
|
+
var LOCK_DEVICE_TYPE = {
|
|
1223
|
+
AKUVOX_LOCK: "akuvox_lock",
|
|
1224
|
+
AUGUST_LOCK: "august_lock",
|
|
1225
|
+
BRIVO_ACCESS_POINT: "brivo_access_point",
|
|
1226
|
+
BUTTERFLYMX_PANEL: "butterflymx_panel",
|
|
1227
|
+
AVIGILON_ALTA_ENTRY: "avigilon_alta_entry",
|
|
1228
|
+
DOORKING_LOCK: "doorking_lock",
|
|
1229
|
+
GENIE_DOOR: "genie_door",
|
|
1230
|
+
IGLOO_LOCK: "igloo_lock",
|
|
1231
|
+
LINEAR_LOCK: "linear_lock",
|
|
1232
|
+
LOCKLY_LOCK: "lockly_lock",
|
|
1233
|
+
KWIKSET_LOCK: "kwikset_lock",
|
|
1234
|
+
NUKI_LOCK: "nuki_lock",
|
|
1235
|
+
SALTO_LOCK: "salto_lock",
|
|
1236
|
+
SCHLAGE_LOCK: "schlage_lock",
|
|
1237
|
+
SEAM_RELAY: "seam_relay",
|
|
1238
|
+
SMARTTHINGS_LOCK: "smartthings_lock",
|
|
1239
|
+
WYZE_LOCK: "wyze_lock",
|
|
1240
|
+
YALE_LOCK: "yale_lock",
|
|
1241
|
+
TWO_N_INTERCOM: "two_n_intercom",
|
|
1242
|
+
CONTROLBYWEB_DEVICE: "controlbyweb_device",
|
|
1243
|
+
TTLOCK_LOCK: "ttlock_lock",
|
|
1244
|
+
IGLOOHOME_LOCK: "igloohome_lock",
|
|
1245
|
+
HUBITAT_LOCK: "hubitat_lock",
|
|
1246
|
+
FOUR_SUITES_DOOR: "four_suites_door",
|
|
1247
|
+
DORMAKABA_ORACODE_DOOR: "dormakaba_oracode_door",
|
|
1248
|
+
TEDEE_LOCK: "tedee_lock"
|
|
1249
|
+
};
|
|
1250
|
+
var lock_device_type = zod.z.enum(
|
|
1251
|
+
Object.values(LOCK_DEVICE_TYPE)
|
|
1252
|
+
);
|
|
1253
|
+
var NOISE_SENSOR_DEVICE_TYPE = {
|
|
1254
|
+
NOISEAWARE_ACTIVITY_ZONE: "noiseaware_activity_zone",
|
|
1255
|
+
MINUT_SENSOR: "minut_sensor"
|
|
1256
|
+
};
|
|
1257
|
+
var noise_sensor_device_type = zod.z.enum(
|
|
1258
|
+
Object.values(NOISE_SENSOR_DEVICE_TYPE)
|
|
1259
|
+
);
|
|
1260
|
+
var THERMOSTAT_DEVICE_TYPE = {
|
|
1261
|
+
ECOBEE_THERMOSTAT: "ecobee_thermostat",
|
|
1262
|
+
NEST_THERMOSTAT: "nest_thermostat",
|
|
1263
|
+
HONEYWELL_RESIDEO_THERMOSTAT: "honeywell_resideo_thermostat"
|
|
1264
|
+
};
|
|
1265
|
+
var thermostat_device_type = zod.z.enum(
|
|
1266
|
+
Object.values(THERMOSTAT_DEVICE_TYPE)
|
|
1267
|
+
);
|
|
1268
|
+
var PHONE_DEVICE_TYPE = {
|
|
1269
|
+
IOS_PHONE: "ios_phone",
|
|
1270
|
+
ANDROID_PHONE: "android_phone"
|
|
1271
|
+
};
|
|
1272
|
+
var PHONE_DEVICE_TYPE_LIST = Object.values(
|
|
1273
|
+
PHONE_DEVICE_TYPE
|
|
1274
|
+
);
|
|
1275
|
+
var phone_device_type = zod.z.enum(
|
|
1276
|
+
Object.values(PHONE_DEVICE_TYPE_LIST)
|
|
1277
|
+
);
|
|
1278
|
+
var any_device_type = zod.z.union([
|
|
1279
|
+
lock_device_type,
|
|
1280
|
+
noise_sensor_device_type,
|
|
1281
|
+
thermostat_device_type,
|
|
1282
|
+
phone_device_type
|
|
1283
|
+
]);
|
|
1284
|
+
var phone_specific_properties = zod.z.object({
|
|
1285
|
+
assa_abloy_credential_service_metadata: zod.z.object({
|
|
1286
|
+
has_active_endpoint: zod.z.boolean(),
|
|
1287
|
+
endpoints: zod.z.array(
|
|
1288
|
+
zod.z.object({
|
|
1289
|
+
endpoint_id: zod.z.string(),
|
|
1290
|
+
is_active: zod.z.boolean()
|
|
1291
|
+
})
|
|
1292
|
+
)
|
|
1293
|
+
}).optional()
|
|
1294
|
+
});
|
|
1295
|
+
|
|
1296
|
+
// src/lib/seam/connect/models/devices/device.ts
|
|
1297
|
+
var device_capability_flags2 = models_exports.device_capability_flags.extend({
|
|
1298
|
+
can_simulate_removal: zod.z.boolean().optional(),
|
|
1299
|
+
can_simulate_connection: zod.z.boolean().optional(),
|
|
1300
|
+
can_simulate_disconnection: zod.z.boolean().optional()
|
|
1301
|
+
});
|
|
1302
|
+
var battery_status = zod.z.enum(["critical", "low", "good", "full"]);
|
|
1303
|
+
var common_device_properties = zod.z.object({
|
|
1304
|
+
online: zod.z.boolean().describe("Indicates whether the device is online."),
|
|
1305
|
+
name: zod.z.string().describe(`
|
|
1306
|
+
---
|
|
1307
|
+
deprecated: use device.display_name instead
|
|
1308
|
+
---
|
|
1309
|
+
Name of the device.
|
|
1310
|
+
`),
|
|
1311
|
+
accessory_keypad: zod.z.object({
|
|
1312
|
+
is_connected: zod.z.boolean().describe(
|
|
1313
|
+
"Indicates if the accessory_keypad is connected to the device."
|
|
1314
|
+
),
|
|
1315
|
+
battery: zod.z.object({
|
|
1316
|
+
level: zod.z.number().min(0).max(1)
|
|
1317
|
+
}).optional().describe("Indicates if the keypad battery properties.")
|
|
1318
|
+
}).optional().describe("Represents the accessory keypad state."),
|
|
1319
|
+
appearance: zod.z.object({
|
|
1320
|
+
name: zod.z.string().describe(
|
|
1321
|
+
"Name of the device as seen from the provider API and application, not settable through Seam."
|
|
1322
|
+
)
|
|
1323
|
+
}),
|
|
1324
|
+
model: zod.z.object({
|
|
1325
|
+
can_connect_accessory_keypad: zod.z.boolean().optional().describe("Indicates whether the device can connect a accessory keypad."),
|
|
1326
|
+
display_name: zod.z.string().describe("Display name of the device model."),
|
|
1327
|
+
manufacturer_display_name: zod.z.string().describe(
|
|
1328
|
+
"Display name that corresponds to the manufacturer-specific terminology for the device."
|
|
1329
|
+
),
|
|
1330
|
+
has_built_in_keypad: zod.z.boolean().optional().describe(
|
|
1331
|
+
"Indicates whether the device has a built in accessory keypad."
|
|
1332
|
+
),
|
|
1333
|
+
offline_access_codes_supported: zod.z.boolean().optional().describe("Indicates whether the device supports offline access codes."),
|
|
1334
|
+
online_access_codes_supported: zod.z.boolean().optional().describe("Indicates whether the device supports online access codes."),
|
|
1335
|
+
accessory_keypad_supported: zod.z.boolean().optional().describe(
|
|
1336
|
+
`
|
|
1337
|
+
---
|
|
1338
|
+
deprecated: use device.properties.model.can_connect_accessory_keypad
|
|
1339
|
+
---
|
|
1340
|
+
`
|
|
1341
|
+
)
|
|
1342
|
+
}),
|
|
1343
|
+
has_direct_power: zod.z.boolean().optional().describe("Indicates whether the device has direct power."),
|
|
1344
|
+
battery_level: zod.z.number().min(0).max(1).optional().describe(
|
|
1345
|
+
"Indicates the battery level of the device as a decimal value between 0 and 1, inclusive."
|
|
1346
|
+
),
|
|
1347
|
+
battery: zod.z.object({
|
|
1348
|
+
level: zod.z.number().min(0).max(1),
|
|
1349
|
+
status: battery_status
|
|
1350
|
+
}).optional().describe(
|
|
1351
|
+
'Represents the current status of the battery charge level. Values are "critical," which indicates an extremely low level, suggesting imminent shutdown or an urgent need for charging; "low," which signifies that the battery is under the preferred threshold and should be charged soon; "good," which denotes a satisfactory charge level, adequate for normal use without the immediate need for recharging; and "full," which represents a battery that is fully charged, providing the maximum duration of usage.'
|
|
1352
|
+
),
|
|
1353
|
+
// todo: use enum
|
|
1354
|
+
manufacturer: zod.z.string().optional().describe("Manufacturer of the device."),
|
|
1355
|
+
image_url: zod.z.string().url().optional().describe("Image URL for the device."),
|
|
1356
|
+
image_alt_text: zod.z.string().optional().describe("Alt text for the device image."),
|
|
1357
|
+
serial_number: zod.z.string().optional().describe("Serial number of the device."),
|
|
1358
|
+
online_access_codes_enabled: zod.z.boolean().describe(
|
|
1359
|
+
"Indicates whether it is currently possible to use online access codes for the device."
|
|
1360
|
+
).optional(),
|
|
1361
|
+
offline_access_codes_enabled: zod.z.boolean().describe(
|
|
1362
|
+
"Indicates whether it is currently possible to use offline access codes for the device."
|
|
1363
|
+
).optional(),
|
|
1364
|
+
// Deprecated legacy capability support props
|
|
1365
|
+
supports_accessory_keypad: zod.z.boolean().describe(
|
|
1366
|
+
`
|
|
1367
|
+
---
|
|
1368
|
+
deprecated: use device.properties.model.can_connect_accessory_keypad
|
|
1369
|
+
---
|
|
1370
|
+
`
|
|
1371
|
+
).optional(),
|
|
1372
|
+
supports_offline_access_codes: zod.z.boolean().describe(
|
|
1373
|
+
`
|
|
1374
|
+
---
|
|
1375
|
+
deprecated: use offline_access_codes_enabled
|
|
1376
|
+
---
|
|
1377
|
+
`
|
|
1378
|
+
).optional(),
|
|
1379
|
+
noise_level_decibels: zod.z.number().describe(
|
|
1380
|
+
"Indicates current noise level in decibels, if the device supports noise detection."
|
|
1381
|
+
).optional(),
|
|
1382
|
+
currently_triggering_noise_threshold_ids: zod.z.array(zod.z.string()).describe("Array of noise threshold IDs that are currently triggering.").optional()
|
|
1383
|
+
});
|
|
1384
|
+
var device = zod.z.object({
|
|
1385
|
+
device_id: zod.z.string().uuid().describe("Unique identifier for the device."),
|
|
1386
|
+
device_type: any_device_type.describe("Type of the device."),
|
|
1387
|
+
nickname: zod.z.string().optional().describe(
|
|
1388
|
+
"Optional nickname to describe the device, settable through Seam"
|
|
1389
|
+
),
|
|
1390
|
+
display_name: zod.z.string().describe(
|
|
1391
|
+
"Display name of the device, defaults to nickname (if it is set) or properties.appearance.name otherwise. Enables administrators and users to identify the device easily, especially when there are numerous devices."
|
|
1392
|
+
),
|
|
1393
|
+
capabilities_supported: zod.z.array(capabilities).describe(
|
|
1394
|
+
'Collection of capabilities that the device supports when connected to Seam. Values are "access_code," which indicates that the device can manage and utilize digital PIN codes for secure access; "lock," which indicates that the device controls a door locking mechanism, enabling the remote opening and closing of doors and other entry points; "noise_detection," which indicates that the device supports monitoring and responding to ambient noise levels; "thermostat," which indicates that the device can regulate and adjust indoor temperatures; and "battery," which indicates that the device can manage battery life and health.'
|
|
1395
|
+
),
|
|
1396
|
+
properties: common_device_properties.and(phone_specific_properties.partial()).and(device_metadata).and(capability_properties).describe("Properties of the device."),
|
|
1397
|
+
location: zod.z.object({
|
|
1398
|
+
location_name: zod.z.string().optional().describe("Name of the device location."),
|
|
1399
|
+
timezone: zod.z.string().optional().describe("Time zone of the device location.")
|
|
1400
|
+
}).nullable().describe("Location information for the device."),
|
|
1401
|
+
connected_account_id: zod.z.string().uuid().describe(
|
|
1402
|
+
"Unique identifier for the account associated with the device."
|
|
1403
|
+
),
|
|
1404
|
+
workspace_id: zod.z.string().uuid().describe(
|
|
1405
|
+
"Unique identifier for the Seam workspace associated with the device."
|
|
1406
|
+
),
|
|
1407
|
+
errors: zod.z.array(
|
|
1408
|
+
zod.z.object({
|
|
1409
|
+
error_code: zod.z.string(),
|
|
1410
|
+
message: zod.z.string()
|
|
1411
|
+
})
|
|
1412
|
+
).describe(
|
|
1413
|
+
'Array of errors associated with the device. Each error object within the array contains two fields: "error_code" and "message." "error_code" is a string that uniquely identifies the type of error, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the error, offering insights into the issue and potentially how to rectify it.'
|
|
1414
|
+
),
|
|
1415
|
+
warnings: zod.z.array(
|
|
1416
|
+
zod.z.object({
|
|
1417
|
+
warning_code: zod.z.string(),
|
|
1418
|
+
message: zod.z.string()
|
|
1419
|
+
})
|
|
1420
|
+
).describe(
|
|
1421
|
+
'Array of warnings associated with the device. Each warning object within the array contains two fields: "warning_code" and "message." "warning_code" is a string that uniquely identifies the type of warning, enabling quick recognition and categorization of the issue. "message" provides a more detailed description of the warning, offering insights into the issue and potentially how to rectify it.'
|
|
1422
|
+
),
|
|
1423
|
+
created_at: zod.z.string().datetime().describe("Date and time at which the device object was created."),
|
|
1424
|
+
is_managed: zod.z.literal(true).describe("Indicates whether Seam manages the device."),
|
|
1425
|
+
custom_metadata
|
|
1426
|
+
}).merge(device_capability_flags2);
|
|
1427
|
+
var unmanaged_device = device.pick({
|
|
1428
|
+
device_id: true,
|
|
1429
|
+
device_type: true,
|
|
1430
|
+
connected_account_id: true,
|
|
1431
|
+
capabilities_supported: true,
|
|
1432
|
+
workspace_id: true,
|
|
1433
|
+
errors: true,
|
|
1434
|
+
warnings: true,
|
|
1435
|
+
created_at: true
|
|
1436
|
+
}).extend({
|
|
1437
|
+
is_managed: zod.z.literal(false),
|
|
1438
|
+
properties: common_device_properties.pick({
|
|
1439
|
+
accessory_keypad: true,
|
|
1440
|
+
name: true,
|
|
1441
|
+
online: true,
|
|
1442
|
+
manufacturer: true,
|
|
1443
|
+
image_url: true,
|
|
1444
|
+
image_alt_text: true,
|
|
1445
|
+
battery_level: true,
|
|
1446
|
+
battery: true,
|
|
1447
|
+
online_access_codes_enabled: true,
|
|
1448
|
+
offline_access_codes_enabled: true,
|
|
1449
|
+
model: true
|
|
1450
|
+
})
|
|
1451
|
+
}).merge(device_capability_flags2);
|
|
609
1452
|
var common_event = zod.z.object({
|
|
610
1453
|
workspace_id: zod.z.string().uuid().describe(`
|
|
611
1454
|
---
|