mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-06 00:07:44 +01:00
eec9593d55
The indented formatting makes it interpreted as a markdown code block. This isn't what we want. It's not as pretty, but putting it on one line makes it render correctly. What it looks like today: ![image](https://github.com/Unleash/unleash/assets/17786332/5e462931-5a3b-4b75-9cb5-0b21da4838b1)
54 lines
1.8 KiB
TypeScript
54 lines
1.8 KiB
TypeScript
import { FromSchema } from 'json-schema-to-ts';
|
|
import { IEventTypes } from '../../types';
|
|
|
|
export const searchEventsSchema = {
|
|
$id: '#/components/schemas/searchEventsSchema',
|
|
type: 'object',
|
|
description: `
|
|
Search for events by type, project, feature, free-text query,
|
|
or a combination thereof. Pass an empty object to fetch all events.
|
|
`,
|
|
properties: {
|
|
type: {
|
|
type: 'string',
|
|
description: 'Find events by event type (case-sensitive).',
|
|
enum: IEventTypes,
|
|
example: 'feature-created',
|
|
},
|
|
project: {
|
|
type: 'string',
|
|
description: 'Find events by project ID (case-sensitive).',
|
|
example: 'default',
|
|
},
|
|
feature: {
|
|
type: 'string',
|
|
description: 'Find events by feature toggle name (case-sensitive).',
|
|
example: 'my.first.toggle',
|
|
},
|
|
query: {
|
|
type: 'string',
|
|
description: `Find events by a free-text search query. The query will be matched against the event type, the username or email that created the event (if any), and the event data payload (if any).`,
|
|
example: 'admin@example.com',
|
|
},
|
|
limit: {
|
|
type: 'integer',
|
|
description:
|
|
'The maximum amount of events to return in the search result',
|
|
minimum: 1,
|
|
maximum: 100,
|
|
default: 100,
|
|
example: 50,
|
|
},
|
|
offset: {
|
|
description: 'Which event id to start listing from',
|
|
type: 'integer',
|
|
minimum: 0,
|
|
default: 0,
|
|
example: 100,
|
|
},
|
|
},
|
|
components: {},
|
|
} as const;
|
|
|
|
export type SearchEventsSchema = FromSchema<typeof searchEventsSchema>;
|