├── http ├── test.py ├── static │ ├── assets │ │ ├── .npmignore │ │ └── img │ │ │ ├── logo.png │ │ │ ├── favicon.png │ │ │ ├── avatars │ │ │ ├── 1.jpg │ │ │ ├── 2.jpg │ │ │ ├── 3.jpg │ │ │ ├── 4.jpg │ │ │ ├── 5.jpg │ │ │ ├── 6.jpg │ │ │ ├── 7.jpg │ │ │ └── 8.jpg │ │ │ └── logo-symbol.png │ ├── logo.a961dfbf36f110092c3f.png │ ├── Simple-Line-Icons.d2285965fe34b0546504.ttf │ ├── Simple-Line-Icons.f33df365d6d0255b586f.eot │ ├── Simple-Line-Icons.0cb0b9c589c0624c9c78.woff2 │ ├── Simple-Line-Icons.78f07e2c2a535c26ef21.woff │ ├── fontawesome-webfont.674f50d287a8c48dc19b.eot │ ├── fontawesome-webfont.b06871f281fee6b241d6.ttf │ ├── fontawesome-webfont.af7ae505a9eed503f8b8.woff2 │ ├── fontawesome-webfont.fee66e712a8a08eef580.woff │ ├── inline.c1aa1fa120fc05b06801.bundle.js │ └── index.html ├── task.aql ├── models │ ├── repository_test.go │ └── invocation.go ├── db.go └── hooks.go ├── aql ├── testing │ ├── extern.test │ ├── 1.txt │ ├── 2.txt │ ├── 1.json │ └── 2.json └── assertions_test.go ├── test.json ├── docs-src ├── node_modules │ ├── .bin │ │ ├── shjs │ │ └── docusaurus-init │ ├── rechoir │ │ ├── .npmignore │ │ ├── lib │ │ │ ├── extension.js │ │ │ ├── normalize.js │ │ │ └── register.js │ │ ├── .travis.yml │ │ ├── CHANGELOG │ │ ├── LICENSE │ │ └── index.js │ ├── resolve │ │ ├── test │ │ │ ├── resolver │ │ │ │ ├── mug.js │ │ │ │ ├── baz │ │ │ │ │ ├── doom.js │ │ │ │ │ ├── quux.js │ │ │ │ │ └── package.json │ │ │ │ ├── mug.coffee │ │ │ │ ├── cup.coffee │ │ │ │ ├── other_path │ │ │ │ │ ├── root.js │ │ │ │ │ └── lib │ │ │ │ │ │ └── other-lib.js │ │ │ │ ├── foo.js │ │ │ │ ├── symlinked │ │ │ │ │ └── _ │ │ │ │ │ │ └── symlink_target │ │ │ │ │ │ └── .gitkeep │ │ │ │ ├── dot_main │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ ├── quux │ │ │ │ │ └── foo │ │ │ │ │ │ └── index.js │ │ │ │ ├── same_names │ │ │ │ │ ├── foo.js │ │ │ │ │ └── foo │ │ │ │ │ │ └── index.js │ │ │ │ ├── dot_slash_main │ │ │ │ │ ├── index.js │ │ │ │ │ └── package.json │ │ │ │ ├── incorrect_main │ │ │ │ │ ├── package.json │ │ │ │ │ └── index.js │ │ │ │ └── without_basedir │ │ │ │ │ └── main.js │ │ │ ├── pathfilter │ │ │ │ └── deep_ref │ │ │ │ │ └── main.js │ │ │ ├── dotdot │ │ │ │ ├── index.js │ │ │ │ └── abc │ │ │ │ │ └── index.js │ │ │ ├── precedence │ │ │ │ ├── aaa.js │ │ │ │ ├── bbb.js │ │ │ │ ├── aaa │ │ │ │ │ ├── index.js │ │ │ │ │ └── main.js │ │ │ │ └── bbb │ │ │ │ │ └── main.js │ │ │ ├── node_path │ │ │ │ ├── x │ │ │ │ │ ├── aaa │ │ │ │ │ │ └── index.js │ │ │ │ │ └── ccc │ │ │ │ │ │ └── index.js │ │ │ │ └── y │ │ │ │ │ ├── bbb │ │ │ │ │ └── index.js │ │ │ │ │ └── ccc │ │ │ │ │ └── index.js │ │ │ ├── module_dir │ │ │ │ ├── zmodules │ │ │ │ │ └── bbb │ │ │ │ │ │ ├── package.json │ │ │ │ │ │ └── main.js │ │ │ │ ├── xmodules │ │ │ │ │ └── aaa │ │ │ │ │ │ └── index.js │ │ │ │ └── ymodules │ │ │ │ │ └── aaa │ │ │ │ │ └── index.js │ │ │ ├── nonstring.js │ │ │ ├── subdirs.js │ │ │ ├── faulty_basedir.js │ │ │ ├── filter_sync.js │ │ │ ├── filter.js │ │ │ ├── precedence.js │ │ │ ├── dotdot.js │ │ │ ├── core.js │ │ │ ├── pathfilter.js │ │ │ ├── node_path.js │ │ │ ├── module_dir.js │ │ │ ├── mock_sync.js │ │ │ └── symlinks.js │ │ ├── .eslintignore │ │ ├── example │ │ │ ├── sync.js │ │ │ └── async.js │ │ ├── index.js │ │ ├── .editorconfig │ │ ├── lib │ │ │ ├── caller.js │ │ │ ├── core.json │ │ │ ├── core.js │ │ │ └── node-modules-paths.js │ │ ├── .eslintrc │ │ ├── LICENSE │ │ └── appveyor.yml │ ├── shelljs │ │ ├── src │ │ │ ├── popd.js │ │ │ ├── pushd.js │ │ │ ├── pwd.js │ │ │ ├── error.js │ │ │ ├── echo.js │ │ │ ├── toEnd.js │ │ │ ├── cd.js │ │ │ ├── to.js │ │ │ ├── cat.js │ │ │ ├── set.js │ │ │ ├── find.js │ │ │ └── grep.js │ │ ├── global.js │ │ ├── commands.js │ │ ├── plugin.js │ │ ├── bin │ │ │ └── shjs │ │ ├── make.js │ │ └── LICENSE │ ├── supports-color │ │ ├── browser.js │ │ ├── license │ │ └── readme.md │ ├── concat-map │ │ ├── .travis.yml │ │ ├── example │ │ │ └── map.js │ │ ├── index.js │ │ ├── LICENSE │ │ ├── test │ │ │ └── map.js │ │ └── README.markdown │ ├── balanced-match │ │ ├── .npmignore │ │ ├── LICENSE.md │ │ └── index.js │ ├── path-parse │ │ ├── .travis.yml │ │ ├── README.md │ │ ├── index.min.js │ │ └── package.json │ ├── color-name │ │ ├── test.js │ │ ├── README.md │ │ ├── LICENSE │ │ ├── .eslintrc.json │ │ ├── package.json │ │ └── .npmignore │ ├── inherits │ │ ├── inherits.js │ │ ├── inherits_browser.js │ │ ├── LICENSE │ │ ├── package.json │ │ └── README.md │ ├── escape-string-regexp │ │ ├── index.js │ │ ├── readme.md │ │ └── license │ ├── has-flag │ │ ├── index.js │ │ ├── license │ │ └── readme.md │ ├── docusaurus-init │ │ ├── README.md │ │ ├── package.json │ │ └── initialize.js │ ├── path-is-absolute │ │ ├── index.js │ │ ├── license │ │ └── readme.md │ ├── inflight │ │ ├── LICENSE │ │ ├── README.md │ │ ├── inflight.js │ │ └── package.json │ ├── glob │ │ ├── LICENSE │ │ └── changelog.md │ ├── once │ │ ├── LICENSE │ │ ├── once.js │ │ └── package.json │ ├── wrappy │ │ ├── LICENSE │ │ ├── README.md │ │ ├── wrappy.js │ │ └── package.json │ ├── minimatch │ │ ├── LICENSE │ │ └── package.json │ ├── fs.realpath │ │ ├── README.md │ │ ├── index.js │ │ └── package.json │ ├── chalk │ │ └── license │ ├── ansi-styles │ │ └── license │ ├── interpret │ │ └── LICENSE │ └── color-convert │ │ ├── LICENSE │ │ └── CHANGELOG.md ├── website │ ├── static │ │ ├── img │ │ │ ├── favicon.png │ │ │ ├── oss_logo.png │ │ │ └── favicon │ │ │ │ └── favicon.ico │ │ └── css │ │ │ └── custom.css │ ├── blog │ │ ├── 2017-09-26-adding-rss.md │ │ ├── 2017-10-24-new-version-1.0.0.md │ │ └── 2017-09-25-testing-rss.md │ ├── sidebars.json │ ├── package.json │ ├── i18n │ │ └── en.json │ ├── pages │ │ └── en │ │ │ ├── users.js │ │ │ └── help.js │ └── siteConfig.js ├── package.json └── docs │ ├── set.md │ ├── connection.md │ ├── include.md │ ├── declare.md │ ├── global.md │ ├── data.md │ ├── http.md │ ├── tests.md │ ├── intro.md │ └── cli.md ├── docs └── img │ ├── favicon.png │ ├── oss_logo.png │ ├── favicon │ └── favicon.ico │ └── language.svg ├── engine ├── testing │ ├── 1.xlsx │ ├── test1.db │ ├── template.xlsx │ ├── test_insert.db │ ├── template.xlsx.bak │ └── empty.go ├── middleware.go ├── sql_driver_manager_test.go ├── stopper.go ├── sequencer_test.go ├── sql_driver_manager.go ├── excel_source_test.go ├── destination.go ├── sequencer.go └── parameters_test.go ├── .idea └── vcs.xml ├── .gitignore ├── cmd ├── test.aql ├── test.go ├── validate.go └── run.go ├── transforms ├── transforms_test.go ├── count.go ├── avg_test.go ├── sum_test.go ├── cdf_test.go ├── quantile_test.go ├── common.go ├── zoh_test.go ├── transforms.go ├── sum.go ├── avg.go ├── min.go ├── max.go ├── cdf.go └── quantile.go ├── example3.py ├── .travis.yml ├── example.aql ├── example3.aql ├── example2.aql └── plugins ├── source_rpc.go ├── destination_rpc.go └── destination.py /http/test.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /http/static/assets/.npmignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /aql/testing/extern.test: -------------------------------------------------------------------------------- 1 | TEST EXTERNAL CONTENT -------------------------------------------------------------------------------- /test.json: -------------------------------------------------------------------------------- 1 | [ 2 | [1, "A"], 3 | [2, "B"] 4 | ] -------------------------------------------------------------------------------- /docs-src/node_modules/.bin/shjs: -------------------------------------------------------------------------------- 1 | ../shelljs/bin/shjs -------------------------------------------------------------------------------- /docs-src/node_modules/rechoir/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/mug.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/baz/doom.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/mug.coffee: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/.eslintignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/pathfilter/deep_ref/main.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/cup.coffee: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/other_path/root.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/popd.js: -------------------------------------------------------------------------------- 1 | // see dirs.js 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/pushd.js: -------------------------------------------------------------------------------- 1 | // see dirs.js 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/other_path/lib/other-lib.js: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs-src/node_modules/.bin/docusaurus-init: -------------------------------------------------------------------------------- 1 | ../docusaurus-init/initialize.js -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/foo.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/dotdot/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'whatever'; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/precedence/aaa.js: -------------------------------------------------------------------------------- 1 | module.exports = 'wtf'; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/precedence/bbb.js: -------------------------------------------------------------------------------- 1 | module.exports = '>_<'; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/baz/quux.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/symlinked/_/symlink_target/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/node_path/x/aaa/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'A'; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/node_path/x/ccc/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'C'; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/node_path/y/bbb/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'B'; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/node_path/y/ccc/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'CY'; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/precedence/aaa/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 'okok'; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/dot_main/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/quux/foo/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/same_names/foo.js: -------------------------------------------------------------------------------- 1 | module.exports = 42; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/precedence/aaa/main.js: -------------------------------------------------------------------------------- 1 | console.log(require('./')); 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/dot_slash_main/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/same_names/foo/index.js: -------------------------------------------------------------------------------- 1 | module.exports = 1; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/supports-color/browser.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = false; 3 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/baz/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "quux.js" 3 | } 4 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/dot_main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "." 3 | } 4 | -------------------------------------------------------------------------------- /docs-src/node_modules/concat-map/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - 0.4 4 | - 0.6 5 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/dotdot/abc/index.js: -------------------------------------------------------------------------------- 1 | var x = require('..'); 2 | console.log(x); 3 | -------------------------------------------------------------------------------- /docs/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/docs/img/favicon.png -------------------------------------------------------------------------------- /docs/img/oss_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/docs/img/oss_logo.png -------------------------------------------------------------------------------- /engine/testing/1.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/engine/testing/1.xlsx -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/module_dir/zmodules/bbb/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "main.js" 3 | } 4 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/precedence/bbb/main.js: -------------------------------------------------------------------------------- 1 | console.log(require('./')); // should throw 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/dot_slash_main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "./" 3 | } 4 | -------------------------------------------------------------------------------- /engine/testing/test1.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/engine/testing/test1.db -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/incorrect_main/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "main": "wrong.js" 3 | } 4 | -------------------------------------------------------------------------------- /docs-src/node_modules/balanced-match/.npmignore: -------------------------------------------------------------------------------- 1 | test 2 | .gitignore 3 | .travis.yml 4 | Makefile 5 | example.js 6 | -------------------------------------------------------------------------------- /docs/img/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/docs/img/favicon/favicon.ico -------------------------------------------------------------------------------- /engine/testing/template.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/engine/testing/template.xlsx -------------------------------------------------------------------------------- /engine/testing/test_insert.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/engine/testing/test_insert.db -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/module_dir/xmodules/aaa/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (x) { return x * 100; }; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/module_dir/ymodules/aaa/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (x) { return x + 100; }; 2 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/module_dir/zmodules/bbb/main.js: -------------------------------------------------------------------------------- 1 | module.exports = function (n) { return n * 111; }; 2 | -------------------------------------------------------------------------------- /http/static/assets/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/logo.png -------------------------------------------------------------------------------- /aql/testing/1.txt: -------------------------------------------------------------------------------- 1 | DESCRIPTION 'Test' 2 | 3 | QUERY 'q1' FROM GLOBAL ( 4 | SELECT * FROM Something 5 | ) INTO CONNECTION d1 -------------------------------------------------------------------------------- /engine/testing/template.xlsx.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/engine/testing/template.xlsx.bak -------------------------------------------------------------------------------- /http/static/assets/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/favicon.png -------------------------------------------------------------------------------- /engine/testing/empty.go: -------------------------------------------------------------------------------- 1 | package testing 2 | 3 | //just to appease goconvey, which refuses to run unless we have a go file here 4 | -------------------------------------------------------------------------------- /http/static/assets/img/avatars/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/avatars/1.jpg -------------------------------------------------------------------------------- /http/static/assets/img/avatars/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/avatars/2.jpg -------------------------------------------------------------------------------- /http/static/assets/img/avatars/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/avatars/3.jpg -------------------------------------------------------------------------------- /http/static/assets/img/avatars/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/avatars/4.jpg -------------------------------------------------------------------------------- /http/static/assets/img/avatars/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/avatars/5.jpg -------------------------------------------------------------------------------- /http/static/assets/img/avatars/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/avatars/6.jpg -------------------------------------------------------------------------------- /http/static/assets/img/avatars/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/avatars/7.jpg -------------------------------------------------------------------------------- /http/static/assets/img/avatars/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/avatars/8.jpg -------------------------------------------------------------------------------- /aql/testing/2.txt: -------------------------------------------------------------------------------- 1 | DESCRIPTION 'Test 3' 2 | 3 | INCLUDE '1.txt' 4 | 5 | QUERY 'b' EXTERN 'extern.test' FROM GLOBAL INTO GLOBAL 6 | 7 | -------------------------------------------------------------------------------- /docs-src/website/static/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/docs-src/website/static/img/favicon.png -------------------------------------------------------------------------------- /engine/middleware.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | //Middleware is a func that transforms a stream. 4 | type Middleware func(Stream) Stream 5 | -------------------------------------------------------------------------------- /http/static/assets/img/logo-symbol.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/assets/img/logo-symbol.png -------------------------------------------------------------------------------- /docs-src/website/static/img/oss_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/docs-src/website/static/img/oss_logo.png -------------------------------------------------------------------------------- /http/static/logo.a961dfbf36f110092c3f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/logo.a961dfbf36f110092c3f.png -------------------------------------------------------------------------------- /docs-src/website/static/img/favicon/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/docs-src/website/static/img/favicon/favicon.ico -------------------------------------------------------------------------------- /http/task.aql: -------------------------------------------------------------------------------- 1 | DATA 'MyMessage' ( 2 | [ 3 | ["{{ .Message }}"] 4 | ] 5 | ) INTO CONSOLE WITH (COLUMNS = 'Message', CONSOLE_OUTPUT_FORMAT='JSON') 6 | 7 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/example/sync.js: -------------------------------------------------------------------------------- 1 | var resolve = require('../'); 2 | var res = resolve.sync('tap', { basedir: __dirname }); 3 | console.log(res); 4 | -------------------------------------------------------------------------------- /http/static/Simple-Line-Icons.d2285965fe34b0546504.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/Simple-Line-Icons.d2285965fe34b0546504.ttf -------------------------------------------------------------------------------- /http/static/Simple-Line-Icons.f33df365d6d0255b586f.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/Simple-Line-Icons.f33df365d6d0255b586f.eot -------------------------------------------------------------------------------- /http/static/Simple-Line-Icons.0cb0b9c589c0624c9c78.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/Simple-Line-Icons.0cb0b9c589c0624c9c78.woff2 -------------------------------------------------------------------------------- /http/static/Simple-Line-Icons.78f07e2c2a535c26ef21.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/Simple-Line-Icons.78f07e2c2a535c26ef21.woff -------------------------------------------------------------------------------- /http/static/fontawesome-webfont.674f50d287a8c48dc19b.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/fontawesome-webfont.674f50d287a8c48dc19b.eot -------------------------------------------------------------------------------- /http/static/fontawesome-webfont.b06871f281fee6b241d6.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/fontawesome-webfont.b06871f281fee6b241d6.ttf -------------------------------------------------------------------------------- /http/static/fontawesome-webfont.af7ae505a9eed503f8b8.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/fontawesome-webfont.af7ae505a9eed503f8b8.woff2 -------------------------------------------------------------------------------- /http/static/fontawesome-webfont.fee66e712a8a08eef580.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/michaelbironneau/analyst/HEAD/http/static/fontawesome-webfont.fee66e712a8a08eef580.woff -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/incorrect_main/index.js: -------------------------------------------------------------------------------- 1 | // this is the actual main file 'index.js', not 'wrong.js' like the package.json would indicate 2 | module.exports = 1; 3 | -------------------------------------------------------------------------------- /docs-src/node_modules/path-parse/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | node_js: 3 | - "0.12" 4 | - "0.11" 5 | - "0.10" 6 | - "0.10.12" 7 | - "0.8" 8 | - "0.6" 9 | - "iojs" 10 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/resolver/without_basedir/main.js: -------------------------------------------------------------------------------- 1 | var resolve = require('../../../'); 2 | 3 | module.exports = function (t, cb) { 4 | resolve('mymodule', null, cb); 5 | }; 6 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/example/async.js: -------------------------------------------------------------------------------- 1 | var resolve = require('../'); 2 | resolve('tap', { basedir: __dirname }, function (err, res) { 3 | if (err) console.error(err); 4 | else console.log(res); 5 | }); 6 | -------------------------------------------------------------------------------- /docs-src/node_modules/color-name/test.js: -------------------------------------------------------------------------------- 1 | 'use strict' 2 | 3 | var names = require('./'); 4 | var assert = require('assert'); 5 | 6 | assert.deepEqual(names.red, [255,0,0]); 7 | assert.deepEqual(names.aliceblue, [240,248,255]); 8 | -------------------------------------------------------------------------------- /docs-src/node_modules/concat-map/example/map.js: -------------------------------------------------------------------------------- 1 | var concatMap = require('../'); 2 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 3 | var ys = concatMap(xs, function (x) { 4 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 5 | }); 6 | console.dir(ys); 7 | -------------------------------------------------------------------------------- /docs-src/node_modules/inherits/inherits.js: -------------------------------------------------------------------------------- 1 | try { 2 | var util = require('util'); 3 | if (typeof util.inherits !== 'function') throw ''; 4 | module.exports = util.inherits; 5 | } catch (e) { 6 | module.exports = require('./inherits_browser.js'); 7 | } 8 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/nonstring.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var resolve = require('../'); 3 | 4 | test('nonstring', function (t) { 5 | t.plan(1); 6 | resolve(555, function (err, res, pkg) { 7 | t.ok(err); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /docs-src/website/blog/2017-09-26-adding-rss.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Adding RSS Support 3 | author: Eric Nakagawa 4 | authorURL: http://twitter.com/ericnakagawa 5 | authorFBID: 661277173 6 | --- 7 | 8 | This is a test post. 9 | 10 | A whole bunch of other information. 11 | -------------------------------------------------------------------------------- /docs-src/website/blog/2017-10-24-new-version-1.0.0.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: New Version 1.0.0 3 | author: Eric Nakagawa 4 | authorURL: http://twitter.com/ericnakagawa 5 | authorFBID: 661277173 6 | --- 7 | 8 | This blog post will test file name parsing issues when periods are present. 9 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/index.js: -------------------------------------------------------------------------------- 1 | var core = require('./lib/core'); 2 | var async = require('./lib/async'); 3 | async.core = core; 4 | async.isCore = function isCore(x) { return core[x]; }; 5 | async.sync = require('./lib/sync'); 6 | 7 | exports = async; 8 | module.exports = async; 9 | -------------------------------------------------------------------------------- /docs-src/node_modules/rechoir/lib/extension.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const EXTRE = /^[.]?[^.]+([.].*)$/; 4 | 5 | module.exports = function (input) { 6 | var extension = EXTRE.exec(path.basename(input)); 7 | if (!extension) { 8 | return; 9 | } 10 | return extension[1]; 11 | }; 12 | -------------------------------------------------------------------------------- /docs-src/node_modules/escape-string-regexp/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g; 4 | 5 | module.exports = function (str) { 6 | if (typeof str !== 'string') { 7 | throw new TypeError('Expected a string'); 8 | } 9 | 10 | return str.replace(matchOperatorsRe, '\\$&'); 11 | }; 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | docs/node_modules 2 | .DS_Store 3 | docs-src/lib/core/metadata.js 4 | docs-src/lib/core/MetadataBlog.js 5 | docs-src/website/translated_docs 6 | docs-src/website/build/ 7 | docs-src/website/yarn.lock 8 | docs-src/website/node_modules 9 | 10 | docs-src/website/i18n/* 11 | !docs-src/website/i18n/en.json 12 | 13 | -------------------------------------------------------------------------------- /docs-src/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "docs", 3 | "version": "1.0.0", 4 | "description": "", 5 | "main": "index.js", 6 | "scripts": { 7 | "test": "echo \"Error: no test specified\" && exit 1" 8 | }, 9 | "author": "", 10 | "license": "ISC", 11 | "dependencies": { 12 | "docusaurus-init": "^1.0.1" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docs-src/website/sidebars.json: -------------------------------------------------------------------------------- 1 | { 2 | "docs": { 3 | "Get Started": ["intro", "cli", "data-flow", "blocks", "connections", "transforms"], 4 | "Recipes" : ["email", "http", "logic"], 5 | "Blocks": ["include", "connection", "query", "exec", "transform", "data", "declare", "global", "set", "tests"] 6 | 7 | }, 8 | "docs-other": { 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /docs-src/node_modules/has-flag/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = function (flag, argv) { 3 | argv = argv || process.argv; 4 | 5 | var terminatorPos = argv.indexOf('--'); 6 | var prefix = /^-{1,2}/.test(flag) ? '' : '--'; 7 | var pos = argv.indexOf(prefix + flag); 8 | 9 | return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos); 10 | }; 11 | -------------------------------------------------------------------------------- /docs-src/node_modules/rechoir/lib/normalize.js: -------------------------------------------------------------------------------- 1 | function normalizer (config) { 2 | if (typeof config === 'string') { 3 | return { 4 | module: config 5 | } 6 | } 7 | return config; 8 | }; 9 | 10 | module.exports = function (config) { 11 | if (Array.isArray(config)) { 12 | return config.map(normalizer); 13 | } 14 | return normalizer(config); 15 | }; 16 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/pwd.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var common = require('./common'); 3 | 4 | common.register('pwd', _pwd, { 5 | allowGlobbing: false, 6 | }); 7 | 8 | //@ 9 | //@ ### pwd() 10 | //@ Returns the current directory. 11 | function _pwd() { 12 | var pwd = path.resolve(process.cwd()); 13 | return pwd; 14 | } 15 | module.exports = _pwd; 16 | -------------------------------------------------------------------------------- /docs-src/website/static/css/custom.css: -------------------------------------------------------------------------------- 1 | /* your custom css */ 2 | 3 | @media only screen and (min-device-width: 360px) and (max-device-width: 736px) { 4 | } 5 | 6 | @media only screen and (min-width: 1024px) { 7 | } 8 | 9 | @media only screen and (max-width: 1023px) { 10 | } 11 | 12 | @media only screen and (min-width: 1400px) { 13 | } 14 | 15 | @media only screen and (min-width: 1500px) { 16 | } -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = tab 5 | indent_size = 4 6 | end_of_line = lf 7 | charset = utf-8 8 | trim_trailing_whitespace = true 9 | insert_final_newline = true 10 | max_line_length = 120 11 | 12 | [CHANGELOG.md] 13 | indent_style = space 14 | indent_size = 2 15 | 16 | [*.json] 17 | max_line_length = off 18 | 19 | [Makefile] 20 | max_line_length = off 21 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/lib/caller.js: -------------------------------------------------------------------------------- 1 | module.exports = function () { 2 | // see https://code.google.com/p/v8/wiki/JavaScriptStackTraceApi 3 | var origPrepareStackTrace = Error.prepareStackTrace; 4 | Error.prepareStackTrace = function (_, stack) { return stack; }; 5 | var stack = (new Error()).stack; 6 | Error.prepareStackTrace = origPrepareStackTrace; 7 | return stack[2].getFileName(); 8 | }; 9 | -------------------------------------------------------------------------------- /cmd/test.aql: -------------------------------------------------------------------------------- 1 | --SET SLACK_WEBHOOK_URL = 'https://hooks.slack.com/services/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' 2 | --SET SLACK_LOG_LEVEL = 'INFO' 3 | --SET SLACK_CHANNEL = 'alerts' 4 | --SET SLACK_NAME = 'Hello world script' 5 | 6 | DATA 'MyMessage' ( 7 | [ 8 | ["Hello, World"] 9 | ] 10 | ) INTO CONSOLE WITH (COLUMNS = 'Message') 11 | 12 | TEST MyMessage WITH ASSERTIONS ( 13 | COLUMN Message HAS UNIQUE VALUES 14 | ); 15 | -------------------------------------------------------------------------------- /docs-src/node_modules/concat-map/index.js: -------------------------------------------------------------------------------- 1 | module.exports = function (xs, fn) { 2 | var res = []; 3 | for (var i = 0; i < xs.length; i++) { 4 | var x = fn(xs[i], i); 5 | if (isArray(x)) res.push.apply(res, x); 6 | else res.push(x); 7 | } 8 | return res; 9 | }; 10 | 11 | var isArray = Array.isArray || function (xs) { 12 | return Object.prototype.toString.call(xs) === '[object Array]'; 13 | }; 14 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/global.js: -------------------------------------------------------------------------------- 1 | /* eslint no-extend-native: 0 */ 2 | var shell = require('./shell.js'); 3 | var common = require('./src/common'); 4 | Object.keys(shell).forEach(function (cmd) { 5 | global[cmd] = shell[cmd]; 6 | }); 7 | 8 | var _to = require('./src/to'); 9 | String.prototype.to = common.wrap('to', _to); 10 | 11 | var _toEnd = require('./src/toEnd'); 12 | String.prototype.toEnd = common.wrap('toEnd', _toEnd); 13 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/subdirs.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var resolve = require('../'); 3 | var path = require('path'); 4 | 5 | test('subdirs', function (t) { 6 | t.plan(2); 7 | 8 | var dir = path.join(__dirname, '/subdirs'); 9 | resolve('a/b/c/x.json', { basedir: dir }, function (err, res) { 10 | t.ifError(err); 11 | t.equal(res, path.join(dir, 'node_modules/a/b/c/x.json')); 12 | }); 13 | }); 14 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/faulty_basedir.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var resolve = require('../'); 3 | 4 | test('faulty basedir must produce error in windows', { skip: process.platform !== 'win32' }, function (t) { 5 | t.plan(1); 6 | 7 | var resolverDir = 'C:\\a\\b\\c\\d'; 8 | 9 | resolve('tape/lib/test.js', { basedir: resolverDir }, function (err, res, pkg) { 10 | t.equal(true, !!err); 11 | }); 12 | 13 | }); 14 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/commands.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | 'cat', 3 | 'cd', 4 | 'chmod', 5 | 'cp', 6 | 'dirs', 7 | 'echo', 8 | 'exec', 9 | 'find', 10 | 'grep', 11 | 'head', 12 | 'ln', 13 | 'ls', 14 | 'mkdir', 15 | 'mv', 16 | 'pwd', 17 | 'rm', 18 | 'sed', 19 | 'set', 20 | 'sort', 21 | 'tail', 22 | 'tempdir', 23 | 'test', 24 | 'to', 25 | 'toEnd', 26 | 'touch', 27 | 'uniq', 28 | 'which', 29 | ]; 30 | -------------------------------------------------------------------------------- /transforms/transforms_test.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestParse(t *testing.T) { 9 | Convey("Given a valid transform body", t, func() { 10 | s := `AGGREGATE SUM(A) As Val` 11 | Convey("It should parse and initialize it correctly", func() { 12 | t, err := Parse(s) 13 | So(err, ShouldBeNil) 14 | So(t, ShouldNotBeNil) 15 | }) 16 | }) 17 | 18 | } 19 | -------------------------------------------------------------------------------- /docs-src/website/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "scripts": { 3 | "examples": "docusaurus-examples", 4 | "start": "docusaurus-start", 5 | "build": "docusaurus-build", 6 | "publish-gh-pages": "docusaurus-publish", 7 | "write-translations": "docusaurus-write-translations", 8 | "version": "docusaurus-version", 9 | "rename-version": "docusaurus-rename-version" 10 | }, 11 | "devDependencies": { 12 | "docusaurus": "^1.0.5" 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /docs-src/node_modules/color-name/README.md: -------------------------------------------------------------------------------- 1 | A JSON with color names and its values. Based on http://dev.w3.org/csswg/css-color/#named-colors. 2 | 3 | [![NPM](https://nodei.co/npm/color-name.png?mini=true)](https://nodei.co/npm/color-name/) 4 | 5 | 6 | ```js 7 | var colors = require('color-name'); 8 | colors.red //[255,0,0] 9 | ``` 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs-src/node_modules/rechoir/lib/register.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const resolve = require('resolve'); 3 | 4 | module.exports = function (cwd, moduleName, register) { 5 | try { 6 | var modulePath = resolve.sync(moduleName, {basedir: cwd}); 7 | var result = require(modulePath); 8 | if (typeof register === 'function') { 9 | register(result); 10 | } 11 | } catch (e) { 12 | result = e; 13 | } 14 | return result; 15 | }; 16 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/filter_sync.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('filter', function (t) { 6 | var dir = path.join(__dirname, 'resolver'); 7 | var res = resolve.sync('./baz', { 8 | basedir: dir, 9 | packageFilter: function (pkg) { 10 | pkg.main = 'doom'; 11 | return pkg; 12 | } 13 | }); 14 | t.equal(res, path.join(dir, 'baz/doom.js')); 15 | t.end(); 16 | }); 17 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/error.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | 3 | //@ 4 | //@ ### error() 5 | //@ Tests if error occurred in the last command. Returns a truthy value if an 6 | //@ error returned and a falsy value otherwise. 7 | //@ 8 | //@ **Note**: do not rely on the 9 | //@ return value to be an error message. If you need the last error message, use 10 | //@ the `.stderr` attribute from the last command's return value instead. 11 | function error() { 12 | return common.state.error; 13 | } 14 | module.exports = error; 15 | -------------------------------------------------------------------------------- /docs-src/website/blog/2017-09-25-testing-rss.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Adding RSS Support - RSS Truncation Test 3 | author: Eric Nakagawa 4 | authorURL: http://twitter.com/ericnakagawa 5 | authorFBID: 661277173 6 | --- 7 | 1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 8 | 9 | This should be truncated. 10 | 11 | This line should never render in XML. 12 | -------------------------------------------------------------------------------- /example3.py: -------------------------------------------------------------------------------- 1 | from subprocess import call 2 | import json 3 | 4 | resampling_times = [("2017-12-01T12:00:00Z", "2017-12-01T12:10:00Z"), 5 | ("2017-12-01T12:10:00Z", "2017-12-01T12:20:00Z"), 6 | ("2017-12-01T12:20:00Z", "2017-12-01T12:30:00Z")] 7 | 8 | if __name__ == "__main__": 9 | for start, finish in resampling_times: 10 | opts = json.dumps({"Start": start, "Finish": finish}) 11 | print("RESAMPLING {0} to {1}".format(start, finish)) 12 | call(["./analyst", "run", "--script", "example3.aql", "--params", opts]) -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: go 2 | before_install: 3 | - sudo apt-get update -qq 4 | - sudo apt-get install -qq python python-pip 5 | - sudo pip install python-jsonrpc 6 | # Download the binary to bin folder in $GOPATH 7 | - curl -L -s https://github.com/golang/dep/releases/download/v${DEP_VERSION}/dep-linux-amd64 -o $GOPATH/bin/dep 8 | # Make the binary executable 9 | - chmod +x $GOPATH/bin/dep 10 | go: 11 | - "1.9" 12 | - "1.10" 13 | - "tip" 14 | matrix: 15 | allow_failures: 16 | - go: tip 17 | env: 18 | - DEP_VERSION="0.4.1" 19 | install: 20 | - dep ensure -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/plugin.js: -------------------------------------------------------------------------------- 1 | // Various utilties exposed to plugins 2 | 3 | require('./shell'); // Create the ShellJS instance (mandatory) 4 | 5 | var common = require('./src/common'); 6 | 7 | var exportedAttributes = [ 8 | 'error', // For signaling errors from within commands 9 | 'parseOptions', // For custom option parsing 10 | 'readFromPipe', // For commands with the .canReceivePipe attribute 11 | 'register', // For registering plugins 12 | ]; 13 | 14 | exportedAttributes.forEach(function (attr) { 15 | exports[attr] = common[attr]; 16 | }); 17 | -------------------------------------------------------------------------------- /transforms/count.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | type count struct { 4 | result float64 5 | notNull bool 6 | am ArgumentMap 7 | } 8 | 9 | func (s *count) ParameterLen() int { 10 | return 1 11 | } 12 | 13 | func (s *count) SetArgumentMap(am ArgumentMap) { 14 | s.am = am 15 | } 16 | 17 | func (s *count) Reduce(arg []interface{}) error { 18 | s.result += 1 19 | return nil 20 | } 21 | 22 | func (s *count) Return() *float64 { 23 | if !s.notNull { 24 | return nil 25 | } 26 | return &s.result 27 | } 28 | 29 | func (s *count) Copy() Reducer { 30 | return &sum{am: s.am} 31 | } 32 | -------------------------------------------------------------------------------- /engine/sql_driver_manager_test.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestDriverManager(t *testing.T) { 9 | Convey("Given the driver manager", t, func() { 10 | Convey("When I connect twice with the same string/driver, I should get back the same connection", func() { 11 | db, err := SQLDriverManager.DB("sqlite3", ":memory:") 12 | So(err, ShouldBeNil) 13 | db2, err2 := SQLDriverManager.DB("sqlite3", ":memory:") 14 | So(err2, ShouldBeNil) 15 | So(db, ShouldEqual, db2) 16 | }) 17 | 18 | }) 19 | } 20 | -------------------------------------------------------------------------------- /http/models/repository_test.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestGetRepoName(t *testing.T) { 9 | Convey("Given some repo URLs", t, func() { 10 | names := map[string]string{ 11 | "https://github.com/michaelbironneau/analyst": "analyst", 12 | "https://github.com/src-d/go-git/": "go-git", 13 | "asdf": "asdf", 14 | } 15 | Convey("It should map them to the repo names", func() { 16 | for url, name := range names { 17 | So(repoName(url), ShouldEqual, name) 18 | } 19 | }) 20 | }) 21 | } 22 | -------------------------------------------------------------------------------- /aql/testing/1.json: -------------------------------------------------------------------------------- 1 | { 2 | "Description": { 3 | "Content": "Test" 4 | }, 5 | "Queries": [{ 6 | "Name": "q1", 7 | "Extern": null, 8 | "Sources": [{ 9 | "Script": null, 10 | "Database": null, 11 | "Block": null, 12 | "Global": true 13 | }], 14 | "Content": "\n SELECT * FROM Something\n", 15 | "Destinations": [{ 16 | "Script": null, 17 | "Database": "d1", 18 | "Block": null, 19 | "Global": false 20 | }], 21 | "Options": null 22 | }], 23 | "Includes": null, 24 | "Tests": null, 25 | "Globals": null, 26 | "Scripts": null 27 | } -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/filter.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('filter', function (t) { 6 | t.plan(2); 7 | var dir = path.join(__dirname, 'resolver'); 8 | resolve('./baz', { 9 | basedir: dir, 10 | packageFilter: function (pkg) { 11 | pkg.main = 'doom'; 12 | return pkg; 13 | } 14 | }, function (err, res, pkg) { 15 | if (err) t.fail(err); 16 | t.equal(res, path.join(dir, 'baz/doom.js')); 17 | t.equal(pkg.main, 'doom'); 18 | }); 19 | }); 20 | -------------------------------------------------------------------------------- /aql/assertions_test.go: -------------------------------------------------------------------------------- 1 | package aql 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestAssertions(t *testing.T) { 9 | Convey("When given a table of valid assertions", t, func() { 10 | assertions := []string{ 11 | "IT OUTPUTS AT LEAST 3 ROWS", 12 | "IT OUTPUTS AT MOST 4321 ROWS", 13 | "COLUMN B HAS UNIQUE VALUES", 14 | "COLUMN A HAS NO NULL VALUES", 15 | } 16 | Convey("It should parse correctly and return no error", func() { 17 | for i := range assertions { 18 | _, err := NewAssertion(assertions[i]) 19 | So(err, ShouldBeNil) 20 | } 21 | }) 22 | }) 23 | } 24 | -------------------------------------------------------------------------------- /aql/testing/2.json: -------------------------------------------------------------------------------- 1 | { 2 | "Description": { 3 | "Content": "Test 3" 4 | }, 5 | "Queries": [{ 6 | "Name": "b", 7 | "Extern": "extern.test", 8 | "Sources": [{ 9 | "Script": null, 10 | "Database": null, 11 | "Block": null, 12 | "Global": true 13 | }], 14 | "Content": "", 15 | "Destinations": [{ 16 | "Script": null, 17 | "Database": null, 18 | "Block": null, 19 | "Global": true 20 | }], 21 | "Options": null 22 | }], 23 | "Connections": null, 24 | "Includes": [{ 25 | "Source": "1.txt" 26 | }], 27 | "Tests": null, 28 | "Globals": null, 29 | "Scripts": null 30 | } -------------------------------------------------------------------------------- /docs-src/node_modules/docusaurus-init/README.md: -------------------------------------------------------------------------------- 1 | ## `docusaurus-init` 2 | 3 | An initialization script for [Docusaurus](https://docusuarus.io). 4 | 5 | ### What does it do? 6 | 7 | Docusaurus was designed from the ground up to be easily installed and used to get your website up an running quickly. To install Docusaurus, we have created an easy script that will get all of the infrastructure setup for you: 8 | 9 | 1. Go into the root of your GitHub repo directory where you will be creating the docs. 10 | 1. `yarn global add docusaurus-init` or `npm install --global docusaurus-init` 11 | 1. `docusaurus-init` 12 | 13 | Find out more in the [official docs](http://localhost:3000/docs/en/installation.html). 14 | -------------------------------------------------------------------------------- /docs-src/node_modules/escape-string-regexp/readme.md: -------------------------------------------------------------------------------- 1 | # escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp) 2 | 3 | > Escape RegExp special characters 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save escape-string-regexp 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const escapeStringRegexp = require('escape-string-regexp'); 17 | 18 | const escapedString = escapeStringRegexp('how much $ for a unicorn?'); 19 | //=> 'how much \$ for a unicorn\?' 20 | 21 | new RegExp(escapedString); 22 | ``` 23 | 24 | 25 | ## License 26 | 27 | MIT © [Sindre Sorhus](http://sindresorhus.com) 28 | -------------------------------------------------------------------------------- /engine/stopper.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | import "sync/atomic" 4 | 5 | //Stopper is used as a condition variable stop halt the execution of the program. 6 | //It is safe for concurrent use by multiple goroutines. 7 | type Stopper interface { 8 | //Stopped checks if the stopper is stopped 9 | Stopped() bool 10 | 11 | //Stops. This is irreversible. 12 | Stop() 13 | } 14 | 15 | type stopper struct { 16 | flag int32 17 | } 18 | 19 | func NewStopper() Stopper { 20 | return &stopper{} 21 | } 22 | 23 | func (s *stopper) Stopped() bool { 24 | if i := atomic.LoadInt32(&s.flag); i == 1 { 25 | return true 26 | } 27 | return false 28 | } 29 | 30 | func (s *stopper) Stop() { 31 | atomic.StoreInt32(&s.flag, 1) 32 | } 33 | -------------------------------------------------------------------------------- /docs-src/node_modules/path-is-absolute/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | 3 | function posix(path) { 4 | return path.charAt(0) === '/'; 5 | } 6 | 7 | function win32(path) { 8 | // https://github.com/nodejs/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 9 | var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; 10 | var result = splitDeviceRe.exec(path); 11 | var device = result[1] || ''; 12 | var isUnc = Boolean(device && device.charAt(1) !== ':'); 13 | 14 | // UNC paths are always absolute 15 | return Boolean(result[2] || isUnc); 16 | } 17 | 18 | module.exports = process.platform === 'win32' ? win32 : posix; 19 | module.exports.posix = posix; 20 | module.exports.win32 = win32; 21 | -------------------------------------------------------------------------------- /docs-src/docs/set.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: set 3 | title: SET 4 | --- 5 | 6 | The syntax for SET blocks is as follows: 7 | ``` 8 | SET OPTION_NAME = OPTION_VALUE 9 | ``` 10 | 11 | The Option value can be a quoted string or number. 12 | 13 | The SET block is used to set a global option. See [Blocks](blocks.md) for more information on option inheritance and values. 14 | 15 | #Example 16 | 17 | In the below example, the global option `Table` is used as an option for the query destination for `MyDb2` connection, resulting in all the rows output by the query being inserted into `MyStagingTable`. 18 | 19 | ``` 20 | SET Table = 'MyStagingTable' 21 | 22 | QUERY 'Results' FROM CONNECTION MyDb ( 23 | SELECT * FROM MyTable 24 | ) INTO CONNECTION MyDb2 25 | ``` -------------------------------------------------------------------------------- /example.aql: -------------------------------------------------------------------------------- 1 | CONNECTION 'Workbook' ( 2 | Driver = 'Excel', 3 | ConnectionString = '.', 4 | File = './output_transform.xlsx' 5 | ) 6 | 7 | QUERY 'SliceOfData' FROM GLOBAL ( 8 | SELECT 1 AS 'Value' 9 | UNION ALL 10 | SELECT -1 AS 'Value' 11 | UNION ALL 12 | SELECT 2 AS 'Value' 13 | ) 14 | 15 | QUERY 'SliceOfData2' FROM GLOBAL ( 16 | SELECT 10 AS 'Value' 17 | UNION ALL 18 | SELECT 11 AS 'Value' 19 | UNION ALL 20 | SELECT -2 AS 'Value' 21 | ) 22 | 23 | TRANSFORM PLUGIN 'FilterNegatives' FROM BLOCK SliceOfData, BLOCK SliceOfData2 () 24 | INTO CONNECTION Workbook 25 | WITH ( 26 | Sheet = 'TestSheet', Range = 'A1:A*', 27 | Columns = 'Value', Multisource_Order = 'Sequential', 28 | Executable = 'python', Args = '["./test_filter.py"]', Overwrite = 'True' 29 | ) -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/precedence.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('precedence', function (t) { 6 | t.plan(3); 7 | var dir = path.join(__dirname, 'precedence/aaa'); 8 | 9 | resolve('./', { basedir: dir }, function (err, res, pkg) { 10 | t.ifError(err); 11 | t.equal(res, path.join(dir, 'index.js')); 12 | t.equal(pkg.name, 'resolve'); 13 | }); 14 | }); 15 | 16 | test('./ should not load ${dir}.js', function (t) { // eslint-disable-line no-template-curly-in-string 17 | t.plan(1); 18 | var dir = path.join(__dirname, 'precedence/bbb'); 19 | 20 | resolve('./', { basedir: dir }, function (err, res, pkg) { 21 | t.ok(err); 22 | }); 23 | }); 24 | -------------------------------------------------------------------------------- /docs-src/docs/connection.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: connection 3 | title: CONNECTION 4 | --- 5 | 6 | The full syntax of CONNECTION blocks is as follows 7 | ``` 8 | CONNECTION 'CONNECTION_NAME' [EXTERN 'CONNECTION_FILE'] ( 9 | DRIVER = 'CONNECTION_DRIVER_NAME' [, CONNECTION_OPTIONS] 10 | ) 11 | ``` 12 | 13 | A connection represents a data source and/or a data sink that can be queried against or that rows can be sent to. 14 | 15 | Connection options are driver-specific. Currently supported drivers are: 16 | 17 | * `mssql`: Microsoft SQL Server database (Source/Sink) 18 | * `sqlite3`: SQLite 3 database (Source/Sink) 19 | * `postgres`: Postgres database (Source/Sink) 20 | * `excel`: Microsoft Excel 2010+ (Source/Sink) 21 | * `mandrill`: Mandrill email API (Sink only) 22 | * `http`: an API served over HTTP (Source only) -------------------------------------------------------------------------------- /docs-src/node_modules/inherits/inherits_browser.js: -------------------------------------------------------------------------------- 1 | if (typeof Object.create === 'function') { 2 | // implementation from standard node.js 'util' module 3 | module.exports = function inherits(ctor, superCtor) { 4 | ctor.super_ = superCtor 5 | ctor.prototype = Object.create(superCtor.prototype, { 6 | constructor: { 7 | value: ctor, 8 | enumerable: false, 9 | writable: true, 10 | configurable: true 11 | } 12 | }); 13 | }; 14 | } else { 15 | // old school shim for old browsers 16 | module.exports = function inherits(ctor, superCtor) { 17 | ctor.super_ = superCtor 18 | var TempCtor = function () {} 19 | TempCtor.prototype = superCtor.prototype 20 | ctor.prototype = new TempCtor() 21 | ctor.prototype.constructor = ctor 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /transforms/avg_test.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestAvg(t *testing.T) { 9 | Convey("Given an avg aggregate", t, func() { 10 | agg := avg{} 11 | agg.SetArgumentMap(DefaultArgMap) 12 | Convey("It should reduce to nil if there are no messages", func() { 13 | So(agg.Return(), ShouldBeNil) 14 | }) 15 | Convey("It should reduce multiple message correctly", func() { 16 | msgs := [][]interface{}{ 17 | []interface{}{0.0}, 18 | []interface{}{1}, 19 | []interface{}{nil}, 20 | } 21 | for _, msg := range msgs { 22 | err := agg.Reduce(msg) 23 | So(err, ShouldBeNil) 24 | } 25 | f := agg.Return() 26 | So(f, ShouldNotBeNil) 27 | So(*f, ShouldEqual, 0.5) 28 | }) 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /transforms/sum_test.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestSum(t *testing.T) { 9 | Convey("Given a sum aggregate", t, func() { 10 | agg := sum{} 11 | agg.SetArgumentMap(DefaultArgMap) 12 | Convey("It should reduce to nil if there are no messages", func() { 13 | So(agg.Return(), ShouldBeNil) 14 | }) 15 | Convey("It should reduce multiple message correctly", func() { 16 | msgs := [][]interface{}{ 17 | []interface{}{0.0}, 18 | []interface{}{1}, 19 | []interface{}{nil}, 20 | } 21 | for _, msg := range msgs { 22 | err := agg.Reduce(msg) 23 | So(err, ShouldBeNil) 24 | } 25 | f := agg.Return() 26 | So(f, ShouldNotBeNil) 27 | So(*f, ShouldEqual, 1.0) 28 | }) 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /transforms/cdf_test.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestCDF(t *testing.T) { 9 | Convey("Given a CDF aggregate", t, func() { 10 | agg := quantile{} 11 | agg.SetArgumentMap(DefaultArgMap) 12 | Convey("It should reduce to nil if there are no messages", func() { 13 | So(agg.Return(), ShouldBeNil) 14 | }) 15 | Convey("It should reduce multiple message correctly", func() { 16 | msgs := [][]interface{}{ 17 | []interface{}{0, 0.5}, 18 | []interface{}{1, 0.5}, 19 | []interface{}{nil, 0.5}, 20 | } 21 | for _, msg := range msgs { 22 | err := agg.Reduce(msg) 23 | So(err, ShouldBeNil) 24 | } 25 | f := agg.Return() 26 | So(f, ShouldNotBeNil) 27 | So(*f, ShouldEqual, 0.5) 28 | }) 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /docs-src/node_modules/inflight/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /docs-src/docs/include.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: include 3 | title: INCLUDE 4 | --- 5 | 6 | `INCLUDE` imports the contents of another SQL script. This can comprise zero or more blocks. 7 | 8 | The general syntax of `INCLUDE` is: 9 | 10 | ``` 11 | INCLUDE 'INCLUDE_FILE' 12 | ``` 13 | 14 | The INCLUDE_FILE path will be resolved relative to the main script directory, that is, from the CLI, the script passed in the `script` parameter. 15 | 16 | **Recursion** 17 | 18 | An included file may, in turn, include other files. The maximum nesting depth is 8 and circular dependencies are not allowed. 19 | 20 | If you have a use case that requires a higher nesting depth, please [open an issue](https://github.com/michaelbironneau/analyst/issues/new) describing your use case. 21 | 22 | ## Example 23 | 24 | ``` 25 | INCLUDE '../connection.aql' 26 | ``` 27 | 28 | -------------------------------------------------------------------------------- /docs-src/node_modules/inherits/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 10 | REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND 11 | FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 12 | INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 13 | LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 14 | OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 15 | PERFORMANCE OF THIS SOFTWARE. 16 | 17 | -------------------------------------------------------------------------------- /transforms/quantile_test.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestQuantile(t *testing.T) { 9 | Convey("Given a quantile aggregate", t, func() { 10 | agg := quantile{} 11 | agg.SetArgumentMap(DefaultArgMap) 12 | Convey("It should reduce to nil if there are no messages", func() { 13 | So(agg.Return(), ShouldBeNil) 14 | }) 15 | Convey("It should reduce multiple message correctly", func() { 16 | msgs := [][]interface{}{ 17 | []interface{}{1, 0.5}, 18 | []interface{}{1, 0.5}, 19 | []interface{}{nil, 0.5}, 20 | } 21 | for _, msg := range msgs { 22 | err := agg.Reduce(msg) 23 | So(err, ShouldBeNil) 24 | } 25 | f := agg.Return() 26 | So(f, ShouldNotBeNil) 27 | So(*f, ShouldEqual, 1) 28 | }) 29 | }) 30 | } 31 | -------------------------------------------------------------------------------- /docs-src/node_modules/glob/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /docs-src/node_modules/once/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /docs-src/node_modules/wrappy/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /docs-src/node_modules/minimatch/LICENSE: -------------------------------------------------------------------------------- 1 | The ISC License 2 | 3 | Copyright (c) Isaac Z. Schlueter and Contributors 4 | 5 | Permission to use, copy, modify, and/or distribute this software for any 6 | purpose with or without fee is hereby granted, provided that the above 7 | copyright notice and this permission notice appear in all copies. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10 | WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11 | MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12 | ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR 15 | IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 | -------------------------------------------------------------------------------- /transforms/common.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | "fmt" 5 | "time" 6 | ) 7 | 8 | const ( 9 | DefaultDatabaseDateFormat = "YYYY-MM-DDTHH:MM:SSZ" 10 | defaultDatabaseGoDateFormat = "2006-01-02T15:04:05Z" 11 | ) 12 | 13 | func parseTime(s string) (*time.Time, string, error) { 14 | var ( 15 | t time.Time 16 | err error 17 | ) 18 | t, err = time.Parse(time.RFC3339, s) 19 | if err != nil { 20 | t, err = time.Parse(time.RFC3339Nano, s) 21 | if err != nil { 22 | t, err = time.Parse(defaultDatabaseGoDateFormat, s) 23 | if err != nil { 24 | return nil, "", fmt.Errorf("unknown time format %s: expected RFC3339, RFC3339 with nanoseconds or %s", s, DefaultDatabaseDateFormat) 25 | } 26 | return &t, DefaultDatabaseDateFormat, nil 27 | } 28 | return &t, time.RFC3339Nano, nil 29 | } 30 | return &t, time.RFC3339, nil 31 | } 32 | -------------------------------------------------------------------------------- /docs-src/node_modules/rechoir/.travis.yml: -------------------------------------------------------------------------------- 1 | sudo: false 2 | language: node_js 3 | node_js: 4 | - "0.10" 5 | - "0.12" 6 | env: 7 | global: 8 | - REMOVE_DEPS="" 9 | matrix: 10 | - "CUSTOM_DEPS=coffee-script@~1.3" 11 | - "CUSTOM_DEPS=coffee-script@~1.5" 12 | - "CUSTOM_DEPS=coffee-script@~1.7" 13 | - "CUSTOM_DEPS=coffee-script@latest" 14 | - "CUSTOM_DEPS=iced-coffee-script@1.6.3-j" 15 | - "CUSTOM_DEPS=iced-coffee-script@latest" 16 | - "CUSTOM_DEPS=LiveScript@1.3.1 REMOVE_DEPS=livescript" 17 | - "CUSTOM_DEPS=typescript-require REMOVE_DEPS=typescript-register" 18 | matrix: 19 | fast_finish: true 20 | before_install: 21 | - "npm install -g npm" # needs the newest version of npm 22 | before_script: 23 | - "[ \"${REMOVE_DEPS}\" == \"\" ] || npm rm $REMOVE_DEPS" 24 | - "npm install $CUSTOM_DEPS" # install a specific version of dependencies 25 | -------------------------------------------------------------------------------- /docs-src/node_modules/wrappy/README.md: -------------------------------------------------------------------------------- 1 | # wrappy 2 | 3 | Callback wrapping utility 4 | 5 | ## USAGE 6 | 7 | ```javascript 8 | var wrappy = require("wrappy") 9 | 10 | // var wrapper = wrappy(wrapperFunction) 11 | 12 | // make sure a cb is called only once 13 | // See also: http://npm.im/once for this specific use case 14 | var once = wrappy(function (cb) { 15 | var called = false 16 | return function () { 17 | if (called) return 18 | called = true 19 | return cb.apply(this, arguments) 20 | } 21 | }) 22 | 23 | function printBoo () { 24 | console.log('boo') 25 | } 26 | // has some rando property 27 | printBoo.iAmBooPrinter = true 28 | 29 | var onlyPrintOnce = once(printBoo) 30 | 31 | onlyPrintOnce() // prints 'boo' 32 | onlyPrintOnce() // does nothing 33 | 34 | // random property is retained! 35 | assert.equal(onlyPrintOnce.iAmBooPrinter, true) 36 | ``` 37 | -------------------------------------------------------------------------------- /http/models/invocation.go: -------------------------------------------------------------------------------- 1 | package models 2 | 3 | import ( 4 | "github.com/jinzhu/gorm" 5 | "time" 6 | ) 7 | 8 | type Invocation struct { 9 | Model 10 | TaskID uint `gorm:"index:ix_invocation_time;" json:"task_id" sql:"type:integer REFERENCES tasks(id)"` 11 | ScheduledAt *time.Time `gorm:"index:ix_invocation_time" json:"scheduled_to_start_at"` 12 | Start *time.Time `json:"started_at"` 13 | Finish *time.Time `json:"finished_at"` 14 | Success bool `json:"success"` 15 | ErrorMessage string `json:"error_message"` 16 | Log string `json:"log" sql:"type:text"` 17 | } 18 | 19 | func (i *Invocation) Create(db *gorm.DB) error { 20 | return db.Create(i).Error 21 | } 22 | 23 | func (i *Invocation) Update(db *gorm.DB) error { 24 | return db.Save(i).Error 25 | } 26 | 27 | func (i *Invocation) Delete(db *gorm.DB) error { 28 | return db.Delete(i).Error 29 | } 30 | -------------------------------------------------------------------------------- /transforms/zoh_test.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestZoh(t *testing.T) { 9 | Convey("Given a zoh aggregate", t, func() { 10 | agg := zoh{} 11 | agg.SetArgumentMap(DefaultArgMap) 12 | Convey("It should reduce to nil if there are no messages", func() { 13 | So(agg.Return(), ShouldBeNil) 14 | }) 15 | Convey("It should reduce multiple message correctly", func() { 16 | msgs := [][]interface{}{ 17 | []interface{}{"2017-01-01T12:00:00Z", 0.0, "2017-01-01T12:00:00Z", "2017-01-01T12:30:00Z"}, 18 | []interface{}{"2017-01-01T12:20:00Z", 3.0, "2017-01-01T12:00:00Z", "2017-01-01T12:30:00Z"}, 19 | } 20 | for _, msg := range msgs { 21 | err := agg.Reduce(msg) 22 | So(err, ShouldBeNil) 23 | } 24 | f := agg.Return() 25 | So(f, ShouldNotBeNil) 26 | So(*f, ShouldEqual, 1.0) 27 | }) 28 | }) 29 | } 30 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/echo.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | 3 | common.register('echo', _echo, { 4 | allowGlobbing: false, 5 | }); 6 | 7 | //@ 8 | //@ ### echo([options,] string [, string ...]) 9 | //@ Available options: 10 | //@ 11 | //@ + `-e`: interpret backslash escapes (default) 12 | //@ 13 | //@ Examples: 14 | //@ 15 | //@ ```javascript 16 | //@ echo('hello world'); 17 | //@ var str = echo('hello world'); 18 | //@ ``` 19 | //@ 20 | //@ Prints string to stdout, and returns string with additional utility methods 21 | //@ like `.to()`. 22 | function _echo(opts, messages) { 23 | // allow strings starting with '-', see issue #20 24 | messages = [].slice.call(arguments, opts ? 0 : 1); 25 | 26 | if (messages[0] === '-e') { 27 | // ignore -e 28 | messages.shift(); 29 | } 30 | 31 | console.log.apply(console, messages); 32 | return messages.join(' '); 33 | } 34 | module.exports = _echo; 35 | -------------------------------------------------------------------------------- /transforms/transforms.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | "fmt" 5 | "github.com/michaelbironneau/analyst/engine" 6 | "strings" 7 | ) 8 | 9 | type initializer func(string) (engine.SequenceableTransform, error) 10 | 11 | var ( 12 | types map[string]initializer = map[string]initializer{ 13 | "aggregate": aggregateInitializer, 14 | "lookup": lookupInitializer, 15 | "apply": applyInitializer, 16 | } 17 | ) 18 | 19 | //Parse parses and initializes a transform given its body and input sequence. 20 | func Parse(s string) (engine.SequenceableTransform, error) { 21 | words := strings.SplitN(strings.TrimSpace(s), " ", 2) 22 | if len(words) == 0 { 23 | return nil, fmt.Errorf("syntax error, expecting keyword (eg. AGGREGATE) followed by space") 24 | } 25 | var f = types[strings.ToLower(words[0])] 26 | if f == nil { 27 | return nil, fmt.Errorf("unknown transform %s", words[0]) 28 | } 29 | return f(s) 30 | } 31 | -------------------------------------------------------------------------------- /docs-src/docs/declare.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: declare 3 | title: DECLARE 4 | --- 5 | 6 | The syntax of a DECLARE block is as follows: 7 | ``` 8 | DECLARE [PARAMETER_NAME] 9 | ``` 10 | 11 | The parameter identifier can include alphanumeric characters and special characters like `@`, but not parentheses, operators or quotation marks. 12 | 13 | Declare blocks are used to declare parameters. These parameters can be populated using query destinations. They can be used by queries or execs using SQL driver-specific parameter templating (eg. `?`). 14 | 15 | **All parameters must be declared before they are used** 16 | 17 | ## Example 18 | 19 | ``` 20 | DECLARE @Name; 21 | 22 | QUERY 'GetLastUser' FROM CONNECTION MyDb ( 23 | SELECT TOP 1 Name FROM Users ORDER BY CreatedAt DESC 24 | ) INTO PARAMETER (@Name); 25 | 26 | EXEC 'DeleteUser' FROM CONNECTION OtherDb ( 27 | DELETE FROM InactiveUsers WHERE Id = ? 28 | ) USING PARAMETER @Name 29 | AFTER GetLastUser 30 | ``` -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/dotdot.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('dotdot', function (t) { 6 | t.plan(4); 7 | var dir = path.join(__dirname, '/dotdot/abc'); 8 | 9 | resolve('..', { basedir: dir }, function (err, res, pkg) { 10 | t.ifError(err); 11 | t.equal(res, path.join(__dirname, 'dotdot/index.js')); 12 | }); 13 | 14 | resolve('.', { basedir: dir }, function (err, res, pkg) { 15 | t.ifError(err); 16 | t.equal(res, path.join(dir, 'index.js')); 17 | }); 18 | }); 19 | 20 | test('dotdot sync', function (t) { 21 | t.plan(2); 22 | var dir = path.join(__dirname, '/dotdot/abc'); 23 | 24 | var a = resolve.sync('..', { basedir: dir }); 25 | t.equal(a, path.join(__dirname, 'dotdot/index.js')); 26 | 27 | var b = resolve.sync('.', { basedir: dir }); 28 | t.equal(b, path.join(dir, 'index.js')); 29 | }); 30 | -------------------------------------------------------------------------------- /engine/sequencer_test.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "math/rand" 6 | "sync" 7 | "testing" 8 | "time" 9 | ) 10 | 11 | func TestSequencer(t *testing.T) { 12 | c := make(chan int, 3) 13 | var wg sync.WaitGroup 14 | Convey("Given a sequencer and a list of tasks", t, func() { 15 | tasks := []string{"a", "b", "c"} 16 | rand.Seed(time.Now().Unix()) 17 | perm := rand.Perm(3) 18 | s := NewSequencer(tasks) 19 | Convey("It should execute the tasks in the correct order", func() { 20 | for i := range tasks { 21 | wg.Add(1) 22 | go func(name string, result int) { 23 | s.Wait(name) 24 | c <- result 25 | s.Done(name) 26 | wg.Done() 27 | }(tasks[perm[i]], perm[i]) 28 | } 29 | wg.Wait() 30 | close(c) 31 | exp := []int{0, 1, 2} 32 | var act []int 33 | for i := range c { 34 | act = append(act, i) 35 | } 36 | So(exp, ShouldResemble, act) 37 | }) 38 | 39 | }) 40 | } 41 | -------------------------------------------------------------------------------- /http/db.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "github.com/jinzhu/gorm" 5 | _ "github.com/jinzhu/gorm/dialects/sqlite" 6 | "github.com/michaelbironneau/analyst/http/models" 7 | ) 8 | 9 | func MigrateDb(db *gorm.DB, filename string) error { 10 | // Migrate the schema 11 | err := db.AutoMigrate(&models.Task{}, &models.Invocation{}, &models.Repository{}).Error 12 | if err != nil { 13 | return err 14 | } 15 | return nil 16 | } 17 | 18 | func GetTasks(db *gorm.DB) ([]models.Task, error) { 19 | var tasks []models.Task 20 | err := db.Find(&tasks).Error 21 | return tasks, err 22 | } 23 | 24 | func GetInvocations(db *gorm.DB, limit int) ([]models.Invocation, error) { 25 | var invocations []models.Invocation 26 | err := db.Order("id desc").Limit(limit).Find(&invocations).Error 27 | return invocations, err 28 | } 29 | 30 | func GetRepositories(db *gorm.DB) ([]models.Repository, error) { 31 | var repos []models.Repository 32 | err := db.Find(&repos).Error 33 | return repos, err 34 | } 35 | -------------------------------------------------------------------------------- /engine/sql_driver_manager.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | import ( 4 | "database/sql" 5 | "sync" 6 | ) 7 | 8 | type sqlDriverManager struct { 9 | sync.Mutex 10 | dbs map[string]*sql.DB 11 | } 12 | 13 | //SQLDriverManager is a singleton that makes sure there is only a single DB object per connection, rather than one per 14 | //source/destination 15 | var SQLDriverManager sqlDriverManager 16 | 17 | const driverManagerSeparator = "<<>>" 18 | 19 | func init() { 20 | SQLDriverManager = sqlDriverManager{ 21 | dbs: make(map[string]*sql.DB), 22 | } 23 | } 24 | 25 | func (s *sqlDriverManager) DB(driver, connectionString string) (*sql.DB, error) { 26 | s.Lock() 27 | defer s.Unlock() 28 | if db, ok := s.dbs[driver+driverManagerSeparator+connectionString]; ok { 29 | return db, nil 30 | } 31 | db, err := sql.Open(driver, connectionString) 32 | //db.SetMaxOpenConns(1) 33 | //db.SetMaxIdleConns(1) 34 | if err == nil { 35 | s.dbs[driver+driverManagerSeparator+connectionString] = db 36 | } 37 | return db, err 38 | } 39 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "@ljharb", 3 | "root": true, 4 | "rules": { 5 | "array-bracket-newline": 0, 6 | "array-element-newline": 0, 7 | "indent": [2, 4], 8 | "strict": 0, 9 | "complexity": 0, 10 | "consistent-return": 0, 11 | "curly": 0, 12 | "dot-notation": [2, { "allowKeywords": true }], 13 | "func-name-matching": 0, 14 | "func-style": 0, 15 | "global-require": 0, 16 | "id-length": [2, { "min": 1, "max": 30 }], 17 | "max-nested-callbacks": 0, 18 | "max-params": 0, 19 | "max-statements-per-line": [2, { "max": 2 }], 20 | "max-statements": 0, 21 | "no-magic-numbers": 0, 22 | "no-console": 0, 23 | "no-shadow": 0, 24 | "no-unused-vars": [2, { "vars": "all", "args": "none" }], 25 | "no-use-before-define": 0, 26 | "object-curly-newline": 0, 27 | "operator-linebreak": [2, "before"], 28 | "sort-keys": 0, 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /example3.aql: -------------------------------------------------------------------------------- 1 | GLOBAL 'CreateTables' ( 2 | CREATE TABLE Timeseries ( 3 | LoadId int not null, 4 | Variable text not null, 5 | Time text not null, 6 | Value real 7 | ); 8 | 9 | INSERT INTO Timeseries (LoadId, Variable, Time, Value) 10 | VALUES 11 | (1, 'power', '2017-12-01T11:59:00Z', 10), 12 | (1, 'power', '2017-12-01T12:13:01Z', 0), 13 | (1, 'power', '2017-12-01T12:57:00Z', 1.1), 14 | (2, 'power', '2017-12-01T11:52:00Z', 120), 15 | (2, 'power', '2017-12-01T11:45:00Z', 100), 16 | (3, 'power', '2017-12-01T12:33:00Z', 119), 17 | (3, 'power', '2017-12-01T12:20:00Z', 50), 18 | (3, 'power', '2017-12-01T11:59:00Z', 100), 19 | (1, 'temperature', '2017-12-01T11:59:00Z', 129.5), 20 | (1, 'temperature', '2017-12-01T12:13:01Z', 130.3); 21 | ) 22 | 23 | TRANSFORM 'Resample' FROM GLOBAL ( 24 | AGGREGATE LoadId, Variable, ZOH(Time, Value, '{{ .Start }}', '{{ .Finish }}') As Value 25 | GROUP BY LoadId, Variable 26 | ) INTO CONSOLE 27 | WITH (Table = 'Timeseries') -------------------------------------------------------------------------------- /docs-src/node_modules/fs.realpath/README.md: -------------------------------------------------------------------------------- 1 | # fs.realpath 2 | 3 | A backwards-compatible fs.realpath for Node v6 and above 4 | 5 | In Node v6, the JavaScript implementation of fs.realpath was replaced 6 | with a faster (but less resilient) native implementation. That raises 7 | new and platform-specific errors and cannot handle long or excessively 8 | symlink-looping paths. 9 | 10 | This module handles those cases by detecting the new errors and 11 | falling back to the JavaScript implementation. On versions of Node 12 | prior to v6, it has no effect. 13 | 14 | ## USAGE 15 | 16 | ```js 17 | var rp = require('fs.realpath') 18 | 19 | // async version 20 | rp.realpath(someLongAndLoopingPath, function (er, real) { 21 | // the ELOOP was handled, but it was a bit slower 22 | }) 23 | 24 | // sync version 25 | var real = rp.realpathSync(someLongAndLoopingPath) 26 | 27 | // monkeypatch at your own risk! 28 | // This replaces the fs.realpath/fs.realpathSync builtins 29 | rp.monkeypatch() 30 | 31 | // un-do the monkeypatching 32 | rp.unmonkeypatch() 33 | ``` 34 | -------------------------------------------------------------------------------- /docs-src/node_modules/wrappy/wrappy.js: -------------------------------------------------------------------------------- 1 | // Returns a wrapper function that returns a wrapped callback 2 | // The wrapper function should do some stuff, and return a 3 | // presumably different callback function. 4 | // This makes sure that own properties are retained, so that 5 | // decorations and such are not lost along the way. 6 | module.exports = wrappy 7 | function wrappy (fn, cb) { 8 | if (fn && cb) return wrappy(fn)(cb) 9 | 10 | if (typeof fn !== 'function') 11 | throw new TypeError('need wrapper function') 12 | 13 | Object.keys(fn).forEach(function (k) { 14 | wrapper[k] = fn[k] 15 | }) 16 | 17 | return wrapper 18 | 19 | function wrapper() { 20 | var args = new Array(arguments.length) 21 | for (var i = 0; i < args.length; i++) { 22 | args[i] = arguments[i] 23 | } 24 | var ret = fn.apply(this, args) 25 | var cb = args[args.length-1] 26 | if (typeof ret === 'function' && ret !== cb) { 27 | Object.keys(cb).forEach(function (k) { 28 | ret[k] = cb[k] 29 | }) 30 | } 31 | return ret 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /docs-src/docs/global.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: global 3 | title: GLOBAL 4 | --- 5 | 6 | The syntax for GLOBAL blocks is as follows: 7 | ``` 8 | GLOBAL 'BLOCK_NAME' [EXTERN 'BLOCK_FILE'] ( 9 | GLOBAL_CONTENT 10 | ) 11 | ``` 12 | 13 | Global blocks run a SQL statement to initialize the GLOBAL database. As such, this must be a valid SQLite3 statement. 14 | 15 | Global blocks run sequentially before any other blocks, in the order that they are declared. They cannot be synchronized using `AFTER`. 16 | 17 | ## Example 18 | 19 | Create a staging table, populate it, and query it. Note that it does not matter where the QUERY block is declared (and it does not need synchronization with the GLOBAL blocks) but the two GLOBAL blocks must be declared in that order: 20 | ``` 21 | GLOBAL 'CreateTable' ( 22 | CREATE TABLE Staging ( 23 | Id int, 24 | Name text 25 | ) 26 | ) 27 | 28 | GLOBAL 'PopulateTable' ( 29 | INSERT INTO Staging VALUES (1, 'Bob'); 30 | INSERT INTO Staging VALUES (2, 'Steve'); 31 | ) 32 | 33 | QUERY 'GetStagingRows' FROM GLOBAL ( 34 | SELECT * FROM Staging 35 | ) INTO CONSOLE 36 | ``` -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/lib/core.json: -------------------------------------------------------------------------------- 1 | { 2 | "assert": true, 3 | "buffer_ieee754": "< 0.9.7", 4 | "buffer": true, 5 | "child_process": true, 6 | "cluster": true, 7 | "console": true, 8 | "constants": true, 9 | "crypto": true, 10 | "_debugger": "< 8", 11 | "dgram": true, 12 | "dns": true, 13 | "domain": true, 14 | "events": true, 15 | "freelist": "< 6", 16 | "fs": true, 17 | "http": true, 18 | "http2": ">= 8.8", 19 | "https": true, 20 | "_http_server": ">= 0.11", 21 | "_linklist": "< 8", 22 | "module": true, 23 | "net": true, 24 | "os": true, 25 | "path": true, 26 | "perf_hooks": ">= 8.5", 27 | "process": ">= 1", 28 | "punycode": true, 29 | "querystring": true, 30 | "readline": true, 31 | "repl": true, 32 | "stream": true, 33 | "string_decoder": true, 34 | "sys": true, 35 | "timers": true, 36 | "tls": true, 37 | "tty": true, 38 | "url": true, 39 | "util": true, 40 | "v8": ">= 1", 41 | "vm": true, 42 | "zlib": true 43 | } 44 | -------------------------------------------------------------------------------- /engine/excel_source_test.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestSourceBasic(t *testing.T) { 9 | var e = ExcelSource{ 10 | Name: "test", 11 | Filename: "./testing/1.xlsx", 12 | Sheet: "Sheet1", 13 | Range: ExcelRange{ 14 | X1: 1, 15 | X2: ExcelRangePoint{ 16 | N: false, 17 | P: 3, 18 | }, 19 | Y1: 1, 20 | Y2: ExcelRangePoint{ 21 | N: false, 22 | P: 3, 23 | }, 24 | }, 25 | RangeIncludesColumns: true, 26 | } 27 | Convey("Given a simple Excel spreadsheet", t, func() { 28 | Convey("It should be able to recover the messages", func() { 29 | 30 | d := SliceDestination{} 31 | l := NewConsoleLogger(Trace) 32 | st := &stopper{} 33 | 34 | sourceStream := NewStream(e.Columns(), DefaultBufferSize) 35 | 36 | e.Open(sourceStream, l, st) 37 | d.Open(sourceStream, l, st) 38 | 39 | expected := [][]interface{}{[]interface{}{1, 2, 3}, []interface{}{"a", "b", "c"}} 40 | So(d.Results(), ShouldResemble, expected) 41 | }) 42 | }) 43 | } 44 | -------------------------------------------------------------------------------- /docs-src/node_modules/rechoir/CHANGELOG: -------------------------------------------------------------------------------- 1 | v0.6.2: 2 | date: 2015-07-22 3 | changes: 4 | - Return `undefined` when an unknown extension is provided to prepare and 5 | the `nothrow` option is specified. 6 | v0.6.1: 7 | date: 2015-05-22 8 | changes: 9 | - Add option for not throwing. 10 | v0.6.0: 11 | date: 2015-05-20 12 | changes: 13 | - Include module name when prepare is successful. 14 | v0.5.0: 15 | date: 2015-05-20 16 | changes: 17 | - Overhaul to support interpret 0.6.0. 18 | v0.3.0: 19 | date: 2015-01-10 20 | changes: 21 | - Breaking: `load` method removed. 22 | - Improved extension recognition. 23 | - No longer fails upon dots in filenames. 24 | - Support confuration objects. 25 | - Support and test ES6. 26 | - Support legacy module loading. 27 | v0.2.2: 28 | date: 2014-12-17 29 | changes: 30 | - Expose interpret. 31 | v0.2.0: 32 | date: 2014-04-20 33 | changes: 34 | - Simplify loading of coffee-script and iced-coffee-script. 35 | v0.1.0: 36 | date: 2014-04-20 37 | changes: 38 | - Initial public release. 39 | -------------------------------------------------------------------------------- /example2.aql: -------------------------------------------------------------------------------- 1 | GLOBAL 'CreateTables' ( 2 | CREATE TABLE Timeseries ( 3 | LoadId int not null, 4 | Variable text not null, 5 | Time text not null, 6 | Value real 7 | ); 8 | 9 | INSERT INTO Timeseries (LoadId, Variable, Time, Value) 10 | VALUES 11 | (1, 'power', '2017-12-01T11:59:00Z', 10), 12 | (1, 'power', '2017-12-01T12:13:01Z', 0), 13 | (1, 'power', '2017-12-01T12:57:00Z', 1.1), 14 | (2, 'power', '2017-12-01T11:52:00Z', 120), 15 | (2, 'power', '2017-12-01T11:45:00Z', 100), 16 | (3, 'power', '2017-12-01T12:33:00Z', 119), 17 | (3, 'power', '2017-12-01T12:20:00Z', 50), 18 | (3, 'power', '2017-12-01T11:59:00Z', 100), 19 | (1, 'temperature', '2017-12-01T11:59:00Z', 129.5), 20 | (1, 'temperature', '2017-12-01T12:13:01Z', 130.3); 21 | ) 22 | 23 | TRANSFORM 'Resample' FROM GLOBAL ( 24 | AGGREGATE LoadId, Variable, ZOH(Time, Value, '2017-12-01T12:00:00Z', '2017-12-01T12:30:00Z') As Value 25 | GROUP BY LoadId, Variable 26 | ) INTO CONSOLE 27 | WITH (Table = 'Timeseries', CONSOLE_OUTPUT_FORMAT='JSON') -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/toEnd.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | var fs = require('fs'); 3 | var path = require('path'); 4 | 5 | common.register('toEnd', _toEnd, { 6 | pipeOnly: true, 7 | wrapOutput: false, 8 | }); 9 | 10 | //@ 11 | //@ ### ShellString.prototype.toEnd(file) 12 | //@ 13 | //@ Examples: 14 | //@ 15 | //@ ```javascript 16 | //@ cat('input.txt').toEnd('output.txt'); 17 | //@ ``` 18 | //@ 19 | //@ Analogous to the redirect-and-append operator `>>` in Unix, but works with 20 | //@ ShellStrings (such as those returned by `cat`, `grep`, etc). 21 | function _toEnd(options, file) { 22 | if (!file) common.error('wrong arguments'); 23 | 24 | if (!fs.existsSync(path.dirname(file))) { 25 | common.error('no such file or directory: ' + path.dirname(file)); 26 | } 27 | 28 | try { 29 | fs.appendFileSync(file, this.stdout || this.toString(), 'utf8'); 30 | return this; 31 | } catch (e) { 32 | /* istanbul ignore next */ 33 | common.error('could not append to file (code ' + e.code + '): ' + file, { continue: true }); 34 | } 35 | } 36 | module.exports = _toEnd; 37 | -------------------------------------------------------------------------------- /cmd/test.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/michaelbironneau/analyst" 6 | "github.com/michaelbironneau/analyst/aql" 7 | "github.com/michaelbironneau/analyst/engine" 8 | "github.com/urfave/cli" 9 | "path/filepath" 10 | ) 11 | 12 | func Test(c *cli.Context) error { 13 | var ( 14 | opts []aql.Option 15 | err error 16 | ) 17 | oString := c.String("params") 18 | if len(opts) > 0 { 19 | opts, err = aql.StrToOpts(oString) 20 | } 21 | 22 | if err != nil { 23 | return err 24 | } 25 | 26 | scriptFile := c.String("script") 27 | 28 | if len(scriptFile) == 0 { 29 | return fmt.Errorf("script file not set") 30 | } 31 | var lev engine.LogLevel 32 | 33 | lev = engine.Warning 34 | 35 | if c.Bool("v") { 36 | lev = engine.Info 37 | } 38 | 39 | if c.Bool("vv") { 40 | lev = engine.Trace 41 | } 42 | 43 | l := engine.NewConsoleLogger(lev) 44 | 45 | err = analyst.TestFile(scriptFile, &analyst.RuntimeOptions{Options: opts, Logger: l, ScriptDirectory: filepath.Dir(scriptFile)}) 46 | 47 | if err != nil { 48 | fmt.Printf("Error: %s\n", err) 49 | } 50 | return err 51 | } 52 | -------------------------------------------------------------------------------- /docs-src/node_modules/color-name/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2015 Dmitry Ivanov 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/cd.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var common = require('./common'); 3 | 4 | common.register('cd', _cd, {}); 5 | 6 | //@ 7 | //@ ### cd([dir]) 8 | //@ Changes to directory `dir` for the duration of the script. Changes to home 9 | //@ directory if no argument is supplied. 10 | function _cd(options, dir) { 11 | if (!dir) dir = common.getUserHome(); 12 | 13 | if (dir === '-') { 14 | if (!process.env.OLDPWD) { 15 | common.error('could not find previous directory'); 16 | } else { 17 | dir = process.env.OLDPWD; 18 | } 19 | } 20 | 21 | try { 22 | var curDir = process.cwd(); 23 | process.chdir(dir); 24 | process.env.OLDPWD = curDir; 25 | } catch (e) { 26 | // something went wrong, let's figure out the error 27 | var err; 28 | try { 29 | fs.statSync(dir); // if this succeeds, it must be some sort of file 30 | err = 'not a directory: ' + dir; 31 | } catch (e2) { 32 | err = 'no such file or directory: ' + dir; 33 | } 34 | if (err) common.error(err); 35 | } 36 | return ''; 37 | } 38 | module.exports = _cd; 39 | -------------------------------------------------------------------------------- /transforms/sum.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import "fmt" 4 | 5 | type sum struct { 6 | result float64 7 | notNull bool 8 | am ArgumentMap 9 | } 10 | 11 | func (s *sum) ParameterLen() int { 12 | return 1 13 | } 14 | 15 | func (s *sum) SetArgumentMap(am ArgumentMap) { 16 | s.am = am 17 | } 18 | 19 | func (s *sum) Reduce(arg []interface{}) error { 20 | args := s.am(arg) 21 | 22 | if len(args) != 1 { 23 | return fmt.Errorf("SUM takes exactly 1 argument but %v were provided", len(args)) 24 | } 25 | if args[0] == nil { 26 | return nil 27 | } 28 | s.notNull = true 29 | switch v := args[0].(type) { 30 | case float64: 31 | s.result += v 32 | case int: 33 | s.result += float64(v) 34 | case int64: 35 | s.result += float64(v) 36 | case int32: 37 | s.result += float64(v) 38 | default: 39 | return fmt.Errorf("SUM takes a single numerical argument, but %v was provided", args[0]) 40 | } 41 | return nil 42 | } 43 | 44 | func (s *sum) Return() *float64 { 45 | if !s.notNull { 46 | return nil 47 | } 48 | return &s.result 49 | } 50 | 51 | func (s *sum) Copy() Reducer { 52 | return &sum{am: s.am} 53 | } 54 | -------------------------------------------------------------------------------- /docs-src/node_modules/path-parse/README.md: -------------------------------------------------------------------------------- 1 | # path-parse [![Build Status](https://travis-ci.org/jbgutierrez/path-parse.svg?branch=master)](https://travis-ci.org/jbgutierrez/path-parse) 2 | 3 | > Node.js [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) ponyfill. 4 | 5 | > Ponyfill: A polyfill that doesn't overwrite the native method 6 | 7 | ## Install 8 | 9 | ``` 10 | $ npm install --save path-parse 11 | ``` 12 | 13 | ## Usage 14 | 15 | ```js 16 | var pathParse = require('path-parse'); 17 | 18 | pathParse('/home/user/dir/file.txt'); 19 | //=> { 20 | // root : "/", 21 | // dir : "/home/user/dir", 22 | // base : "file.txt", 23 | // ext : ".txt", 24 | // name : "file" 25 | // } 26 | ``` 27 | 28 | ## API 29 | 30 | See [`path.parse(pathString)`](https://nodejs.org/api/path.html#path_path_parse_pathstring) docs. 31 | 32 | ### pathParse(path) 33 | 34 | ### pathParse.posix(path) 35 | 36 | The Posix specific version. 37 | 38 | ### pathParse.win32(path) 39 | 40 | The Windows specific version. 41 | 42 | ## License 43 | 44 | MIT © [Javier Blanco](http://jbgutierrez.info) 45 | -------------------------------------------------------------------------------- /docs-src/node_modules/once/once.js: -------------------------------------------------------------------------------- 1 | var wrappy = require('wrappy') 2 | module.exports = wrappy(once) 3 | module.exports.strict = wrappy(onceStrict) 4 | 5 | once.proto = once(function () { 6 | Object.defineProperty(Function.prototype, 'once', { 7 | value: function () { 8 | return once(this) 9 | }, 10 | configurable: true 11 | }) 12 | 13 | Object.defineProperty(Function.prototype, 'onceStrict', { 14 | value: function () { 15 | return onceStrict(this) 16 | }, 17 | configurable: true 18 | }) 19 | }) 20 | 21 | function once (fn) { 22 | var f = function () { 23 | if (f.called) return f.value 24 | f.called = true 25 | return f.value = fn.apply(this, arguments) 26 | } 27 | f.called = false 28 | return f 29 | } 30 | 31 | function onceStrict (fn) { 32 | var f = function () { 33 | if (f.called) 34 | throw new Error(f.onceError) 35 | f.called = true 36 | return f.value = fn.apply(this, arguments) 37 | } 38 | var name = fn.name || 'Function wrapped with `once`' 39 | f.onceError = name + " shouldn't be called more than once" 40 | f.called = false 41 | return f 42 | } 43 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/core.js: -------------------------------------------------------------------------------- 1 | var test = require('tape'); 2 | var keys = require('object-keys'); 3 | var resolve = require('../'); 4 | 5 | test('core modules', function (t) { 6 | t.test('isCore()', function (st) { 7 | st.ok(resolve.isCore('fs')); 8 | st.ok(resolve.isCore('net')); 9 | st.ok(resolve.isCore('http')); 10 | 11 | st.ok(!resolve.isCore('seq')); 12 | st.ok(!resolve.isCore('../')); 13 | st.end(); 14 | }); 15 | 16 | t.test('core list', function (st) { 17 | var cores = keys(resolve.core); 18 | st.plan(cores.length); 19 | 20 | for (var i = 0; i < cores.length; ++i) { 21 | var mod = cores[i]; 22 | if (resolve.core[mod]) { 23 | st.doesNotThrow( 24 | function () { require(mod); }, // eslint-disable-line no-loop-func 25 | 'requiring ' + mod + ' does not throw' 26 | ); 27 | } else { 28 | st.skip(mod + ' not supported'); 29 | } 30 | } 31 | 32 | st.end(); 33 | }); 34 | 35 | t.end(); 36 | }); 37 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/to.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | var fs = require('fs'); 3 | var path = require('path'); 4 | 5 | common.register('to', _to, { 6 | pipeOnly: true, 7 | wrapOutput: false, 8 | }); 9 | 10 | //@ 11 | //@ ### ShellString.prototype.to(file) 12 | //@ 13 | //@ Examples: 14 | //@ 15 | //@ ```javascript 16 | //@ cat('input.txt').to('output.txt'); 17 | //@ ``` 18 | //@ 19 | //@ Analogous to the redirection operator `>` in Unix, but works with 20 | //@ ShellStrings (such as those returned by `cat`, `grep`, etc). _Like Unix 21 | //@ redirections, `to()` will overwrite any existing file!_ 22 | function _to(options, file) { 23 | if (!file) common.error('wrong arguments'); 24 | 25 | if (!fs.existsSync(path.dirname(file))) { 26 | common.error('no such file or directory: ' + path.dirname(file)); 27 | } 28 | 29 | try { 30 | fs.writeFileSync(file, this.stdout || this.toString(), 'utf8'); 31 | return this; 32 | } catch (e) { 33 | /* istanbul ignore next */ 34 | common.error('could not write to file (code ' + e.code + '): ' + file, { continue: true }); 35 | } 36 | } 37 | module.exports = _to; 38 | -------------------------------------------------------------------------------- /docs-src/node_modules/chalk/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /docs-src/node_modules/ansi-styles/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/LICENSE: -------------------------------------------------------------------------------- 1 | This software is released under the MIT license: 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/lib/core.js: -------------------------------------------------------------------------------- 1 | var current = (process.versions && process.versions.node && process.versions.node.split('.')) || []; 2 | 3 | function versionIncluded(specifier) { 4 | if (specifier === true) { return true; } 5 | var parts = specifier.split(' '); 6 | var op = parts[0]; 7 | var versionParts = parts[1].split('.'); 8 | 9 | for (var i = 0; i < 3; ++i) { 10 | var cur = Number(current[i] || 0); 11 | var ver = Number(versionParts[i] || 0); 12 | if (cur === ver) { 13 | continue; // eslint-disable-line no-restricted-syntax, no-continue 14 | } 15 | if (op === '<') { 16 | return cur < ver; 17 | } else if (op === '>=') { 18 | return cur >= ver; 19 | } else { 20 | return false; 21 | } 22 | } 23 | return false; 24 | } 25 | 26 | var data = require('./core.json'); 27 | 28 | var core = {}; 29 | for (var mod in data) { // eslint-disable-line no-restricted-syntax 30 | if (Object.prototype.hasOwnProperty.call(data, mod)) { 31 | core[mod] = versionIncluded(data[mod]); 32 | } 33 | } 34 | module.exports = core; 35 | -------------------------------------------------------------------------------- /docs-src/node_modules/supports-color/license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /docs-src/node_modules/concat-map/LICENSE: -------------------------------------------------------------------------------- 1 | This software is released under the MIT license: 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /docs-src/node_modules/interpret/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2014 Tyler Kellen 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /docs-src/node_modules/rechoir/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015 Tyler Kellen 2 | 3 | Permission is hereby granted, free of charge, to any person 4 | obtaining a copy of this software and associated documentation 5 | files (the "Software"), to deal in the Software without 6 | restriction, including without limitation the rights to use, 7 | copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following 10 | conditions: 11 | 12 | The above copyright notice and this permission notice shall be 13 | included in all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 16 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 17 | OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 18 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 19 | HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 20 | WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 21 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /docs-src/node_modules/inflight/README.md: -------------------------------------------------------------------------------- 1 | # inflight 2 | 3 | Add callbacks to requests in flight to avoid async duplication 4 | 5 | ## USAGE 6 | 7 | ```javascript 8 | var inflight = require('inflight') 9 | 10 | // some request that does some stuff 11 | function req(key, callback) { 12 | // key is any random string. like a url or filename or whatever. 13 | // 14 | // will return either a falsey value, indicating that the 15 | // request for this key is already in flight, or a new callback 16 | // which when called will call all callbacks passed to inflightk 17 | // with the same key 18 | callback = inflight(key, callback) 19 | 20 | // If we got a falsey value back, then there's already a req going 21 | if (!callback) return 22 | 23 | // this is where you'd fetch the url or whatever 24 | // callback is also once()-ified, so it can safely be assigned 25 | // to multiple events etc. First call wins. 26 | setTimeout(function() { 27 | callback(null, key) 28 | }, 100) 29 | } 30 | 31 | // only assigns a single setTimeout 32 | // when it dings, all cbs get called 33 | req('foo', cb1) 34 | req('foo', cb2) 35 | req('foo', cb3) 36 | req('foo', cb4) 37 | ``` 38 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/bin/shjs: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | require('../global'); 3 | 4 | if (process.argv.length < 3) { 5 | console.log('ShellJS: missing argument (script name)'); 6 | console.log(); 7 | process.exit(1); 8 | } 9 | 10 | var args, 11 | scriptName = process.argv[2]; 12 | env['NODE_PATH'] = __dirname + '/../..'; 13 | 14 | if (!scriptName.match(/\.js/) && !scriptName.match(/\.coffee/)) { 15 | if (test('-f', scriptName + '.js')) 16 | scriptName += '.js'; 17 | if (test('-f', scriptName + '.coffee')) 18 | scriptName += '.coffee'; 19 | } 20 | 21 | if (!test('-f', scriptName)) { 22 | console.log('ShellJS: script not found ('+scriptName+')'); 23 | console.log(); 24 | process.exit(1); 25 | } 26 | 27 | args = process.argv.slice(3); 28 | 29 | for (var i = 0, l = args.length; i < l; i++) { 30 | if (args[i][0] !== "-"){ 31 | args[i] = '"' + args[i] + '"'; // fixes arguments with multiple words 32 | } 33 | } 34 | 35 | var path = require('path'); 36 | var extensions = require('interpret').extensions; 37 | var rechoir = require('rechoir'); 38 | rechoir.prepare(extensions, scriptName); 39 | require(require.resolve(path.resolve(process.cwd(), scriptName))); 40 | -------------------------------------------------------------------------------- /docs-src/node_modules/color-convert/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2016 Heather Arthur 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /cmd/validate.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/michaelbironneau/analyst" 6 | "github.com/michaelbironneau/analyst/aql" 7 | "github.com/michaelbironneau/analyst/engine" 8 | "github.com/urfave/cli" 9 | "path/filepath" 10 | ) 11 | 12 | func Validate(c *cli.Context) error { 13 | var ( 14 | opts []aql.Option 15 | err error 16 | ) 17 | oString := c.String("params") 18 | if len(opts) > 0 { 19 | opts, err = aql.StrToOpts(oString) 20 | } 21 | 22 | if err != nil { 23 | return err 24 | } 25 | 26 | scriptFile := c.String("script") 27 | 28 | if len(scriptFile) == 0 { 29 | return fmt.Errorf("script file not set") 30 | } 31 | 32 | var lev engine.LogLevel 33 | 34 | lev = engine.Warning 35 | 36 | if c.Bool("v") { 37 | lev = engine.Info 38 | } 39 | 40 | if c.Bool("vv") { 41 | lev = engine.Trace 42 | } 43 | 44 | l := engine.NewConsoleLogger(lev) 45 | 46 | err = analyst.ValidateFile(scriptFile, &analyst.RuntimeOptions{Options: opts, Logger: l, ScriptDirectory: filepath.Dir(scriptFile)}) 47 | 48 | if err != nil { 49 | fmt.Printf("Error: %s\n", err) 50 | } else { 51 | fmt.Printf("[OK] Script is valid '%s'\n", scriptFile) 52 | } 53 | return err 54 | } 55 | -------------------------------------------------------------------------------- /docs-src/node_modules/balanced-match/LICENSE.md: -------------------------------------------------------------------------------- 1 | (MIT) 2 | 3 | Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 9 | of the Software, and to permit persons to whom the Software is furnished to do 10 | so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs-src/node_modules/has-flag/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs-src/node_modules/path-is-absolute/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs-src/node_modules/escape-string-regexp/license: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) Sindre Sorhus (sindresorhus.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/cat.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | var fs = require('fs'); 3 | 4 | common.register('cat', _cat, { 5 | canReceivePipe: true, 6 | }); 7 | 8 | //@ 9 | //@ ### cat(file [, file ...]) 10 | //@ ### cat(file_array) 11 | //@ 12 | //@ Examples: 13 | //@ 14 | //@ ```javascript 15 | //@ var str = cat('file*.txt'); 16 | //@ var str = cat('file1', 'file2'); 17 | //@ var str = cat(['file1', 'file2']); // same as above 18 | //@ ``` 19 | //@ 20 | //@ Returns a string containing the given file, or a concatenated string 21 | //@ containing the files if more than one file is given (a new line character is 22 | //@ introduced between each file). 23 | function _cat(options, files) { 24 | var cat = common.readFromPipe(); 25 | 26 | if (!files && !cat) common.error('no paths given'); 27 | 28 | files = [].slice.call(arguments, 1); 29 | 30 | files.forEach(function (file) { 31 | if (!fs.existsSync(file)) { 32 | common.error('no such file or directory: ' + file); 33 | } else if (fs.statSync(file).isDirectory()) { 34 | common.error(file + ': Is a directory'); 35 | } 36 | 37 | cat += fs.readFileSync(file, 'utf8'); 38 | }); 39 | 40 | return cat; 41 | } 42 | module.exports = _cat; 43 | -------------------------------------------------------------------------------- /cmd/run.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "fmt" 5 | "github.com/michaelbironneau/analyst" 6 | "github.com/michaelbironneau/analyst/aql" 7 | "github.com/michaelbironneau/analyst/engine" 8 | "github.com/urfave/cli" 9 | "path/filepath" 10 | "time" 11 | ) 12 | 13 | func Run(c *cli.Context) error { 14 | var ( 15 | opts []aql.Option 16 | err error 17 | ) 18 | oString := c.String("params") 19 | 20 | if len(oString) > 0 { 21 | opts, err = aql.StrToOpts(oString) 22 | } 23 | 24 | if err != nil { 25 | fmt.Println("Error reading options", err) 26 | return err 27 | } 28 | 29 | scriptFile := c.String("script") 30 | 31 | if len(scriptFile) == 0 { 32 | fmt.Println("Error - script file not set") 33 | return fmt.Errorf("script file not set") 34 | } 35 | var lev engine.LogLevel 36 | 37 | lev = engine.Warning 38 | 39 | if c.Bool("v") { 40 | lev = engine.Info 41 | } 42 | 43 | if c.Bool("vv") { 44 | lev = engine.Trace 45 | } 46 | 47 | l := engine.NewConsoleLogger(lev) 48 | 49 | err = analyst.ExecuteFile(scriptFile, &analyst.RuntimeOptions{opts, l, nil, nil, filepath.Dir(scriptFile)}) 50 | time.Sleep(time.Millisecond * 1500) //give loggers time to flush 51 | if err != nil { 52 | fmt.Printf("Error: %s\n", err) 53 | } 54 | return err 55 | } 56 | -------------------------------------------------------------------------------- /docs-src/node_modules/concat-map/test/map.js: -------------------------------------------------------------------------------- 1 | var concatMap = require('../'); 2 | var test = require('tape'); 3 | 4 | test('empty or not', function (t) { 5 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 6 | var ixes = []; 7 | var ys = concatMap(xs, function (x, ix) { 8 | ixes.push(ix); 9 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 10 | }); 11 | t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]); 12 | t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]); 13 | t.end(); 14 | }); 15 | 16 | test('always something', function (t) { 17 | var xs = [ 'a', 'b', 'c', 'd' ]; 18 | var ys = concatMap(xs, function (x) { 19 | return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ]; 20 | }); 21 | t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); 22 | t.end(); 23 | }); 24 | 25 | test('scalars', function (t) { 26 | var xs = [ 'a', 'b', 'c', 'd' ]; 27 | var ys = concatMap(xs, function (x) { 28 | return x === 'b' ? [ 'B', 'B', 'B' ] : x; 29 | }); 30 | t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]); 31 | t.end(); 32 | }); 33 | 34 | test('undefs', function (t) { 35 | var xs = [ 'a', 'b', 'c', 'd' ]; 36 | var ys = concatMap(xs, function () {}); 37 | t.same(ys, [ undefined, undefined, undefined, undefined ]); 38 | t.end(); 39 | }); 40 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | skip_branch_with_pr: true 3 | build: off 4 | 5 | environment: 6 | matrix: 7 | - nodejs_version: "7" 8 | - nodejs_version: "6" 9 | - nodejs_version: "5" 10 | - nodejs_version: "4" 11 | - nodejs_version: "3" 12 | - nodejs_version: "2" 13 | - nodejs_version: "1" 14 | - nodejs_version: "0.12" 15 | - nodejs_version: "0.10" 16 | - nodejs_version: "0.8" 17 | - nodejs_version: "0.6" 18 | matrix: 19 | # fast_finish: true 20 | allow_failures: 21 | - nodejs_version: "0.6" 22 | 23 | platform: 24 | - x86 25 | - x64 26 | 27 | # Install scripts. (runs after repo cloning) 28 | install: 29 | # Get the latest stable version of Node.js or io.js 30 | - ps: Install-Product node $env:nodejs_version $env:platform 31 | - IF %nodejs_version% EQU 0.6 npm -g install npm@1.3 32 | - IF %nodejs_version% EQU 0.8 npm -g install npm@2 33 | - set PATH=%APPDATA%\npm;%PATH% 34 | #- IF %nodejs_version% NEQ 0.6 AND %nodejs_version% NEQ 0.8 npm -g install npm 35 | # install modules 36 | - npm install 37 | 38 | # Post-install test scripts. 39 | test_script: 40 | # Output useful info for debugging. 41 | - node --version 42 | - npm --version 43 | # run tests 44 | - npm run tests-only 45 | -------------------------------------------------------------------------------- /plugins/source_rpc.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | "github.com/natefinch/pie" 5 | "net/rpc" 6 | "net/rpc/jsonrpc" 7 | "os" 8 | ) 9 | 10 | type SourceJSONRPC struct { 11 | Path string 12 | Args []string 13 | client *rpc.Client 14 | } 15 | 16 | func (t *SourceJSONRPC) Dial() error { 17 | var err error 18 | t.client, err = pie.StartProviderCodec(jsonrpc.NewClientCodec, os.Stderr, t.Path, t.Args...) 19 | return err 20 | } 21 | 22 | func (t *SourceJSONRPC) Close() error { 23 | return t.client.Close() 24 | } 25 | 26 | func (t *SourceJSONRPC) SetOption(name string, value interface{}) error { 27 | var reply interface{} 28 | return t.client.Call("set_option", option{name, value}, &reply) 29 | } 30 | 31 | func (t *SourceJSONRPC) SetDestinations(names []string) error { 32 | var reply interface{} 33 | return t.client.Call("set_destinations", names, &reply) 34 | } 35 | 36 | func (t *SourceJSONRPC) GetOutputColumns() (map[string][]string, error) { 37 | var reply map[string][]string 38 | err := t.client.Call("get_output_columns", nil, &reply) 39 | return reply, err 40 | } 41 | 42 | func (t *SourceJSONRPC) Receive() ([]OutputRow, []LogEntry, error) { 43 | var reply output 44 | err := t.client.Call("receive", nil, &reply) 45 | return reply.Rows, reply.Logs, err 46 | } 47 | -------------------------------------------------------------------------------- /docs-src/node_modules/has-flag/readme.md: -------------------------------------------------------------------------------- 1 | # has-flag [![Build Status](https://travis-ci.org/sindresorhus/has-flag.svg?branch=master)](https://travis-ci.org/sindresorhus/has-flag) 2 | 3 | > Check if [`argv`](https://nodejs.org/docs/latest/api/process.html#process_process_argv) has a specific flag 4 | 5 | Correctly stops looking after an `--` argument terminator. 6 | 7 | 8 | ## Install 9 | 10 | ``` 11 | $ npm install --save has-flag 12 | ``` 13 | 14 | 15 | ## Usage 16 | 17 | ```js 18 | // foo.js 19 | const hasFlag = require('has-flag'); 20 | 21 | hasFlag('unicorn'); 22 | //=> true 23 | 24 | hasFlag('--unicorn'); 25 | //=> true 26 | 27 | hasFlag('-f'); 28 | //=> true 29 | 30 | hasFlag('foo=bar'); 31 | //=> true 32 | 33 | hasFlag('foo'); 34 | //=> false 35 | 36 | hasFlag('rainbow'); 37 | //=> false 38 | ``` 39 | 40 | ``` 41 | $ node foo.js -f --unicorn --foo=bar -- --rainbow 42 | ``` 43 | 44 | 45 | ## API 46 | 47 | ### hasFlag(flag, [argv]) 48 | 49 | Returns a boolean whether the flag exists. 50 | 51 | #### flag 52 | 53 | Type: `string` 54 | 55 | CLI flag to look for. The `--` prefix is optional. 56 | 57 | #### argv 58 | 59 | Type: `array`
60 | Default: `process.argv` 61 | 62 | CLI arguments. 63 | 64 | 65 | ## License 66 | 67 | MIT © [Sindre Sorhus](https://sindresorhus.com) 68 | -------------------------------------------------------------------------------- /transforms/avg.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import "fmt" 4 | 5 | type avg struct { 6 | result float64 7 | notNull bool 8 | count float64 9 | am ArgumentMap 10 | } 11 | 12 | func (s *avg) ParameterLen() int { 13 | return 1 14 | } 15 | 16 | func (s *avg) SetArgumentMap(am ArgumentMap) { 17 | s.am = am 18 | } 19 | 20 | func (s *avg) Reduce(arg []interface{}) error { 21 | args := s.am(arg) 22 | if len(args) != 1 { 23 | return fmt.Errorf("AVG takes exactly 1 argument but %v were provided", len(args)) 24 | } 25 | if args[0] == nil { 26 | return nil 27 | } 28 | s.notNull = true 29 | switch v := args[0].(type) { 30 | case float64: 31 | s.result = (s.count*s.result + v) / (s.count + 1) 32 | case int: 33 | s.result = (s.count*s.result + float64(v)) / (s.count + 1) 34 | case int64: 35 | s.result = (s.count*s.result + float64(v)) / (s.count + 1) 36 | case int32: 37 | s.result = (s.count*s.result + float64(v)) / (s.count + 1) 38 | default: 39 | return fmt.Errorf("AVG takes a single numerical argument, but %v was provided", args[0]) 40 | } 41 | s.count += 1 42 | return nil 43 | } 44 | 45 | func (s *avg) Return() *float64 { 46 | if !s.notNull { 47 | return nil 48 | } 49 | return &s.result 50 | } 51 | 52 | func (s *avg) Copy() Reducer { 53 | return &avg{am: s.am} 54 | } 55 | -------------------------------------------------------------------------------- /docs-src/website/i18n/en.json: -------------------------------------------------------------------------------- 1 | { 2 | "_comment": "This file is auto-generated by write-translations.js", 3 | "localized-strings": { 4 | "next": "Next", 5 | "previous": "Previous", 6 | "tagline": "a declarative language for ETL jobs", 7 | "blocks": "Block Syntax", 8 | "cli": "Command Line Interface", 9 | "connection": "CONNECTION", 10 | "connections": "Connectors", 11 | "data-flow": "Data Flow", 12 | "data": "DATA", 13 | "declare": "DECLARE", 14 | "email": "Data-Driven Email", 15 | "exec": "EXEC", 16 | "global": "GLOBAL", 17 | "http": "Getting data from Web APIs", 18 | "include": "INCLUDE", 19 | "intro": "30-second Introduction", 20 | "logic": "Using Python for execution logic", 21 | "query": "QUERY", 22 | "set": "SET", 23 | "transform": "TRANSFORM", 24 | "transforms": "Transforms", 25 | "Introduction to Analyst": "Introduction to Analyst", 26 | "Get Started": "Get Started", 27 | "Recipes": "Recipes", 28 | "Blocks": "Blocks" 29 | }, 30 | "pages-strings": { 31 | "Help Translate|recruit community translators for your project": "Help Translate", 32 | "Edit this Doc|recruitment message asking to edit the doc source": "Edit", 33 | "Translate this Doc|recruitment message asking to translate the docs": "Translate" 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /engine/destination.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | import ( 4 | "sync" 5 | "time" 6 | ) 7 | 8 | type Destination interface { 9 | 10 | //Ping checks that the destination is available. It is used to verify 11 | //the destination at runtime. 12 | Ping() error 13 | 14 | //Open gives the destination a stream to start pulling from and an error stream 15 | Open(Stream, Logger, Stopper) 16 | } 17 | 18 | type DevNull struct { 19 | Name string 20 | } 21 | 22 | func (d *DevNull) Ping() error { return nil } 23 | func (d *DevNull) Open(s Stream, l Logger, st Stopper) { 24 | c := s.Chan(d.Name) 25 | for range c { 26 | if st.Stopped() { 27 | return 28 | } 29 | } 30 | } 31 | 32 | type SliceDestination struct { 33 | Alias string 34 | sync.Mutex 35 | res [][]interface{} 36 | } 37 | 38 | func (sd *SliceDestination) Ping() error { return nil } 39 | 40 | func (sd *SliceDestination) Open(s Stream, logger Logger, stop Stopper) { 41 | logger.Chan() <- Event{ 42 | Level: Trace, 43 | Time: time.Now(), 44 | Message: "Slice destination opened", 45 | } 46 | for msg := range s.Chan(sd.Alias) { 47 | if stop.Stopped() { 48 | return 49 | } 50 | sd.Lock() 51 | sd.res = append(sd.res, msg.Data) 52 | sd.Unlock() 53 | } 54 | 55 | } 56 | 57 | func (sd *SliceDestination) Results() [][]interface{} { 58 | return sd.res 59 | } 60 | -------------------------------------------------------------------------------- /docs/img/language.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /docs-src/node_modules/path-parse/index.min.js: -------------------------------------------------------------------------------- 1 | "use strict";var isWindows=process.platform==="win32";var splitDeviceRe=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;var splitTailRe=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/;var win32={};function win32SplitPath(b){var a=splitDeviceRe.exec(b),g=(a[1]||"")+(a[2]||""),e=a[3]||"";var d=splitTailRe.exec(e),c=d[1],h=d[2],f=d[3];return[g,c,h,f]}win32.parse=function(b){if(typeof b!=="string"){throw new TypeError("Parameter 'pathString' must be a string, not "+typeof b)}var a=win32SplitPath(b);if(!a||a.length!==4){throw new TypeError("Invalid path '"+b+"'")}return{root:a[0],dir:a[0]+a[1].slice(0,-1),base:a[2],ext:a[3],name:a[2].slice(0,a[2].length-a[3].length)}};var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;var posix={};function posixSplitPath(a){return splitPathRe.exec(a).slice(1)}posix.parse=function(b){if(typeof b!=="string"){throw new TypeError("Parameter 'pathString' must be a string, not "+typeof b)}var a=posixSplitPath(b);if(!a||a.length!==4){throw new TypeError("Invalid path '"+b+"'")}a[1]=a[1]||"";a[2]=a[2]||"";a[3]=a[3]||"";return{root:a[0],dir:a[0]+a[1].slice(0,-1),base:a[2],ext:a[3],name:a[2].slice(0,a[2].length-a[3].length)}};if(isWindows){module.exports=win32.parse}else{module.exports=posix.parse}module.exports.posix=posix.parse;module.exports.win32=win32.parse; -------------------------------------------------------------------------------- /docs-src/node_modules/color-name/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "node": true, 5 | "commonjs": true, 6 | "es6": true 7 | }, 8 | "extends": "eslint:recommended", 9 | "rules": { 10 | "strict": 2, 11 | "indent": 0, 12 | "linebreak-style": 0, 13 | "quotes": 0, 14 | "semi": 0, 15 | "no-cond-assign": 1, 16 | "no-constant-condition": 1, 17 | "no-duplicate-case": 1, 18 | "no-empty": 1, 19 | "no-ex-assign": 1, 20 | "no-extra-boolean-cast": 1, 21 | "no-extra-semi": 1, 22 | "no-fallthrough": 1, 23 | "no-func-assign": 1, 24 | "no-global-assign": 1, 25 | "no-implicit-globals": 2, 26 | "no-inner-declarations": ["error", "functions"], 27 | "no-irregular-whitespace": 2, 28 | "no-loop-func": 1, 29 | "no-multi-str": 1, 30 | "no-mixed-spaces-and-tabs": 1, 31 | "no-proto": 1, 32 | "no-sequences": 1, 33 | "no-throw-literal": 1, 34 | "no-unmodified-loop-condition": 1, 35 | "no-useless-call": 1, 36 | "no-void": 1, 37 | "no-with": 2, 38 | "wrap-iife": 1, 39 | "no-redeclare": 1, 40 | "no-unused-vars": ["error", { "vars": "all", "args": "none" }], 41 | "no-sparse-arrays": 1 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /http/hooks.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "encoding/json" 5 | "github.com/michaelbironneau/analyst" 6 | "github.com/michaelbironneau/analyst/engine" 7 | "golang.org/x/net/websocket" 8 | ) 9 | 10 | type websocketWriter struct { 11 | ws *websocket.Conn 12 | msgType string 13 | } 14 | 15 | func (w *websocketWriter) Write(p []byte) (n int, err error) { 16 | var entry struct { 17 | Entry string `json:"entry"` 18 | } 19 | entry.Entry = string(p) 20 | b, err := json.Marshal(entry) 21 | if err != nil { 22 | return 0, err 23 | } 24 | msg := Message{ 25 | Type: w.msgType, 26 | Data: json.RawMessage(b), 27 | } 28 | bb, err := json.Marshal(msg) 29 | if err != nil { 30 | return 0, err 31 | } 32 | return w.ws.Write(bb) 33 | } 34 | 35 | func redirectOutputHook(ws *websocket.Conn, msgType string) engine.DestinationHook { 36 | return func(_ string, d engine.Destination) (engine.Destination, error) { 37 | cd, ok := d.(*engine.ConsoleDestination) 38 | if !ok { 39 | return nil, nil 40 | } 41 | cd.Writer = &websocketWriter{ws, msgType} 42 | return nil, nil 43 | } 44 | } 45 | 46 | func outputHooks(ws *websocket.Conn) analyst.RuntimeOptions { 47 | var opts analyst.RuntimeOptions 48 | opts.Logger = engine.NewGenericLogger(engine.Info, &websocketWriter{ws, MsgLog}) 49 | opts.Hooks = []interface{}{redirectOutputHook(ws, MsgResult)} 50 | return opts 51 | } 52 | -------------------------------------------------------------------------------- /docs-src/docs/data.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: data 3 | title: DATA 4 | --- 5 | 6 | The full syntax of a `DATA` block is as follows: 7 | ``` 8 | DATA 'BLOCK_NAME' [EXTERN 'BLOCK_FILE'] ( 9 | DATA_CONTENT 10 | ) [WITH (DATA_OPTIONS)] 11 | ``` 12 | 13 | **Data Content** 14 | 15 | The following formats are currently supported: 16 | 17 | * `JSON_ARRAY`: a flat array, eg `[[2,3],[3,4]]`. Requires `COLUMNS` option to specify the column names. 18 | * `JSON_OBJECTS`: an array of JSON objects, eg. `[{"a": 1, "b": 2}, {"a": 4, "b": 5}]`. Each object must have the same keys. 19 | * `CSV`: A CSV string without headers, eg. `1, 2\n3, 4`. Values will be strings - no attempt will be made to convert them to numbers. 20 | 21 | 22 | **Data Options** 23 | 24 | There are two options: `COLUMNS` and `FORMAT`. 25 | 26 | The `COLUMNS` value is a string containing comma-separated, case-insensitive column names. It is ignored for `JSON_OBJECTS` format. 27 | 28 | The `FORMAT` value specifies the data as a string. The default is `JSON_ARRAY`. 29 | 30 | ## Examples 31 | 32 | ``` 33 | DATA 'Users' EXTERN 'Users.json' () WITH (FORMAT = 'JSON_OBJECTS') 34 | ``` 35 | 36 | ``` 37 | DATA 'Users' ( 38 | [ 39 | {"Name": "Bob"}, 40 | {"Name": "Steve"} 41 | ] 42 | ) WITH (FORMAT = 'JSON_OBJECTS') 43 | ``` 44 | 45 | ``` 46 | DATA 'Users' ( 47 | [ 48 | ["Bob"], 49 | ["Steve"] 50 | ] 51 | ) WITH (COLUMNS = 'Name') 52 | ``` 53 | 54 | -------------------------------------------------------------------------------- /docs-src/node_modules/path-is-absolute/readme.md: -------------------------------------------------------------------------------- 1 | # path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute) 2 | 3 | > Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) [ponyfill](https://ponyfill.com) 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install --save path-is-absolute 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const pathIsAbsolute = require('path-is-absolute'); 17 | 18 | // Running on Linux 19 | pathIsAbsolute('/home/foo'); 20 | //=> true 21 | pathIsAbsolute('C:/Users/foo'); 22 | //=> false 23 | 24 | // Running on Windows 25 | pathIsAbsolute('C:/Users/foo'); 26 | //=> true 27 | pathIsAbsolute('/home/foo'); 28 | //=> false 29 | 30 | // Running on any OS 31 | pathIsAbsolute.posix('/home/foo'); 32 | //=> true 33 | pathIsAbsolute.posix('C:/Users/foo'); 34 | //=> false 35 | pathIsAbsolute.win32('C:/Users/foo'); 36 | //=> true 37 | pathIsAbsolute.win32('/home/foo'); 38 | //=> false 39 | ``` 40 | 41 | 42 | ## API 43 | 44 | See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path). 45 | 46 | ### pathIsAbsolute(path) 47 | 48 | ### pathIsAbsolute.posix(path) 49 | 50 | POSIX specific version. 51 | 52 | ### pathIsAbsolute.win32(path) 53 | 54 | Windows specific version. 55 | 56 | 57 | ## License 58 | 59 | MIT © [Sindre Sorhus](https://sindresorhus.com) 60 | -------------------------------------------------------------------------------- /engine/sequencer.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | import ( 4 | "fmt" 5 | "sync" 6 | ) 7 | 8 | //Sequencer is a synchronization utility to ensure that a collection 9 | //of named tasks run in a given sequence even if they are started in 10 | //parallel. 11 | type Sequencer interface { 12 | Wait(task string) 13 | Done(task string) 14 | } 15 | 16 | type Sequenceable interface { 17 | Sequence(seq []string) 18 | } 19 | 20 | //sequencer is the default implementation of Sequencer 21 | type sequencer struct { 22 | tasks map[string]int 23 | locks []sync.Mutex 24 | } 25 | 26 | func NewSequencer(tasks []string) Sequencer { 27 | var locks []sync.Mutex 28 | taskMap := make(map[string]int) 29 | for i := range tasks { 30 | taskMap[tasks[i]] = i 31 | locks = append(locks, sync.Mutex{}) 32 | if i > 0 { 33 | locks[i].Lock() 34 | } 35 | } 36 | return &sequencer{ 37 | taskMap, 38 | locks, 39 | } 40 | } 41 | 42 | func (s *sequencer) Done(task string) { 43 | if i, ok := s.tasks[task]; !ok { 44 | panic(fmt.Sprintf("task not found in sequencer: %s", task)) 45 | } else { 46 | if i == len(s.locks)-1 { 47 | return //last task - no next task to unlock 48 | } 49 | s.locks[i+1].Unlock() 50 | } 51 | } 52 | 53 | func (s *sequencer) Wait(task string) { 54 | if i, ok := s.tasks[task]; !ok { 55 | panic(fmt.Sprintf("task not found in sequencer: %s", task)) 56 | } else { 57 | s.locks[i].Lock() 58 | s.locks[i].Unlock() //to make idempotent 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /docs-src/node_modules/balanced-match/index.js: -------------------------------------------------------------------------------- 1 | 'use strict'; 2 | module.exports = balanced; 3 | function balanced(a, b, str) { 4 | if (a instanceof RegExp) a = maybeMatch(a, str); 5 | if (b instanceof RegExp) b = maybeMatch(b, str); 6 | 7 | var r = range(a, b, str); 8 | 9 | return r && { 10 | start: r[0], 11 | end: r[1], 12 | pre: str.slice(0, r[0]), 13 | body: str.slice(r[0] + a.length, r[1]), 14 | post: str.slice(r[1] + b.length) 15 | }; 16 | } 17 | 18 | function maybeMatch(reg, str) { 19 | var m = str.match(reg); 20 | return m ? m[0] : null; 21 | } 22 | 23 | balanced.range = range; 24 | function range(a, b, str) { 25 | var begs, beg, left, right, result; 26 | var ai = str.indexOf(a); 27 | var bi = str.indexOf(b, ai + 1); 28 | var i = ai; 29 | 30 | if (ai >= 0 && bi > 0) { 31 | begs = []; 32 | left = str.length; 33 | 34 | while (i >= 0 && !result) { 35 | if (i == ai) { 36 | begs.push(i); 37 | ai = str.indexOf(a, i + 1); 38 | } else if (begs.length == 1) { 39 | result = [ begs.pop(), bi ]; 40 | } else { 41 | beg = begs.pop(); 42 | if (beg < left) { 43 | left = beg; 44 | right = bi; 45 | } 46 | 47 | bi = str.indexOf(b, i + 1); 48 | } 49 | 50 | i = ai < bi && ai >= 0 ? ai : bi; 51 | } 52 | 53 | if (begs.length) { 54 | result = [ left, right ]; 55 | } 56 | } 57 | 58 | return result; 59 | } 60 | -------------------------------------------------------------------------------- /plugins/destination_rpc.go: -------------------------------------------------------------------------------- 1 | package plugins 2 | 3 | import ( 4 | "github.com/natefinch/pie" 5 | "net/rpc" 6 | "net/rpc/jsonrpc" 7 | "os" 8 | ) 9 | 10 | type DestinationJSONRPC struct { 11 | Path string 12 | Args []string 13 | client *rpc.Client 14 | } 15 | 16 | func (t *DestinationJSONRPC) Dial() error { 17 | var err error 18 | t.client, err = pie.StartProviderCodec(jsonrpc.NewClientCodec, os.Stderr, t.Path, t.Args...) 19 | return err 20 | } 21 | 22 | func (t *DestinationJSONRPC) Close() error { 23 | return t.client.Close() 24 | } 25 | 26 | func (t *DestinationJSONRPC) SetOption(name string, value interface{}) error { 27 | var reply interface{} 28 | return t.client.Call("set_option", option{name, value}, &reply) 29 | } 30 | 31 | func (t *DestinationJSONRPC) SetSources(names []string) error { 32 | var reply interface{} 33 | return t.client.Call("set_sources", names, &reply) 34 | } 35 | 36 | func (t *DestinationJSONRPC) SetInputColumns(source string, columns []string) error { 37 | var reply interface{} 38 | return t.client.Call("set_input_columns", inputColumns{source, columns}, &reply) 39 | } 40 | 41 | func (t *DestinationJSONRPC) Send(rows []InputRow) ([]LogEntry, error) { 42 | var reply output 43 | err := t.client.Call("receive", rows, &reply) 44 | return reply.Logs, err 45 | } 46 | 47 | func (t *DestinationJSONRPC) EOS() ([]LogEntry, error) { 48 | var reply output 49 | err := t.client.Call("receive", nil, &reply) 50 | return reply.Logs, err 51 | } 52 | -------------------------------------------------------------------------------- /transforms/min.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | "fmt" 5 | "math" 6 | ) 7 | 8 | type min struct { 9 | result float64 10 | notNull bool 11 | am ArgumentMap 12 | } 13 | 14 | func (s *min) ParameterLen() int { 15 | return 1 16 | } 17 | 18 | func (s *min) SetArgumentMap(am ArgumentMap) { 19 | s.am = am 20 | } 21 | 22 | func (s *min) Reduce(arg []interface{}) error { 23 | args := s.am(arg) 24 | if len(args) != 1 { 25 | return fmt.Errorf("MIN takes exactly 1 argument but %v were provided", len(args)) 26 | } 27 | if args[0] == nil { 28 | return nil 29 | } 30 | if !s.notNull { 31 | //initialize result 32 | s.result = math.MaxFloat64 33 | } 34 | s.notNull = true 35 | switch v := args[0].(type) { 36 | case float64: 37 | s.result = math.Min(s.result, v) 38 | case int: 39 | s.result = math.Min(s.result, float64(v)) 40 | case int64: 41 | s.result = math.Min(s.result, float64(v)) 42 | case int32: 43 | s.result = math.Min(s.result, float64(v)) 44 | case string: 45 | value, _, err := parseTime(v) 46 | if err != nil { 47 | return err 48 | } 49 | s.result = math.Min(s.result, float64(value.Unix())) 50 | default: 51 | return fmt.Errorf("MIN takes a single numerical argument, but %v was provided", args[0]) 52 | } 53 | return nil 54 | } 55 | 56 | func (s *min) Return() *float64 { 57 | if !s.notNull { 58 | return nil 59 | } 60 | return &s.result 61 | } 62 | 63 | func (s *min) Copy() Reducer { 64 | return &min{am: s.am} 65 | } 66 | -------------------------------------------------------------------------------- /docs-src/node_modules/concat-map/README.markdown: -------------------------------------------------------------------------------- 1 | concat-map 2 | ========== 3 | 4 | Concatenative mapdashery. 5 | 6 | [![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map) 7 | 8 | [![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map) 9 | 10 | example 11 | ======= 12 | 13 | ``` js 14 | var concatMap = require('concat-map'); 15 | var xs = [ 1, 2, 3, 4, 5, 6 ]; 16 | var ys = concatMap(xs, function (x) { 17 | return x % 2 ? [ x - 0.1, x, x + 0.1 ] : []; 18 | }); 19 | console.dir(ys); 20 | ``` 21 | 22 | *** 23 | 24 | ``` 25 | [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ] 26 | ``` 27 | 28 | methods 29 | ======= 30 | 31 | ``` js 32 | var concatMap = require('concat-map') 33 | ``` 34 | 35 | concatMap(xs, fn) 36 | ----------------- 37 | 38 | Return an array of concatenated elements by calling `fn(x, i)` for each element 39 | `x` and each index `i` in the array `xs`. 40 | 41 | When `fn(x, i)` returns an array, its result will be concatenated with the 42 | result array. If `fn(x, i)` returns anything else, that value will be pushed 43 | onto the end of the result array. 44 | 45 | install 46 | ======= 47 | 48 | With [npm](http://npmjs.org) do: 49 | 50 | ``` 51 | npm install concat-map 52 | ``` 53 | 54 | license 55 | ======= 56 | 57 | MIT 58 | 59 | notes 60 | ===== 61 | 62 | This module was written while sitting high above the ground in a tree. 63 | -------------------------------------------------------------------------------- /docs-src/node_modules/docusaurus-init/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "docusaurus-init@^1.0.1", 3 | "_id": "docusaurus-init@1.0.1", 4 | "_inBundle": false, 5 | "_integrity": "sha512-uW/wBKbT/B5nXnlev5VIwpuCu0qGCCQ5CrNZGqK6A+/4Vhj0EbxbUuP5WZVrH3wOGMTrzFkouCWSb9+wcbozCQ==", 6 | "_location": "/docusaurus-init", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "docusaurus-init@^1.0.1", 12 | "name": "docusaurus-init", 13 | "escapedName": "docusaurus-init", 14 | "rawSpec": "^1.0.1", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.1" 17 | }, 18 | "_requiredBy": [ 19 | "#USER", 20 | "/" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/docusaurus-init/-/docusaurus-init-1.0.1.tgz", 23 | "_shasum": "153a06b131e9734c35186d4ab571d1df371e57fe", 24 | "_spec": "docusaurus-init@^1.0.1", 25 | "_where": "/home/mike/go/src/github.com/michaelbironneau/analyst/docs", 26 | "bin": { 27 | "docusaurus-init": "initialize.js" 28 | }, 29 | "bundleDependencies": false, 30 | "dependencies": { 31 | "chalk": "^2.1.0", 32 | "shelljs": "^0.7.8" 33 | }, 34 | "deprecated": false, 35 | "description": "Initialization script for Docusaurus", 36 | "keywords": [ 37 | "documentation", 38 | "websites", 39 | "open source", 40 | "docusaurus" 41 | ], 42 | "license": "MIT", 43 | "name": "docusaurus-init", 44 | "preferGlobal": true, 45 | "version": "1.0.1" 46 | } 47 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/pathfilter.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('#62: deep module references and the pathFilter', function (t) { 6 | t.plan(9); 7 | 8 | var resolverDir = path.join(__dirname, '/pathfilter/deep_ref'); 9 | var pathFilter = function (pkg, x, remainder) { 10 | t.equal(pkg.version, '1.2.3'); 11 | t.equal(x, path.join(resolverDir, 'node_modules/deep/ref')); 12 | t.equal(remainder, 'ref'); 13 | return 'alt'; 14 | }; 15 | 16 | resolve('deep/ref', { basedir: resolverDir }, function (err, res, pkg) { 17 | if (err) t.fail(err); 18 | 19 | t.equal(pkg.version, '1.2.3'); 20 | t.equal(res, path.join(resolverDir, 'node_modules/deep/ref.js')); 21 | }); 22 | 23 | resolve( 24 | 'deep/deeper/ref', 25 | { basedir: resolverDir }, 26 | function (err, res, pkg) { 27 | if (err) t.fail(err); 28 | t.notEqual(pkg, undefined); 29 | t.equal(pkg.version, '1.2.3'); 30 | t.equal(res, path.join(resolverDir, 'node_modules/deep/deeper/ref.js')); 31 | } 32 | ); 33 | 34 | resolve( 35 | 'deep/ref', 36 | { basedir: resolverDir, pathFilter: pathFilter }, 37 | function (err, res, pkg) { 38 | if (err) t.fail(err); 39 | t.equal(res, path.join(resolverDir, 'node_modules/deep/alt.js')); 40 | } 41 | ); 42 | }); 43 | -------------------------------------------------------------------------------- /transforms/max.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | "fmt" 5 | "math" 6 | ) 7 | 8 | type max struct { 9 | result float64 10 | notNull bool 11 | am ArgumentMap 12 | } 13 | 14 | func (s *max) ParameterLen() int { 15 | return 1 16 | } 17 | 18 | func (s *max) SetArgumentMap(am ArgumentMap) { 19 | s.am = am 20 | } 21 | 22 | func (s *max) Reduce(arg []interface{}) error { 23 | args := s.am(arg) 24 | if len(args) != 1 { 25 | return fmt.Errorf("max takes exactly 1 argument but %v were provided", len(args)) 26 | } 27 | if args[0] == nil { 28 | return nil 29 | } 30 | if !s.notNull { 31 | s.result = -1 * math.MaxFloat64 32 | } 33 | s.notNull = true 34 | if args[0] == nil { 35 | return nil //ignore 36 | } 37 | switch v := args[0].(type) { 38 | case float64: 39 | s.result = math.Max(s.result, v) 40 | case int: 41 | s.result = math.Max(s.result, float64(v)) 42 | case int64: 43 | s.result = math.Max(s.result, float64(v)) 44 | case int32: 45 | s.result = math.Max(s.result, float64(v)) 46 | case string: 47 | value, _, err := parseTime(v) 48 | if err != nil { 49 | return err 50 | } 51 | s.result = math.Max(s.result, float64(value.Unix())) 52 | default: 53 | return fmt.Errorf("max takes a single numerical argument, but %v was provided", args[0]) 54 | } 55 | return nil 56 | } 57 | 58 | func (s *max) Return() *float64 { 59 | if !s.notNull { 60 | return nil 61 | } 62 | return &s.result 63 | } 64 | 65 | func (s *max) Copy() Reducer { 66 | return &max{am: s.am} 67 | } 68 | -------------------------------------------------------------------------------- /docs-src/website/pages/en/users.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | const React = require('react'); 9 | 10 | const CompLibrary = require('../../core/CompLibrary.js'); 11 | const Container = CompLibrary.Container; 12 | 13 | const siteConfig = require(process.cwd() + '/siteConfig.js'); 14 | 15 | class Users extends React.Component { 16 | render() { 17 | const showcase = siteConfig.users.map((user, i) => { 18 | return ( 19 | 20 | 21 | 22 | ); 23 | }); 24 | 25 | return ( 26 |
27 | 28 |
29 |
30 |

