@flink-app/flink 0.12.1-alpha.0 → 0.12.1-alpha.1

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.
Files changed (46) hide show
  1. package/bin/flink.ts +6 -13
  2. package/dist/bin/flink.js +3 -10
  3. package/dist/cli/build.js +3 -3
  4. package/dist/cli/clean.js +2 -2
  5. package/dist/cli/cli-utils.js +1 -1
  6. package/dist/cli/run.js +2 -2
  7. package/dist/src/FlinkApp.d.ts +1 -1
  8. package/dist/src/FlinkApp.js +77 -77
  9. package/dist/src/FlinkErrors.d.ts +1 -1
  10. package/dist/src/FlinkErrors.js +5 -5
  11. package/dist/src/FlinkHttpHandler.d.ts +7 -7
  12. package/dist/src/FlinkHttpHandler.js +1 -1
  13. package/dist/src/FlinkJob.d.ts +2 -2
  14. package/dist/src/FlinkLog.d.ts +2 -2
  15. package/dist/src/FlinkRepo.d.ts +6 -2
  16. package/dist/src/FlinkRepo.js +19 -10
  17. package/dist/src/FlinkResponse.d.ts +2 -2
  18. package/dist/src/FsUtils.js +7 -7
  19. package/dist/src/TypeScriptCompiler.js +83 -68
  20. package/dist/src/TypeScriptUtils.js +11 -33
  21. package/dist/src/index.js +5 -1
  22. package/dist/src/mock-data-generator.js +1 -1
  23. package/dist/src/utils.js +6 -6
  24. package/package.json +6 -6
  25. package/spec/mock-project/dist/src/handlers/GetCar.js +10 -12
  26. package/spec/mock-project/dist/src/handlers/GetCar2.js +11 -13
  27. package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema.js +8 -10
  28. package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema2.js +8 -10
  29. package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema3.js +8 -10
  30. package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema.js +10 -12
  31. package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema2.js +10 -12
  32. package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile.js +10 -12
  33. package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile2.js +10 -12
  34. package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler.js +10 -12
  35. package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler2.js +10 -12
  36. package/spec/mock-project/dist/src/handlers/PostCar.js +10 -12
  37. package/spec/mock-project/dist/src/handlers/PostLogin.js +11 -13
  38. package/spec/mock-project/dist/src/handlers/PutCar.js +10 -12
  39. package/spec/mock-project/dist/src/index.js +6 -2
  40. package/src/FlinkApp.ts +5 -5
  41. package/src/FlinkRepo.ts +13 -4
  42. package/src/TypeScriptCompiler.ts +13 -2
  43. package/src/TypeScriptUtils.ts +110 -164
  44. package/cli/generate-schemas.ts +0 -153
  45. package/dist/cli/generate-schemas.d.ts +0 -2
  46. package/dist/cli/generate-schemas.js +0 -140
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flink-app/flink",
3
- "version": "0.12.1-alpha.0",
3
+ "version": "0.12.1-alpha.1",
4
4
  "description": "Typescript only framework for creating REST-like APIs on top of Express and mongodb",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "main": "dist/src/index.js",
@@ -47,9 +47,9 @@
47
47
  "reflect-metadata": "^0.1.13",
48
48
  "tiny-glob": "^0.2.9",
49
49
  "toad-scheduler": "^2.2.0",
50
- "ts-json-schema-generator": "0.94.1",
51
- "ts-morph": "11.0.0",
52
- "typescript": "4.2.3",
50
+ "ts-json-schema-generator": "2.3.0",
51
+ "ts-morph": "22.0.0",
52
+ "typescript": "5.4.5",
53
53
  "uuid": "^8.3.2"
54
54
  },
