@trapi/metadata 0.4.0 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +36 -72
- package/dist/cache/driver.d.ts +6 -6
- package/dist/cache/driver.d.ts.map +1 -1
- package/dist/cache/driver.js +27 -45
- package/dist/cache/driver.js.map +1 -1
- package/dist/cache/type.d.ts +31 -32
- package/dist/cache/type.d.ts.map +1 -1
- package/dist/cache/utils.d.ts +3 -3
- package/dist/cache/utils.d.ts.map +1 -1
- package/dist/cache/utils.js +29 -24
- package/dist/cache/utils.js.map +1 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/type.d.ts +37 -0
- package/dist/config/type.d.ts.map +1 -0
- package/dist/config/type.js +9 -0
- package/dist/config/type.js.map +1 -0
- package/dist/decorator/constants.d.ts +40 -0
- package/dist/decorator/constants.d.ts.map +1 -0
- package/dist/decorator/constants.js +52 -0
- package/dist/decorator/constants.js.map +1 -0
- package/dist/decorator/index.d.ts +7 -0
- package/dist/decorator/index.d.ts.map +1 -0
- package/dist/decorator/index.js +29 -0
- package/dist/decorator/index.js.map +1 -0
- package/dist/decorator/preset/index.d.ts +3 -0
- package/dist/decorator/preset/index.d.ts.map +1 -0
- package/dist/decorator/preset/index.js +25 -0
- package/dist/decorator/preset/index.js.map +1 -0
- package/dist/decorator/preset/type.d.ts +6 -0
- package/dist/decorator/preset/type.d.ts.map +1 -0
- package/dist/decorator/preset/type.js +9 -0
- package/dist/decorator/preset/type.js.map +1 -0
- package/dist/decorator/preset/utils/check.d.ts +3 -0
- package/dist/decorator/preset/utils/check.d.ts.map +1 -0
- package/dist/decorator/preset/utils/check.js +18 -0
- package/dist/decorator/preset/utils/check.js.map +1 -0
- package/dist/decorator/preset/utils/index.d.ts +4 -0
- package/dist/decorator/preset/utils/index.d.ts.map +1 -0
- package/dist/decorator/preset/utils/index.js +26 -0
- package/dist/decorator/preset/utils/index.js.map +1 -0
- package/dist/decorator/preset/utils/load.d.ts +3 -0
- package/dist/decorator/preset/utils/load.d.ts.map +1 -0
- package/dist/decorator/preset/utils/load.js +48 -0
- package/dist/decorator/preset/utils/load.js.map +1 -0
- package/dist/decorator/preset/utils/normalize.d.ts +2 -0
- package/dist/decorator/preset/utils/normalize.d.ts.map +1 -0
- package/dist/decorator/preset/utils/normalize.js +27 -0
- package/dist/decorator/preset/utils/normalize.js.map +1 -0
- package/dist/decorator/property-manager/index.d.ts +3 -0
- package/dist/decorator/property-manager/index.d.ts.map +1 -0
- package/dist/decorator/property-manager/index.js +25 -0
- package/dist/decorator/property-manager/index.js.map +1 -0
- package/dist/decorator/property-manager/module.d.ts +19 -0
- package/dist/decorator/property-manager/module.d.ts.map +1 -0
- package/dist/decorator/property-manager/module.js +65 -0
- package/dist/decorator/property-manager/module.js.map +1 -0
- package/dist/decorator/property-manager/utils.d.ts +7 -0
- package/dist/decorator/property-manager/utils.d.ts.map +1 -0
- package/dist/decorator/property-manager/utils.js +121 -0
- package/dist/decorator/property-manager/utils.js.map +1 -0
- package/dist/decorator/resolver/index.d.ts +3 -0
- package/dist/decorator/resolver/index.d.ts.map +1 -0
- package/dist/decorator/resolver/index.js +25 -0
- package/dist/decorator/resolver/index.js.map +1 -0
- package/dist/decorator/resolver/module.d.ts +27 -0
- package/dist/decorator/resolver/module.d.ts.map +1 -0
- package/dist/decorator/resolver/module.js +72 -0
- package/dist/decorator/resolver/module.js.map +1 -0
- package/dist/decorator/resolver/type.d.ts +10 -0
- package/dist/decorator/resolver/type.d.ts.map +1 -0
- package/dist/decorator/resolver/type.js +3 -0
- package/dist/decorator/resolver/type.js.map +1 -0
- package/dist/decorator/sets/class.d.ts +7 -0
- package/dist/decorator/sets/class.d.ts.map +1 -0
- package/dist/decorator/sets/class.js +9 -0
- package/dist/decorator/sets/class.js.map +1 -0
- package/dist/decorator/sets/index.d.ts +8 -0
- package/dist/decorator/sets/index.d.ts.map +1 -0
- package/dist/decorator/sets/index.js +29 -0
- package/dist/decorator/sets/index.js.map +1 -0
- package/dist/decorator/sets/method.d.ts +14 -0
- package/dist/decorator/sets/method.d.ts.map +1 -0
- package/dist/decorator/sets/method.js +9 -0
- package/dist/decorator/sets/method.js.map +1 -0
- package/dist/decorator/sets/mixed.d.ts +8 -0
- package/dist/decorator/sets/mixed.d.ts.map +1 -0
- package/dist/decorator/sets/mixed.js +9 -0
- package/dist/decorator/sets/mixed.js.map +1 -0
- package/dist/decorator/sets/parameter.d.ts +21 -0
- package/dist/decorator/sets/parameter.d.ts.map +1 -0
- package/dist/decorator/sets/parameter.js +9 -0
- package/dist/decorator/sets/parameter.js.map +1 -0
- package/dist/decorator/sets/request.d.ts +6 -0
- package/dist/decorator/sets/request.d.ts.map +1 -0
- package/dist/decorator/sets/request.js +9 -0
- package/dist/decorator/sets/request.js.map +1 -0
- package/dist/decorator/sets/response.d.ts +16 -0
- package/dist/decorator/sets/response.d.ts.map +1 -0
- package/dist/decorator/sets/response.js +9 -0
- package/dist/decorator/sets/response.js.map +1 -0
- package/dist/decorator/sets/type.d.ts +4 -0
- package/dist/decorator/sets/type.d.ts.map +1 -0
- package/dist/decorator/sets/type.js +3 -0
- package/dist/decorator/sets/type.js.map +1 -0
- package/dist/decorator/type.d.ts +39 -0
- package/dist/decorator/type.d.ts.map +1 -0
- package/dist/decorator/type.js +9 -0
- package/dist/decorator/type.js.map +1 -0
- package/dist/error/base.d.ts +3 -0
- package/dist/error/base.d.ts.map +1 -0
- package/dist/error/base.js +13 -0
- package/dist/error/base.js.map +1 -0
- package/dist/error/index.d.ts +3 -0
- package/dist/error/index.d.ts.map +1 -0
- package/dist/{errors → error}/index.js +1 -0
- package/dist/error/index.js.map +1 -0
- package/dist/error/parameter-invalid.d.ts +4 -0
- package/dist/error/parameter-invalid.d.ts.map +1 -0
- package/dist/{errors → error}/parameter-invalid.js +2 -1
- package/dist/error/parameter-invalid.js.map +1 -0
- package/dist/generator/{endpoint.d.ts → abstract.d.ts} +9 -8
- package/dist/generator/abstract.d.ts.map +1 -0
- package/dist/generator/{endpoint.js → abstract.js} +26 -25
- package/dist/generator/abstract.js.map +1 -0
- package/dist/generator/controller/index.d.ts +3 -0
- package/dist/generator/controller/index.d.ts.map +1 -0
- package/dist/generator/controller/index.js +25 -0
- package/dist/generator/controller/index.js.map +1 -0
- package/dist/generator/controller/module.d.ts +13 -0
- package/dist/generator/controller/module.d.ts.map +1 -0
- package/dist/generator/{controller.js → controller/module.js} +7 -6
- package/dist/generator/controller/module.js.map +1 -0
- package/dist/generator/controller/type.d.ts +42 -0
- package/dist/generator/controller/type.d.ts.map +1 -0
- package/dist/generator/controller/type.js +3 -0
- package/dist/generator/controller/type.js.map +1 -0
- package/dist/generator/index.d.ts +3 -3
- package/dist/generator/index.d.ts.map +1 -1
- package/dist/generator/index.js +3 -3
- package/dist/generator/index.js.map +1 -1
- package/dist/generator/metadata/index.d.ts +3 -0
- package/dist/generator/metadata/index.d.ts.map +1 -0
- package/dist/generator/metadata/index.js +25 -0
- package/dist/generator/metadata/index.js.map +1 -0
- package/dist/generator/{module.d.ts → metadata/module.d.ts} +10 -9
- package/dist/generator/metadata/module.d.ts.map +1 -0
- package/dist/generator/{module.js → metadata/module.js} +22 -39
- package/dist/generator/metadata/module.js.map +1 -0
- package/dist/generator/metadata/type.d.ts +25 -0
- package/dist/generator/metadata/type.d.ts.map +1 -0
- package/dist/generator/metadata/type.js +3 -0
- package/dist/generator/metadata/type.js.map +1 -0
- package/dist/generator/method/constants.d.ts +11 -0
- package/dist/generator/method/constants.d.ts.map +1 -0
- package/dist/generator/method/constants.js +21 -0
- package/dist/generator/method/constants.js.map +1 -0
- package/dist/generator/method/index.d.ts +4 -0
- package/dist/generator/method/index.d.ts.map +1 -0
- package/dist/generator/method/index.js +26 -0
- package/dist/generator/method/index.js.map +1 -0
- package/dist/generator/{method.d.ts → method/module.d.ts} +6 -7
- package/dist/generator/method/module.d.ts.map +1 -0
- package/dist/generator/{method.js → method/module.js} +69 -44
- package/dist/generator/method/module.js.map +1 -0
- package/dist/generator/method/type.d.ts +30 -0
- package/dist/generator/method/type.d.ts.map +1 -0
- package/dist/generator/method/type.js +9 -0
- package/dist/generator/method/type.js.map +1 -0
- package/dist/generator/parameter/index.d.ts +4 -0
- package/dist/generator/parameter/index.d.ts.map +1 -0
- package/dist/generator/parameter/index.js +26 -0
- package/dist/generator/parameter/index.js.map +1 -0
- package/dist/generator/{parameter.d.ts → parameter/module.d.ts} +4 -4
- package/dist/generator/parameter/module.d.ts.map +1 -0
- package/dist/generator/{parameter.js → parameter/module.js} +70 -63
- package/dist/generator/parameter/module.js.map +1 -0
- package/dist/generator/parameter/type.d.ts +22 -0
- package/dist/generator/parameter/type.d.ts.map +1 -0
- package/dist/generator/parameter/type.js +9 -0
- package/dist/generator/parameter/type.js.map +1 -0
- package/dist/generator/parameter/validator.d.ts +4 -0
- package/dist/generator/parameter/validator.d.ts.map +1 -0
- package/dist/generator/parameter/validator.js +130 -0
- package/dist/generator/parameter/validator.js.map +1 -0
- package/dist/generator/type.d.ts +16 -0
- package/dist/generator/type.d.ts.map +1 -0
- package/dist/generator/type.js +9 -0
- package/dist/generator/type.js.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/module.d.ts +4 -3
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +20 -2
- package/dist/module.js.map +1 -1
- package/dist/resolver/error.d.ts +8 -0
- package/dist/resolver/error.d.ts.map +1 -0
- package/dist/resolver/error.js +41 -0
- package/dist/resolver/error.js.map +1 -0
- package/dist/resolver/index.d.ts +4 -0
- package/dist/resolver/index.d.ts.map +1 -0
- package/dist/resolver/index.js +26 -0
- package/dist/resolver/index.js.map +1 -0
- package/dist/resolver/module.d.ts +51 -0
- package/dist/resolver/module.d.ts.map +1 -0
- package/dist/resolver/module.js +1081 -0
- package/dist/resolver/module.js.map +1 -0
- package/dist/resolver/type.d.ts +126 -0
- package/dist/resolver/type.d.ts.map +1 -0
- package/dist/resolver/type.js +54 -0
- package/dist/resolver/type.js.map +1 -0
- package/dist/type.d.ts +0 -149
- package/dist/type.d.ts.map +1 -1
- package/dist/type.js +0 -6
- package/dist/type.js.map +1 -1
- package/dist/utils/index.d.ts +6 -2
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +6 -2
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/initializer.d.ts +5 -0
- package/dist/utils/initializer.d.ts.map +1 -0
- package/dist/utils/initializer.js +131 -0
- package/dist/utils/initializer.js.map +1 -0
- package/dist/utils/js-doc.d.ts +8 -0
- package/dist/utils/js-doc.d.ts.map +1 -0
- package/dist/utils/js-doc.js +101 -0
- package/dist/utils/js-doc.js.map +1 -0
- package/dist/utils/node/index.d.ts +3 -0
- package/dist/utils/node/index.d.ts.map +1 -0
- package/dist/utils/node/index.js +25 -0
- package/dist/utils/node/index.js.map +1 -0
- package/dist/utils/node/module.d.ts +10 -0
- package/dist/utils/node/module.d.ts.map +1 -0
- package/dist/utils/node/module.js +52 -0
- package/dist/utils/node/module.js.map +1 -0
- package/dist/utils/node/type.d.ts +6 -0
- package/dist/utils/node/type.d.ts.map +1 -0
- package/dist/utils/node/type.js +9 -0
- package/dist/utils/node/type.js.map +1 -0
- package/dist/utils/{path.d.ts → path-normalize.d.ts} +1 -1
- package/dist/utils/path-normalize.d.ts.map +1 -0
- package/dist/utils/{path.js → path-normalize.js} +1 -1
- package/dist/utils/path-normalize.js.map +1 -0
- package/dist/utils/source-files.d.ts +3 -0
- package/dist/utils/source-files.d.ts.map +1 -0
- package/dist/utils/source-files.js +32 -0
- package/dist/utils/source-files.js.map +1 -0
- package/dist/utils/tsconfig/index.d.ts +3 -0
- package/dist/utils/tsconfig/index.d.ts.map +1 -0
- package/dist/utils/tsconfig/index.js +25 -0
- package/dist/utils/tsconfig/index.js.map +1 -0
- package/dist/utils/tsconfig/module.d.ts +4 -0
- package/dist/utils/tsconfig/module.d.ts.map +1 -0
- package/dist/utils/tsconfig/module.js +54 -0
- package/dist/utils/tsconfig/module.js.map +1 -0
- package/dist/utils/tsconfig/type.d.ts +10 -0
- package/dist/utils/tsconfig/type.d.ts.map +1 -0
- package/dist/utils/tsconfig/type.js +9 -0
- package/dist/utils/tsconfig/type.js.map +1 -0
- package/package.json +11 -12
- package/dist/config/path.d.ts +0 -3
- package/dist/config/path.d.ts.map +0 -1
- package/dist/config/path.js +0 -32
- package/dist/config/path.js.map +0 -1
- package/dist/errors/index.d.ts +0 -2
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/parameter-invalid.d.ts +0 -3
- package/dist/errors/parameter-invalid.d.ts.map +0 -1
- package/dist/errors/parameter-invalid.js.map +0 -1
- package/dist/generator/controller.d.ts +0 -13
- package/dist/generator/controller.d.ts.map +0 -1
- package/dist/generator/controller.js.map +0 -1
- package/dist/generator/endpoint.d.ts.map +0 -1
- package/dist/generator/endpoint.js.map +0 -1
- package/dist/generator/method.d.ts.map +0 -1
- package/dist/generator/method.js.map +0 -1
- package/dist/generator/module.d.ts.map +0 -1
- package/dist/generator/module.js.map +0 -1
- package/dist/generator/parameter.d.ts.map +0 -1
- package/dist/generator/parameter.js.map +0 -1
- package/dist/generator/utils.d.ts +0 -5
- package/dist/generator/utils.d.ts.map +0 -1
- package/dist/generator/utils.js +0 -18
- package/dist/generator/utils.js.map +0 -1
- package/dist/utils/path.d.ts.map +0 -1
- package/dist/utils/path.js.map +0 -1
- package/dist/utils/typescript.d.ts +0 -8
- package/dist/utils/typescript.d.ts.map +0 -1
- package/dist/utils/typescript.js +0 -41
- package/dist/utils/typescript.js.map +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DecoratorID = void 0;
|
|
10
|
+
var DecoratorID;
|
|
11
|
+
(function (DecoratorID) {
|
|
12
|
+
DecoratorID["SWAGGER_TAGS"] = "swaggerTags";
|
|
13
|
+
DecoratorID["CLASS_PATH"] = "classPath";
|
|
14
|
+
DecoratorID["RESPONSE_DESCRIPTION"] = "responseDescription";
|
|
15
|
+
DecoratorID["RESPONSE_EXAMPLE"] = "responseExample";
|
|
16
|
+
DecoratorID["RESPONSE_PRODUCES"] = "responseProduces";
|
|
17
|
+
DecoratorID["REQUEST_ACCEPT"] = "requestAccept";
|
|
18
|
+
DecoratorID["REQUEST_CONSUMES"] = "requestConsumes";
|
|
19
|
+
DecoratorID["DEPRECATED"] = "deprecated";
|
|
20
|
+
DecoratorID["EXTENSION"] = "extension";
|
|
21
|
+
DecoratorID["HIDDEN"] = "hidden";
|
|
22
|
+
DecoratorID["METHOD_PATH"] = "methodPath";
|
|
23
|
+
DecoratorID["ALL"] = "all";
|
|
24
|
+
DecoratorID["GET"] = "get";
|
|
25
|
+
DecoratorID["POST"] = "post";
|
|
26
|
+
DecoratorID["PUT"] = "put";
|
|
27
|
+
DecoratorID["DELETE"] = "delete";
|
|
28
|
+
DecoratorID["PATCH"] = "patch";
|
|
29
|
+
DecoratorID["OPTIONS"] = "options";
|
|
30
|
+
DecoratorID["HEAD"] = "head";
|
|
31
|
+
// Parameter
|
|
32
|
+
DecoratorID["IS_INT"] = "isInt";
|
|
33
|
+
DecoratorID["IS_LONG"] = "isLong";
|
|
34
|
+
DecoratorID["IS_FLOAT"] = "isFloat";
|
|
35
|
+
DecoratorID["IS_DOUBLE"] = "isDouble";
|
|
36
|
+
// Parameter Server
|
|
37
|
+
DecoratorID["CONTEXT"] = "context";
|
|
38
|
+
DecoratorID["PARAM"] = "param";
|
|
39
|
+
DecoratorID["PARAMS"] = "params";
|
|
40
|
+
DecoratorID["QUERY"] = "query";
|
|
41
|
+
DecoratorID["FORM"] = "form";
|
|
42
|
+
DecoratorID["BODY"] = "body";
|
|
43
|
+
DecoratorID["HEADER"] = "header";
|
|
44
|
+
DecoratorID["HEADERS"] = "headers";
|
|
45
|
+
DecoratorID["COOKIE"] = "cookie";
|
|
46
|
+
DecoratorID["COOKIES"] = "cookies";
|
|
47
|
+
DecoratorID["PATH_PARAM"] = "pathParam";
|
|
48
|
+
DecoratorID["PATH_PARAMS"] = "pathParams";
|
|
49
|
+
DecoratorID["FILE_PARAM"] = "fileParam";
|
|
50
|
+
DecoratorID["FILES_PARAM"] = "filesParam";
|
|
51
|
+
})(DecoratorID = exports.DecoratorID || (exports.DecoratorID = {}));
|
|
52
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/decorator/constants.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,IAAY,WA+CX;AA/CD,WAAY,WAAW;IACnB,2CAA4B,CAAA;IAC5B,uCAAwB,CAAA;IAExB,2DAA4C,CAAA;IAC5C,mDAAoC,CAAA;IACpC,qDAAsC,CAAA;IAEtC,+CAAgC,CAAA;IAChC,mDAAoC,CAAA;IAEpC,wCAAyB,CAAA;IACzB,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IAEjB,yCAA0B,CAAA;IAE1B,0BAAW,CAAA;IACX,0BAAW,CAAA;IACX,4BAAa,CAAA;IACb,0BAAW,CAAA;IACX,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,4BAAa,CAAA;IAEb,YAAY;IACZ,+BAAgB,CAAA;IAChB,iCAAkB,CAAA;IAClB,mCAAoB,CAAA;IACpB,qCAAsB,CAAA;IAEtB,mBAAmB;IACnB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,gCAAiB,CAAA;IACjB,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,4BAAa,CAAA;IACb,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,uCAAwB,CAAA;IACxB,yCAA0B,CAAA;IAC1B,uCAAwB,CAAA;IACxB,yCAA0B,CAAA;AAC9B,CAAC,EA/CW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QA+CtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/decorator/index.ts"],"names":[],"mappings":"AAOA,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./constants"), exports);
|
|
24
|
+
__exportStar(require("./property-manager"), exports);
|
|
25
|
+
__exportStar(require("./resolver"), exports);
|
|
26
|
+
__exportStar(require("./preset"), exports);
|
|
27
|
+
__exportStar(require("./sets"), exports);
|
|
28
|
+
__exportStar(require("./type"), exports);
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/decorator/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,8CAA4B;AAC5B,qDAAmC;AACnC,6CAA2B;AAC3B,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorator/preset/index.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./type"), exports);
|
|
24
|
+
__exportStar(require("./utils"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorator/preset/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,yCAAuB;AACvB,0CAAwB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../../src/decorator/preset/type.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,MAAM,MAAM,YAAY,GAAG;IACvB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,eAAe,EAAE,CAAA;CAC3B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
//# sourceMappingURL=type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../../src/decorator/preset/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../../src/decorator/preset/utils/check.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAI,KAAK,IAAI,YAAY,CAKrE"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.isPresetSchema = void 0;
|
|
10
|
+
const locter_1 = require("locter");
|
|
11
|
+
function isPresetSchema(input) {
|
|
12
|
+
return (0, locter_1.isObject)(input) &&
|
|
13
|
+
(0, locter_1.hasOwnProperty)(input, 'items') &&
|
|
14
|
+
Array.isArray(input.items) &&
|
|
15
|
+
(!(0, locter_1.hasOwnProperty)(input, 'extends') || Array.isArray(input.extends));
|
|
16
|
+
}
|
|
17
|
+
exports.isPresetSchema = isPresetSchema;
|
|
18
|
+
//# sourceMappingURL=check.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"check.js","sourceRoot":"","sources":["../../../../src/decorator/preset/utils/check.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mCAAkD;AAGlD,SAAgB,cAAc,CAAC,KAAc;IACzC,OAAO,IAAA,iBAAQ,EAAC,KAAK,CAAC;QAClB,IAAA,uBAAc,EAAC,KAAK,EAAE,OAAO,CAAC;QAC9B,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC;QAC1B,CAAC,CAAC,IAAA,uBAAc,EAAC,KAAK,EAAE,SAAS,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC5E,CAAC;AALD,wCAKC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/decorator/preset/utils/index.ts"],"names":[],"mappings":"AAOA,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./check"), exports);
|
|
24
|
+
__exportStar(require("./load"), exports);
|
|
25
|
+
__exportStar(require("./normalize"), exports);
|
|
26
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/decorator/preset/utils/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,0CAAwB;AACxB,yCAAuB;AACvB,8CAA4B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../../../../src/decorator/preset/utils/load.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIlD,wBAAsB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAyC3E"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.loadPreset = void 0;
|
|
10
|
+
const locter_1 = require("locter");
|
|
11
|
+
const check_1 = require("./check");
|
|
12
|
+
const normalize_1 = require("./normalize");
|
|
13
|
+
async function loadPreset(input) {
|
|
14
|
+
const items = [];
|
|
15
|
+
const lookupPaths = (0, normalize_1.generatePresetLookupPaths)(input);
|
|
16
|
+
let allFailed = true;
|
|
17
|
+
for (let i = 0; i < lookupPaths.length; i++) {
|
|
18
|
+
try {
|
|
19
|
+
let content = await (0, locter_1.load)(lookupPaths[i]);
|
|
20
|
+
if ((0, locter_1.hasOwnProperty)(content, 'default')) {
|
|
21
|
+
content = content.default;
|
|
22
|
+
}
|
|
23
|
+
if ((0, check_1.isPresetSchema)(content)) {
|
|
24
|
+
items.push(...content.items);
|
|
25
|
+
const extendsPromises = [];
|
|
26
|
+
if (content.extends) {
|
|
27
|
+
for (let j = 0; j < content.extends.length; j++) {
|
|
28
|
+
extendsPromises.push(loadPreset(content.extends[j]));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
const output = await Promise.all(extendsPromises);
|
|
32
|
+
for (let j = 0; j < output.length; j++) {
|
|
33
|
+
items.push(...output[j]);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
allFailed = false;
|
|
37
|
+
}
|
|
38
|
+
catch (e) {
|
|
39
|
+
// do nothing ...
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
if (allFailed) {
|
|
43
|
+
throw new Error(`The preset ${input} could not be resolved.`);
|
|
44
|
+
}
|
|
45
|
+
return items;
|
|
46
|
+
}
|
|
47
|
+
exports.loadPreset = loadPreset;
|
|
48
|
+
//# sourceMappingURL=load.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load.js","sourceRoot":"","sources":["../../../../src/decorator/preset/utils/load.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,mCAA8C;AAE9C,mCAAyC;AACzC,2CAAwD;AAEjD,KAAK,UAAU,UAAU,CAAC,KAAa;IAC1C,MAAM,KAAK,GAAuB,EAAE,CAAC;IAErC,MAAM,WAAW,GAAG,IAAA,qCAAyB,EAAC,KAAK,CAAC,CAAC;IACrD,IAAI,SAAS,GAAG,IAAI,CAAC;IAErB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACzC,IAAI;YACA,IAAI,OAAO,GAAG,MAAM,IAAA,aAAI,EAAC,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC;YACzC,IAAI,IAAA,uBAAc,EAAC,OAAO,EAAE,SAAS,CAAC,EAAE;gBACpC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;aAC7B;YAED,IAAI,IAAA,sBAAc,EAAC,OAAO,CAAC,EAAE;gBACzB,KAAK,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;gBAE7B,MAAM,eAAe,GAAkC,EAAE,CAAC;gBAE1D,IAAI,OAAO,CAAC,OAAO,EAAE;oBACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBAC7C,eAAe,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;qBACxD;iBACJ;gBAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAC;gBAClD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;oBACpC,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;iBAC5B;aACJ;YAED,SAAS,GAAG,KAAK,CAAC;SACrB;QAAC,OAAO,CAAC,EAAE;YACR,iBAAiB;SACpB;KACJ;IAED,IAAI,SAAS,EAAE;QACX,MAAM,IAAI,KAAK,CAAC,cAAc,KAAK,yBAAyB,CAAC,CAAC;KACjE;IAED,OAAO,KAAK,CAAC;AACjB,CAAC;AAzCD,gCAyCC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../../src/decorator/preset/utils/normalize.ts"],"names":[],"mappings":"AASA,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAI,MAAM,EAAE,CAclE"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2023.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.generatePresetLookupPaths = void 0;
|
|
13
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
14
|
+
function generatePresetLookupPaths(input) {
|
|
15
|
+
if (node_path_1.default.isAbsolute(input) || input.startsWith('./')) {
|
|
16
|
+
return [input];
|
|
17
|
+
}
|
|
18
|
+
if (input.startsWith('module:')) {
|
|
19
|
+
return [input.substring(0, 'module:'.length)];
|
|
20
|
+
}
|
|
21
|
+
if (!input.startsWith('@')) {
|
|
22
|
+
return [input, `@trapi/${input}`];
|
|
23
|
+
}
|
|
24
|
+
return [input];
|
|
25
|
+
}
|
|
26
|
+
exports.generatePresetLookupPaths = generatePresetLookupPaths;
|
|
27
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../../../src/decorator/preset/utils/normalize.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,0DAA6B;AAE7B,SAAgB,yBAAyB,CAAC,KAAa;IACnD,IAAI,mBAAI,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE;QAClD,OAAO,CAAC,KAAK,CAAC,CAAC;KAClB;IAED,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE;QAC7B,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,EAAE,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;KACjD;IAED,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QACxB,OAAO,CAAC,KAAK,EAAE,UAAU,KAAK,EAAE,CAAC,CAAC;KACrC;IAED,OAAO,CAAC,KAAK,CAAC,CAAC;AACnB,CAAC;AAdD,8DAcC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorator/property-manager/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
9
|
+
if (k2 === undefined) k2 = k;
|
|
10
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
11
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
12
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
13
|
+
}
|
|
14
|
+
Object.defineProperty(o, k2, desc);
|
|
15
|
+
}) : (function(o, m, k, k2) {
|
|
16
|
+
if (k2 === undefined) k2 = k;
|
|
17
|
+
o[k2] = m[k];
|
|
18
|
+
}));
|
|
19
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
20
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
|
+
};
|
|
22
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
+
__exportStar(require("./module"), exports);
|
|
24
|
+
__exportStar(require("./utils"), exports);
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorator/property-manager/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,0CAAwB"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { DecoratorConfig, DecoratorID, DecoratorProperties, DecoratorPropertiesConfig, DecoratorPropertyConfig } from '../index';
|
|
2
|
+
import type { NodeDecorator } from '../../utils';
|
|
3
|
+
export declare class DecoratorPropertyManager<T extends `${DecoratorID}`> {
|
|
4
|
+
protected extendedProperties: Partial<DecoratorPropertiesConfig<DecoratorProperties<T>>>;
|
|
5
|
+
protected representation: DecoratorConfig<T>;
|
|
6
|
+
decorators: NodeDecorator[];
|
|
7
|
+
constructor(representation: DecoratorConfig<T>, decorators: NodeDecorator[]);
|
|
8
|
+
get key(): T;
|
|
9
|
+
/**
|
|
10
|
+
* Get one or more specific value(s) of the decorator arguments or typeArguments.
|
|
11
|
+
*
|
|
12
|
+
* @param type
|
|
13
|
+
* @param decoratorOrIndex
|
|
14
|
+
*/
|
|
15
|
+
getPropertyValue<P extends keyof DecoratorProperties<T>>(type: P, decoratorOrIndex?: number | NodeDecorator): DecoratorProperties<T>[P] | undefined;
|
|
16
|
+
getPropertyConfiguration(type: keyof DecoratorProperties<T>): DecoratorPropertyConfig | undefined;
|
|
17
|
+
protected extendProperty<P extends keyof DecoratorProperties<T>>(type: P): DecoratorPropertyConfig;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=module.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../src/decorator/property-manager/module.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACR,eAAe,EACf,WAAW,EACX,mBAAmB,EACnB,yBAAyB,EACzB,uBAAuB,EAC1B,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAIjD,qBAAa,wBAAwB,CAAC,CAAC,SAAS,GAAG,WAAW,EAAE;IAC5D,SAAS,CAAC,kBAAkB,EAAE,OAAO,CAAC,yBAAyB,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAM;IAE9F,SAAS,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC;IAEtC,UAAU,EAAE,aAAa,EAAE,CAAC;gBAG/B,cAAc,EAAE,eAAe,CAAC,CAAC,CAAC,EAClC,UAAU,EAAE,aAAa,EAAE;IAM/B,IAAI,GAAG,IAAK,CAAC,CAEZ;IAID;;;;;OAKG;IACI,gBAAgB,CAAC,CAAC,SAAS,MAAM,mBAAmB,CAAC,CAAC,CAAC,EAC1D,IAAI,EAAE,CAAC,EACP,gBAAgB,CAAC,EAAE,MAAM,GAAG,aAAa,GAC1C,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS;IA2BjC,wBAAwB,CAAC,IAAI,EAAE,MAAM,mBAAmB,CAAC,CAAC,CAAC,GAAG,uBAAuB,GAAG,SAAS;IAUxG,SAAS,CAAC,cAAc,CAAC,CAAC,SAAS,MAAM,mBAAmB,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,uBAAuB;CAUrG"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2022.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.DecoratorPropertyManager = void 0;
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const utils_2 = require("./utils");
|
|
12
|
+
class DecoratorPropertyManager {
|
|
13
|
+
constructor(representation, decorators) {
|
|
14
|
+
this.extendedProperties = {};
|
|
15
|
+
this.representation = representation;
|
|
16
|
+
this.decorators = decorators;
|
|
17
|
+
}
|
|
18
|
+
get key() {
|
|
19
|
+
return this.representation.id;
|
|
20
|
+
}
|
|
21
|
+
// -------------------------------------------
|
|
22
|
+
/**
|
|
23
|
+
* Get one or more specific value(s) of the decorator arguments or typeArguments.
|
|
24
|
+
*
|
|
25
|
+
* @param type
|
|
26
|
+
* @param decoratorOrIndex
|
|
27
|
+
*/
|
|
28
|
+
getPropertyValue(type, decoratorOrIndex) {
|
|
29
|
+
const config = this.getPropertyConfiguration(type);
|
|
30
|
+
if (typeof config === 'undefined') {
|
|
31
|
+
return undefined;
|
|
32
|
+
}
|
|
33
|
+
let decorator;
|
|
34
|
+
if (typeof decoratorOrIndex === 'number' ||
|
|
35
|
+
typeof decoratorOrIndex === 'undefined') {
|
|
36
|
+
decoratorOrIndex = decoratorOrIndex ?? 0;
|
|
37
|
+
if (decoratorOrIndex < 0 || decoratorOrIndex >= this.decorators.length) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
decorator = this.decorators[decoratorOrIndex];
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
decorator = decoratorOrIndex;
|
|
44
|
+
}
|
|
45
|
+
return (0, utils_2.extractRepresentationPropertyValue)(decorator, config);
|
|
46
|
+
}
|
|
47
|
+
// -------------------------------------------
|
|
48
|
+
getPropertyConfiguration(type) {
|
|
49
|
+
if (!(0, utils_1.hasOwnProperty)(this.representation.properties, type)) {
|
|
50
|
+
return undefined;
|
|
51
|
+
}
|
|
52
|
+
return this.extendProperty(type);
|
|
53
|
+
}
|
|
54
|
+
// -------------------------------------------
|
|
55
|
+
extendProperty(type) {
|
|
56
|
+
if ((0, utils_1.hasOwnProperty)(this.extendedProperties, type)) {
|
|
57
|
+
return this.extendedProperties[type];
|
|
58
|
+
}
|
|
59
|
+
const property = this.representation.properties[type];
|
|
60
|
+
this.extendedProperties[type] = (0, utils_2.extendRepresentationPropertyConfig)(property);
|
|
61
|
+
return this.extendedProperties[type];
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.DecoratorPropertyManager = DecoratorPropertyManager;
|
|
65
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../../src/decorator/property-manager/module.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAUH,uCAA6C;AAC7C,mCAAiG;AAEjG,MAAa,wBAAwB;IAOjC,YACI,cAAkC,EAClC,UAA2B;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,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;SACxC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,GAAG,IAAA,0CAAkC,EAAC,QAAQ,CAAC,CAAC;QAE7E,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACJ;AA7ED,4DA6EC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DecoratorPropertyConfig } from '../type';
|
|
2
|
+
import type { NodeDecorator } from '../../utils';
|
|
3
|
+
export declare function extendRepresentationPropertyConfig(property: DecoratorPropertyConfig): DecoratorPropertyConfig;
|
|
4
|
+
export declare function extractRepresentationPropertyValue(decorator: NodeDecorator, config: DecoratorPropertyConfig): unknown | undefined;
|
|
5
|
+
export declare function mergeObjectArguments(data: unknown[]): Record<string, any>;
|
|
6
|
+
export declare function mergeArrayArguments(data: unknown[]): unknown[];
|
|
7
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/decorator/property-manager/utils.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EACR,uBAAuB,EAC1B,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjD,wBAAgB,kCAAkC,CAAC,QAAQ,EAAE,uBAAuB,GAAG,uBAAuB,CAqB7G;AAED,wBAAgB,kCAAkC,CAC9C,SAAS,EAAE,aAAa,EACxB,MAAM,EAAE,uBAAuB,GAChC,OAAO,GAAG,SAAS,CAiErB;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,OAAO,EAAE,uBAUnD;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,aAWlD"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright (c) 2021-2023.
|
|
4
|
+
* Author Peter Placzek (tada5hi)
|
|
5
|
+
* For the full copyright and license information,
|
|
6
|
+
* view the LICENSE file that was distributed with this source code.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.mergeArrayArguments = exports.mergeObjectArguments = exports.extractRepresentationPropertyValue = exports.extendRepresentationPropertyConfig = void 0;
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
function extendRepresentationPropertyConfig(property) {
|
|
12
|
+
if (typeof property.isType === 'undefined') {
|
|
13
|
+
property.isType = false;
|
|
14
|
+
}
|
|
15
|
+
if (typeof property.type === 'undefined') {
|
|
16
|
+
property.type = 'element';
|
|
17
|
+
}
|
|
18
|
+
if (typeof property.srcArgumentType === 'undefined') {
|
|
19
|
+
property.srcArgumentType = 'argument';
|
|
20
|
+
}
|
|
21
|
+
if (property.type === 'element' &&
|
|
22
|
+
typeof property.srcPosition === 'undefined') {
|
|
23
|
+
property.srcPosition = 0;
|
|
24
|
+
}
|
|
25
|
+
return property;
|
|
26
|
+
}
|
|
27
|
+
exports.extendRepresentationPropertyConfig = extendRepresentationPropertyConfig;
|
|
28
|
+
function extractRepresentationPropertyValue(decorator, config) {
|
|
29
|
+
let items = [];
|
|
30
|
+
switch (config.srcArgumentType) {
|
|
31
|
+
case 'typeArgument':
|
|
32
|
+
items = decorator.typeArguments;
|
|
33
|
+
break;
|
|
34
|
+
case 'argument':
|
|
35
|
+
items = decorator.arguments;
|
|
36
|
+
break;
|
|
37
|
+
}
|
|
38
|
+
if (!config.isType) {
|
|
39
|
+
items = extractValueFromArgumentType(items);
|
|
40
|
+
}
|
|
41
|
+
const srcPosition = config.srcPosition ?? 0;
|
|
42
|
+
const srcAmount = config.srcAmount ?? 1;
|
|
43
|
+
if (items.length <= srcPosition) {
|
|
44
|
+
switch (config.type) {
|
|
45
|
+
case 'element':
|
|
46
|
+
return undefined;
|
|
47
|
+
case 'array':
|
|
48
|
+
return [];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const data = srcAmount >= 1 ?
|
|
52
|
+
items.slice(srcPosition, srcPosition + srcAmount) :
|
|
53
|
+
items.slice(srcPosition);
|
|
54
|
+
if (data.length === 0) {
|
|
55
|
+
return (config.type === 'array' ? [] : undefined);
|
|
56
|
+
}
|
|
57
|
+
const srcStrategy = config.srcStrategy ?? 'none';
|
|
58
|
+
switch (srcStrategy) {
|
|
59
|
+
case 'merge':
|
|
60
|
+
switch (config.type) {
|
|
61
|
+
case 'array':
|
|
62
|
+
return mergeArrayArguments(data);
|
|
63
|
+
case 'element':
|
|
64
|
+
default:
|
|
65
|
+
return mergeObjectArguments(data);
|
|
66
|
+
}
|
|
67
|
+
case 'none':
|
|
68
|
+
// if we don't have any merge strategy, we just return the first argument.
|
|
69
|
+
switch (config.type) {
|
|
70
|
+
case 'array': {
|
|
71
|
+
const arr = Array.isArray(data[0]) ? data[0] : [data[0]];
|
|
72
|
+
return arr;
|
|
73
|
+
}
|
|
74
|
+
case 'element':
|
|
75
|
+
default:
|
|
76
|
+
return data[0];
|
|
77
|
+
}
|
|
78
|
+
default:
|
|
79
|
+
if (typeof config.srcStrategy === 'function') {
|
|
80
|
+
return config.srcStrategy(data);
|
|
81
|
+
}
|
|
82
|
+
return (config.type === 'array' ? [] : undefined);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.extractRepresentationPropertyValue = extractRepresentationPropertyValue;
|
|
86
|
+
function mergeObjectArguments(data) {
|
|
87
|
+
let output = {};
|
|
88
|
+
for (let i = 0; i < data.length; i++) {
|
|
89
|
+
const prototype = Object.prototype.toString.call(data[i]);
|
|
90
|
+
if (prototype === '[object Object]') {
|
|
91
|
+
output = Object.assign(output, data[i]);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return output;
|
|
95
|
+
}
|
|
96
|
+
exports.mergeObjectArguments = mergeObjectArguments;
|
|
97
|
+
function mergeArrayArguments(data) {
|
|
98
|
+
let merged = [];
|
|
99
|
+
for (let i = 0; i < data.length; i++) {
|
|
100
|
+
if (Array.isArray(data[i])) {
|
|
101
|
+
merged = [...merged, ...data[i]];
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
merged.push(data[i]);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
return merged;
|
|
108
|
+
}
|
|
109
|
+
exports.mergeArrayArguments = mergeArrayArguments;
|
|
110
|
+
function extractValueFromArgumentType(argument) {
|
|
111
|
+
const values = [];
|
|
112
|
+
for (let i = 0; i < argument.length; i++) {
|
|
113
|
+
if (!(0, utils_1.hasOwnProperty)(argument[i], 'kind')) {
|
|
114
|
+
values.push(argument[i]);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
values.push((0, utils_1.getInitializerValue)(argument[i]));
|
|
118
|
+
}
|
|
119
|
+
return values;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/decorator/property-manager/utils.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAKH,uCAAkE;AAMlE,SAAgB,kCAAkC,CAAC,QAAiC;IAChF,IAAI,OAAO,QAAQ,CAAC,MAAM,KAAK,WAAW,EAAE;QACxC,QAAQ,CAAC,MAAM,GAAG,KAAK,CAAC;KAC3B;IAED,IAAI,OAAO,QAAQ,CAAC,IAAI,KAAK,WAAW,EAAE;QACtC,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC;KAC7B;IAED,IAAI,OAAO,QAAQ,CAAC,eAAe,KAAK,WAAW,EAAE;QACjD,QAAQ,CAAC,eAAe,GAAG,UAAU,CAAC;KACzC;IAED,IACI,QAAQ,CAAC,IAAI,KAAK,SAAS;QAC3B,OAAO,QAAQ,CAAC,WAAW,KAAK,WAA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