From c72231e6d92dd5751f366f473fa19f94d245dd37 Mon Sep 17 00:00:00 2001
From: Ethan Zhou <73028112+ethanzhouyc@users.noreply.github.com>
Date: Fri, 22 Nov 2024 10:43:43 -0500
Subject: [PATCH] Feature Page Phase 2 (#1482)
- Enable users to toggle device type features.
- When toggling a feature, automatically update the associated elements (attributes, commands, events) to correct conformance, and update the feature map attribute.
- Show warnings and disable feature toggle if relevant elements have conformance that is unknown or too complex to handle.
- Show detailed conformance warnings for elements if they're enabled state conflicts with conformance value.
---
docs/api.md | 570 +-
docs/zap-schema.svg | 4817 ++++++++---------
src-electron/db/db-mapping.js | 52 +-
src-electron/db/query-attribute.js | 39 +
src-electron/db/query-command.js | 48 +
src-electron/db/query-config.js | 8 +-
src-electron/db/query-device-type.js | 3 +-
src-electron/db/query-event.js | 49 +
src-electron/db/query-feature.js | 615 ++-
src-electron/db/query-loader.js | 12 +-
src-electron/db/query-session-notification.js | 160 +-
src-electron/db/query-zcl.js | 2 +
src-electron/db/zap-schema.sql | 3 +
src-electron/rest/user-data.js | 194 +-
src-electron/zcl/zcl-loader-silabs.js | 146 +-
src-shared/db-enum.js | 2 +
src-shared/rest-api.js | 5 +
src/components/ZclAttributeManager.vue | 68 +-
src/components/ZclClusterManager.vue | 16 +-
src/components/ZclCommandManager.vue | 71 +-
src/components/ZclCreateModifyEndpoint.vue | 8 +
.../ZclDeviceTypeFeatureManager.vue | 317 +-
src/components/ZclEventManager.vue | 76 +-
src/store/zap/actions.js | 78 +-
src/store/zap/mutations.js | 64 +-
src/store/zap/state.js | 17 +-
src/util/common-mixin.js | 124 +-
src/util/editable-attributes-mixin.js | 20 +
src/util/ui-options.js | 5 +-
test/feature.test.js | 354 +-
test/notification.test.js | 190 +
test/query.test.js | 57 +
zap-schema.dot | 70 +
zap-schema.svg | 4817 ++++++++---------
34 files changed, 7977 insertions(+), 5100 deletions(-)
diff --git a/docs/api.md b/docs/api.md
index 8b08d79495..ce7e140ee0 100644
--- a/docs/api.md
+++ b/docs/api.md
@@ -3642,19 +3642,229 @@ This module provides queries related to events.
## DB API: feature related queries
This module provides queries for features.
+
+* [DB API: feature related queries](#module_DB API_ feature related queries)
+ * [~getFeaturesByDeviceTypeRefs(db, deviceTypeRefs, endpointTypeRef)](#module_DB API_ feature related queries..getFeaturesByDeviceTypeRefs) ⇒
+ * [~evaluateConformanceExpression(expression, elementMap)](#module_DB API_ feature related queries..evaluateConformanceExpression) ⇒
+ * [~evaluateBooleanExpression(expr)](#module_DB API_ feature related queries..evaluateConformanceExpression..evaluateBooleanExpression)
+ * [~evaluateWithParentheses(expr)](#module_DB API_ feature related queries..evaluateConformanceExpression..evaluateWithParentheses)
+ * [~checkMissingTerms(expression, elementMap)](#module_DB API_ feature related queries..checkMissingTerms) ⇒
+ * [~filterElementsContainingDesc(elements)](#module_DB API_ feature related queries..filterElementsContainingDesc) ⇒
+ * [~filterRelatedDescElements(elements, featureCode)](#module_DB API_ feature related queries..filterRelatedDescElements) ⇒
+ * [~generateWarningMessage(featureData, endpointId, missingTerms, featureMap, descElements)](#module_DB API_ feature related queries..generateWarningMessage) ⇒
+ * [~checkElementConformance(elements, featureMap, featureData, endpointId)](#module_DB API_ feature related queries..checkElementConformance) ⇒
+ * [~filterElementsToUpdate(elements, elementMap, featureCode)](#module_DB API_ feature related queries..filterElementsToUpdate) ⇒
+ * [~getOutdatedElementWarning(featureData, elements, elementMap)](#module_DB API_ feature related queries..getOutdatedElementWarning) ⇒
+ * [~processElements(elementType)](#module_DB API_ feature related queries..getOutdatedElementWarning..processElements)
+ * [~filterRequiredElements(elements, elementMap, featureMap)](#module_DB API_ feature related queries..filterRequiredElements) ⇒
+ * [~checkIfConformanceDataExist(db)](#module_DB API_ feature related queries..checkIfConformanceDataExist) ⇒
+
-### DB API: feature related queries~getFeaturesByDeviceTypeRefs(db, deviceTypeRefs) ⇒
-Get all device type features associated with a list of device type refs
+### DB API: feature related queries~getFeaturesByDeviceTypeRefs(db, deviceTypeRefs, endpointTypeRef) ⇒
+Get all device type features associated with a list of device type refs and an endpoint.
+Join ENDPOINT_TYPE_ATTRIBUTE and ATTRIBUTE table to get featureMap attribute associated with the feature,
+so the frontend could get and set featureMap bit easier.
+Only return features with cluster on the side specified in the device type.
**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
**Returns**: All feature information and device type conformance
-with associated device type and cluster details
+with associated device type, cluster, and featureMap attribute details
| Param | Type |
| --- | --- |
| db | \*
|
| deviceTypeRefs | \*
|
+| endpointTypeRef | \*
|
+
+
+
+### DB API: feature related queries~evaluateConformanceExpression(expression, elementMap) ⇒
+Evaluate the value of a boolean conformance expression that includes terms and operators.
+A term can be an attribute, command, event, feature, or conformance abbreviation.
+Operators include AND (&), OR (|), and NOT (!).
+The '[]' indicates optional conformance if the expression inside true.
+Expression containing comma means otherwise conformance. See spec for details.
+Examples of conformance expression: 'A & (!B | C)', 'A & B, [!C]'
+
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: 'mandatory', 'optional', 'provisional', or 'notSupported'
+
+| Param | Type |
+| --- | --- |
+| expression | \*
|
+| elementMap | \*
|
+
+
+* [~evaluateConformanceExpression(expression, elementMap)](#module_DB API_ feature related queries..evaluateConformanceExpression) ⇒
+ * [~evaluateBooleanExpression(expr)](#module_DB API_ feature related queries..evaluateConformanceExpression..evaluateBooleanExpression)
+ * [~evaluateWithParentheses(expr)](#module_DB API_ feature related queries..evaluateConformanceExpression..evaluateWithParentheses)
+
+
+
+#### evaluateConformanceExpression~evaluateBooleanExpression(expr)
+helper function to evaluate a single boolean expression
+
+**Kind**: inner method of [evaluateConformanceExpression
](#module_DB API_ feature related queries..evaluateConformanceExpression)
+
+| Param | Type |
+| --- | --- |
+| expr | \*
|
+
+
+
+#### evaluateConformanceExpression~evaluateWithParentheses(expr)
+helper function to process parentheses and evaluate inner expressions first
+
+**Kind**: inner method of [evaluateConformanceExpression
](#module_DB API_ feature related queries..evaluateConformanceExpression)
+
+| Param | Type |
+| --- | --- |
+| expr | \*
|
+
+
+
+### DB API: feature related queries~checkMissingTerms(expression, elementMap) ⇒
+Check if any terms in the expression are neither a key in the elementMap nor an abbreviation.
+If so, it means the conformance depends on terms with unknown values and changes are not allowed.
+
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: all missing terms in an array
+
+| Param | Type |
+| --- | --- |
+| expression | \*
|
+| elementMap | \*
|
+
+
+
+### DB API: feature related queries~filterElementsContainingDesc(elements) ⇒
+Filter an array of elements by if any element has conformance containing the term 'desc'.
+
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: elements with conformance containing 'desc'
+
+| Param | Type |
+| --- | --- |
+| elements | \*
|
+
+
+
+### DB API: feature related queries~filterRelatedDescElements(elements, featureCode) ⇒
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: elements with conformance containing 'desc' and the feature code
+
+| Param | Type |
+| --- | --- |
+| elements | \*
|
+| featureCode | \*
|
+
+
+
+### DB API: feature related queries~generateWarningMessage(featureData, endpointId, missingTerms, featureMap, descElements) ⇒
+Generate a warning message after processing conformance of the updated device type feature.
+Set flags to decide whether to show a popup warning or disable changes in the frontend.
+
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: warning message array, disableChange flag, and displayWarning flag
+
+| Param | Type |
+| --- | --- |
+| featureData | \*
|
+| endpointId | \*
|
+| missingTerms | \*
|
+| featureMap | \*
|
+| descElements | \*
|
+
+
+
+### DB API: feature related queries~checkElementConformance(elements, featureMap, featureData, endpointId) ⇒
+Check if elements need to be updated for correct conformance if featureData provided.
+Otherwise, check if elements are required or unsupported by their conformance.
+
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: attributes, commands, and events to update, with warnings if featureData provided;
+required and unsupported attributes, commands, and events, with warnings if not.
+
+| Param | Type | Default |
+| --- | --- | --- |
+| elements | \*
| |
+| featureMap | \*
| |
+| featureData | \*
|
|
+| endpointId | \*
|
|
+
+
+
+### DB API: feature related queries~filterElementsToUpdate(elements, elementMap, featureCode) ⇒
+Return attributes, commands, or events to be updated satisfying:
+(1) its conformance includes feature code of the updated feature
+(2) it has mandatory conformance but it is not enabled, OR,
+ it is has notSupported conformance but it is enabled
+
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: elements that should be updated
+
+| Param | Type |
+| --- | --- |
+| elements | \*
|
+| elementMap | \*
|
+| featureCode | \*
|
+
+
+
+### DB API: feature related queries~getOutdatedElementWarning(featureData, elements, elementMap) ⇒
+Get warnings for element requirements that are outdated after a feature update.
+
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: array of outdated element warnings
+
+| Param | Type |
+| --- | --- |
+| featureData | \*
|
+| elements | \*
|
+| elementMap | \*
|
+
+
+
+#### getOutdatedElementWarning~processElements(elementType)
+Build substrings of outdated warnings and add to returned array if:
+(1) the element conformance includes the feature code
+(2) the element conformance has changed after the feature update
+
+**Kind**: inner method of [getOutdatedElementWarning
](#module_DB API_ feature related queries..getOutdatedElementWarning)
+
+| Param | Type |
+| --- | --- |
+| elementType | \*
|
+
+
+
+### DB API: feature related queries~filterRequiredElements(elements, elementMap, featureMap) ⇒
+Filter required and unsupported elements based on their conformance and generate warnings.
+An element is required if it conforms to element(s) in elementMap and has 'mandatory' conform.
+An element is unsupported if it conforms to element(s) in elementMap and has 'notSupported' conform.
+
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: required and not supported elements with warnings
+
+| Param | Type |
+| --- | --- |
+| elements | \*
|
+| elementMap | \*
|
+| featureMap | \*
|
+
+
+
+### DB API: feature related queries~checkIfConformanceDataExist(db) ⇒
+Check if any non-empty conformance data exist in ATTRIBUTE, COMMAND,
+and DEVICE_TYPE_FEATURE table.
+
+**Kind**: inner method of [DB API: feature related queries
](#module_DB API_ feature related queries)
+**Returns**: boolean value indicating if conformance data exists
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
@@ -14372,6 +14582,9 @@ This module provides the API to access zcl specific information.
* [~httpGetSessionKeyValues(db)](#module_REST API_ user data..httpGetSessionKeyValues) ⇒
* [~httpGetEndpointIds(db)](#module_REST API_ user data..httpGetEndpointIds) ⇒
* [~httpGetDeviceTypeFeatures(db)](#module_REST API_ user data..httpGetDeviceTypeFeatures) ⇒
+ * [~getEndpointTypeElements(db, endpointTypeClusterId, deviceTypeClusterId)](#module_REST API_ user data..getEndpointTypeElements) ⇒
+ * [~httpPostCheckConformOnFeatureUpdate(db)](#module_REST API_ user data..httpPostCheckConformOnFeatureUpdate) ⇒
+ * [~httpGetRequiredElements(db)](#module_REST API_ user data..httpGetRequiredElements) ⇒
* [~httpGetSessionNotifications(db)](#module_REST API_ user data..httpGetSessionNotifications) ⇒
* [~httpDeleteSessionNotification(db)](#module_REST API_ user data..httpDeleteSessionNotification) ⇒
* [~httpGetPackageNotifications(db)](#module_REST API_ user data..httpGetPackageNotifications) ⇒
@@ -14401,6 +14614,9 @@ This module provides the API to access zcl specific information.
* [~httpDeleteSessionPackage(db)](#module_REST API_ user data..httpDeleteSessionPackage) ⇒
* [~httpPostDuplicateEndpoint(db)](#module_REST API_ user data..httpPostDuplicateEndpoint) ⇒
* [~httpPostDuplicateEndpointType(db)](#module_REST API_ user data..httpPostDuplicateEndpointType) ⇒
+ * [~httpPatchUpdateBitOfFeatureMapAttribute(db)](#module_REST API_ user data..httpPatchUpdateBitOfFeatureMapAttribute) ⇒
+ * [~httpGetConformDataExists(db)](#module_REST API_ user data..httpGetConformDataExists) ⇒
+ * [~httpPostRequiredElementWarning(db)](#module_REST API_ user data..httpPostRequiredElementWarning) ⇒
* [~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)](#module_REST API_ user data..duplicateEndpointTypeClusters)
@@ -14454,6 +14670,45 @@ HTTP GET: device type features
| --- | --- |
| db | \*
|
+
+
+### REST API: user data~getEndpointTypeElements(db, endpointTypeClusterId, deviceTypeClusterId) ⇒
+Get all attributes, commands and events in an endpoint type cluster.
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: elements object containing all attributes, commands and events
+in an endpoint type cluster
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+| endpointTypeClusterId | \*
|
+| deviceTypeClusterId | \*
|
+
+
+
+### REST API: user data~httpPostCheckConformOnFeatureUpdate(db) ⇒
+HTTP POST: elements to be updated after toggle a device type feature
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: callback for the express uri registration
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
+
+
+### REST API: user data~httpGetRequiredElements(db) ⇒
+HTTP GET: required and unsupported cluster elements based on conformance
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: callback for the express uri registration
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
### REST API: user data~httpGetSessionNotifications(db) ⇒
@@ -14800,6 +15055,42 @@ Creating a duplicate for endpoint-type and endpoint-type-attributes
| --- | --- |
| db | \*
|
+
+
+### REST API: user data~httpPatchUpdateBitOfFeatureMapAttribute(db) ⇒
+Update feature map attribute with given new value
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: status of the update
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
+
+
+### REST API: user data~httpGetConformDataExists(db) ⇒
+Check if conformance data exists in the database
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: boolean value of data exist or not
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
+
+
+### REST API: user data~httpPostRequiredElementWarning(db) ⇒
+Set warning for the required element, and delete its existing warning if any.
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: response of setting the warning notification
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
### REST API: user data~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)
@@ -15630,6 +15921,9 @@ This module provides the REST API to the user specific data.
* [~httpGetSessionKeyValues(db)](#module_REST API_ user data..httpGetSessionKeyValues) ⇒
* [~httpGetEndpointIds(db)](#module_REST API_ user data..httpGetEndpointIds) ⇒
* [~httpGetDeviceTypeFeatures(db)](#module_REST API_ user data..httpGetDeviceTypeFeatures) ⇒
+ * [~getEndpointTypeElements(db, endpointTypeClusterId, deviceTypeClusterId)](#module_REST API_ user data..getEndpointTypeElements) ⇒
+ * [~httpPostCheckConformOnFeatureUpdate(db)](#module_REST API_ user data..httpPostCheckConformOnFeatureUpdate) ⇒
+ * [~httpGetRequiredElements(db)](#module_REST API_ user data..httpGetRequiredElements) ⇒
* [~httpGetSessionNotifications(db)](#module_REST API_ user data..httpGetSessionNotifications) ⇒
* [~httpDeleteSessionNotification(db)](#module_REST API_ user data..httpDeleteSessionNotification) ⇒
* [~httpGetPackageNotifications(db)](#module_REST API_ user data..httpGetPackageNotifications) ⇒
@@ -15659,6 +15953,9 @@ This module provides the REST API to the user specific data.
* [~httpDeleteSessionPackage(db)](#module_REST API_ user data..httpDeleteSessionPackage) ⇒
* [~httpPostDuplicateEndpoint(db)](#module_REST API_ user data..httpPostDuplicateEndpoint) ⇒
* [~httpPostDuplicateEndpointType(db)](#module_REST API_ user data..httpPostDuplicateEndpointType) ⇒
+ * [~httpPatchUpdateBitOfFeatureMapAttribute(db)](#module_REST API_ user data..httpPatchUpdateBitOfFeatureMapAttribute) ⇒
+ * [~httpGetConformDataExists(db)](#module_REST API_ user data..httpGetConformDataExists) ⇒
+ * [~httpPostRequiredElementWarning(db)](#module_REST API_ user data..httpPostRequiredElementWarning) ⇒
* [~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)](#module_REST API_ user data..duplicateEndpointTypeClusters)
@@ -15712,6 +16009,45 @@ HTTP GET: device type features
| --- | --- |
| db | \*
|
+
+
+### REST API: user data~getEndpointTypeElements(db, endpointTypeClusterId, deviceTypeClusterId) ⇒
+Get all attributes, commands and events in an endpoint type cluster.
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: elements object containing all attributes, commands and events
+in an endpoint type cluster
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+| endpointTypeClusterId | \*
|
+| deviceTypeClusterId | \*
|
+
+
+
+### REST API: user data~httpPostCheckConformOnFeatureUpdate(db) ⇒
+HTTP POST: elements to be updated after toggle a device type feature
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: callback for the express uri registration
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
+
+
+### REST API: user data~httpGetRequiredElements(db) ⇒
+HTTP GET: required and unsupported cluster elements based on conformance
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: callback for the express uri registration
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
### REST API: user data~httpGetSessionNotifications(db) ⇒
@@ -16058,6 +16394,42 @@ Creating a duplicate for endpoint-type and endpoint-type-attributes
| --- | --- |
| db | \*
|
+
+
+### REST API: user data~httpPatchUpdateBitOfFeatureMapAttribute(db) ⇒
+Update feature map attribute with given new value
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: status of the update
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
+
+
+### REST API: user data~httpGetConformDataExists(db) ⇒
+Check if conformance data exists in the database
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: boolean value of data exist or not
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
+
+
+### REST API: user data~httpPostRequiredElementWarning(db) ⇒
+Set warning for the required element, and delete its existing warning if any.
+
+**Kind**: inner method of [REST API: user data
](#module_REST API_ user data)
+**Returns**: response of setting the warning notification
+
+| Param | Type |
+| --- | --- |
+| db | \*
|
+
### REST API: user data~duplicateEndpointTypeClusters(db, oldEndpointTypeId, newEndpointTypeId)
@@ -19763,8 +20135,8 @@ This module provides the APIs for dotdot Loading
* [~parseManufacturerData(db, ctx)](#module_Loader API_ Loader APIs..parseManufacturerData) ⇒
* [~parseProfilesData(db, ctx)](#module_Loader API_ Loader APIs..parseProfilesData) ⇒
* [~parseFeatureFlags(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseFeatureFlags) ⇒
- * [~parseFeatureConformance(operand)](#module_Loader API_ Loader APIs..parseFeatureConformance) ⇒
- * [~parseAndOrConformanceTerms(operand, joinChar)](#module_Loader API_ Loader APIs..parseAndOrConformanceTerms) ⇒
+ * [~parseConformanceFromXML(operand)](#module_Loader API_ Loader APIs..parseConformanceFromXML) ⇒
+ * [~parseConformanceRecursively(operand, depth, parentJoinChar)](#module_Loader API_ Loader APIs..parseConformanceRecursively) ⇒
* [~parseUiOptions(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseUiOptions) ⇒
* [~parseOptions(db)](#module_Loader API_ Loader APIs..parseOptions) ⇒
* [~parseTextOptions(db, pkgRef, textOptions)](#module_Loader API_ Loader APIs..parseTextOptions) ⇒
@@ -21115,10 +21487,14 @@ Key/velues of the object itself, end up in CODE/LABEL combinations.
| packageId | \*
|
| featureFlags | \*
|
-
+
+
+### Loader API: Loader APIs~parseConformanceFromXML(operand) ⇒
+Parses conformance from XML data.
+The conformance could come from features, attributes, commands, or events
-### Loader API: Loader APIs~parseFeatureConformance(operand) ⇒
-Parses feature conformance or an operand in feature conformance recursively from xml data.
+Call recursive helper function to parse conformance only if the conformance exists.
+Otherwise, return empty string directly
An example of parsing the conformance of 'User' device type feature:
@@ -21133,7 +21509,7 @@ Input operand from xml data:
{ "feature": [
{ "$": {"name": "PIN"}},
{ "$": {"name": "RID"}},
- { "$": {"name": "FPG"}},
+ { "$": {"name": "FGP"}},
{ "$": {"name": "FACE"}}
]
}
@@ -21144,28 +21520,32 @@ Input operand from xml data:
]
}
-Output device type feature conformance string:
- "Matter & (PIN | RID | FPG | FACE)"
+Output conformance string:
+ "Matter & (PIN | RID | FGP | FACE)"
**Kind**: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
-**Returns**: The feature conformance string.
+**Returns**: The conformance string
-| Param | Type | Description |
-| --- | --- | --- |
-| operand | \*
| The operand to be parsed. |
+| Param | Type |
+| --- | --- |
+| operand | \*
|
+
+
-
+### Loader API: Loader APIs~parseConformanceRecursively(operand, depth, parentJoinChar) ⇒
+helper function to parse conformance or an operand in conformance recursively
-### Loader API: Loader APIs~parseAndOrConformanceTerms(operand, joinChar) ⇒
-Helper function to parse andTerm or orTerm from xml data
+The baseLevelTerms variable include terms that can not have nested terms.
+When they appear, stop recursing and return the name inside directly
**Kind**: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
-**Returns**: feature conformance string
+**Returns**: The conformance string.
-| Param | Type |
-| --- | --- |
-| operand | \*
|
-| joinChar | \*
|
+| Param | Type | Default |
+| --- | --- | --- |
+| operand | \*
| |
+| depth | \*
| 0
|
+| parentJoinChar | \*
| |
@@ -21589,8 +21969,8 @@ This module provides the APIs for new data model loading
* [~parseManufacturerData(db, ctx)](#module_Loader API_ Loader APIs..parseManufacturerData) ⇒
* [~parseProfilesData(db, ctx)](#module_Loader API_ Loader APIs..parseProfilesData) ⇒
* [~parseFeatureFlags(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseFeatureFlags) ⇒
- * [~parseFeatureConformance(operand)](#module_Loader API_ Loader APIs..parseFeatureConformance) ⇒
- * [~parseAndOrConformanceTerms(operand, joinChar)](#module_Loader API_ Loader APIs..parseAndOrConformanceTerms) ⇒
+ * [~parseConformanceFromXML(operand)](#module_Loader API_ Loader APIs..parseConformanceFromXML) ⇒
+ * [~parseConformanceRecursively(operand, depth, parentJoinChar)](#module_Loader API_ Loader APIs..parseConformanceRecursively) ⇒
* [~parseUiOptions(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseUiOptions) ⇒
* [~parseOptions(db)](#module_Loader API_ Loader APIs..parseOptions) ⇒
* [~parseTextOptions(db, pkgRef, textOptions)](#module_Loader API_ Loader APIs..parseTextOptions) ⇒
@@ -22941,10 +23321,14 @@ Key/velues of the object itself, end up in CODE/LABEL combinations.
| packageId | \*
|
| featureFlags | \*
|
-
+
+
+### Loader API: Loader APIs~parseConformanceFromXML(operand) ⇒
+Parses conformance from XML data.
+The conformance could come from features, attributes, commands, or events
-### Loader API: Loader APIs~parseFeatureConformance(operand) ⇒
-Parses feature conformance or an operand in feature conformance recursively from xml data.
+Call recursive helper function to parse conformance only if the conformance exists.
+Otherwise, return empty string directly
An example of parsing the conformance of 'User' device type feature:
@@ -22959,7 +23343,7 @@ Input operand from xml data:
{ "feature": [
{ "$": {"name": "PIN"}},
{ "$": {"name": "RID"}},
- { "$": {"name": "FPG"}},
+ { "$": {"name": "FGP"}},
{ "$": {"name": "FACE"}}
]
}
@@ -22970,28 +23354,32 @@ Input operand from xml data:
]
}
-Output device type feature conformance string:
- "Matter & (PIN | RID | FPG | FACE)"
+Output conformance string:
+ "Matter & (PIN | RID | FGP | FACE)"
**Kind**: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
-**Returns**: The feature conformance string.
+**Returns**: The conformance string
-| Param | Type | Description |
-| --- | --- | --- |
-| operand | \*
| The operand to be parsed. |
+| Param | Type |
+| --- | --- |
+| operand | \*
|
-
+
-### Loader API: Loader APIs~parseAndOrConformanceTerms(operand, joinChar) ⇒
-Helper function to parse andTerm or orTerm from xml data
+### Loader API: Loader APIs~parseConformanceRecursively(operand, depth, parentJoinChar) ⇒
+helper function to parse conformance or an operand in conformance recursively
+
+The baseLevelTerms variable include terms that can not have nested terms.
+When they appear, stop recursing and return the name inside directly
**Kind**: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
-**Returns**: feature conformance string
+**Returns**: The conformance string.
-| Param | Type |
-| --- | --- |
-| operand | \*
|
-| joinChar | \*
|
+| Param | Type | Default |
+| --- | --- | --- |
+| operand | \*
| |
+| depth | \*
| 0
|
+| parentJoinChar | \*
| |
@@ -23415,8 +23803,8 @@ This module provides the APIs for ZCL/Data-Model loading.
* [~parseManufacturerData(db, ctx)](#module_Loader API_ Loader APIs..parseManufacturerData) ⇒
* [~parseProfilesData(db, ctx)](#module_Loader API_ Loader APIs..parseProfilesData) ⇒
* [~parseFeatureFlags(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseFeatureFlags) ⇒
- * [~parseFeatureConformance(operand)](#module_Loader API_ Loader APIs..parseFeatureConformance) ⇒
- * [~parseAndOrConformanceTerms(operand, joinChar)](#module_Loader API_ Loader APIs..parseAndOrConformanceTerms) ⇒
+ * [~parseConformanceFromXML(operand)](#module_Loader API_ Loader APIs..parseConformanceFromXML) ⇒
+ * [~parseConformanceRecursively(operand, depth, parentJoinChar)](#module_Loader API_ Loader APIs..parseConformanceRecursively) ⇒
* [~parseUiOptions(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseUiOptions) ⇒
* [~parseOptions(db)](#module_Loader API_ Loader APIs..parseOptions) ⇒
* [~parseTextOptions(db, pkgRef, textOptions)](#module_Loader API_ Loader APIs..parseTextOptions) ⇒
@@ -24767,10 +25155,14 @@ Key/velues of the object itself, end up in CODE/LABEL combinations.
| packageId | \*
|
| featureFlags | \*
|
-
+
-### Loader API: Loader APIs~parseFeatureConformance(operand) ⇒
-Parses feature conformance or an operand in feature conformance recursively from xml data.
+### Loader API: Loader APIs~parseConformanceFromXML(operand) ⇒
+Parses conformance from XML data.
+The conformance could come from features, attributes, commands, or events
+
+Call recursive helper function to parse conformance only if the conformance exists.
+Otherwise, return empty string directly
An example of parsing the conformance of 'User' device type feature:
@@ -24785,7 +25177,7 @@ Input operand from xml data:
{ "feature": [
{ "$": {"name": "PIN"}},
{ "$": {"name": "RID"}},
- { "$": {"name": "FPG"}},
+ { "$": {"name": "FGP"}},
{ "$": {"name": "FACE"}}
]
}
@@ -24796,28 +25188,32 @@ Input operand from xml data:
]
}
-Output device type feature conformance string:
- "Matter & (PIN | RID | FPG | FACE)"
+Output conformance string:
+ "Matter & (PIN | RID | FGP | FACE)"
**Kind**: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
-**Returns**: The feature conformance string.
+**Returns**: The conformance string
-| Param | Type | Description |
-| --- | --- | --- |
-| operand | \*
| The operand to be parsed. |
+| Param | Type |
+| --- | --- |
+| operand | \*
|
-
+
-### Loader API: Loader APIs~parseAndOrConformanceTerms(operand, joinChar) ⇒
-Helper function to parse andTerm or orTerm from xml data
+### Loader API: Loader APIs~parseConformanceRecursively(operand, depth, parentJoinChar) ⇒
+helper function to parse conformance or an operand in conformance recursively
+
+The baseLevelTerms variable include terms that can not have nested terms.
+When they appear, stop recursing and return the name inside directly
**Kind**: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
-**Returns**: feature conformance string
+**Returns**: The conformance string.
-| Param | Type |
-| --- | --- |
-| operand | \*
|
-| joinChar | \*
|
+| Param | Type | Default |
+| --- | --- | --- |
+| operand | \*
| |
+| depth | \*
| 0
|
+| parentJoinChar | \*
| |
@@ -25241,8 +25637,8 @@ This module provides the APIs for for common functionality related to loading.
* [~parseManufacturerData(db, ctx)](#module_Loader API_ Loader APIs..parseManufacturerData) ⇒
* [~parseProfilesData(db, ctx)](#module_Loader API_ Loader APIs..parseProfilesData) ⇒
* [~parseFeatureFlags(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseFeatureFlags) ⇒
- * [~parseFeatureConformance(operand)](#module_Loader API_ Loader APIs..parseFeatureConformance) ⇒
- * [~parseAndOrConformanceTerms(operand, joinChar)](#module_Loader API_ Loader APIs..parseAndOrConformanceTerms) ⇒
+ * [~parseConformanceFromXML(operand)](#module_Loader API_ Loader APIs..parseConformanceFromXML) ⇒
+ * [~parseConformanceRecursively(operand, depth, parentJoinChar)](#module_Loader API_ Loader APIs..parseConformanceRecursively) ⇒
* [~parseUiOptions(db, packageId, featureFlags)](#module_Loader API_ Loader APIs..parseUiOptions) ⇒
* [~parseOptions(db)](#module_Loader API_ Loader APIs..parseOptions) ⇒
* [~parseTextOptions(db, pkgRef, textOptions)](#module_Loader API_ Loader APIs..parseTextOptions) ⇒
@@ -26593,10 +26989,14 @@ Key/velues of the object itself, end up in CODE/LABEL combinations.
| packageId | \*
|
| featureFlags | \*
|
-
+
+
+### Loader API: Loader APIs~parseConformanceFromXML(operand) ⇒
+Parses conformance from XML data.
+The conformance could come from features, attributes, commands, or events
-### Loader API: Loader APIs~parseFeatureConformance(operand) ⇒
-Parses feature conformance or an operand in feature conformance recursively from xml data.
+Call recursive helper function to parse conformance only if the conformance exists.
+Otherwise, return empty string directly
An example of parsing the conformance of 'User' device type feature:
@@ -26611,7 +27011,7 @@ Input operand from xml data:
{ "feature": [
{ "$": {"name": "PIN"}},
{ "$": {"name": "RID"}},
- { "$": {"name": "FPG"}},
+ { "$": {"name": "FGP"}},
{ "$": {"name": "FACE"}}
]
}
@@ -26622,28 +27022,32 @@ Input operand from xml data:
]
}
-Output device type feature conformance string:
- "Matter & (PIN | RID | FPG | FACE)"
+Output conformance string:
+ "Matter & (PIN | RID | FGP | FACE)"
**Kind**: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
-**Returns**: The feature conformance string.
+**Returns**: The conformance string
-| Param | Type | Description |
-| --- | --- | --- |
-| operand | \*
| The operand to be parsed. |
+| Param | Type |
+| --- | --- |
+| operand | \*
|
+
+
-
+### Loader API: Loader APIs~parseConformanceRecursively(operand, depth, parentJoinChar) ⇒
+helper function to parse conformance or an operand in conformance recursively
-### Loader API: Loader APIs~parseAndOrConformanceTerms(operand, joinChar) ⇒
-Helper function to parse andTerm or orTerm from xml data
+The baseLevelTerms variable include terms that can not have nested terms.
+When they appear, stop recursing and return the name inside directly
**Kind**: inner method of [Loader API: Loader APIs
](#module_Loader API_ Loader APIs)
-**Returns**: feature conformance string
+**Returns**: The conformance string.
-| Param | Type |
-| --- | --- |
-| operand | \*
|
-| joinChar | \*
|
+| Param | Type | Default |
+| --- | --- | --- |
+| operand | \*
| |
+| depth | \*
| 0
|
+| parentJoinChar | \*
| |
diff --git a/docs/zap-schema.svg b/docs/zap-schema.svg
index 390b1a43ad..6f796b61f6 100644
--- a/docs/zap-schema.svg
+++ b/docs/zap-schema.svg
@@ -1,3113 +1,3088 @@
-
-