@nattyjs/core 0.0.1-beta.14 → 0.0.1-beta.16
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/dist/index.cjs +13 -0
- package/dist/index.d.ts +18 -1
- package/dist/index.mjs +11 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1240,10 +1240,21 @@ function setEnvInfo(envTsDefinition, envValueInfo) {
|
|
|
1240
1240
|
}
|
|
1241
1241
|
}
|
|
1242
1242
|
|
|
1243
|
+
function authorize(permission) {
|
|
1244
|
+
return function(target, propertyKey, descriptor) {
|
|
1245
|
+
base({
|
|
1246
|
+
target,
|
|
1247
|
+
propertyKey,
|
|
1248
|
+
descriptor
|
|
1249
|
+
}, DecoratorType.authorize, permission);
|
|
1250
|
+
};
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1243
1253
|
exports.$request = $request;
|
|
1244
1254
|
exports.AbstractModelState = AbstractModelState;
|
|
1245
1255
|
exports.BadRequestResult = BadRequestResult;
|
|
1246
1256
|
exports.BaseController = BaseController;
|
|
1257
|
+
exports.CreateProblemDetail = CreateProblemDetail;
|
|
1247
1258
|
exports.CreatedResult = CreatedResult;
|
|
1248
1259
|
exports.Delete = Delete;
|
|
1249
1260
|
exports.ForbiddenAccessException = ForbiddenAccessException;
|
|
@@ -1254,6 +1265,7 @@ exports.HttpException = HttpException;
|
|
|
1254
1265
|
exports.HttpHandler = HttpHandler;
|
|
1255
1266
|
exports.HttpNotFoundException = HttpNotFoundException;
|
|
1256
1267
|
exports.HttpResponse = HttpResponse;
|
|
1268
|
+
exports.HttpStatusCode = HttpStatusCode;
|
|
1257
1269
|
exports.ModelBindingContext = ModelBindingContext;
|
|
1258
1270
|
exports.NoContentResult = NoContentResult;
|
|
1259
1271
|
exports.NotFoundResult = NotFoundResult;
|
|
@@ -1262,6 +1274,7 @@ exports.RunOn = RunOn;
|
|
|
1262
1274
|
exports.UnauthorizedAccessException = UnauthorizedAccessException;
|
|
1263
1275
|
exports.anonymous = anonymous;
|
|
1264
1276
|
exports.authenticationOnly = authenticationOnly;
|
|
1277
|
+
exports.authorize = authorize;
|
|
1265
1278
|
exports.badRequest = badRequest;
|
|
1266
1279
|
exports.created = created;
|
|
1267
1280
|
exports.defineNattyConfig = defineNattyConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -469,4 +469,21 @@ declare function setEnvInfo(envTsDefinition: {
|
|
|
469
469
|
[key: string]: any;
|
|
470
470
|
}): void;
|
|
471
471
|
|
|
472
|
-
|
|
472
|
+
declare enum HttpStatusCode {
|
|
473
|
+
success = 200,
|
|
474
|
+
created = 201,
|
|
475
|
+
noContent = 204,
|
|
476
|
+
notFound = 404,
|
|
477
|
+
unAuthorized = 401,
|
|
478
|
+
forbiddenAccess = 403,
|
|
479
|
+
badRequest = 400,
|
|
480
|
+
serverError = 500
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
declare function authorize(permission: {
|
|
484
|
+
[key: string]: any;
|
|
485
|
+
}): (target: any, propertyKey?: string, descriptor?: any) => void;
|
|
486
|
+
|
|
487
|
+
declare function CreateProblemDetail(modelName: string, detail: any): ProblemDetail;
|
|
488
|
+
|
|
489
|
+
export { $request, AbstractModelState, BadRequestResult, BaseController, BuildOptions, ClassTypeInfo, CreateProblemDetail, CreatedResult, Delete, ForbiddenAccessException, ForbiddenAccessInfoResult, HttpBadRequestException, HttpContext, HttpException, HttpHandler, HttpModule, HttpNotFoundException, HttpResponse, HttpStatusCode, MethodInfo$1 as MethodInfo, ModelBindingContext, NoContentResult, NotFoundResult, OkResult, ParameterInfo, RunOn, TypeInfo$1 as TypeInfo, UnauthorizedAccessException, anonymous, authenticationOnly, authorize, badRequest, created, defineNattyConfig, entityContainer, filter, forbiddenAccessInfo, get, init, injectable, noContent, notFound, ok, post, put, registerDecorator, route, setEnvInfo, useFilter };
|
package/dist/index.mjs
CHANGED
|
@@ -1238,4 +1238,14 @@ function setEnvInfo(envTsDefinition, envValueInfo) {
|
|
|
1238
1238
|
}
|
|
1239
1239
|
}
|
|
1240
1240
|
|
|
1241
|
-
|
|
1241
|
+
function authorize(permission) {
|
|
1242
|
+
return function(target, propertyKey, descriptor) {
|
|
1243
|
+
base({
|
|
1244
|
+
target,
|
|
1245
|
+
propertyKey,
|
|
1246
|
+
descriptor
|
|
1247
|
+
}, DecoratorType.authorize, permission);
|
|
1248
|
+
};
|
|
1249
|
+
}
|
|
1250
|
+
|
|
1251
|
+
export { $request, AbstractModelState, BadRequestResult, BaseController, CreateProblemDetail, CreatedResult, Delete, ForbiddenAccessException, ForbiddenAccessInfoResult, HttpBadRequestException, HttpContext, HttpException, HttpHandler, HttpNotFoundException, HttpResponse, HttpStatusCode, ModelBindingContext, NoContentResult, NotFoundResult, OkResult, RunOn, UnauthorizedAccessException, anonymous, authenticationOnly, authorize, badRequest, created, defineNattyConfig, entityContainer, filter, forbiddenAccessInfo, get, init, injectable, noContent, notFound, ok, post, put, registerDecorator, route, setEnvInfo, useFilter };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nattyjs/core",
|
|
3
|
-
"version": "0.0.1-beta.
|
|
3
|
+
"version": "0.0.1-beta.16",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "ajayojha",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"tsyringe": "^4.7.0",
|
|
19
19
|
"path-to-regexp": "6.2.1",
|
|
20
|
-
"@nattyjs/common": "0.0.1-beta.
|
|
20
|
+
"@nattyjs/common": "0.0.1-beta.16"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"unbuild": "1.2.1"
|