@flink-app/flink 0.11.4-next.0 → 0.11.4
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/cli/generate-schemas.ts +102 -67
- package/dist/bin/flink.js +2 -2
- package/dist/cli/build.js +5 -5
- package/dist/cli/clean.js +4 -4
- package/dist/cli/cli-utils.js +3 -2
- package/dist/cli/generate-schemas.js +20 -24
- package/dist/cli/run.js +4 -4
- package/dist/src/FlinkApp.d.ts +1 -1
- package/dist/src/FlinkApp.js +76 -78
- package/dist/src/FlinkErrors.d.ts +1 -1
- package/dist/src/FlinkErrors.js +11 -10
- package/dist/src/FlinkHttpHandler.d.ts +7 -7
- package/dist/src/FlinkHttpHandler.js +1 -1
- package/dist/src/FlinkJob.d.ts +2 -2
- package/dist/src/FlinkLog.d.ts +2 -2
- package/dist/src/FlinkRepo.js +9 -9
- package/dist/src/FlinkResponse.d.ts +2 -2
- package/dist/src/FsUtils.js +13 -12
- package/dist/src/TypeScriptCompiler.js +73 -74
- package/dist/src/TypeScriptUtils.js +41 -18
- package/dist/src/index.js +1 -5
- package/dist/src/mock-data-generator.js +1 -1
- package/dist/src/utils.js +20 -19
- package/package.json +8 -8
- package/spec/mock-project/package-lock.json +104 -104
- package/src/FlinkApp.ts +0 -2
- package/src/TypeScriptCompiler.ts +2 -3
- package/src/TypeScriptUtils.ts +164 -110
package/cli/generate-schemas.ts
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { JSONSchema7, JSONSchema7Definition } from "json-schema";
|
|
3
3
|
import { join } from "path";
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
createFormatter,
|
|
6
|
+
createParser,
|
|
7
|
+
SchemaGenerator,
|
|
8
|
+
} from "ts-json-schema-generator";
|
|
5
9
|
import { Project, SyntaxKind, ts } from "ts-morph";
|
|
6
10
|
import { writeJsonFile } from "../src/FsUtils";
|
|
7
11
|
import { getOption } from "./cli-utils";
|
|
8
12
|
|
|
9
13
|
module.exports = async function run(args: string[]) {
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
if (args.includes("--help")) {
|
|
15
|
+
console.log(`
|
|
12
16
|
Description
|
|
13
17
|
Generates JSON schemas for types located in schemas directory or if any other directory
|
|
14
18
|
is specified with option --types-dir.
|
|
@@ -26,93 +30,124 @@ module.exports = async function run(args: string[]) {
|
|
|
26
30
|
--help Displays this message
|
|
27
31
|
`);
|
|
28
32
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
let dir = "./";
|
|
33
|
-
if (args[0] && !args[0].startsWith("--")) {
|
|
34
|
-
dir = args[0];
|
|
35
|
-
}
|
|
33
|
+
process.exit(0);
|
|
34
|
+
}
|
|
36
35
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
36
|
+
let dir = "./";
|
|
37
|
+
if (args[0] && !args[0].startsWith("--")) {
|
|
38
|
+
dir = args[0];
|
|
39
|
+
}
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
const verbose = getOption(args, "verbose", false, {
|
|
42
|
+
isBoolean: true,
|
|
43
|
+
}) as boolean;
|
|
42
44
|
|
|
43
|
-
|
|
45
|
+
const typesDir = getOption(args, "types-dir", "./src/schemas") as string;
|
|
44
46
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
});
|
|
47
|
+
const outFile = getOption(
|
|
48
|
+
args,
|
|
49
|
+
"out-file",
|
|
50
|
+
"./.flink/generated-schemas.json"
|
|
51
|
+
) as string;
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
const project = new Project({
|
|
54
|
+
tsConfigFilePath: join(dir, "tsconfig.json"),
|
|
55
|
+
skipAddingFilesFromTsConfig: true,
|
|
56
|
+
compilerOptions: {
|
|
57
|
+
noEmit: true,
|
|
58
|
+
},
|
|
59
|
+
});
|
|
54
60
|
|
|
55
|
-
|
|
61
|
+
project.addSourceFilesAtPaths(join(dir, typesDir, "**/*.ts"));
|
|
56
62
|
|
|
57
|
-
|
|
63
|
+
console.log("Found", project.getSourceFiles().length, "files");
|
|
58
64
|
|
|
59
|
-
|
|
65
|
+
const schemaDeclarations: ts.Node[] = [];
|
|
60
66
|
|
|
61
|
-
|
|
67
|
+
const generator = initJsonSchemaGenerator(project);
|
|
62
68
|
|
|
63
|
-
|
|
64
|
-
if (sf.getDefaultExportSymbol()) {
|
|
65
|
-
console.warn(`WARN: Schema file ${sf.getBaseName()} has default export, but only named exports are picked up by json schemas parser`);
|
|
66
|
-
}
|
|
69
|
+
const jsonSchemas: JSONSchema7[] = [];
|
|
67
70
|
|
|
68
|
-
|
|
71
|
+
for (const sf of project.getSourceFiles()) {
|
|
72
|
+
if (sf.getDefaultExportSymbol()) {
|
|
73
|
+
console.warn(
|
|
74
|
+
`WARN: Schema file ${sf.getBaseName()} has default export, but only named exports are picked up by json schemas parser`
|
|
75
|
+
);
|
|
76
|
+
}
|
|
69
77
|
|
|
70
|
-
|
|
78
|
+
const sourceFileInterfaceDeclarations = sf.getChildrenOfKind(
|
|
79
|
+
SyntaxKind.InterfaceDeclaration
|
|
80
|
+
);
|
|
71
81
|
|
|
72
|
-
|
|
82
|
+
const sourceFileEnumDeclarations = sf.getChildrenOfKind(
|
|
83
|
+
SyntaxKind.EnumDeclaration
|
|
84
|
+
);
|
|
73
85
|
|
|
74
|
-
|
|
86
|
+
const sourceFileDeclarations = [
|
|
87
|
+
...sourceFileEnumDeclarations,
|
|
88
|
+
...sourceFileInterfaceDeclarations,
|
|
89
|
+
];
|
|
75
90
|
|
|
76
|
-
|
|
91
|
+
schemaDeclarations.push(
|
|
92
|
+
...sourceFileDeclarations.map((d) => d.compilerNode)
|
|
93
|
+
);
|
|
77
94
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
95
|
+
verbose &&
|
|
96
|
+
console.log(
|
|
97
|
+
"Found",
|
|
98
|
+
sourceFileDeclarations.length,
|
|
99
|
+
"schema(s) in file",
|
|
100
|
+
sf.getBaseName()
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
try {
|
|
104
|
+
const schema = generator.createSchemaFromNodes(
|
|
105
|
+
sourceFileInterfaceDeclarations.map((d) => d.compilerNode)
|
|
106
|
+
);
|
|
107
|
+
jsonSchemas.push(schema);
|
|
108
|
+
// console.log("Created schemas");
|
|
109
|
+
} catch (err) {
|
|
110
|
+
console.error(
|
|
111
|
+
"Failed to generate schema in file",
|
|
112
|
+
sf.getBaseName() + ":",
|
|
113
|
+
err
|
|
114
|
+
);
|
|
85
115
|
}
|
|
116
|
+
}
|
|
86
117
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
return out;
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
$schema: "http://json-schema.org/draft-07/schema#",
|
|
97
|
-
$ref: "#/definitions/Schemas",
|
|
98
|
-
definitions: {},
|
|
118
|
+
const mergedSchemas = jsonSchemas.reduce(
|
|
119
|
+
(out, schema) => {
|
|
120
|
+
if (schema)
|
|
121
|
+
if (schema.definitions) {
|
|
122
|
+
out.definitions = { ...out.definitions, ...schema.definitions };
|
|
99
123
|
}
|
|
100
|
-
|
|
124
|
+
return out;
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
128
|
+
$ref: "#/definitions/Schemas",
|
|
129
|
+
definitions: {},
|
|
130
|
+
}
|
|
131
|
+
);
|
|
101
132
|
|
|
102
|
-
|
|
133
|
+
const file = join(dir, outFile);
|
|
103
134
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
135
|
+
await writeJsonFile(file, mergedSchemas, {
|
|
136
|
+
ensureDir: true,
|
|
137
|
+
});
|
|
107
138
|
|
|
108
|
-
|
|
139
|
+
console.log("Wrote file", file);
|
|
109
140
|
};
|
|
110
141
|
|
|
111
142
|
function initJsonSchemaGenerator(project: Project) {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
143
|
+
const formatter = createFormatter({});
|
|
144
|
+
const parser = createParser(project.getProgram().compilerObject, {});
|
|
145
|
+
const generator = new SchemaGenerator(
|
|
146
|
+
project.getProgram().compilerObject,
|
|
147
|
+
parser,
|
|
148
|
+
formatter,
|
|
149
|
+
{ expose: "export" }
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
return generator;
|
|
118
153
|
}
|
package/dist/bin/flink.js
CHANGED
|
@@ -12,11 +12,11 @@ var commands = [
|
|
|
12
12
|
var argv = process.argv.slice(2);
|
|
13
13
|
var argCommand = argv[0];
|
|
14
14
|
if (!argCommand || argv[0] === "help") {
|
|
15
|
-
console.log("Usage: flink ["
|
|
15
|
+
console.log("Usage: flink [" + commands.join("|") + "]");
|
|
16
16
|
process.exit();
|
|
17
17
|
}
|
|
18
18
|
if (!commands.includes(argv[0])) {
|
|
19
|
-
console.log("Invalid command: "
|
|
19
|
+
console.log("Invalid command: " + argCommand);
|
|
20
20
|
process.exit(1);
|
|
21
21
|
}
|
|
22
22
|
if (argCommand === "generate") {
|
package/dist/cli/build.js
CHANGED
|
@@ -10,12 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
14
|
-
return g
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
15
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
16
|
function step(op) {
|
|
17
17
|
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
-
while (
|
|
18
|
+
while (_) try {
|
|
19
19
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
20
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
21
|
switch (op[0]) {
|
|
@@ -57,7 +57,7 @@ module.exports = function run(args) {
|
|
|
57
57
|
if (args[0] && !args[0].startsWith("--")) {
|
|
58
58
|
dir = args[0];
|
|
59
59
|
}
|
|
60
|
-
exclude =
|
|
60
|
+
exclude = cli_utils_1.getOption(args, "exclude", "/spec");
|
|
61
61
|
return [4 /*yield*/, TypeScriptCompiler_1.default.clean(dir)];
|
|
62
62
|
case 1:
|
|
63
63
|
_a.sent();
|
|
@@ -68,7 +68,7 @@ module.exports = function run(args) {
|
|
|
68
68
|
return [4 /*yield*/, Promise.all([compiler.parseRepos(), compiler.parseHandlers(exclude.split(",")), compiler.parseJobs(), compiler.generateStartScript()])];
|
|
69
69
|
case 2:
|
|
70
70
|
_a.sent();
|
|
71
|
-
console.log("Compilation done, took "
|
|
71
|
+
console.log("Compilation done, took " + (Date.now() - startTime) + "ms");
|
|
72
72
|
compiler.emit();
|
|
73
73
|
return [2 /*return*/];
|
|
74
74
|
}
|
package/dist/cli/clean.js
CHANGED
|
@@ -10,12 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
14
|
-
return g
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
15
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
16
|
function step(op) {
|
|
17
17
|
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
-
while (
|
|
18
|
+
while (_) try {
|
|
19
19
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
20
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
21
|
switch (op[0]) {
|
|
@@ -58,7 +58,7 @@ module.exports = function run(args) {
|
|
|
58
58
|
return [4 /*yield*/, TypeScriptCompiler_1.default.clean(dir)];
|
|
59
59
|
case 1:
|
|
60
60
|
cleanedFolder = _a.sent();
|
|
61
|
-
console.log("Cleaned directory "
|
|
61
|
+
console.log("Cleaned directory " + cleanedFolder);
|
|
62
62
|
return [2 /*return*/];
|
|
63
63
|
}
|
|
64
64
|
});
|
package/dist/cli/cli-utils.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOption =
|
|
3
|
+
exports.getOption = void 0;
|
|
4
4
|
function getOption(args, name, defaultValue, opts) {
|
|
5
5
|
if (opts === void 0) { opts = {}; }
|
|
6
|
-
var option = "--"
|
|
6
|
+
var option = "--" + name;
|
|
7
7
|
if (args.includes(option)) {
|
|
8
8
|
if (opts.isBoolean && args[args.indexOf(option) + 1] !== "false") {
|
|
9
9
|
return true;
|
|
@@ -17,3 +17,4 @@ function getOption(args, name, defaultValue, opts) {
|
|
|
17
17
|
}
|
|
18
18
|
return defaultValue;
|
|
19
19
|
}
|
|
20
|
+
exports.getOption = getOption;
|
|
@@ -21,12 +21,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
21
21
|
});
|
|
22
22
|
};
|
|
23
23
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
24
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
25
|
-
return g
|
|
24
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
25
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26
26
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
27
27
|
function step(op) {
|
|
28
28
|
if (f) throw new TypeError("Generator is already executing.");
|
|
29
|
-
while (
|
|
29
|
+
while (_) try {
|
|
30
30
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
31
31
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
32
32
|
switch (op[0]) {
|
|
@@ -47,14 +47,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
47
47
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
48
48
|
}
|
|
49
49
|
};
|
|
50
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
ar[i] = from[i];
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
50
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from) {
|
|
51
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
52
|
+
to[j] = from[i];
|
|
53
|
+
return to;
|
|
58
54
|
};
|
|
59
55
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
60
56
|
var path_1 = require("path");
|
|
@@ -76,19 +72,19 @@ module.exports = function run(args) {
|
|
|
76
72
|
if (args[0] && !args[0].startsWith("--")) {
|
|
77
73
|
dir = args[0];
|
|
78
74
|
}
|
|
79
|
-
verbose =
|
|
75
|
+
verbose = cli_utils_1.getOption(args, "verbose", false, {
|
|
80
76
|
isBoolean: true,
|
|
81
77
|
});
|
|
82
|
-
typesDir =
|
|
83
|
-
outFile =
|
|
78
|
+
typesDir = cli_utils_1.getOption(args, "types-dir", "./src/schemas");
|
|
79
|
+
outFile = cli_utils_1.getOption(args, "out-file", "./.flink/generated-schemas.json");
|
|
84
80
|
project = new ts_morph_1.Project({
|
|
85
|
-
tsConfigFilePath:
|
|
81
|
+
tsConfigFilePath: path_1.join(dir, "tsconfig.json"),
|
|
86
82
|
skipAddingFilesFromTsConfig: true,
|
|
87
83
|
compilerOptions: {
|
|
88
84
|
noEmit: true,
|
|
89
85
|
},
|
|
90
86
|
});
|
|
91
|
-
project.addSourceFilesAtPaths(
|
|
87
|
+
project.addSourceFilesAtPaths(path_1.join(dir, typesDir, "**/*.ts"));
|
|
92
88
|
console.log("Found", project.getSourceFiles().length, "files");
|
|
93
89
|
schemaDeclarations = [];
|
|
94
90
|
generator = initJsonSchemaGenerator(project);
|
|
@@ -96,13 +92,14 @@ module.exports = function run(args) {
|
|
|
96
92
|
for (_i = 0, _a = project.getSourceFiles(); _i < _a.length; _i++) {
|
|
97
93
|
sf = _a[_i];
|
|
98
94
|
if (sf.getDefaultExportSymbol()) {
|
|
99
|
-
console.warn("WARN: Schema file "
|
|
95
|
+
console.warn("WARN: Schema file " + sf.getBaseName() + " has default export, but only named exports are picked up by json schemas parser");
|
|
100
96
|
}
|
|
101
97
|
sourceFileInterfaceDeclarations = sf.getChildrenOfKind(ts_morph_1.SyntaxKind.InterfaceDeclaration);
|
|
102
98
|
sourceFileEnumDeclarations = sf.getChildrenOfKind(ts_morph_1.SyntaxKind.EnumDeclaration);
|
|
103
|
-
sourceFileDeclarations = __spreadArray(__spreadArray([], sourceFileEnumDeclarations
|
|
99
|
+
sourceFileDeclarations = __spreadArray(__spreadArray([], sourceFileEnumDeclarations), sourceFileInterfaceDeclarations);
|
|
104
100
|
schemaDeclarations.push.apply(schemaDeclarations, sourceFileDeclarations.map(function (d) { return d.compilerNode; }));
|
|
105
|
-
verbose &&
|
|
101
|
+
verbose &&
|
|
102
|
+
console.log("Found", sourceFileDeclarations.length, "schema(s) in file", sf.getBaseName());
|
|
106
103
|
try {
|
|
107
104
|
schema = generator.createSchemaFromNodes(sourceFileInterfaceDeclarations.map(function (d) { return d.compilerNode; }));
|
|
108
105
|
jsonSchemas.push(schema);
|
|
@@ -123,8 +120,8 @@ module.exports = function run(args) {
|
|
|
123
120
|
$ref: "#/definitions/Schemas",
|
|
124
121
|
definitions: {},
|
|
125
122
|
});
|
|
126
|
-
file =
|
|
127
|
-
return [4 /*yield*/,
|
|
123
|
+
file = path_1.join(dir, outFile);
|
|
124
|
+
return [4 /*yield*/, FsUtils_1.writeJsonFile(file, mergedSchemas, {
|
|
128
125
|
ensureDir: true,
|
|
129
126
|
})];
|
|
130
127
|
case 1:
|
|
@@ -136,9 +133,8 @@ module.exports = function run(args) {
|
|
|
136
133
|
});
|
|
137
134
|
};
|
|
138
135
|
function initJsonSchemaGenerator(project) {
|
|
139
|
-
var
|
|
140
|
-
var
|
|
141
|
-
var parser = (0, ts_json_schema_generator_1.createParser)(project.getProgram().compilerObject, config);
|
|
136
|
+
var formatter = ts_json_schema_generator_1.createFormatter({});
|
|
137
|
+
var parser = ts_json_schema_generator_1.createParser(project.getProgram().compilerObject, {});
|
|
142
138
|
var generator = new ts_json_schema_generator_1.SchemaGenerator(project.getProgram().compilerObject, parser, formatter, { expose: "export" });
|
|
143
139
|
return generator;
|
|
144
140
|
}
|
package/dist/cli/run.js
CHANGED
|
@@ -10,12 +10,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
});
|
|
11
11
|
};
|
|
12
12
|
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
13
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g
|
|
14
|
-
return g
|
|
13
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
14
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
15
15
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
16
16
|
function step(op) {
|
|
17
17
|
if (f) throw new TypeError("Generator is already executing.");
|
|
18
|
-
while (
|
|
18
|
+
while (_) try {
|
|
19
19
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
20
20
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
21
21
|
switch (op[0]) {
|
|
@@ -81,7 +81,7 @@ module.exports = function run(args) {
|
|
|
81
81
|
return [4 /*yield*/, Promise.all([compiler.parseRepos(), compiler.parseHandlers(), compiler.parseJobs(), compiler.generateStartScript(entry)])];
|
|
82
82
|
case 2:
|
|
83
83
|
_a.sent();
|
|
84
|
-
console.log("Compilation done, took "
|
|
84
|
+
console.log("Compilation done, took " + (Date.now() - startTime) + "ms");
|
|
85
85
|
compiler.emit();
|
|
86
86
|
forkedProcess = require("child_process").fork(dir + "/dist/.flink/start.js");
|
|
87
87
|
forkedProcess.on("exit", function (code) {
|
package/dist/src/FlinkApp.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { HandlerFile, HttpMethod, QueryParamMetadata, RouteProps } from "./Flink
|
|
|
9
9
|
import { FlinkJobFile } from "./FlinkJob";
|
|
10
10
|
import { FlinkPlugin } from "./FlinkPlugin";
|
|
11
11
|
import { FlinkRepo } from "./FlinkRepo";
|
|
12
|
-
export type JSONSchema = JSONSchema7;
|
|
12
|
+
export declare type JSONSchema = JSONSchema7;
|
|
13
13
|
/**
|
|
14
14
|
* This will be populated at compile time when the apps handlers
|
|
15
15
|
* are picked up by TypeScript compiler
|