@trapi/metadata 1.2.3 → 2.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +63 -16
- package/dist/index.d.mts +1718 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +3310 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +27 -15
- package/dist/cache/client.d.ts +0 -15
- package/dist/cache/client.d.ts.map +0 -1
- package/dist/cache/client.js +0 -98
- package/dist/cache/client.js.map +0 -1
- package/dist/cache/index.d.ts +0 -4
- package/dist/cache/index.d.ts.map +0 -1
- package/dist/cache/index.js +0 -26
- package/dist/cache/index.js.map +0 -1
- package/dist/cache/type.d.ts +0 -33
- package/dist/cache/type.d.ts.map +0 -1
- package/dist/cache/type.js +0 -9
- package/dist/cache/type.js.map +0 -1
- package/dist/cache/utils.d.ts +0 -4
- package/dist/cache/utils.d.ts.map +0 -1
- package/dist/cache/utils.js +0 -53
- package/dist/cache/utils.js.map +0 -1
- package/dist/config/index.d.ts +0 -2
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -24
- package/dist/config/index.js.map +0 -1
- package/dist/config/type.d.ts +0 -37
- package/dist/config/type.d.ts.map +0 -1
- package/dist/config/type.js +0 -9
- package/dist/config/type.js.map +0 -1
- package/dist/decorator/constants.d.ts +0 -41
- package/dist/decorator/constants.d.ts.map +0 -1
- package/dist/decorator/constants.js +0 -53
- package/dist/decorator/constants.js.map +0 -1
- package/dist/decorator/index.d.ts +0 -7
- package/dist/decorator/index.d.ts.map +0 -1
- package/dist/decorator/index.js +0 -29
- package/dist/decorator/index.js.map +0 -1
- package/dist/decorator/preset/index.d.ts +0 -3
- package/dist/decorator/preset/index.d.ts.map +0 -1
- package/dist/decorator/preset/index.js +0 -25
- package/dist/decorator/preset/index.js.map +0 -1
- package/dist/decorator/preset/type.d.ts +0 -6
- package/dist/decorator/preset/type.d.ts.map +0 -1
- package/dist/decorator/preset/type.js +0 -9
- package/dist/decorator/preset/type.js.map +0 -1
- package/dist/decorator/preset/utils/check.d.ts +0 -3
- package/dist/decorator/preset/utils/check.d.ts.map +0 -1
- package/dist/decorator/preset/utils/check.js +0 -18
- package/dist/decorator/preset/utils/check.js.map +0 -1
- package/dist/decorator/preset/utils/index.d.ts +0 -4
- package/dist/decorator/preset/utils/index.d.ts.map +0 -1
- package/dist/decorator/preset/utils/index.js +0 -26
- package/dist/decorator/preset/utils/index.js.map +0 -1
- package/dist/decorator/preset/utils/load.d.ts +0 -3
- package/dist/decorator/preset/utils/load.d.ts.map +0 -1
- package/dist/decorator/preset/utils/load.js +0 -51
- package/dist/decorator/preset/utils/load.js.map +0 -1
- package/dist/decorator/preset/utils/normalize.d.ts +0 -2
- package/dist/decorator/preset/utils/normalize.d.ts.map +0 -1
- package/dist/decorator/preset/utils/normalize.js +0 -27
- package/dist/decorator/preset/utils/normalize.js.map +0 -1
- package/dist/decorator/property-manager/index.d.ts +0 -3
- package/dist/decorator/property-manager/index.d.ts.map +0 -1
- package/dist/decorator/property-manager/index.js +0 -25
- package/dist/decorator/property-manager/index.js.map +0 -1
- package/dist/decorator/property-manager/module.d.ts +0 -17
- package/dist/decorator/property-manager/module.d.ts.map +0 -1
- package/dist/decorator/property-manager/module.js +0 -59
- package/dist/decorator/property-manager/module.js.map +0 -1
- package/dist/decorator/property-manager/utils.d.ts +0 -6
- package/dist/decorator/property-manager/utils.d.ts.map +0 -1
- package/dist/decorator/property-manager/utils.js +0 -92
- package/dist/decorator/property-manager/utils.js.map +0 -1
- package/dist/decorator/resolver/index.d.ts +0 -3
- package/dist/decorator/resolver/index.d.ts.map +0 -1
- package/dist/decorator/resolver/index.js +0 -25
- package/dist/decorator/resolver/index.js.map +0 -1
- package/dist/decorator/resolver/module.d.ts +0 -27
- package/dist/decorator/resolver/module.d.ts.map +0 -1
- package/dist/decorator/resolver/module.js +0 -72
- package/dist/decorator/resolver/module.js.map +0 -1
- package/dist/decorator/resolver/type.d.ts +0 -10
- package/dist/decorator/resolver/type.d.ts.map +0 -1
- package/dist/decorator/resolver/type.js +0 -3
- package/dist/decorator/resolver/type.js.map +0 -1
- package/dist/decorator/sets/class.d.ts +0 -7
- package/dist/decorator/sets/class.d.ts.map +0 -1
- package/dist/decorator/sets/class.js +0 -9
- package/dist/decorator/sets/class.js.map +0 -1
- package/dist/decorator/sets/index.d.ts +0 -8
- package/dist/decorator/sets/index.d.ts.map +0 -1
- package/dist/decorator/sets/index.js +0 -29
- package/dist/decorator/sets/index.js.map +0 -1
- package/dist/decorator/sets/method.d.ts +0 -14
- package/dist/decorator/sets/method.d.ts.map +0 -1
- package/dist/decorator/sets/method.js +0 -9
- package/dist/decorator/sets/method.js.map +0 -1
- package/dist/decorator/sets/mixed.d.ts +0 -12
- package/dist/decorator/sets/mixed.d.ts.map +0 -1
- package/dist/decorator/sets/mixed.js +0 -9
- package/dist/decorator/sets/mixed.js.map +0 -1
- package/dist/decorator/sets/parameter.d.ts +0 -21
- package/dist/decorator/sets/parameter.d.ts.map +0 -1
- package/dist/decorator/sets/parameter.js +0 -9
- package/dist/decorator/sets/parameter.js.map +0 -1
- package/dist/decorator/sets/request.d.ts +0 -6
- package/dist/decorator/sets/request.d.ts.map +0 -1
- package/dist/decorator/sets/request.js +0 -9
- package/dist/decorator/sets/request.js.map +0 -1
- package/dist/decorator/sets/response.d.ts +0 -17
- package/dist/decorator/sets/response.d.ts.map +0 -1
- package/dist/decorator/sets/response.js +0 -9
- package/dist/decorator/sets/response.js.map +0 -1
- package/dist/decorator/sets/type.d.ts +0 -4
- package/dist/decorator/sets/type.d.ts.map +0 -1
- package/dist/decorator/sets/type.js +0 -3
- package/dist/decorator/sets/type.js.map +0 -1
- package/dist/decorator/type.d.ts +0 -32
- package/dist/decorator/type.d.ts.map +0 -1
- package/dist/decorator/type.js +0 -9
- package/dist/decorator/type.js.map +0 -1
- package/dist/error/base.d.ts +0 -3
- package/dist/error/base.d.ts.map +0 -1
- package/dist/error/base.js +0 -13
- package/dist/error/base.js.map +0 -1
- package/dist/error/index.d.ts +0 -2
- package/dist/error/index.d.ts.map +0 -1
- package/dist/error/index.js +0 -24
- package/dist/error/index.js.map +0 -1
- package/dist/generator/abstract.d.ts +0 -19
- package/dist/generator/abstract.d.ts.map +0 -1
- package/dist/generator/abstract.js +0 -151
- package/dist/generator/abstract.js.map +0 -1
- package/dist/generator/controller/index.d.ts +0 -3
- package/dist/generator/controller/index.d.ts.map +0 -1
- package/dist/generator/controller/index.js +0 -25
- package/dist/generator/controller/index.js.map +0 -1
- package/dist/generator/controller/module.d.ts +0 -13
- package/dist/generator/controller/module.d.ts.map +0 -1
- package/dist/generator/controller/module.js +0 -68
- package/dist/generator/controller/module.js.map +0 -1
- package/dist/generator/controller/type.d.ts +0 -47
- package/dist/generator/controller/type.d.ts.map +0 -1
- package/dist/generator/controller/type.js +0 -3
- package/dist/generator/controller/type.js.map +0 -1
- package/dist/generator/index.d.ts +0 -7
- package/dist/generator/index.d.ts.map +0 -1
- package/dist/generator/index.js +0 -29
- package/dist/generator/index.js.map +0 -1
- package/dist/generator/metadata/index.d.ts +0 -4
- package/dist/generator/metadata/index.d.ts.map +0 -1
- package/dist/generator/metadata/index.js +0 -26
- package/dist/generator/metadata/index.js.map +0 -1
- package/dist/generator/metadata/module.d.ts +0 -39
- package/dist/generator/metadata/module.d.ts.map +0 -1
- package/dist/generator/metadata/module.js +0 -140
- package/dist/generator/metadata/module.js.map +0 -1
- package/dist/generator/metadata/type.d.ts +0 -25
- package/dist/generator/metadata/type.d.ts.map +0 -1
- package/dist/generator/metadata/type.js +0 -3
- package/dist/generator/metadata/type.js.map +0 -1
- package/dist/generator/metadata/utils.d.ts +0 -3
- package/dist/generator/metadata/utils.d.ts.map +0 -1
- package/dist/generator/metadata/utils.js +0 -19
- package/dist/generator/metadata/utils.js.map +0 -1
- package/dist/generator/method/constants.d.ts +0 -11
- package/dist/generator/method/constants.d.ts.map +0 -1
- package/dist/generator/method/constants.js +0 -21
- package/dist/generator/method/constants.js.map +0 -1
- package/dist/generator/method/index.d.ts +0 -4
- package/dist/generator/method/index.d.ts.map +0 -1
- package/dist/generator/method/index.js +0 -26
- package/dist/generator/method/index.js.map +0 -1
- package/dist/generator/method/module.d.ts +0 -19
- package/dist/generator/method/module.d.ts.map +0 -1
- package/dist/generator/method/module.js +0 -188
- package/dist/generator/method/module.js.map +0 -1
- package/dist/generator/method/type.d.ts +0 -23
- package/dist/generator/method/type.d.ts.map +0 -1
- package/dist/generator/method/type.js +0 -9
- package/dist/generator/method/type.js.map +0 -1
- package/dist/generator/parameter/constants.d.ts +0 -19
- package/dist/generator/parameter/constants.d.ts.map +0 -1
- package/dist/generator/parameter/constants.js +0 -30
- package/dist/generator/parameter/constants.js.map +0 -1
- package/dist/generator/parameter/error.d.ts +0 -35
- package/dist/generator/parameter/error.d.ts.map +0 -1
- package/dist/generator/parameter/error.js +0 -68
- package/dist/generator/parameter/error.js.map +0 -1
- package/dist/generator/parameter/index.d.ts +0 -5
- package/dist/generator/parameter/index.d.ts.map +0 -1
- package/dist/generator/parameter/index.js +0 -27
- package/dist/generator/parameter/index.js.map +0 -1
- package/dist/generator/parameter/module.d.ts +0 -29
- package/dist/generator/parameter/module.d.ts.map +0 -1
- package/dist/generator/parameter/module.js +0 -556
- package/dist/generator/parameter/module.js.map +0 -1
- package/dist/generator/parameter/type.d.ts +0 -25
- package/dist/generator/parameter/type.d.ts.map +0 -1
- package/dist/generator/parameter/type.js +0 -9
- package/dist/generator/parameter/type.js.map +0 -1
- package/dist/generator/type.d.ts +0 -20
- package/dist/generator/type.d.ts.map +0 -1
- package/dist/generator/type.js +0 -9
- package/dist/generator/type.js.map +0 -1
- package/dist/index.d.ts +0 -10
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -32
- package/dist/index.js.map +0 -1
- package/dist/module.d.ts +0 -5
- package/dist/module.d.ts.map +0 -1
- package/dist/module.js +0 -41
- package/dist/module.js.map +0 -1
- package/dist/resolver/constants.d.ts +0 -36
- package/dist/resolver/constants.d.ts.map +0 -1
- package/dist/resolver/constants.js +0 -47
- package/dist/resolver/constants.js.map +0 -1
- package/dist/resolver/error.d.ts +0 -8
- package/dist/resolver/error.d.ts.map +0 -1
- package/dist/resolver/error.js +0 -41
- package/dist/resolver/error.js.map +0 -1
- package/dist/resolver/extension/index.d.ts +0 -3
- package/dist/resolver/extension/index.d.ts.map +0 -1
- package/dist/resolver/extension/index.js +0 -25
- package/dist/resolver/extension/index.js.map +0 -1
- package/dist/resolver/extension/module.d.ts +0 -5
- package/dist/resolver/extension/module.d.ts.map +0 -1
- package/dist/resolver/extension/module.js +0 -27
- package/dist/resolver/extension/module.js.map +0 -1
- package/dist/resolver/extension/type.d.ts +0 -8
- package/dist/resolver/extension/type.d.ts.map +0 -1
- package/dist/resolver/extension/type.js +0 -9
- package/dist/resolver/extension/type.js.map +0 -1
- package/dist/resolver/index.d.ts +0 -6
- package/dist/resolver/index.d.ts.map +0 -1
- package/dist/resolver/index.js +0 -28
- package/dist/resolver/index.js.map +0 -1
- package/dist/resolver/module.d.ts +0 -57
- package/dist/resolver/module.d.ts.map +0 -1
- package/dist/resolver/module.js +0 -1109
- package/dist/resolver/module.js.map +0 -1
- package/dist/resolver/type.d.ts +0 -139
- package/dist/resolver/type.d.ts.map +0 -1
- package/dist/resolver/type.js +0 -130
- package/dist/resolver/type.js.map +0 -1
- package/dist/type.d.ts +0 -2
- package/dist/type.d.ts.map +0 -1
- package/dist/type.js +0 -9
- package/dist/type.js.map +0 -1
- package/dist/utils/array.d.ts +0 -2
- package/dist/utils/array.d.ts.map +0 -1
- package/dist/utils/array.js +0 -22
- package/dist/utils/array.js.map +0 -1
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/index.js +0 -32
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/initializer.d.ts +0 -5
- package/dist/utils/initializer.d.ts.map +0 -1
- package/dist/utils/initializer.js +0 -131
- package/dist/utils/initializer.js.map +0 -1
- package/dist/utils/js-doc/constants.d.ts +0 -19
- package/dist/utils/js-doc/constants.d.ts.map +0 -1
- package/dist/utils/js-doc/constants.js +0 -30
- package/dist/utils/js-doc/constants.js.map +0 -1
- package/dist/utils/js-doc/index.d.ts +0 -4
- package/dist/utils/js-doc/index.d.ts.map +0 -1
- package/dist/utils/js-doc/index.js +0 -26
- package/dist/utils/js-doc/index.js.map +0 -1
- package/dist/utils/js-doc/module.d.ts +0 -9
- package/dist/utils/js-doc/module.d.ts.map +0 -1
- package/dist/utils/js-doc/module.js +0 -98
- package/dist/utils/js-doc/module.js.map +0 -1
- package/dist/utils/js-doc/utils.d.ts +0 -3
- package/dist/utils/js-doc/utils.d.ts.map +0 -1
- package/dist/utils/js-doc/utils.js +0 -29
- package/dist/utils/js-doc/utils.js.map +0 -1
- package/dist/utils/node/index.d.ts +0 -3
- package/dist/utils/node/index.d.ts.map +0 -1
- package/dist/utils/node/index.js +0 -25
- package/dist/utils/node/index.js.map +0 -1
- package/dist/utils/node/module.d.ts +0 -10
- package/dist/utils/node/module.d.ts.map +0 -1
- package/dist/utils/node/module.js +0 -52
- package/dist/utils/node/module.js.map +0 -1
- package/dist/utils/node/type.d.ts +0 -6
- package/dist/utils/node/type.d.ts.map +0 -1
- package/dist/utils/node/type.js +0 -9
- package/dist/utils/node/type.js.map +0 -1
- package/dist/utils/object.d.ts +0 -2
- package/dist/utils/object.d.ts.map +0 -1
- package/dist/utils/object.js +0 -15
- package/dist/utils/object.js.map +0 -1
- package/dist/utils/path-normalize.d.ts +0 -2
- package/dist/utils/path-normalize.d.ts.map +0 -1
- package/dist/utils/path-normalize.js +0 -17
- package/dist/utils/path-normalize.js.map +0 -1
- package/dist/utils/source-files.d.ts +0 -3
- package/dist/utils/source-files.d.ts.map +0 -1
- package/dist/utils/source-files.js +0 -32
- package/dist/utils/source-files.js.map +0 -1
- package/dist/utils/tsconfig/index.d.ts +0 -3
- package/dist/utils/tsconfig/index.d.ts.map +0 -1
- package/dist/utils/tsconfig/index.js +0 -25
- package/dist/utils/tsconfig/index.js.map +0 -1
- package/dist/utils/tsconfig/module.d.ts +0 -4
- package/dist/utils/tsconfig/module.d.ts.map +0 -1
- package/dist/utils/tsconfig/module.js +0 -54
- package/dist/utils/tsconfig/module.js.map +0 -1
- package/dist/utils/tsconfig/type.d.ts +0 -11
- package/dist/utils/tsconfig/type.d.ts.map +0 -1
- package/dist/utils/tsconfig/type.js +0 -9
- package/dist/utils/tsconfig/type.js.map +0 -1
- package/dist/utils/validator/constants.d.ts +0 -13
- package/dist/utils/validator/constants.d.ts.map +0 -1
- package/dist/utils/validator/constants.js +0 -23
- package/dist/utils/validator/constants.js.map +0 -1
- package/dist/utils/validator/index.d.ts +0 -4
- package/dist/utils/validator/index.d.ts.map +0 -1
- package/dist/utils/validator/index.js +0 -26
- package/dist/utils/validator/index.js.map +0 -1
- package/dist/utils/validator/module.d.ts +0 -4
- package/dist/utils/validator/module.d.ts.map +0 -1
- package/dist/utils/validator/module.js +0 -142
- package/dist/utils/validator/module.js.map +0 -1
- package/dist/utils/validator/type.d.ts +0 -6
- package/dist/utils/validator/type.d.ts.map +0 -1
- package/dist/utils/validator/type.js +0 -9
- package/dist/utils/validator/type.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trapi/metadata",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-beta.0",
|
|
4
4
|
"description": "Generate REST-API metadata scheme from TypeScript Decorators.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.mts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.mts",
|
|
12
|
+
"import": "./dist/index.mjs"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
7
15
|
"files": [
|
|
8
|
-
"dist
|
|
16
|
+
"dist"
|
|
9
17
|
],
|
|
10
18
|
"scripts": {
|
|
11
|
-
"
|
|
12
|
-
"build": "
|
|
13
|
-
"
|
|
14
|
-
"test": "
|
|
15
|
-
"test:coverage": "
|
|
16
|
-
"preblushOnly": "npm run build"
|
|
17
|
-
"generate": "node ./bin/generate.js"
|
|
19
|
+
"build": "npm run build:js && npm run build:types",
|
|
20
|
+
"build:js": "tsdown",
|
|
21
|
+
"build:types": "tsc -p tsconfig.build.json",
|
|
22
|
+
"test": "vitest --config ./test/vitest.config.ts --run",
|
|
23
|
+
"test:coverage": "vitest --config ./test/vitest.config.ts --run --coverage",
|
|
24
|
+
"preblushOnly": "npm run build"
|
|
18
25
|
},
|
|
19
26
|
"keywords": [
|
|
20
27
|
"typescript",
|
|
@@ -42,14 +49,19 @@
|
|
|
42
49
|
},
|
|
43
50
|
"homepage": "https://github.com/Tada5hi/trapi#readme",
|
|
44
51
|
"devDependencies": {
|
|
45
|
-
"jsonata": "^2.0.
|
|
52
|
+
"jsonata": "^2.0.6"
|
|
46
53
|
},
|
|
47
54
|
"dependencies": {
|
|
48
|
-
"
|
|
49
|
-
"
|
|
55
|
+
"@ebec/core": "^1.0.1",
|
|
56
|
+
"@validup/adapter-zod": "^0.2.4",
|
|
57
|
+
"flatted": "^3.3.3",
|
|
58
|
+
"locter": "^2.1.6",
|
|
59
|
+
"minimatch": "^10.0.3",
|
|
60
|
+
"validup": "^0.2.2",
|
|
61
|
+
"zod": "^4.3.6"
|
|
50
62
|
},
|
|
51
63
|
"peerDependencies": {
|
|
52
|
-
"typescript": "
|
|
64
|
+
"typescript": ">=5.0.0"
|
|
53
65
|
},
|
|
54
66
|
"publishConfig": {
|
|
55
67
|
"access": "public"
|
package/dist/cache/client.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { CacheData, CacheOptionsInput } from './type';
|
|
2
|
-
export declare class CacheClient {
|
|
3
|
-
private readonly options;
|
|
4
|
-
constructor(input?: string | boolean | CacheOptionsInput);
|
|
5
|
-
save(data: CacheData): Promise<string | undefined>;
|
|
6
|
-
get(sourceFilesSize: number): Promise<CacheData | undefined>;
|
|
7
|
-
/**
|
|
8
|
-
* At a 10% chance, clear all cache files :)
|
|
9
|
-
*/
|
|
10
|
-
clear(): Promise<void>;
|
|
11
|
-
private buildFilePath;
|
|
12
|
-
private buildFileName;
|
|
13
|
-
protected serialize(input: unknown): string;
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/cache/client.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,SAAS,EAAgB,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAEzE,qBAAa,WAAW;IACpB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAe;gBAE3B,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,iBAAiB;IAMlD,IAAI,CAAC,IAAI,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAYlD,GAAG,CAAC,eAAe,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IA4BlE;;OAEG;IAGG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAwB5B,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,aAAa;IAOrB,SAAS,CAAC,SAAS,CAAC,KAAK,EAAE,OAAO,GAAI,MAAM;CAiB/C"}
|
package/dist/cache/client.js
DELETED
|
@@ -1,98 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.CacheClient = void 0;
|
|
13
|
-
const locter_1 = require("locter");
|
|
14
|
-
const node_fs_1 = __importDefault(require("node:fs"));
|
|
15
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
16
|
-
const utils_1 = require("./utils");
|
|
17
|
-
class CacheClient {
|
|
18
|
-
constructor(input) {
|
|
19
|
-
this.options = (0, utils_1.buildCacheOptions)(input);
|
|
20
|
-
}
|
|
21
|
-
// -------------------------------------------------------------------------
|
|
22
|
-
async save(data) {
|
|
23
|
-
if (!this.options.enabled) {
|
|
24
|
-
return undefined;
|
|
25
|
-
}
|
|
26
|
-
const filePath = this.buildFilePath(undefined, data.sourceFilesSize);
|
|
27
|
-
await node_fs_1.default.promises.writeFile(filePath, this.serialize(data));
|
|
28
|
-
return filePath;
|
|
29
|
-
}
|
|
30
|
-
async get(sourceFilesSize) {
|
|
31
|
-
if (!this.options.enabled) {
|
|
32
|
-
return undefined;
|
|
33
|
-
}
|
|
34
|
-
await this.clear();
|
|
35
|
-
const filePath = this.buildFilePath(undefined, sourceFilesSize);
|
|
36
|
-
try {
|
|
37
|
-
const content = await node_fs_1.default.promises.readFile(filePath, { encoding: 'utf-8' });
|
|
38
|
-
// todo: maybe add shape validation here :)
|
|
39
|
-
const cache = JSON.parse(content);
|
|
40
|
-
if (!cache || cache.sourceFilesSize !== sourceFilesSize) {
|
|
41
|
-
return undefined;
|
|
42
|
-
}
|
|
43
|
-
return cache;
|
|
44
|
-
}
|
|
45
|
-
catch (e) {
|
|
46
|
-
/* istanbul ignore next */
|
|
47
|
-
return undefined;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
// -------------------------------------------------------------------------
|
|
51
|
-
/**
|
|
52
|
-
* At a 10% chance, clear all cache files :)
|
|
53
|
-
*/
|
|
54
|
-
/* istanbul ignore next */
|
|
55
|
-
async clear() {
|
|
56
|
-
if (!this.options.enabled || !this.options.clearAtRandom) {
|
|
57
|
-
return;
|
|
58
|
-
}
|
|
59
|
-
const rand = Math.floor(Math.random() * 100) + 1;
|
|
60
|
-
if (rand > 10) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
const files = await (0, locter_1.locateMany)(this.buildFileName('**'), {
|
|
64
|
-
path: this.options.directoryPath,
|
|
65
|
-
});
|
|
66
|
-
const unlinkPromises = [];
|
|
67
|
-
for (let i = 0; i < files.length; i++) {
|
|
68
|
-
unlinkPromises.push(node_fs_1.default.promises.unlink((0, locter_1.buildFilePath)(files[i])));
|
|
69
|
-
}
|
|
70
|
-
await Promise.all(unlinkPromises);
|
|
71
|
-
}
|
|
72
|
-
// -------------------------------------------------------------------------
|
|
73
|
-
buildFilePath(hash, sourceFilesSize) {
|
|
74
|
-
return node_path_1.default.join(this.options.directoryPath, this.buildFileName(hash, sourceFilesSize));
|
|
75
|
-
}
|
|
76
|
-
buildFileName(hash, sourceFilesSize) {
|
|
77
|
-
if (typeof this.options.fileName === 'string') {
|
|
78
|
-
return this.options.fileName;
|
|
79
|
-
}
|
|
80
|
-
return `.swagger-${hash ?? (0, utils_1.generateFileHash)(sourceFilesSize)}.json`;
|
|
81
|
-
}
|
|
82
|
-
serialize(input) {
|
|
83
|
-
let cache = [];
|
|
84
|
-
const str = JSON.stringify(input, (key, value) => {
|
|
85
|
-
if ((0, locter_1.isObject)(value) || Array.isArray(value)) {
|
|
86
|
-
if (cache.indexOf(value) !== -1) {
|
|
87
|
-
return undefined;
|
|
88
|
-
}
|
|
89
|
-
cache.push(value);
|
|
90
|
-
}
|
|
91
|
-
return value;
|
|
92
|
-
});
|
|
93
|
-
cache = undefined;
|
|
94
|
-
return str;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
exports.CacheClient = CacheClient;
|
|
98
|
-
//# sourceMappingURL=client.js.map
|
package/dist/cache/client.js.map
DELETED
|
@@ -1 +0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C;IAEO,aAAa,CAAC,IAAa,EAAE,eAAwB;QACzD,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QACjC,CAAC;QACD,OAAO,YAAY,IAAI,IAAI,IAAA,wBAAgB,EAAC,eAAe,CAAC,OAAO,CAAC;IACxE,CAAC;IAES,SAAS,CAAC,KAAc;QAC9B,IAAI,KAAK,GAAG,EAAE,CAAC;QACf,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;YAC7C,IAAI,IAAA,iBAAQ,EAAC,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC;oBAC9B,OAAO,SAAS,CAAC;gBACrB,CAAC;gBAED,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACtB,CAAC;YAED,OAAO,KAAK,CAAC;QACjB,CAAC,CAAC,CAAC;QAEH,KAAK,GAAG,SAAS,CAAC;QAClB,OAAO,GAAG,CAAC;IACf,CAAC;CACJ;AA1GD,kCA0GC"}
|
package/dist/cache/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":"AAOA,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
package/dist/cache/index.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
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("./client"), exports);
|
|
24
|
-
__exportStar(require("./type"), exports);
|
|
25
|
-
__exportStar(require("./utils"), exports);
|
|
26
|
-
//# sourceMappingURL=index.js.map
|
package/dist/cache/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cache/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,2CAAyB;AACzB,yCAAuB;AACvB,0CAAwB"}
|
package/dist/cache/type.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import type { Metadata } from '../generator';
|
|
2
|
-
export interface CacheOptions {
|
|
3
|
-
/**
|
|
4
|
-
* Specify if the cache driver should be enabled.
|
|
5
|
-
*
|
|
6
|
-
* Default: false
|
|
7
|
-
* */
|
|
8
|
-
enabled: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Directory relative or absolute path.
|
|
11
|
-
*
|
|
12
|
-
* Default: tmpDir()
|
|
13
|
-
*/
|
|
14
|
-
directoryPath: string;
|
|
15
|
-
/**
|
|
16
|
-
* Specify the cache file name.
|
|
17
|
-
*
|
|
18
|
-
* Default: metadata-{hash}.json
|
|
19
|
-
*/
|
|
20
|
-
fileName?: string;
|
|
21
|
-
/**
|
|
22
|
-
* The cache file(s) will be cleared at a 10% percent change
|
|
23
|
-
* each time.
|
|
24
|
-
*
|
|
25
|
-
* Default: true
|
|
26
|
-
*/
|
|
27
|
-
clearAtRandom: boolean;
|
|
28
|
-
}
|
|
29
|
-
export type CacheOptionsInput = Partial<CacheOptions>;
|
|
30
|
-
export type CacheData = {
|
|
31
|
-
sourceFilesSize: number;
|
|
32
|
-
} & Metadata;
|
|
33
|
-
//# sourceMappingURL=type.d.ts.map
|
package/dist/cache/type.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/cache/type.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,MAAM,WAAW,YAAY;IACzB;;;;SAIK;IACL,OAAO,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,aAAa,EAAE,MAAM,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;;;OAKG;IACH,aAAa,EAAE,OAAO,CAAA;CACzB;AAED,MAAM,MAAM,iBAAiB,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;AAEtD,MAAM,MAAM,SAAS,GAAG;IACpB,eAAe,EAAE,MAAM,CAAC;CAC3B,GAAG,QAAQ,CAAC"}
|
package/dist/cache/type.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
//# sourceMappingURL=type.js.map
|
package/dist/cache/type.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/cache/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
package/dist/cache/utils.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { CacheOptions, CacheOptionsInput } from './type';
|
|
2
|
-
export declare function buildCacheOptions(input?: string | boolean | CacheOptionsInput): CacheOptions;
|
|
3
|
-
export declare function generateFileHash(sourceFilesSize?: number): string;
|
|
4
|
-
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/cache/utils.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE9D,wBAAgB,iBAAiB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,iBAAiB,GAAI,YAAY,CAgC7F;AAED,wBAAgB,gBAAgB,CAAC,eAAe,CAAC,EAAE,MAAM,GAAG,MAAM,CAQjE"}
|
package/dist/cache/utils.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
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 __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.generateFileHash = exports.buildCacheOptions = void 0;
|
|
13
|
-
const node_os_1 = require("node:os");
|
|
14
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
15
|
-
const node_crypto_1 = __importDefault(require("node:crypto"));
|
|
16
|
-
const node_process_1 = __importDefault(require("node:process"));
|
|
17
|
-
function buildCacheOptions(input) {
|
|
18
|
-
if (typeof input === 'string') {
|
|
19
|
-
input = {
|
|
20
|
-
enabled: true,
|
|
21
|
-
directoryPath: input,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
if (typeof input === 'boolean') {
|
|
25
|
-
input = {
|
|
26
|
-
enabled: input,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
input = input || {};
|
|
30
|
-
/* istanbul ignore next */
|
|
31
|
-
const isTestEnvironment = !!node_process_1.default.env.NODE_ENV && node_process_1.default.env.NODE_ENV === 'test';
|
|
32
|
-
let directoryPath = (0, node_os_1.tmpdir)();
|
|
33
|
-
if (typeof input.directoryPath === 'string') {
|
|
34
|
-
directoryPath = node_path_1.default.isAbsolute(input.directoryPath) ?
|
|
35
|
-
input.directoryPath :
|
|
36
|
-
node_path_1.default.join(node_process_1.default.cwd(), input.directoryPath);
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
fileName: input.fileName,
|
|
40
|
-
directoryPath,
|
|
41
|
-
enabled: input.enabled ?? true,
|
|
42
|
-
clearAtRandom: input.clearAtRandom ?? !isTestEnvironment,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
exports.buildCacheOptions = buildCacheOptions;
|
|
46
|
-
function generateFileHash(sourceFilesSize) {
|
|
47
|
-
const hash = node_crypto_1.default.createHash('sha256');
|
|
48
|
-
const strSize = (sourceFilesSize ?? 0).toString();
|
|
49
|
-
hash.update(strSize);
|
|
50
|
-
return hash.digest('hex');
|
|
51
|
-
}
|
|
52
|
-
exports.generateFileHash = generateFileHash;
|
|
53
|
-
//# sourceMappingURL=utils.js.map
|
package/dist/cache/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
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AU,CAAC,QAAQ,CAAC,CAAC;IAEzC,MAAM,OAAO,GAAW,CAAC,eAAe,IAAI,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;IAE1D,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAErB,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AARD,4CAQC"}
|
package/dist/config/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC"}
|
package/dist/config/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
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("./type"), exports);
|
|
24
|
-
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,yCAAuB"}
|
package/dist/config/type.d.ts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { CacheOptions } from '../cache';
|
|
2
|
-
import type { DecoratorConfig } from '../decorator';
|
|
3
|
-
export type EntryPointOptions = {
|
|
4
|
-
cwd: string;
|
|
5
|
-
pattern: string;
|
|
6
|
-
};
|
|
7
|
-
export type EntryPoint = string | string[] | EntryPointOptions | EntryPointOptions[];
|
|
8
|
-
export interface Options {
|
|
9
|
-
/**
|
|
10
|
-
* The entry point to your API.
|
|
11
|
-
*/
|
|
12
|
-
entryPoint: EntryPoint;
|
|
13
|
-
/**
|
|
14
|
-
* Directory to ignore during TypeScript files scan.
|
|
15
|
-
* Default: []
|
|
16
|
-
*/
|
|
17
|
-
ignore?: string[];
|
|
18
|
-
/**
|
|
19
|
-
* Directory to allow during TypeScript files scan.
|
|
20
|
-
* Default: []
|
|
21
|
-
*/
|
|
22
|
-
allow?: string[];
|
|
23
|
-
/**
|
|
24
|
-
* Directory to store and cache metadata cache files.
|
|
25
|
-
* Default: false
|
|
26
|
-
*/
|
|
27
|
-
cache?: string | boolean | Partial<CacheOptions>;
|
|
28
|
-
/**
|
|
29
|
-
* Manual decorator properties configuration.
|
|
30
|
-
*/
|
|
31
|
-
decorators?: DecoratorConfig[];
|
|
32
|
-
/**
|
|
33
|
-
* Load a specific preset configuration.
|
|
34
|
-
*/
|
|
35
|
-
preset?: string;
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=type.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../src/config/type.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,MAAM,MAAM,iBAAiB,GAAG;IAC5B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAA;CAClB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,iBAAiB,GAAG,iBAAiB,EAAE,CAAC;AAErF,MAAM,WAAW,OAAO;IACpB;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IAEvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;IAEjD;;OAEG;IACH,UAAU,CAAC,EAAE,eAAe,EAAE,CAAC;IAE/B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB"}
|
package/dist/config/type.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
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
|
package/dist/config/type.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"type.js","sourceRoot":"","sources":["../../src/config/type.ts"],"names":[],"mappings":";AAAA;;;;;GAKG"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
export declare enum DecoratorID {
|
|
2
|
-
CONTROLLER = "controller",
|
|
3
|
-
DESCRIPTION = "description",
|
|
4
|
-
EXAMPLE = "example",
|
|
5
|
-
PRODUCES = "produces",
|
|
6
|
-
ACCEPT = "accept",
|
|
7
|
-
CONSUMES = "consumes",
|
|
8
|
-
DEPRECATED = "deprecated",
|
|
9
|
-
EXTENSION = "extension",
|
|
10
|
-
HIDDEN = "hidden",
|
|
11
|
-
SECURITY = "security",
|
|
12
|
-
TAGS = "tags",
|
|
13
|
-
MOUNT = "mount",
|
|
14
|
-
ALL = "all",
|
|
15
|
-
GET = "get",
|
|
16
|
-
POST = "post",
|
|
17
|
-
PUT = "put",
|
|
18
|
-
DELETE = "delete",
|
|
19
|
-
PATCH = "patch",
|
|
20
|
-
OPTIONS = "options",
|
|
21
|
-
HEAD = "head",
|
|
22
|
-
IS_INT = "isInt",
|
|
23
|
-
IS_LONG = "isLong",
|
|
24
|
-
IS_FLOAT = "isFloat",
|
|
25
|
-
IS_DOUBLE = "isDouble",
|
|
26
|
-
CONTEXT = "context",
|
|
27
|
-
PARAM = "param",
|
|
28
|
-
PARAMS = "params",
|
|
29
|
-
QUERY = "query",
|
|
30
|
-
FORM = "form",
|
|
31
|
-
BODY = "body",
|
|
32
|
-
HEADER = "header",
|
|
33
|
-
HEADERS = "headers",
|
|
34
|
-
COOKIE = "cookie",
|
|
35
|
-
COOKIES = "cookies",
|
|
36
|
-
PATH = "path",
|
|
37
|
-
PATHS = "paths",
|
|
38
|
-
FILE = "file",
|
|
39
|
-
FILES = "files"
|
|
40
|
-
}
|
|
41
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/decorator/constants.ts"],"names":[],"mappings":"AAOA,oBAAY,WAAW;IACnB,UAAU,eAAe;IAEzB,WAAW,gBAAgB;IAC3B,OAAO,YAAY;IACnB,QAAQ,aAAa;IAErB,MAAM,WAAW;IACjB,QAAQ,aAAa;IAErB,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,IAAI,SAAS;IAEb,KAAK,UAAU;IAEf,GAAG,QAAQ;IACX,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,IAAI,SAAS;IAGb,MAAM,UAAU;IAChB,OAAO,WAAW;IAClB,QAAQ,YAAY;IACpB,SAAS,aAAa;IAGtB,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;IACb,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;IACb,KAAK,UAAU;CAClB"}
|
|
@@ -1,53 +0,0 @@
|
|
|
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["CONTROLLER"] = "controller";
|
|
13
|
-
DecoratorID["DESCRIPTION"] = "description";
|
|
14
|
-
DecoratorID["EXAMPLE"] = "example";
|
|
15
|
-
DecoratorID["PRODUCES"] = "produces";
|
|
16
|
-
DecoratorID["ACCEPT"] = "accept";
|
|
17
|
-
DecoratorID["CONSUMES"] = "consumes";
|
|
18
|
-
DecoratorID["DEPRECATED"] = "deprecated";
|
|
19
|
-
DecoratorID["EXTENSION"] = "extension";
|
|
20
|
-
DecoratorID["HIDDEN"] = "hidden";
|
|
21
|
-
DecoratorID["SECURITY"] = "security";
|
|
22
|
-
DecoratorID["TAGS"] = "tags";
|
|
23
|
-
DecoratorID["MOUNT"] = "mount";
|
|
24
|
-
DecoratorID["ALL"] = "all";
|
|
25
|
-
DecoratorID["GET"] = "get";
|
|
26
|
-
DecoratorID["POST"] = "post";
|
|
27
|
-
DecoratorID["PUT"] = "put";
|
|
28
|
-
DecoratorID["DELETE"] = "delete";
|
|
29
|
-
DecoratorID["PATCH"] = "patch";
|
|
30
|
-
DecoratorID["OPTIONS"] = "options";
|
|
31
|
-
DecoratorID["HEAD"] = "head";
|
|
32
|
-
// Parameter
|
|
33
|
-
DecoratorID["IS_INT"] = "isInt";
|
|
34
|
-
DecoratorID["IS_LONG"] = "isLong";
|
|
35
|
-
DecoratorID["IS_FLOAT"] = "isFloat";
|
|
36
|
-
DecoratorID["IS_DOUBLE"] = "isDouble";
|
|
37
|
-
// Parameter Server
|
|
38
|
-
DecoratorID["CONTEXT"] = "context";
|
|
39
|
-
DecoratorID["PARAM"] = "param";
|
|
40
|
-
DecoratorID["PARAMS"] = "params";
|
|
41
|
-
DecoratorID["QUERY"] = "query";
|
|
42
|
-
DecoratorID["FORM"] = "form";
|
|
43
|
-
DecoratorID["BODY"] = "body";
|
|
44
|
-
DecoratorID["HEADER"] = "header";
|
|
45
|
-
DecoratorID["HEADERS"] = "headers";
|
|
46
|
-
DecoratorID["COOKIE"] = "cookie";
|
|
47
|
-
DecoratorID["COOKIES"] = "cookies";
|
|
48
|
-
DecoratorID["PATH"] = "path";
|
|
49
|
-
DecoratorID["PATHS"] = "paths";
|
|
50
|
-
DecoratorID["FILE"] = "file";
|
|
51
|
-
DecoratorID["FILES"] = "files";
|
|
52
|
-
})(DecoratorID || (exports.DecoratorID = DecoratorID = {}));
|
|
53
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/decorator/constants.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH,IAAY,WAgDX;AAhDD,WAAY,WAAW;IACnB,wCAAyB,CAAA;IAEzB,0CAA2B,CAAA;IAC3B,kCAAmB,CAAA;IACnB,oCAAqB,CAAA;IAErB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IAErB,wCAAyB,CAAA;IACzB,sCAAuB,CAAA;IACvB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,4BAAa,CAAA;IAEb,8BAAe,CAAA;IAEf,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,4BAAa,CAAA;IACb,8BAAe,CAAA;IACf,4BAAa,CAAA;IACb,8BAAe,CAAA;AACnB,CAAC,EAhDW,WAAW,2BAAX,WAAW,QAgDtB"}
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
package/dist/decorator/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorator/preset/index.ts"],"names":[],"mappings":"AAOA,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC"}
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/decorator/preset/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;;;;;;;;;;;AAEH,yCAAuB;AACvB,0CAAwB"}
|