@project-chip/matter.js 0.0.2 → 0.2.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.
Files changed (136) hide show
  1. package/README.md +14 -0
  2. package/dist/cjs/cluster/AccessControlCluster.js +105 -0
  3. package/dist/cjs/cluster/BasicInformationCluster.js +92 -0
  4. package/dist/cjs/cluster/BindingCluster.js +51 -0
  5. package/dist/cjs/cluster/BridgedDeviceBasicInformationCluster.js +75 -0
  6. package/dist/cjs/cluster/Cluster.js +49 -0
  7. package/dist/cjs/cluster/DescriptorCluster.js +53 -0
  8. package/dist/cjs/cluster/GeneralCommissioningCluster.js +89 -0
  9. package/dist/cjs/cluster/GroupsCluster.js +140 -0
  10. package/dist/cjs/cluster/IdentifyCluster.js +55 -0
  11. package/dist/cjs/cluster/LabelCluster.js +55 -0
  12. package/dist/cjs/cluster/OnOffCluster.js +105 -0
  13. package/dist/cjs/cluster/OperationalCredentialsCluster.js +205 -0
  14. package/dist/cjs/cluster/ScenesCluster.js +236 -0
  15. package/dist/cjs/common/AttributeId.js +23 -0
  16. package/dist/cjs/common/ClusterId.js +24 -0
  17. package/dist/cjs/common/DeviceTypeId.js +23 -0
  18. package/dist/cjs/common/EndpointNumber.js +23 -0
  19. package/dist/cjs/common/FabricId.js +24 -0
  20. package/dist/cjs/common/FabricIndex.js +28 -0
  21. package/dist/cjs/common/GroupId.js +30 -0
  22. package/dist/cjs/common/NodeId.js +31 -0
  23. package/dist/cjs/common/SubjectId.js +11 -0
  24. package/dist/cjs/common/VendorId.js +25 -0
  25. package/{dist-cjs → dist/cjs}/matter.js +12 -0
  26. package/dist/cjs/protocol/InteractionProtocol.js +136 -0
  27. package/dist/cjs/schema/BitmapSchema.js +133 -0
  28. package/{dist-cjs → dist/cjs}/tlv/TlvObject.js +6 -2
  29. package/{dist-cjs → dist/cjs}/util/ByteArray.js +2 -0
  30. package/{dist-cjs → dist/cjs}/util/Type.js +3 -0
  31. package/dist/dts/cluster/AccessControlCluster.d.ts +108 -0
  32. package/dist/dts/cluster/BasicInformationCluster.d.ts +57 -0
  33. package/dist/dts/cluster/BindingCluster.d.ts +23 -0
  34. package/dist/dts/cluster/BridgedDeviceBasicInformationCluster.d.ts +53 -0
  35. package/dist/dts/cluster/Cluster.d.ts +109 -0
  36. package/dist/dts/cluster/DescriptorCluster.d.ts +25 -0
  37. package/dist/dts/cluster/GeneralCommissioningCluster.d.ts +94 -0
  38. package/dist/dts/cluster/GroupsCluster.d.ts +92 -0
  39. package/dist/dts/cluster/IdentifyCluster.d.ts +60 -0
  40. package/dist/dts/cluster/LabelCluster.d.ts +34 -0
  41. package/dist/dts/cluster/OnOffCluster.d.ts +85 -0
  42. package/dist/dts/cluster/OperationalCredentialsCluster.d.ts +156 -0
  43. package/dist/dts/cluster/ScenesCluster.d.ts +200 -0
  44. package/dist/dts/common/AttributeId.d.ts +17 -0
  45. package/dist/dts/common/ClusterId.d.ts +18 -0
  46. package/dist/dts/common/DeviceTypeId.d.ts +17 -0
  47. package/dist/dts/common/EndpointNumber.d.ts +17 -0
  48. package/dist/dts/common/FabricId.d.ts +18 -0
  49. package/dist/dts/common/FabricIndex.d.ts +22 -0
  50. package/dist/dts/common/GroupId.d.ts +24 -0
  51. package/dist/dts/common/NodeId.d.ts +19 -0
  52. package/dist/dts/common/SubjectId.d.ts +15 -0
  53. package/dist/dts/common/VendorId.d.ts +19 -0
  54. package/dist/{matter.d.ts → dts/matter.d.ts} +12 -0
  55. package/dist/dts/protocol/InteractionProtocol.d.ts +159 -0
  56. package/dist/{schema → dts/schema}/BitmapSchema.d.ts +15 -3
  57. package/dist/{util → dts/util}/Type.d.ts +1 -0
  58. package/dist/es/cluster/AccessControlCluster.js +102 -0
  59. package/dist/es/cluster/BasicInformationCluster.js +89 -0
  60. package/dist/es/cluster/BindingCluster.js +48 -0
  61. package/dist/es/cluster/BridgedDeviceBasicInformationCluster.js +72 -0
  62. package/dist/es/cluster/Cluster.js +36 -0
  63. package/dist/es/cluster/DescriptorCluster.js +50 -0
  64. package/dist/es/cluster/GeneralCommissioningCluster.js +86 -0
  65. package/dist/es/cluster/GroupsCluster.js +137 -0
  66. package/dist/es/cluster/IdentifyCluster.js +52 -0
  67. package/dist/es/cluster/LabelCluster.js +52 -0
  68. package/dist/es/cluster/OnOffCluster.js +102 -0
  69. package/dist/es/cluster/OperationalCredentialsCluster.js +202 -0
  70. package/dist/es/cluster/ScenesCluster.js +233 -0
  71. package/dist/es/common/AttributeId.js +19 -0
  72. package/dist/es/common/ClusterId.js +20 -0
  73. package/dist/es/common/DeviceTypeId.js +19 -0
  74. package/dist/es/common/EndpointNumber.js +19 -0
  75. package/dist/es/common/FabricId.js +20 -0
  76. package/dist/es/common/FabricIndex.js +24 -0
  77. package/dist/es/common/GroupId.js +26 -0
  78. package/dist/es/common/NodeId.js +27 -0
  79. package/dist/es/common/SubjectId.js +8 -0
  80. package/dist/es/common/VendorId.js +21 -0
  81. package/dist/{matter.js → es/matter.js} +12 -0
  82. package/dist/es/protocol/InteractionProtocol.js +133 -0
  83. package/dist/es/schema/BitmapSchema.js +125 -0
  84. package/dist/{tlv → es/tlv}/TlvObject.js +6 -2
  85. package/dist/{util → es/util}/ByteArray.js +2 -0
  86. package/dist/{util → es/util}/Type.js +1 -1
  87. package/package.json +7 -8
  88. package/dist/schema/BitmapSchema.js +0 -48
  89. package/dist-cjs/schema/BitmapSchema.js +0 -55
  90. /package/{dist-cjs → dist/cjs}/schema/Schema.js +0 -0
  91. /package/{dist-cjs → dist/cjs}/spec/Specifications.js +0 -0
  92. /package/{dist-cjs → dist/cjs}/tlv/TlvAny.js +0 -0
  93. /package/{dist-cjs → dist/cjs}/tlv/TlvArray.js +0 -0
  94. /package/{dist-cjs → dist/cjs}/tlv/TlvBoolean.js +0 -0
  95. /package/{dist-cjs → dist/cjs}/tlv/TlvCodec.js +0 -0
  96. /package/{dist-cjs → dist/cjs}/tlv/TlvNullable.js +0 -0
  97. /package/{dist-cjs → dist/cjs}/tlv/TlvNumber.js +0 -0
  98. /package/{dist-cjs → dist/cjs}/tlv/TlvSchema.js +0 -0
  99. /package/{dist-cjs → dist/cjs}/tlv/TlvString.js +0 -0
  100. /package/{dist-cjs → dist/cjs}/tlv/TlvVoid.js +0 -0
  101. /package/{dist-cjs → dist/cjs}/tlv/TlvWrapper.js +0 -0
  102. /package/{dist-cjs → dist/cjs}/util/DataReader.js +0 -0
  103. /package/{dist-cjs → dist/cjs}/util/DataWriter.js +0 -0
  104. /package/{dist-cjs → dist/cjs}/util/Number.js +0 -0
  105. /package/dist/{schema → dts/schema}/Schema.d.ts +0 -0
  106. /package/dist/{spec → dts/spec}/Specifications.d.ts +0 -0
  107. /package/dist/{tlv → dts/tlv}/TlvAny.d.ts +0 -0
  108. /package/dist/{tlv → dts/tlv}/TlvArray.d.ts +0 -0
  109. /package/dist/{tlv → dts/tlv}/TlvBoolean.d.ts +0 -0
  110. /package/dist/{tlv → dts/tlv}/TlvCodec.d.ts +0 -0
  111. /package/dist/{tlv → dts/tlv}/TlvNullable.d.ts +0 -0
  112. /package/dist/{tlv → dts/tlv}/TlvNumber.d.ts +0 -0
  113. /package/dist/{tlv → dts/tlv}/TlvObject.d.ts +0 -0
  114. /package/dist/{tlv → dts/tlv}/TlvSchema.d.ts +0 -0
  115. /package/dist/{tlv → dts/tlv}/TlvString.d.ts +0 -0
  116. /package/dist/{tlv → dts/tlv}/TlvVoid.d.ts +0 -0
  117. /package/dist/{tlv → dts/tlv}/TlvWrapper.d.ts +0 -0
  118. /package/dist/{util → dts/util}/ByteArray.d.ts +0 -0
  119. /package/dist/{util → dts/util}/DataReader.d.ts +0 -0
  120. /package/dist/{util → dts/util}/DataWriter.d.ts +0 -0
  121. /package/dist/{util → dts/util}/Number.d.ts +0 -0
  122. /package/dist/{schema → es/schema}/Schema.js +0 -0
  123. /package/dist/{spec → es/spec}/Specifications.js +0 -0
  124. /package/dist/{tlv → es/tlv}/TlvAny.js +0 -0
  125. /package/dist/{tlv → es/tlv}/TlvArray.js +0 -0
  126. /package/dist/{tlv → es/tlv}/TlvBoolean.js +0 -0
  127. /package/dist/{tlv → es/tlv}/TlvCodec.js +0 -0
  128. /package/dist/{tlv → es/tlv}/TlvNullable.js +0 -0
  129. /package/dist/{tlv → es/tlv}/TlvNumber.js +0 -0
  130. /package/dist/{tlv → es/tlv}/TlvSchema.js +0 -0
  131. /package/dist/{tlv → es/tlv}/TlvString.js +0 -0
  132. /package/dist/{tlv → es/tlv}/TlvVoid.js +0 -0
  133. /package/dist/{tlv → es/tlv}/TlvWrapper.js +0 -0
  134. /package/dist/{util → es/util}/DataReader.js +0 -0
  135. /package/dist/{util → es/util}/DataWriter.js +0 -0
  136. /package/dist/{util → es/util}/Number.js +0 -0
