najm-auth 2.0.2 → 2.0.3
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.js +13 -13
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -400,7 +400,7 @@ CookieManager = __decorate2([
|
|
|
400
400
|
// src/auth/AuthController.ts
|
|
401
401
|
import { Controller } from "najm-core";
|
|
402
402
|
import { Get, Post, ResMsg } from "najm-core";
|
|
403
|
-
import { Body, User as
|
|
403
|
+
import { Body, User as User2, Headers } from "najm-core";
|
|
404
404
|
|
|
405
405
|
// src/auth/AuthService.ts
|
|
406
406
|
import { Injectable as Injectable8, Inject as Inject8 } from "najm-core";
|
|
@@ -2402,7 +2402,7 @@ var isAuth = createGuard(AuthGuard);
|
|
|
2402
2402
|
|
|
2403
2403
|
// src/roles/RoleGuards.ts
|
|
2404
2404
|
import { Service as Service3 } from "najm-core";
|
|
2405
|
-
import { GuardParams,
|
|
2405
|
+
import { GuardParams, Role as RequestRole } from "najm-core";
|
|
2406
2406
|
import { composeGuards, createGuard as createGuard2 } from "najm-guard";
|
|
2407
2407
|
var __decorate14 = function(decorators, target, key, desc) {
|
|
2408
2408
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -2435,7 +2435,7 @@ var RoleGuard = class RoleGuard2 {
|
|
|
2435
2435
|
};
|
|
2436
2436
|
__decorate14([
|
|
2437
2437
|
__param4(0, GuardParams()),
|
|
2438
|
-
__param4(1,
|
|
2438
|
+
__param4(1, RequestRole()),
|
|
2439
2439
|
__metadata14("design:type", Function),
|
|
2440
2440
|
__metadata14("design:paramtypes", [Object, String]),
|
|
2441
2441
|
__metadata14("design:returntype", void 0)
|
|
@@ -2630,7 +2630,7 @@ __decorate15([
|
|
|
2630
2630
|
Post("/logout"),
|
|
2631
2631
|
isAuth(),
|
|
2632
2632
|
RateLimit({ limit: 10, window: "15m", key: "user" }),
|
|
2633
|
-
__param5(0,
|
|
2633
|
+
__param5(0, User2("id")),
|
|
2634
2634
|
__param5(1, Headers("authorization")),
|
|
2635
2635
|
__metadata15("design:type", Function),
|
|
2636
2636
|
__metadata15("design:paramtypes", [String, String]),
|
|
@@ -2641,7 +2641,7 @@ __decorate15([
|
|
|
2641
2641
|
isAuth(),
|
|
2642
2642
|
Validate(changePasswordDto),
|
|
2643
2643
|
ResMsg("auth.success.passwordChanged"),
|
|
2644
|
-
__param5(0,
|
|
2644
|
+
__param5(0, User2("id")),
|
|
2645
2645
|
__param5(1, Body()),
|
|
2646
2646
|
__metadata15("design:type", Function),
|
|
2647
2647
|
__metadata15("design:paramtypes", [String, Object]),
|
|
@@ -3370,7 +3370,7 @@ PermissionRepository = __decorate19([
|
|
|
3370
3370
|
|
|
3371
3371
|
// src/permissions/PermissionGuards.ts
|
|
3372
3372
|
import { Injectable as Injectable9 } from "najm-core";
|
|
3373
|
-
import { GuardParams as GuardParams2, User as
|
|
3373
|
+
import { GuardParams as GuardParams2, User as User3 } from "najm-core";
|
|
3374
3374
|
import { createGuard as createGuard4, composeGuards as composeGuards3 } from "najm-guard";
|
|
3375
3375
|
var __decorate20 = function(decorators, target, key, desc) {
|
|
3376
3376
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -3416,7 +3416,7 @@ var PermissionGuard = class PermissionGuard2 {
|
|
|
3416
3416
|
};
|
|
3417
3417
|
__decorate20([
|
|
3418
3418
|
__param8(0, GuardParams2()),
|
|
3419
|
-
__param8(1,
|
|
3419
|
+
__param8(1, User3("permissions")),
|
|
3420
3420
|
__metadata20("design:type", Function),
|
|
3421
3421
|
__metadata20("design:paramtypes", [String, Array]),
|
|
3422
3422
|
__metadata20("design:returntype", Object)
|
|
@@ -4038,7 +4038,7 @@ function own(table, opts) {
|
|
|
4038
4038
|
__name(own, "own");
|
|
4039
4039
|
|
|
4040
4040
|
// src/ownership/configureOwnership.ts
|
|
4041
|
-
import { Injectable as Injectable12, Inject as Inject11, User as
|
|
4041
|
+
import { Injectable as Injectable12, Inject as Inject11, User as User4, Body as Body5, Params as Params4 } from "najm-core";
|
|
4042
4042
|
import { createGuard as createGuard5, composeGuards as composeGuards4 } from "najm-guard";
|
|
4043
4043
|
var __decorate24 = function(decorators, target, key, desc) {
|
|
4044
4044
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
@@ -4083,7 +4083,7 @@ function createResourceGuards(ownershipClass, resourceType, resource, options) {
|
|
|
4083
4083
|
__metadata24("design:type", Object)
|
|
4084
4084
|
], AccessGuard.prototype, "ownership", void 0);
|
|
4085
4085
|
__decorate24([
|
|
4086
|
-
__param10(0,
|
|
4086
|
+
__param10(0, User4()),
|
|
4087
4087
|
__param10(1, Params4("id")),
|
|
4088
4088
|
__metadata24("design:type", Function),
|
|
4089
4089
|
__metadata24("design:paramtypes", [Object, String]),
|
|
@@ -4107,7 +4107,7 @@ function createResourceGuards(ownershipClass, resourceType, resource, options) {
|
|
|
4107
4107
|
__metadata24("design:type", Object)
|
|
4108
4108
|
], ListGuard.prototype, "ownership", void 0);
|
|
4109
4109
|
__decorate24([
|
|
4110
|
-
__param10(0,
|
|
4110
|
+
__param10(0, User4()),
|
|
4111
4111
|
__metadata24("design:type", Function),
|
|
4112
4112
|
__metadata24("design:paramtypes", [Object]),
|
|
4113
4113
|
__metadata24("design:returntype", typeof (_b12 = typeof Promise !== "undefined" && Promise) === "function" ? _b12 : Object)
|
|
@@ -4266,7 +4266,7 @@ function configureOwnership(config) {
|
|
|
4266
4266
|
__metadata24("design:type", GeneratedOwnershipService)
|
|
4267
4267
|
], BodyAccessGuard.prototype, "ownership", void 0);
|
|
4268
4268
|
__decorate24([
|
|
4269
|
-
__param10(0,
|
|
4269
|
+
__param10(0, User4()),
|
|
4270
4270
|
__param10(1, Body5()),
|
|
4271
4271
|
__metadata24("design:type", Function),
|
|
4272
4272
|
__metadata24("design:paramtypes", [Object, Object]),
|
|
@@ -4977,7 +4977,7 @@ OAuthAccountService = __decorate29([
|
|
|
4977
4977
|
|
|
4978
4978
|
// src/oauth/OAuthController.ts
|
|
4979
4979
|
import { createHash as createHash4 } from "crypto";
|
|
4980
|
-
import { Controller as Controller5, Ctx, Get as Get5, Post as Post5, Query as Query2, User as
|
|
4980
|
+
import { Controller as Controller5, Ctx, Get as Get5, Post as Post5, Query as Query2, User as User5 } from "najm-core";
|
|
4981
4981
|
import { RateLimit as RateLimit2 } from "najm-rate";
|
|
4982
4982
|
|
|
4983
4983
|
// src/oauth/OAuthService.ts
|
|
@@ -5284,7 +5284,7 @@ __decorate32([
|
|
|
5284
5284
|
Post5("/link"),
|
|
5285
5285
|
isAuth(),
|
|
5286
5286
|
RateLimit2({ limit: 10, window: "15m", key: "user" }),
|
|
5287
|
-
__param11(0,
|
|
5287
|
+
__param11(0, User5("id")),
|
|
5288
5288
|
__param11(1, Query2("returnTo")),
|
|
5289
5289
|
__metadata32("design:type", Function),
|
|
5290
5290
|
__metadata32("design:paramtypes", [String, String]),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "najm-auth",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "Authentication and authorization library for najm framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
@@ -76,8 +76,8 @@
|
|
|
76
76
|
"dependencies": {
|
|
77
77
|
"bcryptjs": "^3.0.2",
|
|
78
78
|
"najm-cookies": "^2.0.2",
|
|
79
|
-
"najm-core": "^2.0.
|
|
80
|
-
"najm-database": "^2.0.
|
|
79
|
+
"najm-core": "^2.0.4",
|
|
80
|
+
"najm-database": "^2.0.3",
|
|
81
81
|
"najm-guard": "^2.0.2",
|
|
82
82
|
"najm-i18n": "^2.0.2",
|
|
83
83
|
"najm-cache": "^2.0.2",
|