npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@gbaud/kibana-client

v1.1.1

Published

Kibana client for Kibana API usage

Downloads

7

Readme

Kibana Client

This package is used to connect and chat with the Kibana API

Here is the list of currently implemented endpoints:

// https://www.elastic.co/guide/en/kibana/current/cases-api-add-comment.html
addCommentToCase(caseId: string, commentInput: CommentInput): Promise<Case> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-create.html
createCase(caseInput: CaseInput): Promise<Case> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-delete-cases.html
deleteCases(caseIds: string[]): Promise<boolean> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-delete-comments.html
deleteCommentFromCase(caseId: string, commentId: string): Promise<boolean> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-delete-comments.html
deleteAllCommentsFromCase(caseId: string): Promise<boolean> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-find-cases.html
findCases(findCasesQuery: FindCasesQuery): Promise<Case[]> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-find-connectors.html
findConnectors(): Promise<Connector[]> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-get-alerts.html
getCaseAlerts(caseId: string): Promise<Alert[]> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-get-case.html
getCase(caseId: string, includeComments: boolean = true): Promise<Case> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-get-status.html
getCaseStatus(caseId: string, owners?: OwnerType[]): Promise<CaseStatus> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-get-cases-by-alert.html
getCasesByAlert(alertId: string, owners?: OwnerType[]): Promise<CaseStatus> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-get-comments.html
getCaseComment(caseId: string, commentId: string): Promise<Comment> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-get-comments.html
getReporters(owners?: OwnerType[]): Promise<User[]> {}

// https://www.elastic.co/guide/en/kibana/current/cases-api-get-tag.html
getTags(owners?: OwnerType[]): Promise<string[]> {}

Examples :


// Setup client configuration :
const config: KibanaConfig = new KibanaConfig("http://localhost:5601", "elastic", "elastic", "default");
const client: KibanaClient = new KibanaClient(config);

// Exemple case :
const newCase: CaseInput = {
	assignees: [],
	connector: {
		fields: null,
		id: "none",
		name: "none",
		type: ConnectorType.NONE
	},
	description: "No description",
	owner: OwnerType.SECURITY_SOLUTION,
	settings: {
		syncAlerts: true
	},
	severity: Severity.HIGH,
	tags: ["example_tag"],
	title: "Case Title"
};

// Create new case:
await client.createCase(newCase).then(async value => {

	// Delete the case:
	const caseId = value.id;
	await client.deleteCases([case_id]).then((r: boolean) = {
		console.log(`Delete case ${case_id}`);
	}).catch(e => console.log(e));
}).catch(e => console.log(e));