55
55
  "devDependencies": {
@@ -58,7 +58,7 @@
58
58
  "@types/json-schema": "^7.0.7",
59
59
  "@types/mkdirp": "^1.0.1",
60
60
  "@types/morgan": "^1.9.4",
61
- "@types/node": "^15.0.1",
61
+ "@types/node": "22.13.10",
62
62
  "jasmine": "^3.7.0",
63
63
  "jasmine-spec-reporter": "^7.0.0",
64
64
  "jasmine-ts": "^0.3.3",
@@ -66,5 +66,5 @@
66
66
  "rimraf": "^3.0.2",
67
67
  "ts-node": "^9.1.1"
68
68
  },
69
- "gitHead": "7f6e32aa896f5cade313f3c5133c756fc5391ce8"
69
+ "gitHead": "040e670be372c0cc47d9c7106bed55780910cf39"
70
70
  }
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -42,18 +42,16 @@ exports.Route = {
42
42
  path: "/car/:id",
43
43
  method: flink_1.HttpMethod.get,
44
44
  };
45
- var GetCar = function (_a) {
46
- var ctx = _a.ctx, req = _a.req;
47
- return __awaiter(void 0, void 0, void 0, function () {
48
- return __generator(this, function (_b) {
49
- return [2 /*return*/, {
50
- data: {
51
- model: "Volvo",
52
- },
53
- }];
54
- });
45
+ var GetCar = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
46
+ var ctx = _b.ctx, req = _b.req;
47
+ return __generator(this, function (_c) {
48
+ return [2 /*return*/, {
49
+ data: {
50
+ model: "Volvo",
51
+ },
52
+ }];
55
53
  });
56
- };
54
+ }); };
57
55
  exports.default = GetCar;
58
56
  exports.__assumedHttpMethod = "get", exports.__file = "GetCar.ts", exports.__query = [{ description: "For pagination", name: "page" }], exports.__params = [{ description: "", name: "id" }];
59
57
  exports.__schemas = { reqSchema: undefined, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -43,19 +43,17 @@ exports.Route = {
43
43
  method: flink_1.HttpMethod.get,
44
44
  permissions: "*",
45
45
  };
46
- var GetCar2 = function (_a) {
47
- var ctx = _a.ctx, req = _a.req;
48
- return __awaiter(void 0, void 0, void 0, function () {
49
- return __generator(this, function (_b) {
50
- return [2 /*return*/, {
51
- data: {
52
- model: { name: "Mercedes" },
53
- engine: { name: "Rolls Royce" },
54
- },
55
- }];
56
- });
46
+ var GetCar2 = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
47
+ var ctx = _b.ctx, req = _b.req;
48
+ return __generator(this, function (_c) {
49
+ return [2 /*return*/, {
50
+ data: {
51
+ model: { name: "Mercedes" },
52
+ engine: { name: "Rolls Royce" },
53
+ },
54
+ }];
57
55
  });
58
- };
56
+ }); };
59
57
  exports.default = GetCar2;
60
58
  exports.__assumedHttpMethod = "get", exports.__file = "GetCar2.ts", exports.__query = [], exports.__params = [];
61
59
  exports.__schemas = { reqSchema: undefined, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "model": { "type": "object", "properties": { "name": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["name"], "additionalProperties": false }, "engine": { "type": "object", "properties": { "name": { "type": "string" } }, "required": ["name"], "additionalProperties": false } }, "required": ["model", "engine"], "additionalProperties": false, "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,16 +40,14 @@ exports.__schemas = exports.__params = exports.__query = exports.__file = export
40
40
  exports.Route = {
41
41
  path: "/car-with-array-schema",
42
42
  };
43
- var GetCarWithArraySchema = function (_a) {
44
- var ctx = _a.ctx, req = _a.req;
45
- return __awaiter(void 0, void 0, void 0, function () {
46
- return __generator(this, function (_b) {
47
- return [2 /*return*/, {
48
- data: [{ model: "Volvo" }],
49
- }];
50
- });
43
+ var GetCarWithArraySchema = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
44
+ var ctx = _b.ctx, req = _b.req;
45
+ return __generator(this, function (_c) {
46
+ return [2 /*return*/, {
47
+ data: [{ model: "Volvo" }],
48
+ }];
51
49
  });
52
- };
50
+ }); };
53
51
  exports.default = GetCarWithArraySchema;