@@ -0,0 +1,140 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright 2022 Project CHIP Authors
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.GroupsCluster = void 0;
9
+ const Cluster_js_1 = require("./Cluster.js");
10
+ const GroupId_js_1 = require("../common/GroupId.js");
11
+ const TlvObject_js_1 = require("../tlv/TlvObject.js");
12
+ const TlvString_js_1 = require("../tlv/TlvString.js");
13
+ const TlvNumber_js_1 = require("../tlv/TlvNumber.js");
14
+ const TlvArray_js_1 = require("../tlv/TlvArray.js");
15
+ const TlvNullable_js_1 = require("../tlv/TlvNullable.js");
16
+ const BitmapSchema_js_1 = require("../schema/BitmapSchema.js");
17
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.1 */
18
+ const TlvAddGroupRequest = (0, TlvObject_js_1.TlvObject)({
19
+ groupId: (0, TlvObject_js_1.TlvField)(0, GroupId_js_1.TlvGroupId),
20
+ groupName: (0, TlvObject_js_1.TlvField)(1, TlvString_js_1.TlvString.bound({ maxLength: 16 })),
21
+ });
22
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.7 */
23
+ const TlvAddGroupResponse = (0, TlvObject_js_1.TlvObject)({
24
+ status: (0, TlvObject_js_1.TlvField)(0, (0, TlvNumber_js_1.TlvEnum)()),
25
+ groupId: (0, TlvObject_js_1.TlvField)(1, GroupId_js_1.TlvGroupId), /* type: min: 1 */
26
+ });
27
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.2 */
28
+ const TlvViewGroupRequest = (0, TlvObject_js_1.TlvObject)({
29
+ groupId: (0, TlvObject_js_1.TlvField)(0, GroupId_js_1.TlvGroupId), /* type: min: 1 */
30
+ });
31
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.8 */
32
+ const TlvViewGroupResponse = (0, TlvObject_js_1.TlvObject)({
33
+ status: (0, TlvObject_js_1.TlvField)(0, (0, TlvNumber_js_1.TlvEnum)()),
34
+ groupId: (0, TlvObject_js_1.TlvField)(1, GroupId_js_1.TlvGroupId),
35
+ groupName: (0, TlvObject_js_1.TlvField)(2, TlvString_js_1.TlvString.bound({ maxLength: 16 })),
36
+ });
37
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.3 */
38
+ const TlvGetGroupMembershipRequest = (0, TlvObject_js_1.TlvObject)({
39
+ groupList: (0, TlvObject_js_1.TlvField)(0, (0, TlvArray_js_1.TlvArray)(GroupId_js_1.TlvGroupId)), /* groupId min: 1 */
40
+ });
41
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.9 */
42
+ const TlvGetGroupMembershipResponse = (0, TlvObject_js_1.TlvObject)({
43
+ /** contain the remaining capacity of the Group Table of the node. */
44
+ capacity: (0, TlvObject_js_1.TlvField)(0, (0, TlvNullable_js_1.TlvNullable)(TlvNumber_js_1.TlvUInt8)),
45
+ groupList: (0, TlvObject_js_1.TlvField)(1, (0, TlvArray_js_1.TlvArray)(GroupId_js_1.TlvGroupId)), /* groupId min: 1 */
46
+ });
47
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.4 */
48
+ const TlvRemoveGroupRequest = (0, TlvObject_js_1.TlvObject)({
49
+ groupId: (0, TlvObject_js_1.TlvField)(0, GroupId_js_1.TlvGroupId), /* min: 1 */
50
+ });
51
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.10 */
52
+ const TlvRemoveGroupResponse = (0, TlvObject_js_1.TlvObject)({
53
+ status: (0, TlvObject_js_1.TlvField)(0, (0, TlvNumber_js_1.TlvEnum)()),
54
+ groupId: (0, TlvObject_js_1.TlvField)(1, GroupId_js_1.TlvGroupId), /* min: 1 */
55
+ });
56
+ /**
57
+ * Formally not defined in specs state:
58
+ * If the RemoveAllGroups command was received as unicast and a response is not
59
+ * suppressed, the server SHALL generate a response with the Status field set to SUCCESS.
60
+ *
61
+ * @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.5.1
62
+ */
63
+ const TlvRemoveAllGroupResponse = (0, TlvObject_js_1.TlvObject)({
64
+ status: (0, TlvObject_js_1.TlvField)(0, (0, TlvNumber_js_1.TlvEnum)()),
65
+ });
66
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7.6 */
67
+ const TlvAddGroupIfIdentifyingRequest = (0, TlvObject_js_1.TlvObject)({
68
+ groupId: (0, TlvObject_js_1.TlvField)(0, GroupId_js_1.TlvGroupId),
69
+ groupName: (0, TlvObject_js_1.TlvField)(1, TlvString_js_1.TlvString.bound({ maxLength: 16 })),
70
+ });
71
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.6.1 */
72
+ const TlvNameSupportBitmap = (0, TlvNumber_js_1.TlvBitmap)(TlvNumber_js_1.TlvUInt8, {
73
+ groupNames: (0, BitmapSchema_js_1.BitFlag)(7),
74
+ });
75
+ /**
76
+ * The Groups cluster manages, per endpoint, the content of the node-wide Group
77
+ * Table that is part of the underlying interaction layer.
78
+ *
79
+ * @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3
80
+ */
81
+ exports.GroupsCluster = (0, Cluster_js_1.Cluster)({
82
+ id: 0x04,
83
+ name: "Groups",
84
+ revision: 4,
85
+ features: {
86
+ /** The ability to store a name for a group. */
87
+ groupNames: (0, BitmapSchema_js_1.BitFlag)(0),
88
+ },
89
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.6 */
90
+ attributes: {
91
+ /**
92
+ * This attribute provides legacy, read-only access to whether the Group
93
+ * Names feature is supported. The most significant bit, bit 7, SHALL be
94
+ * equal to bit 0 of the FeatureMap attribute. All other bits SHALL be 0.
95
+ *
96
+ * TODO because we (will) support group names we need to set bit 7 to 1, rest is 0
97
+ */
98
+ nameSupport: (0, Cluster_js_1.Attribute)(0, TlvNameSupportBitmap, { default: { groupNames: true } }),
99
+ },
100
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.3.7 */
101
+ commands: {
102
+ /**
103
+ * The AddGroup command allows a client to add group membership in a particular group for the server endpoint.
104
+ */
105
+ addGroup: (0, Cluster_js_1.Command)(0, TlvAddGroupRequest, 0, TlvAddGroupResponse),
106
+ /**
107
+ * The ViewGroup command allows a client to request that the server responds with a ViewGroupResponse command
108
+ * containing the name string for a particular group.
109
+ *
110
+ */
111
+ viewGroup: (0, Cluster_js_1.Command)(1, TlvViewGroupRequest, 0, TlvViewGroupResponse),
112
+ /**
113
+ * The GetGroupMembership command allows a client to inquire about the group membership of the server endpoint,
114
+ * in a number of ways.
115
+ */
116
+ getGroupMembership: (0, Cluster_js_1.Command)(2, TlvGetGroupMembershipRequest, 2, TlvGetGroupMembershipResponse),
117
+ /**
118
+ * The RemoveGroup command allows a client to request that the server removes the membership for the server
119
+ * endpoint, if any, in a particular group.
120
+ */
121
+ removeGroup: (0, Cluster_js_1.Command)(3, TlvRemoveGroupRequest, 3, TlvRemoveGroupResponse),
122
+ /**
123
+ * The RemoveAllGroups command allows a client to direct the server to remove all group associations for the
124
+ * server endpoint.
125
+ *
126
+ * TODO: According to specs the response might be suppressed:
127
+ * If the RemoveAllGroups command was received as unicast and a response is not suppressed, the server
128
+ * SHALL generate a response with the Status field set to SUCCESS.
129
+ * Else potentially no response?
130
+ *
131
+ */
132
+ removeAllGroups: (0, Cluster_js_1.Command)(4, Cluster_js_1.TlvNoArguments, 4, TlvRemoveAllGroupResponse),
133
+ /**
134
+ * The AddGroupIfIdentifying command allows a client to add group membership in a particular group for the
135
+ * server endpoint, on condition that the endpoint is identifying itself.
136
+ *
137
+ */
138
+ addGroupIfIdentifying: (0, Cluster_js_1.Command)(5, TlvAddGroupIfIdentifyingRequest, 5, Cluster_js_1.TlvNoResponse),
139
+ }
140
+ });
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright 2022 Project CHIP Authors
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.IdentifyCluster = void 0;
9
+ const Cluster_js_1 = require("./Cluster.js");
10
+ const TlvObject_js_1 = require("../tlv/TlvObject.js");
11
+ const TlvNumber_js_1 = require("../tlv/TlvNumber.js");
12
+ const BitmapSchema_js_1 = require("../schema/BitmapSchema.js");
13
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2.6.1 */
14
+ const TlvIdentifyRequest = (0, TlvObject_js_1.TlvObject)({
15
+ identifyTime: (0, TlvObject_js_1.TlvField)(0, TlvNumber_js_1.TlvUInt16),
16
+ });
17
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2.6.3 */
18
+ const TlvTriggerEffectRequest = (0, TlvObject_js_1.TlvObject)({
19
+ effectIdentifier: (0, TlvObject_js_1.TlvField)(0, (0, TlvNumber_js_1.TlvEnum)()),
20
+ effectVariant: (0, TlvObject_js_1.TlvField)(1, (0, TlvNumber_js_1.TlvEnum)()),
21
+ });
22
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2.6.4 */
23
+ const TlvIdentifyQueryResponse = (0, TlvObject_js_1.TlvObject)({
24
+ timeout: (0, TlvObject_js_1.TlvField)(0, TlvNumber_js_1.TlvUInt16),
25
+ });
26
+ /**
27
+ * Attributes and commands for putting a device into Identification mode (e.g. flashing a light).
28
+ *
29
+ * @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2
30
+ */
31
+ exports.IdentifyCluster = (0, Cluster_js_1.Cluster)({
32
+ id: 0x03,
33
+ name: "Identify",
34
+ revision: 4,
35
+ features: {
36
+ /** Replies to multicast / groupcast queries if the identification state is active. */
37
+ query: (0, BitmapSchema_js_1.BitFlag)(0),
38
+ },
39
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2.5 */
40
+ attributes: {
41
+ /** Specifies the remaining length of time, in seconds, that the endpoint will continue to identify itself. */
42
+ identifyTime: (0, Cluster_js_1.WritableAttribute)(0, TlvNumber_js_1.TlvUInt16, { default: 0 }),
43
+ /** Specifies how the identification state is presented to the user. */
44
+ identifyType: (0, Cluster_js_1.Attribute)(1, (0, TlvNumber_js_1.TlvEnum)(), { default: 0 }),
45
+ },
46
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.2.6 */
47
+ commands: {
48
+ /** Starts or stops the receiving device identifying itself. */
49
+ identify: (0, Cluster_js_1.Command)(0, TlvIdentifyRequest, 0, Cluster_js_1.TlvNoResponse),
50
+ /** Request the target or targets to respond if they are currently identifying themselves. */
51
+ identifyQuery: (0, Cluster_js_1.Command)(1, Cluster_js_1.TlvNoArguments, 0, TlvIdentifyQueryResponse),
52
+ /** Allows the support of feedback to the user, such as a certain light effect when identifying. */
53
+ triggerEffect: (0, Cluster_js_1.OptionalCommand)(0x40, TlvTriggerEffectRequest, 0, Cluster_js_1.TlvNoResponse),
54
+ },
55
+ });
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright 2022 Project CHIP Authors
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.FixedLabelCluster = exports.UserLabelCluster = void 0;
9
+ const Cluster_js_1 = require("./Cluster.js");
10
+ const TlvObject_js_1 = require("../tlv/TlvObject.js");
11
+ const TlvString_js_1 = require("../tlv/TlvString.js");
12
+ const TlvArray_js_1 = require("../tlv/TlvArray.js");
13
+ /**
14
+ * This is a string tuple with strings that are user defined.
15
+ *
16
+ * @see {@link MatterCoreSpecificationV1_0} § 9.7.5.1
17
+ */
18
+ const TlvLabel = (0, TlvObject_js_1.TlvObject)({
19
+ /** Contains a string as label without a further defined semantic n this base cluster. */
20
+ label: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvString.bound({ length: 16 })),
21
+ /** Contains a string as value without a further defined semantic n this base cluster. */
22
+ value: (0, TlvObject_js_1.TlvField)(1, TlvString_js_1.TlvString.bound({ length: 16 })), /* default: "" */
23
+ });
24
+ /**
25
+ * This cluster provides a feature to tag an endpoint with zero or more labels.
26
+ * Derived from LabelCluster ({@link MatterCoreSpecificationV1_0} § 9.7)
27
+ *
28
+ * @see {@link MatterCoreSpecificationV1_0} § 9.9
29
+ */
30
+ exports.UserLabelCluster = (0, Cluster_js_1.Cluster)({
31
+ id: 0x41,
32
+ name: "User Label",
33
+ revision: 1,
34
+ /** @see {@link MatterCoreSpecificationV1_0} § 9.9.4 */
35
+ attributes: {
36
+ /** An implementation SHALL support at least 4 list entries per node for all User Label cluster instances on the node. */
37
+ labelList: (0, Cluster_js_1.WritableAttribute)(0, (0, TlvArray_js_1.TlvArray)(TlvLabel), { default: [], writeAcl: 1 /* AccessLevel.Manage */ }), /* non-volatile */
38
+ },
39
+ });
40
+ /**
41
+ * This cluster provides a feature for the device to tag an endpoint with zero or more read only labels.
42
+ * Derived from LabelCluster ({@link MatterCoreSpecificationV1_0} § 9.7)
43
+ *
44
+ * @see {@link MatterCoreSpecificationV1_0} § 9.8
45
+ */
46
+ exports.FixedLabelCluster = (0, Cluster_js_1.Cluster)({
47
+ id: 0x40,
48
+ name: "Fixed Label",
49
+ revision: 1,
50
+ /** @see {@link MatterCoreSpecificationV1_0} § 9.8.4 */
51
+ attributes: {
52
+ /** List of fixed labels. */
53
+ labelList: (0, Cluster_js_1.Attribute)(0, (0, TlvArray_js_1.TlvArray)(TlvLabel), { default: [] }), /* non-volatile */
54
+ },
55
+ });
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright 2022 Project CHIP Authors
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.OnOffCluster = void 0;
9
+ const Cluster_js_1 = require("./Cluster.js");
10
+ const BitmapSchema_js_1 = require("../schema/BitmapSchema.js");
11
+ const TlvBoolean_js_1 = require("../tlv/TlvBoolean.js");
12
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.4.2 */
13
+ // const TlvEffectVariant = TlvUInt8 as TlvSchema<DyingLightEffectVariant | DelayedAllOffEffectVariant>;
14
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.4 */
15
+ /* const TlvOffWithEffectRequest = TlvObject({
16
+ effectIdentifier: TlvField(0, TlvEnum<OnOffEffectIdentifier>()),
17
+ effectVariant: TlvField(1, TlvEffectVariant),
18
+ }) as TlvSchema<
19
+ { effectIdentifier: OnOffEffectIdentifier.DelayedAllOff, effectVariant: DelayedAllOffEffectVariant } |
20
+ { effectIdentifier: OnOffEffectIdentifier.DyingLight, effectVariant: DyingLightEffectVariant }
21
+ >; */
22
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.4.2 */
23
+ /* const TlvOnOffControlBitmap = TlvBitmap(TlvUInt8, {
24
+ acceptOnlyWhenOn: BitFlag(1),
25
+ }) */
26
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7.6. */
27
+ /* const TlvOnWithTimedOffRequest = TlvObject({
28
+ onOffControl: TlvField(0, TlvOnOffControlBitmap),
29
+ onTime: TlvField(1, TlvNullable(TlvUInt8.bound({ min: 0, max: 254 }))),
30
+ offWaitTime: TlvField(2, TlvNullable(TlvUInt8.bound({ min: 0, max: 254 }))),
31
+ }); */
32
+ /**
33
+ * Attributes and commands for switching devices between 'On' and 'Off' states.
34
+ *
35
+ * @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5
36
+ */
37
+ exports.OnOffCluster = (0, Cluster_js_1.Cluster)({
38
+ id: 0x06,
39
+ name: "On/Off",
40
+ revision: 4,
41
+ features: {
42
+ /** Level Control for Lighting - Behavior that supports lighting applications */
43
+ lightingLevelControl: (0, BitmapSchema_js_1.BitFlag)(0),
44
+ },
45
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.6 */
46
+ attributes: {
47
+ /** Indicates whether the device type implemented on the endpoint is turned off (false) or turned on (true). */
48
+ onOff: (0, Cluster_js_1.Attribute)(0, TlvBoolean_js_1.TlvBoolean, { default: false }), /* reportable: true, scene:true */
49
+ // The following attributes are only needed for "Level Control for Lighting" support
50
+ /** Used to remember if a state is already storednin an old scene to not store one again when sending another Off command */
51
+ //globalSceneControl: OptionalAttribute(0x4000, TlvBoolean, { default: true }),
52
+ /**
53
+ * Specifies the length of time (in 1/10ths second) that the ‘On’ state SHALL be maintained before
54
+ * automatically transitioning to the ‘Off’ state when using the OnWithTimedOff command.
55
+ */
56
+ //onTime: OptionalWritableAttribute(0x4001, TlvNullable(TlvUInt16)), { default: 0 }), /* unit: 1/10s */
57
+ /**
58
+ * Specifies the length of time (in 1/10ths second) that the ‘Off’ state SHALL be guarded to prevent
59
+ * another OnWithTimedOff command turning the server back to its ‘On’ state
60
+ */
61
+ //offWaitTime: OptionalWritableAttribute(0x4002, TlvNullable(TlvUInt16), { default: 0 }), /* unit: 1/10s */
62
+ /** Defines the desired startup behavior of a device when it is supplied with power. */
63
+ //startUpOnOff: OptionalWritableAttribute(0x4003, TlvNullable(TlvEnum<StartUpOnOff>()), { writeAcl: AccessLevel.Manage }),
64
+ },
65
+ /** @see {@link MatterApplicationClusterSpecificationV1_0} § 1.5.7 */
66
+ commands: {
67
+ /**
68
+ * On receipt of this command, a device SHALL enter its ‘Off’ state. This state is device dependent, but it is
69
+ * recommended that it is used for power off or similar functions. On receipt of the Off command, the OnTime
70
+ * attribute SHALL be set to 0.
71
+ */
72
+ off: (0, Cluster_js_1.Command)(0, Cluster_js_1.TlvNoArguments, 0, Cluster_js_1.TlvNoResponse),
73
+ /**
74
+ * On receipt of this command, a device SHALL enter its ‘On’ state. This state is device dependent, but it is
75
+ * recommended that it is used for power on or similar functions. On receipt of the On command, if the value
76
+ * of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0.
77
+ */
78
+ on: (0, Cluster_js_1.Command)(1, Cluster_js_1.TlvNoArguments, 1, Cluster_js_1.TlvNoResponse),
79
+ /**
80
+ * On receipt of this command, if a device is in its ‘Off’ state it SHALL enter its ‘On’ state. Otherwise,
81
+ * if it is in its ‘On’ state it SHALL enter its ‘Off’ state. On receipt of the Toggle command, if the value
82
+ * of the OnOff attribute is equal to FALSE and if the value of the OnTime attribute is equal to 0, the device
83
+ * SHALL set the OffWaitTime attribute to 0. If the value of the OnOff attribute is equal to TRUE, the OnTime
84
+ * attribute SHALL be set to 0.
85
+ */
86
+ toggle: (0, Cluster_js_1.Command)(2, Cluster_js_1.TlvNoArguments, 2, Cluster_js_1.TlvNoResponse),
87
+ // The following attributes are only needed for "Level Control for Lighting" support
88
+ // So we declare them option for now!
89
+ // TODO: Split these out into a separate Cluster Spec that adds "Level Control for Lighting" support
90
+ /**
91
+ * The OffWithEffect command allows devices to be turned off using enhanced ways of fading.
92
+ */
93
+ //offWithEffect: OptionalCommand(0x40, OffWithEffectRequestT, 0x40, NoResponseT),
94
+ /**
95
+ * The OnWithRecallGlobalScene command allows the recall of the settings when the device was turned off.
96
+ */
97
+ //onWithRecallGlobalScene: OptionalCommand(0x41, NoArgumentsT, 0x41, NoResponseT),
98
+ /**
99
+ * The OnWithTimedOff command allows devices to be turned on for a specific duration with a guarded off
100
+ * duration so that SHOULD the device be subsequently switched off, further OnWithTimedOff commands, received
101
+ * during this time, are prevented from turning the devices back on.
102
+ */
103
+ //onWithTimedOff: OptionalCommand(0x42, OnWithTimedOffRequestT, 0x42, NoResponseT),
104
+ },
105
+ });
@@ -0,0 +1,205 @@
1
+ "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright 2022 Project CHIP Authors
5
+ * SPDX-License-Identifier: Apache-2.0
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.OperationalCredentialsCluster = exports.TlvCertSigningRequest = exports.TlvAttestation = exports.RESP_MAX = void 0;
9
+ const VendorId_js_1 = require("../common/VendorId.js");
10
+ const NodeId_js_1 = require("../common/NodeId.js");
11
+ const SubjectId_js_1 = require("../common/SubjectId.js");
12
+ const FabricId_js_1 = require("../common/FabricId.js");
13
+ const FabricIndex_js_1 = require("../common/FabricIndex.js");
14
+ const Cluster_js_1 = require("./Cluster.js");
15
+ const TlvObject_js_1 = require("../tlv/TlvObject.js");
16
+ const TlvString_js_1 = require("../tlv/TlvString.js");
17
+ const TlvNullable_js_1 = require("../tlv/TlvNullable.js");
18
+ const TlvBoolean_js_1 = require("../tlv/TlvBoolean.js");
19
+ const TlvNumber_js_1 = require("../tlv/TlvNumber.js");
20
+ const TlvArray_js_1 = require("../tlv/TlvArray.js");
21
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.5.1 */
22
+ exports.RESP_MAX = 900;
23
+ /**
24
+ * Encodes a Fabric Reference for a fabric within which a given Node is currently commissioned.
25
+ *
26
+ * @see {@link MatterCoreSpecificationV1_0} § 11.17.5.3
27
+ */
28
+ const TlvFabricDescriptor = (0, TlvObject_js_1.TlvObject)({
29
+ /** Contains the public key for the trusted root that scopes the fabric referenced by FabricIndex and its associated operational credential. */
30
+ rootPublicKey: (0, TlvObject_js_1.TlvField)(1, TlvString_js_1.TlvByteString.bound({ length: 65 })),
31
+ /** Contains the value of AdminVendorID provided in the AddNOC command that led to the creation of this FabricDescriptorStruct. */
32
+ vendorId: (0, TlvObject_js_1.TlvField)(2, VendorId_js_1.TlvVendorId),
33
+ /** Contains the FabricID allocated to the fabric referenced by FabricIndex. */
34
+ fabricID: (0, TlvObject_js_1.TlvField)(3, FabricId_js_1.TlvFabricId),
35
+ /** Contain the NodeID in use within the fabric referenced by FabricIndex. */
36
+ nodeID: (0, TlvObject_js_1.TlvField)(4, NodeId_js_1.TlvNodeId),
37
+ /** Contains a commissioner-set label for the fabric referenced by FabricIndex. */
38
+ label: (0, TlvObject_js_1.TlvField)(5, TlvString_js_1.TlvString.bound({ maxLength: 32 })), /* default: "" */
39
+ });
40
+ /**
41
+ * Encodes a fabric sensitive NOC chain, underpinning a commissioned Operational Identity for a given Node.
42
+ *
43
+ * @see {@link MatterCoreSpecificationV1_0} § 11.17.5.2
44
+ */
45
+ const TlvNoc = (0, TlvObject_js_1.TlvObject)({
46
+ /** Contains the NOC for the struct’s associated fabric. */
47
+ noc: (0, TlvObject_js_1.TlvField)(1, TlvString_js_1.TlvByteString.bound({ maxLength: 400 })),
48
+ /** Contain the ICAC or the struct’s associated fabric. */
49
+ icac: (0, TlvObject_js_1.TlvField)(2, (0, TlvNullable_js_1.TlvNullable)(TlvString_js_1.TlvByteString.bound({ maxLength: 400 }))), /* default(not present): null */
50
+ });
51
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.1 */
52
+ const TlvAttestationRequest = (0, TlvObject_js_1.TlvObject)({
53
+ /** Contains the attestation nonce to be used in the computation of the Attestation Information. */
54
+ attestationNonce: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvByteString.bound({ length: 32 })),
55
+ });
56
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.2 */
57
+ const TlvAttestationResponse = (0, TlvObject_js_1.TlvObject)({
58
+ /** Contains the octet string of the serialized attestation_elements_message. */
59
+ elements: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvByteString.bound({ maxLength: exports.RESP_MAX })),
60
+ /** Contain the octet string of the necessary attestation_signature. */
61
+ signature: (0, TlvObject_js_1.TlvField)(1, TlvString_js_1.TlvByteString.bound({ length: 64 })),
62
+ });
63
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.5 */
64
+ const TlvCertSigningRequestRequest = (0, TlvObject_js_1.TlvObject)({
65
+ /** Contains the CSRNonce to be used in the computation of the NOCSR information. */
66
+ certSigningRequestNonce: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvByteString.bound({ length: 32 })),
67
+ /**
68
+ * If set to true, the internal state of the CSR associated keypair SHALL be tagged as being for
69
+ * a subsequent UpdateNOC, otherwise the internal state of the CSR SHALL be tagged as being for a
70
+ * subsequent AddNOC
71
+ * */
72
+ isForUpdateNOC: (0, TlvObject_js_1.TlvOptionalField)(1, TlvBoolean_js_1.TlvBoolean), /* default: false */
73
+ });
74
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.6 */
75
+ const TlvCertSigningRequestResponse = (0, TlvObject_js_1.TlvObject)({
76
+ /** Contains the octet string of the serialized nocsr_elements_message. */
77
+ elements: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvByteString.bound({ maxLength: exports.RESP_MAX })),
78
+ /** Contain the octet string of the necessary attestation_signature. */
79
+ signature: (0, TlvObject_js_1.TlvField)(1, TlvString_js_1.TlvByteString.bound({ length: 64 })),
80
+ });
81
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.3 */
82
+ const TlvCertChainRequest = (0, TlvObject_js_1.TlvObject)({
83
+ /** Contains the type of certificate to be requested. */
84
+ type: (0, TlvObject_js_1.TlvField)(0, (0, TlvNumber_js_1.TlvEnum)()),
85
+ });
86
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.4 */
87
+ const TlvCertChainResponse = (0, TlvObject_js_1.TlvObject)({
88
+ /** Contains the octet string of the requested certificate. */
89
+ certificate: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvByteString.bound({ maxLength: 600 })),
90
+ });
91
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.8 */
92
+ const TlvAddNocRequest = (0, TlvObject_js_1.TlvObject)({
93
+ /** Contains the Node Operational Certificate (NOC) to be added. */
94
+ operationalCert: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvByteString.bound({ maxLength: 400 })),
95
+ /** Contains the Intermediate CA Certificate (ICAC). */
96
+ intermediateCaCert: (0, TlvObject_js_1.TlvOptionalField)(1, TlvString_js_1.TlvByteString.bound({ maxLength: 400 })),
97
+ /** Contains the value of the Epoch Key for the Identity Protection Key (IPK) to set for the Fabric which is to be added. */
98
+ identityProtectionKey: (0, TlvObject_js_1.TlvField)(2, TlvString_js_1.TlvByteString.bound({ length: 16 })),
99
+ /**
100
+ * Used to atomically add an Access Control Entry enabling that Subject to subsequently administer
101
+ * the Node whose operational identity is being added by this command.
102
+ */
103
+ caseAdminNode: (0, TlvObject_js_1.TlvField)(3, SubjectId_js_1.TlvSubjectId),
104
+ /** Contains the Vendor ID of the entity issuing the AddNOC command. */
105
+ adminVendorId: (0, TlvObject_js_1.TlvField)(4, VendorId_js_1.TlvVendorId),
106
+ });
107
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.9 */
108
+ const TlvUpdateNocRequest = (0, TlvObject_js_1.TlvObject)({
109
+ /** Contains the Node Operational Certificate (NOC). */
110
+ operationalCert: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvByteString.bound({ maxLength: 400 })),
111
+ /** Contains the Intermediate CA Certificate (ICAC). */
112
+ intermediateCaCert: (0, TlvObject_js_1.TlvOptionalField)(1, TlvString_js_1.TlvByteString.bound({ maxLength: 400 })),
113
+ });
114
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.13 */
115
+ const TlvAddTrustedRootCertificateRequest = (0, TlvObject_js_1.TlvObject)({
116
+ /** Contains the Trusted Root Certificate (TRC) to be added. */
117
+ certificate: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvByteString.bound({ maxLength: 400 })),
118
+ });
119
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.10 */
120
+ const TlvOperationalCertificateStatusResponse = (0, TlvObject_js_1.TlvObject)({
121
+ /** Contains a NOCStatus value representing the status of an operation involving a NOC. */
122
+ status: (0, TlvObject_js_1.TlvField)(0, (0, TlvNumber_js_1.TlvEnum)()),
123
+ /** When action was successful, contains the Fabric Index of the Fabric last added, removed or updated. */
124
+ fabricIndex: (0, TlvObject_js_1.TlvOptionalField)(1, FabricIndex_js_1.TlvFabricIndex),
125
+ /** Optionally contains debugging textual information from the cluster implementation and should be visible in logs, not User UI */
126
+ debugText: (0, TlvObject_js_1.TlvOptionalField)(2, TlvString_js_1.TlvString.bound({ maxLength: 128 })),
127
+ });
128
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.5.4 */
129
+ exports.TlvAttestation = (0, TlvObject_js_1.TlvObject)({
130
+ declaration: (0, TlvObject_js_1.TlvField)(1, TlvString_js_1.TlvByteString),
131
+ attestationNonce: (0, TlvObject_js_1.TlvField)(2, TlvString_js_1.TlvByteString.bound({ length: 32 })),
132
+ timestamp: (0, TlvObject_js_1.TlvField)(3, TlvNumber_js_1.TlvUInt32),
133
+ firmwareInfo: (0, TlvObject_js_1.TlvOptionalField)(4, TlvString_js_1.TlvByteString),
134
+ });
135
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.5.6 */
136
+ exports.TlvCertSigningRequest = (0, TlvObject_js_1.TlvObject)({
137
+ certSigningRequest: (0, TlvObject_js_1.TlvField)(1, TlvString_js_1.TlvByteString),
138
+ certSigningRequestNonce: (0, TlvObject_js_1.TlvField)(2, TlvString_js_1.TlvByteString.bound({ length: 32 })),
139
+ vendorReserved1: (0, TlvObject_js_1.TlvOptionalField)(3, TlvString_js_1.TlvByteString),
140
+ vendorReserved2: (0, TlvObject_js_1.TlvOptionalField)(4, TlvString_js_1.TlvByteString),
141
+ vendorReserved3: (0, TlvObject_js_1.TlvOptionalField)(5, TlvString_js_1.TlvByteString),
142
+ });
143
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.11 */
144
+ const TlvUpdateFabricLabelRequest = (0, TlvObject_js_1.TlvObject)({
145
+ /** Contains the label to set for the fabric associated with the current secure session. */
146
+ label: (0, TlvObject_js_1.TlvField)(0, TlvString_js_1.TlvString32max),
147
+ });
148
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7.12 */
149
+ const TlvRemoveFabricRequest = (0, TlvObject_js_1.TlvObject)({
150
+ /** Contains the Fabric Index reference associated with the Fabric which is to be removed from the device. */
151
+ fabricIndex: (0, TlvObject_js_1.TlvField)(0, FabricIndex_js_1.TlvFabricIndex),
152
+ });
153
+ /**
154
+ * This cluster is used to add or remove Operational Credentials on a Commissionee or Node, as well as manage the
155
+ * associated Fabrics.
156
+ *
157
+ * @see {@link MatterCoreSpecificationV1_0} § 11.17
158
+ */
159
+ exports.OperationalCredentialsCluster = (0, Cluster_js_1.Cluster)({
160
+ id: 0x3e,
161
+ name: "Operational Credentials",
162
+ revision: 1,
163
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.6 */
164
+ attributes: {
165
+ /** Contains all NOCs applicable to this Node. */
166
+ nocs: (0, Cluster_js_1.Attribute)(0, (0, TlvArray_js_1.TlvArray)(TlvNoc), { readAcl: 2 /* AccessLevel.Administer */ }),
167
+ /** Describes all fabrics to which this Node is commissioned. */
168
+ fabrics: (0, Cluster_js_1.Attribute)(1, (0, TlvArray_js_1.TlvArray)(TlvFabricDescriptor)),
169
+ /** Contains the number of Fabrics that are supported by the device. */
170
+ supportedFabrics: (0, Cluster_js_1.Attribute)(2, TlvNumber_js_1.TlvUInt8.bound({ min: 5, max: 254 })),
171
+ /** Contains the number of Fabrics to which the device is currently commissioned. */
172
+ commissionedFabrics: (0, Cluster_js_1.Attribute)(3, TlvNumber_js_1.TlvUInt8),
173
+ /** Contains a read-only list of Trusted Root CA Certificates installed on the Node. */
174
+ trustedRootCertificates: (0, Cluster_js_1.Attribute)(4, (0, TlvArray_js_1.TlvArray)(TlvString_js_1.TlvByteString, { maxLength: 400 })),
175
+ /** Contain accessing fabric index. */
176
+ currentFabricIndex: (0, Cluster_js_1.Attribute)(5, TlvNumber_js_1.TlvUInt8),
177
+ },
178
+ /** @see {@link MatterCoreSpecificationV1_0} § 11.17.7 */
179
+ commands: {
180
+ /** Sender is requesting attestation information from the receiver. */
181
+ requestAttestation: (0, Cluster_js_1.Command)(0, TlvAttestationRequest, 1, TlvAttestationResponse),
182
+ /** Sender is requesting a device attestation certificate from the receiver. */
183
+ requestCertChain: (0, Cluster_js_1.Command)(2, TlvCertChainRequest, 3, TlvCertChainResponse),
184
+ /** Sender is requesting a certificate signing request (CSR) from the receiver. */
185
+ requestCertSigning: (0, Cluster_js_1.Command)(4, TlvCertSigningRequestRequest, 5, TlvCertSigningRequestResponse),
186
+ /** Sender is requesting to add the new node operational certificates. */
187
+ addOperationalCert: (0, Cluster_js_1.Command)(6, TlvAddNocRequest, 8, TlvOperationalCertificateStatusResponse),
188
+ /** Sender is requesting to update the node operational certificates. */
189
+ updateOperationalCert: (0, Cluster_js_1.Command)(7, TlvUpdateNocRequest, 8, TlvOperationalCertificateStatusResponse),
190
+ /**
191
+ * This command SHALL be used by an Administrative Node to set the user-visible Label field for a given
192
+ * Fabric, as reflected by entries in the Fabrics attribute.
193
+ */
194
+ updateFabricLabel: (0, Cluster_js_1.Command)(9, TlvUpdateFabricLabelRequest, 8, TlvOperationalCertificateStatusResponse),
195
+ /**
196
+ * This command is used by Administrative Nodes to remove a given fabric index and delete all associated
197
+ * fabric-scoped data.
198
+ */
199
+ removeFabric: (0, Cluster_js_1.Command)(10, TlvRemoveFabricRequest, 8, TlvOperationalCertificateStatusResponse),
200
+ /**
201
+ * This command SHALL add a Trusted Root CA Certificate, provided as its CHIP Certificate representation.
202
+ */
203
+ addRootCert: (0, Cluster_js_1.Command)(11, TlvAddTrustedRootCertificateRequest, 11, Cluster_js_1.TlvNoResponse),
204
+ },
205
+ });