@things-factory/auth-base 5.0.0 → 5.0.11
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/config/config.development.js +2 -1
- package/dist-server/constants/error-code.js.map +1 -1
- package/dist-server/constants/error-message.js.map +1 -1
- package/dist-server/constants/max-age.js.map +1 -1
- package/dist-server/controllers/auth.js +5 -18
- package/dist-server/controllers/auth.js.map +1 -1
- package/dist-server/controllers/change-pwd.js +6 -8
- package/dist-server/controllers/change-pwd.js.map +1 -1
- package/dist-server/controllers/checkin.js.map +1 -1
- package/dist-server/controllers/delete-user.js.map +1 -1
- package/dist-server/controllers/invitation.js +3 -8
- package/dist-server/controllers/invitation.js.map +1 -1
- package/dist-server/controllers/profile.js.map +1 -1
- package/dist-server/controllers/reset-password.js +7 -9
- package/dist-server/controllers/reset-password.js.map +1 -1
- package/dist-server/controllers/signin.js.map +1 -1
- package/dist-server/controllers/signup.js.map +1 -1
- package/dist-server/controllers/unlock-user.js.map +1 -1
- package/dist-server/controllers/utils/make-invitation-token.js +2 -4
- package/dist-server/controllers/utils/make-invitation-token.js.map +1 -1
- package/dist-server/controllers/utils/make-verification-token.js +2 -4
- package/dist-server/controllers/utils/make-verification-token.js.map +1 -1
- package/dist-server/controllers/utils/password-rule.js +2 -5
- package/dist-server/controllers/utils/password-rule.js.map +1 -1
- package/dist-server/controllers/utils/save-invitation-token.js.map +1 -1
- package/dist-server/controllers/utils/save-verification-token.js.map +1 -1
- package/dist-server/controllers/verification.js.map +1 -1
- package/dist-server/errors/auth-error.js +2 -24
- package/dist-server/errors/auth-error.js.map +1 -1
- package/dist-server/errors/index.js +3 -16
- package/dist-server/errors/index.js.map +1 -1
- package/dist-server/errors/user-domain-not-match-error.js.map +1 -1
- package/dist-server/index.js +12 -25
- package/dist-server/index.js.map +1 -1
- package/dist-server/middlewares/authenticate-401-middleware.js +0 -6
- package/dist-server/middlewares/authenticate-401-middleware.js.map +1 -1
- package/dist-server/middlewares/domain-authenticate-middleware.js +2 -5
- package/dist-server/middlewares/domain-authenticate-middleware.js.map +1 -1
- package/dist-server/middlewares/graphql-authenticate-middleware.js +1 -3
- package/dist-server/middlewares/graphql-authenticate-middleware.js.map +1 -1
- package/dist-server/middlewares/index.js +6 -24
- package/dist-server/middlewares/index.js.map +1 -1
- package/dist-server/middlewares/jwt-authenticate-middleware.js +5 -11
- package/dist-server/middlewares/jwt-authenticate-middleware.js.map +1 -1
- package/dist-server/middlewares/signin-middleware.js +2 -6
- package/dist-server/middlewares/signin-middleware.js.map +1 -1
- package/dist-server/migrations/1548206416130-SeedUser.js.map +1 -1
- package/dist-server/migrations/1566805283882-SeedPrivilege.js.map +1 -1
- package/dist-server/migrations/index.js.map +1 -1
- package/dist-server/router/auth-checkin-router.js +3 -8
- package/dist-server/router/auth-checkin-router.js.map +1 -1
- package/dist-server/router/auth-private-process-router.js +15 -20
- package/dist-server/router/auth-private-process-router.js.map +1 -1
- package/dist-server/router/auth-public-process-router.js +4 -22
- package/dist-server/router/auth-public-process-router.js.map +1 -1
- package/dist-server/router/auth-signin-router.js +2 -7
- package/dist-server/router/auth-signin-router.js.map +1 -1
- package/dist-server/router/auth-signup-router.js +3 -8
- package/dist-server/router/auth-signup-router.js.map +1 -1
- package/dist-server/router/index.js +9 -22
- package/dist-server/router/index.js.map +1 -1
- package/dist-server/router/oauth2/index.js +3 -16
- package/dist-server/router/oauth2/index.js.map +1 -1
- package/dist-server/router/oauth2/oauth2-authorize-router.js +2 -9
- package/dist-server/router/oauth2/oauth2-authorize-router.js.map +1 -1
- package/dist-server/router/oauth2/oauth2-router.js +5 -10
- package/dist-server/router/oauth2/oauth2-router.js.map +1 -1
- package/dist-server/router/oauth2/oauth2-server.js +2 -14
- package/dist-server/router/oauth2/oauth2-server.js.map +1 -1
- package/dist-server/router/oauth2/passport-oauth2-client-password.js +3 -5
- package/dist-server/router/oauth2/passport-oauth2-client-password.js.map +1 -1
- package/dist-server/router/oauth2/passport-refresh-token.js +3 -5
- package/dist-server/router/oauth2/passport-refresh-token.js.map +1 -1
- package/dist-server/router/path-base-domain-router.js +2 -6
- package/dist-server/router/path-base-domain-router.js.map +1 -1
- package/dist-server/router/site-root-router.js +4 -13
- package/dist-server/router/site-root-router.js.map +1 -1
- package/dist-server/routes.js +2 -9
- package/dist-server/routes.js.map +1 -1
- package/dist-server/service/app-binding/app-binding-mutation.js +10 -23
- package/dist-server/service/app-binding/app-binding-mutation.js.map +1 -1
- package/dist-server/service/app-binding/app-binding-query.js +45 -52
- package/dist-server/service/app-binding/app-binding-query.js.map +1 -1
- package/dist-server/service/app-binding/app-binding-types.js +6 -14
- package/dist-server/service/app-binding/app-binding-types.js.map +1 -1
- package/dist-server/service/app-binding/app-binding.js +8 -16
- package/dist-server/service/app-binding/app-binding.js.map +1 -1
- package/dist-server/service/app-binding/index.js.map +1 -1
- package/dist-server/service/appliance/appliance-mutation.js +27 -41
- package/dist-server/service/appliance/appliance-mutation.js.map +1 -1
- package/dist-server/service/appliance/appliance-query.js +29 -40
- package/dist-server/service/appliance/appliance-query.js.map +1 -1
- package/dist-server/service/appliance/appliance-types.js +34 -42
- package/dist-server/service/appliance/appliance-types.js.map +1 -1
- package/dist-server/service/appliance/appliance.js +35 -46
- package/dist-server/service/appliance/appliance.js.map +1 -1
- package/dist-server/service/appliance/index.js.map +1 -1
- package/dist-server/service/application/application-mutation.js +34 -48
- package/dist-server/service/application/application-mutation.js.map +1 -1
- package/dist-server/service/application/application-query.js +44 -55
- package/dist-server/service/application/application-query.js.map +1 -1
- package/dist-server/service/application/application-types.js +41 -49
- package/dist-server/service/application/application-types.js.map +1 -1
- package/dist-server/service/application/application.js +42 -53
- package/dist-server/service/application/application.js.map +1 -1
- package/dist-server/service/application/index.js.map +1 -1
- package/dist-server/service/domain-generator/domain-generator-mutation.js +14 -25
- package/dist-server/service/domain-generator/domain-generator-mutation.js.map +1 -1
- package/dist-server/service/domain-generator/domain-generator-types.js +26 -34
- package/dist-server/service/domain-generator/domain-generator-types.js.map +1 -1
- package/dist-server/service/domain-generator/index.js.map +1 -1
- package/dist-server/service/granted-role/granted-role-mutation.js +9 -20
- package/dist-server/service/granted-role/granted-role-mutation.js.map +1 -1
- package/dist-server/service/granted-role/granted-role-query.js +23 -34
- package/dist-server/service/granted-role/granted-role-query.js.map +1 -1
- package/dist-server/service/granted-role/granted-role.js +12 -20
- package/dist-server/service/granted-role/granted-role.js.map +1 -1
- package/dist-server/service/granted-role/index.js.map +1 -1
- package/dist-server/service/index.js +22 -35
- package/dist-server/service/index.js.map +1 -1
- package/dist-server/service/invitation/index.js.map +1 -1
- package/dist-server/service/invitation/invitation-mutation.js +17 -28
- package/dist-server/service/invitation/invitation-mutation.js.map +1 -1
- package/dist-server/service/invitation/invitation-query.js +15 -26
- package/dist-server/service/invitation/invitation-query.js.map +1 -1
- package/dist-server/service/invitation/invitation-types.js +6 -14
- package/dist-server/service/invitation/invitation-types.js.map +1 -1
- package/dist-server/service/invitation/invitation.js +24 -32
- package/dist-server/service/invitation/invitation.js.map +1 -1
- package/dist-server/service/login-history/index.js.map +1 -1
- package/dist-server/service/login-history/login-history-query.js +18 -29
- package/dist-server/service/login-history/login-history-query.js.map +1 -1
- package/dist-server/service/login-history/login-history.js +16 -24
- package/dist-server/service/login-history/login-history.js.map +1 -1
- package/dist-server/service/partner/index.js.map +1 -1
- package/dist-server/service/partner/partner-mutation.js +14 -25
- package/dist-server/service/partner/partner-mutation.js.map +1 -1
- package/dist-server/service/partner/partner-query.js +44 -55
- package/dist-server/service/partner/partner-query.js.map +1 -1
- package/dist-server/service/partner/partner-types.js +6 -14
- package/dist-server/service/partner/partner-types.js.map +1 -1
- package/dist-server/service/partner/partner.js +24 -32
- package/dist-server/service/partner/partner.js.map +1 -1
- package/dist-server/service/password-history/index.js.map +1 -1
- package/dist-server/service/password-history/password-history.js +6 -14
- package/dist-server/service/password-history/password-history.js.map +1 -1
- package/dist-server/service/privilege/index.js.map +1 -1
- package/dist-server/service/privilege/privilege-directive.js +2 -5
- package/dist-server/service/privilege/privilege-directive.js.map +1 -1
- package/dist-server/service/privilege/privilege-mutation.js +26 -37
- package/dist-server/service/privilege/privilege-mutation.js.map +1 -1
- package/dist-server/service/privilege/privilege-query.js +35 -46
- package/dist-server/service/privilege/privilege-query.js.map +1 -1
- package/dist-server/service/privilege/privilege-types.js +35 -43
- package/dist-server/service/privilege/privilege-types.js.map +1 -1
- package/dist-server/service/privilege/privilege.js +24 -32
- package/dist-server/service/privilege/privilege.js.map +1 -1
- package/dist-server/service/role/index.js.map +1 -1
- package/dist-server/service/role/role-mutation.js +27 -38
- package/dist-server/service/role/role-mutation.js.map +1 -1
- package/dist-server/service/role/role-query.js +70 -77
- package/dist-server/service/role/role-query.js.map +1 -1
- package/dist-server/service/role/role-types.js +48 -56
- package/dist-server/service/role/role-types.js.map +1 -1
- package/dist-server/service/role/role.js +28 -36
- package/dist-server/service/role/role.js.map +1 -1
- package/dist-server/service/user/index.js.map +1 -1
- package/dist-server/service/user/user-mutation.js +65 -76
- package/dist-server/service/user/user-mutation.js.map +1 -1
- package/dist-server/service/user/user-query.js +59 -70
- package/dist-server/service/user/user-query.js.map +1 -1
- package/dist-server/service/user/user-types.js +40 -48
- package/dist-server/service/user/user-types.js.map +1 -1
- package/dist-server/service/user/user.js +46 -57
- package/dist-server/service/user/user.js.map +1 -1
- package/dist-server/service/verification-token/index.js.map +1 -1
- package/dist-server/service/verification-token/verification-token.js +14 -22
- package/dist-server/service/verification-token/verification-token.js.map +1 -1
- package/dist-server/templates/account-unlock-email.js.map +1 -1
- package/dist-server/templates/invitation-email.js.map +1 -1
- package/dist-server/templates/reset-password-email.js.map +1 -1
- package/dist-server/templates/verification-email.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -0
- package/dist-server/utils/accepts.js.map +1 -1
- package/dist-server/utils/access-token-cookie.js.map +1 -1
- package/dist-server/utils/check-user-belongs-domain.js.map +1 -1
- package/dist-server/utils/get-domain-from-hostname.js.map +1 -1
- package/dist-server/utils/get-domain-users.js.map +1 -1
- package/dist-server/utils/get-secret.js.map +1 -1
- package/dist-server/utils/get-user-domains.js.map +1 -1
- package/package.json +6 -6
- package/server/controllers/change-pwd.ts +10 -13
- package/server/controllers/invitation.ts +5 -10
- package/server/controllers/reset-password.ts +10 -11
- package/server/controllers/utils/password-rule.ts +0 -1
- package/server/middlewares/authenticate-401-middleware.ts +0 -8
- package/server/middlewares/domain-authenticate-middleware.ts +4 -8
- package/server/middlewares/graphql-authenticate-middleware.ts +1 -5
- package/server/middlewares/index.ts +0 -4
- package/server/middlewares/jwt-authenticate-middleware.ts +4 -9
- package/server/middlewares/signin-middleware.ts +6 -5
- package/server/router/auth-checkin-router.ts +4 -6
- package/server/router/auth-private-process-router.ts +16 -17
- package/server/router/auth-public-process-router.ts +4 -34
- package/server/router/auth-signin-router.ts +1 -5
- package/server/router/auth-signup-router.ts +3 -10
- package/server/router/oauth2/oauth2-authorize-router.ts +1 -8
- package/server/router/oauth2/oauth2-router.ts +0 -6
- package/server/router/oauth2/oauth2-server.ts +0 -12
- package/server/router/path-base-domain-router.ts +0 -4
- package/server/router/site-root-router.ts +4 -11
- package/server/routes.ts +8 -13
- package/server/service/app-binding/app-binding-mutation.ts +3 -6
- package/server/service/app-binding/app-binding-query.ts +7 -6
- package/server/service/appliance/appliance-mutation.ts +0 -5
- package/server/service/application/application-mutation.ts +3 -6
- package/server/service/granted-role/granted-role-mutation.ts +1 -1
- package/server/service/privilege/privilege-directive.ts +0 -2
- package/server/service/privilege/privilege-mutation.ts +5 -4
- package/server/service/role/role-query.ts +14 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"granted-role-query.js","sourceRoot":"","sources":["../../../server/service/granted-role/granted-role-query.ts"],"names":[],"mappings":"
|
|
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;AAGnC,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAG3B,KAAK,CAAC,YAAY,CAAQ,OAAY;QACpC,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,OAAO,MAAM,IAAA,uBAAa,EAAC,0BAAW,CAAC,CAAC,IAAI,CAAC;YAC3C,KAAK,EAAE,EAAE,MAAM,EAAE;SAClB,CAAC,CAAA;IACJ,CAAC;IAED;;;;;;OAMG;IAGH,KAAK,CAAC,aAAa,CAAoB,UAAkB,EAAS,OAAY;QAC5E,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,KAAK,CAAA;QAChC,MAAM,cAAc,GAAW,MAAM,IAAA,uBAAa,EAAC,cAAM,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAE9E,IAAI,CAAC,cAAc;YAAE,MAAM,IAAI,KAAK,CAAC,iDAAiD,UAAU,GAAG,CAAC,CAAA;QAEpG,MAAM,cAAc,GAAY,OAAO,CACrC,MAAM,IAAA,uBAAa,EAAC,iBAAO,CAAC,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,CAAC,CAC9E,CAAA;QAED,IAAI,CAAC,cAAc;YAAE,MAAM,IAAI,KAAK,CAAC,yCAAyC,cAAc,CAAC,IAAI,EAAE,CAAC,CAAA;QAEpG,MAAM,EAAE,GAAoC,IAAA,uBAAa,EAAC,0BAAW,CAAC;aACnE,kBAAkB,CAAC,cAAc,CAAC;aAClC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;aACrC,KAAK,CAAC,sCAAsC,EAAE,EAAE,UAAU,EAAE,CAAC;aAC7D,QAAQ,CAAC,6BAA6B,EAAE,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC,CAAA;QAEnE,OAAO,MAAM,EAAE,CAAC,OAAO,EAAE,CAAA;IAC3B,CAAC;IAGD,KAAK,CAAC,IAAI,CAAS,WAAwB;QACzC,OAAO,MAAM,IAAA,uBAAa,EAAC,WAAI,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IAC9D,CAAC;IAGD,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;AA9CC;IAFC,IAAA,wBAAS,EAAC,4EAA4E,CAAC;IACvF,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC;IACZ,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;oDAKxB;AAWD;IAFC,IAAA,wBAAS,EAAC,4EAA4E,CAAC;IACvF,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,0BAAW,CAAC,CAAC;IACX,mBAAA,IAAA,kBAAG,EAAC,YAAY,CAAC,CAAA;IAAsB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;qDAmBhE;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAc,0BAAW;;4CAE1C;AAGD;IADC,IAAA,4BAAa,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IAChB,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAc,0BAAW;;8CAE5C;AAhDU,gBAAgB;IAD5B,IAAA,uBAAQ,EAAC,0BAAW,CAAC;GACT,gBAAgB,CAiD5B;AAjDY,4CAAgB","sourcesContent":["import { Resolver, Directive, Query, FieldResolver, Root, Arg, Ctx } from 'type-graphql'\nimport { getRepository, SelectQueryBuilder } from 'typeorm'\nimport { GrantedRole } from './granted-role'\nimport { Partner } from '../partner/partner'\nimport { Domain } from '@things-factory/shell'\nimport { Role } from '../role/role'\n\n@Resolver(GrantedRole)\nexport class GrantedRoleQuery {\n @Directive('@privilege(category: \"user\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => [GrantedRole])\n async grantedRoles(@Ctx() context: any): Promise<GrantedRole[]> {\n const { domain } = context.state\n return await getRepository(GrantedRole).find({\n where: { domain }\n })\n }\n\n /**\n * @summary The role list that target customer being granted by domain.\n *\n * @param customerId\n * @param context\n * @returns\n */\n @Directive('@privilege(category: \"user\", privilege: \"query\", domainOwnerGranted: true)')\n @Query(returns => [GrantedRole])\n async grantingRoles(@Arg('customerId') customerId: string, @Ctx() context: any): Promise<GrantedRole[]> {\n const { domain } = context.state\n const customerDomain: Domain = await getRepository(Domain).findOne(customerId)\n\n if (!customerDomain) throw new Error(`Failed to find customer by passed customerId (${customerId})`)\n\n const hasPartnership: boolean = Boolean(\n await getRepository(Partner).count({ domain, partnerDomain: customerDomain })\n )\n\n if (!hasPartnership) throw new Error(`Company doesn't have partnership with ${customerDomain.name}`)\n\n const qb: SelectQueryBuilder<GrantedRole> = getRepository(GrantedRole)\n .createQueryBuilder('GRANTED_ROLE')\n .leftJoin('GRANTED_ROLE.role', 'ROLE')\n .where('GRANTED_ROLE.domain_id = :customerId', { customerId })\n .andWhere('ROLE.domain_id = :domainId ', { domainId: domain.id })\n\n return await qb.getMany()\n }\n\n @FieldResolver(type => Role)\n async role(@Root() grantedRole: GrantedRole): Promise<Role> {\n return await getRepository(Role).findOne(grantedRole.roleId)\n }\n\n @FieldResolver(type => Domain)\n async domain(@Root() grantedRole: GrantedRole): Promise<Domain> {\n return await getRepository(Domain).findOne(grantedRole.domainId)\n }\n}\n"]}
|
|
@@ -1,46 +1,38 @@
|
|
|
1
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
2
|
var _a;
|
|
12
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
4
|
exports.GrantedRole = void 0;
|
|
5
|
+
const tslib_1 = require("tslib");
|
|
14
6
|
const shell_1 = require("@things-factory/shell");
|
|
15
7
|
const role_1 = require("../role/role");
|
|
16
8
|
const type_graphql_1 = require("type-graphql");
|
|
17
9
|
const typeorm_1 = require("typeorm");
|
|
18
10
|
let GrantedRole = class GrantedRole {
|
|
19
11
|
};
|
|
20
|
-
__decorate([
|
|
12
|
+
tslib_1.__decorate([
|
|
21
13
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
22
14
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
23
|
-
__metadata("design:type", String)
|
|
15
|
+
tslib_1.__metadata("design:type", String)
|
|
24
16
|
], GrantedRole.prototype, "id", void 0);
|
|
25
|
-
__decorate([
|
|
17
|
+
tslib_1.__decorate([
|
|
26
18
|
(0, typeorm_1.ManyToOne)(type => role_1.Role),
|
|
27
19
|
(0, type_graphql_1.Field)(),
|
|
28
|
-
__metadata("design:type", role_1.Role)
|
|
20
|
+
tslib_1.__metadata("design:type", role_1.Role)
|
|
29
21
|
], GrantedRole.prototype, "role", void 0);
|
|
30
|
-
__decorate([
|
|
22
|
+
tslib_1.__decorate([
|
|
31
23
|
(0, typeorm_1.RelationId)((grantedRole) => grantedRole.role),
|
|
32
|
-
__metadata("design:type", String)
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
33
25
|
], GrantedRole.prototype, "roleId", void 0);
|
|
34
|
-
__decorate([
|
|
26
|
+
tslib_1.__decorate([
|
|
35
27
|
(0, typeorm_1.ManyToOne)(type => shell_1.Domain),
|
|
36
28
|
(0, type_graphql_1.Field)(),
|
|
37
|
-
__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
29
|
+
tslib_1.__metadata("design:type", typeof (_a = typeof shell_1.Domain !== "undefined" && shell_1.Domain) === "function" ? _a : Object)
|
|
38
30
|
], GrantedRole.prototype, "domain", void 0);
|
|
39
|
-
__decorate([
|
|
31
|
+
tslib_1.__decorate([
|
|
40
32
|
(0, typeorm_1.RelationId)((grantedRole) => grantedRole.domain),
|
|
41
|
-
__metadata("design:type", String)
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
42
34
|
], GrantedRole.prototype, "domainId", void 0);
|
|
43
|
-
GrantedRole = __decorate([
|
|
35
|
+
GrantedRole = tslib_1.__decorate([
|
|
44
36
|
(0, typeorm_1.Entity)(),
|
|
45
37
|
(0, typeorm_1.Index)('ix_granted_role_0', (grantedRole) => [grantedRole.role, grantedRole.domain], { unique: true }),
|
|
46
38
|
(0, type_graphql_1.ObjectType)()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"granted-role.js","sourceRoot":"","sources":["../../../server/service/granted-role/granted-role.ts"],"names":[],"mappings":"
|
|
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;AAKtF,IAAa,WAAW,GAAxB,MAAa,WAAW;CAkBvB,CAAA;AAfC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;uCACC;AAInB;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,CAAC;IACvB,IAAA,oBAAK,GAAE;sCACF,WAAI;yCAAA;AAGV;IADC,IAAA,oBAAU,EAAC,CAAC,WAAwB,EAAE,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC;;2CAC7C;AAId;IAFC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,cAAM,CAAC;IACzB,IAAA,oBAAK,GAAE;0DACA,cAAM,oBAAN,cAAM;2CAAA;AAGd;IADC,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","sourcesContent":["import { Domain } from '@things-factory/shell'\nimport { Role } from '../role/role'\nimport { ObjectType, Field, ID } from 'type-graphql'\nimport { Entity, ManyToOne, PrimaryGeneratedColumn, Index, RelationId } from 'typeorm'\n\n@Entity()\n@Index('ix_granted_role_0', (grantedRole: GrantedRole) => [grantedRole.role, grantedRole.domain], { unique: true })\n@ObjectType()\nexport class GrantedRole {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @ManyToOne(type => Role)\n @Field()\n role: Role\n\n @RelationId((grantedRole: GrantedRole) => grantedRole.role)\n roleId: string\n\n @ManyToOne(type => Domain)\n @Field()\n domain: Domain\n\n @RelationId((grantedRole: GrantedRole) => grantedRole.domain)\n domainId: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"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","sourcesContent":["import { GrantedRole } from './granted-role'\nimport { GrantedRoleQuery } from './granted-role-query'\nimport { GrantedRoleMutation } from './granted-role-mutation'\n\nexport const entities = [GrantedRole]\nexport const resolvers = [GrantedRoleQuery, GrantedRoleMutation]\n"]}
|
|
@@ -1,20 +1,7 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.schema = exports.entities = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
18
5
|
/* IMPORT ENTITIES AND RESOLVERS */
|
|
19
6
|
const app_binding_1 = require("./app-binding");
|
|
20
7
|
const appliance_1 = require("./appliance");
|
|
@@ -31,28 +18,28 @@ const role_1 = require("./role");
|
|
|
31
18
|
const user_1 = require("./user");
|
|
32
19
|
const verification_token_1 = require("./verification-token");
|
|
33
20
|
/* 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);
|
|
21
|
+
tslib_1.__exportStar(require("./application/application"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./appliance/appliance"), exports);
|
|
23
|
+
tslib_1.__exportStar(require("./privilege/privilege"), exports);
|
|
24
|
+
tslib_1.__exportStar(require("./role/role"), exports);
|
|
25
|
+
tslib_1.__exportStar(require("./user/user"), exports);
|
|
26
|
+
tslib_1.__exportStar(require("./partner/partner"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./granted-role/granted-role"), exports);
|
|
28
|
+
tslib_1.__exportStar(require("./invitation/invitation"), exports);
|
|
29
|
+
tslib_1.__exportStar(require("./app-binding/app-binding"), exports);
|
|
30
|
+
tslib_1.__exportStar(require("./password-history/password-history"), exports);
|
|
31
|
+
tslib_1.__exportStar(require("./verification-token/verification-token"), exports);
|
|
32
|
+
tslib_1.__exportStar(require("./login-history/login-history"), exports);
|
|
46
33
|
/* 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);
|
|
34
|
+
tslib_1.__exportStar(require("./app-binding/app-binding-types"), exports);
|
|
35
|
+
tslib_1.__exportStar(require("./appliance/appliance-types"), exports);
|
|
36
|
+
tslib_1.__exportStar(require("./application/application-types"), exports);
|
|
37
|
+
tslib_1.__exportStar(require("./domain-generator/domain-generator-types"), exports);
|
|
38
|
+
tslib_1.__exportStar(require("./invitation/invitation-types"), exports);
|
|
39
|
+
tslib_1.__exportStar(require("./partner/partner-types"), exports);
|
|
40
|
+
tslib_1.__exportStar(require("./privilege/privilege-types"), exports);
|
|
41
|
+
tslib_1.__exportStar(require("./role/role-types"), exports);
|
|
42
|
+
tslib_1.__exportStar(require("./user/user-types"), exports);
|
|
56
43
|
exports.entities = [
|
|
57
44
|
/* ENTITIES */
|
|
58
45
|
...application_1.entities,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../server/service/index.ts"],"names":[],"mappings":"
|
|
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,oEAAyC;AACzC,gEAAqC;AACrC,gEAAqC;AACrC,sDAA2B;AAC3B,sDAA2B;AAC3B,4DAAiC;AACjC,sEAA2C;AAC3C,kEAAuC;AACvC,oEAAyC;AACzC,8EAAmD;AACnD,kFAAuD;AACvD,wEAA6C;AAE7C,kBAAkB;AAClB,0EAA+C;AAC/C,sEAA2C;AAC3C,0EAA+C;AAC/C,oFAAyD;AACzD,wEAA6C;AAC7C,kEAAuC;AACvC,sEAA2C;AAC3C,4DAAiC;AACjC,4DAAiC;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","sourcesContent":["/* IMPORT ENTITIES AND RESOLVERS */\nimport { resolvers as AppbindingResolver } from './app-binding'\nimport { entities as ApplianceEntities, resolvers as ApplianceResolvers } from './appliance'\nimport { entities as ApplicationEntities, resolvers as ApplicationResolvers } from './application'\nimport { resolvers as DomainGeneratorResolver } from './domain-generator'\nimport { entities as GrantedRoleEntities, resolvers as GrantedRoleResolver } from './granted-role'\nimport { entities as InvitationEntities, resolvers as InvitationResolver } from './invitation'\nimport { entities as LoginHistoryEntities, resolvers as LoginHistoryResolver } from './login-history'\nimport { entities as PartnerEntities, resolvers as PartnerResolvers } from './partner'\nimport { entities as PasswordHistoryEntities } from './password-history'\nimport { entities as PrivilegeEntities, resolvers as PrivilegeResolvers } from './privilege'\nimport { privilegeDirectiveResolver, privilegeDirectiveTypeDefs } from './privilege/privilege-directive'\nimport { entities as RoleEntities, resolvers as RoleResolvers } from './role'\nimport { entities as UserEntities, resolvers as UserResolvers } from './user'\nimport { entities as VerificationTokenEntities } from './verification-token'\n\n/* EXPORT ENTITY TYPES */\nexport * from './application/application'\nexport * from './appliance/appliance'\nexport * from './privilege/privilege'\nexport * from './role/role'\nexport * from './user/user'\nexport * from './partner/partner'\nexport * from './granted-role/granted-role'\nexport * from './invitation/invitation'\nexport * from './app-binding/app-binding'\nexport * from './password-history/password-history'\nexport * from './verification-token/verification-token'\nexport * from './login-history/login-history'\n\n/* EXPORT TYPES */\nexport * from './app-binding/app-binding-types'\nexport * from './appliance/appliance-types'\nexport * from './application/application-types'\nexport * from './domain-generator/domain-generator-types'\nexport * from './invitation/invitation-types'\nexport * from './partner/partner-types'\nexport * from './privilege/privilege-types'\nexport * from './role/role-types'\nexport * from './user/user-types'\n\nexport const entities = [\n /* ENTITIES */\n ...ApplicationEntities,\n ...ApplianceEntities,\n ...PrivilegeEntities,\n ...RoleEntities,\n ...UserEntities,\n ...PartnerEntities,\n ...GrantedRoleEntities,\n ...InvitationEntities,\n ...PasswordHistoryEntities,\n ...VerificationTokenEntities,\n ...LoginHistoryEntities\n]\n\nexport const schema = {\n typeDefs: {\n privilegeDirectiveTypeDefs\n },\n\n resolverClasses: [\n /* RESOLVER CLASSES */\n ...ApplicationResolvers,\n ...ApplianceResolvers,\n ...PrivilegeResolvers,\n ...RoleResolvers,\n ...UserResolvers,\n ...PartnerResolvers,\n ...GrantedRoleResolver,\n ...InvitationResolver,\n ...AppbindingResolver,\n ...DomainGeneratorResolver,\n ...LoginHistoryResolver\n ],\n directives: {\n privilege: privilegeDirectiveResolver\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"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","sourcesContent":["import { Invitation } from './invitation'\nimport { InvitationQuery } from './invitation-query'\nimport { InvitationMutation } from './invitation-mutation'\n\nexport const entities = [Invitation]\nexport const resolvers = [InvitationQuery, InvitationMutation]\n"]}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.InvitationMutation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const type_graphql_1 = require("type-graphql");
|
|
17
6
|
const typeorm_1 = require("typeorm");
|
|
18
7
|
const invitation_1 = require("./invitation");
|
|
@@ -50,26 +39,26 @@ let InvitationMutation = class InvitationMutation {
|
|
|
50
39
|
type, creator: context.state.user, updater: context.state.user }));
|
|
51
40
|
}
|
|
52
41
|
};
|
|
53
|
-
__decorate([
|
|
42
|
+
tslib_1.__decorate([
|
|
54
43
|
(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)
|
|
44
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('email')),
|
|
45
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('reference')),
|
|
46
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('type')),
|
|
47
|
+
tslib_1.__metadata("design:type", Function),
|
|
48
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String]),
|
|
49
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
61
50
|
], InvitationMutation.prototype, "cancelInvitation", null);
|
|
62
|
-
__decorate([
|
|
51
|
+
tslib_1.__decorate([
|
|
63
52
|
(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)
|
|
53
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('email')),
|
|
54
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('reference')),
|
|
55
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('type')),
|
|
56
|
+
tslib_1.__param(3, (0, type_graphql_1.Ctx)()),
|
|
57
|
+
tslib_1.__metadata("design:type", Function),
|
|
58
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String, Object]),
|
|
59
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
71
60
|
], InvitationMutation.prototype, "sendInvitation", null);
|
|
72
|
-
InvitationMutation = __decorate([
|
|
61
|
+
InvitationMutation = tslib_1.__decorate([
|
|
73
62
|
(0, type_graphql_1.Resolver)(invitation_1.Invitation)
|
|
74
63
|
], InvitationMutation);
|
|
75
64
|
exports.InvitationMutation = InvitationMutation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-mutation.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation-mutation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invitation-mutation.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation-mutation.ts"],"names":[],"mappings":";;;;AAAA,+CAA2D;AAC3D,qCAAuC;AACvC,6CAAyC;AACzC,6DAAkE;AAGlE,IAAa,kBAAkB,GAA/B,MAAa,kBAAkB;IAE7B,KAAK,CAAC,gBAAgB,CAAe,KAAa,EAAoB,SAAiB,EAAe,IAAY;QAChH,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,uBAAU,CAAC,CAAA;QAE5C,MAAM,UAAU,CAAC,MAAM,CAAC;YACtB,KAAK;YACL,SAAS;YACT,IAAI;SACL,CAAC,CAAA;QAEF,OAAO,IAAI,CAAA;IACb,CAAC;IAGD,KAAK,CAAC,cAAc,CACJ,KAAa,EACT,SAAiB,EACtB,IAAY,EAClB,OAAY;QAEnB,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,uBAAU,CAAC,CAAA;QAE5C,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC;YACtC,KAAK;YACL,IAAI;YACJ,SAAS;SACV,CAAC,CAAA;QAEF,uBAAuB;QACvB,MAAM,IAAA,gCAAmB,EAAC;YACxB,UAAU,EAAE;gBACV,KAAK;gBACL,SAAS;gBACT,IAAI;aACL;YACD,OAAO;SACR,CAAC,CAAA;QAEF,mBAAmB;QACnB,OAAO,MAAM,UAAU,CAAC,IAAI,iCACvB,MAAM,KAAE,sCAAsC;YACjD,KAAK;YACL,SAAS;YACT,IAAI,EACJ,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,EAC3B,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC,IAAI,IAC3B,CAAA;IACJ,CAAC;CACF,CAAA;AA/CC;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC;IACL,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;;;;0DAUpG;AAGD;IADC,IAAA,uBAAQ,EAAC,OAAO,CAAC,EAAE,CAAC,uBAAU,CAAC;IAE7B,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IACZ,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAChB,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;IACX,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;wDA6BP;AAhDU,kBAAkB;IAD9B,IAAA,uBAAQ,EAAC,uBAAU,CAAC;GACR,kBAAkB,CAiD9B;AAjDY,gDAAkB","sourcesContent":["import { Arg, Mutation, Resolver, Ctx } from 'type-graphql'\nimport { getRepository } from 'typeorm'\nimport { Invitation } from './invitation'\nimport { sendInvitationEmail } from '../../controllers/invitation'\n\n@Resolver(Invitation)\nexport class InvitationMutation {\n @Mutation(returns => Boolean)\n async cancelInvitation(@Arg('email') email: string, @Arg('reference') reference: string, @Arg('type') type: string) {\n const repository = getRepository(Invitation)\n\n await repository.delete({\n email,\n reference,\n type\n })\n\n return true\n }\n\n @Mutation(returns => Invitation)\n async sendInvitation(\n @Arg('email') email: string,\n @Arg('reference') reference: string,\n @Arg('type') type: string,\n @Ctx() context: any\n ) {\n const repository = getRepository(Invitation)\n\n const oldone = await repository.findOne({\n email,\n type,\n reference\n })\n\n // TODO send invitation\n await sendInvitationEmail({\n invitation: {\n email,\n reference,\n type\n },\n context\n })\n\n // update or create\n return await repository.save({\n ...oldone, // take only id from oldone for update\n email,\n reference,\n type,\n creator: context.state.user,\n updater: context.state.user\n })\n }\n}\n"]}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.InvitationQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const invitation_1 = require("./invitation");
|
|
17
6
|
const type_graphql_1 = require("type-graphql");
|
|
18
7
|
const invitation_types_1 = require("./invitation-types");
|
|
@@ -33,24 +22,24 @@ let InvitationQuery = class InvitationQuery {
|
|
|
33
22
|
return { items, total };
|
|
34
23
|
}
|
|
35
24
|
};
|
|
36
|
-
__decorate([
|
|
25
|
+
tslib_1.__decorate([
|
|
37
26
|
(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)
|
|
27
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('email')),
|
|
28
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('reference')),
|
|
29
|
+
tslib_1.__param(2, (0, type_graphql_1.Arg)('type')),
|
|
30
|
+
tslib_1.__metadata("design:type", Function),
|
|
31
|
+
tslib_1.__metadata("design:paramtypes", [String, String, String]),
|
|
32
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
44
33
|
], InvitationQuery.prototype, "invitation", null);
|
|
45
|
-
__decorate([
|
|
34
|
+
tslib_1.__decorate([
|
|
46
35
|
(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)
|
|
36
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('reference')),
|
|
37
|
+
tslib_1.__param(1, (0, type_graphql_1.Arg)('type')),
|
|
38
|
+
tslib_1.__metadata("design:type", Function),
|
|
39
|
+
tslib_1.__metadata("design:paramtypes", [String, String]),
|
|
40
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
52
41
|
], InvitationQuery.prototype, "invitations", null);
|
|
53
|
-
InvitationQuery = __decorate([
|
|
42
|
+
InvitationQuery = tslib_1.__decorate([
|
|
54
43
|
(0, type_graphql_1.Resolver)(invitation_1.Invitation)
|
|
55
44
|
], InvitationQuery);
|
|
56
45
|
exports.InvitationQuery = InvitationQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-query.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation-query.ts"],"names":[],"mappings":"
|
|
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;AAGvC,IAAa,eAAe,GAA5B,MAAa,eAAe;IAE1B,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;IAGD,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;AAjBC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,uBAAU,CAAC;IACX,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;;;;iDAM9F;AAGD;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,iCAAc,CAAC;IACd,mBAAA,IAAA,kBAAG,EAAC,WAAW,CAAC,CAAA;IAAqB,mBAAA,IAAA,kBAAG,EAAC,MAAM,CAAC,CAAA;;;;kDAOlE;AAlBU,eAAe;IAD3B,IAAA,uBAAQ,EAAC,uBAAU,CAAC;GACR,eAAe,CAmB3B;AAnBY,0CAAe","sourcesContent":["import { Invitation } from './invitation'\nimport { Resolver, Query, Arg } from 'type-graphql'\nimport { InvitationList } from './invitation-types'\nimport { getRepository } from 'typeorm'\n\n@Resolver(Invitation)\nexport class InvitationQuery {\n @Query(returns => Invitation)\n async invitation(@Arg('email') email: string, @Arg('reference') reference: string, @Arg('type') type: string) {\n return await getRepository(Invitation).findOne({\n email,\n reference,\n type\n })\n }\n\n @Query(returns => InvitationList)\n async invitations(@Arg('reference') reference: string, @Arg('type') type: string) {\n const [items, total] = await getRepository(Invitation).findAndCount({\n reference,\n type\n })\n\n return { items, total }\n }\n}\n"]}
|
|
@@ -1,28 +1,20 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.InvitationList = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
13
5
|
const invitation_1 = require("./invitation");
|
|
14
6
|
const type_graphql_1 = require("type-graphql");
|
|
15
7
|
let InvitationList = class InvitationList {
|
|
16
8
|
};
|
|
17
|
-
__decorate([
|
|
9
|
+
tslib_1.__decorate([
|
|
18
10
|
(0, type_graphql_1.Field)(type => [invitation_1.Invitation], { nullable: true }),
|
|
19
|
-
__metadata("design:type", Array)
|
|
11
|
+
tslib_1.__metadata("design:type", Array)
|
|
20
12
|
], InvitationList.prototype, "items", void 0);
|
|
21
|
-
__decorate([
|
|
13
|
+
tslib_1.__decorate([
|
|
22
14
|
(0, type_graphql_1.Field)(type => type_graphql_1.Int, { nullable: true }),
|
|
23
|
-
__metadata("design:type", Number)
|
|
15
|
+
tslib_1.__metadata("design:type", Number)
|
|
24
16
|
], InvitationList.prototype, "total", void 0);
|
|
25
|
-
InvitationList = __decorate([
|
|
17
|
+
InvitationList = tslib_1.__decorate([
|
|
26
18
|
(0, type_graphql_1.ObjectType)()
|
|
27
19
|
], InvitationList);
|
|
28
20
|
exports.InvitationList = InvitationList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation-types.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation-types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invitation-types.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation-types.ts"],"names":[],"mappings":";;;;AAAA,6CAAyC;AACzC,+CAAqD;AAGrD,IAAa,cAAc,GAA3B,MAAa,cAAc;CAM1B,CAAA;AAJC;IADC,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,uBAAU,CAAC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CAC7B;AAGnB;IADC,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","sourcesContent":["import { Invitation } from './invitation'\nimport { ObjectType, Field, Int } from 'type-graphql'\n\n@ObjectType()\nexport class InvitationList {\n @Field(type => [Invitation], { nullable: true })\n items: Invitation[]\n\n @Field(type => Int, { nullable: true })\n total: number\n}\n"]}
|
|
@@ -1,78 +1,70 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
3
|
exports.Invitation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
13
5
|
const typeorm_1 = require("typeorm");
|
|
14
6
|
const type_graphql_1 = require("type-graphql");
|
|
15
7
|
const user_1 = require("../user/user");
|
|
16
8
|
let Invitation = class Invitation {
|
|
17
9
|
};
|
|
18
|
-
__decorate([
|
|
10
|
+
tslib_1.__decorate([
|
|
19
11
|
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
20
12
|
(0, type_graphql_1.Field)(type => type_graphql_1.ID),
|
|
21
|
-
__metadata("design:type", String)
|
|
13
|
+
tslib_1.__metadata("design:type", String)
|
|
22
14
|
], Invitation.prototype, "id", void 0);
|
|
23
|
-
__decorate([
|
|
15
|
+
tslib_1.__decorate([
|
|
24
16
|
(0, typeorm_1.Column)(),
|
|
25
17
|
(0, type_graphql_1.Field)(),
|
|
26
|
-
__metadata("design:type", String)
|
|
18
|
+
tslib_1.__metadata("design:type", String)
|
|
27
19
|
], Invitation.prototype, "email", void 0);
|
|
28
|
-
__decorate([
|
|
20
|
+
tslib_1.__decorate([
|
|
29
21
|
(0, typeorm_1.Column)(),
|
|
30
22
|
(0, type_graphql_1.Field)(),
|
|
31
|
-
__metadata("design:type", String)
|
|
23
|
+
tslib_1.__metadata("design:type", String)
|
|
32
24
|
], Invitation.prototype, "reference", void 0);
|
|
33
|
-
__decorate([
|
|
25
|
+
tslib_1.__decorate([
|
|
34
26
|
(0, typeorm_1.Column)(),
|
|
35
27
|
(0, type_graphql_1.Field)(),
|
|
36
|
-
__metadata("design:type", String)
|
|
28
|
+
tslib_1.__metadata("design:type", String)
|
|
37
29
|
], Invitation.prototype, "type", void 0);
|
|
38
|
-
__decorate([
|
|
30
|
+
tslib_1.__decorate([
|
|
39
31
|
(0, typeorm_1.Column)(),
|
|
40
32
|
(0, type_graphql_1.Field)(),
|
|
41
|
-
__metadata("design:type", String)
|
|
33
|
+
tslib_1.__metadata("design:type", String)
|
|
42
34
|
], Invitation.prototype, "token", void 0);
|
|
43
|
-
__decorate([
|
|
35
|
+
tslib_1.__decorate([
|
|
44
36
|
(0, typeorm_1.CreateDateColumn)({ nullable: true }),
|
|
45
37
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
46
|
-
__metadata("design:type", Date)
|
|
38
|
+
tslib_1.__metadata("design:type", Date)
|
|
47
39
|
], Invitation.prototype, "createdAt", void 0);
|
|
48
|
-
__decorate([
|
|
40
|
+
tslib_1.__decorate([
|
|
49
41
|
(0, typeorm_1.UpdateDateColumn)({ nullable: true }),
|
|
50
42
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
51
|
-
__metadata("design:type", Date)
|
|
43
|
+
tslib_1.__metadata("design:type", Date)
|
|
52
44
|
], Invitation.prototype, "updatedAt", void 0);
|
|
53
|
-
__decorate([
|
|
45
|
+
tslib_1.__decorate([
|
|
54
46
|
(0, typeorm_1.ManyToOne)(type => user_1.User, {
|
|
55
47
|
nullable: true
|
|
56
48
|
}),
|
|
57
49
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
58
|
-
__metadata("design:type", user_1.User)
|
|
50
|
+
tslib_1.__metadata("design:type", user_1.User)
|
|
59
51
|
], Invitation.prototype, "creator", void 0);
|
|
60
|
-
__decorate([
|
|
52
|
+
tslib_1.__decorate([
|
|
61
53
|
(0, typeorm_1.RelationId)((invitation) => invitation.creator),
|
|
62
|
-
__metadata("design:type", String)
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
63
55
|
], Invitation.prototype, "creatorId", void 0);
|
|
64
|
-
__decorate([
|
|
56
|
+
tslib_1.__decorate([
|
|
65
57
|
(0, typeorm_1.ManyToOne)(type => user_1.User, {
|
|
66
58
|
nullable: true
|
|
67
59
|
}),
|
|
68
60
|
(0, type_graphql_1.Field)({ nullable: true }),
|
|
69
|
-
__metadata("design:type", user_1.User)
|
|
61
|
+
tslib_1.__metadata("design:type", user_1.User)
|
|
70
62
|
], Invitation.prototype, "updater", void 0);
|
|
71
|
-
__decorate([
|
|
63
|
+
tslib_1.__decorate([
|
|
72
64
|
(0, typeorm_1.RelationId)((invitation) => invitation.updater),
|
|
73
|
-
__metadata("design:type", String)
|
|
65
|
+
tslib_1.__metadata("design:type", String)
|
|
74
66
|
], Invitation.prototype, "updaterId", void 0);
|
|
75
|
-
Invitation = __decorate([
|
|
67
|
+
Invitation = tslib_1.__decorate([
|
|
76
68
|
(0, typeorm_1.Entity)(),
|
|
77
69
|
(0, typeorm_1.Index)('ix_invitation_0', (invitation) => [invitation.email, invitation.reference, invitation.type], {
|
|
78
70
|
unique: true
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"invitation.js","sourceRoot":"","sources":["../../../server/service/invitation/invitation.ts"],"names":[],"mappings":";;;;AAAA,qCASgB;AAChB,+CAAoD;AACpD,uCAAmC;AAQnC,IAAa,UAAU,GAAvB,MAAa,UAAU;CA8CtB,CAAA;AA3CC;IAFC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;sCACC;AAInB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;yCACK;AAIb;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;6CACS;AAIjB;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;wCACI;AAIZ;IAFC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAK,GAAE;;yCACK;AAIb;IAFC,IAAA,0BAAgB,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACpC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;6CAAA;AAIf;IAFC,IAAA,0BAAgB,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACpC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;6CAAA;AAMf;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,WAAI;2CAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CAC1C;AAMjB;IAJC,IAAA,mBAAS,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,EAAE;QACvB,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACjB,WAAI;2CAAA;AAGb;IADC,IAAA,oBAAU,EAAC,CAAC,UAAsB,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;;6CAC1C;AA7CN,UAAU;IANtB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,iBAAiB,EAAE,CAAC,UAAsB,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,KAAK,EAAE,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,EAAE;QAC/G,MAAM,EAAE,IAAI;KACb,CAAC;IACD,IAAA,eAAK,EAAC,iBAAiB,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","sourcesContent":["import {\n CreateDateColumn,\n UpdateDateColumn,\n Entity,\n Index,\n Column,\n ManyToOne,\n RelationId,\n PrimaryGeneratedColumn\n} from 'typeorm'\nimport { ObjectType, Field, ID } from 'type-graphql'\nimport { User } from '../user/user'\n\n@Entity()\n@Index('ix_invitation_0', (invitation: Invitation) => [invitation.email, invitation.reference, invitation.type], {\n unique: true\n})\n@Index('ix_invitation_1', (invitation: Invitation) => [invitation.token], { unique: true })\n@ObjectType()\nexport class Invitation {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n readonly id: string\n\n @Column()\n @Field()\n email: string\n\n @Column()\n @Field()\n reference: string // company, bizplace\n\n @Column()\n @Field()\n type: string // company, bizplace, .. should think whether this column needs.\n\n @Column()\n @Field()\n token: string\n\n @CreateDateColumn({ nullable: true })\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn({ nullable: true })\n @Field({ nullable: true })\n updatedAt: Date\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n creator: User\n\n @RelationId((invitation: Invitation) => invitation.creator)\n creatorId: string\n\n @ManyToOne(type => User, {\n nullable: true\n })\n @Field({ nullable: true })\n updater: User\n\n @RelationId((invitation: Invitation) => invitation.updater)\n updaterId: string\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
{"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","sourcesContent":["import { LoginHistory } from './login-history'\nimport { LoginHistoryQuery } from './login-history-query'\n\nexport const entities = [LoginHistory]\nexport const resolvers = [LoginHistoryQuery]\n"]}
|
|
@@ -1,18 +1,7 @@
|
|
|
1
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
3
|
exports.LoginHistoryQuery = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
16
5
|
const login_history_1 = require("./login-history");
|
|
17
6
|
const type_graphql_1 = require("type-graphql");
|
|
18
7
|
const user_1 = require("../user/user");
|
|
@@ -38,29 +27,29 @@ let LoginHistoryQuery = class LoginHistoryQuery {
|
|
|
38
27
|
return await (0, typeorm_1.getRepository)(user_1.User).findOne(loginHistory.accessUserId);
|
|
39
28
|
}
|
|
40
29
|
};
|
|
41
|
-
__decorate([
|
|
30
|
+
tslib_1.__decorate([
|
|
42
31
|
(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)
|
|
32
|
+
tslib_1.__param(0, (0, type_graphql_1.Arg)('limit')),
|
|
33
|
+
tslib_1.__param(1, (0, type_graphql_1.Ctx)()),
|
|
34
|
+
tslib_1.__metadata("design:type", Function),
|
|
35
|
+
tslib_1.__metadata("design:paramtypes", [Number, Object]),
|
|
36
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
48
37
|
], LoginHistoryQuery.prototype, "myLoginHistories", null);
|
|
49
|
-
__decorate([
|
|
38
|
+
tslib_1.__decorate([
|
|
50
39
|
(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)
|
|
40
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
41
|
+
tslib_1.__metadata("design:type", Function),
|
|
42
|
+
tslib_1.__metadata("design:paramtypes", [login_history_1.LoginHistory]),
|
|
43
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
55
44
|
], LoginHistoryQuery.prototype, "accessDomain", null);
|
|
56
|
-
__decorate([
|
|
45
|
+
tslib_1.__decorate([
|
|
57
46
|
(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)
|
|
47
|
+
tslib_1.__param(0, (0, type_graphql_1.Root)()),
|
|
48
|
+
tslib_1.__metadata("design:type", Function),
|
|
49
|
+
tslib_1.__metadata("design:paramtypes", [login_history_1.LoginHistory]),
|
|
50
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
62
51
|
], LoginHistoryQuery.prototype, "accessUser", null);
|
|
63
|
-
LoginHistoryQuery = __decorate([
|
|
52
|
+
LoginHistoryQuery = tslib_1.__decorate([
|
|
64
53
|
(0, type_graphql_1.Resolver)(login_history_1.LoginHistory)
|
|
65
54
|
], LoginHistoryQuery);
|
|
66
55
|
exports.LoginHistoryQuery = LoginHistoryQuery;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login-history-query.js","sourceRoot":"","sources":["../../../server/service/login-history/login-history-query.ts"],"names":[],"mappings":"
|
|
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;AAG9C,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAE5B,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,IAAI,CAAC;YAC5C,KAAK,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;YAC3B,IAAI,EAAE,KAAK;YACX,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE;SAC9B,CAAC,CAAA;IACJ,CAAC;IAGD,KAAK,CAAC,YAAY,CAAS,YAA0B;QACnD,OAAO,MAAM,IAAA,uBAAa,EAAC,cAAM,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,CAAA;IACzE,CAAC;IAGD,KAAK,CAAC,UAAU,CAAS,YAA0B;QACjD,OAAO,MAAM,IAAA,uBAAa,EAAC,WAAI,CAAC,CAAC,OAAO,CAAC,YAAY,CAAC,YAAY,CAAC,CAAA;IACrE,CAAC;CACF,CAAA;AArBC;IADC,IAAA,oBAAK,EAAC,OAAO,CAAC,EAAE,CAAC,CAAC,4BAAY,CAAC,CAAC;IACT,mBAAA,IAAA,kBAAG,EAAC,OAAO,CAAC,CAAA;IAAiB,mBAAA,IAAA,kBAAG,GAAE,CAAA;;;;yDAUzD;AAGD;IADC,IAAA,4BAAa,GAAE;IACI,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;qDAEpD;AAGD;IADC,IAAA,4BAAa,GAAE;IACE,mBAAA,IAAA,mBAAI,GAAE,CAAA;;6CAAe,4BAAY;;mDAElD;AAtBU,iBAAiB;IAD7B,IAAA,uBAAQ,EAAC,4BAAY,CAAC;GACV,iBAAiB,CAuB7B;AAvBY,8CAAiB","sourcesContent":["import { LoginHistory } from './login-history'\nimport { Resolver, Query, FieldResolver, Root, Arg, Ctx } from 'type-graphql'\nimport { User } from '../user/user'\nimport { getRepository } from 'typeorm'\nimport { Domain } from '@things-factory/shell'\n\n@Resolver(LoginHistory)\nexport class LoginHistoryQuery {\n @Query(returns => [LoginHistory])\n async myLoginHistories(@Arg('limit') limit: number, @Ctx() context: any): Promise<LoginHistory[]> {\n if (!limit) limit = 10\n const user: User = context.state.user\n if (!user) throw new Error('No user specified')\n\n return await getRepository(LoginHistory).find({\n where: { accessUser: user },\n take: limit,\n order: { accessedAt: 'DESC' }\n })\n }\n\n @FieldResolver()\n async accessDomain(@Root() loginHistory: LoginHistory) {\n return await getRepository(Domain).findOne(loginHistory.accessDomainId)\n }\n\n @FieldResolver()\n async accessUser(@Root() loginHistory: LoginHistory) {\n return await getRepository(User).findOne(loginHistory.accessUserId)\n }\n}\n"]}
|