Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.x] [UII] Add types to return content packages correctly (#195505) #195690

Merged
merged 2 commits into from
Oct 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 85 additions & 2 deletions x-pack/plugins/fleet/common/openapi/bundled.json
Original file line number Diff line number Diff line change
Expand Up @@ -6700,7 +6700,12 @@
"type": "string"
},
"type": {
"type": "string"
"type": "string",
"enum": [
"integration",
"input",
"content"
]
},
"categories": {
"type": "array",
Expand Down Expand Up @@ -6853,6 +6858,83 @@
}
}
}
},
"owner": {
"type": "object",
"properties": {
"github": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"elastic",
"partner",
"community"
]
}
},
"required": [
"github"
]
},
"agent": {
"type": "object",
"properties": {
"privileges": {
"type": "object",
"properties": {
"root": {
"type": "boolean"
}
}
}
}
},
"asset_tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"text": {
"type": "string"
},
"asset_types": {
"type": "array",
"items": {
"type": "string"
}
},
"asset_ids": {
"type": "array",
"items": {
"type": "string"
}
}
},
"required": [
"text"
]
}
},
"discovery": {
"type": "object",
"properties": {
"fields": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
},
"required": [
"name"
]
}
}
}
}
},
"required": [
Expand All @@ -6866,7 +6948,8 @@
"assets",
"format_version",
"download",
"path"
"path",
"owner"
]
},
"package_usage_stats": {
Expand Down
55 changes: 55 additions & 0 deletions x-pack/plugins/fleet/common/openapi/bundled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4233,6 +4233,10 @@ components:
type: string
type:
type: string
enum:
- integration
- input
- content
categories:
type: array
items:
Expand Down Expand Up @@ -4335,6 +4339,56 @@ components:
type: array
items:
type: string
owner:
type: object
properties:
github:
type: string
type:
type: string
enum:
- elastic
- partner
- community
required:
- github
agent:
type: object
properties:
privileges:
type: object
properties:
root:
type: boolean
asset_tags:
type: array
items:
type: object
properties:
text:
type: string
asset_types:
type: array
items:
type: string
asset_ids:
type: array
items:
type: string
required:
- text
discovery:
type: object
properties:
fields:
type: array
items:
type: object
properties:
name:
type: string
required:
- name
required:
- name
- title
Expand All @@ -4347,6 +4401,7 @@ components:
- format_version
- download
- path
- owner
package_usage_stats:
title: Package usage stats
type: object
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ properties:
type: string
type:
type: string
enum:
- integration
- input
- content
categories:
type: array
items:
Expand Down Expand Up @@ -131,6 +135,56 @@ properties:
type: array
items:
type: string
owner:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a few more package spec properties that weren't added to the openapi spec docs

type: object
properties:
github:
type: string
type:
type: string
enum:
- elastic
- partner
- community
required:
- github
agent:
type: object
properties:
privileges:
type: object
properties:
root:
type: boolean
asset_tags:
type: array
items:
type: object
properties:
text:
type: string
asset_types:
type: array
items:
type: string
asset_ids:
type: array
items:
type: string
required:
- text
discovery:
type: object
properties:
fields:
type: array
items:
type: object
properties:
name:
type: string
required:
- name
required:
- name
- title
Expand All @@ -143,3 +197,4 @@ required:
- format_version
- download
- path
- owner
9 changes: 7 additions & 2 deletions x-pack/plugins/fleet/common/types/models/package_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface PackageSpecManifest {
source?: {
license: string;
};
type?: 'integration' | 'input';
type?: PackageSpecPackageType;
release?: 'experimental' | 'beta' | 'ga';
categories?: Array<PackageSpecCategory | undefined>;
conditions?: PackageSpecConditions;
Expand All @@ -35,14 +35,19 @@ export interface PackageSpecManifest {
privileges?: { root?: boolean };
};
asset_tags?: PackageSpecTags[];
discovery?: {
fields?: Array<{
name: string;
}>;
};
}
export interface PackageSpecTags {
text: string;
asset_types?: string[];
asset_ids?: string[];
}

export type PackageSpecPackageType = 'integration' | 'input';
export type PackageSpecPackageType = 'integration' | 'input' | 'content';

export type PackageSpecCategory =
| 'advanced_analytics_ueba'
Expand Down