@things-factory/auth-base 4.3.591 → 4.3.671
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/package.json +5 -5
- package/dist-server/constants/error-code.js +0 -21
- package/dist-server/constants/error-code.js.map +0 -1
- package/dist-server/constants/error-message.js +0 -1
- package/dist-server/constants/error-message.js.map +0 -1
- package/dist-server/constants/max-age.js +0 -5
- package/dist-server/constants/max-age.js.map +0 -1
- package/dist-server/controllers/auth.js +0 -21
- package/dist-server/controllers/auth.js.map +0 -1
- package/dist-server/controllers/change-pwd.js +0 -80
- package/dist-server/controllers/change-pwd.js.map +0 -1
- package/dist-server/controllers/checkin.js +0 -21
- package/dist-server/controllers/checkin.js.map +0 -1
- package/dist-server/controllers/delete-user.js +0 -61
- package/dist-server/controllers/delete-user.js.map +0 -1
- package/dist-server/controllers/invitation.js +0 -119
- package/dist-server/controllers/invitation.js.map +0 -1
- package/dist-server/controllers/profile.js +0 -26
- package/dist-server/controllers/profile.js.map +0 -1
- package/dist-server/controllers/reset-password.js +0 -110
- package/dist-server/controllers/reset-password.js.map +0 -1
- package/dist-server/controllers/signin.js +0 -76
- package/dist-server/controllers/signin.js.map +0 -1
- package/dist-server/controllers/signup.js +0 -105
- package/dist-server/controllers/signup.js.map +0 -1
- package/dist-server/controllers/unlock-user.js +0 -60
- package/dist-server/controllers/unlock-user.js.map +0 -1
- package/dist-server/controllers/utils/make-invitation-token.js +0 -12
- package/dist-server/controllers/utils/make-invitation-token.js.map +0 -1
- package/dist-server/controllers/utils/make-verification-token.js +0 -12
- package/dist-server/controllers/utils/make-verification-token.js.map +0 -1
- package/dist-server/controllers/utils/password-rule.js +0 -90
- package/dist-server/controllers/utils/password-rule.js.map +0 -1
- package/dist-server/controllers/utils/save-invitation-token.js +0 -13
- package/dist-server/controllers/utils/save-invitation-token.js.map +0 -1
- package/dist-server/controllers/utils/save-verification-token.js +0 -15
- package/dist-server/controllers/utils/save-verification-token.js.map +0 -1
- package/dist-server/controllers/verification.js +0 -78
- package/dist-server/controllers/verification.js.map +0 -1
- package/dist-server/errors/auth-error.js +0 -40
- package/dist-server/errors/auth-error.js.map +0 -1
- package/dist-server/errors/index.js +0 -19
- package/dist-server/errors/index.js.map +0 -1
- package/dist-server/errors/user-domain-not-match-error.js +0 -24
- package/dist-server/errors/user-domain-not-match-error.js.map +0 -1
- package/dist-server/index.js +0 -29
- package/dist-server/index.js.map +0 -1
- package/dist-server/middlewares/authenticate-401-middleware.js +0 -84
- package/dist-server/middlewares/authenticate-401-middleware.js.map +0 -1
- package/dist-server/middlewares/domain-authenticate-middleware.js +0 -58
- package/dist-server/middlewares/domain-authenticate-middleware.js.map +0 -1
- package/dist-server/middlewares/graphql-authenticate-middleware.js +0 -17
- package/dist-server/middlewares/graphql-authenticate-middleware.js.map +0 -1
- package/dist-server/middlewares/index.js +0 -57
- package/dist-server/middlewares/index.js.map +0 -1
- package/dist-server/middlewares/jwt-authenticate-middleware.js +0 -77
- package/dist-server/middlewares/jwt-authenticate-middleware.js.map +0 -1
- package/dist-server/middlewares/signin-middleware.js +0 -47
- package/dist-server/middlewares/signin-middleware.js.map +0 -1
- package/dist-server/migrations/1548206416130-SeedUser.js +0 -46
- package/dist-server/migrations/1548206416130-SeedUser.js.map +0 -1
- package/dist-server/migrations/1566805283882-SeedPrivilege.js +0 -26
- package/dist-server/migrations/1566805283882-SeedPrivilege.js.map +0 -1
- package/dist-server/migrations/index.js +0 -12
- package/dist-server/migrations/index.js.map +0 -1
- package/dist-server/router/auth-checkin-router.js +0 -96
- package/dist-server/router/auth-checkin-router.js.map +0 -1
- package/dist-server/router/auth-private-process-router.js +0 -91
- package/dist-server/router/auth-private-process-router.js.map +0 -1
- package/dist-server/router/auth-public-process-router.js +0 -243
- package/dist-server/router/auth-public-process-router.js.map +0 -1
- package/dist-server/router/auth-signin-router.js +0 -38
- package/dist-server/router/auth-signin-router.js.map +0 -1
- package/dist-server/router/auth-signup-router.js +0 -76
- package/dist-server/router/auth-signup-router.js.map +0 -1
- package/dist-server/router/index.js +0 -25
- package/dist-server/router/index.js.map +0 -1
- package/dist-server/router/oauth2/index.js +0 -19
- package/dist-server/router/oauth2/index.js.map +0 -1
- package/dist-server/router/oauth2/oauth2-authorize-router.js +0 -72
- package/dist-server/router/oauth2/oauth2-authorize-router.js.map +0 -1
- package/dist-server/router/oauth2/oauth2-router.js +0 -137
- package/dist-server/router/oauth2/oauth2-router.js.map +0 -1
- package/dist-server/router/oauth2/oauth2-server.js +0 -201
- package/dist-server/router/oauth2/oauth2-server.js.map +0 -1
- package/dist-server/router/oauth2/passport-oauth2-client-password.js +0 -84
- package/dist-server/router/oauth2/passport-oauth2-client-password.js.map +0 -1
- package/dist-server/router/oauth2/passport-refresh-token.js +0 -84
- package/dist-server/router/oauth2/passport-refresh-token.js.map +0 -1
- package/dist-server/router/path-base-domain-router.js +0 -15
- package/dist-server/router/path-base-domain-router.js.map +0 -1
- package/dist-server/router/site-root-router.js +0 -48
- package/dist-server/router/site-root-router.js.map +0 -1
- package/dist-server/routes.js +0 -58
- package/dist-server/routes.js.map +0 -1
- package/dist-server/service/app-binding/app-binding-mutation.js +0 -45
- package/dist-server/service/app-binding/app-binding-mutation.js.map +0 -1
- package/dist-server/service/app-binding/app-binding-query.js +0 -135
- package/dist-server/service/app-binding/app-binding-query.js.map +0 -1
- package/dist-server/service/app-binding/app-binding-types.js +0 -29
- package/dist-server/service/app-binding/app-binding-types.js.map +0 -1
- package/dist-server/service/app-binding/app-binding.js +0 -34
- package/dist-server/service/app-binding/app-binding.js.map +0 -1
- package/dist-server/service/app-binding/index.js +0 -7
- package/dist-server/service/app-binding/index.js.map +0 -1
- package/dist-server/service/appliance/appliance-mutation.js +0 -117
- package/dist-server/service/appliance/appliance-mutation.js.map +0 -1
- package/dist-server/service/appliance/appliance-query.js +0 -85
- package/dist-server/service/appliance/appliance-query.js.map +0 -1
- package/dist-server/service/appliance/appliance-types.js +0 -93
- package/dist-server/service/appliance/appliance-types.js.map +0 -1
- package/dist-server/service/appliance/appliance.js +0 -155
- package/dist-server/service/appliance/appliance.js.map +0 -1
- package/dist-server/service/appliance/index.js +0 -9
- package/dist-server/service/appliance/index.js.map +0 -1
- package/dist-server/service/application/application-mutation.js +0 -121
- package/dist-server/service/application/application-mutation.js.map +0 -1
- package/dist-server/service/application/application-query.js +0 -128
- package/dist-server/service/application/application-query.js.map +0 -1
- package/dist-server/service/application/application-types.js +0 -119
- package/dist-server/service/application/application-types.js.map +0 -1
- package/dist-server/service/application/application.js +0 -236
- package/dist-server/service/application/application.js.map +0 -1
- package/dist-server/service/application/index.js +0 -9
- package/dist-server/service/application/index.js.map +0 -1
- package/dist-server/service/domain-generator/domain-generator-mutation.js +0 -117
- package/dist-server/service/domain-generator/domain-generator-mutation.js.map +0 -1
- package/dist-server/service/domain-generator/domain-generator-types.js +0 -79
- package/dist-server/service/domain-generator/domain-generator-types.js.map +0 -1
- package/dist-server/service/domain-generator/index.js +0 -6
- package/dist-server/service/domain-generator/index.js.map +0 -1
- package/dist-server/service/granted-role/granted-role-mutation.js +0 -144
- package/dist-server/service/granted-role/granted-role-mutation.js.map +0 -1
- package/dist-server/service/granted-role/granted-role-query.js +0 -93
- package/dist-server/service/granted-role/granted-role-query.js.map +0 -1
- package/dist-server/service/granted-role/granted-role.js +0 -49
- package/dist-server/service/granted-role/granted-role.js.map +0 -1
- package/dist-server/service/granted-role/index.js +0 -9
- package/dist-server/service/granted-role/index.js.map +0 -1
- package/dist-server/service/index.js +0 -94
- package/dist-server/service/index.js.map +0 -1
- package/dist-server/service/invitation/index.js +0 -9
- package/dist-server/service/invitation/index.js.map +0 -1
- package/dist-server/service/invitation/invitation-mutation.js +0 -76
- package/dist-server/service/invitation/invitation-mutation.js.map +0 -1
- package/dist-server/service/invitation/invitation-query.js +0 -57
- package/dist-server/service/invitation/invitation-query.js.map +0 -1
- package/dist-server/service/invitation/invitation-types.js +0 -29
- package/dist-server/service/invitation/invitation-types.js.map +0 -1
- package/dist-server/service/invitation/invitation.js +0 -84
- package/dist-server/service/invitation/invitation.js.map +0 -1
- package/dist-server/service/login-history/index.js +0 -8
- package/dist-server/service/login-history/index.js.map +0 -1
- package/dist-server/service/login-history/login-history-query.js +0 -67
- package/dist-server/service/login-history/login-history-query.js.map +0 -1
- package/dist-server/service/login-history/login-history.js +0 -68
- package/dist-server/service/login-history/login-history.js.map +0 -1
- package/dist-server/service/partner/index.js +0 -9
- package/dist-server/service/partner/index.js.map +0 -1
- package/dist-server/service/partner/partner-mutation.js +0 -134
- package/dist-server/service/partner/partner-mutation.js.map +0 -1
- package/dist-server/service/partner/partner-query.js +0 -193
- package/dist-server/service/partner/partner-query.js.map +0 -1
- package/dist-server/service/partner/partner-types.js +0 -57
- package/dist-server/service/partner/partner-types.js.map +0 -1
- package/dist-server/service/partner/partner.js +0 -86
- package/dist-server/service/partner/partner.js.map +0 -1
- package/dist-server/service/password-history/index.js +0 -6
- package/dist-server/service/password-history/index.js.map +0 -1
- package/dist-server/service/password-history/password-history.js +0 -34
- package/dist-server/service/password-history/password-history.js.map +0 -1
- package/dist-server/service/privilege/index.js +0 -9
- package/dist-server/service/privilege/index.js.map +0 -1
- package/dist-server/service/privilege/privilege-directive.js +0 -85
- package/dist-server/service/privilege/privilege-directive.js.map +0 -1
- package/dist-server/service/privilege/privilege-mutation.js +0 -80
- package/dist-server/service/privilege/privilege-mutation.js.map +0 -1
- package/dist-server/service/privilege/privilege-query.js +0 -109
- package/dist-server/service/privilege/privilege-query.js.map +0 -1
- package/dist-server/service/privilege/privilege-types.js +0 -100
- package/dist-server/service/privilege/privilege-types.js.map +0 -1
- package/dist-server/service/privilege/privilege.js +0 -92
- package/dist-server/service/privilege/privilege.js.map +0 -1
- package/dist-server/service/role/index.js +0 -9
- package/dist-server/service/role/index.js.map +0 -1
- package/dist-server/service/role/role-mutation.js +0 -121
- package/dist-server/service/role/role-mutation.js.map +0 -1
- package/dist-server/service/role/role-query.js +0 -207
- package/dist-server/service/role/role-query.js.map +0 -1
- package/dist-server/service/role/role-types.js +0 -130
- package/dist-server/service/role/role-types.js.map +0 -1
- package/dist-server/service/role/role.js +0 -94
- package/dist-server/service/role/role.js.map +0 -1
- package/dist-server/service/user/index.js +0 -9
- package/dist-server/service/user/index.js.map +0 -1
- package/dist-server/service/user/user-mutation.js +0 -307
- package/dist-server/service/user/user-mutation.js.map +0 -1
- package/dist-server/service/user/user-query.js +0 -194
- package/dist-server/service/user/user-query.js.map +0 -1
- package/dist-server/service/user/user-types.js +0 -106
- package/dist-server/service/user/user-types.js.map +0 -1
- package/dist-server/service/user/user.js +0 -274
- package/dist-server/service/user/user.js.map +0 -1
- package/dist-server/service/verification-token/index.js +0 -6
- package/dist-server/service/verification-token/index.js.map +0 -1
- package/dist-server/service/verification-token/verification-token.js +0 -75
- package/dist-server/service/verification-token/verification-token.js.map +0 -1
- package/dist-server/templates/account-unlock-email.js +0 -69
- package/dist-server/templates/account-unlock-email.js.map +0 -1
- package/dist-server/templates/invitation-email.js +0 -70
- package/dist-server/templates/invitation-email.js.map +0 -1
- package/dist-server/templates/reset-password-email.js +0 -66
- package/dist-server/templates/reset-password-email.js.map +0 -1
- package/dist-server/templates/verification-email.js +0 -70
- package/dist-server/templates/verification-email.js.map +0 -1
- package/dist-server/utils/accepts.js +0 -14
- package/dist-server/utils/accepts.js.map +0 -1
- package/dist-server/utils/access-token-cookie.js +0 -45
- package/dist-server/utils/access-token-cookie.js.map +0 -1
- package/dist-server/utils/check-user-belongs-domain.js +0 -22
- package/dist-server/utils/check-user-belongs-domain.js.map +0 -1
- package/dist-server/utils/get-domain-from-hostname.js +0 -10
- package/dist-server/utils/get-domain-from-hostname.js.map +0 -1
- package/dist-server/utils/get-domain-users.js +0 -31
- package/dist-server/utils/get-domain-users.js.map +0 -1
- package/dist-server/utils/get-secret.js +0 -15
- package/dist-server/utils/get-secret.js.map +0 -1
- package/dist-server/utils/get-user-domains.js +0 -40
- package/dist-server/utils/get-user-domains.js.map +0 -1
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.GrantedRoleQuery = void 0;
|
|
16
|
-
const type_graphql_1 = require("type-graphql");
|
|
17
|
-
const typeorm_1 = require("typeorm");
|
|
18
|
-
const granted_role_1 = require("./granted-role");
|
|
19
|
-
const partner_1 = require("../partner/partner");
|
|
20
|
-
const shell_1 = require("@things-factory/shell");
|
|
21
|
-
const role_1 = require("../role/role");
|
|
22
|
-
let GrantedRoleQuery = class GrantedRoleQuery {
|
|
23
|
-
async grantedRoles(context) {
|
|
24
|
-
const { domain } = context.state;
|
|
25
|
-
return await (0, typeorm_1.getRepository)(granted_role_1.GrantedRole).find({
|
|
26
|
-
where: { domain }
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* @summary The role list that target customer being granted by domain.
|
|
31
|
-
*
|
|
32
|
-
* @param customerId
|
|
33
|
-
* @param context
|
|
34
|
-
* @returns
|
|
35
|
-
*/
|
|
36
|
-
async grantingRoles(customerId, context) {
|
|
37
|
-
const { domain } = context.state;
|
|
38
|
-
const customerDomain = await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(customerId);
|
|
39
|
-
if (!customerDomain)
|
|
40
|
-
throw new Error(`Failed to find customer by passed customerId (${customerId})`);
|
|
41
|
-
const hasPartnership = Boolean(await (0, typeorm_1.getRepository)(partner_1.Partner).count({ domain, partnerDomain: customerDomain }));
|
|
42
|
-
if (!hasPartnership)
|
|
43
|
-
throw new Error(`Company doesn't have partnership with ${customerDomain.name}`);
|
|
44
|
-
const qb = (0, typeorm_1.getRepository)(granted_role_1.GrantedRole)
|
|
45
|
-
.createQueryBuilder('GRANTED_ROLE')
|
|
46
|
-
.leftJoin('GRANTED_ROLE.role', 'ROLE')
|
|
47
|
-
.where('GRANTED_ROLE.domain_id = :customerId', { customerId })
|
|
48
|
-
.andWhere('ROLE.domain_id = :domainId ', { domainId: domain.id });
|
|
49
|
-
return await qb.getMany();
|
|
50
|
-
}
|
|
51
|
-
async role(grantedRole) {
|
|
52
|
-
return await (0, typeorm_1.getRepository)(role_1.Role).findOne(grantedRole.roleId);
|
|
53
|
-
}
|
|
54
|
-
async domain(grantedRole) {
|
|
55
|
-
return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(grantedRole.domainId);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
__decorate([
|
|
59
|
-
(0, type_graphql_1.Directive)('@privilege(category: "user", privilege: "query", domainOwnerGranted: true)'),
|
|
60
|
-
(0, type_graphql_1.Query)(returns => [granted_role_1.GrantedRole]),
|
|
61
|
-
__param(0, (0, type_graphql_1.Ctx)()),
|
|
62
|
-
__metadata("design:type", Function),
|
|
63
|
-
__metadata("design:paramtypes", [Object]),
|
|
64
|
-
__metadata("design:returntype", Promise)
|
|
65
|
-
], GrantedRoleQuery.prototype, "grantedRoles", null);
|
|
66
|
-
__decorate([
|
|
67
|
-
(0, type_graphql_1.Directive)('@privilege(category: "user", privilege: "query", domainOwnerGranted: true)'),
|
|
68
|
-
(0, type_graphql_1.Query)(returns => [granted_role_1.GrantedRole]),
|
|
69
|
-
__param(0, (0, type_graphql_1.Arg)('customerId')),
|
|
70
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
71
|
-
__metadata("design:type", Function),
|
|
72
|
-
__metadata("design:paramtypes", [String, Object]),
|
|
73
|
-
__metadata("design:returntype", Promise)
|
|
74
|
-
], GrantedRoleQuery.prototype, "grantingRoles", null);
|
|
75
|
-
__decorate([
|
|
76
|
-
(0, type_graphql_1.FieldResolver)(type => role_1.Role),
|
|
77
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
78
|
-
__metadata("design:type", Function),
|
|
79
|
-
__metadata("design:paramtypes", [granted_role_1.GrantedRole]),
|
|
80
|
-
__metadata("design:returntype", Promise)
|
|
81
|
-
], GrantedRoleQuery.prototype, "role", null);
|
|
82
|
-
__decorate([
|
|
83
|
-
(0, type_graphql_1.FieldResolver)(type => shell_1.Domain),
|
|
84
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
85
|
-
__metadata("design:type", Function),
|
|
86
|
-
__metadata("design:paramtypes", [granted_role_1.GrantedRole]),
|
|
87
|
-
__metadata("design:returntype", Promise)
|
|
88
|
-
], GrantedRoleQuery.prototype, "domain", null);
|
|
89
|
-
GrantedRoleQuery = __decorate([
|
|
90
|
-
(0, type_graphql_1.Resolver)(granted_role_1.GrantedRole)
|
|
91
|
-
], GrantedRoleQuery);
|
|
92
|
-
exports.GrantedRoleQuery = GrantedRoleQuery;
|
|
93
|
-
//# sourceMappingURL=granted-role-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"granted-role-query.js","sourceRoot":"","sources":["../../../server/service/granted-role/granted-role-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+CAAwF;AACxF,qCAA2D;AAC3D,iDAA4C;AAC5C,gDAA4C;AAC5C,iDAA8C;AAC9C,uCAAmC;A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CAAS,WAAwB;QACzC,OAAO,MAAM,IAAA,uBAAa,EAAC,WAAI,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAC9D,CAAC;IAGK,AAAN,KAAK,CAAC,MAAM,CAAS,WAAwB;QAC3C,OAAO,MAAM,IAAA,uBAAa,EAAC,cAAM,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IAClE,CAAC;CACF,CAAA;AA9CO;IAFL,IAAA,wBAAS,EAAC,4EAA4E,CAAC;IACvF,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC;IACZ,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAKxB;AAWK;IAFL,IAAA,wBAAS,EAAC,4EAA4E,CAAC;IACvF,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC;IACX,WAAA,IAAA,kBAAG,EAAC,YAAY,CAAC,CAAA;IAAsB,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAmBhE;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAc,0BAAW;;4CAE1C;AAGK;IADL,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,WAAA,IAAA,mBAAI,GAAE,CAAA;;qCAAc,0BAAW;;8CAE5C;AAhDU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,0BAAW,CAAC;GACT,gBAAgB,CAiD5B;AAjDY,4CAAgB"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var _a;
|
|
12
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.GrantedRole = void 0;
|
|
14
|
-
const shell_1 = require("@things-factory/shell");
|
|
15
|
-
const role_1 = require("../role/role");
|
|
16
|
-
const type_graphql_1 = require("type-graphql");
|
|
17
|
-
const typeorm_1 = require("typeorm");
|
|
18
|
-
let GrantedRole = class GrantedRole {
|
|
19
|
-
};
|
|
20
|
-
__decorate([
|
|
21
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
23
|
-
__metadata("design:type", String)
|
|
24
|
-
], GrantedRole.prototype, "id", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, typeorm_1.ManyToOne)(type => role_1.Role),
|
|
27
|
-
(0, type_graphql_1.Field)(),
|
|
28
|
-
__metadata("design:type", role_1.Role)
|
|
29
|
-
], GrantedRole.prototype, "role", void 0);
|
|
30
|
-
__decorate([
|
|
31
|
-
(0, typeorm_1.RelationId)((grantedRole) => grantedRole.role),
|
|
32
|
-
__metadata("design:type", String)
|
|
33
|
-
], GrantedRole.prototype, "roleId", void 0);
|
|
34
|
-
__decorate([
|
|
35
|
-
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
36
|
-
(0, type_graphql_1.Field)(),
|
|
37
|
-
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
38
|
-
], GrantedRole.prototype, "domain", void 0);
|
|
39
|
-
__decorate([
|
|
40
|
-
(0, typeorm_1.RelationId)((grantedRole) => grantedRole.domain),
|
|
41
|
-
__metadata("design:type", String)
|
|
42
|
-
], GrantedRole.prototype, "domainId", void 0);
|
|
43
|
-
GrantedRole = __decorate([
|
|
44
|
-
(0, typeorm_1.Entity)(),
|
|
45
|
-
(0, typeorm_1.Index)('ix_granted_role_0', (grantedRole) => [grantedRole.role, grantedRole.domain], { unique: true }),
|
|
46
|
-
(0, type_graphql_1.ObjectType)()
|
|
47
|
-
], GrantedRole);
|
|
48
|
-
exports.GrantedRole = GrantedRole;
|
|
49
|
-
//# sourceMappingURL=granted-role.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"granted-role.js","sourceRoot":"","sources":["../../../server/service/granted-role/granted-role.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,iDAA8C;AAC9C,uCAAmC;AACnC,+CAAoD;AACpD,qCAAsF;AAK/E,IAAM,WAAW,GAAjB,MAAM,WAAW;CAkBvB,CAAA;AAjBC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;uCACC;AAEnB;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,CAAC;IACvB,IAAA,oBAAK,GAAE;8BACF,WAAI;yCAAA;AAEV;IAAC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;;2CAC7C;AAEd;IAAC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,GAAE;kDACA,cAAM,oBAAN,cAAM;2CAAA;AAEd;IAAC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC;;6CAC7C;AAjBL,WAAW;IAHvB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,mBAAmB,EAAE,CAAC,WAAwB,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,WAAW,CAAC,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClH,IAAA,yBAAU,GAAE;GACA,WAAW,CAkBvB;AAlBY,kCAAW"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolvers = exports.entities = void 0;
|
|
4
|
-
const granted_role_1 = require("./granted-role");
|
|
5
|
-
const granted_role_query_1 = require("./granted-role-query");
|
|
6
|
-
const granted_role_mutation_1 = require("./granted-role-mutation");
|
|
7
|
-
exports.entities = [granted_role_1.GrantedRole];
|
|
8
|
-
exports.resolvers = [granted_role_query_1.GrantedRoleQuery, granted_role_mutation_1.GrantedRoleMutation];
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/granted-role/index.ts"],"names":[],"mappings":";;;AAAA,iDAA4C;AAC5C,6DAAuD;AACvD,mEAA6D;AAEhD,QAAA,QAAQ,GAAG,CAAC,0BAAW,CAAC,CAAA;AACxB,QAAA,SAAS,GAAG,CAAC,qCAAgB,EAAE,2CAAmB,CAAC,CAAA"}
|
|
@@ -1,94 +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
|
-
exports.terminateGrantedRoles = exports.schema = exports.entities = void 0;
|
|
18
|
-
/* IMPORT ENTITIES AND RESOLVERS */
|
|
19
|
-
const app_binding_1 = require("./app-binding");
|
|
20
|
-
const appliance_1 = require("./appliance");
|
|
21
|
-
const application_1 = require("./application");
|
|
22
|
-
const domain_generator_1 = require("./domain-generator");
|
|
23
|
-
const granted_role_1 = require("./granted-role");
|
|
24
|
-
const invitation_1 = require("./invitation");
|
|
25
|
-
const login_history_1 = require("./login-history");
|
|
26
|
-
const partner_1 = require("./partner");
|
|
27
|
-
const password_history_1 = require("./password-history");
|
|
28
|
-
const privilege_1 = require("./privilege");
|
|
29
|
-
const privilege_directive_1 = require("./privilege/privilege-directive");
|
|
30
|
-
const role_1 = require("./role");
|
|
31
|
-
const user_1 = require("./user");
|
|
32
|
-
const verification_token_1 = require("./verification-token");
|
|
33
|
-
/* EXPORT ENTITY TYPES */
|
|
34
|
-
__exportStar(require("./application/application"), exports);
|
|
35
|
-
__exportStar(require("./appliance/appliance"), exports);
|
|
36
|
-
__exportStar(require("./privilege/privilege"), exports);
|
|
37
|
-
__exportStar(require("./role/role"), exports);
|
|
38
|
-
__exportStar(require("./user/user"), exports);
|
|
39
|
-
__exportStar(require("./partner/partner"), exports);
|
|
40
|
-
__exportStar(require("./granted-role/granted-role"), exports);
|
|
41
|
-
__exportStar(require("./invitation/invitation"), exports);
|
|
42
|
-
__exportStar(require("./app-binding/app-binding"), exports);
|
|
43
|
-
__exportStar(require("./password-history/password-history"), exports);
|
|
44
|
-
__exportStar(require("./verification-token/verification-token"), exports);
|
|
45
|
-
__exportStar(require("./login-history/login-history"), exports);
|
|
46
|
-
/* EXPORT TYPES */
|
|
47
|
-
__exportStar(require("./app-binding/app-binding-types"), exports);
|
|
48
|
-
__exportStar(require("./appliance/appliance-types"), exports);
|
|
49
|
-
__exportStar(require("./application/application-types"), exports);
|
|
50
|
-
__exportStar(require("./domain-generator/domain-generator-types"), exports);
|
|
51
|
-
__exportStar(require("./invitation/invitation-types"), exports);
|
|
52
|
-
__exportStar(require("./partner/partner-types"), exports);
|
|
53
|
-
__exportStar(require("./privilege/privilege-types"), exports);
|
|
54
|
-
__exportStar(require("./role/role-types"), exports);
|
|
55
|
-
__exportStar(require("./user/user-types"), exports);
|
|
56
|
-
exports.entities = [
|
|
57
|
-
/* ENTITIES */
|
|
58
|
-
...application_1.entities,
|
|
59
|
-
...appliance_1.entities,
|
|
60
|
-
...privilege_1.entities,
|
|
61
|
-
...role_1.entities,
|
|
62
|
-
...user_1.entities,
|
|
63
|
-
...partner_1.entities,
|
|
64
|
-
...granted_role_1.entities,
|
|
65
|
-
...invitation_1.entities,
|
|
66
|
-
...password_history_1.entities,
|
|
67
|
-
...verification_token_1.entities,
|
|
68
|
-
...login_history_1.entities
|
|
69
|
-
];
|
|
70
|
-
exports.schema = {
|
|
71
|
-
typeDefs: {
|
|
72
|
-
privilegeDirectiveTypeDefs: privilege_directive_1.privilegeDirectiveTypeDefs
|
|
73
|
-
},
|
|
74
|
-
resolverClasses: [
|
|
75
|
-
/* RESOLVER CLASSES */
|
|
76
|
-
...application_1.resolvers,
|
|
77
|
-
...appliance_1.resolvers,
|
|
78
|
-
...privilege_1.resolvers,
|
|
79
|
-
...role_1.resolvers,
|
|
80
|
-
...user_1.resolvers,
|
|
81
|
-
...partner_1.resolvers,
|
|
82
|
-
...granted_role_1.resolvers,
|
|
83
|
-
...invitation_1.resolvers,
|
|
84
|
-
...app_binding_1.resolvers,
|
|
85
|
-
...domain_generator_1.resolvers,
|
|
86
|
-
...login_history_1.resolvers
|
|
87
|
-
],
|
|
88
|
-
directives: {
|
|
89
|
-
privilege: privilege_directive_1.privilegeDirectiveResolver
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
var granted_role_mutation_1 = require("./granted-role/granted-role-mutation");
|
|
93
|
-
Object.defineProperty(exports, "terminateGrantedRoles", { enumerable: true, get: function () { return granted_role_mutation_1.terminateGrantedRoles; } });
|
|
94
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,mCAAmC;AACnC,+CAA+D;AAC/D,2CAA4F;AAC5F,+CAAkG;AAClG,yDAAyE;AACzE,iDAAkG;AAClG,6CAA8F;AAC9F,mDAAqG;AACrG,uCAAsF;AACtF,yDAAwE;AACxE,2CAA4F;AAC5F,yEAAwG;AACxG,iCAA6E;AAC7E,iCAA6E;AAC7E,6DAA4E;AAE5E,yBAAyB;AACzB,4DAAyC;AACzC,wDAAqC;AACrC,wDAAqC;AACrC,8CAA2B;AAC3B,8CAA2B;AAC3B,oDAAiC;AACjC,8DAA2C;AAC3C,0DAAuC;AACvC,4DAAyC;AACzC,sEAAmD;AACnD,0EAAuD;AACvD,gEAA6C;AAE7C,kBAAkB;AAClB,kEAA+C;AAC/C,8DAA2C;AAC3C,kEAA+C;AAC/C,4EAAyD;AACzD,gEAA6C;AAC7C,0DAAuC;AACvC,8DAA2C;AAC3C,oDAAiC;AACjC,oDAAiC;AAEpB,QAAA,QAAQ,GAAG;IACtB,cAAc;IACd,GAAG,sBAAmB;IACtB,GAAG,oBAAiB;IACpB,GAAG,oBAAiB;IACpB,GAAG,eAAY;IACf,GAAG,eAAY;IACf,GAAG,kBAAe;IAClB,GAAG,uBAAmB;IACtB,GAAG,qBAAkB;IACrB,GAAG,2BAAuB;IAC1B,GAAG,6BAAyB;IAC5B,GAAG,wBAAoB;CACxB,CAAA;AAEY,QAAA,MAAM,GAAG;IACpB,QAAQ,EAAE;QACR,0BAA0B,EAA1B,gDAA0B;KAC3B;IAED,eAAe,EAAE;QACf,sBAAsB;QACtB,GAAG,uBAAoB;QACvB,GAAG,qBAAkB;QACrB,GAAG,qBAAkB;QACrB,GAAG,gBAAa;QAChB,GAAG,gBAAa;QAChB,GAAG,mBAAgB;QACnB,GAAG,wBAAmB;QACtB,GAAG,sBAAkB;QACrB,GAAG,uBAAkB;QACrB,GAAG,4BAAuB;QAC1B,GAAG,yBAAoB;KACxB;IACD,UAAU,EAAE;QACV,SAAS,EAAE,gDAA0B;KACtC;CACF,CAAA;AAED,8EAA4E;AAAnE,8HAAA,qBAAqB,OAAA"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolvers = exports.entities = void 0;
|
|
4
|
-
const invitation_1 = require("./invitation");
|
|
5
|
-
const invitation_query_1 = require("./invitation-query");
|
|
6
|
-
const invitation_mutation_1 = require("./invitation-mutation");
|
|
7
|
-
exports.entities = [invitation_1.Invitation];
|
|
8
|
-
exports.resolvers = [invitation_query_1.InvitationQuery, invitation_mutation_1.InvitationMutation];
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/invitation/index.ts"],"names":[],"mappings":";;;AAAA,6CAAyC;AACzC,yDAAoD;AACpD,+DAA0D;AAE7C,QAAA,QAAQ,GAAG,CAAC,uBAAU,CAAC,CAAA;AACvB,QAAA,SAAS,GAAG,CAAC,kCAAe,EAAE,wCAAkB,CAAC,CAAA"}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.InvitationMutation = void 0;
|
|
16
|
-
const type_graphql_1 = require("type-graphql");
|
|
17
|
-
const typeorm_1 = require("typeorm");
|
|
18
|
-
const invitation_1 = require("./invitation");
|
|
19
|
-
const invitation_2 = require("../../controllers/invitation");
|
|
20
|
-
let InvitationMutation = class InvitationMutation {
|
|
21
|
-
async cancelInvitation(email, reference, type) {
|
|
22
|
-
const repository = (0, typeorm_1.getRepository)(invitation_1.Invitation);
|
|
23
|
-
await repository.delete({
|
|
24
|
-
email,
|
|
25
|
-
reference,
|
|
26
|
-
type
|
|
27
|
-
});
|
|
28
|
-
return true;
|
|
29
|
-
}
|
|
30
|
-
async sendInvitation(email, reference, type, context) {
|
|
31
|
-
const repository = (0, typeorm_1.getRepository)(invitation_1.Invitation);
|
|
32
|
-
const oldone = await repository.findOne({
|
|
33
|
-
email,
|
|
34
|
-
type,
|
|
35
|
-
reference
|
|
36
|
-
});
|
|
37
|
-
// TODO send invitation
|
|
38
|
-
await (0, invitation_2.sendInvitationEmail)({
|
|
39
|
-
invitation: {
|
|
40
|
-
email,
|
|
41
|
-
reference,
|
|
42
|
-
type
|
|
43
|
-
},
|
|
44
|
-
context
|
|
45
|
-
});
|
|
46
|
-
// update or create
|
|
47
|
-
return await repository.save(Object.assign(Object.assign({}, oldone), { // take only id from oldone for update
|
|
48
|
-
email,
|
|
49
|
-
reference,
|
|
50
|
-
type, creator: context.state.user, updater: context.state.user }));
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, type_graphql_1.Mutation)(returns => Boolean),
|
|
55
|
-
__param(0, (0, type_graphql_1.Arg)('email')),
|
|
56
|
-
__param(1, (0, type_graphql_1.Arg)('reference')),
|
|
57
|
-
__param(2, (0, type_graphql_1.Arg)('type')),
|
|
58
|
-
__metadata("design:type", Function),
|
|
59
|
-
__metadata("design:paramtypes", [String, String, String]),
|
|
60
|
-
__metadata("design:returntype", Promise)
|
|
61
|
-
], InvitationMutation.prototype, "cancelInvitation", null);
|
|
62
|
-
__decorate([
|
|
63
|
-
(0, type_graphql_1.Mutation)(returns => invitation_1.Invitation),
|
|
64
|
-
__param(0, (0, type_graphql_1.Arg)('email')),
|
|
65
|
-
__param(1, (0, type_graphql_1.Arg)('reference')),
|
|
66
|
-
__param(2, (0, type_graphql_1.Arg)('type')),
|
|
67
|
-
__param(3, (0, type_graphql_1.Ctx)()),
|
|
68
|
-
__metadata("design:type", Function),
|
|
69
|
-
__metadata("design:paramtypes", [String, String, String, Object]),
|
|
70
|
-
__metadata("design:returntype", Promise)
|
|
71
|
-
], InvitationMutation.prototype, "sendInvitation", null);
|
|
72
|
-
InvitationMutation = __decorate([
|
|
73
|
-
(0, type_graphql_1.Resolver)(invitation_1.Invitation)
|
|
74
|
-
], InvitationMutation);
|
|
75
|
-
exports.InvitationMutation = InvitationMutation;
|
|
76
|
-
//# sourceMappingURL=invitation-mutation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-mutation.js","sourceRoot":"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IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;;;;0DAUpG;AAGK;IADL,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,uBAAU,CAAC;IAE7B,WAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,WAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAChB,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,WAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDA6BP;AAhDU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,uBAAU,CAAC;GACR,kBAAkB,CAiD9B;AAjDY,gDAAkB"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.InvitationQuery = void 0;
|
|
16
|
-
const invitation_1 = require("./invitation");
|
|
17
|
-
const type_graphql_1 = require("type-graphql");
|
|
18
|
-
const invitation_types_1 = require("./invitation-types");
|
|
19
|
-
const typeorm_1 = require("typeorm");
|
|
20
|
-
let InvitationQuery = class InvitationQuery {
|
|
21
|
-
async invitation(email, reference, type) {
|
|
22
|
-
return await (0, typeorm_1.getRepository)(invitation_1.Invitation).findOne({
|
|
23
|
-
email,
|
|
24
|
-
reference,
|
|
25
|
-
type
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
async invitations(reference, type) {
|
|
29
|
-
const [items, total] = await (0, typeorm_1.getRepository)(invitation_1.Invitation).findAndCount({
|
|
30
|
-
reference,
|
|
31
|
-
type
|
|
32
|
-
});
|
|
33
|
-
return { items, total };
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
__decorate([
|
|
37
|
-
(0, type_graphql_1.Query)(returns => invitation_1.Invitation),
|
|
38
|
-
__param(0, (0, type_graphql_1.Arg)('email')),
|
|
39
|
-
__param(1, (0, type_graphql_1.Arg)('reference')),
|
|
40
|
-
__param(2, (0, type_graphql_1.Arg)('type')),
|
|
41
|
-
__metadata("design:type", Function),
|
|
42
|
-
__metadata("design:paramtypes", [String, String, String]),
|
|
43
|
-
__metadata("design:returntype", Promise)
|
|
44
|
-
], InvitationQuery.prototype, "invitation", null);
|
|
45
|
-
__decorate([
|
|
46
|
-
(0, type_graphql_1.Query)(returns => invitation_types_1.InvitationList),
|
|
47
|
-
__param(0, (0, type_graphql_1.Arg)('reference')),
|
|
48
|
-
__param(1, (0, type_graphql_1.Arg)('type')),
|
|
49
|
-
__metadata("design:type", Function),
|
|
50
|
-
__metadata("design:paramtypes", [String, String]),
|
|
51
|
-
__metadata("design:returntype", Promise)
|
|
52
|
-
], InvitationQuery.prototype, "invitations", null);
|
|
53
|
-
InvitationQuery = __decorate([
|
|
54
|
-
(0, type_graphql_1.Resolver)(invitation_1.Invitation)
|
|
55
|
-
], InvitationQuery);
|
|
56
|
-
exports.InvitationQuery = InvitationQuery;
|
|
57
|
-
//# sourceMappingURL=invitation-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-query.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,+CAAmD;AACnD,yDAAmD;AACnD,qCAAuC;AAGhC,IAAM,eAAe,GAArB,MAAM,eAAe;IAEpB,AAAN,KAAK,CAAC,UAAU,CAAe,KAAa,EAAoB,SAAiB,EAAe,IAAY;QAC1G,OAAO,MAAM,IAAA,uBAAa,EAAC,uBAAU,CAAC,CAAC,OAAO,CAAC;YAC7C,KAAK;YACL,SAAS;YACT,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;IAGK,AAAN,KAAK,CAAC,WAAW,CAAmB,SAAiB,EAAe,IAAY;QAC9E,MAAM,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,MAAM,IAAA,uBAAa,EAAC,uBAAU,CAAC,CAAC,YAAY,CAAC;YAClE,SAAS;YACT,IAAI;SACL,CAAC,CAAA;QAEF,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAA;IACzB,CAAC;CACF,CAAA;AAjBO;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,uBAAU,CAAC;IACX,WAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IAAiB,WAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAAqB,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;;;;iDAM9F;AAGK;IADL,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iCAAc,CAAC;IACd,WAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAAqB,WAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;;;;kDAOlE;AAlBU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,uBAAU,CAAC;GACR,eAAe,CAmB3B;AAnBY,0CAAe"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.InvitationList = void 0;
|
|
13
|
-
const invitation_1 = require("./invitation");
|
|
14
|
-
const type_graphql_1 = require("type-graphql");
|
|
15
|
-
let InvitationList = class InvitationList {
|
|
16
|
-
};
|
|
17
|
-
__decorate([
|
|
18
|
-
(0, type_graphql_1.Field)(type => [invitation_1.Invitation], { nullable: true }),
|
|
19
|
-
__metadata("design:type", Array)
|
|
20
|
-
], InvitationList.prototype, "items", void 0);
|
|
21
|
-
__decorate([
|
|
22
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
23
|
-
__metadata("design:type", Number)
|
|
24
|
-
], InvitationList.prototype, "total", void 0);
|
|
25
|
-
InvitationList = __decorate([
|
|
26
|
-
(0, type_graphql_1.ObjectType)()
|
|
27
|
-
], InvitationList);
|
|
28
|
-
exports.InvitationList = InvitationList;
|
|
29
|
-
//# sourceMappingURL=invitation-types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-types.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation-types.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAyC;AACzC,+CAAqD;AAG9C,IAAM,cAAc,GAApB,MAAM,cAAc;CAM1B,CAAA;AALC;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,uBAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC7B;AAEnB;IAAC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,kBAAG,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC1B;AALF,cAAc;IAD1B,IAAA,yBAAU,GAAE;GACA,cAAc,CAM1B;AANY,wCAAc"}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.Invitation = void 0;
|
|
13
|
-
const typeorm_1 = require("typeorm");
|
|
14
|
-
const type_graphql_1 = require("type-graphql");
|
|
15
|
-
const user_1 = require("../user/user");
|
|
16
|
-
let Invitation = class Invitation {
|
|
17
|
-
};
|
|
18
|
-
__decorate([
|
|
19
|
-
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
|
-
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
21
|
-
__metadata("design:type", String)
|
|
22
|
-
], Invitation.prototype, "id", void 0);
|
|
23
|
-
__decorate([
|
|
24
|
-
(0, typeorm_1.Column)(),
|
|
25
|
-
(0, type_graphql_1.Field)(),
|
|
26
|
-
__metadata("design:type", String)
|
|
27
|
-
], Invitation.prototype, "email", void 0);
|
|
28
|
-
__decorate([
|
|
29
|
-
(0, typeorm_1.Column)(),
|
|
30
|
-
(0, type_graphql_1.Field)(),
|
|
31
|
-
__metadata("design:type", String)
|
|
32
|
-
], Invitation.prototype, "reference", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
(0, typeorm_1.Column)(),
|
|
35
|
-
(0, type_graphql_1.Field)(),
|
|
36
|
-
__metadata("design:type", String)
|
|
37
|
-
], Invitation.prototype, "type", void 0);
|
|
38
|
-
__decorate([
|
|
39
|
-
(0, typeorm_1.Column)(),
|
|
40
|
-
(0, type_graphql_1.Field)(),
|
|
41
|
-
__metadata("design:type", String)
|
|
42
|
-
], Invitation.prototype, "token", void 0);
|
|
43
|
-
__decorate([
|
|
44
|
-
(0, typeorm_1.CreateDateColumn)({ nullable: true }),
|
|
45
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
-
__metadata("design:type", Date)
|
|
47
|
-
], Invitation.prototype, "createdAt", void 0);
|
|
48
|
-
__decorate([
|
|
49
|
-
(0, typeorm_1.UpdateDateColumn)({ nullable: true }),
|
|
50
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
51
|
-
__metadata("design:type", Date)
|
|
52
|
-
], Invitation.prototype, "updatedAt", void 0);
|
|
53
|
-
__decorate([
|
|
54
|
-
(0, typeorm_1.ManyToOne)(type => user_1.User, {
|
|
55
|
-
nullable: true
|
|
56
|
-
}),
|
|
57
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
58
|
-
__metadata("design:type", user_1.User)
|
|
59
|
-
], Invitation.prototype, "creator", void 0);
|
|
60
|
-
__decorate([
|
|
61
|
-
(0, typeorm_1.RelationId)((invitation) => invitation.creator),
|
|
62
|
-
__metadata("design:type", String)
|
|
63
|
-
], Invitation.prototype, "creatorId", void 0);
|
|
64
|
-
__decorate([
|
|
65
|
-
(0, typeorm_1.ManyToOne)(type => user_1.User, {
|
|
66
|
-
nullable: true
|
|
67
|
-
}),
|
|
68
|
-
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
-
__metadata("design:type", user_1.User)
|
|
70
|
-
], Invitation.prototype, "updater", void 0);
|
|
71
|
-
__decorate([
|
|
72
|
-
(0, typeorm_1.RelationId)((invitation) => invitation.updater),
|
|
73
|
-
__metadata("design:type", String)
|
|
74
|
-
], Invitation.prototype, "updaterId", void 0);
|
|
75
|
-
Invitation = __decorate([
|
|
76
|
-
(0, typeorm_1.Entity)(),
|
|
77
|
-
(0, typeorm_1.Index)('ix_invitation_0', (invitation) => [invitation.email, invitation.reference, invitation.type], {
|
|
78
|
-
unique: true
|
|
79
|
-
}),
|
|
80
|
-
(0, typeorm_1.Index)('ix_invitation_1', (invitation) => [invitation.token], { unique: true }),
|
|
81
|
-
(0, type_graphql_1.ObjectType)()
|
|
82
|
-
], Invitation);
|
|
83
|
-
exports.Invitation = Invitation;
|
|
84
|
-
//# sourceMappingURL=invitation.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCASgB;AAChB,+CAAoD;AACpD,uCAAmC;AAQ5B,IAAM,UAAU,GAAhB,MAAM,UAAU;CA8CtB,CAAA;AA7CC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;sCACC;AAEnB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;yCACK;AAEb;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;6CACS;AAEjB;IAAC,IAA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AiB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAC1F,IAAA,yBAAU,GAAE;GACA,UAAU,CA8CtB;AA9CY,gCAAU"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolvers = exports.entities = void 0;
|
|
4
|
-
const login_history_1 = require("./login-history");
|
|
5
|
-
const login_history_query_1 = require("./login-history-query");
|
|
6
|
-
exports.entities = [login_history_1.LoginHistory];
|
|
7
|
-
exports.resolvers = [login_history_query_1.LoginHistoryQuery];
|
|
8
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../server/service/login-history/index.ts"],"names":[],"mappings":";;;AAAA,mDAA8C;AAC9C,+DAAyD;AAE5C,QAAA,QAAQ,GAAG,CAAC,4BAAY,CAAC,CAAA;AACzB,QAAA,SAAS,GAAG,CAAC,uCAAiB,CAAC,CAAA"}
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.LoginHistoryQuery = void 0;
|
|
16
|
-
const login_history_1 = require("./login-history");
|
|
17
|
-
const type_graphql_1 = require("type-graphql");
|
|
18
|
-
const user_1 = require("../user/user");
|
|
19
|
-
const typeorm_1 = require("typeorm");
|
|
20
|
-
const shell_1 = require("@things-factory/shell");
|
|
21
|
-
let LoginHistoryQuery = class LoginHistoryQuery {
|
|
22
|
-
async myLoginHistories(limit, context) {
|
|
23
|
-
if (!limit)
|
|
24
|
-
limit = 10;
|
|
25
|
-
const user = context.state.user;
|
|
26
|
-
if (!user)
|
|
27
|
-
throw new Error('No user specified');
|
|
28
|
-
return await (0, typeorm_1.getRepository)(login_history_1.LoginHistory).find({
|
|
29
|
-
where: { accessUser: user },
|
|
30
|
-
take: limit,
|
|
31
|
-
order: { accessedAt: 'DESC' }
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
async accessDomain(loginHistory) {
|
|
35
|
-
return await (0, typeorm_1.getRepository)(shell_1.Domain).findOne(loginHistory.accessDomainId);
|
|
36
|
-
}
|
|
37
|
-
async accessUser(loginHistory) {
|
|
38
|
-
return await (0, typeorm_1.getRepository)(user_1.User).findOne(loginHistory.accessUserId);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
__decorate([
|
|
42
|
-
(0, type_graphql_1.Query)(returns => [login_history_1.LoginHistory]),
|
|
43
|
-
__param(0, (0, type_graphql_1.Arg)('limit')),
|
|
44
|
-
__param(1, (0, type_graphql_1.Ctx)()),
|
|
45
|
-
__metadata("design:type", Function),
|
|
46
|
-
__metadata("design:paramtypes", [Number, Object]),
|
|
47
|
-
__metadata("design:returntype", Promise)
|
|
48
|
-
], LoginHistoryQuery.prototype, "myLoginHistories", null);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, type_graphql_1.FieldResolver)(),
|
|
51
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
52
|
-
__metadata("design:type", Function),
|
|
53
|
-
__metadata("design:paramtypes", [login_history_1.LoginHistory]),
|
|
54
|
-
__metadata("design:returntype", Promise)
|
|
55
|
-
], LoginHistoryQuery.prototype, "accessDomain", null);
|
|
56
|
-
__decorate([
|
|
57
|
-
(0, type_graphql_1.FieldResolver)(),
|
|
58
|
-
__param(0, (0, type_graphql_1.Root)()),
|
|
59
|
-
__metadata("design:type", Function),
|
|
60
|
-
__metadata("design:paramtypes", [login_history_1.LoginHistory]),
|
|
61
|
-
__metadata("design:returntype", Promise)
|
|
62
|
-
], LoginHistoryQuery.prototype, "accessUser", null);
|
|
63
|
-
LoginHistoryQuery = __decorate([
|
|
64
|
-
(0, type_graphql_1.Resolver)(login_history_1.LoginHistory)
|
|
65
|
-
], LoginHistoryQuery);
|
|
66
|
-
exports.LoginHistoryQuery = LoginHistoryQuery;
|
|
67
|
-
//# sourceMappingURL=login-history-query.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"login-history-query.js","sourceRoot":"","sources":["../../../server/service/login-history/login-history-query.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAA8C;AAC9C,+CAA6E;AAC7E,uCAAmC;AACnC,qCAAuC;AACvC,iDAA8C;AAGvC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAEtB,AAAN,KAAK,CAAC,gBAAgB,CAAe,KAAa,EAAS,OAAY;QACrE,IAAI,CAAC,KAAK;YAAE,KAAK,GAAG,EAAE,CAAA;QACtB,MAAM,IAAI,GAAS,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA;QACrC,IAAI,CAAC,IAAI;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAA;QAE/C,OAAO,MAAM,IAAA,uBAAa,EAAC,4BAAY,CAAC,CAAC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