54
52
  exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithArraySchema.ts", exports.__query = [], exports.__params = [];
55
53
  exports.__schemas = { reqSchema: undefined, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", "items": { "type": "object", "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "additionalProperties": false }, "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,16 +40,14 @@ exports.__schemas = exports.__params = exports.__query = exports.__file = export
40
40
  exports.Route = {
41
41
  path: "/car-with-array-schema2",
42
42
  };
43
- var GetCarWithArraySchema2 = function (_a) {
44
- var ctx = _a.ctx, req = _a.req;
45
- return __awaiter(void 0, void 0, void 0, function () {
46
- return __generator(this, function (_b) {
47
- return [2 /*return*/, {
48
- data: [{ car: { model: "Volvo" } }],
49
- }];
50
- });
43
+ var GetCarWithArraySchema2 = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
44
+ var ctx = _b.ctx, req = _b.req;
45
+ return __generator(this, function (_c) {
46
+ return [2 /*return*/, {
47
+ data: [{ car: { model: "Volvo" } }],
48
+ }];
51
49
  });
52
- };
50
+ }); };
53
51
  exports.default = GetCarWithArraySchema2;
54
52
  exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithArraySchema2.ts", exports.__query = [], exports.__params = [];
55
53
  exports.__schemas = { reqSchema: undefined, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", "items": { "type": "object", "properties": { "car": { "type": "object", "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "additionalProperties": false } }, "required": ["car"], "additionalProperties": false }, "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,16 +40,14 @@ exports.__schemas = exports.__params = exports.__query = exports.__file = export
40
40
  exports.Route = {
41
41
  path: "/car-with-array-schema3",
42
42
  };
43
- var GetCarWithArraySchema3 = function (_a) {
44
- var ctx = _a.ctx, req = _a.req;
45
- return __awaiter(void 0, void 0, void 0, function () {
46
- return __generator(this, function (_b) {
47
- return [2 /*return*/, {
48
- data: [{ car: { model: "Volvo" }, year: 2002 }],
49
- }];
50
- });
43
+ var GetCarWithArraySchema3 = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
44
+ var ctx = _b.ctx, req = _b.req;
45
+ return __generator(this, function (_c) {
46
+ return [2 /*return*/, {
47
+ data: [{ car: { model: "Volvo" }, year: 2002 }],
48
+ }];
51
49
  });
52
- };
50
+ }); };
53
51
  exports.default = GetCarWithArraySchema3;
54
52
  exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithArraySchema3.ts", exports.__query = [], exports.__params = [];
