diff --git a/.gitignore b/.gitignore index 6aeaf8f8e..378959f7b 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,6 @@ cover_html .splunkrc *.zip test_logs/* -docs/ \ No newline at end of file +docs/ +.vscode/ +*.tgz \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e6c0ed3f..9ddcbb884 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,21 +2,17 @@ ## How to contribute -If you would like to contribute to this project, go here for more information: - -* [Splunk and open source][contributions] -* [Individual contributions][indivcontrib] -* [Company contributions][companycontrib] +If you would like to contribute to this project, see [Contributions to Splunk][indivcontrib] for more information. ## Issues & Bug Reports If you're seeing some unexpected behavior with this project, please create an [issue on GitHub][issues] with the following information: -0. Version of this project you're using (ex: 1.7.1) -0. Platform version (ex: Windows Server 2012) -0. Framework version (ex: Node.js 0.10.37) or Browser (ex: Chrome 43.0.2357.81) -0. Splunk version (ex: 6.2.2) -0. Other relevant information (ex: local/remote environment, Splunk network configuration) +1. Version of this project you're using (ex: 1.7.1) +1. Platform version (ex: Windows Server 2012) +1. Framework version (ex: Node.js 0.10.37) or Browser (ex: Chrome 43.0.2357.81) +1. Splunk version (ex: 6.2.2) +1. Other relevant information (ex: local/remote environment, Splunk network configuration) Alternatively, if you have a Splunk question please ask on [Splunk Answers][answers] @@ -26,14 +22,14 @@ We love to see pull requests! To create a pull request: -0. Fill out the [Individual Contributor Agreement][indivcontrib]. -0. Fork [the repository][repo]. -0. Make changes to the **`develop`** branch, preferably with tests. -0. Create a [pull request][pulls] against the **`develop`** branch. +1. Fill out the [Individual Contributor Agreement][indivcontrib]. +1. Fork [the repository][repo]. +1. Make changes to the **`develop`** branch, preferably with tests. +1. Create a [pull request][pulls] against the **`develop`** branch. ## Contact us -You can reach Splunk support at _support@splunk.com_ if you have Splunk related questions. +You can [contact support][contact] if you have Splunk related questions. You can reach the Developer Platform team at _devinfo@splunk.com_. @@ -43,4 +39,5 @@ You can reach the Developer Platform team at _devinfo@splunk.com_. [answers]: http://answers.splunk.com/ [repo]: https://github.com/splunk/splunk-sdk-javascript [issues]: https://github.com/splunk/splunk-sdk-javascript/issues -[pulls]: https://github.com/splunk/splunk-sdk-javascript/pulls \ No newline at end of file +[pulls]: https://github.com/splunk/splunk-sdk-javascript/pulls +[contact]: https://www.splunk.com/en_us/support-and-services.html diff --git a/README.md b/README.md index 104100f15..eec4eb924 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ JavaScript. This SDK supports both server- and client-side JavaScript. ## Requirements -* Node.js v.0.12, or v4 or later. The Splunk SDK for Javascript is tested with Node.js v.0.12, v4.2, and v10.0. +* Node.js v.0.12, or v4 or later. The Splunk SDK for Javascript is tested with Node.js v.0.12, v4.2, and v10.0, as well as with Typescript 3.8. * Splunk Enterprise 6.3.0 or later, or Splunk Cloud. The Splunk SDK for Javascript is tested with Splunk Enterprise 7.0 and 7.2. ## Installation @@ -57,6 +57,12 @@ code: var splunkjs = require('splunk-sdk'); +Or, to include the Splunk SDK in your Typescript project, use the `import` function in your code: + + ```typescript + import * as splunk from "splunk-sdk"; + ``` + ## Usage The following examples show you how to list search jobs using client-side and @@ -110,6 +116,47 @@ jobs: }); }); +### Typescript code example + +This example shows how to use the Splunk SDK for Javascript in a Typescript project: + + ```typescript + import * as splunk from "splunk-sdk"; + + const service = new splunk.Service({username: "admin", password: "changeme"}); + + service.login((err, success) => { + if (err) { + throw err; + } + + console.log("Login was successful: " + success); + service.jobs().fetch((err, jobs) => { + const jobList = jobs.list(); + for(let i = 0; i < jobList.length; i++) { + console.log("Job " + i + ": " + jobList[i].sid); + } + }); + }); + ``` + +Here is a good example of a `tslint.json` configuration that works well with this library and doesn't spit out too many errors, since these are basic Typescript definitions. Note that allowing the `var` keyword, as well as not using arrow functions makes typescript behave less predictably: + + ```json + { + "defaultSeverity": "error", + "extends": [ + "tslint:recommended" + ], + "jsRules": {}, + "rules": { + "no-var-keyword": false, + "only-arrow-functions": false, + "no-console": false + }, + "rulesDirectory": [] + ``` + ## SDK examples The Splunk SDK for JavaScript contains several server- and client-based examples. @@ -251,6 +298,11 @@ To run all the tests and generate JUnit compatible XML in `splunk-sdk-javascript
+ * Splunk.namespace("property.package");
+ * Splunk.namespace("Splunk.property.package");
+ *
+ * Either of the above would create Splunk.property, then
+ * Splunk.property.package
+ *
+ * @method namespace
+ * @static
+ * @param {String} name A "." delimited namespace to create
+ * @return {Object} A reference to the last namespace object created
+ */
+ namespace(name: string): any;
+};
diff --git a/dist/lib/ui/charting/util.d.ts b/dist/lib/ui/charting/util.d.ts
new file mode 100644
index 000000000..6a5c34ec6
--- /dev/null
+++ b/dist/lib/ui/charting/util.d.ts
@@ -0,0 +1 @@
+export function sprintf(...args: any[]): any;
diff --git a/dist/lib/ui/timeline.d.ts b/dist/lib/ui/timeline.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/lib/ui/timeline.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/lib/ui/timeline/format.d.ts b/dist/lib/ui/timeline/format.d.ts
new file mode 100644
index 000000000..26ff1d7a5
--- /dev/null
+++ b/dist/lib/ui/timeline/format.d.ts
@@ -0,0 +1,6 @@
+export function formatNumber(num: any): any;
+export function formatNumericString(strSingular: any, strPlural: any, num: any): any;
+export function formatDate(time: any, timeZoneOffset: any, dateFormat: any): string;
+export function formatTime(time: any, timeZoneOffset: any, timeFormat: any): string;
+export function formatDateTime(time: any, timeZoneOffset: any, dateFormat: any, timeFormat: any): string;
+export function formatTooltip(earliestTime: any, latestTime: any, earliestOffset: any, latestOffset: any, eventCount: any): string;
diff --git a/dist/lib/ui/timeline/jg_global.d.ts b/dist/lib/ui/timeline/jg_global.d.ts
new file mode 100644
index 000000000..e69de29bb
diff --git a/dist/lib/ui/timeline/splunk_time.d.ts b/dist/lib/ui/timeline/splunk_time.d.ts
new file mode 100644
index 000000000..22b070bca
--- /dev/null
+++ b/dist/lib/ui/timeline/splunk_time.d.ts
@@ -0,0 +1,2 @@
+export = jg_global;
+declare var jg_global: any;
diff --git a/dist/lib/ui/timeline/splunk_timeline.d.ts b/dist/lib/ui/timeline/splunk_timeline.d.ts
new file mode 100644
index 000000000..22b070bca
--- /dev/null
+++ b/dist/lib/ui/timeline/splunk_timeline.d.ts
@@ -0,0 +1,2 @@
+export = jg_global;
+declare var jg_global: any;
diff --git a/dist/lib/utils.d.ts b/dist/lib/utils.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/lib/utils.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/app.d.ts b/dist/tests/service_tests/app.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/app.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/collection.d.ts b/dist/tests/service_tests/collection.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/collection.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/configuration.d.ts b/dist/tests/service_tests/configuration.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/configuration.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/datamodels.d.ts b/dist/tests/service_tests/datamodels.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/datamodels.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/endpoint.d.ts b/dist/tests/service_tests/endpoint.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/endpoint.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/entity.d.ts b/dist/tests/service_tests/entity.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/entity.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/firedalerts.d.ts b/dist/tests/service_tests/firedalerts.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/firedalerts.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/indexes.d.ts b/dist/tests/service_tests/indexes.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/indexes.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/job.d.ts b/dist/tests/service_tests/job.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/job.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/namespace.d.ts b/dist/tests/service_tests/namespace.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/namespace.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/parser.d.ts b/dist/tests/service_tests/parser.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/parser.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/pivot.d.ts b/dist/tests/service_tests/pivot.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/pivot.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/properties.d.ts b/dist/tests/service_tests/properties.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/properties.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/savedsearch.d.ts b/dist/tests/service_tests/savedsearch.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/savedsearch.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/serverinfo.d.ts b/dist/tests/service_tests/serverinfo.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/serverinfo.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/storagepasswords.d.ts b/dist/tests/service_tests/storagepasswords.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/storagepasswords.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/typeahead.d.ts b/dist/tests/service_tests/typeahead.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/typeahead.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/user.d.ts b/dist/tests/service_tests/user.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/user.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/service_tests/view.d.ts b/dist/tests/service_tests/view.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/service_tests/view.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/test_async.d.ts b/dist/tests/test_async.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/test_async.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/test_context.d.ts b/dist/tests/test_context.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/test_context.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/test_examples.d.ts b/dist/tests/test_examples.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/test_examples.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/test_http.d.ts b/dist/tests/test_http.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/test_http.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/dist/tests/test_service.d.ts b/dist/tests/test_service.d.ts
new file mode 100644
index 000000000..d9f15d48e
--- /dev/null
+++ b/dist/tests/test_service.d.ts
@@ -0,0 +1,21 @@
+export function setup(svc: any, loggedOutSvc: any): {
+ "Namespace Tests": any;
+ "Job Tests": any;
+ "Data Model tests": any;
+ "Pivot tests": any;
+ "App Tests": any;
+ "Saved Search Tests": any;
+ "Fired Alerts Tests": any;
+ "Properties Tests": any;
+ "Configuration Tests": any;
+ "Storage Passwords Tests": any;
+ "Index Tests": any;
+ "User Tests": any;
+ "Server Info Tests": any;
+ "View Tests": any;
+ "Parser Tests": any;
+ "Typeahead Tests": any;
+ "Endpoint Tests": any;
+ "Entity tests": any;
+ "Collection tests": any;
+};
diff --git a/dist/tests/test_utils.d.ts b/dist/tests/test_utils.d.ts
new file mode 100644
index 000000000..6334cc111
--- /dev/null
+++ b/dist/tests/test_utils.d.ts
@@ -0,0 +1,23 @@
+export function setup(): {
+ "Callback#callback to object success": (test: any) => void;
+ "Callback#callback to object error - single argument": (test: any) => void;
+ "Callback#callback to object error - multi argument": (test: any) => void;
+ "keyOf works": (test: any) => void;
+ "bind": (test: any) => void;
+ "trim": (test: any) => void;
+ "indexOf": (test: any) => void;
+ "contains": (test: any) => void;
+ "startsWith": (test: any) => void;
+ "endsWith": (test: any) => void;
+ "toArray": (test: any) => void;
+ "isArray": (test: any) => void;
+ "isFunction": (test: any) => void;
+ "isNumber": (test: any) => void;
+ "isObject": (test: any) => void;
+ "isEmpty": (test: any) => void;
+ "forEach": (test: any) => void;
+ "extend": (test: any) => void;
+ "clone": (test: any) => void;
+ "namespaceFromProperties": (test: any) => void;
+ "namespaceFromProperties - bad data": (test: any) => void;
+};
diff --git a/dist/tests/utils.d.ts b/dist/tests/utils.d.ts
new file mode 100644
index 000000000..cb0ff5c3b
--- /dev/null
+++ b/dist/tests/utils.d.ts
@@ -0,0 +1 @@
+export {};
diff --git a/lib/modularinputs/argument.js b/lib/modularinputs/argument.js
index 62bbaf564..7cd3c6d91 100644
--- a/lib/modularinputs/argument.js
+++ b/lib/modularinputs/argument.js
@@ -99,4 +99,6 @@
};
module.exports = Argument;
-})();
\ No newline at end of file
+})();
+
+export { Argument };
\ No newline at end of file
diff --git a/lib/modularinputs/event.js b/lib/modularinputs/event.js
index bf639433a..d367a2c5e 100644
--- a/lib/modularinputs/event.js
+++ b/lib/modularinputs/event.js
@@ -192,3 +192,5 @@
module.exports = Event;
})();
+
+export { Event };
\ No newline at end of file
diff --git a/lib/modularinputs/eventwriter.js b/lib/modularinputs/eventwriter.js
index 8dddc3155..733de05ae 100644
--- a/lib/modularinputs/eventwriter.js
+++ b/lib/modularinputs/eventwriter.js
@@ -90,3 +90,5 @@
module.exports = EventWriter;
})();
+
+export { EventWriter };
\ No newline at end of file
diff --git a/lib/modularinputs/index.js b/lib/modularinputs/index.js
index 341b21b64..3edf8a303 100644
--- a/lib/modularinputs/index.js
+++ b/lib/modularinputs/index.js
@@ -86,3 +86,4 @@ ModularInputs.execute = function(exports, module) {
};
module.exports = ModularInputs;
+export { ModularInputs };
\ No newline at end of file
diff --git a/lib/modularinputs/inputdefinition.js b/lib/modularinputs/inputdefinition.js
index 4fc6cbe19..f265c629c 100644
--- a/lib/modularinputs/inputdefinition.js
+++ b/lib/modularinputs/inputdefinition.js
@@ -89,4 +89,6 @@
};
module.exports = InputDefinition;
-})();
\ No newline at end of file
+})();
+
+export { InputDefinition };
\ No newline at end of file
diff --git a/lib/modularinputs/modularinput.js b/lib/modularinputs/modularinput.js
index 4abc0ecba..50f27cae6 100644
--- a/lib/modularinputs/modularinput.js
+++ b/lib/modularinputs/modularinput.js
@@ -301,3 +301,5 @@
module.exports = ModularInput;
})();
+
+export { ModularInput };
\ No newline at end of file
diff --git a/lib/modularinputs/scheme.js b/lib/modularinputs/scheme.js
index b47abe56a..51689a617 100644
--- a/lib/modularinputs/scheme.js
+++ b/lib/modularinputs/scheme.js
@@ -109,3 +109,5 @@
module.exports = Scheme;
})();
+
+export { Scheme };
\ No newline at end of file
diff --git a/lib/modularinputs/validationdefinition.js b/lib/modularinputs/validationdefinition.js
index 8eb050511..d5053c13f 100644
--- a/lib/modularinputs/validationdefinition.js
+++ b/lib/modularinputs/validationdefinition.js
@@ -77,4 +77,6 @@
};
module.exports = ValidationDefinition;
-})();
\ No newline at end of file
+})();
+
+export { ValidationDefinition };
\ No newline at end of file
diff --git a/lib/ui/charting/highcharts.js b/lib/ui/charting/highcharts.js
index 6ffcf718d..d57f27488 100644
--- a/lib/ui/charting/highcharts.js
+++ b/lib/ui/charting/highcharts.js
@@ -11682,3 +11682,5 @@ exports.Highcharts = {
version: '2.1.7'
};
}());
+
+export { Chart };
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 8bb6c6e00..c4d4440a0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1221,7 +1221,7 @@
},
"foreground-child": {
"version": "1.5.6",
- "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz",
+ "resolved": "http://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz",
"integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=",
"dev": true,
"requires": {
@@ -3122,7 +3122,7 @@
},
"readable-stream": {
"version": "2.3.6",
- "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
+ "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz",
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"dev": true,
"optional": true,
diff --git a/package.json b/package.json
index e24522ab9..725e7c029 100644
--- a/package.json
+++ b/package.json
@@ -4,6 +4,10 @@
"description": "SDK for usage with the Splunk REST API",
"homepage": "http://dev.splunk.com",
"main": "index.js",
+ "scripts": {
+ "test": "tsc"
+ },
+ "types": "dist/index.d.ts",
"directories": {
"example": "examples",
"lib": "lib",
diff --git a/tests/service_tests/app.js b/tests/service_tests/app.js
index ca29f1dec..798d3b45c 100644
--- a/tests/service_tests/app.js
+++ b/tests/service_tests/app.js
@@ -169,4 +169,6 @@ module.exports = function(svc) {
});
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/collection.js b/tests/service_tests/collection.js
index e351b08bd..2a9b9cb43 100644
--- a/tests/service_tests/collection.js
+++ b/tests/service_tests/collection.js
@@ -50,4 +50,6 @@ module.exports = function (svc, loggedOutSvc) {
test.done();
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/configuration.js b/tests/service_tests/configuration.js
index e0d6697f7..a252bb8a2 100644
--- a/tests/service_tests/configuration.js
+++ b/tests/service_tests/configuration.js
@@ -206,4 +206,6 @@ module.exports = function (svc) {
});
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/datamodels.js b/tests/service_tests/datamodels.js
index bba00516e..c59f4acb6 100644
--- a/tests/service_tests/datamodels.js
+++ b/tests/service_tests/datamodels.js
@@ -1070,4 +1070,6 @@ module.exports = function(svc) {
);
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/endpoint.js b/tests/service_tests/endpoint.js
index 8d1945197..8efc0338a 100644
--- a/tests/service_tests/endpoint.js
+++ b/tests/service_tests/endpoint.js
@@ -33,4 +33,6 @@ module.exports = function(svc) {
test.done();
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/entity.js b/tests/service_tests/entity.js
index 6c9402f37..fb15fb72b 100644
--- a/tests/service_tests/entity.js
+++ b/tests/service_tests/entity.js
@@ -105,4 +105,6 @@ module.exports = function(svc, loggedOutSvc) {
);
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/firedalerts.js b/tests/service_tests/firedalerts.js
index 8729548b6..1c6ba0391 100644
--- a/tests/service_tests/firedalerts.js
+++ b/tests/service_tests/firedalerts.js
@@ -263,4 +263,6 @@ module.exports = function (svc, loggedOutSvc) {
);
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/indexes.js b/tests/service_tests/indexes.js
index 3741ef68f..885c17b53 100644
--- a/tests/service_tests/indexes.js
+++ b/tests/service_tests/indexes.js
@@ -424,4 +424,6 @@ module.exports = function(svc, loggedOutSvc) {
);
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/job.js b/tests/service_tests/job.js
index bd1d19f29..ba2b758a4 100644
--- a/tests/service_tests/job.js
+++ b/tests/service_tests/job.js
@@ -970,3 +970,5 @@ module.exports = function(svc) {
}
};
};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/namespace.js b/tests/service_tests/namespace.js
index 97d7a1c7f..9ac59058c 100644
--- a/tests/service_tests/namespace.js
+++ b/tests/service_tests/namespace.js
@@ -250,4 +250,4 @@ module.exports = function(svc) {
};
};
-
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/parser.js b/tests/service_tests/parser.js
index 59fcfdb43..d2597db08 100644
--- a/tests/service_tests/parser.js
+++ b/tests/service_tests/parser.js
@@ -26,4 +26,6 @@ module.exports = function (svc) {
});
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/pivot.js b/tests/service_tests/pivot.js
index 1140d9577..38c32e462 100644
--- a/tests/service_tests/pivot.js
+++ b/tests/service_tests/pivot.js
@@ -1552,4 +1552,6 @@ module.exports = function (svc) {
});
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/properties.js b/tests/service_tests/properties.js
index fe8b8aa3b..ddfd62514 100644
--- a/tests/service_tests/properties.js
+++ b/tests/service_tests/properties.js
@@ -123,4 +123,6 @@ module.exports = function (svc) {
});
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/savedsearch.js b/tests/service_tests/savedsearch.js
index 9cbe9346f..6eb749b97 100644
--- a/tests/service_tests/savedsearch.js
+++ b/tests/service_tests/savedsearch.js
@@ -412,4 +412,6 @@ module.exports = function (svc, loggedOutSvc) {
});
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/serverinfo.js b/tests/service_tests/serverinfo.js
index 6db447475..c8656401d 100644
--- a/tests/service_tests/serverinfo.js
+++ b/tests/service_tests/serverinfo.js
@@ -20,4 +20,6 @@ module.exports = function (svc) {
});
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/storagepasswords.js b/tests/service_tests/storagepasswords.js
index 551d7bfee..fe618f778 100644
--- a/tests/service_tests/storagepasswords.js
+++ b/tests/service_tests/storagepasswords.js
@@ -603,4 +603,6 @@ module.exports = function(svc) {
);
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/typeahead.js b/tests/service_tests/typeahead.js
index f64b8cbea..9f85534db 100644
--- a/tests/service_tests/typeahead.js
+++ b/tests/service_tests/typeahead.js
@@ -35,4 +35,6 @@ module.exports = function(svc, loggedOutSvc) {
});
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/user.js b/tests/service_tests/user.js
index c2f16f15b..6d05768cc 100644
--- a/tests/service_tests/user.js
+++ b/tests/service_tests/user.js
@@ -243,4 +243,6 @@ module.exports = function (svc, loggedOutSvc) {
});
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/service_tests/view.js b/tests/service_tests/view.js
index bc9b7d42f..1e9324340 100644
--- a/tests/service_tests/view.js
+++ b/tests/service_tests/view.js
@@ -59,4 +59,6 @@ module.exports = function (svc) {
);
}
};
-};
\ No newline at end of file
+};
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/test_async.js b/tests/test_async.js
index 8c8d609e9..58ba108ad 100644
--- a/tests/test_async.js
+++ b/tests/test_async.js
@@ -533,3 +533,5 @@ if (module === require.main) {
var suite = exports.setup();
test.run([{"Tests": suite}]);
}
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/test_context.js b/tests/test_context.js
index ab488206f..0d27c9e2e 100644
--- a/tests/test_context.js
+++ b/tests/test_context.js
@@ -1100,3 +1100,5 @@ if (module === require.main) {
test.run([{"Tests": suite}]);
});
}
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/test_examples.js b/tests/test_examples.js
index 66d1fbc0f..ea966c530 100644
--- a/tests/test_examples.js
+++ b/tests/test_examples.js
@@ -501,4 +501,6 @@ if (module === require.main) {
}
test.run([{"Tests": suite}]);
});
-}
\ No newline at end of file
+}
+
+export { setUp };
\ No newline at end of file
diff --git a/tests/test_http.js b/tests/test_http.js
index d7827f9c4..be465ad19 100644
--- a/tests/test_http.js
+++ b/tests/test_http.js
@@ -311,3 +311,5 @@ if (module === require.main) {
var suite = exports.setup(http);
test.run([{"Tests": suite}]);
}
+
+export { setUp };
\ No newline at end of file
diff --git a/tsconfig.json b/tsconfig.json
new file mode 100644
index 000000000..b55b0b595
--- /dev/null
+++ b/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "include": [
+ "lib/**/*",
+ "!*.d.ts"
+ ],
+
+ "compilerOptions": {
+ // Tells TypeScript to read JS files, as
+ // normally they are ignored as source files
+ "allowJs": true,
+ // Generate d.ts files
+ "declaration": true,
+ // This compiler run should
+ // only output d.ts files
+ "emitDeclarationOnly": true,
+ // Types should go into this directory.
+ // Removing this would place the .d.ts files
+ // next to the .js files
+ "outDir": "dist"
+ }
+}
\ No newline at end of file
diff --git a/tslint.json b/tslint.json
new file mode 100644
index 000000000..32fa6e5e8
--- /dev/null
+++ b/tslint.json
@@ -0,0 +1,9 @@
+{
+ "defaultSeverity": "error",
+ "extends": [
+ "tslint:recommended"
+ ],
+ "jsRules": {},
+ "rules": {},
+ "rulesDirectory": []
+}
\ No newline at end of file