Who's Using This?

31 |

This project is used by many folks

32 |
33 |
{showcase}
34 |

Are you using this project?

35 | 38 | Add your company 39 | 40 |
41 |
42 |
43 | ); 44 | } 45 | } 46 | 47 | module.exports = Users; 48 | -------------------------------------------------------------------------------- /http/static/inline.c1aa1fa120fc05b06801.bundle.js: -------------------------------------------------------------------------------- 1 | !function(e){var n=window.webpackJsonp;window.webpackJsonp=function(r,a,c){for(var f,u,i,d=0,l=[];d -1) { 12 | targetArgs = args.slice(dashesLoc + 1, args.length); 13 | args = args.slice(0, dashesLoc); 14 | } 15 | 16 | // This ensures we only execute the script targets after the entire script has 17 | // been evaluated 18 | setTimeout(function() { 19 | var t; 20 | 21 | if (args.length === 1 && args[0] === '--help') { 22 | console.log('Available targets:'); 23 | for (t in global.target) 24 | console.log(' ' + t); 25 | return; 26 | } 27 | 28 | // Wrap targets to prevent duplicate execution 29 | for (t in global.target) { 30 | (function(t, oldTarget){ 31 | 32 | // Wrap it 33 | global.target[t] = function() { 34 | if (!oldTarget.done){ 35 | oldTarget.done = true; 36 | oldTarget.result = oldTarget.apply(oldTarget, arguments); 37 | } 38 | return oldTarget.result; 39 | }; 40 | 41 | })(t, global.target[t]); 42 | } 43 | 44 | // Execute desired targets 45 | if (args.length > 0) { 46 | args.forEach(function(arg) { 47 | if (arg in global.target) 48 | global.target[arg](targetArgs); 49 | else { 50 | console.log('no such target: ' + arg); 51 | } 52 | }); 53 | } else if ('all' in global.target) { 54 | global.target.all(targetArgs); 55 | } 56 | 57 | }, 0); 58 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/node_path.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('$NODE_PATH', function (t) { 6 | t.plan(4); 7 | 8 | resolve('aaa', { 9 | paths: [ 10 | path.join(__dirname, '/node_path/x'), 11 | path.join(__dirname, '/node_path/y') 12 | ], 13 | basedir: __dirname 14 | }, function (err, res) { 15 | t.equal(res, path.join(__dirname, '/node_path/x/aaa/index.js')); 16 | }); 17 | 18 | resolve('bbb', { 19 | paths: [ 20 | path.join(__dirname, '/node_path/x'), 21 | path.join(__dirname, '/node_path/y') 22 | ], 23 | basedir: __dirname 24 | }, function (err, res) { 25 | t.equal(res, path.join(__dirname, '/node_path/y/bbb/index.js')); 26 | }); 27 | 28 | resolve('ccc', { 29 | paths: [ 30 | path.join(__dirname, '/node_path/x'), 31 | path.join(__dirname, '/node_path/y') 32 | ], 33 | basedir: __dirname 34 | }, function (err, res) { 35 | t.equal(res, path.join(__dirname, '/node_path/x/ccc/index.js')); 36 | }); 37 | 38 | // ensure that relative paths still resolve against the 39 | // regular `node_modules` correctly 40 | resolve('tap', { 41 | paths: [ 42 | 'node_path' 43 | ], 44 | basedir: 'node_path/x' 45 | }, function (err, res) { 46 | var root = require('tap/package.json').main; 47 | t.equal(res, path.resolve(__dirname, '..', 'node_modules/tap', root)); 48 | }); 49 | }); 50 | -------------------------------------------------------------------------------- /docs-src/node_modules/inflight/inflight.js: -------------------------------------------------------------------------------- 1 | var wrappy = require('wrappy') 2 | var reqs = Object.create(null) 3 | var once = require('once') 4 | 5 | module.exports = wrappy(inflight) 6 | 7 | function inflight (key, cb) { 8 | if (reqs[key]) { 9 | reqs[key].push(cb) 10 | return null 11 | } else { 12 | reqs[key] = [cb] 13 | return makeres(key) 14 | } 15 | } 16 | 17 | function makeres (key) { 18 | return once(function RES () { 19 | var cbs = reqs[key] 20 | var len = cbs.length 21 | var args = slice(arguments) 22 | 23 | // XXX It's somewhat ambiguous whether a new callback added in this 24 | // pass should be queued for later execution if something in the 25 | // list of callbacks throws, or if it should just be discarded. 26 | // However, it's such an edge case that it hardly matters, and either 27 | // choice is likely as surprising as the other. 28 | // As it happens, we do go ahead and schedule it for later execution. 29 | try { 30 | for (var i = 0; i < len; i++) { 31 | cbs[i].apply(null, args) 32 | } 33 | } finally { 34 | if (cbs.length > len) { 35 | // added more in the interim. 36 | // de-zalgo, just in case, but don't call again. 37 | cbs.splice(0, len) 38 | process.nextTick(function () { 39 | RES.apply(null, args) 40 | }) 41 | } else { 42 | delete reqs[key] 43 | } 44 | } 45 | }) 46 | } 47 | 48 | function slice (args) { 49 | var length = args.length 50 | var array = [] 51 | 52 | for (var i = 0; i < length; i++) array[i] = args[i] 53 | return array 54 | } 55 | -------------------------------------------------------------------------------- /docs-src/website/pages/en/help.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | const React = require('react'); 9 | 10 | const CompLibrary = require('../../core/CompLibrary.js'); 11 | const Container = CompLibrary.Container; 12 | const GridBlock = CompLibrary.GridBlock; 13 | 14 | const siteConfig = require(process.cwd() + '/siteConfig.js'); 15 | 16 | class Help extends React.Component { 17 | render() { 18 | const supportLinks = [ 19 | { 20 | content: 21 | 'Learn more using the [documentation on this site.](docs/intro.html)', 22 | title: 'Browse Docs', 23 | }, 24 | { 25 | content: 'Ask questions about the documentation and project', 26 | title: 'Join the community', 27 | }, 28 | { 29 | content: "Find out what's new with this project", 30 | title: 'Stay up to date', 31 | }, 32 | ]; 33 | 34 | return ( 35 |
36 | 37 |
38 |
39 |

Need help?

40 |
41 |

This project is maintained by a dedicated group of people.

42 | 43 |
44 |
45 |
46 | ); 47 | } 48 | } 49 | 50 | module.exports = Help; 51 | -------------------------------------------------------------------------------- /docs-src/node_modules/fs.realpath/index.js: -------------------------------------------------------------------------------- 1 | module.exports = realpath 2 | realpath.realpath = realpath 3 | realpath.sync = realpathSync 4 | realpath.realpathSync = realpathSync 5 | realpath.monkeypatch = monkeypatch 6 | realpath.unmonkeypatch = unmonkeypatch 7 | 8 | var fs = require('fs') 9 | var origRealpath = fs.realpath 10 | var origRealpathSync = fs.realpathSync 11 | 12 | var version = process.version 13 | var ok = /^v[0-5]\./.test(version) 14 | var old = require('./old.js') 15 | 16 | function newError (er) { 17 | return er && er.syscall === 'realpath' && ( 18 | er.code === 'ELOOP' || 19 | er.code === 'ENOMEM' || 20 | er.code === 'ENAMETOOLONG' 21 | ) 22 | } 23 | 24 | function realpath (p, cache, cb) { 25 | if (ok) { 26 | return origRealpath(p, cache, cb) 27 | } 28 | 29 | if (typeof cache === 'function') { 30 | cb = cache 31 | cache = null 32 | } 33 | origRealpath(p, cache, function (er, result) { 34 | if (newError(er)) { 35 | old.realpath(p, cache, cb) 36 | } else { 37 | cb(er, result) 38 | } 39 | }) 40 | } 41 | 42 | function realpathSync (p, cache) { 43 | if (ok) { 44 | return origRealpathSync(p, cache) 45 | } 46 | 47 | try { 48 | return origRealpathSync(p, cache) 49 | } catch (er) { 50 | if (newError(er)) { 51 | return old.realpathSync(p, cache) 52 | } else { 53 | throw er 54 | } 55 | } 56 | } 57 | 58 | function monkeypatch () { 59 | fs.realpath = realpath 60 | fs.realpathSync = realpathSync 61 | } 62 | 63 | function unmonkeypatch () { 64 | fs.realpath = origRealpath 65 | fs.realpathSync = origRealpathSync 66 | } 67 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/set.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | 3 | common.register('set', _set, { 4 | allowGlobbing: false, 5 | wrapOutput: false, 6 | }); 7 | 8 | //@ 9 | //@ ### set(options) 10 | //@ Available options: 11 | //@ 12 | //@ + `+/-e`: exit upon error (`config.fatal`) 13 | //@ + `+/-v`: verbose: show all commands (`config.verbose`) 14 | //@ + `+/-f`: disable filename expansion (globbing) 15 | //@ 16 | //@ Examples: 17 | //@ 18 | //@ ```javascript 19 | //@ set('-e'); // exit upon first error 20 | //@ set('+e'); // this undoes a "set('-e')" 21 | //@ ``` 22 | //@ 23 | //@ Sets global configuration variables 24 | function _set(options) { 25 | if (!options) { 26 | var args = [].slice.call(arguments, 0); 27 | if (args.length < 2) common.error('must provide an argument'); 28 | options = args[1]; 29 | } 30 | var negate = (options[0] === '+'); 31 | if (negate) { 32 | options = '-' + options.slice(1); // parseOptions needs a '-' prefix 33 | } 34 | options = common.parseOptions(options, { 35 | 'e': 'fatal', 36 | 'v': 'verbose', 37 | 'f': 'noglob', 38 | }); 39 | 40 | if (negate) { 41 | Object.keys(options).forEach(function (key) { 42 | options[key] = !options[key]; 43 | }); 44 | } 45 | 46 | Object.keys(options).forEach(function (key) { 47 | // Only change the global config if `negate` is false and the option is true 48 | // or if `negate` is true and the option is false (aka negate !== option) 49 | if (negate !== options[key]) { 50 | common.config[key] = options[key]; 51 | } 52 | }); 53 | return; 54 | } 55 | module.exports = _set; 56 | -------------------------------------------------------------------------------- /docs-src/node_modules/color-name/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "color-name@^1.1.1", 3 | "_id": "color-name@1.1.3", 4 | "_inBundle": false, 5 | "_integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", 6 | "_location": "/color-name", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "color-name@^1.1.1", 12 | "name": "color-name", 13 | "escapedName": "color-name", 14 | "rawSpec": "^1.1.1", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.1.1" 17 | }, 18 | "_requiredBy": [ 19 | "/color-convert" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", 22 | "_shasum": "a7d0558bd89c42f795dd42328f740831ca53bc25", 23 | "_spec": "color-name@^1.1.1", 24 | "_where": "/home/mike/go/src/github.com/michaelbironneau/analyst/docs/node_modules/color-convert", 25 | "author": { 26 | "name": "DY", 27 | "email": "dfcreative@gmail.com" 28 | }, 29 | "bugs": { 30 | "url": "https://github.com/dfcreative/color-name/issues" 31 | }, 32 | "bundleDependencies": false, 33 | "deprecated": false, 34 | "description": "A list of color names and its values", 35 | "homepage": "https://github.com/dfcreative/color-name", 36 | "keywords": [ 37 | "color-name", 38 | "color", 39 | "color-keyword", 40 | "keyword" 41 | ], 42 | "license": "MIT", 43 | "main": "index.js", 44 | "name": "color-name", 45 | "repository": { 46 | "type": "git", 47 | "url": "git+ssh://git@github.com/dfcreative/color-name.git" 48 | }, 49 | "scripts": { 50 | "test": "node test.js" 51 | }, 52 | "version": "1.1.3" 53 | } 54 | -------------------------------------------------------------------------------- /docs-src/node_modules/rechoir/index.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | 3 | const extension = require('./lib/extension'); 4 | const normalize = require('./lib/normalize'); 5 | const register = require('./lib/register'); 6 | 7 | exports.prepare = function (extensions, filepath, cwd, nothrow) { 8 | var option, attempt; 9 | var attempts = []; 10 | var err; 11 | var onlyErrors = false; 12 | var ext = extension(filepath); 13 | if (Object.keys(require.extensions).indexOf(ext) !== -1) { 14 | return true; 15 | } 16 | var config = normalize(extensions[ext]); 17 | if (!config) { 18 | if (nothrow) { 19 | return; 20 | } else { 21 | throw new Error('No module loader found for "'+ext+'".'); 22 | } 23 | } 24 | if (!cwd) { 25 | cwd = path.dirname(path.resolve(filepath)); 26 | } 27 | if (!Array.isArray(config)) { 28 | config = [config]; 29 | } 30 | for (var i in config) { 31 | option = config[i]; 32 | attempt = register(cwd, option.module, option.register); 33 | error = (attempt instanceof Error) ? attempt : null; 34 | if (error) { 35 | attempt = null; 36 | } 37 | attempts.push({ 38 | moduleName: option.module, 39 | module: attempt, 40 | error: error 41 | }); 42 | if (!error) { 43 | onlyErrors = false; 44 | break; 45 | } else { 46 | onlyErrors = true; 47 | } 48 | } 49 | if (onlyErrors) { 50 | err = new Error('Unable to use specified module loaders for "'+ext+'".'); 51 | err.failures = attempts; 52 | if (nothrow) { 53 | return err; 54 | } else { 55 | throw err; 56 | } 57 | } 58 | return attempts; 59 | }; 60 | -------------------------------------------------------------------------------- /docs-src/node_modules/wrappy/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "wrappy@1", 3 | "_id": "wrappy@1.0.2", 4 | "_inBundle": false, 5 | "_integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", 6 | "_location": "/wrappy", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "wrappy@1", 12 | "name": "wrappy", 13 | "escapedName": "wrappy", 14 | "rawSpec": "1", 15 | "saveSpec": null, 16 | "fetchSpec": "1" 17 | }, 18 | "_requiredBy": [ 19 | "/inflight", 20 | "/once" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", 23 | "_shasum": "b5243d8f3ec1aa35f1364605bc0d1036e30ab69f", 24 | "_spec": "wrappy@1", 25 | "_where": "/home/mike/go/src/github.com/michaelbironneau/analyst/docs/node_modules/inflight", 26 | "author": { 27 | "name": "Isaac Z. Schlueter", 28 | "email": "i@izs.me", 29 | "url": "http://blog.izs.me/" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/npm/wrappy/issues" 33 | }, 34 | "bundleDependencies": false, 35 | "dependencies": {}, 36 | "deprecated": false, 37 | "description": "Callback wrapping utility", 38 | "devDependencies": { 39 | "tap": "^2.3.1" 40 | }, 41 | "directories": { 42 | "test": "test" 43 | }, 44 | "files": [ 45 | "wrappy.js" 46 | ], 47 | "homepage": "https://github.com/npm/wrappy", 48 | "license": "ISC", 49 | "main": "wrappy.js", 50 | "name": "wrappy", 51 | "repository": { 52 | "type": "git", 53 | "url": "git+https://github.com/npm/wrappy.git" 54 | }, 55 | "scripts": { 56 | "test": "tap --coverage test/*.js" 57 | }, 58 | "version": "1.0.2" 59 | } 60 | -------------------------------------------------------------------------------- /transforms/cdf.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | "fmt" 5 | "github.com/influxdata/tdigest" 6 | ) 7 | 8 | type cdf struct { 9 | td *tdigest.TDigest 10 | notNull bool 11 | notFirst bool 12 | val float64 13 | am ArgumentMap 14 | } 15 | 16 | func (q *cdf) ParameterLen() int { 17 | return 2 18 | } 19 | 20 | func (q *cdf) SetArgumentMap(am ArgumentMap) { 21 | q.am = am 22 | } 23 | 24 | func (q *cdf) Reduce(arg []interface{}) error { 25 | if q.td == nil { 26 | q.td = tdigest.New() 27 | } 28 | 29 | args := q.am(arg) 30 | 31 | if len(args) != 2 { 32 | return fmt.Errorf("CDF takes exactly 2 arguments but %v were provided", len(args)) 33 | } 34 | f, ok := args[1].(float64) 35 | 36 | if !ok { 37 | return fmt.Errorf("CDF expects second argument to be a float representing the value") 38 | } 39 | 40 | if q.notFirst && (f != q.val) { 41 | return fmt.Errorf("CDF expects the value for each group to be constant") 42 | } 43 | 44 | q.val = f 45 | 46 | q.notFirst = true 47 | if args[0] == nil { 48 | return nil 49 | } 50 | q.notNull = true 51 | switch v := args[0].(type) { 52 | case float64: 53 | q.td.Add(v, 1) 54 | case int: 55 | q.td.Add(float64(v), 1) 56 | case int64: 57 | q.td.Add(float64(v), 1) 58 | case int32: 59 | q.td.Add(float64(v), 1) 60 | default: 61 | return fmt.Errorf("QUANTILE wants its first argument to be numeric but %v was provided", args[0]) 62 | } 63 | return nil 64 | } 65 | 66 | func (q *cdf) Return() *float64 { 67 | if !q.notNull || !q.notFirst { 68 | return nil 69 | } 70 | f := q.td.CDF(q.val) 71 | return &f 72 | } 73 | 74 | func (q *cdf) Copy() Reducer { 75 | return &quantile{am: q.am} 76 | } 77 | -------------------------------------------------------------------------------- /docs-src/node_modules/color-convert/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 1.0.0 - 2016-01-07 2 | 3 | - Removed: unused speed test 4 | - Added: Automatic routing between previously unsupported conversions 5 | ([#27](https://github.com/Qix-/color-convert/pull/27)) 6 | - Removed: `xxx2xxx()` and `xxx2xxxRaw()` functions 7 | ([#27](https://github.com/Qix-/color-convert/pull/27)) 8 | - Removed: `convert()` class 9 | ([#27](https://github.com/Qix-/color-convert/pull/27)) 10 | - Changed: all functions to lookup dictionary 11 | ([#27](https://github.com/Qix-/color-convert/pull/27)) 12 | - Changed: `ansi` to `ansi256` 13 | ([#27](https://github.com/Qix-/color-convert/pull/27)) 14 | - Fixed: argument grouping for functions requiring only one argument 15 | ([#27](https://github.com/Qix-/color-convert/pull/27)) 16 | 17 | # 0.6.0 - 2015-07-23 18 | 19 | - Added: methods to handle 20 | [ANSI](https://en.wikipedia.org/wiki/ANSI_escape_code#Colors) 16/256 colors: 21 | - rgb2ansi16 22 | - rgb2ansi 23 | - hsl2ansi16 24 | - hsl2ansi 25 | - hsv2ansi16 26 | - hsv2ansi 27 | - hwb2ansi16 28 | - hwb2ansi 29 | - cmyk2ansi16 30 | - cmyk2ansi 31 | - keyword2ansi16 32 | - keyword2ansi 33 | - ansi162rgb 34 | - ansi162hsl 35 | - ansi162hsv 36 | - ansi162hwb 37 | - ansi162cmyk 38 | - ansi162keyword 39 | - ansi2rgb 40 | - ansi2hsl 41 | - ansi2hsv 42 | - ansi2hwb 43 | - ansi2cmyk 44 | - ansi2keyword 45 | ([#18](https://github.com/harthur/color-convert/pull/18)) 46 | 47 | # 0.5.3 - 2015-06-02 48 | 49 | - Fixed: hsl2hsv does not return `NaN` anymore when using `[0,0,0]` 50 | ([#15](https://github.com/harthur/color-convert/issues/15)) 51 | 52 | --- 53 | 54 | Check out commit logs for older releases 55 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Artur Adib 2 | All rights reserved. 3 | 4 | You may use this project under the terms of the New BSD license as follows: 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | * Neither the name of Artur Adib nor the 14 | names of the contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20 | ARE DISCLAIMED. IN NO EVENT SHALL ARTUR ADIB BE LIABLE FOR ANY 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /docs-src/docs/http.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: http 3 | title: Getting data from Web APIs 4 | --- 5 | 6 | In this easy recipe, we're going to get a list of awardees from Chronicling America and figure out how many awardees are University-based academics. 7 | 8 | Looking at the data in a web browser, you will see the below structure, truncated for brevity: 9 | 10 | ``` 11 | { 12 | "awardees": [ 13 | { 14 | "url": "http://chroniclingamerica.loc.gov/awardees/ak.json", 15 | "name": "Alaska State Library Historical Collections" 16 | }, 17 | { 18 | "url": "http://chroniclingamerica.loc.gov/awardees/az.json", 19 | "name": "Arizona State Library, Archives and Public Records; Phoenix, AZ" 20 | }, 21 | { 22 | "url": "http://chroniclingamerica.loc.gov/awardees/mimtptc.json", 23 | "name": "Central Michigan University, Clark Historical Library" 24 | }] 25 | } 26 | ``` 27 | 28 | The array of awardees is contained in the JSON-path `awardees`, and the column names will be `URL` and `Name`. 29 | 30 | ## Printing the Awardees on the console 31 | 32 | ``` 33 | CONNECTION 'WebAPI' ( 34 | DRIVER = 'http', 35 | URL = 'https://chroniclingamerica.loc.gov/awardees.json', 36 | JSON_PATH = 'awardees', 37 | COLUMNS = 'URL, Name' 38 | ) 39 | 40 | QUERY 'Aggregate' FROM CONNECTION WebAPI ( 41 | --Select how many awardees are universities 42 | SELECT 'The Magic Answer Is', COUNT(*) As NumberOfUniversityAwardees FROM WebAPI 43 | WHERE Name LIKE '%university%' 44 | ) INTO CONSOLE 45 | ``` 46 | 47 | In the above, we are making use of the Auto-SQL source. This will fetch all the rows from the HTTP API and insert them into a temporary staging table, in-memory, allowing us to run any SQLite3-compatible query. -------------------------------------------------------------------------------- /docs-src/node_modules/inflight/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "inflight@^1.0.4", 3 | "_id": "inflight@1.0.6", 4 | "_inBundle": false, 5 | "_integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", 6 | "_location": "/inflight", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "inflight@^1.0.4", 12 | "name": "inflight", 13 | "escapedName": "inflight", 14 | "rawSpec": "^1.0.4", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.4" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", 22 | "_shasum": "49bd6331d7d02d0c09bc910a1075ba8165b56df9", 23 | "_spec": "inflight@^1.0.4", 24 | "_where": "/home/mike/go/src/github.com/michaelbironneau/analyst/docs/node_modules/glob", 25 | "author": { 26 | "name": "Isaac Z. Schlueter", 27 | "email": "i@izs.me", 28 | "url": "http://blog.izs.me/" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/isaacs/inflight/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": { 35 | "once": "^1.3.0", 36 | "wrappy": "1" 37 | }, 38 | "deprecated": false, 39 | "description": "Add callbacks to requests in flight to avoid async duplication", 40 | "devDependencies": { 41 | "tap": "^7.1.2" 42 | }, 43 | "files": [ 44 | "inflight.js" 45 | ], 46 | "homepage": "https://github.com/isaacs/inflight", 47 | "license": "ISC", 48 | "main": "inflight.js", 49 | "name": "inflight", 50 | "repository": { 51 | "type": "git", 52 | "url": "git+https://github.com/npm/inflight.git" 53 | }, 54 | "scripts": { 55 | "test": "tap test.js --100" 56 | }, 57 | "version": "1.0.6" 58 | } 59 | -------------------------------------------------------------------------------- /docs-src/node_modules/glob/changelog.md: -------------------------------------------------------------------------------- 1 | ## 7.0 2 | 3 | - Raise error if `options.cwd` is specified, and not a directory 4 | 5 | ## 6.0 6 | 7 | - Remove comment and negation pattern support 8 | - Ignore patterns are always in `dot:true` mode 9 | 10 | ## 5.0 11 | 12 | - Deprecate comment and negation patterns 13 | - Fix regression in `mark` and `nodir` options from making all cache 14 | keys absolute path. 15 | - Abort if `fs.readdir` returns an error that's unexpected 16 | - Don't emit `match` events for ignored items 17 | - Treat ENOTSUP like ENOTDIR in readdir 18 | 19 | ## 4.5 20 | 21 | - Add `options.follow` to always follow directory symlinks in globstar 22 | - Add `options.realpath` to call `fs.realpath` on all results 23 | - Always cache based on absolute path 24 | 25 | ## 4.4 26 | 27 | - Add `options.ignore` 28 | - Fix handling of broken symlinks 29 | 30 | ## 4.3 31 | 32 | - Bump minimatch to 2.x 33 | - Pass all tests on Windows 34 | 35 | ## 4.2 36 | 37 | - Add `glob.hasMagic` function 38 | - Add `options.nodir` flag 39 | 40 | ## 4.1 41 | 42 | - Refactor sync and async implementations for performance 43 | - Throw if callback provided to sync glob function 44 | - Treat symbolic links in globstar results the same as Bash 4.3 45 | 46 | ## 4.0 47 | 48 | - Use `^` for dependency versions (bumped major because this breaks 49 | older npm versions) 50 | - Ensure callbacks are only ever called once 51 | - switch to ISC license 52 | 53 | ## 3.x 54 | 55 | - Rewrite in JavaScript 56 | - Add support for setting root, cwd, and windows support 57 | - Cache many fs calls 58 | - Add globstar support 59 | - emit match events 60 | 61 | ## 2.x 62 | 63 | - Use `glob.h` and `fnmatch.h` from NetBSD 64 | 65 | ## 1.x 66 | 67 | - `glob.h` static binding. 68 | -------------------------------------------------------------------------------- /transforms/quantile.go: -------------------------------------------------------------------------------- 1 | package transforms 2 | 3 | import ( 4 | "fmt" 5 | "github.com/influxdata/tdigest" 6 | ) 7 | 8 | type quantile struct { 9 | td *tdigest.TDigest 10 | notNull bool 11 | notFirst bool 12 | quantile float64 13 | am ArgumentMap 14 | } 15 | 16 | func (q *quantile) ParameterLen() int { 17 | return 2 18 | } 19 | 20 | func (q *quantile) SetArgumentMap(am ArgumentMap) { 21 | q.am = am 22 | } 23 | 24 | func (q *quantile) Reduce(arg []interface{}) error { 25 | if q.td == nil { 26 | q.td = tdigest.New() 27 | } 28 | 29 | args := q.am(arg) 30 | 31 | if len(args) != 2 { 32 | return fmt.Errorf("QUANTILE takes exactly 2 arguments but %v were provided", len(args)) 33 | } 34 | f, ok := args[1].(float64) 35 | 36 | if !ok { 37 | return fmt.Errorf("QUANTILE expects second argument to be a float between 0 and 1 representing the quantile") 38 | } 39 | 40 | if q.notFirst && (f != q.quantile) { 41 | return fmt.Errorf("QUANTILE expects the quantile for each group to be constant") 42 | } 43 | 44 | q.quantile = f 45 | 46 | q.notFirst = true 47 | if args[0] == nil { 48 | return nil 49 | } 50 | q.notNull = true 51 | switch v := args[0].(type) { 52 | case float64: 53 | q.td.Add(v, 1) 54 | case int: 55 | q.td.Add(float64(v), 1) 56 | case int64: 57 | q.td.Add(float64(v), 1) 58 | case int32: 59 | q.td.Add(float64(v), 1) 60 | default: 61 | return fmt.Errorf("QUANTILE wants its first argument to be numeric but %v was provided", args[0]) 62 | } 63 | return nil 64 | } 65 | 66 | func (q *quantile) Return() *float64 { 67 | if !q.notNull || !q.notFirst { 68 | return nil 69 | } 70 | f := q.td.Quantile(q.quantile) 71 | return &f 72 | } 73 | 74 | func (q *quantile) Copy() Reducer { 75 | return &quantile{am: q.am} 76 | } 77 | -------------------------------------------------------------------------------- /docs-src/node_modules/path-parse/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "path-parse@^1.0.5", 3 | "_id": "path-parse@1.0.5", 4 | "_inBundle": false, 5 | "_integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=", 6 | "_location": "/path-parse", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "path-parse@^1.0.5", 12 | "name": "path-parse", 13 | "escapedName": "path-parse", 14 | "rawSpec": "^1.0.5", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.5" 17 | }, 18 | "_requiredBy": [ 19 | "/resolve" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", 22 | "_shasum": "3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1", 23 | "_spec": "path-parse@^1.0.5", 24 | "_where": "/home/mike/go/src/github.com/michaelbironneau/analyst/docs/node_modules/resolve", 25 | "author": { 26 | "name": "Javier Blanco", 27 | "email": "http://jbgutierrez.info" 28 | }, 29 | "bugs": { 30 | "url": "https://github.com/jbgutierrez/path-parse/issues" 31 | }, 32 | "bundleDependencies": false, 33 | "deprecated": false, 34 | "description": "Node.js path.parse() ponyfill", 35 | "homepage": "https://github.com/jbgutierrez/path-parse#readme", 36 | "keywords": [ 37 | "path", 38 | "paths", 39 | "file", 40 | "dir", 41 | "parse", 42 | "built-in", 43 | "util", 44 | "utils", 45 | "core", 46 | "ponyfill", 47 | "polyfill", 48 | "shim" 49 | ], 50 | "license": "MIT", 51 | "main": "index.js", 52 | "name": "path-parse", 53 | "repository": { 54 | "type": "git", 55 | "url": "git+https://github.com/jbgutierrez/path-parse.git" 56 | }, 57 | "scripts": { 58 | "test": "node test.js" 59 | }, 60 | "version": "1.0.5" 61 | } 62 | -------------------------------------------------------------------------------- /docs-src/node_modules/inherits/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "inherits@2", 3 | "_id": "inherits@2.0.3", 4 | "_inBundle": false, 5 | "_integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", 6 | "_location": "/inherits", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "inherits@2", 12 | "name": "inherits", 13 | "escapedName": "inherits", 14 | "rawSpec": "2", 15 | "saveSpec": null, 16 | "fetchSpec": "2" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", 22 | "_shasum": "633c2c83e3da42a502f52466022480f4208261de", 23 | "_spec": "inherits@2", 24 | "_where": "/home/mike/go/src/github.com/michaelbironneau/analyst/docs/node_modules/glob", 25 | "browser": "./inherits_browser.js", 26 | "bugs": { 27 | "url": "https://github.com/isaacs/inherits/issues" 28 | }, 29 | "bundleDependencies": false, 30 | "deprecated": false, 31 | "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", 32 | "devDependencies": { 33 | "tap": "^7.1.0" 34 | }, 35 | "files": [ 36 | "inherits.js", 37 | "inherits_browser.js" 38 | ], 39 | "homepage": "https://github.com/isaacs/inherits#readme", 40 | "keywords": [ 41 | "inheritance", 42 | "class", 43 | "klass", 44 | "oop", 45 | "object-oriented", 46 | "inherits", 47 | "browser", 48 | "browserify" 49 | ], 50 | "license": "ISC", 51 | "main": "./inherits.js", 52 | "name": "inherits", 53 | "repository": { 54 | "type": "git", 55 | "url": "git://github.com/isaacs/inherits.git" 56 | }, 57 | "scripts": { 58 | "test": "node test" 59 | }, 60 | "version": "2.0.3" 61 | } 62 | -------------------------------------------------------------------------------- /plugins/destination.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # Description: A sample asynchronous RPC server plugin over STDIO in python that works with natefiinch/pie 4 | # Usage: 5 | # pip install pyjsonrpc 6 | # go run master.go 7 | 8 | import sys 9 | import pyjsonrpc 10 | 11 | #f = open('debug.txt', 'w') 12 | 13 | class Destination(pyjsonrpc.JsonRpc): 14 | """ 15 | JsonRpc subprocess test 16 | """ 17 | options = {} 18 | sources = [] 19 | destinations = [] 20 | input_columns = {} 21 | output_columns = {} 22 | process = None 23 | 24 | @pyjsonrpc.rpcmethod 25 | def set_option(self, opt): 26 | """Set the option""" 27 | self.options[opt["name"]] = opt["value"] 28 | return "" 29 | 30 | @pyjsonrpc.rpcmethod 31 | def set_sources(self, names): 32 | self.sources = names 33 | return "" 34 | 35 | @pyjsonrpc.rpcmethod 36 | def set_input_columns(self, columns): 37 | self.input_columns[columns["source"]] = columns["columns"] 38 | return "" 39 | 40 | @pyjsonrpc.rpcmethod 41 | def receive(self, rows): 42 | return {} 43 | 44 | 45 | def main(): 46 | rpc = Destination() 47 | line = sys.stdin.readline() 48 | 49 | # This is a synchronous way to poll stdin, but because we 50 | while line: 51 | try: 52 | this_input = line 53 | out = rpc.call(this_input) 54 | if out: 55 | sys.stdout.write(out + "\n") 56 | sys.stdout.flush() 57 | except Exception as e: 58 | pass 59 | #f.write("Exception occured {0}\n".format(e)) 60 | #f.flush() 61 | finally: 62 | line = sys.stdin.readline() 63 | if __name__ == "__main__": 64 | main() 65 | #f.close() -------------------------------------------------------------------------------- /docs-src/node_modules/docusaurus-init/initialize.js: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env node 2 | 3 | /** 4 | * Copyright (c) 2017-present, Facebook, Inc. 5 | * 6 | * This source code is licensed under the MIT license found in the 7 | * LICENSE file in the root directory of this source tree. 8 | */ 9 | 10 | const shell = require("shelljs"); 11 | const chalk = require("chalk"); 12 | const fs = require("fs"); 13 | 14 | const CWD = process.cwd(); 15 | 16 | let useYarn = false; 17 | if (shell.which("yarn")) { 18 | useYarn = true; 19 | } 20 | 21 | if (fs.existsSync(CWD + "/website")) { 22 | console.error(chalk.yellow("Website folder already exists.\n")); 23 | console.log( 24 | "In order for Docusaurus to get set up as your static site generator, you will need to remove any existing 'website' folder from your root directory. If you are migrating from another static site generator, you may want to move your old website folder to a different location." 25 | ); 26 | process.exit(1); 27 | } 28 | 29 | shell.cd(CWD); 30 | 31 | shell.mkdir("website"); 32 | 33 | console.log(chalk.green("Website folder created!\n")); 34 | 35 | shell.cd("website"); 36 | 37 | console.log( 38 | chalk.yellow("Installing latest version of Docusaurus in website.\n") 39 | ); 40 | 41 | const packageContent = { scripts: { examples: "docusaurus-examples" } }; 42 | fs.writeFileSync( 43 | CWD + "/website/package.json", 44 | JSON.stringify(packageContent, null, 2) + "\n" 45 | ); 46 | 47 | if (useYarn) { 48 | shell.exec("yarn add docusaurus --dev"); 49 | } else { 50 | shell.exec("npm install docusaurus --save-dev"); 51 | } 52 | 53 | console.log(chalk.green("Docusaurus installed in website folder!\n")); 54 | 55 | if (useYarn) { 56 | shell.exec("yarn run examples"); 57 | } else { 58 | shell.exec("npm run examples"); 59 | } 60 | -------------------------------------------------------------------------------- /docs-src/node_modules/once/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "once@^1.3.0", 3 | "_id": "once@1.4.0", 4 | "_inBundle": false, 5 | "_integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", 6 | "_location": "/once", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "once@^1.3.0", 12 | "name": "once", 13 | "escapedName": "once", 14 | "rawSpec": "^1.3.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.3.0" 17 | }, 18 | "_requiredBy": [ 19 | "/glob", 20 | "/inflight" 21 | ], 22 | "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", 23 | "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", 24 | "_spec": "once@^1.3.0", 25 | "_where": "/home/mike/go/src/github.com/michaelbironneau/analyst/docs/node_modules/glob", 26 | "author": { 27 | "name": "Isaac Z. Schlueter", 28 | "email": "i@izs.me", 29 | "url": "http://blog.izs.me/" 30 | }, 31 | "bugs": { 32 | "url": "https://github.com/isaacs/once/issues" 33 | }, 34 | "bundleDependencies": false, 35 | "dependencies": { 36 | "wrappy": "1" 37 | }, 38 | "deprecated": false, 39 | "description": "Run a function exactly one time", 40 | "devDependencies": { 41 | "tap": "^7.0.1" 42 | }, 43 | "directories": { 44 | "test": "test" 45 | }, 46 | "files": [ 47 | "once.js" 48 | ], 49 | "homepage": "https://github.com/isaacs/once#readme", 50 | "keywords": [ 51 | "once", 52 | "function", 53 | "one", 54 | "single" 55 | ], 56 | "license": "ISC", 57 | "main": "once.js", 58 | "name": "once", 59 | "repository": { 60 | "type": "git", 61 | "url": "git://github.com/isaacs/once.git" 62 | }, 63 | "scripts": { 64 | "test": "tap test/*.js" 65 | }, 66 | "version": "1.4.0" 67 | } 68 | -------------------------------------------------------------------------------- /docs-src/node_modules/inherits/README.md: -------------------------------------------------------------------------------- 1 | Browser-friendly inheritance fully compatible with standard node.js 2 | [inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor). 3 | 4 | This package exports standard `inherits` from node.js `util` module in 5 | node environment, but also provides alternative browser-friendly 6 | implementation through [browser 7 | field](https://gist.github.com/shtylman/4339901). Alternative 8 | implementation is a literal copy of standard one located in standalone 9 | module to avoid requiring of `util`. It also has a shim for old 10 | browsers with no `Object.create` support. 11 | 12 | While keeping you sure you are using standard `inherits` 13 | implementation in node.js environment, it allows bundlers such as 14 | [browserify](https://github.com/substack/node-browserify) to not 15 | include full `util` package to your client code if all you need is 16 | just `inherits` function. It worth, because browser shim for `util` 17 | package is large and `inherits` is often the single function you need 18 | from it. 19 | 20 | It's recommended to use this package instead of 21 | `require('util').inherits` for any code that has chances to be used 22 | not only in node.js but in browser too. 23 | 24 | ## usage 25 | 26 | ```js 27 | var inherits = require('inherits'); 28 | // then use exactly as the standard one 29 | ``` 30 | 31 | ## note on version ~1.0 32 | 33 | Version ~1.0 had completely different motivation and is not compatible 34 | neither with 2.0 nor with standard node.js `inherits`. 35 | 36 | If you are using version ~1.0 and planning to switch to ~2.0, be 37 | careful: 38 | 39 | * new version uses `super_` instead of `super` for referencing 40 | superclass 41 | * new version overwrites current prototype while old one preserves any 42 | existing fields on it 43 | -------------------------------------------------------------------------------- /docs-src/node_modules/fs.realpath/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "fs.realpath@^1.0.0", 3 | "_id": "fs.realpath@1.0.0", 4 | "_inBundle": false, 5 | "_integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", 6 | "_location": "/fs.realpath", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "fs.realpath@^1.0.0", 12 | "name": "fs.realpath", 13 | "escapedName": "fs.realpath", 14 | "rawSpec": "^1.0.0", 15 | "saveSpec": null, 16 | "fetchSpec": "^1.0.0" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", 22 | "_shasum": "1504ad2523158caa40db4a2787cb01411994ea4f", 23 | "_spec": "fs.realpath@^1.0.0", 24 | "_where": "/home/mike/go/src/github.com/michaelbironneau/analyst/docs/node_modules/glob", 25 | "author": { 26 | "name": "Isaac Z. Schlueter", 27 | "email": "i@izs.me", 28 | "url": "http://blog.izs.me/" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/isaacs/fs.realpath/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": {}, 35 | "deprecated": false, 36 | "description": "Use node's fs.realpath, but fall back to the JS implementation if the native one fails", 37 | "devDependencies": {}, 38 | "files": [ 39 | "old.js", 40 | "index.js" 41 | ], 42 | "homepage": "https://github.com/isaacs/fs.realpath#readme", 43 | "keywords": [ 44 | "realpath", 45 | "fs", 46 | "polyfill" 47 | ], 48 | "license": "ISC", 49 | "main": "index.js", 50 | "name": "fs.realpath", 51 | "repository": { 52 | "type": "git", 53 | "url": "git+https://github.com/isaacs/fs.realpath.git" 54 | }, 55 | "scripts": { 56 | "test": "tap test/*.js --cov" 57 | }, 58 | "version": "1.0.0" 59 | } 60 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/module_dir.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('moduleDirectory strings', function (t) { 6 | t.plan(4); 7 | var dir = path.join(__dirname, 'module_dir'); 8 | var xopts = { 9 | basedir: dir, 10 | moduleDirectory: 'xmodules' 11 | }; 12 | resolve('aaa', xopts, function (err, res, pkg) { 13 | t.ifError(err); 14 | t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); 15 | }); 16 | 17 | var yopts = { 18 | basedir: dir, 19 | moduleDirectory: 'ymodules' 20 | }; 21 | resolve('aaa', yopts, function (err, res, pkg) { 22 | t.ifError(err); 23 | t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); 24 | }); 25 | }); 26 | 27 | test('moduleDirectory array', function (t) { 28 | t.plan(6); 29 | var dir = path.join(__dirname, 'module_dir'); 30 | var aopts = { 31 | basedir: dir, 32 | moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] 33 | }; 34 | resolve('aaa', aopts, function (err, res, pkg) { 35 | t.ifError(err); 36 | t.equal(res, path.join(dir, '/xmodules/aaa/index.js')); 37 | }); 38 | 39 | var bopts = { 40 | basedir: dir, 41 | moduleDirectory: ['zmodules', 'ymodules', 'xmodules'] 42 | }; 43 | resolve('aaa', bopts, function (err, res, pkg) { 44 | t.ifError(err); 45 | t.equal(res, path.join(dir, '/ymodules/aaa/index.js')); 46 | }); 47 | 48 | var copts = { 49 | basedir: dir, 50 | moduleDirectory: ['xmodules', 'ymodules', 'zmodules'] 51 | }; 52 | resolve('bbb', copts, function (err, res, pkg) { 53 | t.ifError(err); 54 | t.equal(res, path.join(dir, '/zmodules/bbb/main.js')); 55 | }); 56 | }); 57 | -------------------------------------------------------------------------------- /docs-src/docs/tests.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: tests 3 | title: TEST 4 | --- 5 | 6 | # Testing 7 | 8 | While it is certainly possible to test scripts using external coordination, Analyst comes with built-in assertions to faciliate testing of scripts. 9 | 10 | It is important to note that tests will only be run in test mode, that is, with the subcommand `test` rather than `run`. 11 | 12 | ## Test blocks 13 | 14 | The syntax for a test block is as follows: 15 | 16 | ``` 17 | TEST BLOCK_IDENTIFIER WITH ASSERTIONS ( 18 | ASSERTIONS 19 | ) 20 | ``` 21 | 22 | Where `BLOCK_IDENTIFIER` is the identifier of the block to be tested (either a source or a transform) and the assertions are semi-colon delimited and chosen from the below: 23 | 24 | 25 | ## Assertions 26 | 27 | ### Number of rows overall 28 | Valid assertions are: 29 | 30 | * `IT OUTPUTS AT LEAST {N} ROWS` 31 | * `IT OUTPUTS AT MOST {N} ROWS` 32 | * `IT OUTPUTS EXACTLY {N} ROWS` 33 | 34 | ### Number of distinct values, for a given column 35 | 36 | * `COLUMN {COLUMN_NAME} HAS AT LEAST {N} DISTINCT VALUES` 37 | * `COLUMN {COLUMN_NAME} HAS AT MOST {N} DISTINCT VALUES` 38 | * `COLUMN {COLUMN_NAME} HAS EXACTLY {N} DISTINCT VALUES` 39 | 40 | ### Uniqueness of a column 41 | 42 | The assertion is `COLUMN {COLUMN_NAME} HAS UNIQUE VALUES`. 43 | 44 | ### No null values 45 | 46 | The assertion is `COLUMN {COLUMN_NAME} HAS NO NULL VALUES`. 47 | 48 | ## Example 49 | 50 | The below example contains a passing test and a failing test. Running the test with `analyst test --script path/to/file` will return an error. 51 | 52 | ``` 53 | DATA 'Values' ( 54 | [ 55 | ["Hello, World"], 56 | ["Hello, World"] 57 | ] 58 | ) 59 | INTO CONSOLE 60 | WITH (FORMAT = 'JSON_ARRAY', COLUMNS = 'Word') 61 | 62 | TEST Values WITH ASSERTIONS ( 63 | IT OUTPUTS AT LEAST 2 ROWS; 64 | COLUMN Word HAS UNIQUE VALUES 65 | ) 66 | ``` -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/find.js: -------------------------------------------------------------------------------- 1 | var fs = require('fs'); 2 | var path = require('path'); 3 | var common = require('./common'); 4 | var _ls = require('./ls'); 5 | 6 | common.register('find', _find, {}); 7 | 8 | //@ 9 | //@ ### find(path [, path ...]) 10 | //@ ### find(path_array) 11 | //@ Examples: 12 | //@ 13 | //@ ```javascript 14 | //@ find('src', 'lib'); 15 | //@ find(['src', 'lib']); // same as above 16 | //@ find('.').filter(function(file) { return file.match(/\.js$/); }); 17 | //@ ``` 18 | //@ 19 | //@ Returns array of all files (however deep) in the given paths. 20 | //@ 21 | //@ The main difference from `ls('-R', path)` is that the resulting file names 22 | //@ include the base directories, e.g. `lib/resources/file1` instead of just `file1`. 23 | function _find(options, paths) { 24 | if (!paths) { 25 | common.error('no path specified'); 26 | } else if (typeof paths === 'string') { 27 | paths = [].slice.call(arguments, 1); 28 | } 29 | 30 | var list = []; 31 | 32 | function pushFile(file) { 33 | if (process.platform === 'win32') { 34 | file = file.replace(/\\/g, '/'); 35 | } 36 | list.push(file); 37 | } 38 | 39 | // why not simply do ls('-R', paths)? because the output wouldn't give the base dirs 40 | // to get the base dir in the output, we need instead ls('-R', 'dir/*') for every directory 41 | 42 | paths.forEach(function (file) { 43 | var stat; 44 | try { 45 | stat = fs.statSync(file); 46 | } catch (e) { 47 | common.error('no such file or directory: ' + file); 48 | } 49 | 50 | pushFile(file); 51 | 52 | if (stat.isDirectory()) { 53 | _ls({ recursive: true, all: true }, file).forEach(function (subfile) { 54 | pushFile(path.join(file, subfile)); 55 | }); 56 | } 57 | }); 58 | 59 | return list; 60 | } 61 | module.exports = _find; 62 | -------------------------------------------------------------------------------- /docs-src/docs/intro.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: intro 3 | title: 30-second Introduction 4 | --- 5 | 6 | Analyst Query Language (AQL) is a language to extract, transform and load data. Unlike other ETL languages, it is designed to have better interoperability with existing tooling, integrate with source control, and allow a modular workflow thanks to powerful templating features. 7 | 8 | A "Hello world" in AQL looks like this: 9 | 10 | ``` 11 | DATA 'MyMessage' ( 12 | [ 13 | ["Hello, World"] 14 | ] 15 | ) INTO CONSOLE WITH (COLUMNS = "Message") 16 | 17 | ``` 18 | 19 | This code structure is called a **block**. All blocks have a type (`DATA`) and a name (`MyMessage`). They can also have options (the `WITH` clause). 20 | 21 | A script contains one or more blocks. Data can be passed between blocks. A more useful script is as follows: 22 | 23 | ``` 24 | CONNECTION 'MyDb' ( 25 | DRIVER = 'mssql' 26 | CONNECTIONSTRING = 'server=myserver;user id=sa;password=something' 27 | ) 28 | 29 | QUERY 'GetBob' FROM CONNECTION MyDb ( 30 | SELECT * FROM Users WHERE Name LIKE 'Bob' 31 | ) INTO CONSOLE 32 | ``` 33 | 34 | This particular script runs a query in an MS SQL database and displays the result in the console. Data can also be transformed: 35 | 36 | ``` 37 | CONNECTION 'MyDb' ( 38 | DRIVER = 'mssql' 39 | CONNECTIONSTRING = 'server=myserver;user id=sa;password=something' 40 | ) 41 | 42 | QUERY 'GetAllUserNames' FROM CONNECTION MyDb ( 43 | SELECT Name FROM Users 44 | ) 45 | 46 | TRANSFORM 'CountNames' FROM BLOCK GetAllUserNames ( 47 | AGGREGATE Name, COUNT(Name) AS Cnt FROM GetAllUserNames 48 | GROUP BY Name 49 | ) INTO CONSOLE 50 | ``` 51 | 52 | While this transformation could have been performed in the query in this case, saving the need for an additional block, it would also work had the data come from a non-SQL source such as Excel or a text file. 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /docs-src/website/siteConfig.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2017-present, Facebook, Inc. 3 | * 4 | * This source code is licensed under the MIT license found in the 5 | * LICENSE file in the root directory of this source tree. 6 | */ 7 | 8 | /* List of projects/orgs using your project for the users page */ 9 | const users = [ 10 | { 11 | caption: 'User1', 12 | image: '/analyst/img/docusaurus.svg', 13 | infoLink: 'https://github.com/michaelbironneau/analyst', 14 | pinned: true, 15 | }, 16 | ]; 17 | 18 | const siteConfig = { 19 | title: 'Analyst QL' /* title for your website */, 20 | tagline: 'a declarative language for ETL jobs', 21 | url: 'https://github.com/michaelbironneau/analyst' /* your website url */, 22 | baseUrl: '/analyst/' /* base url for your project */, 23 | projectName: 'analyst', 24 | headerLinks: [ 25 | {doc: 'intro', label: 'Introduction to Analyst'} 26 | ], 27 | users, 28 | /* path to images for header/footer */ 29 | headerIcon: '', 30 | footerIcon: '', 31 | favicon: '', 32 | /* colors for website */ 33 | colors: { 34 | primaryColor: '#486A87', 35 | secondaryColor: '#FF9D00', 36 | }, 37 | // This copyright info is used in /core/Footer.js and blog rss/atom feeds. 38 | copyright: 39 | 'Copyright © ' + 40 | new Date().getFullYear() + 41 | ' Michael Bironneau', 42 | // organizationName: 'deltice', // or set an env variable ORGANIZATION_NAME 43 | // projectName: 'analyst', // or set an env variable PROJECT_NAME 44 | highlight: { 45 | // Highlight.js theme to use for syntax highlighting in code blocks 46 | theme: 'default', 47 | }, 48 | scripts: ['https://buttons.github.io/buttons.js'], 49 | // You may provide arbitrary config keys to be used as needed by your template. 50 | repoUrl: 'https://github.com/michaelbironneau/analyst', 51 | }; 52 | 53 | module.exports = siteConfig; 54 | -------------------------------------------------------------------------------- /engine/parameters_test.go: -------------------------------------------------------------------------------- 1 | package engine 2 | 3 | import ( 4 | . "github.com/smartystreets/goconvey/convey" 5 | "testing" 6 | ) 7 | 8 | func TestParameterTable(t *testing.T) { 9 | Convey("Given a parameter table", t, func() { 10 | p := NewParameterTable() 11 | Convey("It should allow declarations", func() { 12 | err := p.Declare("A") 13 | So(err, ShouldBeNil) 14 | }) 15 | Convey("It should reject duplicate declarations", func() { 16 | p.Declare("A") 17 | err := p.Declare("A") 18 | So(err, ShouldNotBeNil) 19 | }) 20 | Convey("It should allow values to be set and retrieved", func() { 21 | p.Declare("A") 22 | err := p.Set("A", 1) 23 | So(err, ShouldBeNil) 24 | v, ok := p.Get("A") 25 | So(ok, ShouldBeTrue) 26 | So(v, ShouldEqual, 1) 27 | _, ok = p.Get("B") 28 | So(ok, ShouldBeFalse) 29 | }) 30 | Convey("It should reject a value set if the parameter has not been declared", func() { 31 | err := p.Set("A", 1) 32 | So(err, ShouldNotBeNil) 33 | _, ok := p.Get("A") 34 | So(ok, ShouldBeFalse) 35 | }) 36 | }) 37 | } 38 | 39 | func TestParameterTableAsDestination(t *testing.T) { 40 | Convey("Given a parameter table, stream, logger, stopper", t, func() { 41 | pp := NewParameterTable() 42 | p := NewParameterTableDestination(pp, []string{"AA", "bb"}) 43 | pp.Declare("Aa") 44 | pp.Declare("Bb") 45 | st := NewStopper() 46 | l := NewConsoleLogger(Trace) 47 | s := NewStream([]string{"CC", "DD"}, 100) 48 | Convey("It should correctly populate the parameter table from valid messages", func() { 49 | s.Chan("") <- Message{Data: []interface{}{1, 2}} 50 | s.Chan("") <- Message{Data: []interface{}{3, 4}} 51 | close(s.Chan("")) 52 | p.Open(s, l, st) 53 | a, ok := pp.Get("Aa") 54 | So(ok, ShouldBeTrue) 55 | So(a, ShouldEqual, 3) 56 | b, ok := pp.Get("BB") 57 | So(ok, ShouldBeTrue) 58 | So(b, ShouldEqual, 4) 59 | }) 60 | }) 61 | } 62 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/mock_sync.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var test = require('tape'); 3 | var resolve = require('../'); 4 | 5 | test('mock', function (t) { 6 | t.plan(4); 7 | 8 | var files = {}; 9 | files[path.resolve('/foo/bar/baz.js')] = 'beep'; 10 | 11 | function opts(basedir) { 12 | return { 13 | basedir: path.resolve(basedir), 14 | isFile: function (file) { 15 | return Object.prototype.hasOwnProperty.call(files, file); 16 | }, 17 | readFileSync: function (file) { 18 | return files[file]; 19 | } 20 | }; 21 | } 22 | 23 | t.equal( 24 | resolve.sync('./baz', opts('/foo/bar')), 25 | path.resolve('/foo/bar/baz.js') 26 | ); 27 | 28 | t.equal( 29 | resolve.sync('./baz.js', opts('/foo/bar')), 30 | path.resolve('/foo/bar/baz.js') 31 | ); 32 | 33 | t.throws(function () { 34 | resolve.sync('baz', opts('/foo/bar')); 35 | }); 36 | 37 | t.throws(function () { 38 | resolve.sync('../baz', opts('/foo/bar')); 39 | }); 40 | }); 41 | 42 | test('mock package', function (t) { 43 | t.plan(1); 44 | 45 | var files = {}; 46 | files[path.resolve('/foo/node_modules/bar/baz.js')] = 'beep'; 47 | files[path.resolve('/foo/node_modules/bar/package.json')] = JSON.stringify({ 48 | main: './baz.js' 49 | }); 50 | 51 | function opts(basedir) { 52 | return { 53 | basedir: path.resolve(basedir), 54 | isFile: function (file) { 55 | return Object.prototype.hasOwnProperty.call(files, file); 56 | }, 57 | readFileSync: function (file) { 58 | return files[file]; 59 | } 60 | }; 61 | } 62 | 63 | t.equal( 64 | resolve.sync('bar', opts('/foo')), 65 | path.resolve('/foo/node_modules/bar/baz.js') 66 | ); 67 | }); 68 | -------------------------------------------------------------------------------- /docs-src/node_modules/minimatch/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "_from": "minimatch@^3.0.4", 3 | "_id": "minimatch@3.0.4", 4 | "_inBundle": false, 5 | "_integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", 6 | "_location": "/minimatch", 7 | "_phantomChildren": {}, 8 | "_requested": { 9 | "type": "range", 10 | "registry": true, 11 | "raw": "minimatch@^3.0.4", 12 | "name": "minimatch", 13 | "escapedName": "minimatch", 14 | "rawSpec": "^3.0.4", 15 | "saveSpec": null, 16 | "fetchSpec": "^3.0.4" 17 | }, 18 | "_requiredBy": [ 19 | "/glob" 20 | ], 21 | "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", 22 | "_shasum": "5166e286457f03306064be5497e8dbb0c3d32083", 23 | "_spec": "minimatch@^3.0.4", 24 | "_where": "/home/mike/go/src/github.com/michaelbironneau/analyst/docs/node_modules/glob", 25 | "author": { 26 | "name": "Isaac Z. Schlueter", 27 | "email": "i@izs.me", 28 | "url": "http://blog.izs.me" 29 | }, 30 | "bugs": { 31 | "url": "https://github.com/isaacs/minimatch/issues" 32 | }, 33 | "bundleDependencies": false, 34 | "dependencies": { 35 | "brace-expansion": "^1.1.7" 36 | }, 37 | "deprecated": false, 38 | "description": "a glob matcher in javascript", 39 | "devDependencies": { 40 | "tap": "^10.3.2" 41 | }, 42 | "engines": { 43 | "node": "*" 44 | }, 45 | "files": [ 46 | "minimatch.js" 47 | ], 48 | "homepage": "https://github.com/isaacs/minimatch#readme", 49 | "license": "ISC", 50 | "main": "minimatch.js", 51 | "name": "minimatch", 52 | "repository": { 53 | "type": "git", 54 | "url": "git://github.com/isaacs/minimatch.git" 55 | }, 56 | "scripts": { 57 | "postpublish": "git push origin --all; git push origin --tags", 58 | "postversion": "npm publish", 59 | "preversion": "npm test", 60 | "test": "tap test/*.js --cov" 61 | }, 62 | "version": "3.0.4" 63 | } 64 | -------------------------------------------------------------------------------- /docs-src/docs/cli.md: -------------------------------------------------------------------------------- 1 | --- 2 | id: cli 3 | title: Command Line Interface 4 | --- 5 | 6 | The `analyst` command can be used to validate or execute a script. There are two commands with identical parameters: 7 | 8 | * `analyst validate`: Attempts to parse the script and assemble the DAG, returning any errors 9 | * `analyst run`: Executes the script 10 | * `analyst test`: Runs the script, validating the assertions in `TEST` blocks, returning any failures as errors. *All destinations will be mocked*. 11 | 12 | The parameters are as follows: 13 | 14 | * `script`: The script to evaluate/validate (default: `.analyst`) 15 | * `params`: Global options for the script as a JSON object, eg. `{"OptName": "OptValue"}`. 16 | * `v`: Verbose (INFO-level events) 17 | * `vv`: Extra verbose (TRACE-level events) 18 | 19 | ## Full example 20 | 21 | ``` 22 | analyst validate --script 'myscript.aql' --params "{\"MyOpt\": 1}" --v 23 | ``` 24 | 25 | ## Logging 26 | 27 | There are four log levels: `TRACE`, `INFO`, `WARNING` and `ERROR`. Any error condition causes the execution to halt and any managed transactions to be rolled back. 28 | 29 | ### Logging to Slack 30 | 31 | You can configure the logger to send log messages above a given level to Slack using an [incoming webhook](https://api.slack.com/incoming-webhooks). 32 | 33 | Messages will be formatted as `: SOURCE - LEVEL - MESSAGE`. 34 | 35 | The options, that you can set using either `SET = ''` syntax or via command-line flag `params`, are: 36 | 37 | * `SLACK_WEBHOOK_URL`: The URL of your webhook. 38 | * `SLACK_LOG_LEVEL`: Minimum level of messages to log. One of 'TRACE', 'INFO', 'WARNING' or 'ERROR' (case-insensitive). 39 | * `SLACK_CHANNEL` (optional): Name of Slack channel for the messages. 40 | * `SLACK_USER` (optional): Name of Slack user for the messages. 41 | * `SLACK_EMOJI` (optional): Emoji for message. 42 | * `SLACK_NAME` (optional): Prefix of all messages, so that the script that caused the error can be identified ('' above) -------------------------------------------------------------------------------- /docs-src/node_modules/color-name/.npmignore: -------------------------------------------------------------------------------- 1 | //this will affect all the git repos 2 | git config --global core.excludesfile ~/.gitignore 3 | 4 | 5 | //update files since .ignore won't if already tracked 6 | git rm --cached 7 | 8 | # Compiled source # 9 | ################### 10 | *.com 11 | *.class 12 | *.dll 13 | *.exe 14 | *.o 15 | *.so 16 | 17 | # Packages # 18 | ############ 19 | # it's better to unpack these files and commit the raw source 20 | # git has its own built in compression methods 21 | *.7z 22 | *.dmg 23 | *.gz 24 | *.iso 25 | *.jar 26 | *.rar 27 | *.tar 28 | *.zip 29 | 30 | # Logs and databases # 31 | ###################### 32 | *.log 33 | *.sql 34 | *.sqlite 35 | 36 | # OS generated files # 37 | ###################### 38 | .DS_Store 39 | .DS_Store? 40 | ._* 41 | .Spotlight-V100 42 | .Trashes 43 | # Icon? 44 | ehthumbs.db 45 | Thumbs.db 46 | .cache 47 | .project 48 | .settings 49 | .tmproj 50 | *.esproj 51 | nbproject 52 | 53 | # Numerous always-ignore extensions # 54 | ##################################### 55 | *.diff 56 | *.err 57 | *.orig 58 | *.rej 59 | *.swn 60 | *.swo 61 | *.swp 62 | *.vi 63 | *~ 64 | *.sass-cache 65 | *.grunt 66 | *.tmp 67 | 68 | # Dreamweaver added files # 69 | ########################### 70 | _notes 71 | dwsync.xml 72 | 73 | # Komodo # 74 | ########################### 75 | *.komodoproject 76 | .komodotools 77 | 78 | # Node # 79 | ##################### 80 | node_modules 81 | 82 | # Bower # 83 | ##################### 84 | bower_components 85 | 86 | # Folders to ignore # 87 | ##################### 88 | .hg 89 | .svn 90 | .CVS 91 | intermediate 92 | publish 93 | .idea 94 | .graphics 95 | _test 96 | _archive 97 | uploads 98 | tmp 99 | 100 | # Vim files to ignore # 101 | ####################### 102 | .VimballRecord 103 | .netrwhist 104 | 105 | bundle.* 106 | 107 | _demo -------------------------------------------------------------------------------- /http/static/index.html: -------------------------------------------------------------------------------- 1 | Analyst ETL Designer -------------------------------------------------------------------------------- /docs-src/node_modules/supports-color/readme.md: -------------------------------------------------------------------------------- 1 | # supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color) 2 | 3 | > Detect whether a terminal supports color 4 | 5 | 6 | ## Install 7 | 8 | ``` 9 | $ npm install supports-color 10 | ``` 11 | 12 | 13 | ## Usage 14 | 15 | ```js 16 | const supportsColor = require('supports-color'); 17 | 18 | if (supportsColor) { 19 | console.log('Terminal supports color'); 20 | } 21 | 22 | if (supportsColor.has256) { 23 | console.log('Terminal supports 256 colors'); 24 | } 25 | 26 | if (supportsColor.has16m) { 27 | console.log('Terminal supports 16 million colors (truecolor)'); 28 | } 29 | ``` 30 | 31 | 32 | ## API 33 | 34 | Returns an `Object`, or `false` if color is not supported. 35 | 36 | The returned object specifies a level of support for color through a `.level` property and a corresponding flag: 37 | 38 | - `.level = 1` and `.hasBasic = true`: Basic color support (16 colors) 39 | - `.level = 2` and `.has256 = true`: 256 color support 40 | - `.level = 3` and `.has16m = true`: Truecolor support (16 million colors) 41 | 42 | 43 | ## Info 44 | 45 | It obeys the `--color` and `--no-color` CLI flags. 46 | 47 | Can be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add the environment variable `FORCE_COLOR=1` to forcefully enable color or `FORCE_COLOR=0` to forcefully disable. The use of `FORCE_COLOR` overrides all other color support checks. 48 | 49 | Explicit 256/Truecolor mode can be enabled using the `--color=256` and `--color=16m` flags, respectively. 50 | 51 | 52 | ## Related 53 | 54 | - [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module 55 | - [chalk](https://github.com/chalk/chalk) - Terminal string styling done right 56 | 57 | 58 | ## Maintainers 59 | 60 | - [Sindre Sorhus](https://github.com/sindresorhus) 61 | - [Josh Junon](https://github.com/qix-) 62 | 63 | 64 | ## License 65 | 66 | MIT 67 | -------------------------------------------------------------------------------- /docs-src/node_modules/shelljs/src/grep.js: -------------------------------------------------------------------------------- 1 | var common = require('./common'); 2 | var fs = require('fs'); 3 | 4 | common.register('grep', _grep, { 5 | globStart: 2, // don't glob-expand the regex 6 | canReceivePipe: true, 7 | cmdOptions: { 8 | 'v': 'inverse', 9 | 'l': 'nameOnly', 10 | }, 11 | }); 12 | 13 | //@ 14 | //@ ### grep([options,] regex_filter, file [, file ...]) 15 | //@ ### grep([options,] regex_filter, file_array) 16 | //@ Available options: 17 | //@ 18 | //@ + `-v`: Inverse the sense of the regex and print the lines not matching the criteria. 19 | //@ + `-l`: Print only filenames of matching files 20 | //@ 21 | //@ Examples: 22 | //@ 23 | //@ ```javascript 24 | //@ grep('-v', 'GLOBAL_VARIABLE', '*.js'); 25 | //@ grep('GLOBAL_VARIABLE', '*.js'); 26 | //@ ``` 27 | //@ 28 | //@ Reads input string from given files and returns a string containing all lines of the 29 | //@ file that match the given `regex_filter`. 30 | function _grep(options, regex, files) { 31 | // Check if this is coming from a pipe 32 | var pipe = common.readFromPipe(); 33 | 34 | if (!files && !pipe) common.error('no paths given', 2); 35 | 36 | files = [].slice.call(arguments, 2); 37 | 38 | if (pipe) { 39 | files.unshift('-'); 40 | } 41 | 42 | var grep = []; 43 | files.forEach(function (file) { 44 | if (!fs.existsSync(file) && file !== '-') { 45 | common.error('no such file or directory: ' + file, 2, { continue: true }); 46 | return; 47 | } 48 | 49 | var contents = file === '-' ? pipe : fs.readFileSync(file, 'utf8'); 50 | var lines = contents.split(/\r*\n/); 51 | if (options.nameOnly) { 52 | if (contents.match(regex)) { 53 | grep.push(file); 54 | } 55 | } else { 56 | lines.forEach(function (line) { 57 | var matched = line.match(regex); 58 | if ((options.inverse && !matched) || (!options.inverse && matched)) { 59 | grep.push(line); 60 | } 61 | }); 62 | } 63 | }); 64 | 65 | return grep.join('\n') + '\n'; 66 | } 67 | module.exports = _grep; 68 | -------------------------------------------------------------------------------- /docs-src/node_modules/resolve/test/symlinks.js: -------------------------------------------------------------------------------- 1 | var path = require('path'); 2 | var fs = require('fs'); 3 | var test = require('tape'); 4 | var resolve = require('../'); 5 | 6 | var symlinkDir = path.join(__dirname, 'resolver', 'symlinked', 'symlink'); 7 | try { 8 | fs.unlinkSync(symlinkDir); 9 | } catch (err) {} 10 | try { 11 | fs.symlinkSync('./_/symlink_target', symlinkDir, 'dir'); 12 | } catch (err) { 13 | // if fails then it is probably on Windows and lets try to create a junction 14 | fs.symlinkSync(path.join(__dirname, 'resolver', 'symlinked', '_', 'symlink_target') + '\\', symlinkDir, 'junction'); 15 | } 16 | 17 | test('symlink', function (t) { 18 | t.plan(1); 19 | 20 | resolve('foo', { basedir: symlinkDir, preserveSymlinks: false }, function (err, res, pkg) { 21 | if (err) t.fail(err); 22 | t.equal(res, path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); 23 | }); 24 | }); 25 | 26 | test('sync symlink when preserveSymlinks = true', function (t) { 27 | t.plan(4); 28 | 29 | resolve('foo', { basedir: symlinkDir }, function (err, res, pkg) { 30 | t.ok(err, 'there is an error'); 31 | t.notOk(res, 'no result'); 32 | 33 | t.equal(err && err.code, 'MODULE_NOT_FOUND', 'error code matches require.resolve'); 34 | t.equal( 35 | err && err.message, 36 | 'Cannot find module \'foo\' from \'' + symlinkDir + '\'', 37 | 'can not find nonexistent module' 38 | ); 39 | }); 40 | }); 41 | 42 | test('sync symlink', function (t) { 43 | var start = new Date(); 44 | t.equal(resolve.sync('foo', { basedir: symlinkDir, preserveSymlinks: false }), path.join(__dirname, 'resolver', 'symlinked', '_', 'node_modules', 'foo.js')); 45 | t.ok(new Date() - start < 50, 'resolve.sync timedout'); 46 | t.end(); 47 | }); 48 | 49 | test('sync symlink when preserveSymlinks = true', function (t) { 50 | t.throws(function () { 51 | resolve.sync('foo', { basedir: symlinkDir }); 52 | }, /Cannot find module 'foo'/); 53 | t.end(); 54 | }); 55 | --------------------------------------------------------------------------------