@zenofolio/hyper-decor 1.0.7 → 1.0.8
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/.agent/rules/philosophy.md +103 -0
- package/.agent/rules/writing.md +32 -0
- package/README.md +103 -201
- package/dist/__internals/constants.d.ts +1 -62
- package/dist/__internals/constants.js +3 -69
- package/dist/__internals/helpers/merge-metadata.d.ts +2 -3
- package/dist/__internals/helpers/merge-metadata.js +31 -7
- package/dist/__internals/helpers/prepare.helper.d.ts +4 -10
- package/dist/__internals/helpers/prepare.helper.js +325 -281
- package/dist/__internals/stores/hyper.store.d.ts +5 -0
- package/dist/__internals/stores/hyper.store.js +5 -0
- package/dist/__internals/stores/index.d.ts +4 -0
- package/dist/{lib/openapi/helpers → __internals/stores}/index.js +4 -7
- package/dist/__internals/stores/meta.store.d.ts +34 -0
- package/dist/__internals/stores/meta.store.js +107 -0
- package/dist/{stores → __internals/stores}/scope.store.d.ts +1 -1
- package/dist/__internals/transform/middleware.transform.d.ts +1 -1
- package/dist/__internals/transform/middleware.transform.js +1 -1
- package/dist/__internals/transform/role.transform.d.ts +1 -1
- package/dist/__internals/transform/role.transform.js +4 -4
- package/dist/__internals/transform/scope.transfrom.d.ts +1 -1
- package/dist/__internals/transform/scope.transfrom.js +2 -2
- package/dist/__internals/types.d.ts +53 -4
- package/dist/common/bootstrap.d.ts +6 -2
- package/dist/common/bootstrap.js +49 -10
- package/dist/common/testing.d.ts +56 -0
- package/dist/common/testing.js +193 -0
- package/dist/common/transport.d.ts +1 -0
- package/dist/common/transport.js +27 -14
- package/dist/constants.d.ts +1 -0
- package/dist/constants.js +2 -1
- package/dist/decorators.d.ts +1 -0
- package/dist/{stores/index.js → decorators.js} +1 -1
- package/dist/index.d.ts +7 -5
- package/dist/index.js +7 -5
- package/dist/lib/event/meta.store.d.ts +4 -0
- package/dist/lib/event/meta.store.js +5 -0
- package/dist/lib/openapi/collectors/class.collector.d.ts +5 -9
- package/dist/lib/openapi/collectors/class.collector.js +6 -63
- package/dist/lib/openapi/collectors/index.d.ts +3 -4
- package/dist/lib/openapi/collectors/index.js +0 -1
- package/dist/lib/openapi/collectors/method.collector.d.ts +6 -1
- package/dist/lib/openapi/collectors/method.collector.js +92 -59
- package/dist/lib/openapi/collectors/schema.collector.d.ts +3 -8
- package/dist/lib/openapi/collectors/schema.collector.js +17 -25
- package/dist/lib/openapi/constants.d.ts +1 -0
- package/dist/lib/openapi/constants.js +2 -2
- package/dist/lib/openapi/decorators.d.ts +16 -0
- package/dist/lib/openapi/decorators.js +93 -0
- package/dist/lib/openapi/index.d.ts +29 -5
- package/dist/lib/openapi/index.js +119 -5
- package/dist/lib/openapi/metadata.d.ts +7 -0
- package/dist/lib/openapi/metadata.js +8 -0
- package/dist/lib/openapi/metadata.registry.d.ts +1 -1
- package/dist/lib/server/decorators/File.d.ts +37 -0
- package/dist/{decorators → lib/server/decorators}/File.js +62 -75
- package/dist/lib/server/decorators/Http.d.ts +12 -0
- package/dist/lib/server/decorators/Http.js +56 -0
- package/dist/lib/server/decorators/HyperApp.d.ts +7 -0
- package/dist/lib/server/decorators/HyperApp.js +14 -0
- package/dist/lib/server/decorators/HyperController.d.ts +6 -0
- package/dist/lib/server/decorators/HyperController.js +15 -0
- package/dist/lib/server/decorators/HyperModule.d.ts +6 -0
- package/dist/lib/server/decorators/HyperModule.js +13 -0
- package/dist/lib/server/decorators/HyperService.d.ts +12 -0
- package/dist/lib/server/decorators/HyperService.js +30 -0
- package/dist/lib/server/decorators/Messaging.d.ts +8 -0
- package/dist/lib/server/decorators/Messaging.js +19 -0
- package/dist/{decorators → lib/server/decorators}/Middleware.d.ts +5 -12
- package/dist/lib/server/decorators/Middleware.js +52 -0
- package/dist/lib/server/decorators/Output.d.ts +6 -0
- package/dist/lib/server/decorators/Output.js +14 -0
- package/dist/lib/server/decorators/Pass.d.ts +10 -0
- package/dist/lib/server/decorators/Pass.js +13 -0
- package/dist/lib/server/decorators/Role.d.ts +7 -0
- package/dist/lib/server/decorators/Role.js +14 -0
- package/dist/lib/server/decorators/Routes.d.ts +14 -0
- package/dist/lib/server/decorators/Routes.js +39 -0
- package/dist/lib/server/decorators/Scope.d.ts +7 -0
- package/dist/lib/server/decorators/Scope.js +14 -0
- package/dist/{decorators → lib/server/decorators}/index.d.ts +6 -4
- package/dist/{decorators → lib/server/decorators}/index.js +6 -4
- package/dist/lib/server/decorators/metadata.d.ts +1 -0
- package/dist/lib/server/decorators/metadata.js +5 -0
- package/dist/{decorators → lib/server/decorators}/types.d.ts +16 -15
- package/dist/{exeptions → lib/server/exeptions}/HyperException.d.ts +2 -1
- package/dist/{exeptions → lib/server/exeptions}/HyperException.js +2 -1
- package/dist/{exeptions → lib/server/exeptions}/HyperFileException.js +1 -1
- package/dist/{exeptions → lib/server/exeptions}/NotRoleException.js +1 -1
- package/dist/{exeptions → lib/server/exeptions}/NotScopeException.js +1 -1
- package/dist/{__internals/helpers/tree.helper.d.ts → lib/tree/tree.d.ts} +12 -12
- package/dist/lib/tree/tree.js +106 -0
- package/package.json +10 -2
- package/scripts/clean.js +54 -54
- package/scripts/test-server.ts +85 -85
- package/vitest.config.mjs +1 -1
- package/debug.txt +0 -1
- package/dist/__internals/creators/request.creator.d.ts +0 -11
- package/dist/__internals/creators/request.creator.js +0 -55
- package/dist/__internals/creators/routes.creator.d.ts +0 -9
- package/dist/__internals/creators/routes.creator.js +0 -39
- package/dist/__internals/decorator-base.d.ts +0 -30
- package/dist/__internals/decorator-base.js +0 -122
- package/dist/__internals/helpers/imports.helper.d.ts +0 -8
- package/dist/__internals/helpers/imports.helper.js +0 -92
- package/dist/__internals/helpers/tree.helper.js +0 -81
- package/dist/__internals/stores/metadata.store.d.ts +0 -15
- package/dist/__internals/stores/metadata.store.js +0 -37
- package/dist/decorators/File.d.ts +0 -65
- package/dist/decorators/Http.d.ts +0 -62
- package/dist/decorators/Http.js +0 -139
- package/dist/decorators/HyperApp.d.ts +0 -3
- package/dist/decorators/HyperApp.js +0 -96
- package/dist/decorators/HyperController.d.ts +0 -2
- package/dist/decorators/HyperController.js +0 -20
- package/dist/decorators/HyperModule.d.ts +0 -5
- package/dist/decorators/HyperModule.js +0 -14
- package/dist/decorators/HyperService.d.ts +0 -15
- package/dist/decorators/HyperService.js +0 -29
- package/dist/decorators/Messaging.d.ts +0 -10
- package/dist/decorators/Messaging.js +0 -22
- package/dist/decorators/Middleware.js +0 -65
- package/dist/decorators/Output.d.ts +0 -9
- package/dist/decorators/Output.js +0 -18
- package/dist/decorators/Pass.d.ts +0 -15
- package/dist/decorators/Pass.js +0 -32
- package/dist/decorators/Role.d.ts +0 -6
- package/dist/decorators/Role.js +0 -34
- package/dist/decorators/Routes.d.ts +0 -15
- package/dist/decorators/Routes.js +0 -21
- package/dist/decorators/Scope.d.ts +0 -6
- package/dist/decorators/Scope.js +0 -25
- package/dist/decorators/Transform.d.ts +0 -14
- package/dist/decorators/Transform.js +0 -18
- package/dist/lib/openapi/collectors/param.collector.d.ts +0 -2
- package/dist/lib/openapi/collectors/param.collector.js +0 -64
- package/dist/lib/openapi/decorators/api-bearer-auth.decorator.d.ts +0 -2
- package/dist/lib/openapi/decorators/api-bearer-auth.decorator.js +0 -10
- package/dist/lib/openapi/decorators/api-method.decorator.d.ts +0 -3
- package/dist/lib/openapi/decorators/api-method.decorator.js +0 -11
- package/dist/lib/openapi/decorators/api-parameter.decorator.d.ts +0 -3
- package/dist/lib/openapi/decorators/api-parameter.decorator.js +0 -10
- package/dist/lib/openapi/decorators/api-request-body.decorator.d.ts +0 -3
- package/dist/lib/openapi/decorators/api-request-body.decorator.js +0 -10
- package/dist/lib/openapi/decorators/api-response.decorator.d.ts +0 -3
- package/dist/lib/openapi/decorators/api-response.decorator.js +0 -10
- package/dist/lib/openapi/decorators/api-security.decorator.d.ts +0 -3
- package/dist/lib/openapi/decorators/api-security.decorator.js +0 -10
- package/dist/lib/openapi/decorators/api-tag.decorator.d.ts +0 -3
- package/dist/lib/openapi/decorators/api-tag.decorator.js +0 -13
- package/dist/lib/openapi/decorators/index.d.ts +0 -7
- package/dist/lib/openapi/decorators/index.js +0 -23
- package/dist/lib/openapi/helpers/index.d.ts +0 -7
- package/dist/lib/openapi/helpers/method.helper.d.ts +0 -3
- package/dist/lib/openapi/helpers/method.helper.js +0 -20
- package/dist/lib/openapi/helpers/openapi.helper.d.ts +0 -7
- package/dist/lib/openapi/helpers/openapi.helper.js +0 -51
- package/dist/lib/openapi/helpers/parameter.helper.d.ts +0 -3
- package/dist/lib/openapi/helpers/parameter.helper.js +0 -16
- package/dist/lib/openapi/helpers/request-body.helper.d.ts +0 -3
- package/dist/lib/openapi/helpers/request-body.helper.js +0 -9
- package/dist/lib/openapi/helpers/response.helper.d.ts +0 -3
- package/dist/lib/openapi/helpers/response.helper.js +0 -18
- package/dist/lib/openapi/helpers/security.helper.d.ts +0 -3
- package/dist/lib/openapi/helpers/security.helper.js +0 -17
- package/dist/lib/openapi/helpers/tag.helper.d.ts +0 -3
- package/dist/lib/openapi/helpers/tag.helper.js +0 -10
- package/dist/stores/index.d.ts +0 -1
- package/vitest.json +0 -0
- /package/dist/{stores → __internals/stores}/scope.store.js +0 -0
- /package/dist/__internals/stores/{service.store.d.ts → serivces.store.d.ts} +0 -0
- /package/dist/__internals/stores/{service.store.js → serivces.store.js} +0 -0
- /package/dist/{decorators → lib/server/decorators}/types.js +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/DuplicateControllerPathException.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/DuplicateControllerPathException.js +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/DuplicatedException.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/DuplicatedException.js +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/DuplicatedHandlerException.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/DuplicatedHandlerException.js +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/HyperFileException.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/MethodNotFountException.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/MethodNotFountException.js +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/NotPropertyException.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/NotPropertyException.js +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/NotRoleException.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/NotScopeException.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/WrongPlaceException.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/WrongPlaceException.js +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/index.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/index.js +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/types.d.ts +0 -0
- /package/dist/{exeptions → lib/server/exeptions}/types.js +0 -0
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiRequestBody = ApiRequestBody;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const request_body_helper_1 = require("../helpers/request-body.helper");
|
|
6
|
-
function ApiRequestBody(options) {
|
|
7
|
-
return (target, propertyKey) => {
|
|
8
|
-
(0, request_body_helper_1.apiRequestBody)(target, propertyKey, options);
|
|
9
|
-
};
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiResponse = ApiResponse;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const response_helper_1 = require("../helpers/response.helper");
|
|
6
|
-
function ApiResponse(options) {
|
|
7
|
-
return (target, propertyKey, descriptor) => {
|
|
8
|
-
(0, response_helper_1.apiResponse)(target, propertyKey, options);
|
|
9
|
-
};
|
|
10
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiSecurity = ApiSecurity;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const security_helper_1 = require("../helpers/security.helper");
|
|
6
|
-
function ApiSecurity(options) {
|
|
7
|
-
return (target, propertyKey, descriptor) => {
|
|
8
|
-
(0, security_helper_1.apiSecurity)(target, options, propertyKey);
|
|
9
|
-
};
|
|
10
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiTag = ApiTag;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const tag_helper_1 = require("../helpers/tag.helper");
|
|
6
|
-
function ApiTag(options) {
|
|
7
|
-
return (target) => {
|
|
8
|
-
if (typeof options === 'string') {
|
|
9
|
-
options = { name: options };
|
|
10
|
-
}
|
|
11
|
-
(0, tag_helper_1.apiTag)(target, options);
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export * from "./api-method.decorator";
|
|
2
|
-
export * from "./api-parameter.decorator";
|
|
3
|
-
export * from "./api-request-body.decorator";
|
|
4
|
-
export * from "./api-response.decorator";
|
|
5
|
-
export * from "./api-security.decorator";
|
|
6
|
-
export * from "./api-bearer-auth.decorator";
|
|
7
|
-
export * from "./api-tag.decorator";
|
|
@@ -1,23 +0,0 @@
|
|
|
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./api-method.decorator"), exports);
|
|
18
|
-
__exportStar(require("./api-parameter.decorator"), exports);
|
|
19
|
-
__exportStar(require("./api-request-body.decorator"), exports);
|
|
20
|
-
__exportStar(require("./api-response.decorator"), exports);
|
|
21
|
-
__exportStar(require("./api-security.decorator"), exports);
|
|
22
|
-
__exportStar(require("./api-bearer-auth.decorator"), exports);
|
|
23
|
-
__exportStar(require("./api-tag.decorator"), exports);
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apimethod = apimethod;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
const response_helper_1 = require("./response.helper");
|
|
7
|
-
function apimethod(target, propertyKey, options) {
|
|
8
|
-
if (options.summary) {
|
|
9
|
-
Reflect.defineMetadata(constants_1.METHOD_SUMMARY, options.summary, target, propertyKey);
|
|
10
|
-
}
|
|
11
|
-
if (options.operationId) {
|
|
12
|
-
Reflect.defineMetadata(constants_1.METHOD_OPERATION_ID, options.operationId, target, propertyKey);
|
|
13
|
-
}
|
|
14
|
-
if (options.tags) {
|
|
15
|
-
Reflect.defineMetadata(constants_1.METHOD_TAGS, options.tags, target, propertyKey);
|
|
16
|
-
}
|
|
17
|
-
if (options.responses) {
|
|
18
|
-
(0, response_helper_1.apiResponse)(target, propertyKey, options.responses);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getOpenAPI = getOpenAPI;
|
|
4
|
-
const tree_helper_1 = require("../../../__internals/helpers/tree.helper");
|
|
5
|
-
/**
|
|
6
|
-
* Generates a complete OpenAPI 3.0.0 document from a HyperApp class.
|
|
7
|
-
*
|
|
8
|
-
* @param App The HyperApp class (usually decorated with @HyperApp)
|
|
9
|
-
*/
|
|
10
|
-
function getOpenAPI(App) {
|
|
11
|
-
var _a;
|
|
12
|
-
const tree = (0, tree_helper_1.getAppTree)(App);
|
|
13
|
-
const appMeta = tree.app;
|
|
14
|
-
const doc = {
|
|
15
|
-
openapi: "3.0.0",
|
|
16
|
-
info: {
|
|
17
|
-
title: appMeta.name || "API Documentation",
|
|
18
|
-
version: appMeta.version || "1.0.0",
|
|
19
|
-
description: appMeta.description || "",
|
|
20
|
-
},
|
|
21
|
-
paths: {},
|
|
22
|
-
components: Object.assign({ schemas: {}, securitySchemes: {} }, (_a = tree.openapi) === null || _a === void 0 ? void 0 : _a.components)
|
|
23
|
-
};
|
|
24
|
-
// Populate paths from the flattened tree paths
|
|
25
|
-
Object.entries(tree.paths).forEach(([path, routes]) => {
|
|
26
|
-
// Convert /v1/user/ to /v1/user (remove trailing slash except for root)
|
|
27
|
-
const normalizedPath = path.length > 1 && path.endsWith("/") ? path.slice(0, -1) : path;
|
|
28
|
-
if (!doc.paths[normalizedPath]) {
|
|
29
|
-
doc.paths[normalizedPath] = {};
|
|
30
|
-
}
|
|
31
|
-
const pathItem = doc.paths[normalizedPath];
|
|
32
|
-
routes.forEach(route => {
|
|
33
|
-
var _a;
|
|
34
|
-
const method = route.method.toLowerCase();
|
|
35
|
-
// Merge route-level OpenAPI metadata
|
|
36
|
-
const operation = Object.assign(Object.assign({}, route.openapi), { responses: ((_a = route.openapi) === null || _a === void 0 ? void 0 : _a.responses) || {
|
|
37
|
-
"200": { description: "Successful operation" }
|
|
38
|
-
} });
|
|
39
|
-
// Ensure operationId if missing for better client generation
|
|
40
|
-
if (!operation.operationId) {
|
|
41
|
-
operation.operationId = `${route.propertyKey}`;
|
|
42
|
-
}
|
|
43
|
-
pathItem[method] = operation;
|
|
44
|
-
});
|
|
45
|
-
});
|
|
46
|
-
// Apply any global tree processors that might have added data to tree.openapi
|
|
47
|
-
if (tree.openapi) {
|
|
48
|
-
Object.assign(doc, tree.openapi);
|
|
49
|
-
}
|
|
50
|
-
return doc;
|
|
51
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apiParameter = apiParameter;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
function apiParameter(target, propertyKey, options) {
|
|
7
|
-
const existingParameters = Reflect.getMetadata(constants_1.PARAMETERS, target, propertyKey) || [];
|
|
8
|
-
existingParameters.push({
|
|
9
|
-
name: options.name,
|
|
10
|
-
in: options.in,
|
|
11
|
-
required: options.required || false,
|
|
12
|
-
description: options.description,
|
|
13
|
-
schema: options.schema,
|
|
14
|
-
});
|
|
15
|
-
Reflect.defineMetadata(constants_1.PARAMETERS, existingParameters, target, propertyKey);
|
|
16
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apiRequestBody = apiRequestBody;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
function apiRequestBody(target, propertyKey, options) {
|
|
7
|
-
Reflect.defineMetadata(constants_1.REQUEST_BODY_DESCRIPTION, options.description, target, propertyKey);
|
|
8
|
-
Reflect.defineMetadata(constants_1.REQUEST_BODY_CONTENT, options.content, target, propertyKey);
|
|
9
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apiResponse = apiResponse;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
function apiResponse(target, propertyKey, options) {
|
|
7
|
-
const existingResponses = Reflect.getMetadata(constants_1.RESPONSES, target, propertyKey) || {};
|
|
8
|
-
for (const key in options) {
|
|
9
|
-
if (options.hasOwnProperty(key)) {
|
|
10
|
-
const response = options[key];
|
|
11
|
-
existingResponses[key] = {
|
|
12
|
-
description: response.description,
|
|
13
|
-
content: response.content,
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
Reflect.defineMetadata(constants_1.RESPONSES, existingResponses, target, propertyKey);
|
|
18
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apiSecurity = apiSecurity;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
function apiSecurity(target, options, propertyKey) {
|
|
7
|
-
const existingSecurity = propertyKey
|
|
8
|
-
? Reflect.getMetadata(constants_1.SECURITY, target, propertyKey) || []
|
|
9
|
-
: Reflect.getMetadata(constants_1.SECURITY, target) || [];
|
|
10
|
-
existingSecurity.push(options);
|
|
11
|
-
if (propertyKey) {
|
|
12
|
-
Reflect.defineMetadata(constants_1.SECURITY, existingSecurity, target, propertyKey);
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
Reflect.defineMetadata(constants_1.SECURITY, existingSecurity, target);
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.apiTag = apiTag;
|
|
4
|
-
require("reflect-metadata");
|
|
5
|
-
const constants_1 = require("../constants");
|
|
6
|
-
function apiTag(target, options) {
|
|
7
|
-
const existingTags = Reflect.getMetadata(constants_1.TAGS, target) || [];
|
|
8
|
-
existingTags.push({ name: options.name, description: options.description });
|
|
9
|
-
Reflect.defineMetadata(constants_1.TAGS, existingTags, target);
|
|
10
|
-
}
|
package/dist/stores/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./scope.store";
|
package/vitest.json
DELETED
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|