@drax/identity-back 1.0.0 → 1.1.1

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.
@@ -9,7 +9,7 @@ declare const UserLoginFailMongoSchema: mongoose.Schema<IUserLoginFail, mongoose
9
9
  }> & {
10
10
  __v: number;
11
11
  }>;
12
- declare const UserLoginFailModel: mongoose.PaginateModel<IUserLoginFail, {}, {}>;
12
+ declare let UserLoginFailModel: any;
13
13
  export { UserLoginFailMongoSchema, UserLoginFailModel };
14
14
  export default UserLoginFailModel;
15
15
  //# sourceMappingURL=UserLoginFailModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserLoginFailModel.d.ts","sourceRoot":"","sources":["../../src/models/UserLoginFailModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAI3C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAA;AAExD,QAAA,MAAM,wBAAwB;;;;;;;;EAIR,CAAC;AAgBvB,QAAA,MAAM,kBAAkB,gDAAsH,CAAC;AAE/I,OAAO,EACH,wBAAwB,EACxB,kBAAkB,EACrB,CAAA;AAED,eAAe,kBAAkB,CAAA"}
1
+ {"version":3,"file":"UserLoginFailModel.d.ts","sourceRoot":"","sources":["../../src/models/UserLoginFailModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAI3C,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAA;AAExD,QAAA,MAAM,wBAAwB;;;;;;;;EAIR,CAAC;AAiBvB,QAAA,IAAI,kBAAkB,KAAA,CAAC;AAcvB,OAAO,EACH,wBAAwB,EACxB,kBAAkB,EACrB,CAAA;AAED,eAAe,kBAAkB,CAAA"}
@@ -9,7 +9,7 @@ declare const UserSessionMongoSchema: mongoose.Schema<IUserSession, mongoose.Mod
9
9
  }> & {
10
10
  __v: number;
11
11
  }>;
12
- declare const UserSessionModel: mongoose.PaginateModel<IUserSession, {}, {}>;
12
+ declare let UserSessionModel: any;
13
13
  export { UserSessionMongoSchema, UserSessionModel };
14
14
  export default UserSessionModel;
15
15
  //# sourceMappingURL=UserSessionModel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"UserSessionModel.d.ts","sourceRoot":"","sources":["../../src/models/UserSessionModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAI3C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAA;AAEtD,QAAA,MAAM,sBAAsB;;;;;;;;EAKN,CAAC;AAgBvB,QAAA,MAAM,gBAAgB,8CAAgH,CAAC;AAEvI,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EACnB,CAAA;AAED,eAAe,gBAAgB,CAAA"}
1
+ {"version":3,"file":"UserSessionModel.d.ts","sourceRoot":"","sources":["../../src/models/UserSessionModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAI3C,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,sBAAsB,CAAA;AAEtD,QAAA,MAAM,sBAAsB;;;;;;;;EAKN,CAAC;AAiBvB,QAAA,IAAI,gBAAgB,KAAA,CAAC;AAarB,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EACnB,CAAA;AAED,eAAe,gBAAgB,CAAA"}
@@ -1,17 +0,0 @@
1
- import {CreateOrUpdateRole} from "../../../src/setup/CreateOrUpdateRole";
2
- import {CreateUserIfNotExist} from "../../../src/setup/CreateUserIfNotExist";
3
- import rootUser from "../data/root-user";
4
- import adminRole from "../data/admin-role";
5
- import {IUser, IRole} from "@drax/identity-share";
6
-
7
- async function CreateRootUserAndAdminRole(){
8
- const role:IRole = await CreateOrUpdateRole(adminRole)
9
- const user:IUser = await CreateUserIfNotExist(rootUser)
10
- return {user, role}
11
- }
12
-
13
- export default CreateRootUserAndAdminRole
14
-
15
- export {
16
- CreateRootUserAndAdminRole
17
- }
@@ -1,26 +0,0 @@
1
- import Fastify from "fastify";
2
- import {InternalServerError} from "@drax/common-back";
3
-
4
- import {
5
- jwtMiddleware, rbacMiddleware, apiKeyMiddleware,
6
- } from '../../../src/index'
7
-
8
-
9
- const FastifyTestServerFactory = () => {
10
- const fastify = Fastify()
11
- fastify.setErrorHandler((error, request, reply) => {
12
- console.error("Error",error)
13
- let serverError = new InternalServerError()
14
- reply.status(serverError.statusCode).send(serverError.body)
15
- },)
16
- fastify.setValidatorCompiler(() => () => true)
17
-
18
- fastify.addHook('onRequest', jwtMiddleware)
19
- fastify.addHook('onRequest', rbacMiddleware)
20
- fastify.addHook('onRequest', apiKeyMiddleware)
21
-
22
- return fastify
23
- }
24
-
25
- export default FastifyTestServerFactory
26
- export {FastifyTestServerFactory}
@@ -1,23 +0,0 @@
1
- import {LoadPermissions,
2
- UserPermissions, RolePermissions, TenantPermissions, UserApiKeyPermissions
3
- } from "../../../src/index.js";
4
-
5
-
6
- function InitializePermissions() {
7
-
8
- //Merge All Permissions
9
- const permissions = [
10
- ...Object.values(UserPermissions),
11
- ...Object.values(RolePermissions),
12
- ...Object.values(TenantPermissions),
13
- ...Object.values(UserApiKeyPermissions),
14
- ]
15
-
16
- //Load All Permissions
17
- LoadPermissions(permissions)
18
- }
19
-
20
- export default InitializePermissions
21
-
22
- export {InitializePermissions}
23
-
@@ -1,22 +0,0 @@
1
- import { LoadCommonConfigFromEnv} from "@drax/common-back";
2
- import {LoadIdentityConfigFromEnv} from "@drax/identity-back";
3
- import InitializePermissions from "./InitializePermissions.js";
4
- import CreateRootUserAndAdminRole from "./CreateRootUserAndAdminRole.js";
5
-
6
-
7
- async function SetupIdentityDrax(){
8
-
9
- //Load Identity Drax Config from enviroment variables
10
- LoadCommonConfigFromEnv()
11
- LoadIdentityConfigFromEnv()
12
-
13
- //Setup Permissions
14
- InitializePermissions()
15
-
16
- //Create Root User and Admin Role
17
- return await CreateRootUserAndAdminRole()
18
-
19
- }
20
-
21
- export default SetupIdentityDrax
22
- export {SetupIdentityDrax}
File without changes
File without changes
File without changes