-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare the connector GetAll API for versioning (#162799)
Part of: elastic/response-ops-team#125 This PR intends to prepare the `GET ${BASE_ACTION_API_PATH}/connectors` API for versioning as shown in the above issue. --------- Co-authored-by: kibanamachine <[email protected]>
- Loading branch information
1 parent
0d85af2
commit d65b02c
Showing
41 changed files
with
1,314 additions
and
730 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
x-pack/plugins/actions/common/routes/connector/response/index.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,17 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
// Latest | ||
export type { ConnectorResponse, ActionTypeConfig } from './types/latest'; | ||
export { connectorResponseSchema } from './schemas/latest'; | ||
|
||
// v1 | ||
export type { | ||
ConnectorResponse as ConnectorResponseV1, | ||
ActionTypeConfig as ActionTypeConfigV1, | ||
} from './types/v1'; | ||
export { connectorResponseSchema as connectorResponseSchemaV1 } from './schemas/v1'; |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/actions/common/routes/connector/response/schemas/latest.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,8 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
export { connectorResponseSchema } from './v1'; |
20 changes: 20 additions & 0 deletions
20
x-pack/plugins/actions/common/routes/connector/response/schemas/v1.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,20 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { schema } from '@kbn/config-schema'; | ||
|
||
export const connectorResponseSchema = schema.object({ | ||
id: schema.string(), | ||
name: schema.string(), | ||
config: schema.maybe(schema.recordOf(schema.string(), schema.any())), | ||
connector_type_id: schema.string(), | ||
is_missing_secrets: schema.maybe(schema.boolean()), | ||
is_preconfigured: schema.boolean(), | ||
is_deprecated: schema.boolean(), | ||
is_system_action: schema.boolean(), | ||
referenced_by_count: schema.number(), | ||
}); |
7 changes: 7 additions & 0 deletions
7
x-pack/plugins/actions/common/routes/connector/response/types/latest.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,7 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
export * from './v1'; |
24 changes: 24 additions & 0 deletions
24
x-pack/plugins/actions/common/routes/connector/response/types/v1.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,24 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import { TypeOf } from '@kbn/config-schema'; | ||
import { connectorResponseSchemaV1 } from '..'; | ||
|
||
export type ActionTypeConfig = Record<string, unknown>; | ||
type ConnectorResponseSchemaType = TypeOf<typeof connectorResponseSchemaV1>; | ||
|
||
export interface ConnectorResponse<Config extends ActionTypeConfig = ActionTypeConfig> { | ||
id: ConnectorResponseSchemaType['id']; | ||
name: ConnectorResponseSchemaType['name']; | ||
config?: Config; | ||
connector_type_id: ConnectorResponseSchemaType['connector_type_id']; | ||
is_missing_secrets?: ConnectorResponseSchemaType['is_missing_secrets']; | ||
is_preconfigured: ConnectorResponseSchemaType['is_preconfigured']; | ||
is_deprecated: ConnectorResponseSchemaType['is_deprecated']; | ||
is_system_action: ConnectorResponseSchemaType['is_system_action']; | ||
referenced_by_count: ConnectorResponseSchemaType['referenced_by_count']; | ||
} |
Oops, something went wrong.