Skip to content

Commit

Permalink
Initial commit with client
Browse files Browse the repository at this point in the history
Defining and exporting types `application` and `mount` to be utilized
and implemented.

Published with
```
npm publish --access public
```

Example publish:
https://www.npmjs.com/package/@avillk/opensearch-dashboards-sdk

Example of working solution of consuming the SDK:
https://github.com/kavilla/OpenSearch-Dashboards-1/tree/avillk/consume-sdk-2

Generate docs with the following:
```
yarn gen:doc
```

Issue Resolved:
opensearch-project#42

Signed-off-by: Kawika Avilla <[email protected]>
  • Loading branch information
kavilla committed May 23, 2023
1 parent fe8f0f5 commit 7b20940
Show file tree
Hide file tree
Showing 32 changed files with 3,677 additions and 8 deletions.
5 changes: 5 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
npm-debug.log
test/benchmarks
opensearch
.git
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
coverage
26 changes: 26 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"env": {
"node": true,
"es6": true
},
"extends": [
"eslint:recommended",
"prettier"
],
"parser": "babel-eslint",
"plugins": [
"prettier"
],
"rules": {
"prettier/prettier": [
"error",
{
"endOfLine": "auto"
}
],
/*temporarily turn off no-unused-vars, open an issue to track https://github.com/opensearch-project/opensearch-js/issues/241*/
"no-unused-vars": "off",
/*temporarily turn off no-dupe-else-if, open an issue to track https://github.com/opensearch-project/opensearch-js/issues/240*/
"no-dupe-else-if": "off"
}
}
7 changes: 5 additions & 2 deletions .github/.codecov.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# https://docs.codecov.com/docs/codecov-yaml
codecov:
require_ci_to_pass: yes

coverage:
status:
project:
default:
# https://docs.codecov.com/docs/commit-status#target
target: auto # coverage must be equal or above the previous commit
target: auto
threshold: 2% # the leniency in hitting the target
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
32 changes: 32 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
node_modules/
docs/
reports/
tmp/
wiki/
generator-oui/
test/
src-docs/
packages/react-datepicker
packages/eslint-plugin
.nvmrc

# typescript output
types/

# ignore everything in `scripts` except postinstall.js
scripts/!(postinstall.js)

src/**/*.!(scss)

