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

fix: use correct type for kibana version #818

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"@types/micromatch": "^4.0.2",
"@types/node": "^16.11.59",
"@types/sharp": "^0.28.6",
"@types/semver": "^7",
"@typescript-eslint/eslint-plugin": "^5.38.0",
"@typescript-eslint/parser": "^5.38.0",
"eslint": "^8.23.1",
Expand Down
2 changes: 1 addition & 1 deletion src/common_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ export type RunOptions = BaseArgs & {
export type PushOptions = Partial<ProjectSettings> &
Partial<BaseArgs> & {
auth: string;
kibanaVersion?: number;
kibanaVersion?: string;
yes?: boolean;
};

Expand Down
2 changes: 1 addition & 1 deletion src/push/kibana_api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export async function bulkDeleteMonitors(

type StatusResponse = {
version: {
number: number;
number: string;
};
};

Expand Down
4 changes: 2 additions & 2 deletions src/push/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export function generateURL(options: PushOptions, operation: Operation) {
/**
* Bulk API is supported for push monitors only from 8.6.0 and above
*/
export function isBulkAPISupported(version: number) {
export function isBulkAPISupported(version: string) {
return semver.satisfies(version, '>=8.6.0');
}

Expand All @@ -103,6 +103,6 @@ export function isLightweightMonitorSupported(
* Lighweight monitor param options are supported only from
* 8.7.2 and above
*/
export function isParamOptionSupported(version: number) {
export function isParamOptionSupported(version: string) {
return semver.satisfies(version, '>=8.7.2');
}