datagrok-tools 4.7.2-beta.2 → 4.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +100 -100
- package/bin/_deprecated/migrate.js +83 -83
- package/bin/_deprecated/upload.js +161 -161
- package/bin/commands/link.js +4 -4
- package/bin/grok.js +29 -29
- package/bin/utils/test-utils.js +4 -3
- package/config-template.yaml +11 -11
- package/entity-template/app.js +6 -6
- package/entity-template/connection.json +17 -17
- package/entity-template/function.js +9 -9
- package/entity-template/function.ts +9 -9
- package/entity-template/init.js +4 -4
- package/entity-template/panel.js +11 -11
- package/entity-template/panel.ts +11 -11
- package/entity-template/queries.sql +7 -7
- package/entity-template/sem-type-detector.js +11 -11
- package/entity-template/test.ts +16 -16
- package/entity-template/view-class.js +60 -60
- package/entity-template/view-class.ts +64 -64
- package/entity-template/view.js +10 -10
- package/entity-template/viewer-class.js +23 -23
- package/entity-template/viewer-class.ts +23 -23
- package/entity-template/viewer.js +8 -8
- package/package-template/.eslintrc.json +38 -38
- package/package-template/.vscode/launch.json +15 -15
- package/package-template/.vscode/tasks.json +9 -9
- package/package-template/README.md +2 -2
- package/package-template/detectors.js +9 -9
- package/package-template/gitignore +29 -29
- package/package-template/npmignore +26 -26
- package/package-template/package.json +29 -29
- package/package-template/src/package-test.js +11 -11
- package/package-template/src/package-test.ts +12 -12
- package/package-template/src/package.js +11 -11
- package/package-template/ts.webpack.config.js +37 -37
- package/package-template/tsconfig.json +71 -71
- package/package-template/webpack.config.js +29 -29
- package/package.json +52 -52
- package/script-template/javascript.js +6 -6
- package/script-template/julia.jl +8 -8
- package/script-template/node.js +8 -8
- package/script-template/octave.m +8 -8
- package/script-template/python.py +8 -8
- package/script-template/r.R +8 -8
- package/tsconfig.json +71 -71
|
@@ -1,162 +1,162 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const argv = require('minimist')(process.argv.slice(2));
|
|
3
|
-
const getFiles = require('node-recursive-directory');
|
|
4
|
-
const fs = require('fs');
|
|
5
|
-
const fetch = require('node-fetch');
|
|
6
|
-
const path = require('path');
|
|
7
|
-
const archiver = require('archiver-promise');
|
|
8
|
-
const walk = require('ignore-walk')
|
|
9
|
-
|
|
10
|
-
// The script is no longer supported
|
|
11
|
-
console.log(`\`datagrok-upload\` is not available, please use \`grok publish\` instead.
|
|
12
|
-
Run \`grok migrate\` to convert your scripts in \`package.json\` and to copy your keys to \`config.yaml\``);
|
|
13
|
-
console.log(`Exiting with code 1`);
|
|
14
|
-
process.exit(1);
|
|
15
|
-
|
|
16
|
-
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
|
17
|
-
|
|
18
|
-
let mode = argv['_'][1];
|
|
19
|
-
let host = argv['_'][0];
|
|
20
|
-
let rebuild = argv['_'].includes('rebuild');
|
|
21
|
-
|
|
22
|
-
if (mode !== 'debug' && mode !== 'deploy')
|
|
23
|
-
return console.log('Mode must be either debug or deploy');
|
|
24
|
-
|
|
25
|
-
let debug = mode === 'debug';
|
|
26
|
-
|
|
27
|
-
let keys = {
|
|
28
|
-
[host]: ''
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
//get key from keys file
|
|
32
|
-
if (fs.existsSync('upload.keys.json')) {
|
|
33
|
-
keys = JSON.parse(fs.readFileSync('upload.keys.json'));
|
|
34
|
-
} else {
|
|
35
|
-
fs.writeFileSync('upload.keys.json', JSON.stringify(keys));
|
|
36
|
-
}
|
|
37
|
-
let devKey = keys[host];
|
|
38
|
-
if (devKey === undefined) {
|
|
39
|
-
devKey = '';
|
|
40
|
-
keys[host] = devKey;
|
|
41
|
-
fs.writeFileSync('upload.keys.json', JSON.stringify(keys));
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (devKey === '')
|
|
45
|
-
return console.log('Empty developer key. See upload.keys.json file.');
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
//check if package.json exists, get package name
|
|
49
|
-
let packageName = '';
|
|
50
|
-
if (!fs.existsSync('package.json'))
|
|
51
|
-
return console.log('package.js doesn\'t exists');
|
|
52
|
-
else {
|
|
53
|
-
let packageJson = JSON.parse(fs.readFileSync('package.json'));
|
|
54
|
-
packageName = packageJson['name'];
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
process.on('beforeExit', async () => {
|
|
58
|
-
let code = 0;
|
|
59
|
-
try {
|
|
60
|
-
code = await processPackage()
|
|
61
|
-
|
|
62
|
-
} catch (err) {
|
|
63
|
-
console.log(err);
|
|
64
|
-
code = 1;
|
|
65
|
-
}
|
|
66
|
-
console.log(`Exiting with code ${code}`);
|
|
67
|
-
process.exit(code);
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
async function processPackage() {
|
|
71
|
-
//get server timestamps
|
|
72
|
-
let timestamps = {};
|
|
73
|
-
if (debug) {
|
|
74
|
-
try {
|
|
75
|
-
timestamps = await (await fetch(`${host}/packages/dev/${devKey}/${packageName}/timestamps`)).json();
|
|
76
|
-
if (timestamps['#type'] === 'ApiError') {
|
|
77
|
-
console.log(timestamps.message);
|
|
78
|
-
return 1;
|
|
79
|
-
}
|
|
80
|
-
} catch (error) {
|
|
81
|
-
console.log(error);
|
|
82
|
-
return 1;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
let zip = archiver('zip', {store: false});
|
|
87
|
-
|
|
88
|
-
//gather files
|
|
89
|
-
let localTimestamps = {};
|
|
90
|
-
let files = await walk({
|
|
91
|
-
path: '.',
|
|
92
|
-
ignoreFiles: ['.npmignore', '.gitignore'],
|
|
93
|
-
includeEmpty: true,
|
|
94
|
-
follow: true
|
|
95
|
-
});
|
|
96
|
-
|
|
97
|
-
if (!rebuild) {
|
|
98
|
-
const distFiles = await walk({
|
|
99
|
-
path: './dist',
|
|
100
|
-
ignoreFiles: [],
|
|
101
|
-
includeEmpty: true,
|
|
102
|
-
follow: true
|
|
103
|
-
});
|
|
104
|
-
distFiles.forEach((df) => {
|
|
105
|
-
files.push(`dist/${df}`);
|
|
106
|
-
})
|
|
107
|
-
}
|
|
108
|
-
files.forEach((file) => {
|
|
109
|
-
let fullPath = file;
|
|
110
|
-
let relativePath = path.relative(process.cwd(), fullPath);
|
|
111
|
-
let canonicalRelativePath = relativePath.replace(/\\/g, '/');
|
|
112
|
-
if (canonicalRelativePath.includes('/.'))
|
|
113
|
-
return;
|
|
114
|
-
if (canonicalRelativePath.startsWith('.'))
|
|
115
|
-
return;
|
|
116
|
-
if (relativePath.startsWith('node_modules'))
|
|
117
|
-
return;
|
|
118
|
-
if (relativePath.startsWith('dist') && rebuild)
|
|
119
|
-
return;
|
|
120
|
-
if (relativePath.startsWith('upload.keys.json'))
|
|
121
|
-
return;
|
|
122
|
-
if (relativePath === 'zip')
|
|
123
|
-
return;
|
|
124
|
-
let t = fs.statSync(fullPath).mtime.toUTCString();
|
|
125
|
-
localTimestamps[canonicalRelativePath] = t;
|
|
126
|
-
if (debug && timestamps[canonicalRelativePath] === t) {
|
|
127
|
-
console.log(`Skipping ${canonicalRelativePath}`);
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
zip.append(fs.createReadStream(fullPath), {name: relativePath});
|
|
131
|
-
console.log(`Adding ${relativePath}...`);
|
|
132
|
-
});
|
|
133
|
-
zip.append(JSON.stringify(localTimestamps), {name: 'timestamps.json'});
|
|
134
|
-
|
|
135
|
-
//upload
|
|
136
|
-
let uploadPromise = new Promise((resolve, reject) => {
|
|
137
|
-
fetch(`${host}/packages/dev/${devKey}/${packageName}?debug=${debug.toString()}&rebuild=${rebuild.toString()}`, {
|
|
138
|
-
method: 'POST',
|
|
139
|
-
body: zip
|
|
140
|
-
}).then(body => body.json()).then(j => resolve(j)).catch(err => {
|
|
141
|
-
reject(err);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
)
|
|
145
|
-
await zip.finalize();
|
|
146
|
-
|
|
147
|
-
try {
|
|
148
|
-
let log = await uploadPromise;
|
|
149
|
-
|
|
150
|
-
fs.unlinkSync('zip');
|
|
151
|
-
if (log['#type'] === 'ApiError') {
|
|
152
|
-
console.log(log['message']);
|
|
153
|
-
console.log(log['innerMessage']);
|
|
154
|
-
return 1;
|
|
155
|
-
} else
|
|
156
|
-
console.log(log);
|
|
157
|
-
} catch (error) {
|
|
158
|
-
console.log(error);
|
|
159
|
-
return 1;
|
|
160
|
-
}
|
|
161
|
-
return 0;
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const argv = require('minimist')(process.argv.slice(2));
|
|
3
|
+
const getFiles = require('node-recursive-directory');
|
|
4
|
+
const fs = require('fs');
|
|
5
|
+
const fetch = require('node-fetch');
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const archiver = require('archiver-promise');
|
|
8
|
+
const walk = require('ignore-walk')
|
|
9
|
+
|
|
10
|
+
// The script is no longer supported
|
|
11
|
+
console.log(`\`datagrok-upload\` is not available, please use \`grok publish\` instead.
|
|
12
|
+
Run \`grok migrate\` to convert your scripts in \`package.json\` and to copy your keys to \`config.yaml\``);
|
|
13
|
+
console.log(`Exiting with code 1`);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
|
|
16
|
+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
|
|
17
|
+
|
|
18
|
+
let mode = argv['_'][1];
|
|
19
|
+
let host = argv['_'][0];
|
|
20
|
+
let rebuild = argv['_'].includes('rebuild');
|
|
21
|
+
|
|
22
|
+
if (mode !== 'debug' && mode !== 'deploy')
|
|
23
|
+
return console.log('Mode must be either debug or deploy');
|
|
24
|
+
|
|
25
|
+
let debug = mode === 'debug';
|
|
26
|
+
|
|
27
|
+
let keys = {
|
|
28
|
+
[host]: ''
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//get key from keys file
|
|
32
|
+
if (fs.existsSync('upload.keys.json')) {
|
|
33
|
+
keys = JSON.parse(fs.readFileSync('upload.keys.json'));
|
|
34
|
+
} else {
|
|
35
|
+
fs.writeFileSync('upload.keys.json', JSON.stringify(keys));
|
|
36
|
+
}
|
|
37
|
+
let devKey = keys[host];
|
|
38
|
+
if (devKey === undefined) {
|
|
39
|
+
devKey = '';
|
|
40
|
+
keys[host] = devKey;
|
|
41
|
+
fs.writeFileSync('upload.keys.json', JSON.stringify(keys));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (devKey === '')
|
|
45
|
+
return console.log('Empty developer key. See upload.keys.json file.');
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
//check if package.json exists, get package name
|
|
49
|
+
let packageName = '';
|
|
50
|
+
if (!fs.existsSync('package.json'))
|
|
51
|
+
return console.log('package.js doesn\'t exists');
|
|
52
|
+
else {
|
|
53
|
+
let packageJson = JSON.parse(fs.readFileSync('package.json'));
|
|
54
|
+
packageName = packageJson['name'];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
process.on('beforeExit', async () => {
|
|
58
|
+
let code = 0;
|
|
59
|
+
try {
|
|
60
|
+
code = await processPackage()
|
|
61
|
+
|
|
62
|
+
} catch (err) {
|
|
63
|
+
console.log(err);
|
|
64
|
+
code = 1;
|
|
65
|
+
}
|
|
66
|
+
console.log(`Exiting with code ${code}`);
|
|
67
|
+
process.exit(code);
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
async function processPackage() {
|
|
71
|
+
//get server timestamps
|
|
72
|
+
let timestamps = {};
|
|
73
|
+
if (debug) {
|
|
74
|
+
try {
|
|
75
|
+
timestamps = await (await fetch(`${host}/packages/dev/${devKey}/${packageName}/timestamps`)).json();
|
|
76
|
+
if (timestamps['#type'] === 'ApiError') {
|
|
77
|
+
console.log(timestamps.message);
|
|
78
|
+
return 1;
|
|
79
|
+
}
|
|
80
|
+
} catch (error) {
|
|
81
|
+
console.log(error);
|
|
82
|
+
return 1;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
let zip = archiver('zip', {store: false});
|
|
87
|
+
|
|
88
|
+
//gather files
|
|
89
|
+
let localTimestamps = {};
|
|
90
|
+
let files = await walk({
|
|
91
|
+
path: '.',
|
|
92
|
+
ignoreFiles: ['.npmignore', '.gitignore'],
|
|
93
|
+
includeEmpty: true,
|
|
94
|
+
follow: true
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
if (!rebuild) {
|
|
98
|
+
const distFiles = await walk({
|
|
99
|
+
path: './dist',
|
|
100
|
+
ignoreFiles: [],
|
|
101
|
+
includeEmpty: true,
|
|
102
|
+
follow: true
|
|
103
|
+
});
|
|
104
|
+
distFiles.forEach((df) => {
|
|
105
|
+
files.push(`dist/${df}`);
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
files.forEach((file) => {
|
|
109
|
+
let fullPath = file;
|
|
110
|
+
let relativePath = path.relative(process.cwd(), fullPath);
|
|
111
|
+
let canonicalRelativePath = relativePath.replace(/\\/g, '/');
|
|
112
|
+
if (canonicalRelativePath.includes('/.'))
|
|
113
|
+
return;
|
|
114
|
+
if (canonicalRelativePath.startsWith('.'))
|
|
115
|
+
return;
|
|
116
|
+
if (relativePath.startsWith('node_modules'))
|
|
117
|
+
return;
|
|
118
|
+
if (relativePath.startsWith('dist') && rebuild)
|
|
119
|
+
return;
|
|
120
|
+
if (relativePath.startsWith('upload.keys.json'))
|
|
121
|
+
return;
|
|
122
|
+
if (relativePath === 'zip')
|
|
123
|
+
return;
|
|
124
|
+
let t = fs.statSync(fullPath).mtime.toUTCString();
|
|
125
|
+
localTimestamps[canonicalRelativePath] = t;
|
|
126
|
+
if (debug && timestamps[canonicalRelativePath] === t) {
|
|
127
|
+
console.log(`Skipping ${canonicalRelativePath}`);
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
zip.append(fs.createReadStream(fullPath), {name: relativePath});
|
|
131
|
+
console.log(`Adding ${relativePath}...`);
|
|
132
|
+
});
|
|
133
|
+
zip.append(JSON.stringify(localTimestamps), {name: 'timestamps.json'});
|
|
134
|
+
|
|
135
|
+
//upload
|
|
136
|
+
let uploadPromise = new Promise((resolve, reject) => {
|
|
137
|
+
fetch(`${host}/packages/dev/${devKey}/${packageName}?debug=${debug.toString()}&rebuild=${rebuild.toString()}`, {
|
|
138
|
+
method: 'POST',
|
|
139
|
+
body: zip
|
|
140
|
+
}).then(body => body.json()).then(j => resolve(j)).catch(err => {
|
|
141
|
+
reject(err);
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
)
|
|
145
|
+
await zip.finalize();
|
|
146
|
+
|
|
147
|
+
try {
|
|
148
|
+
let log = await uploadPromise;
|
|
149
|
+
|
|
150
|
+
fs.unlinkSync('zip');
|
|
151
|
+
if (log['#type'] === 'ApiError') {
|
|
152
|
+
console.log(log['message']);
|
|
153
|
+
console.log(log['innerMessage']);
|
|
154
|
+
return 1;
|
|
155
|
+
} else
|
|
156
|
+
console.log(log);
|
|
157
|
+
} catch (error) {
|
|
158
|
+
console.log(error);
|
|
159
|
+
return 1;
|
|
160
|
+
}
|
|
161
|
+
return 0;
|
|
162
162
|
}
|
package/bin/commands/link.js
CHANGED
|
@@ -34,9 +34,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
34
34
|
|
|
35
35
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
36
36
|
|
|
37
|
-
/**
|
|
38
|
-
* Link: api > utils > other libs - npm install, npm run build, npm link
|
|
39
|
-
* Unlink: npm install in the package and its dependencies, npm unlink
|
|
37
|
+
/**
|
|
38
|
+
* Link: api > utils > other libs - npm install, npm run build, npm link
|
|
39
|
+
* Unlink: npm install in the package and its dependencies, npm unlink
|
|
40
40
|
*/
|
|
41
41
|
var apiPackageName = 'datagrok-api';
|
|
42
42
|
var libScope = '@datagrok-libraries';
|
|
@@ -63,7 +63,7 @@ function link(args) {
|
|
|
63
63
|
console.log('Running `npm install` to get the required dependencies...\n');
|
|
64
64
|
(0, _child_process.exec)('npm install', function (err, stdout, stderr) {
|
|
65
65
|
if (err) throw err;else console.log(stderr, stdout);
|
|
66
|
-
});
|
|
66
|
+
});
|
|
67
67
|
} // The order should start with js-api, then libraries/utils, then other libraries
|
|
68
68
|
|
|
69
69
|
|
package/bin/grok.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
const argv = require('minimist')(process.argv.slice(2), {alias: {k: 'key'}});
|
|
3
|
-
const help = require('./commands/help').help;
|
|
4
|
-
|
|
5
|
-
const commands = {
|
|
6
|
-
add: require('./commands/add').add,
|
|
7
|
-
api: require('./commands/api').api,
|
|
8
|
-
check: require('./commands/check').check,
|
|
9
|
-
config: require('./commands/config').config,
|
|
10
|
-
create: require('./commands/create').create,
|
|
11
|
-
link: require('./commands/link').link,
|
|
12
|
-
unlink: require('./commands/link').unlink,
|
|
13
|
-
publish: require('./commands/publish').publish,
|
|
14
|
-
test: require('./commands/test').test,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const command = argv['_'][0];
|
|
18
|
-
if (command in commands) {
|
|
19
|
-
try {
|
|
20
|
-
if (!commands[command](argv)) {
|
|
21
|
-
console.log(help[command]);
|
|
22
|
-
}
|
|
23
|
-
} catch (err) {
|
|
24
|
-
console.error(err);
|
|
25
|
-
console.log(help[command]);
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
console.log(help.help);
|
|
29
|
-
}
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
const argv = require('minimist')(process.argv.slice(2), {alias: {k: 'key'}});
|
|
3
|
+
const help = require('./commands/help').help;
|
|
4
|
+
|
|
5
|
+
const commands = {
|
|
6
|
+
add: require('./commands/add').add,
|
|
7
|
+
api: require('./commands/api').api,
|
|
8
|
+
check: require('./commands/check').check,
|
|
9
|
+
config: require('./commands/config').config,
|
|
10
|
+
create: require('./commands/create').create,
|
|
11
|
+
link: require('./commands/link').link,
|
|
12
|
+
unlink: require('./commands/link').unlink,
|
|
13
|
+
publish: require('./commands/publish').publish,
|
|
14
|
+
test: require('./commands/test').test,
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
const command = argv['_'][0];
|
|
18
|
+
if (command in commands) {
|
|
19
|
+
try {
|
|
20
|
+
if (!commands[command](argv)) {
|
|
21
|
+
console.log(help[command]);
|
|
22
|
+
}
|
|
23
|
+
} catch (err) {
|
|
24
|
+
console.error(err);
|
|
25
|
+
console.log(help[command]);
|
|
26
|
+
}
|
|
27
|
+
} else {
|
|
28
|
+
console.log(help.help);
|
|
29
|
+
}
|
package/bin/utils/test-utils.js
CHANGED
|
@@ -245,12 +245,12 @@ function _getBrowserPage() {
|
|
|
245
245
|
function runWithTimeout(timeout, f) {
|
|
246
246
|
return new Promise( /*#__PURE__*/function () {
|
|
247
247
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(resolve, reject) {
|
|
248
|
-
var resolveValue;
|
|
248
|
+
var timeoutId, resolveValue;
|
|
249
249
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
250
250
|
while (1) {
|
|
251
251
|
switch (_context.prev = _context.next) {
|
|
252
252
|
case 0:
|
|
253
|
-
setTimeout(function () {
|
|
253
|
+
timeoutId = setTimeout(function () {
|
|
254
254
|
return reject("Timeout exceeded: ".concat(timeout, " ms"));
|
|
255
255
|
}, timeout);
|
|
256
256
|
_context.next = 3;
|
|
@@ -258,9 +258,10 @@ function runWithTimeout(timeout, f) {
|
|
|
258
258
|
|
|
259
259
|
case 3:
|
|
260
260
|
resolveValue = _context.sent;
|
|
261
|
+
clearTimeout(timeoutId);
|
|
261
262
|
resolve(resolveValue);
|
|
262
263
|
|
|
263
|
-
case
|
|
264
|
+
case 6:
|
|
264
265
|
case "end":
|
|
265
266
|
return _context.stop();
|
|
266
267
|
}
|
package/config-template.yaml
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
servers:
|
|
2
|
-
dev:
|
|
3
|
-
url: 'https://dev.datagrok.ai/api'
|
|
4
|
-
key: ''
|
|
5
|
-
public:
|
|
6
|
-
url: 'https://public.datagrok.ai/api'
|
|
7
|
-
key: ''
|
|
8
|
-
local:
|
|
9
|
-
url: 'http://127.0.0.1:8080/api'
|
|
10
|
-
key: ''
|
|
11
|
-
default: 'public'
|
|
1
|
+
servers:
|
|
2
|
+
dev:
|
|
3
|
+
url: 'https://dev.datagrok.ai/api'
|
|
4
|
+
key: ''
|
|
5
|
+
public:
|
|
6
|
+
url: 'https://public.datagrok.ai/api'
|
|
7
|
+
key: ''
|
|
8
|
+
local:
|
|
9
|
+
url: 'http://127.0.0.1:8080/api'
|
|
10
|
+
key: ''
|
|
11
|
+
default: 'public'
|
package/entity-template/app.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
//name: #{NAME}
|
|
3
|
-
//tags: app
|
|
4
|
-
export function #{NAME}() {
|
|
5
|
-
grok.shell.info('Hello!');
|
|
6
|
-
}
|
|
1
|
+
|
|
2
|
+
//name: #{NAME}
|
|
3
|
+
//tags: app
|
|
4
|
+
export function #{NAME}() {
|
|
5
|
+
grok.shell.info('Hello!');
|
|
6
|
+
}
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "#{NAME}",
|
|
3
|
-
"#type": "DataConnection",
|
|
4
|
-
"parameters": {
|
|
5
|
-
"server": "#{GROK_DB_SERVER}",
|
|
6
|
-
"db": "#{DB_NAME}"
|
|
7
|
-
},
|
|
8
|
-
"credentials" : {
|
|
9
|
-
"parameters": {
|
|
10
|
-
"login": "#{LOGIN}",
|
|
11
|
-
"password": "#{PASSWORD}"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
"dataSource": "PostgresDart",
|
|
15
|
-
"description": "#{DB_NAME} db",
|
|
16
|
-
"tags": ["demo"]
|
|
17
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "#{NAME}",
|
|
3
|
+
"#type": "DataConnection",
|
|
4
|
+
"parameters": {
|
|
5
|
+
"server": "#{GROK_DB_SERVER}",
|
|
6
|
+
"db": "#{DB_NAME}"
|
|
7
|
+
},
|
|
8
|
+
"credentials" : {
|
|
9
|
+
"parameters": {
|
|
10
|
+
"login": "#{LOGIN}",
|
|
11
|
+
"password": "#{PASSWORD}"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dataSource": "PostgresDart",
|
|
15
|
+
"description": "#{DB_NAME} db",
|
|
16
|
+
"tags": ["demo"]
|
|
17
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
//name: #{NAME}
|
|
3
|
-
//input: string name
|
|
4
|
-
//output: string greeting
|
|
5
|
-
export function #{NAME}(name) {
|
|
6
|
-
let greeting = 'Hello, ' + name;
|
|
7
|
-
grok.shell.info(greeting);
|
|
8
|
-
return greeting;
|
|
9
|
-
}
|
|
1
|
+
|
|
2
|
+
//name: #{NAME}
|
|
3
|
+
//input: string name
|
|
4
|
+
//output: string greeting
|
|
5
|
+
export function #{NAME}(name) {
|
|
6
|
+
let greeting = 'Hello, ' + name;
|
|
7
|
+
grok.shell.info(greeting);
|
|
8
|
+
return greeting;
|
|
9
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
//name: #{NAME}
|
|
3
|
-
//input: string name
|
|
4
|
-
//output: string greeting
|
|
5
|
-
export function #{NAME}(name: string) {
|
|
6
|
-
let greeting = 'Hello, ' + name;
|
|
7
|
-
grok.shell.info(greeting);
|
|
8
|
-
return greeting;
|
|
9
|
-
}
|
|
1
|
+
|
|
2
|
+
//name: #{NAME}
|
|
3
|
+
//input: string name
|
|
4
|
+
//output: string greeting
|
|
5
|
+
export function #{NAME}(name: string) {
|
|
6
|
+
let greeting = 'Hello, ' + name;
|
|
7
|
+
grok.shell.info(greeting);
|
|
8
|
+
return greeting;
|
|
9
|
+
}
|
package/entity-template/init.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
//tags: init
|
|
3
|
-
export async function #{NAME}() {
|
|
4
|
-
}
|
|
1
|
+
|
|
2
|
+
//tags: init
|
|
3
|
+
export async function #{NAME}() {
|
|
4
|
+
}
|
package/entity-template/panel.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
//name: #{NAME}
|
|
3
|
-
//description: Creates an info panel
|
|
4
|
-
//tags: panel
|
|
5
|
-
//input: string smiles {semType: Molecule}
|
|
6
|
-
//output: widget result
|
|
7
|
-
//condition: true
|
|
8
|
-
export function #{NAME}(smiles) {
|
|
9
|
-
let mol = ui.div(grok.chem.svgMol(smiles));
|
|
10
|
-
return DG.Widget.fromRoot(mol);
|
|
11
|
-
}
|
|
1
|
+
|
|
2
|
+
//name: #{NAME}
|
|
3
|
+
//description: Creates an info panel
|
|
4
|
+
//tags: panel
|
|
5
|
+
//input: string smiles {semType: Molecule}
|
|
6
|
+
//output: widget result
|
|
7
|
+
//condition: true
|
|
8
|
+
export function #{NAME}(smiles) {
|
|
9
|
+
let mol = ui.div(grok.chem.svgMol(smiles));
|
|
10
|
+
return DG.Widget.fromRoot(mol);
|
|
11
|
+
}
|
package/entity-template/panel.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
//name: #{NAME}
|
|
3
|
-
//description: Creates an info panel
|
|
4
|
-
//tags: panel
|
|
5
|
-
//input: string smiles {semType: Molecule}
|
|
6
|
-
//output: widget result
|
|
7
|
-
//condition: true
|
|
8
|
-
export function #{NAME}(smiles: string) {
|
|
9
|
-
let mol = ui.div(grok.chem.svgMol(smiles));
|
|
10
|
-
return DG.Widget.fromRoot(mol);
|
|
11
|
-
}
|
|
1
|
+
|
|
2
|
+
//name: #{NAME}
|
|
3
|
+
//description: Creates an info panel
|
|
4
|
+
//tags: panel
|
|
5
|
+
//input: string smiles {semType: Molecule}
|
|
6
|
+
//output: widget result
|
|
7
|
+
//condition: true
|
|
8
|
+
export function #{NAME}(smiles: string) {
|
|
9
|
+
let mol = ui.div(grok.chem.svgMol(smiles));
|
|
10
|
+
return DG.Widget.fromRoot(mol);
|
|
11
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
--name: #{NAME}
|
|
3
|
-
--connection: #{CONNECTION}
|
|
4
|
-
--input: int id
|
|
5
|
-
--output: dataframe result
|
|
6
|
-
select * from country where id = @id
|
|
7
|
-
--end
|
|
1
|
+
|
|
2
|
+
--name: #{NAME}
|
|
3
|
+
--connection: #{CONNECTION}
|
|
4
|
+
--input: int id
|
|
5
|
+
--output: dataframe result
|
|
6
|
+
select * from country where id = @id
|
|
7
|
+
--end
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
//tags: semTypeDetector
|
|
3
|
-
//input: column col
|
|
4
|
-
//output: string semType
|
|
5
|
-
detect#{PACKAGE_DETECTORS_NAME}(col) {
|
|
6
|
-
if (col.name.startsWith('#{NAME_PREFIX}')) {
|
|
7
|
-
col.semType = '#{NAME}';
|
|
8
|
-
return col.semType;
|
|
9
|
-
}
|
|
10
|
-
return null;
|
|
11
|
-
}
|
|
1
|
+
|
|
2
|
+
//tags: semTypeDetector
|
|
3
|
+
//input: column col
|
|
4
|
+
//output: string semType
|
|
5
|
+
detect#{PACKAGE_DETECTORS_NAME}(col) {
|
|
6
|
+
if (col.name.startsWith('#{NAME_PREFIX}')) {
|
|
7
|
+
col.semType = '#{NAME}';
|
|
8
|
+
return col.semType;
|
|
9
|
+
}
|
|
10
|
+
return null;
|
|
11
|
+
}
|