Skip to content

Commit

Permalink
feat!: release 1.0.0 with moveAllComponents option (#252)
Browse files Browse the repository at this point in the history
Co-authored-by: Viacheslav Turovskyi <aeworxet@protonmail.com>
  • Loading branch information
KhudaDad414 and aeworxet authored Apr 17, 2024
1 parent 4ba7276 commit 066b011
Show file tree
Hide file tree
Showing 15 changed files with 1,075 additions and 7,109 deletions.
1 change: 1 addition & 0 deletions .sonarcloud.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sonar.exclusions=test/**/*
30 changes: 28 additions & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ user will only interact with this class. here we generate different kind of repo
## Functions

<dl>
<dt><a href="#findAllComponents">findAllComponents(optimizableComponentGroup)</a> ⇒</dt>
<dd></dd>
<dt><a href="#findDuplicateComponents">findDuplicateComponents(optimizableComponentGroup)</a> ⇒</dt>
<dd></dd>
<dt><a href="#hasParent">hasParent()</a></dt>
Expand All @@ -33,6 +35,8 @@ user will only interact with this class. here we generate different kind of repo
<dl>
<dt><a href="#Rules">Rules</a> : <code>Object</code></dt>
<dd></dd>
<dt><a href="#DisableOptimizationFor">DisableOptimizationFor</a> : <code>Object</code></dt>
<dd></dd>
<dt><a href="#Options">Options</a> : <code>Object</code></dt>
<dd></dd>
</dl>
Expand Down Expand Up @@ -76,6 +80,16 @@ This function is used to get the optimized document after seeing the report.
| --- | --- | --- |
| [Options] | [<code>Options</code>](#Options) | the options are a way to customize the final output. |

<a name="findAllComponents"></a>

## findAllComponents(optimizableComponentGroup) ⇒
**Kind**: global function
**Returns**: A list of optimization report elements.

| Param | Description |
| --- | --- |
| optimizableComponentGroup | all AsyncAPI Specification-valid components. |

<a name="findDuplicateComponents"></a>

## findDuplicateComponents(optimizableComponentGroup) ⇒
Expand All @@ -84,7 +98,7 @@ This function is used to get the optimized document after seeing the report.

| Param | Description |
| --- | --- |
| optimizableComponentGroup | components that you want to analyze for duplicates. |
| optimizableComponentGroup | all AsyncAPI Specification-valid components that you want to analyze for duplicates. |

<a name="hasParent"></a>

Expand Down Expand Up @@ -132,7 +146,18 @@ Converts JSON or YAML string object.
| --- | --- | --- |
| [reuseComponents] | <code>Boolean</code> | whether to reuse components from `components` section or not. Defaults to `true`. |
| [removeComponents] | <code>Boolean</code> | whether to remove un-used components from `components` section or not. Defaults to `true`. |
| [moveToComponents] | <code>Boolean</code> | whether to move duplicated components to the `components` section or not. Defaults to `true`. |
| [moveAllToComponents] | <code>Boolean</code> | whether to move all AsyncAPI Specification-valid components to the `components` section or not. Defaults to `true`. |
| [moveDuplicatesToComponents] | <code>Boolean</code> | whether to move duplicated components to the `components` section or not. Defaults to `false`. |

<a name="DisableOptimizationFor"></a>

## DisableOptimizationFor : <code>Object</code>
**Kind**: global typedef
**Properties**

| Name | Type | Description |
| --- | --- | --- |
| [schema] | <code>Boolean</code> | whether object `schema` should be excluded from the process of optimization (`true` instructs **not** to add calculated `schemas` to the optimized AsyncAPI Document.) |

<a name="Options"></a>

Expand All @@ -144,4 +169,5 @@ Converts JSON or YAML string object.
| --- | --- | --- |
| [rules] | [<code>Rules</code>](#Rules) | the list of rules that specifies which type of optimizations should be applied. |
| [output] | <code>String</code> | specifies which type of output user wants, `'JSON'` or `'YAML'`. Defaults to `'YAML'`; |
| [disableOptimizationFor] | [<code>DisableOptimizationFor</code>](#DisableOptimizationFor) | the list of objects that should be excluded from the process of optimization. |

Loading

0 comments on commit 066b011

Please sign in to comment.