-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate api/_types/index.d.ts (#955) Signed-off-by: Xavier Fournet <461943+xfournet@users.noreply.github.com>
- Loading branch information
Showing
8 changed files
with
301 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,233 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
/* | ||
* This file was generated from the OpenSearch API Spec. Do NOT edit it | ||
* manually. If you want to make changes, either update the spec or | ||
* modify the API generator. | ||
*/ | ||
|
||
import * as Common from './_common' | ||
import * as Common_Aggregations from './_common.aggregations' | ||
import * as Common_Analysis from './_common.analysis' | ||
import * as Common_Mapping from './_common.mapping' | ||
import * as Common_QueryDsl from './_common.query_dsl' | ||
import * as Core_Common from './_core._common' | ||
import * as Core_Bulk from './_core.bulk' | ||
import * as Core_Explain from './_core.explain' | ||
import * as Core_FieldCaps from './_core.field_caps' | ||
import * as Core_GetScriptContext from './_core.get_script_context' | ||
import * as Core_GetScriptLanguages from './_core.get_script_languages' | ||
import * as Core_Get from './_core.get' | ||
import * as Core_Mget from './_core.mget' | ||
import * as Core_MsearchTemplate from './_core.msearch_template' | ||
import * as Core_Msearch from './_core.msearch' | ||
import * as Core_Mtermvectors from './_core.mtermvectors' | ||
import * as Core_RankEval from './_core.rank_eval' | ||
import * as Core_ReindexRethrottle from './_core.reindex_rethrottle' | ||
import * as Core_Reindex from './_core.reindex' | ||
import * as Core_ScriptsPainlessExecute from './_core.scripts_painless_execute' | ||
import * as Core_SearchShards from './_core.search_shards' | ||
import * as Core_Search from './_core.search' | ||
import * as Core_Termvectors from './_core.termvectors' | ||
import * as Core_UpdateByQueryRethrottle from './_core.update_by_query_rethrottle' | ||
import * as Core_Update from './_core.update' | ||
import * as AsynchronousSearch_Common from './asynchronous_search._common' | ||
import * as Cat_Aliases from './cat.aliases' | ||
import * as Cat_Allocation from './cat.allocation' | ||
import * as Cat_ClusterManager from './cat.cluster_manager' | ||
import * as Cat_Count from './cat.count' | ||
import * as Cat_Fielddata from './cat.fielddata' | ||
import * as Cat_Health from './cat.health' | ||
import * as Cat_Indices from './cat.indices' | ||
import * as Cat_Master from './cat.master' | ||
import * as Cat_Nodeattrs from './cat.nodeattrs' | ||
import * as Cat_Nodes from './cat.nodes' | ||
import * as Cat_PendingTasks from './cat.pending_tasks' | ||
import * as Cat_Plugins from './cat.plugins' | ||
import * as Cat_Recovery from './cat.recovery' | ||
import * as Cat_Repositories from './cat.repositories' | ||
import * as Cat_SegmentReplication from './cat.segment_replication' | ||
import * as Cat_Segments from './cat.segments' | ||
import * as Cat_Shards from './cat.shards' | ||
import * as Cat_Snapshots from './cat.snapshots' | ||
import * as Cat_Tasks from './cat.tasks' | ||
import * as Cat_Templates from './cat.templates' | ||
import * as Cat_ThreadPool from './cat.thread_pool' | ||
import * as Cluster_Common from './cluster._common' | ||
import * as Cluster_AllocationExplain from './cluster.allocation_explain' | ||
import * as Cluster_DecommissionAwareness from './cluster.decommission_awareness' | ||
import * as Cluster_Health from './cluster.health' | ||
import * as Cluster_PendingTasks from './cluster.pending_tasks' | ||
import * as Cluster_RemoteInfo from './cluster.remote_info' | ||
import * as Cluster_Reroute from './cluster.reroute' | ||
import * as Cluster_State from './cluster.state' | ||
import * as Cluster_Stats from './cluster.stats' | ||
import * as Cluster_WeightedRouting from './cluster.weighted_routing' | ||
import * as DanglingIndices_ListDanglingIndices from './dangling_indices.list_dangling_indices' | ||
import * as FlowFramework_Common from './flow_framework.common' | ||
import * as FlowFramework_Errors from './flow_framework.errors' | ||
import * as Indices_Common from './indices._common' | ||
import * as Indices_AddBlock from './indices.add_block' | ||
import * as Indices_Analyze from './indices.analyze' | ||
import * as Indices_Close from './indices.close' | ||
import * as Indices_GetAlias from './indices.get_alias' | ||
import * as Indices_GetFieldMapping from './indices.get_field_mapping' | ||
import * as Indices_GetIndexTemplate from './indices.get_index_template' | ||
import * as Indices_GetMapping from './indices.get_mapping' | ||
import * as Indices_PutIndexTemplate from './indices.put_index_template' | ||
import * as Indices_Recovery from './indices.recovery' | ||
import * as Indices_ResolveIndex from './indices.resolve_index' | ||
import * as Indices_Rollover from './indices.rollover' | ||
import * as Indices_Segments from './indices.segments' | ||
import * as Indices_ShardStores from './indices.shard_stores' | ||
import * as Indices_SimulateTemplate from './indices.simulate_template' | ||
import * as Indices_Stats from './indices.stats' | ||
import * as Indices_UpdateAliases from './indices.update_aliases' | ||
import * as Indices_ValidateQuery from './indices.validate_query' | ||
import * as Ingest_Common from './ingest._common' | ||
import * as Ingest_Simulate from './ingest.simulate' | ||
import * as Insights_Common from './insights._common' | ||
import * as Ism_Common from './ism._common' | ||
import * as Knn_Common from './knn._common' | ||
import * as Ml_Common from './ml._common' | ||
import * as Nodes_Common from './nodes._common' | ||
import * as Nodes_Info from './nodes.info' | ||
import * as Nodes_ReloadSecureSettings from './nodes.reload_secure_settings' | ||
import * as Nodes_Stats from './nodes.stats' | ||
import * as Nodes_Usage from './nodes.usage' | ||
import * as Notifications_Common from './notifications._common' | ||
import * as Observability_Common from './observability._common' | ||
import * as Query_Common from './query._common' | ||
import * as RemoteStore_Common from './remote_store._common' | ||
import * as Replication_Common from './replication._common' | ||
import * as Rollups_Common from './rollups._common' | ||
import * as SearchPipeline_Common from './search_pipeline._common' | ||
import * as Security_Common from './security._common' | ||
import * as Sm_Common from './sm._common' | ||
import * as Snapshot_Common from './snapshot._common' | ||
import * as Snapshot_CleanupRepository from './snapshot.cleanup_repository' | ||
import * as Snapshot_Restore from './snapshot.restore' | ||
import * as Snapshot_VerifyRepository from './snapshot.verify_repository' | ||
import * as Sql_Common from './sql._common' | ||
import * as Tasks_Common from './tasks._common' | ||
import * as Transforms_Common from './transforms._common' | ||
import * as Wlm_Common from './wlm._common' | ||
import * as Global from './_global' | ||
|
||
export { | ||
Common, | ||
Common_Aggregations, | ||
Common_Analysis, | ||
Common_Mapping, | ||
Common_QueryDsl, | ||
Core_Common, | ||
Core_Bulk, | ||
Core_Explain, | ||
Core_FieldCaps, | ||
Core_GetScriptContext, | ||
Core_GetScriptLanguages, | ||
Core_Get, | ||
Core_Mget, | ||
Core_MsearchTemplate, | ||
Core_Msearch, | ||
Core_Mtermvectors, | ||
Core_RankEval, | ||
Core_ReindexRethrottle, | ||
Core_Reindex, | ||
Core_ScriptsPainlessExecute, | ||
Core_SearchShards, | ||
Core_Search, | ||
Core_Termvectors, | ||
Core_UpdateByQueryRethrottle, | ||
Core_Update, | ||
AsynchronousSearch_Common, | ||
Cat_Aliases, | ||
Cat_Allocation, | ||
Cat_ClusterManager, | ||
Cat_Count, | ||
Cat_Fielddata, | ||
Cat_Health, | ||
Cat_Indices, | ||
Cat_Master, | ||
Cat_Nodeattrs, | ||
Cat_Nodes, | ||
Cat_PendingTasks, | ||
Cat_Plugins, | ||
Cat_Recovery, | ||
Cat_Repositories, | ||
Cat_SegmentReplication, | ||
Cat_Segments, | ||
Cat_Shards, | ||
Cat_Snapshots, | ||
Cat_Tasks, | ||
Cat_Templates, | ||
Cat_ThreadPool, | ||
Cluster_Common, | ||
Cluster_AllocationExplain, | ||
Cluster_DecommissionAwareness, | ||
Cluster_Health, | ||
Cluster_PendingTasks, | ||
Cluster_RemoteInfo, | ||
Cluster_Reroute, | ||
Cluster_State, | ||
Cluster_Stats, | ||
Cluster_WeightedRouting, | ||
DanglingIndices_ListDanglingIndices, | ||
FlowFramework_Common, | ||
FlowFramework_Errors, | ||
Indices_Common, | ||
Indices_AddBlock, | ||
Indices_Analyze, | ||
Indices_Close, | ||
Indices_GetAlias, | ||
Indices_GetFieldMapping, | ||
Indices_GetIndexTemplate, | ||
Indices_GetMapping, | ||
Indices_PutIndexTemplate, | ||
Indices_Recovery, | ||
Indices_ResolveIndex, | ||
Indices_Rollover, | ||
Indices_Segments, | ||
Indices_ShardStores, | ||
Indices_SimulateTemplate, | ||
Indices_Stats, | ||
Indices_UpdateAliases, | ||
Indices_ValidateQuery, | ||
Ingest_Common, | ||
Ingest_Simulate, | ||
Insights_Common, | ||
Ism_Common, | ||
Knn_Common, | ||
Ml_Common, | ||
Nodes_Common, | ||
Nodes_Info, | ||
Nodes_ReloadSecureSettings, | ||
Nodes_Stats, | ||
Nodes_Usage, | ||
Notifications_Common, | ||
Observability_Common, | ||
Query_Common, | ||
RemoteStore_Common, | ||
Replication_Common, | ||
Rollups_Common, | ||
SearchPipeline_Common, | ||
Security_Common, | ||
Sm_Common, | ||
Snapshot_Common, | ||
Snapshot_CleanupRepository, | ||
Snapshot_Restore, | ||
Snapshot_VerifyRepository, | ||
Sql_Common, | ||
Tasks_Common, | ||
Transforms_Common, | ||
Wlm_Common, | ||
Global, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
api_generator/src/renderers/render_types/ComponentTypesRenderer.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
* | ||
* The OpenSearch Contributors require contributions made to | ||
* this file be licensed under the Apache-2.0 license or a | ||
* compatible open source license. | ||
* | ||
*/ | ||
|
||
import BaseRenderer from '../BaseRenderer' | ||
import FunctionTypesContainer from './FunctionTypesContainer' | ||
import TypesContainer from './TypesContainer' | ||
|
||
export default class ComponentTypesRenderer extends BaseRenderer { | ||
protected template_file = 'types.component_types.mustache' | ||
private readonly containers: TypesContainer[] | ||
|
||
constructor () { | ||
super() | ||
this.containers = [...TypesContainer.REPO.values()].filter((container) => container.folder_name === '_types') | ||
} | ||
|
||
view (): Record<string, any> { | ||
return { imports: this.#imports(), exports: this.#exports() } | ||
} | ||
|
||
#imports (): Array<{ name: string, path: string }> { | ||
return this.containers.map(container => { | ||
return { | ||
name: container.import_name, | ||
path: FunctionTypesContainer.import_path(container, { file_path: './_types/index.d.ts' }) | ||
} | ||
}) | ||
} | ||
|
||
#exports (): string[] { | ||
return this.containers.map(container => container.import_name) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
api_generator/src/renderers/templates/types.component_types.mustache
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{{{opensearch_license}}} | ||
{{{generated_code_warning}}} | ||
|
||
{{#imports}} | ||
import * as {{{name}}} from '{{{path}}}' | ||
{{/imports}} | ||
|
||
export { | ||
{{#exports}} | ||
{{{.}}}, | ||
{{/exports}} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters