Skip to content

Commit 5d600c1

Browse files
Merge pull request #130 from splunk/release/1.10.0
release/1.10.0
2 parents 3108379 + b119573 commit 5d600c1

File tree

462 files changed

+66928
-52830
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

462 files changed

+66928
-52830
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
SPLUNK_HOME="/opt/splunk"

.github/workflows/release.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Create Release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish-npm:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- uses: actions/setup-node@v2
13+
with:
14+
node-version: 14
15+
registry-url: https://registry.npmjs.org/
16+
- run: npm publish
17+
env:
18+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Node.js CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
runs-on: ${{ matrix.os }}
8+
9+
strategy:
10+
matrix:
11+
os:
12+
- ubuntu-latest
13+
node:
14+
- 14
15+
- 8.17.0
16+
splunk-version:
17+
- "8.0"
18+
- "latest"
19+
20+
services:
21+
splunk:
22+
image: splunk/splunk:${{matrix.splunk-version}}
23+
env:
24+
SPLUNK_START_ARGS: --accept-license
25+
SPLUNK_HEC_TOKEN: 11111111-1111-1111-1111-1111111111113
26+
SPLUNK_PASSWORD: changed!
27+
SPLUNK_APPS_URL: https://github.com/splunk/sdk-app-collection/releases/download/v1.0.0/sdk-app-collection.tgz
28+
ports:
29+
- 8000:8000
30+
- 8088:8088
31+
- 8089:8089
32+
33+
steps:
34+
- uses: actions/checkout@v2
35+
36+
- name: Use node ${{ matrix.node }}
37+
uses: actions/setup-node@v2
38+
with:
39+
node-version: ${{ matrix.node }}
40+
41+
- name: Create .splunkrc file
42+
run: |
43+
cd ~
44+
echo host=localhost > .splunkrc
45+
echo port=8089 >> .splunkrc
46+
echo username=admin >> .splunkrc
47+
echo password=changed! >> .splunkrc
48+
echo scheme=https >> .splunkrc
49+
echo version=${{ matrix.splunk }} >> .splunkrc
50+
51+
- name: Run npm install
52+
run: npm install
53+
54+
- name: Run make test
55+
run: make test
56+
env:
57+
SPLUNK_HOME: /opt/splunk

.travis.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

CHANGELOG.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,29 @@
11
# Splunk Enterprise SDK for JavaScript Changelog
22