55
53
  exports.__schemas = { reqSchema: undefined, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "array", "items": { "type": "object", "properties": { "car": { "type": "object", "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "additionalProperties": false }, "year": { "type": "number" } }, "required": ["car", "year"], "additionalProperties": false }, "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,18 +40,16 @@ exports.__schemas = exports.__params = exports.__query = exports.__file = export
40
40
  exports.Route = {
41
41
  path: "/car-with-literal-schema",
42
42
  };
43
- var GetCarWithLiteralSchema = function (_a) {
44
- var ctx = _a.ctx, req = _a.req;
45
- return __awaiter(void 0, void 0, void 0, function () {
46
- return __generator(this, function (_b) {
47
- return [2 /*return*/, {
48
- data: {
49
- car: { model: "Volvo" },
50
- },
51
- }];
52
- });
43
+ var GetCarWithLiteralSchema = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
44
+ var ctx = _b.ctx, req = _b.req;
45
+ return __generator(this, function (_c) {
46
+ return [2 /*return*/, {
47
+ data: {
48
+ car: { model: "Volvo" },
49
+ },
50
+ }];
53
51
  });
54
- };
52
+ }); };
55
53
  exports.default = GetCarWithLiteralSchema;
56
54
  exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithLiteralSchema.ts", exports.__query = [], exports.__params = [];
57
55
  exports.__schemas = { reqSchema: undefined, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "car": { "type": "object", "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "additionalProperties": false } }, "required": ["car"], "additionalProperties": false, "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,18 +40,16 @@ exports.__schemas = exports.__params = exports.__query = exports.__file = export
40
40
  exports.Route = {
41
41
  path: "/car-with-literal-schema2",
42
42
  };
43
- var GetCarWithLiteralSchema2 = function (_a) {
44
- var ctx = _a.ctx, req = _a.req;
45
- return __awaiter(void 0, void 0, void 0, function () {
46
- return __generator(this, function (_b) {
47
- return [2 /*return*/, {
48
- data: {
49
- car: { nestedCar: { model: "Volvo" } },
50
- },
51
- }];
52
- });
43
+ var GetCarWithLiteralSchema2 = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
44
+ var ctx = _b.ctx, req = _b.req;
45
+ return __generator(this, function (_c) {
46
+ return [2 /*return*/, {
47
+ data: {
48
+ car: { nestedCar: { model: "Volvo" } },
49
+ },
50
+ }];
53
51
  });
54
- };
52
+ }); };
55
53
  exports.default = GetCarWithLiteralSchema2;
56
54
  exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithLiteralSchema2.ts", exports.__query = [], exports.__params = [];
57
55
  exports.__schemas = { reqSchema: undefined, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "car": { "type": "object", "properties": { "nestedCar": { "type": "object", "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "additionalProperties": false } }, "required": ["nestedCar"], "additionalProperties": false } }, "required": ["car"], "additionalProperties": false, "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -43,18 +43,16 @@ exports.Route = {
43
43
  method: flink_1.HttpMethod.get,
44
44
  permissions: "*",
45
45
  };
46
- var GetCarWithSchemaInFile = function (_a) {
47
- var ctx = _a.ctx, req = _a.req;
48
- return __awaiter(void 0, void 0, void 0, function () {
49
- return __generator(this, function (_b) {
50
- return [2 /*return*/, {
51
- data: {
52
- model: "Volvo",
53
- },
54
- }];
55
- });
46
+ var GetCarWithSchemaInFile = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
47
+ var ctx = _b.ctx, req = _b.req;
48
+ return __generator(this, function (_c) {
49
+ return [2 /*return*/, {
50
+ data: {
51
+ model: "Volvo",
52
+ },
53
+ }];
56
54
  });
57
- };
55
+ }); };
58
56
  exports.default = GetCarWithSchemaInFile;
59
57
  exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithSchemaInFile.ts", exports.__query = [], exports.__params = [];
60
58
  exports.__schemas = { reqSchema: undefined, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "model": { "type": "string" } }, "required": ["model"], "additionalProperties": false, "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -43,18 +43,16 @@ exports.Route = {
43
43
  method: flink_1.HttpMethod.get,
44
44
  permissions: "*",
45
45
  };
46
- var GetCarWithSchemaInFile2 = function (_a) {
47
- var ctx = _a.ctx, req = _a.req;
48
- return __awaiter(void 0, void 0, void 0, function () {
49
- return __generator(this, function (_b) {
50
- return [2 /*return*/, {
51
- data: {
52
- car: { model: "Volvo" },
53
- },
54
- }];
55
- });
46
+ var GetCarWithSchemaInFile2 = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
47
+ var ctx = _b.ctx, req = _b.req;
48
+ return __generator(this, function (_c) {
49
+ return [2 /*return*/, {
50
+ data: {
51
+ car: { model: "Volvo" },
52
+ },
53
+ }];
56
54
  });
57
- };
55
+ }); };
58
56
  exports.default = GetCarWithSchemaInFile2;
59
57
  exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithSchemaInFile2.ts", exports.__query = [], exports.__params = [];
60
58
  exports.__schemas = { reqSchema: undefined, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": { "car": { "type": "object", "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "additionalProperties": false } }, "required": ["car"], "additionalProperties": false, "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -39,18 +39,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
40
  // This handle is added using `app.addHandler()` and hence should not have
41
41
  // any route props defined
42
- var manuallyAddedHandler = function (_a) {
43
- var ctx = _a.ctx, req = _a.req;
44
- return __awaiter(void 0, void 0, void 0, function () {
45
- return __generator(this, function (_b) {
46
- return [2 /*return*/, {
47
- data: {
48
- model: "Volvo",
49
- },
50
- }];
51
- });
42
+ var manuallyAddedHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
43
+ var ctx = _b.ctx, req = _b.req;
44
+ return __generator(this, function (_c) {
45
+ return [2 /*return*/, {
46
+ data: {
47
+ model: "Volvo",
48
+ },
49
+ }];
52
50
  });
53
- };
51
+ }); };
54
52
  exports.default = manuallyAddedHandler;
55
53
  exports.__assumedHttpMethod = "", exports.__file = "ManuallyAddedHandler.ts", exports.__query = [], exports.__params = [];
56
54
  exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "definitions": {} }, resSchema: undefined };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -41,18 +41,16 @@ exports.Route = {
41
41
  path: "/manually-added-handler-2",
42
42
  skipAutoRegister: true,
43
43
  };
44
- var manuallyAddedHandler = function (_a) {
45
- var ctx = _a.ctx, req = _a.req;
46
- return __awaiter(void 0, void 0, void 0, function () {
47
- return __generator(this, function (_b) {
48
- return [2 /*return*/, {
49
- data: {
50
- model: "Volvo",
51
- },
52
- }];
53
- });
44
+ var manuallyAddedHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
45
+ var ctx = _b.ctx, req = _b.req;
46
+ return __generator(this, function (_c) {
47
+ return [2 /*return*/, {
48
+ data: {
49
+ model: "Volvo",
50
+ },
51
+ }];
54
52
  });
55
- };
53
+ }); };
56
54
  exports.default = manuallyAddedHandler;
