Skip to content

Commit

Permalink
Fix type errors with an offering to the CI gods
Browse files Browse the repository at this point in the history
  • Loading branch information
rw-access committed Feb 23, 2021
1 parent bc57209 commit b4c2267
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 6 deletions.
6 changes: 5 additions & 1 deletion x-pack/plugins/fleet/common/types/models/epm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ export type EpmPackageInstallStatus = 'installed' | 'installing';
export type DetailViewPanelName = 'overview' | 'policies' | 'settings' | 'custom';
export type ServiceName = 'kibana' | 'elasticsearch';
export type AgentAssetType = typeof agentAssetTypes;
export type AssetType = KibanaAssetType | ElasticsearchAssetType | ValueOf<AgentAssetType> | 'rules';
export type AssetType =
| KibanaAssetType
| ElasticsearchAssetType
| ValueOf<AgentAssetType>
| 'rules';

/*
Enum mapping of a saved object asset type to how it would appear in a package file path (snake cased)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const AssetTitleMap: Record<AssetType, string> = {
map: 'Map',
data_stream_ilm_policy: 'Data Stream ILM Policy',
lens: 'Lens',
rules: 'Detection Rules'
rules: 'Detection Rules',
};

export const ServiceTitleMap: Record<ServiceName, string> = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ export const getPrePackagedRulesStatus = async ({
rules_installed: 12,
rules_not_installed: 0,
rules_not_updated: 0,
rules_package_version: null,
timelines_installed: 0,
timelines_not_installed: 0,
timelines_not_updated: 0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ export const duplicateRules = async ({ rules }: DuplicateRulesProps): Promise<Bu
* @throws An error if response is not OK
*/
export const createPrepackagedRules = async ({
pkgVersion,
pkgVersion = null,
signal,
}: {
pkgVersion: string | undefined | null;
pkgVersion?: string | null | undefined;
signal: AbortSignal;
}): Promise<{
rules_installed: number;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const createMockConfig = () => ({
to: 'now',
},
packagerTaskInterval: '60s',
usePackageRegistryRules: false,
validateArtifactDownloads: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const addPrepackedRulesRoute = (
frameworkRequest,
config.maxTimelineImportExportSize,
undefined,
request.body.rules_package_version
request.body?.rules_package_version || undefined
);
return response.ok({ body: validated ?? {} });
} catch (err) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ export const checkAndStageUpdate = async () => {
}

try {
const registryPackage = await fetchFindLatestPackage(DetectionRulesPackageName);
const registryPackage = await fetchFindLatestPackage(DETECTION_RULES_PACKAGE_NAME);
if (!latestRulesPackageVersion || registryPackage.version !== latestRulesPackageVersion) {
// automatically download and cache the latest in memory
const downloaded = await getPackageRegistryRules(registryPackage.version);
Expand Down

0 comments on commit b4c2267

Please sign in to comment.