File tree Expand file tree Collapse file tree
packages/ui-extensions/docs/surfaces/point-of-sale Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -451,6 +451,9 @@ function getNestedApis(apiName) {
451451 }
452452}
453453
454+ // APIs that are composites of other documented APIs - we list their constituent APIs, not these wrapper types
455+ const COMPOSITE_APIS = new Set ( [ 'StandardApi' , 'ActionTargetApi' ] ) ;
456+
454457function parseApis ( apiString ) {
455458 const apisSet = new Set ( ) ;
456459
@@ -480,16 +483,24 @@ function parseApis(apiString) {
480483 }
481484
482485 if ( apiName ) {
483- // Add the API itself
484- apisSet . add ( apiName ) ;
486+ if ( ! COMPOSITE_APIS . has ( apiName ) ) {
487+ apisSet . add ( apiName ) ;
488+ }
485489
486- // Get nested APIs from this API (recursively)
487490 const nestedApis = getNestedApis ( apiName ) ;
488491 for ( const nestedApi of nestedApis ) {
489- apisSet . add ( nestedApi ) ;
490- // Recursively get nested APIs of nested APIs
491- const deepNestedApis = getNestedApis ( nestedApi ) ;
492- deepNestedApis . forEach ( ( api ) => apisSet . add ( api ) ) ;
492+ if ( COMPOSITE_APIS . has ( nestedApi ) ) {
493+ const deepNestedApis = getNestedApis ( nestedApi ) ;
494+ deepNestedApis . forEach ( ( api ) => {
495+ if ( ! COMPOSITE_APIS . has ( api ) ) apisSet . add ( api ) ;
496+ } ) ;
497+ } else {
498+ apisSet . add ( nestedApi ) ;
499+ const deepNestedApis = getNestedApis ( nestedApi ) ;
500+ deepNestedApis . forEach ( ( api ) => {
501+ if ( ! COMPOSITE_APIS . has ( api ) ) apisSet . add ( api ) ;
502+ } ) ;
503+ }
493504 }
494505 }
495506 }
You can’t perform that action at this time.
0 commit comments