@nattyjs/core 0.0.1-beta.13 → 0.0.1-beta.15
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 +12 -0
- package/dist/index.d.ts +16 -1
- package/dist/index.mjs +11 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1240,6 +1240,16 @@ 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;
|
|
@@ -1254,6 +1264,7 @@ exports.HttpException = HttpException;
|
|
|
1254
1264
|
exports.HttpHandler = HttpHandler;
|
|
1255
1265
|
exports.HttpNotFoundException = HttpNotFoundException;
|
|
1256
1266
|
exports.HttpResponse = HttpResponse;
|
|
1267
|
+
exports.HttpStatusCode = HttpStatusCode;
|
|
1257
1268
|
exports.ModelBindingContext = ModelBindingContext;
|
|
1258
1269
|
exports.NoContentResult = NoContentResult;
|
|
1259
1270
|
exports.NotFoundResult = NotFoundResult;
|
|
@@ -1262,6 +1273,7 @@ exports.RunOn = RunOn;
|
|
|
1262
1273
|
exports.UnauthorizedAccessException = UnauthorizedAccessException;
|
|
1263
1274
|
exports.anonymous = anonymous;
|
|
1264
1275
|
exports.authenticationOnly = authenticationOnly;
|
|
1276
|
+
exports.authorize = authorize;
|
|
1265
1277
|
exports.badRequest = badRequest;
|
|
1266
1278
|
exports.created = created;
|
|
1267
1279
|
exports.defineNattyConfig = defineNattyConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -469,4 +469,19 @@ 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
|
+
export { $request, AbstractModelState, BadRequestResult, BaseController, BuildOptions, ClassTypeInfo, 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, 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.15",
|
|
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.15"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"unbuild": "1.2.1"
|