-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ResponseOps] Prepare the connector
create
HTTP API for versioning (#…
…194879) Towards elastic/response-ops-team#125 ## Summary Preparing the `POST ${BASE_ACTION_API_PATH}/connector/{id?}` HTTP API for versioning
- Loading branch information
Showing
24 changed files
with
427 additions
and
296 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
21 changes: 21 additions & 0 deletions
21
x-pack/plugins/actions/common/routes/connector/apis/create/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,21 @@ | ||
/* | ||
* 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 { | ||
createConnectorRequestParamsSchema, | ||
createConnectorRequestBodySchema, | ||
} from './schemas/latest'; | ||
export type { CreateConnectorRequestParams, CreateConnectorRequestBody } from './types/latest'; | ||
|
||
export { | ||
createConnectorRequestParamsSchema as createConnectorRequestParamsSchemaV1, | ||
createConnectorRequestBodySchema as createConnectorRequestBodySchemaV1, | ||
} from './schemas/v1'; | ||
export type { | ||
CreateConnectorRequestParams as CreateConnectorRequestParamsV1, | ||
CreateConnectorRequestBody as CreateConnectorRequestBodyV1, | ||
} from './types/v1'; |
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 |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
* 2.0. | ||
*/ | ||
|
||
export { transformGetConnectorResponse } from './v1'; | ||
export * from './v1'; |
32 changes: 32 additions & 0 deletions
32
x-pack/plugins/actions/common/routes/connector/apis/create/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,32 @@ | ||
/* | ||
* 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'; | ||
import { validateEmptyStrings } from '../../../../../validate_empty_strings'; | ||
|
||
export const createConnectorRequestParamsSchema = schema.maybe( | ||
schema.object({ | ||
id: schema.maybe(schema.string({ meta: { description: 'An identifier for the connector.' } })), | ||
}) | ||
); | ||
|
||
export const createConnectorRequestBodySchema = schema.object({ | ||
name: schema.string({ | ||
validate: validateEmptyStrings, | ||
meta: { description: 'The display name for the connector.' }, | ||
}), | ||
connector_type_id: schema.string({ | ||
validate: validateEmptyStrings, | ||
meta: { description: 'The type of connector.' }, | ||
}), | ||
config: schema.recordOf(schema.string(), schema.any({ validate: validateEmptyStrings }), { | ||
defaultValue: {}, | ||
}), | ||
secrets: schema.recordOf(schema.string(), schema.any({ validate: validateEmptyStrings }), { | ||
defaultValue: {}, | ||
}), | ||
}); |
8 changes: 8 additions & 0 deletions
8
x-pack/plugins/actions/common/routes/connector/apis/create/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,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 * from './v1'; |
12 changes: 12 additions & 0 deletions
12
x-pack/plugins/actions/common/routes/connector/apis/create/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,12 @@ | ||
/* | ||
* 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 type { TypeOf } from '@kbn/config-schema'; | ||
import { createConnectorRequestParamsSchemaV1, createConnectorRequestBodySchemaV1 } from '..'; | ||
|
||
export type CreateConnectorRequestParams = TypeOf<typeof createConnectorRequestParamsSchemaV1>; | ||
export type CreateConnectorRequestBody = TypeOf<typeof createConnectorRequestBodySchemaV1>; |
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
Oops, something went wrong.