nestia 2.0.6 → 2.0.7-dev.20220414
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/{src/IConfiguration.ts → bin/IConfiguration.d.ts} +5 -8
- package/bin/IConfiguration.d.ts.map +1 -0
- package/bin/IConfiguration.js +3 -0
- package/bin/NestiaApplication.d.ts +10 -0
- package/bin/NestiaApplication.d.ts.map +1 -0
- package/bin/NestiaApplication.js +281 -0
- package/bin/analyses/ControllerAnalyzer.d.ts +7 -0
- package/bin/analyses/ControllerAnalyzer.d.ts.map +1 -0
- package/bin/analyses/ControllerAnalyzer.js +186 -0
- package/bin/analyses/GenericAnalyzer.d.ts +6 -0
- package/bin/analyses/GenericAnalyzer.d.ts.map +1 -0
- package/bin/analyses/GenericAnalyzer.js +100 -0
- package/bin/analyses/ImportAnalyzer.d.ts +13 -0
- package/bin/analyses/ImportAnalyzer.d.ts.map +1 -0
- package/bin/analyses/ImportAnalyzer.js +82 -0
- package/bin/analyses/ReflectAnalyzer.d.ts +5 -0
- package/bin/analyses/ReflectAnalyzer.d.ts.map +1 -0
- package/bin/analyses/ReflectAnalyzer.js +307 -0
- package/bin/analyses/SourceFinder.d.ts +5 -0
- package/bin/analyses/SourceFinder.d.ts.map +1 -0
- package/bin/analyses/SourceFinder.js +260 -0
- package/bin/bundle/HttpError.d.ts +2 -0
- package/bin/bundle/HttpError.d.ts.map +1 -0
- package/bin/bundle/HttpError.js +6 -0
- package/bin/bundle/IConnection.d.ts +2 -0
- package/bin/bundle/IConnection.d.ts.map +1 -0
- package/bin/bundle/IConnection.js +3 -0
- package/bin/bundle/Primitive.d.ts +2 -0
- package/bin/bundle/Primitive.d.ts.map +1 -0
- package/bin/bundle/Primitive.js +6 -0
- package/bin/bundle/__internal/AesPkcs5.d.ts +2 -0
- package/bin/bundle/__internal/AesPkcs5.d.ts.map +1 -0
- package/bin/bundle/__internal/AesPkcs5.js +6 -0
- package/bin/bundle/__internal/Fetcher.d.ts +2 -0
- package/bin/bundle/__internal/Fetcher.d.ts.map +1 -0
- package/bin/bundle/__internal/Fetcher.js +6 -0
- package/bin/executable/internal/CompilerOptions.d.ts +13 -0
- package/bin/executable/internal/CompilerOptions.d.ts.map +1 -0
- package/bin/executable/internal/CompilerOptions.js +132 -0
- package/bin/executable/internal/NestiaConfig.d.ts +5 -0
- package/bin/executable/internal/NestiaConfig.d.ts.map +1 -0
- package/bin/executable/internal/NestiaConfig.js +196 -0
- package/bin/executable/internal/nestia.config.getter.d.ts +2 -0
- package/bin/executable/internal/nestia.config.getter.d.ts.map +1 -0
- package/bin/executable/internal/nestia.config.getter.js +60 -0
- package/bin/executable/nestia.d.ts +3 -0
- package/bin/executable/nestia.d.ts.map +1 -0
- package/bin/executable/nestia.js +136 -0
- package/bin/executable/sdk.d.ts +2 -0
- package/bin/executable/sdk.d.ts.map +1 -0
- package/bin/executable/sdk.js +206 -0
- package/bin/generates/FileGenerator.d.ts +6 -0
- package/bin/generates/FileGenerator.d.ts.map +1 -0
- package/bin/generates/FileGenerator.js +302 -0
- package/bin/generates/FunctionGenerator.d.ts +5 -0
- package/bin/generates/FunctionGenerator.d.ts.map +1 -0
- package/bin/generates/FunctionGenerator.js +207 -0
- package/bin/generates/SdkGenerator.d.ts +6 -0
- package/bin/generates/SdkGenerator.d.ts.map +1 -0
- package/bin/generates/SdkGenerator.js +147 -0
- package/bin/index.d.ts +3 -0
- package/bin/index.d.ts.map +1 -0
- package/bin/index.js +28 -0
- package/bin/module.d.ts +3 -0
- package/bin/module.d.ts.map +1 -0
- package/bin/module.js +19 -0
- package/{src/structures/IController.ts → bin/structures/IController.d.ts} +6 -13
- package/bin/structures/IController.d.ts.map +1 -0
- package/bin/structures/IController.js +3 -0
- package/{src/structures/IRoute.ts → bin/structures/IRoute.d.ts} +5 -11
- package/bin/structures/IRoute.d.ts.map +1 -0
- package/bin/structures/IRoute.js +3 -0
- package/bin/structures/MethodType.d.ts +5 -0
- package/bin/structures/MethodType.d.ts.map +1 -0
- package/bin/structures/MethodType.js +8 -0
- package/bin/structures/ParamCategory.d.ts +2 -0
- package/bin/structures/ParamCategory.d.ts.map +1 -0
- package/bin/structures/ParamCategory.js +3 -0
- package/bin/utils/ArrayUtil.d.ts +6 -0
- package/bin/utils/ArrayUtil.d.ts.map +1 -0
- package/bin/utils/ArrayUtil.js +144 -0
- package/bin/utils/DirectoryUtil.d.ts +6 -0
- package/bin/utils/DirectoryUtil.d.ts.map +1 -0
- package/bin/utils/DirectoryUtil.js +190 -0
- package/bin/utils/ImportDictionary.d.ts +7 -0
- package/bin/utils/ImportDictionary.d.ts.map +1 -0
- package/bin/utils/ImportDictionary.js +85 -0
- package/bin/utils/StringUtil.d.ts +4 -0
- package/bin/utils/StringUtil.d.ts.map +1 -0
- package/bin/utils/StringUtil.js +13 -0
- package/bin/utils/stripJsonComments.d.ts +4 -0
- package/bin/utils/stripJsonComments.d.ts.map +1 -0
- package/bin/utils/stripJsonComments.js +76 -0
- package/package.json +14 -10
- package/tsconfig.json +8 -7
- package/src/NestiaApplication.ts +0 -96
- package/src/analyses/ControllerAnalyzer.ts +0 -154
- package/src/analyses/GenericAnalyzer.ts +0 -52
- package/src/analyses/ImportAnalyzer.ts +0 -93
- package/src/analyses/ReflectAnalyzer.ts +0 -221
- package/src/analyses/SourceFinder.ts +0 -73
- package/src/bin/nestia.ts +0 -59
- package/src/bundle/HttpError.ts +0 -1
- package/src/bundle/IConnection.ts +0 -1
- package/src/bundle/Primitive.ts +0 -1
- package/src/bundle/__internal/AesPkcs5.ts +0 -1
- package/src/bundle/__internal/Fetcher.ts +0 -1
- package/src/executable/sdk.ts +0 -84
- package/src/generates/FileGenerator.ts +0 -150
- package/src/generates/FunctionGenerator.ts +0 -201
- package/src/generates/SdkGenerator.ts +0 -39
- package/src/internal/NestiaConfig.ts +0 -36
- package/src/internal/TsConfig.ts +0 -123
- package/src/internal/tsconfig.default.json +0 -81
- package/src/structures/MethodType.ts +0 -6
- package/src/structures/ParamCategory.ts +0 -1
- package/src/utils/ArrayUtil.ts +0 -26
- package/src/utils/DirectoryUtil.ts +0 -48
- package/src/utils/ImportDictionary.ts +0 -44
- package/src/utils/StringUtil.ts +0 -10
- package/src/utils/stripJsonComments.ts +0 -79
|
@@ -0,0 +1,144 @@
|
|
|
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
|
+
var __values = (this && this.__values) || function(o) {
|
|
39
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
40
|
+
if (m) return m.call(o);
|
|
41
|
+
if (o && typeof o.length === "number") return {
|
|
42
|
+
next: function () {
|
|
43
|
+
if (o && i >= o.length) o = void 0;
|
|
44
|
+
return { value: o && o[i++], done: !o };
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
|
+
};
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.ArrayUtil = void 0;
|
|
51
|
+
var ArrayUtil;
|
|
52
|
+
(function (ArrayUtil) {
|
|
53
|
+
function has(array) {
|
|
54
|
+
var items = [];
|
|
55
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
56
|
+
items[_i - 1] = arguments[_i];
|
|
57
|
+
}
|
|
58
|
+
return items.every(function (elem) { return array.find(function (org) { return org === elem; }) !== undefined; });
|
|
59
|
+
}
|
|
60
|
+
ArrayUtil.has = has;
|
|
61
|
+
function asyncMap(array, closure) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
63
|
+
var ret, array_1, array_1_1, elem, _a, _b, e_1_1;
|
|
64
|
+
var e_1, _c;
|
|
65
|
+
return __generator(this, function (_d) {
|
|
66
|
+
switch (_d.label) {
|
|
67
|
+
case 0:
|
|
68
|
+
ret = [];
|
|
69
|
+
_d.label = 1;
|
|
70
|
+
case 1:
|
|
71
|
+
_d.trys.push([1, 6, 7, 8]);
|
|
72
|
+
array_1 = __values(array), array_1_1 = array_1.next();
|
|
73
|
+
_d.label = 2;
|
|
74
|
+
case 2:
|
|
75
|
+
if (!!array_1_1.done) return [3 /*break*/, 5];
|
|
76
|
+
elem = array_1_1.value;
|
|
77
|
+
_b = (_a = ret).push;
|
|
78
|
+
return [4 /*yield*/, closure(elem)];
|
|
79
|
+
case 3:
|
|
80
|
+
_b.apply(_a, [_d.sent()]);
|
|
81
|
+
_d.label = 4;
|
|
82
|
+
case 4:
|
|
83
|
+
array_1_1 = array_1.next();
|
|
84
|
+
return [3 /*break*/, 2];
|
|
85
|
+
case 5: return [3 /*break*/, 8];
|
|
86
|
+
case 6:
|
|
87
|
+
e_1_1 = _d.sent();
|
|
88
|
+
e_1 = { error: e_1_1 };
|
|
89
|
+
return [3 /*break*/, 8];
|
|
90
|
+
case 7:
|
|
91
|
+
try {
|
|
92
|
+
if (array_1_1 && !array_1_1.done && (_c = array_1.return)) _c.call(array_1);
|
|
93
|
+
}
|
|
94
|
+
finally { if (e_1) throw e_1.error; }
|
|
95
|
+
return [7 /*endfinally*/];
|
|
96
|
+
case 8: return [2 /*return*/, ret];
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
ArrayUtil.asyncMap = asyncMap;
|
|
102
|
+
function asyncFilter(array, closure) {
|
|
103
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
104
|
+
var ret, array_2, array_2_1, elem, e_2_1;
|
|
105
|
+
var e_2, _a;
|
|
106
|
+
return __generator(this, function (_b) {
|
|
107
|
+
switch (_b.label) {
|
|
108
|
+
case 0:
|
|
109
|
+
ret = [];
|
|
110
|
+
_b.label = 1;
|
|
111
|
+
case 1:
|
|
112
|
+
_b.trys.push([1, 6, 7, 8]);
|
|
113
|
+
array_2 = __values(array), array_2_1 = array_2.next();
|
|
114
|
+
_b.label = 2;
|
|
115
|
+
case 2:
|
|
116
|
+
if (!!array_2_1.done) return [3 /*break*/, 5];
|
|
117
|
+
elem = array_2_1.value;
|
|
118
|
+
return [4 /*yield*/, closure(elem)];
|
|
119
|
+
case 3:
|
|
120
|
+
if ((_b.sent()) === true)
|
|
121
|
+
ret.push(elem);
|
|
122
|
+
_b.label = 4;
|
|
123
|
+
case 4:
|
|
124
|
+
array_2_1 = array_2.next();
|
|
125
|
+
return [3 /*break*/, 2];
|
|
126
|
+
case 5: return [3 /*break*/, 8];
|
|
127
|
+
case 6:
|
|
128
|
+
e_2_1 = _b.sent();
|
|
129
|
+
e_2 = { error: e_2_1 };
|
|
130
|
+
return [3 /*break*/, 8];
|
|
131
|
+
case 7:
|
|
132
|
+
try {
|
|
133
|
+
if (array_2_1 && !array_2_1.done && (_a = array_2.return)) _a.call(array_2);
|
|
134
|
+
}
|
|
135
|
+
finally { if (e_2) throw e_2.error; }
|
|
136
|
+
return [7 /*endfinally*/];
|
|
137
|
+
case 8: return [2 /*return*/, ret];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
ArrayUtil.asyncFilter = asyncFilter;
|
|
143
|
+
})(ArrayUtil = exports.ArrayUtil || (exports.ArrayUtil = {}));
|
|
144
|
+
//# sourceMappingURL=ArrayUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectoryUtil.d.ts","sourceRoot":"","sources":["../../src/utils/DirectoryUtil.ts"],"names":[],"mappings":"AAGA,yBAAiB,aAAa,CAC9B;IACI,SAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOxD;IAED,SAAsB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIxD;IAED,SAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAIlE;CAuBJ"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = 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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
+
function step(op) {
|
|
39
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
+
while (_) try {
|
|
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;
|
|
42
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
+
switch (op[0]) {
|
|
44
|
+
case 0: case 1: t = op; break;
|
|
45
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
+
default:
|
|
49
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
+
if (t[2]) _.ops.pop();
|
|
54
|
+
_.trys.pop(); continue;
|
|
55
|
+
}
|
|
56
|
+
op = body.call(thisArg, _);
|
|
57
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
var __values = (this && this.__values) || function(o) {
|
|
62
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
63
|
+
if (m) return m.call(o);
|
|
64
|
+
if (o && typeof o.length === "number") return {
|
|
65
|
+
next: function () {
|
|
66
|
+
if (o && i >= o.length) o = void 0;
|
|
67
|
+
return { value: o && o[i++], done: !o };
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
71
|
+
};
|
|
72
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
73
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
74
|
+
};
|
|
75
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
76
|
+
exports.DirectoryUtil = void 0;
|
|
77
|
+
var del_1 = __importDefault(require("del"));
|
|
78
|
+
var fs = __importStar(require("fs"));
|
|
79
|
+
var DirectoryUtil;
|
|
80
|
+
(function (DirectoryUtil) {
|
|
81
|
+
function remove(path) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var _a;
|
|
84
|
+
return __generator(this, function (_b) {
|
|
85
|
+
switch (_b.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
_b.trys.push([0, 2, , 3]);
|
|
88
|
+
return [4 /*yield*/, (0, del_1.default)(path)];
|
|
89
|
+
case 1:
|
|
90
|
+
_b.sent();
|
|
91
|
+
return [3 /*break*/, 3];
|
|
92
|
+
case 2:
|
|
93
|
+
_a = _b.sent();
|
|
94
|
+
return [3 /*break*/, 3];
|
|
95
|
+
case 3: return [2 /*return*/];
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
DirectoryUtil.remove = remove;
|
|
101
|
+
function remake(path) {
|
|
102
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
103
|
+
return __generator(this, function (_a) {
|
|
104
|
+
switch (_a.label) {
|
|
105
|
+
case 0: return [4 /*yield*/, remove(path)];
|
|
106
|
+
case 1:
|
|
107
|
+
_a.sent();
|
|
108
|
+
return [4 /*yield*/, fs.promises.mkdir(path)];
|
|
109
|
+
case 2:
|
|
110
|
+
_a.sent();
|
|
111
|
+
return [2 /*return*/];
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
DirectoryUtil.remake = remake;
|
|
117
|
+
function copy(from, to) {
|
|
118
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
119
|
+
return __generator(this, function (_a) {
|
|
120
|
+
switch (_a.label) {
|
|
121
|
+
case 0: return [4 /*yield*/, remake(to)];
|
|
122
|
+
case 1:
|
|
123
|
+
_a.sent();
|
|
124
|
+
return [4 /*yield*/, _Copy(from, to)];
|
|
125
|
+
case 2:
|
|
126
|
+
_a.sent();
|
|
127
|
+
return [2 /*return*/];
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
DirectoryUtil.copy = copy;
|
|
133
|
+
function _Copy(from, to) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
+
var directory, directory_1, directory_1_1, file, fromPath, toPath, stats, content, e_1_1;
|
|
136
|
+
var e_1, _a;
|
|
137
|
+
return __generator(this, function (_b) {
|
|
138
|
+
switch (_b.label) {
|
|
139
|
+
case 0: return [4 /*yield*/, fs.promises.readdir(from)];
|
|
140
|
+
case 1:
|
|
141
|
+
directory = _b.sent();
|
|
142
|
+
_b.label = 2;
|
|
143
|
+
case 2:
|
|
144
|
+
_b.trys.push([2, 12, 13, 14]);
|
|
145
|
+
directory_1 = __values(directory), directory_1_1 = directory_1.next();
|
|
146
|
+
_b.label = 3;
|
|
147
|
+
case 3:
|
|
148
|
+
if (!!directory_1_1.done) return [3 /*break*/, 11];
|
|
149
|
+
file = directory_1_1.value;
|
|
150
|
+
fromPath = "".concat(from, "/").concat(file);
|
|
151
|
+
toPath = "".concat(to, "/").concat(file);
|
|
152
|
+
return [4 /*yield*/, fs.promises.stat(fromPath)];
|
|
153
|
+
case 4:
|
|
154
|
+
stats = _b.sent();
|
|
155
|
+
if (!(stats.isDirectory() === true)) return [3 /*break*/, 7];
|
|
156
|
+
return [4 /*yield*/, fs.promises.mkdir(toPath)];
|
|
157
|
+
case 5:
|
|
158
|
+
_b.sent();
|
|
159
|
+
return [4 /*yield*/, _Copy(fromPath, toPath)];
|
|
160
|
+
case 6:
|
|
161
|
+
_b.sent();
|
|
162
|
+
return [3 /*break*/, 10];
|
|
163
|
+
case 7: return [4 /*yield*/, fs.promises.readFile(fromPath, "utf8")];
|
|
164
|
+
case 8:
|
|
165
|
+
content = _b.sent();
|
|
166
|
+
return [4 /*yield*/, fs.promises.writeFile(toPath, content.split("\r\n").join("\n"), "utf8")];
|
|
167
|
+
case 9:
|
|
168
|
+
_b.sent();
|
|
169
|
+
_b.label = 10;
|
|
170
|
+
case 10:
|
|
171
|
+
directory_1_1 = directory_1.next();
|
|
172
|
+
return [3 /*break*/, 3];
|
|
173
|
+
case 11: return [3 /*break*/, 14];
|
|
174
|
+
case 12:
|
|
175
|
+
e_1_1 = _b.sent();
|
|
176
|
+
e_1 = { error: e_1_1 };
|
|
177
|
+
return [3 /*break*/, 14];
|
|
178
|
+
case 13:
|
|
179
|
+
try {
|
|
180
|
+
if (directory_1_1 && !directory_1_1.done && (_a = directory_1.return)) _a.call(directory_1);
|
|
181
|
+
}
|
|
182
|
+
finally { if (e_1) throw e_1.error; }
|
|
183
|
+
return [7 /*endfinally*/];
|
|
184
|
+
case 14: return [2 /*return*/];
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
})(DirectoryUtil = exports.DirectoryUtil || (exports.DirectoryUtil = {}));
|
|
190
|
+
//# sourceMappingURL=DirectoryUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ImportDictionary.d.ts","sourceRoot":"","sources":["../../src/utils/ImportDictionary.ts"],"names":[],"mappings":"AAMA,qBAAa,gBAAgB;IAEzB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAkE;IAEjF,KAAK,IAAI,OAAO;IAKhB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;IAejE,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM;CAa1C"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = 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);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __values = (this && this.__values) || function(o) {
|
|
26
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
27
|
+
if (m) return m.call(o);
|
|
28
|
+
if (o && typeof o.length === "number") return {
|
|
29
|
+
next: function () {
|
|
30
|
+
if (o && i >= o.length) o = void 0;
|
|
31
|
+
return { value: o && o[i++], done: !o };
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
35
|
+
};
|
|
36
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
+
exports.ImportDictionary = void 0;
|
|
38
|
+
var path = __importStar(require("path"));
|
|
39
|
+
var HashMap_1 = require("tstl/container/HashMap");
|
|
40
|
+
var HashSet_1 = require("tstl/container/HashSet");
|
|
41
|
+
var Pair_1 = require("tstl/utility/Pair");
|
|
42
|
+
var ImportDictionary = /** @class */ (function () {
|
|
43
|
+
function ImportDictionary() {
|
|
44
|
+
this.dict_ = new HashMap_1.HashMap();
|
|
45
|
+
}
|
|
46
|
+
ImportDictionary.prototype.empty = function () {
|
|
47
|
+
return this.dict_.empty();
|
|
48
|
+
};
|
|
49
|
+
ImportDictionary.prototype.emplace = function (file, realistic, instance) {
|
|
50
|
+
if (file.substr(-5) === ".d.ts")
|
|
51
|
+
file = file.substr(0, file.length - 5);
|
|
52
|
+
else if (file.substr(-3) === ".ts")
|
|
53
|
+
file = file.substr(0, file.length - 3);
|
|
54
|
+
else
|
|
55
|
+
throw new Error("Error on ImportDictionary.emplace(): extension of the target file \"".concat(file, "\" is not \"ts\"."));
|
|
56
|
+
var it = this.dict_.find(file);
|
|
57
|
+
if (it.equals(this.dict_.end()) === true)
|
|
58
|
+
it = this.dict_.emplace(file, new Pair_1.Pair(realistic, new HashSet_1.HashSet())).first;
|
|
59
|
+
it.second.second.insert(instance);
|
|
60
|
+
};
|
|
61
|
+
ImportDictionary.prototype.toScript = function (outDir) {
|
|
62
|
+
var e_1, _a;
|
|
63
|
+
var statements = [];
|
|
64
|
+
try {
|
|
65
|
+
for (var _b = __values(this.dict_), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
66
|
+
var it = _c.value;
|
|
67
|
+
var file = path.relative(outDir, it.first).split("\\").join("/");
|
|
68
|
+
var realistic = it.second.first;
|
|
69
|
+
var instances = it.second.second.toJSON();
|
|
70
|
+
statements.push("import ".concat(!realistic ? "type " : "", "{ ").concat(instances.join(", "), " } from \"./").concat(file, "\";"));
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
74
|
+
finally {
|
|
75
|
+
try {
|
|
76
|
+
if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
|
|
77
|
+
}
|
|
78
|
+
finally { if (e_1) throw e_1.error; }
|
|
79
|
+
}
|
|
80
|
+
return statements.join("\n");
|
|
81
|
+
};
|
|
82
|
+
return ImportDictionary;
|
|
83
|
+
}());
|
|
84
|
+
exports.ImportDictionary = ImportDictionary;
|
|
85
|
+
//# sourceMappingURL=ImportDictionary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StringUtil.d.ts","sourceRoot":"","sources":["../../src/utils/StringUtil.ts"],"names":[],"mappings":"AAAA,yBAAiB,UAAU,CAC3B;IACI,SAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAM1E;CACJ"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StringUtil = void 0;
|
|
4
|
+
var StringUtil;
|
|
5
|
+
(function (StringUtil) {
|
|
6
|
+
function betweens(str, start, end) {
|
|
7
|
+
var ret = str.split(start);
|
|
8
|
+
ret.splice(0, 1);
|
|
9
|
+
return ret.map(function (str) { return str.split(end)[0]; });
|
|
10
|
+
}
|
|
11
|
+
StringUtil.betweens = betweens;
|
|
12
|
+
})(StringUtil = exports.StringUtil || (exports.StringUtil = {}));
|
|
13
|
+
//# sourceMappingURL=StringUtil.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stripJsonComments.d.ts","sourceRoot":"","sources":["../../src/utils/stripJsonComments.ts"],"names":[],"mappings":"AAoBA,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,MAAM,EAAE,EAAC,UAAiB,EAAC;;CAAK,UA0D7E"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// https://github.com/sindresorhus/strip-json-comments
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.stripJsonComments = void 0;
|
|
5
|
+
var singleComment = Symbol('singleComment');
|
|
6
|
+
var multiComment = Symbol('multiComment');
|
|
7
|
+
var stripWithoutWhitespace = function () { return ''; };
|
|
8
|
+
var stripWithWhitespace = function (string, start, end) { return string.slice(start, end).replace(/\S/g, ' '); };
|
|
9
|
+
var isEscaped = function (jsonString, quotePosition) {
|
|
10
|
+
var index = quotePosition - 1;
|
|
11
|
+
var backslashCount = 0;
|
|
12
|
+
while (jsonString[index] === '\\') {
|
|
13
|
+
index -= 1;
|
|
14
|
+
backslashCount += 1;
|
|
15
|
+
}
|
|
16
|
+
return Boolean(backslashCount % 2);
|
|
17
|
+
};
|
|
18
|
+
function stripJsonComments(jsonString, _a) {
|
|
19
|
+
var _b = _a === void 0 ? {} : _a, _c = _b.whitespace, whitespace = _c === void 0 ? true : _c;
|
|
20
|
+
if (typeof jsonString !== 'string') {
|
|
21
|
+
throw new TypeError("Expected argument `jsonString` to be a `string`, got `".concat(typeof jsonString, "`"));
|
|
22
|
+
}
|
|
23
|
+
var strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;
|
|
24
|
+
var isInsideString = false;
|
|
25
|
+
var isInsideComment = false;
|
|
26
|
+
var offset = 0;
|
|
27
|
+
var result = '';
|
|
28
|
+
for (var index = 0; index < jsonString.length; index++) {
|
|
29
|
+
var currentCharacter = jsonString[index];
|
|
30
|
+
var nextCharacter = jsonString[index + 1];
|
|
31
|
+
if (!isInsideComment && currentCharacter === '"') {
|
|
32
|
+
var escaped = isEscaped(jsonString, index);
|
|
33
|
+
if (!escaped) {
|
|
34
|
+
isInsideString = !isInsideString;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (isInsideString) {
|
|
38
|
+
continue;
|
|
39
|
+
}
|
|
40
|
+
if (!isInsideComment && currentCharacter + nextCharacter === '//') {
|
|
41
|
+
result += jsonString.slice(offset, index);
|
|
42
|
+
offset = index;
|
|
43
|
+
isInsideComment = singleComment;
|
|
44
|
+
index++;
|
|
45
|
+
}
|
|
46
|
+
else if (isInsideComment === singleComment && currentCharacter + nextCharacter === '\r\n') {
|
|
47
|
+
index++;
|
|
48
|
+
isInsideComment = false;
|
|
49
|
+
result += strip(jsonString, offset, index);
|
|
50
|
+
offset = index;
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
else if (isInsideComment === singleComment && currentCharacter === '\n') {
|
|
54
|
+
isInsideComment = false;
|
|
55
|
+
result += strip(jsonString, offset, index);
|
|
56
|
+
offset = index;
|
|
57
|
+
}
|
|
58
|
+
else if (!isInsideComment && currentCharacter + nextCharacter === '/*') {
|
|
59
|
+
result += jsonString.slice(offset, index);
|
|
60
|
+
offset = index;
|
|
61
|
+
isInsideComment = multiComment;
|
|
62
|
+
index++;
|
|
63
|
+
continue;
|
|
64
|
+
}
|
|
65
|
+
else if (isInsideComment === multiComment && currentCharacter + nextCharacter === '*/') {
|
|
66
|
+
index++;
|
|
67
|
+
isInsideComment = false;
|
|
68
|
+
result += strip(jsonString, offset, index + 1);
|
|
69
|
+
offset = index + 1;
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
return result + (isInsideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset));
|
|
74
|
+
}
|
|
75
|
+
exports.stripJsonComments = stripJsonComments;
|
|
76
|
+
//# sourceMappingURL=stripJsonComments.js.map
|
package/package.json
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nestia",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.7-dev.20220414",
|
|
4
4
|
"description": "Automatic SDK and Document generator for the NestJS",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "lib/index.js",
|
|
6
|
+
"typings": "lib/index.d.ts",
|
|
6
7
|
"bin": {
|
|
7
|
-
"nestia": "./
|
|
8
|
+
"nestia": "./bin/executable/nestia.js"
|
|
8
9
|
},
|
|
9
10
|
"scripts": {
|
|
10
|
-
"
|
|
11
|
+
"build": "rimraf bin && ttsc",
|
|
12
|
+
"dev": "npm run build -- --watch",
|
|
11
13
|
"test": "ts-node test/index"
|
|
12
14
|
},
|
|
13
15
|
"repository": {
|
|
@@ -28,15 +30,13 @@
|
|
|
28
30
|
},
|
|
29
31
|
"homepage": "https://github.com/samchon/nestia#readme",
|
|
30
32
|
"dependencies": {
|
|
31
|
-
"@types/cli": "^0.11.19",
|
|
32
|
-
"@types/glob": "^7.2.0",
|
|
33
|
-
"@types/node": "^17.0.23",
|
|
34
|
-
"@types/reflect-metadata": "^0.1.0",
|
|
35
33
|
"cli": "^1.0.1",
|
|
36
|
-
"comment-json": "^4.2.2",
|
|
37
34
|
"del": "^6.0.0",
|
|
38
35
|
"glob": "^7.2.0",
|
|
39
|
-
"
|
|
36
|
+
"jsonc-simple-parser": "^2.2.1",
|
|
37
|
+
"tgrid": "^0.8.6",
|
|
38
|
+
"ts-node": "^10.4.0",
|
|
39
|
+
"tsconfig-paths": "^3.14.1",
|
|
40
40
|
"tstl": "^2.5.3",
|
|
41
41
|
"ttypescript": "^1.5.13",
|
|
42
42
|
"typescript": "^4.6.3",
|
|
@@ -44,6 +44,10 @@
|
|
|
44
44
|
"typescript-transform-paths": "^3.3.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
+
"@types/cli": "^0.11.19",
|
|
48
|
+
"@types/glob": "^7.2.0",
|
|
49
|
+
"@types/node": "^17.0.23",
|
|
50
|
+
"@types/reflect-metadata": "^0.1.0",
|
|
47
51
|
"nestia-helper": "^2.0.0",
|
|
48
52
|
"rimraf": "^3.0.2"
|
|
49
53
|
}
|
package/tsconfig.json
CHANGED
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
// "allowJs": true, /* Allow javascript files to be compiled. */
|
|
14
14
|
// "checkJs": true, /* Report errors in .js files. */
|
|
15
15
|
// "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
"declaration": true, /* Generates corresponding '.d.ts' file. */
|
|
17
|
+
"declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */
|
|
18
|
+
"sourceMap": true, /* Generates corresponding '.map' file. */
|
|
19
19
|
// "outFile": "./", /* Concatenate and emit output to single file. */
|
|
20
|
-
|
|
20
|
+
"outDir": "./bin", /* Redirect output structure to the directory. */
|
|
21
21
|
// "rootDir": "./", /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */
|
|
22
22
|
// "composite": true, /* Enable project compilation */
|
|
23
23
|
// "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */
|
|
24
24
|
// "removeComments": true, /* Do not emit comments to output. */
|
|
25
|
-
"noEmit": true, /* Do not emit outputs. */
|
|
25
|
+
// "noEmit": true, /* Do not emit outputs. */
|
|
26
26
|
// "importHelpers": true, /* Import emit helpers from 'tslib'. */
|
|
27
27
|
"downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */
|
|
28
28
|
// "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */
|
|
@@ -74,8 +74,9 @@
|
|
|
74
74
|
"skipLibCheck": true, /* Skip type checking of declaration files. */
|
|
75
75
|
"forceConsistentCasingInFileNames": true, /* Disallow inconsistently-cased references to the same file. */
|
|
76
76
|
"plugins": [
|
|
77
|
-
{
|
|
78
|
-
|
|
77
|
+
{
|
|
78
|
+
"transform": "typescript-is/lib/transform-inline/transformer"
|
|
79
|
+
}
|
|
79
80
|
]
|
|
80
81
|
},
|
|
81
82
|
"include": ["src"]
|