@flink-app/flink 0.3.12 → 0.4.0
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/.vscode/notes.txt +11 -0
- package/cli/run.ts +23 -27
- package/dist/bin/flink.js +2 -2
- package/dist/cli/build.js +3 -3
- package/dist/cli/clean.js +2 -2
- package/dist/cli/cli-utils.js +1 -1
- package/dist/cli/generate-schemas.js +20 -16
- package/dist/cli/run.js +3 -7
- package/dist/src/FlinkApp.d.ts +21 -3
- package/dist/src/FlinkApp.js +163 -53
- package/dist/src/FlinkErrors.d.ts +1 -1
- package/dist/src/FlinkErrors.js +5 -5
- package/dist/src/FlinkHttpHandler.d.ts +7 -7
- package/dist/src/FlinkJob.d.ts +58 -0
- package/dist/src/FlinkJob.js +2 -0
- package/dist/src/FlinkLog.d.ts +16 -0
- package/dist/src/FlinkLog.js +11 -30
- package/dist/src/FlinkRepo.js +1 -1
- package/dist/src/FlinkResponse.d.ts +2 -2
- package/dist/src/FsUtils.js +4 -4
- package/dist/src/TypeScriptCompiler.d.ts +5 -1
- package/dist/src/TypeScriptCompiler.js +119 -91
- package/dist/src/TypeScriptUtils.js +1 -1
- package/dist/src/index.d.ts +2 -1
- package/dist/src/index.js +7 -2
- package/dist/src/mock-data-generator.js +1 -1
- package/dist/src/utils.js +9 -9
- package/package.json +7 -3
- package/spec/mock-project/dist/src/handlers/GetCar.js +59 -0
- package/spec/mock-project/dist/src/handlers/GetCar2.js +61 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema.js +55 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema2.js +55 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithArraySchema3.js +55 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema.js +57 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithLiteralSchema2.js +57 -0
- package/{dist/cli/generate.js → spec/mock-project/dist/src/handlers/GetCarWithOmitSchema.js} +19 -14
- package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile.js +60 -0
- package/spec/mock-project/dist/src/handlers/GetCarWithSchemaInFile2.js +60 -0
- package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler.js +56 -0
- package/spec/mock-project/dist/src/handlers/ManuallyAddedHandler2.js +58 -0
- package/spec/mock-project/dist/src/handlers/PostCar.js +57 -0
- package/{dist/cli/generate-schema.js → spec/mock-project/dist/src/handlers/PostLogin.js} +18 -14
- package/spec/mock-project/dist/src/handlers/PutCar.js +57 -0
- package/spec/mock-project/dist/src/index.js +79 -0
- package/spec/mock-project/dist/src/repos/CarRepo.js +26 -0
- package/spec/mock-project/dist/src/schemas/Car.js +2 -0
- package/spec/mock-project/dist/src/schemas/DefaultExportSchema.js +2 -0
- package/spec/mock-project/dist/src/schemas/FileWithTwoSchemas.js +2 -0
- package/src/FlinkApp.ts +146 -11
- package/src/FlinkJob.ts +64 -0
- package/src/FlinkLog.ts +13 -11
- package/src/TypeScriptCompiler.ts +593 -663
- package/src/index.ts +2 -1
- package/dist/cli/generate-schema.d.ts +0 -2
- package/dist/cli/generate.d.ts +0 -2
- package/dist/src/FlinkTsParser.d.ts +0 -2
- package/dist/src/FlinkTsParser.js +0 -219
- package/dist/src/FlinkTsUtils.d.ts +0 -16
- package/dist/src/FlinkTsUtils.js +0 -118
package/dist/src/index.js
CHANGED
|
@@ -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.
|
|
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];
|
|
@@ -10,13 +14,14 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./FlinkLog"), exports);
|
|
13
18
|
__exportStar(require("./FlinkApp"), exports);
|
|
14
19
|
__exportStar(require("./FlinkHttpHandler"), exports);
|
|
15
20
|
__exportStar(require("./FlinkContext"), exports);
|
|
16
21
|
__exportStar(require("./FlinkRepo"), exports);
|
|
17
22
|
__exportStar(require("./FlinkResponse"), exports);
|
|
18
|
-
__exportStar(require("./FlinkLog"), exports);
|
|
19
23
|
__exportStar(require("./FlinkErrors"), exports);
|
|
20
24
|
__exportStar(require("./FlinkPlugin"), exports);
|
|
25
|
+
__exportStar(require("./FlinkJob"), exports);
|
|
21
26
|
__exportStar(require("./auth/FlinkAuthUser"), exports);
|
|
22
27
|
__exportStar(require("./auth/FlinkAuthPlugin"), exports);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
var mock_json_schema_1 = require("mock-json-schema");
|
|
4
4
|
var generateMockData = function (schema) {
|
|
5
5
|
// TODO: mock-json-schema does not seem to handle `examples` array, might want to switch to json-schema-faker
|
|
6
|
-
var mockData = mock_json_schema_1.mock(schema);
|
|
6
|
+
var mockData = (0, mock_json_schema_1.mock)(schema);
|
|
7
7
|
return mockData;
|
|
8
8
|
};
|
|
9
9
|
exports.default = generateMockData;
|
package/dist/src/utils.js
CHANGED
|
@@ -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]) {
|
|
@@ -45,11 +45,11 @@ var tiny_glob_1 = __importDefault(require("tiny-glob"));
|
|
|
45
45
|
var FlinkHttpHandler_1 = require("./FlinkHttpHandler");
|
|
46
46
|
var FlinkLog_1 = require("./FlinkLog");
|
|
47
47
|
function handlersPath(appRoot) {
|
|
48
|
-
return path_1.join(appRoot, "src", "handlers");
|
|
48
|
+
return (0, path_1.join)(appRoot, "src", "handlers");
|
|
49
49
|
}
|
|
50
50
|
exports.handlersPath = handlersPath;
|
|
51
51
|
function schemasPath(appRoot) {
|
|
52
|
-
return path_1.join(appRoot, "src", "schemas");
|
|
52
|
+
return (0, path_1.join)(appRoot, "src", "schemas");
|
|
53
53
|
}
|
|
54
54
|
exports.schemasPath = schemasPath;
|
|
55
55
|
function isRouteMatch(req, routes) {
|
|
@@ -73,14 +73,14 @@ function getHandlerFiles(appRoot) {
|
|
|
73
73
|
switch (_a.label) {
|
|
74
74
|
case 0:
|
|
75
75
|
_a.trys.push([0, 2, , 3]);
|
|
76
|
-
return [4 /*yield*/, tiny_glob_1.default("**/*.ts", {
|
|
76
|
+
return [4 /*yield*/, (0, tiny_glob_1.default)("**/*.ts", {
|
|
77
77
|
cwd: handlersPath(appRoot),
|
|
78
78
|
absolute: true,
|
|
79
79
|
})];
|
|
80
80
|
case 1: return [2 /*return*/, _a.sent()];
|
|
81
81
|
case 2:
|
|
82
82
|
err_1 = _a.sent();
|
|
83
|
-
FlinkLog_1.log.debug("Failed getting handler files: "
|
|
83
|
+
FlinkLog_1.log.debug("Failed getting handler files: ".concat(err_1));
|
|
84
84
|
return [2 /*return*/, []];
|
|
85
85
|
case 3: return [2 /*return*/];
|
|
86
86
|
}
|
|
@@ -95,7 +95,7 @@ function getSchemaFiles(appRoot) {
|
|
|
95
95
|
switch (_a.label) {
|
|
96
96
|
case 0:
|
|
97
97
|
_a.trys.push([0, 2, , 3]);
|
|
98
|
-
return [4 /*yield*/, tiny_glob_1.default("**/*.ts", {
|
|
98
|
+
return [4 /*yield*/, (0, tiny_glob_1.default)("**/*.ts", {
|
|
99
99
|
cwd: schemasPath(appRoot),
|
|
100
100
|
absolute: true,
|
|
101
101
|
})];
|
|
@@ -159,7 +159,7 @@ function deRefSchema(schemaToDeRef, jsonSchemas) {
|
|
|
159
159
|
schemaToDeRef.items = deRefSchema(refedSchema, jsonSchemas);
|
|
160
160
|
}
|
|
161
161
|
else {
|
|
162
|
-
console.warn("Failed to find deref "
|
|
162
|
+
console.warn("Failed to find deref ".concat(schemaToDeRef.$ref));
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
else {
|
|
@@ -179,7 +179,7 @@ function deRefSchema(schemaToDeRef, jsonSchemas) {
|
|
|
179
179
|
schemaToDeRef.properties[k] = deRefSchema(refedSchema, jsonSchemas);
|
|
180
180
|
}
|
|
181
181
|
else {
|
|
182
|
-
console.warn("Failed to find deref "
|
|
182
|
+
console.warn("Failed to find deref ".concat(prop.$ref));
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
185
|
else if (prop.type === "array" && prop.items.$ref) {
|
|
@@ -189,7 +189,7 @@ function deRefSchema(schemaToDeRef, jsonSchemas) {
|
|
|
189
189
|
schemaToDeRef.properties[k].items = deRefSchema(refedSchema, jsonSchemas);
|
|
190
190
|
}
|
|
191
191
|
else {
|
|
192
|
-
console.warn("Failed to find deref "
|
|
192
|
+
console.warn("Failed to find deref ".concat(prop.$ref));
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
else if (prop.type === "object" || prop.type === "array") {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flink-app/flink",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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",
|
|
@@ -33,17 +33,20 @@
|
|
|
33
33
|
"ajv-formats": "^2.1.0",
|
|
34
34
|
"body-parser": "^1.19.0",
|
|
35
35
|
"cors": "^2.8.5",
|
|
36
|
+
"croner": "^5.4.1",
|
|
36
37
|
"express": "^4.17.1",
|
|
37
38
|
"folder-hash": "^4.0.1",
|
|
38
39
|
"fs-extra": "^10.0.0",
|
|
39
40
|
"mkdirp": "^1.0.4",
|
|
40
41
|
"mock-json-schema": "^1.0.8",
|
|
41
42
|
"mongodb": "^3.6.6",
|
|
42
|
-
"
|
|
43
|
+
"ms": "^2.0.0",
|
|
44
|
+
"node-color-log": "^10.0.2",
|
|
43
45
|
"passport": "^0.4.1",
|
|
44
46
|
"passport-jwt": "^4.0.0",
|
|
45
47
|
"reflect-metadata": "^0.1.13",
|
|
46
48
|
"tiny-glob": "^0.2.9",
|
|
49
|
+
"toad-scheduler": "^2.2.0",
|
|
47
50
|
"ts-json-schema-generator": "0.94.1",
|
|
48
51
|
"ts-morph": "11.0.0",
|
|
49
52
|
"typescript": "4.2.3",
|
|
@@ -54,6 +57,7 @@
|
|
|
54
57
|
"@types/jasmine": "^3.7.1",
|
|
55
58
|
"@types/json-schema": "^7.0.7",
|
|
56
59
|
"@types/mkdirp": "^1.0.1",
|
|
60
|
+
"@types/ms": "^0.7.31",
|
|
57
61
|
"@types/node": "^15.0.1",
|
|
58
62
|
"jasmine": "^3.7.0",
|
|
59
63
|
"jasmine-spec-reporter": "^7.0.0",
|
|
@@ -62,5 +66,5 @@
|
|
|
62
66
|
"rimraf": "^3.0.2",
|
|
63
67
|
"ts-node": "^9.1.1"
|
|
64
68
|
},
|
|
65
|
-
"gitHead": "
|
|
69
|
+
"gitHead": "167e0b1d9dc3d4d14610633bbbda93fde1ea30f5"
|
|
66
70
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
|
|
40
|
+
var flink_1 = require("@flink-app/flink");
|
|
41
|
+
exports.Route = {
|
|
42
|
+
path: "/car/:id",
|
|
43
|
+
method: flink_1.HttpMethod.get,
|
|
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
|
+
});
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
exports.default = GetCar;
|
|
58
|
+
exports.__assumedHttpMethod = "get", exports.__file = "GetCar.ts", exports.__query = [{ description: "For pagination", name: "page" }], exports.__params = [{ description: "", name: "id" }];
|
|
59
|
+
exports.__schemas = { reqSchema: undefined, resSchema: { "type": "object", "additionalProperties": false, "properties": { "model": { "type": "string" }, "metadata": { "type": "object", "properties": { "created": { "type": "string", "format": "date-time" } }, "additionalProperties": false } }, "required": ["model"] } };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
|
|
40
|
+
var flink_1 = require("@flink-app/flink");
|
|
41
|
+
exports.Route = {
|
|
42
|
+
path: "/car2",
|
|
43
|
+
method: flink_1.HttpMethod.get,
|
|
44
|
+
permissions: "*",
|
|
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
|
+
});
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
exports.default = GetCar2;
|
|
60
|
+
exports.__assumedHttpMethod = "get", exports.__file = "GetCar2.ts", exports.__query = [], exports.__params = [];
|
|
61
|
+
exports.__schemas = { reqSchema: undefined, resSchema: { "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 } };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
|
|
40
|
+
exports.Route = {
|
|
41
|
+
path: "/car-with-array-schema",
|
|
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
|
+
});
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
exports.default = GetCarWithArraySchema;
|
|
54
|
+
exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithArraySchema.ts", exports.__query = [], exports.__params = [];
|
|
55
|
+
exports.__schemas = { reqSchema: undefined, resSchema: { "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 } } };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
|
|
40
|
+
exports.Route = {
|
|
41
|
+
path: "/car-with-array-schema2",
|
|
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
|
+
});
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
exports.default = GetCarWithArraySchema2;
|
|
54
|
+
exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithArraySchema2.ts", exports.__query = [], exports.__params = [];
|
|
55
|
+
exports.__schemas = { reqSchema: undefined, resSchema: { "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 } } };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
|
|
40
|
+
exports.Route = {
|
|
41
|
+
path: "/car-with-array-schema3",
|
|
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
|
+
});
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
exports.default = GetCarWithArraySchema3;
|
|
54
|
+
exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithArraySchema3.ts", exports.__query = [], exports.__params = [];
|
|
55
|
+
exports.__schemas = { reqSchema: undefined, resSchema: { "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 } } };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
|
|
40
|
+
exports.Route = {
|
|
41
|
+
path: "/car-with-literal-schema",
|
|
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
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
exports.default = GetCarWithLiteralSchema;
|
|
56
|
+
exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithLiteralSchema.ts", exports.__query = [], exports.__params = [];
|
|
57
|
+
exports.__schemas = { reqSchema: undefined, resSchema: { "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 } };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
|
|
40
|
+
exports.Route = {
|
|
41
|
+
path: "/car-with-literal-schema2",
|
|
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
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
exports.default = GetCarWithLiteralSchema2;
|
|
56
|
+
exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithLiteralSchema2.ts", exports.__query = [], exports.__params = [];
|
|
57
|
+
exports.__schemas = { reqSchema: undefined, resSchema: { "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 } };
|
package/{dist/cli/generate.js → spec/mock-project/dist/src/handlers/GetCarWithOmitSchema.js}
RENAMED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
1
|
"use strict";
|
|
3
2
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
4
3
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -37,18 +36,24 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.Route = void 0;
|
|
40
|
+
exports.Route = {
|
|
41
|
+
path: "/car-with-omit-schema",
|
|
42
|
+
};
|
|
43
|
+
// interface CarWithoutId extends Omit<Car, "_id"> {}
|
|
44
|
+
var GetCarWithOmitSchema = 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
|
+
foo: 1,
|
|
52
|
+
},
|
|
53
|
+
}];
|
|
51
54
|
});
|
|
52
55
|
});
|
|
53
|
-
}
|
|
54
|
-
exports.
|
|
56
|
+
};
|
|
57
|
+
exports.default = GetCarWithOmitSchema;
|
|
58
|
+
exports.__assumedHttpMethod = "get", exports.__file = "GetCarWithOmitSchema.ts", exports.__query = [], exports.__params = [];
|
|
59
|
+
exports.__schemas = { reqSchema: undefined, resSchema: undefined };
|