nestia 2.1.0-dev.20220414 → 2.1.0-dev.20220430
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/.github/workflows/build.yml +2 -4
- package/README.md +84 -14
- package/{src/bundle → bundle}/HttpError.ts +0 -0
- package/{src/bundle → bundle}/IConnection.ts +0 -0
- package/{src/bundle → bundle}/Primitive.ts +0 -0
- package/{src/bundle → bundle}/__internal/AesPkcs5.ts +0 -0
- package/{src/bundle → bundle}/__internal/Fetcher.ts +0 -0
- package/lib/IConfiguration.d.ts +71 -0
- package/lib/IConfiguration.d.ts.map +1 -0
- package/lib/IConfiguration.js +3 -0
- package/lib/NestiaApplication.d.ts +12 -0
- package/lib/NestiaApplication.d.ts.map +1 -0
- package/lib/NestiaApplication.js +340 -0
- package/lib/analyses/ControllerAnalyzer.d.ts +7 -0
- package/lib/analyses/ControllerAnalyzer.d.ts.map +1 -0
- package/lib/analyses/ControllerAnalyzer.js +191 -0
- package/lib/analyses/GenericAnalyzer.d.ts +6 -0
- package/lib/analyses/GenericAnalyzer.d.ts.map +1 -0
- package/lib/analyses/GenericAnalyzer.js +100 -0
- package/lib/analyses/ImportAnalyzer.d.ts +14 -0
- package/lib/analyses/ImportAnalyzer.d.ts.map +1 -0
- package/lib/analyses/ImportAnalyzer.js +79 -0
- package/lib/analyses/ReflectAnalyzer.d.ts +5 -0
- package/lib/analyses/ReflectAnalyzer.d.ts.map +1 -0
- package/lib/analyses/ReflectAnalyzer.js +313 -0
- package/lib/analyses/SourceFinder.d.ts +5 -0
- package/lib/analyses/SourceFinder.d.ts.map +1 -0
- package/lib/analyses/SourceFinder.js +260 -0
- package/lib/executable/internal/CompilerOptions.d.ts +14 -0
- package/lib/executable/internal/CompilerOptions.d.ts.map +1 -0
- package/lib/executable/internal/CompilerOptions.js +126 -0
- package/lib/executable/internal/NestiaCommand.d.ts +5 -0
- package/lib/executable/internal/NestiaCommand.d.ts.map +1 -0
- package/lib/executable/internal/NestiaCommand.js +228 -0
- package/lib/executable/internal/NestiaConfig.d.ts +5 -0
- package/lib/executable/internal/NestiaConfig.d.ts.map +1 -0
- package/lib/executable/internal/NestiaConfig.js +277 -0
- package/lib/executable/internal/nestia.config.getter.d.ts +2 -0
- package/lib/executable/internal/nestia.config.getter.d.ts.map +1 -0
- package/lib/executable/internal/nestia.config.getter.js +60 -0
- package/lib/executable/nestia.d.ts +3 -0
- package/lib/executable/nestia.d.ts.map +1 -0
- package/lib/executable/nestia.js +129 -0
- package/lib/generates/FileGenerator.d.ts +6 -0
- package/lib/generates/FileGenerator.d.ts.map +1 -0
- package/lib/generates/FileGenerator.js +326 -0
- package/lib/generates/FunctionGenerator.d.ts +6 -0
- package/lib/generates/FunctionGenerator.d.ts.map +1 -0
- package/lib/generates/FunctionGenerator.js +217 -0
- package/lib/generates/SdkGenerator.d.ts +8 -0
- package/lib/generates/SdkGenerator.d.ts.map +1 -0
- package/lib/generates/SdkGenerator.js +128 -0
- package/lib/generates/SwaggerGenerator.d.ts +7 -0
- package/lib/generates/SwaggerGenerator.d.ts.map +1 -0
- package/lib/generates/SwaggerGenerator.js +258 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +28 -0
- package/lib/module.d.ts +3 -0
- package/lib/module.d.ts.map +1 -0
- package/lib/module.js +19 -0
- package/{src/structures/IController.ts → lib/structures/IController.d.ts} +6 -13
- package/lib/structures/IController.d.ts.map +1 -0
- package/lib/structures/IController.js +3 -0
- package/{src/structures/IRoute.ts → lib/structures/IRoute.d.ts} +8 -13
- package/lib/structures/IRoute.d.ts.map +1 -0
- package/lib/structures/IRoute.js +3 -0
- package/lib/structures/ISwagger.d.ts +36 -0
- package/lib/structures/ISwagger.d.ts.map +1 -0
- package/lib/structures/ISwagger.js +3 -0
- package/lib/structures/IType.d.ts +6 -0
- package/lib/structures/IType.d.ts.map +1 -0
- package/lib/structures/IType.js +3 -0
- package/lib/structures/MethodType.d.ts +5 -0
- package/lib/structures/MethodType.d.ts.map +1 -0
- package/lib/structures/MethodType.js +8 -0
- package/lib/structures/ParamCategory.d.ts +2 -0
- package/lib/structures/ParamCategory.d.ts.map +1 -0
- package/lib/structures/ParamCategory.js +3 -0
- package/lib/utils/ArrayUtil.d.ts +6 -0
- package/lib/utils/ArrayUtil.d.ts.map +1 -0
- package/lib/utils/ArrayUtil.js +144 -0
- package/lib/utils/DirectoryUtil.d.ts +6 -0
- package/lib/utils/DirectoryUtil.d.ts.map +1 -0
- package/lib/utils/DirectoryUtil.js +190 -0
- package/lib/utils/ImportDictionary.d.ts +7 -0
- package/lib/utils/ImportDictionary.d.ts.map +1 -0
- package/lib/utils/ImportDictionary.js +83 -0
- package/lib/utils/MapUtil.d.ts +4 -0
- package/lib/utils/MapUtil.d.ts.map +1 -0
- package/lib/utils/MapUtil.js +16 -0
- package/lib/utils/StringUtil.d.ts +4 -0
- package/lib/utils/StringUtil.d.ts.map +1 -0
- package/lib/utils/StringUtil.js +13 -0
- package/package.json +17 -10
- package/src/IConfiguration.ts +0 -17
- 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 -125
- package/src/executable/sdk.ts +0 -89
- package/src/generates/FileGenerator.ts +0 -150
- package/src/generates/FunctionGenerator.ts +0 -201
- package/src/generates/SdkGenerator.ts +0 -39
- package/src/internal/CompilerOptions.ts +0 -142
- 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
- package/tsconfig.json +0 -82
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
3
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
4
|
+
if (!m) return o;
|
|
5
|
+
var i = m.call(o), r, ar = [], e;
|
|
6
|
+
try {
|
|
7
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
8
|
+
}
|
|
9
|
+
catch (error) { e = { error: error }; }
|
|
10
|
+
finally {
|
|
11
|
+
try {
|
|
12
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
13
|
+
}
|
|
14
|
+
finally { if (e) throw e.error; }
|
|
15
|
+
}
|
|
16
|
+
return ar;
|
|
17
|
+
};
|
|
18
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
19
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
20
|
+
if (ar || !(i in from)) {
|
|
21
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
22
|
+
ar[i] = from[i];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
26
|
+
};
|
|
27
|
+
var __values = (this && this.__values) || function(o) {
|
|
28
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
29
|
+
if (m) return m.call(o);
|
|
30
|
+
if (o && typeof o.length === "number") return {
|
|
31
|
+
next: function () {
|
|
32
|
+
if (o && i >= o.length) o = void 0;
|
|
33
|
+
return { value: o && o[i++], done: !o };
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.FunctionGenerator = void 0;
|
|
40
|
+
var Pair_1 = require("tstl/utility/Pair");
|
|
41
|
+
var Vector_1 = require("tstl/container/Vector");
|
|
42
|
+
var FunctionGenerator;
|
|
43
|
+
(function (FunctionGenerator) {
|
|
44
|
+
function generate(config, route) {
|
|
45
|
+
var query = route.parameters.find(function (param) { return param.category === "query"; });
|
|
46
|
+
var input = route.parameters.find(function (param) { return param.category === "body"; });
|
|
47
|
+
return [head, body, tail]
|
|
48
|
+
.map(function (closure) { return closure(route, query, input, config); })
|
|
49
|
+
.filter(function (str) { return !!str; })
|
|
50
|
+
.join("\n");
|
|
51
|
+
}
|
|
52
|
+
FunctionGenerator.generate = generate;
|
|
53
|
+
/* ---------------------------------------------------------
|
|
54
|
+
BODY
|
|
55
|
+
--------------------------------------------------------- */
|
|
56
|
+
function body(route, query, input, config) {
|
|
57
|
+
// FETCH ARGUMENTS WITH REQUST BODY
|
|
58
|
+
var parameters = filter_parameters(route, query);
|
|
59
|
+
var fetchArguments = [
|
|
60
|
+
"connection",
|
|
61
|
+
"".concat(route.name, ".ENCRYPTED"),
|
|
62
|
+
"".concat(route.name, ".METHOD"),
|
|
63
|
+
"".concat(route.name, ".path(").concat(parameters.map(function (p) { return p.name; }).join(", "), ")")
|
|
64
|
+
];
|
|
65
|
+
if (input !== undefined) {
|
|
66
|
+
fetchArguments.push(input.name);
|
|
67
|
+
if (config.json === true)
|
|
68
|
+
fetchArguments.push("".concat(route.name, ".stringify"));
|
|
69
|
+
}
|
|
70
|
+
var assertions = config.assert === true && route.parameters.length !== 0
|
|
71
|
+
? route.parameters
|
|
72
|
+
.map(function (param) { return " assertType<typeof ".concat(param.name, ">(").concat(param.name, ");"); })
|
|
73
|
+
.join("\n") + "\n\n"
|
|
74
|
+
: "";
|
|
75
|
+
// RETURNS WITH FINALIZATION
|
|
76
|
+
return "{\n"
|
|
77
|
+
+ assertions
|
|
78
|
+
+ " return Fetcher.fetch\n"
|
|
79
|
+
+ " (\n"
|
|
80
|
+
+ fetchArguments.map(function (param) { return " ".concat(param); }).join(",\n") + "\n"
|
|
81
|
+
+ " );\n"
|
|
82
|
+
+ "}";
|
|
83
|
+
}
|
|
84
|
+
function filter_parameters(route, query) {
|
|
85
|
+
var parameters = route.parameters.filter(function (param) { return param.category === "param"; });
|
|
86
|
+
if (query)
|
|
87
|
+
parameters.push(query);
|
|
88
|
+
return parameters;
|
|
89
|
+
}
|
|
90
|
+
/* ---------------------------------------------------------
|
|
91
|
+
HEAD & TAIL
|
|
92
|
+
--------------------------------------------------------- */
|
|
93
|
+
function head(route, query, input) {
|
|
94
|
+
//----
|
|
95
|
+
// CONSTRUCT COMMENT
|
|
96
|
+
//----
|
|
97
|
+
// MAIN DESCRIPTION
|
|
98
|
+
var comments = route.comments
|
|
99
|
+
.map(function (part) { return "".concat(part.kind === "linkText" ? " " : "").concat(part.text); })
|
|
100
|
+
.map(function (str) { return str.split("\r\n").join("\n"); })
|
|
101
|
+
.join("")
|
|
102
|
+
.split("\n")
|
|
103
|
+
.filter(function (str, i, array) { return str !== "" || i !== array.length - 1; });
|
|
104
|
+
if (comments.length)
|
|
105
|
+
comments.push("");
|
|
106
|
+
// FILTER TAGS (VULNERABLE PARAMETERS WOULD BE REMOVED)
|
|
107
|
+
var tagList = route.tags.filter(function (tag) { return tag.text !== undefined; });
|
|
108
|
+
if (tagList.length !== 0) {
|
|
109
|
+
var index = tagList.findIndex(function (t) { return t.name === "param"; });
|
|
110
|
+
if (index !== -1) {
|
|
111
|
+
var capsule = Vector_1.Vector.wrap(tagList);
|
|
112
|
+
capsule.insert(capsule.nth(index), {
|
|
113
|
+
name: "param",
|
|
114
|
+
text: [
|
|
115
|
+
{
|
|
116
|
+
kind: "parameterName",
|
|
117
|
+
text: "connection"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
kind: "space",
|
|
121
|
+
text: " "
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
kind: "text",
|
|
125
|
+
text: "connection Information of the remote HTTP(s) server with headers (+encryption password)"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
comments.push.apply(comments, __spreadArray(__spreadArray([], __read(tagList.map(function (tag) { return "@".concat(tag.name, " ").concat(tag.text.map(function (elem) { return elem.text; }).join("")); })), false), [""], false));
|
|
131
|
+
}
|
|
132
|
+
// COMPLETE THE COMMENT
|
|
133
|
+
comments.push("@nestia Generated by Nestia - https://github.com/samchon/nestia", "@controller ".concat(route.symbol), "@path ".concat(route.method, " ").concat(route.path));
|
|
134
|
+
//----
|
|
135
|
+
// FINALIZATION
|
|
136
|
+
//----
|
|
137
|
+
// REFORM PARAMETERS TEXT
|
|
138
|
+
var parameters = __spreadArray([
|
|
139
|
+
"connection: IConnection"
|
|
140
|
+
], __read(route.parameters.map(function (param) {
|
|
141
|
+
var type = (param === query || param === input)
|
|
142
|
+
? "Primitive<".concat(route.name, ".").concat(param === query ? "Query" : "Input", ">")
|
|
143
|
+
: param.type.escapedText;
|
|
144
|
+
return "".concat(param.name, ": ").concat(type);
|
|
145
|
+
})), false);
|
|
146
|
+
// OUTPUT TYPE
|
|
147
|
+
var output = route.output.escapedText === "void"
|
|
148
|
+
? "void"
|
|
149
|
+
: "".concat(route.name, ".Output");
|
|
150
|
+
// RETURNS WITH CONSTRUCTION
|
|
151
|
+
return ""
|
|
152
|
+
+ "/**\n"
|
|
153
|
+
+ comments.map(function (str) { return " * ".concat(str); }).join("\n") + "\n"
|
|
154
|
+
+ " */\n"
|
|
155
|
+
+ "export function ".concat(route.name, "\n")
|
|
156
|
+
+ " (\n"
|
|
157
|
+
+ "".concat(parameters.map(function (str) { return " ".concat(str); }).join(",\n"), "\n")
|
|
158
|
+
+ " ): Promise<".concat(output, ">");
|
|
159
|
+
}
|
|
160
|
+
function tail(route, query, input, config) {
|
|
161
|
+
// LIST UP TYPES
|
|
162
|
+
var types = [];
|
|
163
|
+
if (query !== undefined)
|
|
164
|
+
types.push(new Pair_1.Pair("Query", query.type.escapedText));
|
|
165
|
+
if (input !== undefined)
|
|
166
|
+
types.push(new Pair_1.Pair("Input", input.type.escapedText));
|
|
167
|
+
if (route.output.escapedText !== "void")
|
|
168
|
+
types.push(new Pair_1.Pair("Output", route.output.escapedText));
|
|
169
|
+
// PATH WITH PARAMETERS
|
|
170
|
+
var parameters = filter_parameters(route, query);
|
|
171
|
+
var path = compute_path(query, parameters, route.path);
|
|
172
|
+
return "export namespace ".concat(route.name, "\n")
|
|
173
|
+
+ "{\n"
|
|
174
|
+
+
|
|
175
|
+
(types.length !== 0
|
|
176
|
+
? types.map(function (tuple) { return " export type ".concat(tuple.first, " = Primitive<").concat(tuple.second, ">;"); }).join("\n") + "\n"
|
|
177
|
+
: "")
|
|
178
|
+
+ "\n"
|
|
179
|
+
+ " export const METHOD = \"".concat(route.method, "\" as const;\n")
|
|
180
|
+
+ " export const PATH: string = \"".concat(route.path, "\";\n")
|
|
181
|
+
+ " export const ENCRYPTED: Fetcher.IEncrypted = {\n"
|
|
182
|
+
+ " request: ".concat(input !== undefined && input.encrypted, ",\n")
|
|
183
|
+
+ " response: ".concat(route.encrypted, ",\n")
|
|
184
|
+
+ " };\n"
|
|
185
|
+
+ "\n"
|
|
186
|
+
+ " export function path(".concat(parameters.map(function (param) { return "".concat(param.name, ": ").concat(param.type); }).join(", "), "): string\n")
|
|
187
|
+
+ " {\n"
|
|
188
|
+
+ " return ".concat(path, ";\n")
|
|
189
|
+
+ " }\n"
|
|
190
|
+
+
|
|
191
|
+
(config.json === true && (route.method === "POST" || route.method === "PUT" || route.method === "PATCH")
|
|
192
|
+
? " export const stringify = createStringifier<Input>();\n"
|
|
193
|
+
: "")
|
|
194
|
+
+ "}";
|
|
195
|
+
}
|
|
196
|
+
function compute_path(query, parameters, path) {
|
|
197
|
+
var e_1, _a;
|
|
198
|
+
try {
|
|
199
|
+
for (var parameters_1 = __values(parameters), parameters_1_1 = parameters_1.next(); !parameters_1_1.done; parameters_1_1 = parameters_1.next()) {
|
|
200
|
+
var param = parameters_1_1.value;
|
|
201
|
+
if (param.category === "param")
|
|
202
|
+
path = path.replace(":".concat(param.field), "${".concat(param.name, "}"));
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
206
|
+
finally {
|
|
207
|
+
try {
|
|
208
|
+
if (parameters_1_1 && !parameters_1_1.done && (_a = parameters_1.return)) _a.call(parameters_1);
|
|
209
|
+
}
|
|
210
|
+
finally { if (e_1) throw e_1.error; }
|
|
211
|
+
}
|
|
212
|
+
return (query !== undefined)
|
|
213
|
+
? "`".concat(path, "?${new URLSearchParams(").concat(query.name, " as any).toString()}`")
|
|
214
|
+
: "`".concat(path, "`");
|
|
215
|
+
}
|
|
216
|
+
})(FunctionGenerator = exports.FunctionGenerator || (exports.FunctionGenerator = {}));
|
|
217
|
+
//# sourceMappingURL=FunctionGenerator.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { IRoute } from "../structures/IRoute";
|
|
3
|
+
import { IConfiguration } from "../IConfiguration";
|
|
4
|
+
export declare namespace SdkGenerator {
|
|
5
|
+
function generate(_checker: ts.TypeChecker, config: IConfiguration, routeList: IRoute[]): Promise<void>;
|
|
6
|
+
const BUNDLE_PATH: string;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=SdkGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SdkGenerator.d.ts","sourceRoot":"","sources":["../../src/generates/SdkGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAI5B,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,yBAAiB,YAAY,CAC7B;IACI,SAAsB,QAAQ,CAEtB,QAAQ,EAAE,EAAE,CAAC,WAAW,EACxB,MAAM,EAAE,cAAc,EACtB,SAAS,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CA0BnB;IAEM,MAAM,WAAW,QAAiD,CAAC;CAC7E"}
|
|
@@ -0,0 +1,128 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
50
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
51
|
+
};
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.SdkGenerator = void 0;
|
|
54
|
+
var fs_1 = __importDefault(require("fs"));
|
|
55
|
+
var path_1 = __importDefault(require("path"));
|
|
56
|
+
var DirectoryUtil_1 = require("../utils/DirectoryUtil");
|
|
57
|
+
var FileGenerator_1 = require("./FileGenerator");
|
|
58
|
+
var SdkGenerator;
|
|
59
|
+
(function (SdkGenerator) {
|
|
60
|
+
function generate(_checker, config, routeList) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
62
|
+
var _a, bundle, bundle_1, bundle_1_1, file, current, stats, content, e_1_1;
|
|
63
|
+
var e_1, _b;
|
|
64
|
+
return __generator(this, function (_c) {
|
|
65
|
+
switch (_c.label) {
|
|
66
|
+
case 0:
|
|
67
|
+
_c.trys.push([0, 2, , 3]);
|
|
68
|
+
return [4 /*yield*/, fs_1.default.promises.mkdir(config.output)];
|
|
69
|
+
case 1:
|
|
70
|
+
_c.sent();
|
|
71
|
+
return [3 /*break*/, 3];
|
|
72
|
+
case 2:
|
|
73
|
+
_a = _c.sent();
|
|
74
|
+
return [3 /*break*/, 3];
|
|
75
|
+
case 3: return [4 /*yield*/, fs_1.default.promises.readdir(SdkGenerator.BUNDLE_PATH)];
|
|
76
|
+
case 4:
|
|
77
|
+
bundle = _c.sent();
|
|
78
|
+
_c.label = 5;
|
|
79
|
+
case 5:
|
|
80
|
+
_c.trys.push([5, 12, 13, 14]);
|
|
81
|
+
bundle_1 = __values(bundle), bundle_1_1 = bundle_1.next();
|
|
82
|
+
_c.label = 6;
|
|
83
|
+
case 6:
|
|
84
|
+
if (!!bundle_1_1.done) return [3 /*break*/, 11];
|
|
85
|
+
file = bundle_1_1.value;
|
|
86
|
+
current = "".concat(SdkGenerator.BUNDLE_PATH, "/").concat(file);
|
|
87
|
+
return [4 /*yield*/, fs_1.default.promises.stat(current)];
|
|
88
|
+
case 7:
|
|
89
|
+
stats = _c.sent();
|
|
90
|
+
if (!(stats.isFile() === true)) return [3 /*break*/, 10];
|
|
91
|
+
return [4 /*yield*/, fs_1.default.promises.readFile(current, "utf8")];
|
|
92
|
+
case 8:
|
|
93
|
+
content = _c.sent();
|
|
94
|
+
return [4 /*yield*/, fs_1.default.promises.writeFile("".concat(config.output, "/").concat(file), content, "utf8")];
|
|
95
|
+
case 9:
|
|
96
|
+
_c.sent();
|
|
97
|
+
_c.label = 10;
|
|
98
|
+
case 10:
|
|
99
|
+
bundle_1_1 = bundle_1.next();
|
|
100
|
+
return [3 /*break*/, 6];
|
|
101
|
+
case 11: return [3 /*break*/, 14];
|
|
102
|
+
case 12:
|
|
103
|
+
e_1_1 = _c.sent();
|
|
104
|
+
e_1 = { error: e_1_1 };
|
|
105
|
+
return [3 /*break*/, 14];
|
|
106
|
+
case 13:
|
|
107
|
+
try {
|
|
108
|
+
if (bundle_1_1 && !bundle_1_1.done && (_b = bundle_1.return)) _b.call(bundle_1);
|
|
109
|
+
}
|
|
110
|
+
finally { if (e_1) throw e_1.error; }
|
|
111
|
+
return [7 /*endfinally*/];
|
|
112
|
+
case 14: return [4 /*yield*/, DirectoryUtil_1.DirectoryUtil.copy(SdkGenerator.BUNDLE_PATH + "/__internal", config.output + "/__internal")];
|
|
113
|
+
case 15:
|
|
114
|
+
_c.sent();
|
|
115
|
+
// FUNCTIONAL
|
|
116
|
+
return [4 /*yield*/, FileGenerator_1.FileGenerator.generate(config, routeList)];
|
|
117
|
+
case 16:
|
|
118
|
+
// FUNCTIONAL
|
|
119
|
+
_c.sent();
|
|
120
|
+
return [2 /*return*/];
|
|
121
|
+
}
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
SdkGenerator.generate = generate;
|
|
126
|
+
SdkGenerator.BUNDLE_PATH = path_1.default.join(__dirname, "..", "..", "bundle");
|
|
127
|
+
})(SdkGenerator = exports.SdkGenerator || (exports.SdkGenerator = {}));
|
|
128
|
+
//# sourceMappingURL=SdkGenerator.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import ts from "typescript";
|
|
2
|
+
import { IConfiguration } from "../IConfiguration";
|
|
3
|
+
import { IRoute } from "../structures/IRoute";
|
|
4
|
+
export declare namespace SwaggerGenerator {
|
|
5
|
+
function generate(checker: ts.TypeChecker, config: IConfiguration.ISwagger, routeList: IRoute[]): Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=SwaggerGenerator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SwaggerGenerator.d.ts","sourceRoot":"","sources":["../../src/generates/SwaggerGenerator.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,YAAY,CAAC;AAK5B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAK9C,yBAAiB,gBAAgB,CACjC;IACI,SAAsB,QAAQ,CAEtB,OAAO,EAAE,EAAE,CAAC,WAAW,EACvB,MAAM,EAAE,cAAc,CAAC,QAAQ,EAC/B,SAAS,EAAE,MAAM,EAAE,GACpB,OAAO,CAAC,IAAI,CAAC,CAyCnB;CAyJJ"}
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
15
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
16
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
18
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
19
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
23
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
24
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
25
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26
|
+
function step(op) {
|
|
27
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
28
|
+
while (_) try {
|
|
29
|
+
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;
|
|
30
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
31
|
+
switch (op[0]) {
|
|
32
|
+
case 0: case 1: t = op; break;
|
|
33
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
34
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
35
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
36
|
+
default:
|
|
37
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
38
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
39
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
40
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
41
|
+
if (t[2]) _.ops.pop();
|
|
42
|
+
_.trys.pop(); continue;
|
|
43
|
+
}
|
|
44
|
+
op = body.call(thisArg, _);
|
|
45
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
46
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var __values = (this && this.__values) || function(o) {
|
|
50
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
51
|
+
if (m) return m.call(o);
|
|
52
|
+
if (o && typeof o.length === "number") return {
|
|
53
|
+
next: function () {
|
|
54
|
+
if (o && i >= o.length) o = void 0;
|
|
55
|
+
return { value: o && o[i++], done: !o };
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
59
|
+
};
|
|
60
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
61
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
62
|
+
if (!m) return o;
|
|
63
|
+
var i = m.call(o), r, ar = [], e;
|
|
64
|
+
try {
|
|
65
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
66
|
+
}
|
|
67
|
+
catch (error) { e = { error: error }; }
|
|
68
|
+
finally {
|
|
69
|
+
try {
|
|
70
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
71
|
+
}
|
|
72
|
+
finally { if (e) throw e.error; }
|
|
73
|
+
}
|
|
74
|
+
return ar;
|
|
75
|
+
};
|
|
76
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
77
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
78
|
+
};
|
|
79
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
80
|
+
exports.SwaggerGenerator = void 0;
|
|
81
|
+
var fs_1 = __importDefault(require("fs"));
|
|
82
|
+
var path_1 = __importDefault(require("path"));
|
|
83
|
+
var MetadataFactory_1 = require("typescript-json/lib/factories/MetadataFactory");
|
|
84
|
+
var SchemaFactory_1 = require("typescript-json/lib/factories/SchemaFactory");
|
|
85
|
+
var MapUtil_1 = require("../utils/MapUtil");
|
|
86
|
+
var SwaggerGenerator;
|
|
87
|
+
(function (SwaggerGenerator) {
|
|
88
|
+
function generate(checker, config, routeList) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
90
|
+
var parsed, location, swagger, collection, pathDict, routeList_1, routeList_1_1, route, path, pathDict_1, pathDict_1_1, _a, path, routes;
|
|
91
|
+
var e_1, _b, e_2, _c;
|
|
92
|
+
return __generator(this, function (_d) {
|
|
93
|
+
switch (_d.label) {
|
|
94
|
+
case 0:
|
|
95
|
+
parsed = path_1.default.parse(config.output);
|
|
96
|
+
location = !!parsed.ext
|
|
97
|
+
? path_1.default.resolve(config.output)
|
|
98
|
+
: path_1.default.join(path_1.default.resolve(config.output), "swagger.json");
|
|
99
|
+
return [4 /*yield*/, initialize(location)];
|
|
100
|
+
case 1:
|
|
101
|
+
swagger = _d.sent();
|
|
102
|
+
collection = new MetadataFactory_1.MetadataFactory.Collection(false);
|
|
103
|
+
pathDict = new Map();
|
|
104
|
+
try {
|
|
105
|
+
for (routeList_1 = __values(routeList), routeList_1_1 = routeList_1.next(); !routeList_1_1.done; routeList_1_1 = routeList_1.next()) {
|
|
106
|
+
route = routeList_1_1.value;
|
|
107
|
+
path = MapUtil_1.MapUtil.take(pathDict, get_path(route.path, route.parameters), function () { return ({}); });
|
|
108
|
+
path[route.method.toLowerCase()] = generate_route(checker, collection, route);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
112
|
+
finally {
|
|
113
|
+
try {
|
|
114
|
+
if (routeList_1_1 && !routeList_1_1.done && (_b = routeList_1.return)) _b.call(routeList_1);
|
|
115
|
+
}
|
|
116
|
+
finally { if (e_1) throw e_1.error; }
|
|
117
|
+
}
|
|
118
|
+
swagger.paths = {};
|
|
119
|
+
try {
|
|
120
|
+
for (pathDict_1 = __values(pathDict), pathDict_1_1 = pathDict_1.next(); !pathDict_1_1.done; pathDict_1_1 = pathDict_1.next()) {
|
|
121
|
+
_a = __read(pathDict_1_1.value, 2), path = _a[0], routes = _a[1];
|
|
122
|
+
swagger.paths[path] = routes;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
126
|
+
finally {
|
|
127
|
+
try {
|
|
128
|
+
if (pathDict_1_1 && !pathDict_1_1.done && (_c = pathDict_1.return)) _c.call(pathDict_1);
|
|
129
|
+
}
|
|
130
|
+
finally { if (e_2) throw e_2.error; }
|
|
131
|
+
}
|
|
132
|
+
swagger.components = __assign({}, SchemaFactory_1.SchemaFactory.components(collection.storage()));
|
|
133
|
+
swagger.nestia = "Generated by Nestia - https://github.com/samchon/nestia";
|
|
134
|
+
return [4 /*yield*/, fs_1.default.promises.writeFile(location, JSON.stringify(swagger, null, 2), "utf8")];
|
|
135
|
+
case 2:
|
|
136
|
+
_d.sent();
|
|
137
|
+
return [2 /*return*/];
|
|
138
|
+
}
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
SwaggerGenerator.generate = generate;
|
|
143
|
+
function initialize(path) {
|
|
144
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
145
|
+
var swagger, _a, _b, _c;
|
|
146
|
+
return __generator(this, function (_d) {
|
|
147
|
+
switch (_d.label) {
|
|
148
|
+
case 0:
|
|
149
|
+
if (!fs_1.default.existsSync(path)) return [3 /*break*/, 2];
|
|
150
|
+
_c = (_b = JSON).parse;
|
|
151
|
+
return [4 /*yield*/, fs_1.default.promises.readFile(path, "utf8")];
|
|
152
|
+
case 1:
|
|
153
|
+
_a = _c.apply(_b, [_d.sent()]);
|
|
154
|
+
return [3 /*break*/, 3];
|
|
155
|
+
case 2:
|
|
156
|
+
_a = {
|
|
157
|
+
openapi: "3.0",
|
|
158
|
+
nestia: "",
|
|
159
|
+
paths: {},
|
|
160
|
+
components: {}
|
|
161
|
+
};
|
|
162
|
+
_d.label = 3;
|
|
163
|
+
case 3:
|
|
164
|
+
swagger = _a;
|
|
165
|
+
// RETURNS
|
|
166
|
+
return [2 /*return*/, swagger];
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
function get_path(path, parameters) {
|
|
172
|
+
var e_3, _a;
|
|
173
|
+
var filtered = parameters.filter(function (param) { return param.category === "param"
|
|
174
|
+
&& !!param.field; });
|
|
175
|
+
try {
|
|
176
|
+
for (var filtered_1 = __values(filtered), filtered_1_1 = filtered_1.next(); !filtered_1_1.done; filtered_1_1 = filtered_1.next()) {
|
|
177
|
+
var param = filtered_1_1.value;
|
|
178
|
+
path = path.replace(":".concat(param.field), "{".concat(param.field, "}"));
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
catch (e_3_1) { e_3 = { error: e_3_1 }; }
|
|
182
|
+
finally {
|
|
183
|
+
try {
|
|
184
|
+
if (filtered_1_1 && !filtered_1_1.done && (_a = filtered_1.return)) _a.call(filtered_1);
|
|
185
|
+
}
|
|
186
|
+
finally { if (e_3) throw e_3.error; }
|
|
187
|
+
}
|
|
188
|
+
return path;
|
|
189
|
+
}
|
|
190
|
+
function generate_route(checker, collection, route) {
|
|
191
|
+
var bodyParam = route.parameters.find(function (param) { return param.category === "body"; });
|
|
192
|
+
return {
|
|
193
|
+
tags: [],
|
|
194
|
+
parameters: route.parameters
|
|
195
|
+
.filter(function (param) { return param.category !== "body"; })
|
|
196
|
+
.map(function (param) { return generate_parameter(checker, collection, route, param); }),
|
|
197
|
+
requestBody: bodyParam
|
|
198
|
+
? generate_request_body(checker, collection, route, bodyParam)
|
|
199
|
+
: undefined,
|
|
200
|
+
responses: generate_response_body(checker, collection, route)
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
function generate_parameter(checker, collection, route, parameter) {
|
|
204
|
+
return {
|
|
205
|
+
name: parameter.name,
|
|
206
|
+
in: parameter.category === "param"
|
|
207
|
+
? "path"
|
|
208
|
+
: parameter.category,
|
|
209
|
+
description: get_parametric_description(route.comments, "parameterName", parameter.name),
|
|
210
|
+
schema: generate_schema(checker, collection, parameter.type.metadata),
|
|
211
|
+
required: true
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function generate_request_body(checker, collection, route, parameter) {
|
|
215
|
+
return {
|
|
216
|
+
description: get_parametric_description(route.comments, "parameterName", parameter.name),
|
|
217
|
+
content: {
|
|
218
|
+
"application/json": {
|
|
219
|
+
schema: generate_schema(checker, collection, route.output.metadata)
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
required: true
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
function generate_response_body(checker, collection, route) {
|
|
226
|
+
var _a;
|
|
227
|
+
var status = route.method === "GET" || route.method === "DELETE"
|
|
228
|
+
? "200"
|
|
229
|
+
: "201";
|
|
230
|
+
return _a = {},
|
|
231
|
+
_a[status] = {
|
|
232
|
+
description: get_parametric_description(route.comments, "return")
|
|
233
|
+
|| get_parametric_description(route.comments, "returns"),
|
|
234
|
+
content: route.output.escapedText === "void" ? undefined :
|
|
235
|
+
{
|
|
236
|
+
"application/json": {
|
|
237
|
+
schema: generate_schema(checker, collection, route.output.metadata)
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
},
|
|
241
|
+
_a;
|
|
242
|
+
}
|
|
243
|
+
function get_parametric_description(comments, kind, text) {
|
|
244
|
+
var _a;
|
|
245
|
+
var index = comments.findIndex(function (c) {
|
|
246
|
+
return c.kind === kind &&
|
|
247
|
+
(c.text === text || !text);
|
|
248
|
+
});
|
|
249
|
+
return index !== -1
|
|
250
|
+
? (_a = comments[index + 2]) === null || _a === void 0 ? void 0 : _a.text
|
|
251
|
+
: undefined;
|
|
252
|
+
}
|
|
253
|
+
function generate_schema(checker, collection, type) {
|
|
254
|
+
var entity = MetadataFactory_1.MetadataFactory.generate(checker, type, collection);
|
|
255
|
+
return SchemaFactory_1.SchemaFactory.schema((entity === null || entity === void 0 ? void 0 : entity.metadata) || null);
|
|
256
|
+
}
|
|
257
|
+
})(SwaggerGenerator = exports.SwaggerGenerator || (exports.SwaggerGenerator = {}));
|
|
258
|
+
//# sourceMappingURL=SwaggerGenerator.js.map
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,UAAU,CAAC;AACnC,eAAe,MAAM,CAAC"}
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
var nestia = __importStar(require("./module"));
|
|
27
|
+
exports.default = nestia;
|
|
28
|
+
//# sourceMappingURL=index.js.map
|