57
55
  exports.__assumedHttpMethod = "", exports.__file = "ManuallyAddedHandler2.ts", exports.__query = [], exports.__params = [];
58
56
  exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "definitions": {} }, resSchema: undefined };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,18 +40,16 @@ exports.__schemas = exports.__params = exports.__query = exports.__file = export
40
40
  exports.Route = {
41
41
  path: "/car",
42
42
  };
43
- var PostCar = function (_a) {
44
- var ctx = _a.ctx, req = _a.req;
45
- return __awaiter(void 0, void 0, void 0, function () {
46
- return __generator(this, function (_b) {
47
- return [2 /*return*/, {
48
- data: {
49
- model: "Volvo",
50
- },
51
- }];
52
- });
43
+ var PostCar = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
44
+ var ctx = _b.ctx, req = _b.req;
45
+ return __generator(this, function (_c) {
46
+ return [2 /*return*/, {
47
+ data: {
48
+ model: "Volvo",
49
+ },
50
+ }];
53
51
  });
54
- };
52
+ }); };
55
53
  exports.default = PostCar;
56
54
  exports.__assumedHttpMethod = "post", exports.__file = "PostCar.ts", exports.__query = [], exports.__params = [];
57
55
  exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "definitions": {} } };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,19 +40,17 @@ exports.__schemas = exports.__params = exports.__query = exports.__file = export
40
40
  exports.Route = {
41
41
  path: "/login",
42
42
  };
43
- var PostLogin = function (_a) {
44
- var ctx = _a.ctx, req = _a.req;
45
- return __awaiter(void 0, void 0, void 0, function () {
46
- return __generator(this, function (_b) {
47
- return [2 /*return*/, {
48
- data: {},
49
- headers: {
50
- "x-test": "hello world",
51
- },
52
- }];
53
- });
43
+ var PostLogin = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
44
+ var ctx = _b.ctx, req = _b.req;
45
+ return __generator(this, function (_c) {
46
+ return [2 /*return*/, {
47
+ data: {},
48
+ headers: {
49
+ "x-test": "hello world",
50
+ },
51
+ }];
54
52
  });
55
- };
53
+ }); };
56
54
  exports.default = PostLogin;