3+
## v1.10.0
4+
5+
### Major changes
6+
* Dropped support for deprecated request http client.
7+
* Added support for [needle](https://www.npmjs.com/package/needle) http client library.
8+
9+
### Minor changes
10+
11+
* Added support for Splunk Enterprise 8.2
12+
* Added support for Node v14.
13+
* Dropped support for deprecated nodeunit testing library.
14+
* Added support for [mocha](https://www.npmjs.com/package/mocha) for testing and [chai](https://www.npmjs.com/package/chai) for assertions.
15+
* Updated `cookie` dependency version to `0.4.1`
16+
* Updated `elementtree` dependency version to `0.1.7`
17+
* Updated `browserify` dependency version to `17.0.0`
18+
* Updated `jshint` dependency version to `2.13.0`
19+
* Updated `mustache` dependency version to `4.2.0`
20+
* Updated `readable-stream` dependency version to `3.6.0`
21+
* Updated `uglify-js` dependency version to `3.13.8`
22+
* Added support for `[email protected]` to declared env variables.
23+
* Added support for `[email protected]` to generate test report.
24+
* Fixed the Buffer and new Buffer() deprecation warnings appeared when running the tests.
25+
* Added support for running single test file and test case. Run `make test_specific` for more info.
26+
327
## v1.9.1
428

529
### Minor changes

CREDITS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ Some of the components included in the Splunk Enterprise SDK for JavaScript are
1414
| [commander](https://github.com/visionmedia/commander.js/) | Node.js command-line interfaces | [MIT](https://github.com/splunk/splunk-sdk-javascript/blob/master/licenses/LICENSE-COMMANDER) |
1515
| [script.js](https://github.com/ded/script.js/) | Asyncronous JavaScript loader and dependency manager | [Apache](https://github.com/splunk/splunk-sdk-javascript/blob/master/licenses/LICENSE-SCRIPTJS) |
1616
| [base64.js](http://code.google.com/p/javascriptbase64/) | Fast base64 encoding/decoding | [MIT](https://github.com/splunk/splunk-sdk-javascript/blob/master/licenses/LICENSE-BASE64) |
17+
| [dotenv](https://github.com/motdotla/dotenv) | Loads environment varibles from .env file | [BSD 2-Clause](https://github.com/splunk/splunk-sdk-javascript/blob/master/licenses/LICENSE-DOTENV) |
18+
| [cookie](https://github.com/jshttp/cookie) | HTTP cookie parser and serializer for HTTP servers | [MIT](https://github.com/splunk/splunk-sdk-javascript/blob/master/licenses/LICENSE-COOKIE) |
19+
| [elementtree](https://github.com/racker/node-elementtree) | Node.js XML parserer and serializer | [Apache-2.0](https://github.com/splunk/splunk-sdk-javascript/blob/master/licenses/LICENSE-ELEMENTTREE) |
20+
| [needle](https://github.com/tomas/needle) | Node.js http client | [MIT](https://github.com/splunk/splunk-sdk-javascript/blob/master/licenses/LICENSE-NEEDLE) |

Makefile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# text reset
2+
NO_COLOR=\033[0m
3+
# green
4+
OK_COLOR=\033[32;01m
5+
# red
6+
ERROR_COLOR=\033[31;01m
7+
# cyan
8+
WARN_COLOR=\033[36;01m
9+
# yellow
10+
ATTN_COLOR=\033[33;01m
11+
12+
ROOT_DIR := $(shell git rev-parse --show-toplevel)
13+
14+
VERSION := `git describe --tags --dirty 2>/dev/null`
15+
COMMITHASH := `git rev-parse --short HEAD 2>/dev/null`
16+
DATE := `date "+%FT%T%z"`
17+
18+
.PHONY: all
19+
all: init test
20+
21+
init:
22+
@echo "$(ATTN_COLOR)==> init $(NO_COLOR)"
23+
24+
.PHONY: test
25+
test:
26+
@echo "$(ATTN_COLOR)==> test $(NO_COLOR)"
27+
@node sdkdo tests ${arg}
28+
29+
.PHONY: test_specific
30+
test_specific:
31+
@echo "$(ATTN_COLOR)==> test_specific $(NO_COLOR)"
32+
@sh ./scripts/test_specific.sh
33+
34+
.PHONY: up
35+
up:
36+
@echo "$(ATTN_COLOR)==> up $(NO_COLOR)"
37+
@docker-compose up -d
38+
39+
.PHONY: wait_up
40+
wait_up:
41+
@echo "$(ATTN_COLOR)==> wait_up $(NO_COLOR)"
42+
@for i in `seq 0 180`; do if docker exec -it splunk /sbin/checkstate.sh &> /dev/null; then break; fi; printf "\rWaiting for Splunk for %s seconds..." $$i; sleep 1; done
43+
44+
.PHONY: down
45+
down:
46+
@echo "$(ATTN_COLOR)==> down $(NO_COLOR)"
47+
@docker-compose stop

README.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
[![Build Status](https://travis-ci.org/splunk/splunk-sdk-javascript.svg?branch=master)](https://travis-ci.org/splunk/splunk-sdk-javascript)
22
# The Splunk Enterprise Software Development Kit for JavaScript
33

4-
#### Version 1.9.1
4+
#### Version 1.10.0
55

66
The Splunk Enterprise Software Development Kit (SDK) for JavaScript contains library code and examples designed to enable developers to build applications using the Splunk platform and JavaScript. This SDK supports server-side and client-side JavaScript.
77

88
For more information, see [Splunk Enterprise SDK for JavaScript](https://dev.splunk.com/enterprise/docs/devtools/javascript/sdk-javascript/) on the Splunk Developer Portal.
99

1010
## Requirements
1111

12-
* Node.js v 0.12, or v4 or later
12+
* Node.js v 8.17.0, or v14 or later
1313

14-
The Splunk Enterprise SDK for JavaScript was tested with Node.js v.0.12, v4.2, and v10.0.
14+
The Splunk Enterprise SDK for JavaScript was tested with Node.js v8.17.0, v14.
1515

16-
* Splunk Enterprise 6.3.0 or later, or Splunk Cloud
16+
* Splunk Enterprise 8.0 or 8.2, or Splunk Cloud
1717

18-
The Splunk Enterprise SDK for JavaScript was tested with Splunk Enterprise 7.0 and 7.2.
18+
The Splunk Enterprise SDK for JavaScript was tested with Splunk Enterprise 8.0 or 8.2, or Splunk Cloud.
1919

2020
* Splunk Enterprise SDK for JavaScript
2121

@@ -61,13 +61,13 @@ The following examples show you how to list search jobs using client-side and se
6161
### Client-side code example
6262

6363
This HTML example uses the Splunk Enterprise SDK for JavaScript to list all jobs:
64-
64+
```javascript
6565
<script type="text/javascript" src="splunk.js"></script>
6666
<script type="text/javascript" src="jquery.min.js"></script>
6767

6868
<script type="text/javascript" charset="utf-8">
6969

70-
var service = new splunkjs.Service({username: "admin", password: "changeme"});
70+
var service = new splunkjs.Service({username: "admin", password: "changed!"});
7171
service.login(function(err, success) {
7272
if (err) {
7373
throw err;
@@ -83,14 +83,16 @@ This HTML example uses the Splunk Enterprise SDK for JavaScript to list all jobs
8383
});
8484

8585
</script>
86+
```
8687

8788
### Node.js code example
8889

8990
This example shows how to use the Splunk Enterprise SDK for JavaScript and Node.js to list all jobs:
9091

92+
```javascript
9193
var splunkjs = require('splunk-sdk');
9294

93-
var service = new splunkjs.Service({username: "admin", password: "changeme"});
95+
var service = new splunkjs.Service({username: "admin", password: "changed!"});
9496
service.login(function(err, success) {
9597
if (err) {
9698
throw err;
@@ -104,6 +106,7 @@ This example shows how to use the Splunk Enterprise SDK for JavaScript and Node.
104106
}
105107
});
106108
});
109+
```
107110

108111
## SDK examples
109112

@@ -125,11 +128,11 @@ To use this convenience file, create a text file with the following format:
125128
# Splunk Enterprise username
126129
username=admin
127130
# Splunk Enterprise password
128-
password=changeme
131+
password=changed!
129132
# Access scheme (default: https)
130133
scheme=https
131134
# Your version of Splunk Enterprise
132-
version=7.2
135+
version=8.2
133136

134137
Save the file as **.splunkrc** in the current user's home directory.
135138

@@ -209,6 +212,10 @@ To run the HTTP and the Async tests, enter:
209212

210213
node sdkdo tests http,async
211214

215+
To run tests containing a particular string, enter:
216+
217+
node sdkdo tests --grep "While success"
218+
212219
To run the browser tests, enter:
213220

214221
node sdkdo tests-browser
@@ -217,9 +224,13 @@ To run all unit tests without log messages, enter:
217224

218225
node sdkdo tests --quiet
219226

220-
To run all the tests and generate JUnit compatible XML in **splunk-sdk-javascript/test_logs/junit_test_results.xml**, enter:
227+
To run all the tests and generate test report in **splunk-sdk-javascript/mochawesome-report/mochawesome.html**, enter:
228+
229+
node sdkdo tests --reporter mochawesome
230+
231+
To get more info to run tests, enter:
221232

222-
node sdkdo tests --reporter junit
233+
make test_specific
223234

224235
## Repository
225236

0 commit comments

Comments
 (0)