-
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.
[ML] New Platform server shim: update calendar routes to use new plat…
…form router (#56264) * migrate calendar routes to NP * add proper types for calendars and events * set actual client in constructor so isLegacy is not stored * remove unnecessary comments * fix calendar schema for missing calendar_id and event_id properties
- Loading branch information
1 parent
a8622cf
commit fb334ef
Showing
9 changed files
with
268 additions
and
157 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
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
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
25 changes: 25 additions & 0 deletions
25
x-pack/legacy/plugins/ml/server/new_platform/calendars_schema.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,25 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { schema } from '@kbn/config-schema'; | ||
|
||
export const calendarSchema = { | ||
calendar_id: schema.maybe(schema.string()), | ||
calendarId: schema.string(), | ||
job_ids: schema.arrayOf(schema.maybe(schema.string())), | ||
description: schema.maybe(schema.string()), | ||
events: schema.arrayOf( | ||
schema.maybe( | ||
schema.object({ | ||
event_id: schema.maybe(schema.string()), | ||
calendar_id: schema.maybe(schema.string()), | ||
description: schema.maybe(schema.string()), | ||
start_time: schema.any(), | ||
end_time: schema.any(), | ||
}) | ||
) | ||
), | ||
}; |
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.