57
55
  exports.__assumedHttpMethod = "post", exports.__file = "PostLogin.ts", exports.__query = [], exports.__params = [];
58
56
  exports.__schemas = { reqSchema: undefined, resSchema: undefined };
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
17
- while (_) try {
17
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
18
18
  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;
19
19
  if (y = 0, t) op = [op[0] & 2, t.value];
20
20
  switch (op[0]) {
@@ -40,18 +40,16 @@ exports.__schemas = exports.__params = exports.__query = exports.__file = export
40
40
  exports.Route = {
41
41
  path: "/car",
42
42
  };
43
- var PutCar = function (_a) {
44
- var ctx = _a.ctx, req = _a.req;
45
- return __awaiter(void 0, void 0, void 0, function () {
46
- return __generator(this, function (_b) {
47
- return [2 /*return*/, {
48
- data: {
49
- model: "Volvo",
50
- },
51
- }];
52
- });
43
+ var PutCar = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
44
+ var ctx = _b.ctx, req = _b.req;
45
+ return __generator(this, function (_c) {
46
+ return [2 /*return*/, {
47
+ data: {
48
+ model: "Volvo",
49
+ },
50
+ }];
53
51
  });
54
- };
52
+ }); };
55
53
  exports.default = PutCar;
56
54
  exports.__assumedHttpMethod = "put", exports.__file = "PutCar.ts", exports.__query = [], exports.__params = [];
57
55
  exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"], "definitions": {} }, resSchema: undefined };
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -33,7 +37,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
33
37
  function verb(n) { return function (v) { return step([n, v]); }; }
34
38
  function step(op) {
35
39
  if (f) throw new TypeError("Generator is already executing.");
36
- while (_) try {
40
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
37
41
  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;
38
42
  if (y = 0, t) op = [op[0] & 2, t.value];
39
43
  switch (op[0]) {
package/src/FlinkApp.ts CHANGED
@@ -2,9 +2,9 @@ import Ajv, { ValidateFunction } from "ajv";
2
2
  import addFormats from "ajv-formats";
3
3
  import bodyParser, { OptionsJson } from "body-parser";
4
4
  import cors from "cors";
5
- import express, { Express, Request } from "express";
5
+ import express, { Express, Request, RequestHandler } from "express";
6
6
  import { JSONSchema7 } from "json-schema";
7
- import mongodb, { Db, MongoClient, ServerApiVersion } from "mongodb";
7
+ import { Db, MongoClient, ServerApiVersion } from "mongodb";
8
8
  import morgan from "morgan";
9
9
  import ms from "ms";
10
10
  import { AsyncTask, CronJob, SimpleIntervalJob, ToadScheduler } from "toad-scheduler";
@@ -303,14 +303,14 @@ export class FlinkApp<C extends FlinkContext> {
303
303
 
304
304
  if (this.rawContentTypes) {
305
305
  for (const type of this.rawContentTypes) {
306
- this.expressApp.use(express.raw({ type }));
306
+ this.expressApp.use(express.raw({ type }) as RequestHandler);
307
307
  }
308
308
  }
309
309
 
310
- this.expressApp.use(bodyParser.json(this.jsonOptions));
310
+ this.expressApp.use(bodyParser.json(this.jsonOptions) as RequestHandler);
311
311
 
312
312
  if (this.accessLog.enabled) {
313
- this.expressApp.use(morgan(this.accessLog.format));
313
+ this.expressApp.use(morgan(this.accessLog.format) as RequestHandler);
314
314
  }
315
315
 
316
316
  this.expressApp.use((req, res, next) => {