UNPKG

3.54 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.HAPMimeTypes = exports.PairingStates = exports.PairMethods = exports.TLVValues = void 0;
4exports.consideredTrue = consideredTrue;
5/**
6 * @group Utils
7 */
8function consideredTrue(input) {
9 if (!input) {
10 return false;
11 }
12 return input === "true" || input === "1";
13}
14/**
15 * @group HAP Accessory Server
16 */
17var TLVValues;
18(function (TLVValues) {
19 // noinspection JSUnusedGlobalSymbols
20 TLVValues[TLVValues["REQUEST_TYPE"] = 0] = "REQUEST_TYPE";
21 // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
22 TLVValues[TLVValues["METHOD"] = 0] = "METHOD";
23 TLVValues[TLVValues["USERNAME"] = 1] = "USERNAME";
24 // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
25 TLVValues[TLVValues["IDENTIFIER"] = 1] = "IDENTIFIER";
26 TLVValues[TLVValues["SALT"] = 2] = "SALT";
27 TLVValues[TLVValues["PUBLIC_KEY"] = 3] = "PUBLIC_KEY";
28 TLVValues[TLVValues["PASSWORD_PROOF"] = 4] = "PASSWORD_PROOF";
29 TLVValues[TLVValues["ENCRYPTED_DATA"] = 5] = "ENCRYPTED_DATA";
30 TLVValues[TLVValues["SEQUENCE_NUM"] = 6] = "SEQUENCE_NUM";
31 // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
32 TLVValues[TLVValues["STATE"] = 6] = "STATE";
33 TLVValues[TLVValues["ERROR_CODE"] = 7] = "ERROR_CODE";
34 TLVValues[TLVValues["RETRY_DELAY"] = 8] = "RETRY_DELAY";
35 TLVValues[TLVValues["CERTIFICATE"] = 9] = "CERTIFICATE";
36 TLVValues[TLVValues["PROOF"] = 10] = "PROOF";
37 // eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
38 TLVValues[TLVValues["SIGNATURE"] = 10] = "SIGNATURE";
39 TLVValues[TLVValues["PERMISSIONS"] = 11] = "PERMISSIONS";
40 TLVValues[TLVValues["FRAGMENT_DATA"] = 12] = "FRAGMENT_DATA";
41 TLVValues[TLVValues["FRAGMENT_LAST"] = 13] = "FRAGMENT_LAST";
42 TLVValues[TLVValues["SEPARATOR"] = 255] = "SEPARATOR"; // Zero-length TLV that separates different TLVs in a list.
43})(TLVValues || (exports.TLVValues = TLVValues = {}));
44/**
45 * @group HAP Accessory Server
46 */
47var PairMethods;
48(function (PairMethods) {
49 // noinspection JSUnusedGlobalSymbols
50 PairMethods[PairMethods["PAIR_SETUP"] = 0] = "PAIR_SETUP";
51 PairMethods[PairMethods["PAIR_SETUP_WITH_AUTH"] = 1] = "PAIR_SETUP_WITH_AUTH";
52 PairMethods[PairMethods["PAIR_VERIFY"] = 2] = "PAIR_VERIFY";
53 PairMethods[PairMethods["ADD_PAIRING"] = 3] = "ADD_PAIRING";
54 PairMethods[PairMethods["REMOVE_PAIRING"] = 4] = "REMOVE_PAIRING";
55 PairMethods[PairMethods["LIST_PAIRINGS"] = 5] = "LIST_PAIRINGS";
56})(PairMethods || (exports.PairMethods = PairMethods = {}));
57/**
58 * Pairing states (pair-setup or pair-verify). Encoded in {@link TLVValues.SEQUENCE_NUM}.
59 *
60 * @group HAP Accessory Server
61 */
62var PairingStates;
63(function (PairingStates) {
64 PairingStates[PairingStates["M1"] = 1] = "M1";
65 PairingStates[PairingStates["M2"] = 2] = "M2";
66 PairingStates[PairingStates["M3"] = 3] = "M3";
67 PairingStates[PairingStates["M4"] = 4] = "M4";
68 PairingStates[PairingStates["M5"] = 5] = "M5";
69 PairingStates[PairingStates["M6"] = 6] = "M6";
70})(PairingStates || (exports.PairingStates = PairingStates = {}));
71/**
72 * @group HAP Accessory Server
73 */
74var HAPMimeTypes;
75(function (HAPMimeTypes) {
76 HAPMimeTypes["PAIRING_TLV8"] = "application/pairing+tlv8";
77 HAPMimeTypes["HAP_JSON"] = "application/hap+json";
78 HAPMimeTypes["IMAGE_JPEG"] = "image/jpeg";
79})(HAPMimeTypes || (exports.HAPMimeTypes = HAPMimeTypes = {}));
80//# sourceMappingURL=internal-types.js.map
\No newline at end of file