From 3aa189a1de6d58b727cdced6554e78cdc92ec7d5 Mon Sep 17 00:00:00 2001 From: PKing70 <39703314+PKing70@users.noreply.github.com> Date: Mon, 23 Mar 2020 22:01:46 -0700 Subject: [PATCH 01/13] Update CONTRIBUTING.md Revise link to contact us (no more support@splunk.com). --- CONTRIBUTING.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9e6c0ed3f..f65dc5022 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -33,7 +33,7 @@ To create a pull request: ## Contact us -You can reach Splunk support at _support@splunk.com_ if you have Splunk related questions. +You can [contact us][contact] if you have Splunk related questions. You can reach the Developer Platform team at _devinfo@splunk.com_. @@ -43,4 +43,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/about-splunk/contact-us.html#tabs/tab_parsys_tabs_CustomerSupport_4 From d6cea4ee2abc7c07a2092d5bc233c5f4f75dd2ba Mon Sep 17 00:00:00 2001 From: PKing70 <39703314+PKing70@users.noreply.github.com> Date: Mon, 23 Mar 2020 22:05:55 -0700 Subject: [PATCH 02/13] Update README.md Update contact us information (no more support@splunk.com). Addresses SCP-16043 --- README.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 104100f15..b050dfba2 100644 --- a/README.md +++ b/README.md @@ -364,7 +364,7 @@ If you would like to contribute to the SDK, go here for more information: ### Support 1. You will be granted support if you or your company are already covered under an existing maintenance/support agreement. - Send an email to support@splunk.com and include "Splunk SDK for JavaScript" in the subject line. + Submit a new case in the [Support Portal][support] and include "Splunk SDK for JavaScript" in the subject line. 2. If you are not covered under an existing maintenance/support agreement, you can find help through the broader community at:
+ * 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/test_async.d.ts b/dist/tests/test_async.d.ts new file mode 100644 index 000000000..e2c295cee --- /dev/null +++ b/dist/tests/test_async.d.ts @@ -0,0 +1,31 @@ +export function setup(): { + "While success": (test: any) => void; + "While success deep": (test: any) => void; + "While error": (test: any) => void; + "Whilst sans condition is never": (test: any) => void; + "Whilst with empty body does nothing": (test: any) => void; + "Parallel success": (test: any) => void; + "Parallel success - outside of arrays": (test: any) => void; + "Parallel success - no reordering": (test: any) => void; + "Parallel error": (test: any) => void; + "Parallel no tasks": (test: any) => void; + "Series success": (test: any) => void; + "Series success - outside of array": (test: any) => void; + "Series reordering success": (test: any) => void; + "Series error": (test: any) => void; + "Series no tasks": (test: any) => void; + "Parallel map success": (test: any) => void; + "Parallel map reorder success": (test: any) => void; + "Parallel map error": (test: any) => void; + "Series map success": (test: any) => void; + "Series map error": (test: any) => void; + "Chain single success": (test: any) => void; + "Chain flat single success": (test: any) => void; + "Chain flat multiple success": (test: any) => void; + "Chain flat arity change success": (test: any) => void; + "Chain error": (test: any) => void; + "Chain no tasks": (test: any) => void; + "Parallel each reodrder success": (test: any) => void; + "Series each success": (test: any) => void; + "Augment callback": (test: any) => void; +}; 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/index.ts b/index.ts new file mode 100644 index 000000000..43b3972a8 --- /dev/null +++ b/index.ts @@ -0,0 +1 @@ +export { Logger, Context , Service, Http, Utils, Async, Paths, Class, ModularInputs } from './dist/index'; \ No newline at end of file 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/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 5d9c874a0..0581e0160 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "splunk-sdk", - "version": "1.8.4", + "version": "1.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -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/tsconfig.json b/tsconfig.json new file mode 100644 index 000000000..19a06cfe5 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,23 @@ +{ + "include": ["lib/**/*"], + "exclude": [ + "**/tests", + "**/node_modules", + "**/.*/" + ], + + "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 From 2d6b6ecc8b9b95bdeec2352e38f7ea33c17c27fb Mon Sep 17 00:00:00 2001 From: arcsector