.DS_Store
.eslintcache
.idea
.vscode
.yo-rc.json
package-lock.json
npm-debug.log
.cache-loader
*.md
yarn-error.log
tsconfig.json
tsconfig-builttypes.json
5 changes: 5 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"trailingComma": "es5",
"printWidth": 100
}
11 changes: 11 additions & 0 deletions .typedoc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://typedoc.org/schema.json",
"entryPoints": [
"./lib/application/index.d.ts",
"./lib/mount/index.d.ts",
],
"tsconfig": "./tsconfig.json",
"out": "./docs",
"gitRemote": "upstream",
"exclude": ["**/node_modules/**"]
}
4 changes: 0 additions & 4 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@ Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
OpenSearch (https://opensearch.org/)
Copyright OpenSearch Contributors

This product includes software developed by
Elasticsearch (http://www.elastic.co).
Copyright 2009-2018 Elasticsearch

This product includes software developed by The Apache Software
Foundation (http://www.apache.org/).

Expand Down
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@
- [Copyright](#copyright)

## Introduction
Opensearch Dashboards plugins have allowed the extension and ehancements of various core features however, current plugin architecture carries the risk of fatally impacting clusters should they fail. In order to ensure that plugins may run safely without impacting the system, our goal is to effectively isolate plugin interactions with OpenSearch Dashboards by modularizing the extension points to which they hook onto.
OpenSearch Dashboards plugins have allowed the extension and enhancements of various core features however, current plugin architecture carries the risk of fatally impacting clusters should they fail. In order to ensure that plugins may run safely without impacting the system, our goal is to effectively isolate plugin interactions with OpenSearch Dashboards by modularizing the extension points to which they hook onto.

## Contributing
See [CONTRIBUTING](CONTRIBUTING.md)

## Developer Guide
TODO
* Clone this project
* Run `yarn`
* Within OpenSearch Dashboards, run `yarn add link:${path to this repo}/opensearch-dashboards-sdk-js --dev`

## Design
TODO

Expand Down
1 change: 1 addition & 0 deletions docs/.nojekyll
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false.
41 changes: 41 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
@opensearch-project/opensearch-dashboards-sdk / [Modules](modules.md)

# OpenSearch Dashboards SDK for JS

- [Introduction](#introduction)
- [Contributing](#contributing)
- [Developer Guide](#developer-guide)
- [Design](#design)
- [Maintainers](#maintainers)
- [Code of Conduct](#code-of-conduct)
- [License](#license)
- [Copyright](#copyright)

## Introduction
OpenSearch Dashboards plugins have allowed the extension and enhancements of various core features however, current plugin architecture carries the risk of fatally impacting clusters should they fail. In order to ensure that plugins may run safely without impacting the system, our goal is to effectively isolate plugin interactions with OpenSearch Dashboards by modularizing the extension points to which they hook onto.

## Contributing
See [CONTRIBUTING](CONTRIBUTING.md)

## Developer Guide
* Clone this project
* Run `yarn`
* Within OpenSearch Dashboards, run `yarn add link:${path to this repo}/opensearch-dashboards-sdk-js --dev`

## Design
TODO

## Maintainers
See [MAINTAINERS](MAINTAINERS.md)

## Code of Conduct

This project has adopted the [Amazon Open Source Code of Conduct](CODE_OF_CONDUCT.md). For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq), or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

## License

This project is licensed under the [Apache v2.0 License](LICENSE).

## Copyright

Copyright OpenSearch Contributors. See [NOTICE](NOTICE) for details.
56 changes: 56 additions & 0 deletions docs/interfaces/application.AppLeaveActionFactory.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
[@opensearch-project/opensearch-dashboards-sdk](../README.md) / [Modules](../modules.md) / [application](../modules/application.md) / AppLeaveActionFactory

# Interface: AppLeaveActionFactory

[application](../modules/application.md).AppLeaveActionFactory

Factory provided when invoking a [AppLeaveHandler](../modules/application.md#appleavehandler) to retrieve the [AppLeaveAction](../modules/application.md#appleaveaction) to execute.

## Table of contents

### Methods

- [confirm](application.AppLeaveActionFactory.md#confirm)
- [default](application.AppLeaveActionFactory.md#default)

## Methods

### confirm

**confirm**(`text`, `title?`): [`AppLeaveConfirmAction`](application.AppLeaveConfirmAction.md)

Returns a confirm action, resulting on prompting a message to the user before leaving the
application, allowing him to choose if he wants to stay on the app or confirm that he
wants to leave.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `text` | `string` | The text to display in the confirmation message |
| `title?` | `string` | (optional) title to display in the confirmation message |

#### Returns

[`AppLeaveConfirmAction`](application.AppLeaveConfirmAction.md)

#### Defined in

[application/app_leave.ts:77](https://github.com/opensearch-project/opensearch-dashboards-sdk-js/blob/8190d60/lib/application/app_leave.ts#L77)

___

### default

**default**(): [`AppLeaveDefaultAction`](application.AppLeaveDefaultAction.md)

Returns a default action, resulting on executing the default behavior when
the user tries to leave an application

#### Returns

[`AppLeaveDefaultAction`](application.AppLeaveDefaultAction.md)

#### Defined in

[application/app_leave.ts:82](https://github.com/opensearch-project/opensearch-dashboards-sdk-js/blob/8190d60/lib/application/app_leave.ts#L82)
48 changes: 48 additions & 0 deletions docs/interfaces/application.AppLeaveConfirmAction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[@opensearch-project/opensearch-dashboards-sdk](../README.md) / [Modules](../modules.md) / [application](../modules/application.md) / AppLeaveConfirmAction

# Interface: AppLeaveConfirmAction

[application](../modules/application.md).AppLeaveConfirmAction

Action to return from a [AppLeaveHandler](../modules/application.md#appleavehandler) to show a confirmation
message when trying to leave an application.

See [AppLeaveActionFactory](application.AppLeaveActionFactory.md)

## Table of contents

### Properties

- [text](application.AppLeaveConfirmAction.md#text)
- [title](application.AppLeaveConfirmAction.md#title)
- [type](application.AppLeaveConfirmAction.md#type)

## Properties

### text

**text**: `string`

#### Defined in

[application/app_leave.ts:52](https://github.com/opensearch-project/opensearch-dashboards-sdk-js/blob/8190d60/lib/application/app_leave.ts#L52)

___

### title

`Optional` **title**: `string`

#### Defined in

[application/app_leave.ts:53](https://github.com/opensearch-project/opensearch-dashboards-sdk-js/blob/8190d60/lib/application/app_leave.ts#L53)

___

### type

**type**: `confirm`

#### Defined in

[application/app_leave.ts:51](https://github.com/opensearch-project/opensearch-dashboards-sdk-js/blob/8190d60/lib/application/app_leave.ts#L51)
26 changes: 26 additions & 0 deletions docs/interfaces/application.AppLeaveDefaultAction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
[@opensearch-project/opensearch-dashboards-sdk](../README.md) / [Modules](../modules.md) / [application](../modules/application.md) / AppLeaveDefaultAction

# Interface: AppLeaveDefaultAction

[application](../modules/application.md).AppLeaveDefaultAction

Action to return from a [AppLeaveHandler](../modules/application.md#appleavehandler) to execute the default
behaviour when leaving the application.

See [AppLeaveActionFactory](application.AppLeaveActionFactory.md)

## Table of contents

### Properties

- [type](application.AppLeaveDefaultAction.md#type)

## Properties

### type

**type**: `default`

#### Defined in

[application/app_leave.ts:39](https://github.com/opensearch-project/opensearch-dashboards-sdk-js/blob/8190d60/lib/application/app_leave.ts#L39)
Loading

0 comments on commit 7b20940

Please sign in to comment.