@darraghor/nest-backend-libs 2.12.18 → 2.13.0
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/README.md +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/invitations/entities/invitation.entity.d.ts +1 -0
- package/dist/invitations/entities/invitation.entity.js +7 -3
- package/dist/invitations/entities/invitation.entity.js.map +1 -1
- package/dist/invitations/invitation.controller.js +1 -1
- package/dist/invitations/invitation.controller.js.map +1 -1
- package/dist/invitations/invitation.service.js +3 -2
- package/dist/invitations/invitation.service.js.map +1 -1
- package/dist/organisation/entities/member-role.entity.d.ts +1 -1
- package/dist/organisation/entities/member-role.entity.js +1 -1
- package/dist/organisation/entities/member-role.entity.js.map +1 -1
- package/dist/organisation/entities/organisation.entity.d.ts +1 -1
- package/dist/organisation/entities/organisation.entity.js +1 -8
- package/dist/organisation/entities/organisation.entity.js.map +1 -1
- package/dist/organisation/organisation.module.js +3 -1
- package/dist/organisation/organisation.module.js.map +1 -1
- package/dist/organisation/organisation.service.js +1 -1
- package/dist/organisation/organisation.service.js.map +1 -1
- package/dist/organisation-memberships/dtos/create-membership-dto.d.ts +4 -0
- package/dist/organisation-memberships/dtos/create-membership-dto.js +27 -0
- package/dist/organisation-memberships/dtos/create-membership-dto.js.map +1 -0
- package/dist/{organisation → organisation-memberships}/entities/organisation-membership.entity.d.ts +1 -1
- package/dist/{organisation → organisation-memberships}/entities/organisation-membership.entity.js +2 -1
- package/dist/organisation-memberships/entities/organisation-membership.entity.js.map +1 -0
- package/dist/organisation-memberships/index.d.ts +1 -0
- package/dist/organisation-memberships/index.js +6 -0
- package/dist/organisation-memberships/index.js.map +1 -0
- package/dist/organisation-memberships/organisation-memberships.controller.d.ts +10 -0
- package/dist/organisation-memberships/organisation-memberships.controller.js +66 -0
- package/dist/organisation-memberships/organisation-memberships.controller.js.map +1 -0
- package/dist/organisation-memberships/organisation-memberships.module.d.ts +2 -0
- package/dist/organisation-memberships/organisation-memberships.module.js +36 -0
- package/dist/organisation-memberships/organisation-memberships.module.js.map +1 -0
- package/dist/organisation-memberships/organisation-memberships.service.d.ts +12 -0
- package/dist/organisation-memberships/organisation-memberships.service.js +109 -0
- package/dist/organisation-memberships/organisation-memberships.service.js.map +1 -0
- package/dist/person/entities/person.entity.d.ts +1 -1
- package/dist/person/entities/person.entity.js +1 -1
- package/dist/person/entities/person.entity.js.map +1 -1
- package/dist/person/person.service.js +1 -1
- package/dist/person/person.service.js.map +1 -1
- package/dist/root-app/core-app.module.js +4 -14
- package/dist/root-app/core-app.module.js.map +1 -1
- package/dist/stripe-client/services/stripe-event-handler.d.ts +1 -1
- package/dist/stripe-client/services/stripe-event-handler.js +37 -8
- package/dist/stripe-client/services/stripe-event-handler.js.map +1 -1
- package/package.json +1 -1
- package/dist/organisation/entities/organisation-membership.entity.js.map +0 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ A controller to generate a customer portal session for authenticated users is ad
|
|
|
15
15
|
|
|
16
16
|
A controller to create a checkout session for either Authenticated or Unauthenticated users (your choice if you want your front end app to force users to auth or not)
|
|
17
17
|
|
|
18
|
-
A handler for the webhook queue events
|
|
18
|
+
A handler for the webhook queue events. You can see an example `StripeEventHandler` in Miller but you will probably want to do different actions for your customers.
|
|
19
19
|
|
|
20
20
|
### Env vars
|
|
21
21
|
|
package/dist/index.d.ts
CHANGED
|
@@ -25,5 +25,7 @@ import { CoreConfigModule } from "./core-config/CoreConfig.module";
|
|
|
25
25
|
import { CliCommandService } from "./runningCommandLine/CliCommandService";
|
|
26
26
|
import { ClaimsAuthorisationGuard } from "./authz/ClaimsAuthorisationGuard";
|
|
27
27
|
import { MandatoryUserClaims } from "./authz/MandatoryUserClaims.decorator";
|
|
28
|
-
|
|
28
|
+
import { OrganisationMembershipsModule } from "./organisation-memberships/organisation-memberships.module";
|
|
29
|
+
export { CoreLoggerService, CoreConfigurationService, SmtpEmailClientModule, CoreModule, CoreConfigModule, SwaggerGen, DefaultAuthGuard, PostgresDatabaseModule as DatabaseModule, JwtStrategy, AuthzModule, Person, PostgresTypeOrmConfigurationProvider as TypeOrmConfigurationProvider, SmtpEmailClient, ValidatedConfigurationService, RequestWithUser, PersonModule, OrganisationModule, PersonService, SqliteDatabaseModule, SqliteDatabaseConfigurationService, TwitterClientService, TwitterAccountModule, EUploadMimeType, RunningCommandLineModule, CliCommandService, ClaimsAuthorisationGuard, MandatoryUserClaims, OrganisationMembershipsModule, };
|
|
29
30
|
export * from "./stripe-client/index";
|
|
31
|
+
export * from "./organisation-memberships/index";
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.MandatoryUserClaims = exports.ClaimsAuthorisationGuard = exports.CliCommandService = exports.RunningCommandLineModule = exports.EUploadMimeType = exports.TwitterAccountModule = exports.TwitterClientService = exports.SqliteDatabaseConfigurationService = exports.SqliteDatabaseModule = exports.PersonService = exports.OrganisationModule = exports.PersonModule = exports.ValidatedConfigurationService = exports.SmtpEmailClient = exports.TypeOrmConfigurationProvider = exports.Person = exports.AuthzModule = exports.JwtStrategy = exports.DatabaseModule = exports.DefaultAuthGuard = exports.SwaggerGen = exports.CoreConfigModule = exports.CoreModule = exports.SmtpEmailClientModule = exports.CoreConfigurationService = exports.CoreLoggerService = void 0;
|
|
20
|
+
exports.OrganisationMembershipsModule = exports.MandatoryUserClaims = exports.ClaimsAuthorisationGuard = exports.CliCommandService = exports.RunningCommandLineModule = exports.EUploadMimeType = exports.TwitterAccountModule = exports.TwitterClientService = exports.SqliteDatabaseConfigurationService = exports.SqliteDatabaseModule = exports.PersonService = exports.OrganisationModule = exports.PersonModule = exports.ValidatedConfigurationService = exports.SmtpEmailClient = exports.TypeOrmConfigurationProvider = exports.Person = exports.AuthzModule = exports.JwtStrategy = exports.DatabaseModule = exports.DefaultAuthGuard = exports.SwaggerGen = exports.CoreConfigModule = exports.CoreModule = exports.SmtpEmailClientModule = exports.CoreConfigurationService = exports.CoreLoggerService = void 0;
|
|
21
21
|
/* eslint-disable unicorn/prefer-export-from */
|
|
22
22
|
const RunningCommandLine_module_1 = require("./runningCommandLine/RunningCommandLine.module");
|
|
23
23
|
Object.defineProperty(exports, "RunningCommandLineModule", { enumerable: true, get: function () { return RunningCommandLine_module_1.RunningCommandLineModule; } });
|
|
@@ -71,5 +71,8 @@ const ClaimsAuthorisationGuard_1 = require("./authz/ClaimsAuthorisationGuard");
|
|
|
71
71
|
Object.defineProperty(exports, "ClaimsAuthorisationGuard", { enumerable: true, get: function () { return ClaimsAuthorisationGuard_1.ClaimsAuthorisationGuard; } });
|
|
72
72
|
const MandatoryUserClaims_decorator_1 = require("./authz/MandatoryUserClaims.decorator");
|
|
73
73
|
Object.defineProperty(exports, "MandatoryUserClaims", { enumerable: true, get: function () { return MandatoryUserClaims_decorator_1.MandatoryUserClaims; } });
|
|
74
|
+
const organisation_memberships_module_1 = require("./organisation-memberships/organisation-memberships.module");
|
|
75
|
+
Object.defineProperty(exports, "OrganisationMembershipsModule", { enumerable: true, get: function () { return organisation_memberships_module_1.OrganisationMembershipsModule; } });
|
|
74
76
|
__exportStar(require("./stripe-client/index"), exports);
|
|
77
|
+
__exportStar(require("./organisation-memberships/index"), exports);
|
|
75
78
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,+CAA+C;AAC/C,8FAAwF;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,+CAA+C;AAC/C,8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+BtE,oGA/BI,mDAAmB,OA+BJ;AA9BvB,gHAAyG;AA+BrG,8GA/BI,+DAA6B,OA+BJ;AAIjC,wDAAsC;AACtC,mEAAiD"}
|
|
@@ -22,6 +22,7 @@ let Invitation = class Invitation {
|
|
|
22
22
|
expiresOn;
|
|
23
23
|
acceptedOn;
|
|
24
24
|
organisation;
|
|
25
|
+
organisationId;
|
|
25
26
|
createdDate;
|
|
26
27
|
updateDate;
|
|
27
28
|
deletedDate;
|
|
@@ -67,11 +68,14 @@ __decorate([
|
|
|
67
68
|
], Invitation.prototype, "acceptedOn", void 0);
|
|
68
69
|
__decorate([
|
|
69
70
|
(0, swagger_1.ApiProperty)(),
|
|
70
|
-
(0, typeorm_1.ManyToOne)(() => organisation_entity_1.Organisation, {
|
|
71
|
-
eager: true,
|
|
72
|
-
}),
|
|
71
|
+
(0, typeorm_1.ManyToOne)(() => organisation_entity_1.Organisation, {}),
|
|
73
72
|
__metadata("design:type", organisation_entity_1.Organisation)
|
|
74
73
|
], Invitation.prototype, "organisation", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, swagger_1.ApiProperty)(),
|
|
76
|
+
(0, typeorm_1.RelationId)((invitation) => invitation.organisation),
|
|
77
|
+
__metadata("design:type", organisation_entity_1.Organisation)
|
|
78
|
+
], Invitation.prototype, "organisationId", void 0);
|
|
75
79
|
__decorate([
|
|
76
80
|
(0, typeorm_1.CreateDateColumn)(),
|
|
77
81
|
(0, swagger_1.ApiProperty)(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.entity.js","sourceRoot":"","sources":["../../../src/invitations/entities/invitation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiE;AAEjE,
|
|
1
|
+
{"version":3,"file":"invitation.entity.js","sourceRoot":"","sources":["../../../src/invitations/entities/invitation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiE;AAEjE,qCAUiB;AACjB,yFAA6E;AAGtE,IAAM,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AAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;8CAAC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,6BAAmB,GAAE;8BACR,IAAI;+CAAC;AAnDV,UAAU;IADtB,IAAA,gBAAM,GAAE;GACI,UAAU,CAoDtB;AApDY,gCAAU"}
|
|
@@ -53,7 +53,7 @@ __decorate([
|
|
|
53
53
|
InvitationController = __decorate([
|
|
54
54
|
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
|
|
55
55
|
(0, swagger_1.ApiBearerAuth)(),
|
|
56
|
-
(0, common_1.Controller)("invitations"),
|
|
56
|
+
(0, common_1.Controller)("organisations/invitations"),
|
|
57
57
|
(0, swagger_1.ApiTags)("organisations"),
|
|
58
58
|
__metadata("design:paramtypes", [invitation_service_1.InvitationService])
|
|
59
59
|
], InvitationController);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.controller.js","sourceRoot":"","sources":["../../src/invitations/invitation.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AAExB,6CAAsE;AAEtE,+CAA2C;AAE3C,oEAAwD;AACxD,6DAAuD;AACvD,uEAAgE;AAMzD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACA;IAA7B,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAI/D,AAAN,KAAK,CAAC,MAAM,CACA,SAA8B,EAC3B,OAAwB;QAEnC,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CACO,IAAY,EAChB,OAAwB;QAEnC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CACpD,IAAI,EACJ,OAAO,CAAC,IAAI,CAAC,EAAE,CAClB,CAAC;QAEF,OAAO,YAAY,CAAC,WAAW,KAAK,SAAS,CAAC;IAClD,CAAC;CACJ,CAAA;AApBS;IAFL,IAAA,aAAI,GAAE;IACN,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,8BAAU,EAAC,CAAC;IAE7B,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,gBAAO,GAAE,CAAA;;qCADS,2CAAmB;;kDAIzC;AAIK;IAFL,IAAA,eAAM,EAAC,OAAO,CAAC;IACf,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,8BAAU,EAAC,CAAC;IAE7B,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;kDAQb;AAxBQ,oBAAoB;IAJhC,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IAC3B,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,
|
|
1
|
+
{"version":3,"file":"invitation.controller.js","sourceRoot":"","sources":["../../src/invitations/invitation.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AAExB,6CAAsE;AAEtE,+CAA2C;AAE3C,oEAAwD;AACxD,6DAAuD;AACvD,uEAAgE;AAMzD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IACA;IAA7B,YAA6B,iBAAoC;QAApC,sBAAiB,GAAjB,iBAAiB,CAAmB;IAAG,CAAC;IAI/D,AAAN,KAAK,CAAC,MAAM,CACA,SAA8B,EAC3B,OAAwB;QAEnC,OAAO,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CACO,IAAY,EAChB,OAAwB;QAEnC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,iBAAiB,CAAC,MAAM,CACpD,IAAI,EACJ,OAAO,CAAC,IAAI,CAAC,EAAE,CAClB,CAAC;QAEF,OAAO,YAAY,CAAC,WAAW,KAAK,SAAS,CAAC;IAClD,CAAC;CACJ,CAAA;AApBS;IAFL,IAAA,aAAI,GAAE;IACN,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,8BAAU,EAAC,CAAC;IAE7B,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,gBAAO,GAAE,CAAA;;qCADS,2CAAmB;;kDAIzC;AAIK;IAFL,IAAA,eAAM,EAAC,OAAO,CAAC;IACf,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,8BAAU,EAAC,CAAC;IAE7B,WAAA,IAAA,cAAK,EAAC,MAAM,CAAC,CAAA;IACb,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;kDAQb;AAxBQ,oBAAoB;IAJhC,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IAC3B,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,2BAA2B,CAAC;IACvC,IAAA,iBAAO,EAAC,eAAe,CAAC;qCAE2B,sCAAiB;GADxD,oBAAoB,CAyBhC;AAzBY,oDAAoB"}
|
|
@@ -39,10 +39,11 @@ let InvitationService = class InvitationService {
|
|
|
39
39
|
organisation: {
|
|
40
40
|
id: createDto.organisationId,
|
|
41
41
|
},
|
|
42
|
+
// and it's not expired
|
|
43
|
+
expiresOn: (0, typeorm_2.MoreThan)(new Date()),
|
|
42
44
|
},
|
|
43
45
|
});
|
|
44
|
-
|
|
45
|
-
if (hasUnexpiredInvitations) {
|
|
46
|
+
if (existingInvitations) {
|
|
46
47
|
throw new Error("An valid invitation already exists for this email address for this organisation");
|
|
47
48
|
}
|
|
48
49
|
// otherwise, create a new invitation
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitation.service.js","sourceRoot":"","sources":["../../src/invitations/invitation.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0C;AAC1C,6CAAiD;AACjD,
|
|
1
|
+
{"version":3,"file":"invitation.service.js","sourceRoot":"","sources":["../../src/invitations/invitation.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0C;AAC1C,6CAAiD;AACjD,qCAA6C;AAC7C,6DAAoD;AAEpD,oEAAwD;AACxD,oFAA0E;AAC1E,sFAA0E;AAC1E,qFAAiF;AAI1E,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAGd;IAEA;IACS;IACA;IANrB,YAEY,oBAA4C,EAE5C,sBAAgD,EACvC,WAA4B,EAC5B,aAA8C;QAJvD,yBAAoB,GAApB,oBAAoB,CAAwB;QAE5C,2BAAsB,GAAtB,sBAAsB,CAA0B;QACvC,gBAAW,GAAX,WAAW,CAAiB;QAC5B,kBAAa,GAAb,aAAa,CAAiC;IAChE,CAAC;IAEJ,KAAK,CAAC,MAAM,CACR,SAA8B,EAC9B,SAAwB;QAExB,MAAM,mBAAmB,GAAG,MAAM,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC;YAC7D,KAAK,EAAE;gBACH,YAAY,EAAE,SAAS,CAAC,YAAY;gBACpC,YAAY,EAAE;oBACV,EAAE,EAAE,SAAS,CAAC,cAAc;iBAC/B;gBACD,uBAAuB;gBACvB,SAAS,EAAE,IAAA,kBAAQ,EAAC,IAAI,IAAI,EAAE,CAAC;aAClC;SACJ,CAAC,CAAC;QAEH,IAAI,mBAAmB,EAAE;YACrB,MAAM,IAAI,KAAK,CACX,iFAAiF,CACpF,CAAC;SACL;QAED,qCAAqC;QACrC,MAAM,iBAAiB,GAAG,IAAI,8BAAU,EAAE,CAAC;QAC3C,iBAAiB,CAAC,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;QACxD,iBAAiB,CAAC,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;QACzC,iBAAiB,CAAC,SAAS,CAAC,OAAO,CAC/B,iBAAiB,CAAC,SAAS,CAAC,OAAO,EAAE,GAAG,CAAC,CAC5C,CAAC;QACF,iBAAi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AAC;IACxD,CAAC;CACJ,CAAA;AA1FY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;IAGJ,WAAA,IAAA,0BAAgB,EAAC,8BAAU,CAAC,CAAA;IAE5B,WAAA,IAAA,0BAAgB,EAAC,kCAAY,CAAC,CAAA;qCADD,oBAAU;QAER,oBAAU;QACZ,sCAAe;QACb,gEAA+B;GAP1D,iBAAiB,CA0F7B;AA1FY,8CAAiB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrganisationMembership } from "
|
|
1
|
+
import { OrganisationMembership } from "../../organisation-memberships/entities/organisation-membership.entity";
|
|
2
2
|
export declare class MembershipRole {
|
|
3
3
|
id: number;
|
|
4
4
|
membership: OrganisationMembership;
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.MembershipRole = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
|
-
const organisation_membership_entity_1 = require("
|
|
15
|
+
const organisation_membership_entity_1 = require("../../organisation-memberships/entities/organisation-membership.entity");
|
|
16
16
|
let MembershipRole = class MembershipRole {
|
|
17
17
|
id;
|
|
18
18
|
membership;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-role.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/member-role.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,qCASiB;AACjB,
|
|
1
|
+
{"version":3,"file":"member-role.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/member-role.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,qCASiB;AACjB,2HAA8G;AAGvG,IAAM,cAAc,GAApB,MAAM,cAAc;IAGvB,EAAE,CAAU;IAGZ,UAAU,CAA0B;IAI7B,YAAY,CAAU;IAG7B,IAAI,CAAU;IAId,WAAW,CAAQ;IAInB,UAAU,CAAQ;IAIlB,WAAW,CAAQ;CACtB,CAAA;AAzBG;IAAC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,GAAE;;0CACF;AAEZ;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uDAAsB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;8BAC7D,uDAAsB;kDAAC;AAEpC;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,oBAAU,EAAC,CAAC,EAAkB,EAAE,EAAE,CAAC,EAAE,CAAC,UAAU,CAAC;;oDACrB;AAE7B;IAAC,IAAA,gBAAM,GAAE;;4CACK;AAEd;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;mDAAC;AAEnB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;kDAAC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;mDAAC;AAzBV,cAAc;IAD1B,IAAA,gBAAM,GAAE;GACI,cAAc,CA0B1B;AA1BY,wCAAc"}
|
|
@@ -12,18 +12,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.Organisation = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
|
-
|
|
16
|
-
const organisation_membership_entity_1 = require("./organisation-membership.entity");
|
|
15
|
+
const organisation_membership_entity_1 = require("../../organisation-memberships/entities/organisation-membership.entity");
|
|
17
16
|
let Organisation = class Organisation {
|
|
18
17
|
id;
|
|
19
18
|
uuid;
|
|
20
19
|
memberships;
|
|
21
|
-
// @OneToMany(() => Invitation, (om) => om.organisation, {
|
|
22
|
-
// eager: true,
|
|
23
|
-
// cascade: ["insert", "update"],
|
|
24
|
-
// })
|
|
25
|
-
// @Index()
|
|
26
|
-
// invitations!: Invitation[];
|
|
27
20
|
name;
|
|
28
21
|
createdDate;
|
|
29
22
|
updateDate;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisation.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/organisation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,qCAYiB;AACjB,
|
|
1
|
+
{"version":3,"file":"organisation.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/organisation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,qCAYiB;AACjB,2HAA8G;AAGvG,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGrB,EAAE,CAAU;IAQL,IAAI,CAAU;IAKrB,WAAW,CAA4B;IAIvC,IAAI,CAAU;IAId,WAAW,CAAQ;IAInB,UAAU,CAAQ;IAIlB,WAAW,CAAQ;IAEnB,4DAA4D;IAItD,AAAN,KAAK,CAAC,UAAU;QACZ,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;YACnB,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;SACzB;IACL,CAAC;CACJ,CAAA;AA1CG;IAAC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,GAAE;;wCACF;AAEZ;IAAC,IAAA,gBAAM,EAAC,MAAM,EAAE;QACZ,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB;KACtC,CAAC;IACD,IAAA,mBAAS,EAAC,MAAM,CAAC;IACjB,IAAA,qBAAW,GAAE;;0CACO;AAErB;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uDAAsB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,YAAY,EAAE;QAC9D,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAChC,CAAC;;iDACqC;AAEvC;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;0CACA;AAEd;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;iDAAC;AAEnB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;gDAAC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;iDAAC;AAMb;IAHL,IAAA,mBAAS,GAAE;IACX,IAAA,qBAAW,GAAE;IACb,IAAA,qBAAW,GAAE;;;;8CAKb;AA1CQ,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CA2CxB;AA3CY,oCAAY"}
|
|
@@ -13,14 +13,16 @@ const organisation_controller_1 = require("./organisation.controller");
|
|
|
13
13
|
const logger_module_1 = require("../logger/logger.module");
|
|
14
14
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
15
15
|
const organisation_entity_1 = require("./entities/organisation.entity");
|
|
16
|
-
const organisation_membership_entity_1 = require("./entities/organisation-membership.entity");
|
|
17
16
|
const member_role_entity_1 = require("./entities/member-role.entity");
|
|
17
|
+
const organisation_membership_entity_1 = require("../organisation-memberships/entities/organisation-membership.entity");
|
|
18
|
+
const organisation_memberships_module_1 = require("../organisation-memberships/organisation-memberships.module");
|
|
18
19
|
let OrganisationModule = class OrganisationModule {
|
|
19
20
|
};
|
|
20
21
|
OrganisationModule = __decorate([
|
|
21
22
|
(0, common_1.Module)({
|
|
22
23
|
imports: [
|
|
23
24
|
logger_module_1.LoggerModule,
|
|
25
|
+
organisation_memberships_module_1.OrganisationMembershipsModule,
|
|
24
26
|
typeorm_1.TypeOrmModule.forFeature([
|
|
25
27
|
organisation_entity_1.Organisation,
|
|
26
28
|
organisation_membership_entity_1.OrganisationMembership,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisation.module.js","sourceRoot":"","sources":["../../src/organisation/organisation.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsC;AACtC,iEAA2D;AAC3D,uEAAiE;AACjE,2DAAqD;AACrD,6CAA8C;AAC9C,wEAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"organisation.module.js","sourceRoot":"","sources":["../../src/organisation/organisation.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsC;AACtC,iEAA2D;AAC3D,uEAAiE;AACjE,2DAAqD;AACrD,6CAA8C;AAC9C,wEAA4D;AAC5D,sEAA6D;AAC7D,wHAA2G;AAC3G,iHAA0G;AAgBnG,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,kBAAkB;IAd9B,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,4BAAY;YACZ,+DAA6B;YAC7B,uBAAa,CAAC,UAAU,CAAC;gBACrB,kCAAY;gBACZ,uDAAsB;gBACtB,mCAAc;aACjB,CAAC;SACL;QACD,WAAW,EAAE,CAAC,gDAAsB,CAAC;QACrC,SAAS,EAAE,CAAC,0CAAmB,CAAC;QAChC,OAAO,EAAE,CAAC,0CAAmB,CAAC;KACjC,CAAC;GACW,kBAAkB,CAAG;AAArB,gDAAkB"}
|
|
@@ -16,9 +16,9 @@ exports.OrganisationService = void 0;
|
|
|
16
16
|
const common_1 = require("@nestjs/common");
|
|
17
17
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
18
|
const typeorm_2 = require("typeorm");
|
|
19
|
+
const organisation_membership_entity_1 = require("../organisation-memberships/entities/organisation-membership.entity");
|
|
19
20
|
const RolesEnum_1 = require("./dto/RolesEnum");
|
|
20
21
|
const member_role_entity_1 = require("./entities/member-role.entity");
|
|
21
|
-
const organisation_membership_entity_1 = require("./entities/organisation-membership.entity");
|
|
22
22
|
const organisation_entity_1 = require("./entities/organisation.entity");
|
|
23
23
|
let OrganisationService = class OrganisationService {
|
|
24
24
|
repository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organisation.service.js","sourceRoot":"","sources":["../../src/organisation/organisation.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0C;AAC1C,6C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,aAAqB;QAC5C,MAAM,UAAU,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,aAAa,CAAC;YACnD,KAAK,EAAE;gBACH,IAAI;gBACJ,WAAW,EAAE;oBACT,MAAM,EAAE;wBACJ,EAAE,EAAE,aAAa;qBACpB;oBACD,KAAK,EAAE;wBACH,IAAI,EAAE,iBAAK,CAAC,KAAK;qBACpB;iBACJ;aACJ;SACJ,CAAC,CAAC;QAEH,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YAC1B,EAAE,EAAE,UAAU,CAAC,EAAE;SACpB,CAAC,CAAC;IACP,CAAC;CACJ,CAAA;AA1GY,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;IAGJ,WAAA,IAAA,0BAAgB,EAAC,kCAAY,CAAC,CAAA;qCACX,oBAAU;GAHzB,mBAAmB,CA0G/B;AA1GY,kDAAmB"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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.CreateUpdateMembershipDto = void 0;
|
|
13
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
14
|
+
class CreateUpdateMembershipDto {
|
|
15
|
+
personId;
|
|
16
|
+
roles;
|
|
17
|
+
}
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, swagger_1.ApiProperty)(),
|
|
20
|
+
__metadata("design:type", Number)
|
|
21
|
+
], CreateUpdateMembershipDto.prototype, "personId", void 0);
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, swagger_1.ApiProperty)({ type: String, isArray: true }),
|
|
24
|
+
__metadata("design:type", Array)
|
|
25
|
+
], CreateUpdateMembershipDto.prototype, "roles", void 0);
|
|
26
|
+
exports.CreateUpdateMembershipDto = CreateUpdateMembershipDto;
|
|
27
|
+
//# sourceMappingURL=create-membership-dto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-membership-dto.js","sourceRoot":"","sources":["../../../src/organisation-memberships/dtos/create-membership-dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,MAAa,yBAAyB;IAElC,QAAQ,CAAU;IAGlB,KAAK,CAAY;CACpB;AALG;IAAC,IAAA,qBAAW,GAAE;;2DACI;AAElB;IAAC,IAAA,qBAAW,EAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;wDAC1B;AALrB,8DAMC"}
|
package/dist/{organisation → organisation-memberships}/entities/organisation-membership.entity.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { MembershipRole } from "../../organisation/entities/member-role.entity";
|
|
1
2
|
import { Organisation } from "../../organisation/entities/organisation.entity";
|
|
2
3
|
import { Person } from "../../person/entities/person.entity";
|
|
3
|
-
import { MembershipRole } from "./member-role.entity";
|
|
4
4
|
export declare class OrganisationMembership {
|
|
5
5
|
id: number;
|
|
6
6
|
uuid: string;
|
package/dist/{organisation → organisation-memberships}/entities/organisation-membership.entity.js
RENAMED
|
@@ -12,9 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.OrganisationMembership = void 0;
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const typeorm_1 = require("typeorm");
|
|
15
|
+
const member_role_entity_1 = require("../../organisation/entities/member-role.entity");
|
|
15
16
|
const organisation_entity_1 = require("../../organisation/entities/organisation.entity");
|
|
16
17
|
const person_entity_1 = require("../../person/entities/person.entity");
|
|
17
|
-
const member_role_entity_1 = require("./member-role.entity");
|
|
18
18
|
let OrganisationMembership = class OrganisationMembership {
|
|
19
19
|
id;
|
|
20
20
|
uuid;
|
|
@@ -22,6 +22,7 @@ let OrganisationMembership = class OrganisationMembership {
|
|
|
22
22
|
personId;
|
|
23
23
|
organisation;
|
|
24
24
|
organisationId;
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
25
26
|
roles;
|
|
26
27
|
createdDate;
|
|
27
28
|
updateDate;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organisation-membership.entity.js","sourceRoot":"","sources":["../../../src/organisation-memberships/entities/organisation-membership.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,qCAciB;AACjB,uFAA8E;AAC9E,yFAA6E;AAC7E,uEAA2D;AAGpD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAG/B,EAAE,CAAU;IAQL,IAAI,CAAU;IAMrB,MAAM,CAAU;IAIT,QAAQ,CAAU;IAMzB,YAAY,CAAgB;IAIrB,cAAc,CAAU;IAE/B,+DAA+D;IAK/D,KAAK,CAAoB;IAIzB,WAAW,CAAQ;IAInB,UAAU,CAAQ;IAIlB,WAAW,CAAQ;IAEnB,4DAA4D;IAItD,AAAN,KAAK,CAAC,UAAU;QACZ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YACb,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;SACnB;IACL,CAAC;CACJ,CAAA;AA5DG;IAAC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,GAAE;;kDACF;AAEZ;IAAC,IAAA,gBAAM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IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;2DAAC;AAMb;IAHL,IAAA,mBAAS,GAAE;IACX,IAAA,qBAAW,GAAE;IACb,IAAA,qBAAW,GAAE;;;;wDAKb;AA5DQ,sBAAsB;IADlC,IAAA,gBAAM,GAAE;GACI,sBAAsB,CA6DlC;AA7DY,wDAAsB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { OrganisationMembershipsService } from "./organisation-memberships.service";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OrganisationMembershipsService = void 0;
|
|
4
|
+
var organisation_memberships_service_1 = require("./organisation-memberships.service");
|
|
5
|
+
Object.defineProperty(exports, "OrganisationMembershipsService", { enumerable: true, get: function () { return organisation_memberships_service_1.OrganisationMembershipsService; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/organisation-memberships/index.ts"],"names":[],"mappings":";;;AAAA,uFAAkF;AAA1E,kJAAA,8BAA8B,OAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RequestWithUser } from "../authz/RequestWithUser";
|
|
2
|
+
import { OrganisationMembershipsService } from "./organisation-memberships.service";
|
|
3
|
+
import { Organisation } from "../organisation/entities/organisation.entity";
|
|
4
|
+
import { CreateUpdateMembershipDto } from "./dtos/create-membership-dto";
|
|
5
|
+
export declare class OrganisationMembershipsController {
|
|
6
|
+
private readonly omService;
|
|
7
|
+
constructor(omService: OrganisationMembershipsService);
|
|
8
|
+
createOrUpdate(orgUuid: string, updateOrganisationDto: CreateUpdateMembershipDto, request: RequestWithUser): Promise<Organisation>;
|
|
9
|
+
remove(orgUuid: string, membershipUuid: string, request: RequestWithUser): Promise<boolean>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
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.OrganisationMembershipsController = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
18
|
+
const passport_1 = require("@nestjs/passport");
|
|
19
|
+
const organisation_memberships_service_1 = require("./organisation-memberships.service");
|
|
20
|
+
const organisation_entity_1 = require("../organisation/entities/organisation.entity");
|
|
21
|
+
const create_membership_dto_1 = require("./dtos/create-membership-dto");
|
|
22
|
+
let OrganisationMembershipsController = class OrganisationMembershipsController {
|
|
23
|
+
omService;
|
|
24
|
+
constructor(omService) {
|
|
25
|
+
this.omService = omService;
|
|
26
|
+
}
|
|
27
|
+
async createOrUpdate(orgUuid, updateOrganisationDto, request) {
|
|
28
|
+
return this.omService.createOrUpdate(orgUuid, updateOrganisationDto, request.user.id);
|
|
29
|
+
}
|
|
30
|
+
async remove(orgUuid, membershipUuid, request) {
|
|
31
|
+
const deleteResult = await this.omService.remove(orgUuid, membershipUuid, request.user.id);
|
|
32
|
+
return (deleteResult !== undefined &&
|
|
33
|
+
deleteResult.affected !== undefined &&
|
|
34
|
+
deleteResult?.affected !== null &&
|
|
35
|
+
deleteResult?.affected > 0);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, common_1.Post)(),
|
|
40
|
+
(0, swagger_1.ApiOkResponse)({ type: organisation_entity_1.Organisation }),
|
|
41
|
+
__param(0, (0, common_1.Param)("orgUuid")),
|
|
42
|
+
__param(1, (0, common_1.Body)()),
|
|
43
|
+
__param(2, (0, common_1.Request)()),
|
|
44
|
+
__metadata("design:type", Function),
|
|
45
|
+
__metadata("design:paramtypes", [String, create_membership_dto_1.CreateUpdateMembershipDto, Object]),
|
|
46
|
+
__metadata("design:returntype", Promise)
|
|
47
|
+
], OrganisationMembershipsController.prototype, "createOrUpdate", null);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, common_1.Delete)(":membershipUuid"),
|
|
50
|
+
(0, swagger_1.ApiOkResponse)({ type: organisation_entity_1.Organisation }),
|
|
51
|
+
__param(0, (0, common_1.Param)("orgUuid")),
|
|
52
|
+
__param(1, (0, common_1.Param)("membershipUuid")),
|
|
53
|
+
__param(2, (0, common_1.Request)()),
|
|
54
|
+
__metadata("design:type", Function),
|
|
55
|
+
__metadata("design:paramtypes", [String, String, Object]),
|
|
56
|
+
__metadata("design:returntype", Promise)
|
|
57
|
+
], OrganisationMembershipsController.prototype, "remove", null);
|
|
58
|
+
OrganisationMembershipsController = __decorate([
|
|
59
|
+
(0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
|
|
60
|
+
(0, swagger_1.ApiBearerAuth)(),
|
|
61
|
+
(0, common_1.Controller)("organisation/:orgUuid/memberships"),
|
|
62
|
+
(0, swagger_1.ApiTags)("organisations"),
|
|
63
|
+
__metadata("design:paramtypes", [organisation_memberships_service_1.OrganisationMembershipsService])
|
|
64
|
+
], OrganisationMembershipsController);
|
|
65
|
+
exports.OrganisationMembershipsController = OrganisationMembershipsController;
|
|
66
|
+
//# sourceMappingURL=organisation-memberships.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organisation-memberships.controller.js","sourceRoot":"","sources":["../../src/organisation-memberships/organisation-memberships.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAQwB;AACxB,6CAAsE;AAEtE,+CAA2C;AAE3C,yFAAkF;AAClF,sFAA0E;AAC1E,wEAAuE;AAMhE,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IACb;IAA7B,YAA6B,SAAyC;QAAzC,cAAS,GAAT,SAAS,CAAgC;IAAG,CAAC;IAIpE,AAAN,KAAK,CAAC,cAAc,CACE,OAAe,EACzB,qBAAgD,EAC7C,OAAwB;QAEnC,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAChC,OAAO,EACP,qBAAqB,EACrB,OAAO,CAAC,IAAI,CAAC,EAAE,CAClB,CAAC;IACN,CAAC;IAIK,AAAN,KAAK,CAAC,MAAM,CACU,OAAe,EACR,cAAsB,EACpC,OAAwB;QAEnC,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,SAAS,CAAC,MAAM,CAC5C,OAAO,EACP,cAAc,EACd,OAAO,CAAC,IAAI,CAAC,EAAE,CAClB,CAAC;QACF,OAAO,CACH,YAAY,KAAK,SAAS;YAC1B,YAAY,CAAC,QAAQ,KAAK,SAAS;YACnC,YAAY,EAAE,QAAQ,KAAK,IAAI;YAC/B,YAAY,EAAE,QAAQ,GAAG,CAAC,CAC7B,CAAC;IACN,CAAC;CACJ,CAAA;AA/BS;IAFL,IAAA,aAAI,GAAE;IACN,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,kCAAY,EAAC,CAAC;IAE/B,WAAA,IAAA,cAAK,EAAC,SAAS,CAAC,CAAA;IAChB,WAAA,IAAA,aAAI,GAAE,CAAA;IACN,WAAA,IAAA,gBAAO,GAAE,CAAA;;6CADqB,iDAAyB;;uEAQ3D;AAIK;IAFL,IAAA,eAAM,EAAC,iBAAiB,CAAC;IACzB,IAAA,uBAAa,EAAC,EAAC,IAAI,EAAE,kCAAY,EAAC,CAAC;IAE/B,WAAA,IAAA,cAAK,EAAC,SAAS,CAAC,CAAA;IAChB,WAAA,IAAA,cAAK,EAAC,gBAAgB,CAAC,CAAA;IACvB,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;+DAab;AAnCQ,iCAAiC;IAJ7C,IAAA,kBAAS,EAAC,IAAA,oBAAS,EAAC,KAAK,CAAC,CAAC;IAC3B,IAAA,uBAAa,GAAE;IACf,IAAA,mBAAU,EAAC,mCAAmC,CAAC;IAC/C,IAAA,iBAAO,EAAC,eAAe,CAAC;qCAEmB,iEAA8B;GAD7D,iCAAiC,CAoC7C;AApCY,8EAAiC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.OrganisationMembershipsModule = void 0;
|
|
10
|
+
const common_1 = require("@nestjs/common");
|
|
11
|
+
const logger_module_1 = require("../logger/logger.module");
|
|
12
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
13
|
+
const organisation_membership_entity_1 = require("./entities/organisation-membership.entity");
|
|
14
|
+
const organisation_memberships_controller_1 = require("./organisation-memberships.controller");
|
|
15
|
+
const organisation_memberships_service_1 = require("./organisation-memberships.service");
|
|
16
|
+
const organisation_entity_1 = require("../organisation/entities/organisation.entity");
|
|
17
|
+
const member_role_entity_1 = require("../organisation/entities/member-role.entity");
|
|
18
|
+
let OrganisationMembershipsModule = class OrganisationMembershipsModule {
|
|
19
|
+
};
|
|
20
|
+
OrganisationMembershipsModule = __decorate([
|
|
21
|
+
(0, common_1.Module)({
|
|
22
|
+
imports: [
|
|
23
|
+
logger_module_1.LoggerModule,
|
|
24
|
+
typeorm_1.TypeOrmModule.forFeature([
|
|
25
|
+
organisation_entity_1.Organisation,
|
|
26
|
+
organisation_membership_entity_1.OrganisationMembership,
|
|
27
|
+
member_role_entity_1.MembershipRole,
|
|
28
|
+
]),
|
|
29
|
+
],
|
|
30
|
+
controllers: [organisation_memberships_controller_1.OrganisationMembershipsController],
|
|
31
|
+
providers: [organisation_memberships_service_1.OrganisationMembershipsService],
|
|
32
|
+
exports: [organisation_memberships_service_1.OrganisationMembershipsService],
|
|
33
|
+
})
|
|
34
|
+
], OrganisationMembershipsModule);
|
|
35
|
+
exports.OrganisationMembershipsModule = OrganisationMembershipsModule;
|
|
36
|
+
//# sourceMappingURL=organisation-memberships.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organisation-memberships.module.js","sourceRoot":"","sources":["../../src/organisation-memberships/organisation-memberships.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAsC;AACtC,2DAAqD;AACrD,6CAA8C;AAC9C,8FAAiF;AACjF,+FAAwF;AACxF,yFAAkF;AAClF,sFAA0E;AAC1E,oFAA2E;AAepE,IAAM,6BAA6B,GAAnC,MAAM,6BAA6B;CAAG,CAAA;AAAhC,6BAA6B;IAbzC,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,4BAAY;YACZ,uBAAa,CAAC,UAAU,CAAC;gBACrB,kCAAY;gBACZ,uDAAsB;gBACtB,mCAAc;aACjB,CAAC;SACL;QACD,WAAW,EAAE,CAAC,uEAAiC,CAAC;QAChD,SAAS,EAAE,CAAC,iEAA8B,CAAC;QAC3C,OAAO,EAAE,CAAC,iEAA8B,CAAC;KAC5C,CAAC;GACW,6BAA6B,CAAG;AAAhC,sEAA6B"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeleteResult, Repository } from "typeorm";
|
|
2
|
+
import { Organisation } from "../organisation/entities/organisation.entity";
|
|
3
|
+
import { CreateUpdateMembershipDto } from "./dtos/create-membership-dto";
|
|
4
|
+
import { OrganisationMembership } from "./entities/organisation-membership.entity";
|
|
5
|
+
export declare class OrganisationMembershipsService {
|
|
6
|
+
private orgRepo;
|
|
7
|
+
private membershipRepo;
|
|
8
|
+
constructor(orgRepo: Repository<Organisation>, membershipRepo: Repository<OrganisationMembership>);
|
|
9
|
+
createOrUpdate(orgUuid: string, createOmDto: CreateUpdateMembershipDto, currentUserId: number): Promise<Organisation>;
|
|
10
|
+
private currentUserIsOwnerGuard;
|
|
11
|
+
remove(orgUuid: string, membershipUuid: string, currentUserId: number): Promise<DeleteResult>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
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.OrganisationMembershipsService = void 0;
|
|
16
|
+
const common_1 = require("@nestjs/common");
|
|
17
|
+
const typeorm_1 = require("@nestjs/typeorm");
|
|
18
|
+
const typeorm_2 = require("typeorm");
|
|
19
|
+
const RolesEnum_1 = require("../organisation/dto/RolesEnum");
|
|
20
|
+
const member_role_entity_1 = require("../organisation/entities/member-role.entity");
|
|
21
|
+
const organisation_entity_1 = require("../organisation/entities/organisation.entity");
|
|
22
|
+
const organisation_membership_entity_1 = require("./entities/organisation-membership.entity");
|
|
23
|
+
let OrganisationMembershipsService = class OrganisationMembershipsService {
|
|
24
|
+
orgRepo;
|
|
25
|
+
membershipRepo;
|
|
26
|
+
constructor(orgRepo, membershipRepo) {
|
|
27
|
+
this.orgRepo = orgRepo;
|
|
28
|
+
this.membershipRepo = membershipRepo;
|
|
29
|
+
}
|
|
30
|
+
async createOrUpdate(orgUuid, createOmDto, currentUserId) {
|
|
31
|
+
// find the org
|
|
32
|
+
const org = await this.orgRepo.findOneOrFail({
|
|
33
|
+
where: {
|
|
34
|
+
uuid: orgUuid,
|
|
35
|
+
},
|
|
36
|
+
relations: {
|
|
37
|
+
memberships: {
|
|
38
|
+
roles: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
});
|
|
42
|
+
// check if the user is allowed to work with memberships
|
|
43
|
+
this.currentUserIsOwnerGuard(org, currentUserId);
|
|
44
|
+
// existing membership for this person?
|
|
45
|
+
const existingMembership = org.memberships.find((m) => m.person.id === createOmDto.personId);
|
|
46
|
+
if (existingMembership) {
|
|
47
|
+
// add all roles to the existing membership
|
|
48
|
+
for (const role of createOmDto.roles) {
|
|
49
|
+
const existingRole = existingMembership.roles.find((r) => r.name === role);
|
|
50
|
+
if (!existingRole) {
|
|
51
|
+
const newRole = new member_role_entity_1.MembershipRole();
|
|
52
|
+
newRole.name = role;
|
|
53
|
+
existingMembership.roles.push(newRole);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
// remove all roles that are not in the DTO
|
|
57
|
+
existingMembership.roles = existingMembership.roles.filter((r) => createOmDto.roles.includes(r.name));
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
// create a new membership
|
|
61
|
+
const newMembership = new organisation_membership_entity_1.OrganisationMembership();
|
|
62
|
+
newMembership.personId = createOmDto.personId;
|
|
63
|
+
for (const role of createOmDto.roles) {
|
|
64
|
+
const newRole = new member_role_entity_1.MembershipRole();
|
|
65
|
+
newRole.name = role;
|
|
66
|
+
newMembership.roles.push(newRole);
|
|
67
|
+
}
|
|
68
|
+
org.memberships.push(newMembership);
|
|
69
|
+
}
|
|
70
|
+
return await this.orgRepo.save(org);
|
|
71
|
+
}
|
|
72
|
+
currentUserIsOwnerGuard(org, currentUserId) {
|
|
73
|
+
const membership = org.memberships.find((m) => m.person.id === currentUserId &&
|
|
74
|
+
m.roles.some((r) => r.name === RolesEnum_1.Roles.owner));
|
|
75
|
+
if (!membership) {
|
|
76
|
+
throw new Error("You are not allowed to add a member to this organisation");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
async remove(orgUuid, membershipUuid, currentUserId) {
|
|
80
|
+
// find the org
|
|
81
|
+
const org = await this.orgRepo.findOneOrFail({
|
|
82
|
+
where: {
|
|
83
|
+
uuid: orgUuid,
|
|
84
|
+
},
|
|
85
|
+
relations: {
|
|
86
|
+
memberships: {
|
|
87
|
+
roles: true,
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
// check if the user is allowed to work with memberships
|
|
92
|
+
this.currentUserIsOwnerGuard(org, currentUserId);
|
|
93
|
+
// remove the membership
|
|
94
|
+
const membership = org.memberships.find((m) => m.uuid === membershipUuid);
|
|
95
|
+
if (!membership) {
|
|
96
|
+
throw new Error("Membership not found");
|
|
97
|
+
}
|
|
98
|
+
return await this.membershipRepo.delete(membership.id);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
OrganisationMembershipsService = __decorate([
|
|
102
|
+
(0, common_1.Injectable)(),
|
|
103
|
+
__param(0, (0, typeorm_1.InjectRepository)(organisation_entity_1.Organisation)),
|
|
104
|
+
__param(1, (0, typeorm_1.InjectRepository)(organisation_membership_entity_1.OrganisationMembership)),
|
|
105
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
106
|
+
typeorm_2.Repository])
|
|
107
|
+
], OrganisationMembershipsService);
|
|
108
|
+
exports.OrganisationMembershipsService = OrganisationMembershipsService;
|
|
109
|
+
//# sourceMappingURL=organisation-memberships.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organisation-memberships.service.js","sourceRoot":"","sources":["../../src/organisation-memberships/organisation-memberships.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAA0C;AAC1C,6CAAiD;AACjD,qCAAiD;AACjD,6DAAoD;AACpD,oFAA2E;AAC3E,sFAA0E;AAE1E,8FAAiF;AAG1E,IAAM,8BAA8B,GAApC,MAAM,8BAA8B;IAG3B;IAEA;IAJZ,YAEY,OAAiC,EAEjC,cAAkD;QAFlD,YAAO,GAAP,OAAO,CAA0B;QAEjC,mBAAc,GAAd,cAAc,CAAoC;IAC3D,CAAC;IAEJ,KAAK,CAAC,cAAc,CAChB,OAAe,EACf,WAAsC,EACtC,aAAqB;QAErB,eAAe;QACf,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC;YACzC,KAAK,EAAE;gBACH,IAAI,EAAE,OAAO;aAChB;YACD,SAAS,EAAE;gBACP,WAAW,EAAE;oBACT,KAAK,EAAE,IAAI;iBACd;aACJ;SACJ,CAAC,CAAC;QAEH,wDAAwD;QACxD,IAAI,CAAC,uBAAuB,CAAC,GAAG,EAAE,aAAa,CAAC,CAAC;QAEjD,uCAAuC;QACvC,MAAM,kBA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AA,IAAA,0BAAgB,EAAC,uDAAsB,CAAC,CAAA;qCADxB,oBAAU;QAEH,oBAAU;GAL7B,8BAA8B,CAyG1C;AAzGY,wEAA8B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OrganisationMembership } from "../../organisation/entities/organisation-membership.entity";
|
|
1
|
+
import { OrganisationMembership } from "../../organisation-memberships/entities/organisation-membership.entity";
|
|
2
2
|
export declare class Person {
|
|
3
3
|
id: number;
|
|
4
4
|
email: string;
|
|
@@ -13,7 +13,7 @@ exports.Person = void 0;
|
|
|
13
13
|
const swagger_1 = require("@nestjs/swagger");
|
|
14
14
|
const class_transformer_1 = require("class-transformer");
|
|
15
15
|
const typeorm_1 = require("typeorm");
|
|
16
|
-
const organisation_membership_entity_1 = require("../../organisation/entities/organisation-membership.entity");
|
|
16
|
+
const organisation_membership_entity_1 = require("../../organisation-memberships/entities/organisation-membership.entity");
|
|
17
17
|
let Person = class Person {
|
|
18
18
|
id;
|
|
19
19
|
email;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.entity.js","sourceRoot":"","sources":["../../../src/person/entities/person.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiE;AACjE,yDAA0C;AAC1C,qCAaiB;AACjB
|
|
1
|
+
{"version":3,"file":"person.entity.js","sourceRoot":"","sources":["../../../src/person/entities/person.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAAiE;AACjE,yDAA0C;AAC1C,qCAaiB;AACjB,2HAA8G;AAGvG,IAAM,MAAM,GAAZ,MAAM,MAAM;IAGf,EAAE,CAAU;IAIZ,KAAK,CAAU;IAQR,IAAI,CAAU;IAIrB,aAAa,CAAW;IAIxB,OAAO,CAAW;IAIlB,IAAI,CAAU;IAId,UAAU,CAAU;IAIpB,SAAS,CAAU;IAInB,OAAO,CAAU;IAKjB,WAAW,CAAU;IAIrB,QAAQ,CAAU;IAMlB,WAAW,CAA4B;IAIvC,WAAW,CAAQ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,6BAAmB,GAAE;IACrB,IAAA,gBAAM,EAAC,EAAC,QAAQ,EAAE,IAAI,EAAC,CAAC;;wCACP;AAElB;IAAC,IAAA,2BAAO,GAAE;IACT,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,uDAAsB,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,MAAM,EAAE;QACxD,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAChC,CAAC;;2CACqC;AAEvC;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;2CAAC;AAEnB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;0CAAC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;2CAAC;AAMb;IAHL,IAAA,mBAAS,GAAE;IACX,IAAA,qBAAW,GAAE;IACb,IAAA,qBAAW,GAAE;;;;wCAKb;AA5EQ,MAAM;IADlB,IAAA,gBAAM,GAAE;GACI,MAAM,CA6ElB;AA7EY,wBAAM"}
|
|
@@ -21,9 +21,9 @@ const typeorm_1 = require("@nestjs/typeorm");
|
|
|
21
21
|
const typeorm_2 = require("typeorm");
|
|
22
22
|
const authz_service_1 = require("../authzclient/authz.service");
|
|
23
23
|
const CoreLoggerService_1 = __importDefault(require("../logger/CoreLoggerService"));
|
|
24
|
+
const organisation_membership_entity_1 = require("../organisation-memberships/entities/organisation-membership.entity");
|
|
24
25
|
const RolesEnum_1 = require("../organisation/dto/RolesEnum");
|
|
25
26
|
const member_role_entity_1 = require("../organisation/entities/member-role.entity");
|
|
26
|
-
const organisation_membership_entity_1 = require("../organisation/entities/organisation-membership.entity");
|
|
27
27
|
const organisation_entity_1 = require("../organisation/entities/organisation.entity");
|
|
28
28
|
const person_entity_1 = require("./entities/person.entity");
|
|
29
29
|
let PersonService = class PersonService {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"person.service.js","sourceRoot":"","sources":["../../src/person/person.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAA6D;AAC7D,6CAAiD;AACjD,qCAAmC;AAEnC,gEAAgE;AAEhE,oFAA4D;AAC5D,6DAAoD;AACpD,oFAA2E;AAC3E,
|
|
1
|
+
{"version":3,"file":"person.service.js","sourceRoot":"","sources":["../../src/person/person.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAA6D;AAC7D,6CAAiD;AACjD,qCAAmC;AAEnC,gEAAgE;AAEhE,oFAA4D;AAC5D,wHAA2G;AAC3G,6DAAoD;AACpD,oFAA2E;AAC3E,sFAA0E;AAE1E,4DAAgD;AAGzC,IAAM,aAAa,GAAnB,MAAM,aAAa;IAGV;IACA;IACA;IAJZ,YAEY,UAA8B,EAC9B,MAAyB,EACzB,WAA+B;QAF/B,eAAU,GAAV,UAAU,CAAoB;QAC9B,WAAM,GAAN,MAAM,CAAmB;QACzB,gBAAW,GAAX,WAAW,CAAoB;IACxC,CAAC;IAEJ,KAAK,CAAC,YAAY,CACd,OAAoB,EACpB,cAAsB;QAEtB,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,CAAC,YAAY,CACd,OAAoB,EACpB,cAAsB;QAEtB,yCAAyC;QACzC,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;YAC9C,KAAK,EAAE,EAAC,WAAW,EAAE,OAAO,CAAC,GAAG,EAAC;YACjC,SAAS,EAAE,CAAC,aAAa,CAAC;SAC7B,CAAC,CAAC;QAEH,oDAAoD;QACpD,IACI,WAAW,KAAK,SAAS;YACzB,WAAW,KAAK,IAAI;YACpB,WAAW,CAAC,WAAW,CAAC,MAAM,GAAG,CAAC,EACpC;YACE,OAAO,WAAW,CAAC;SACtB;QAED,+EAA+E;QAC/E,MAAM,SAAS,GAA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Aa,CAAC;YAC7C,KAAK,EAAE;gBACH,IAAI;aACP;YACD,SAAS,EAAE;gBACP,WAAW,EAAE;oBACT,KAAK,EAAE,IAAI;iBACd;aACJ;SACJ,CAAC,CAAC;QACH,IACI,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACxB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,iBAAK,CAAC,KAAK,CAAC,CAC9C,EACH;YACE,MAAM,IAAI,KAAK,CACX,sEAAsE,CACzE,CAAC;SACL;QAED,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAEO,YAAY,CAChB,IAAY,EACZ,eAAuB,EACvB,eAAuB;QAEvB,IAAI,IAAI,KAAK,eAAe,EAAE;YAC1B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,eAAe,eAAe,EAAE;gBAC7D,eAAe;gBACf,IAAI;aACP,CAAC,CAAC;YACH,MAAM,IAAI,0BAAiB,EAAE,CAAC;SACjC;IACL,CAAC;CACJ,CAAA;AArJY,aAAa;IADzB,IAAA,mBAAU,GAAE;IAGJ,WAAA,IAAA,0BAAgB,EAAC,sBAAM,CAAC,CAAA;qCACL,oBAAU;QACd,2BAAiB;QACZ,kCAAkB;GALlC,aAAa,CAqJzB;AArJY,sCAAa"}
|
|
@@ -74,25 +74,15 @@ CoreModule = __decorate([
|
|
|
74
74
|
logger_module_1.LoggerModule,
|
|
75
75
|
CoreConfig_module_1.CoreConfigModule,
|
|
76
76
|
bull_1.BullModule.forRootAsync({
|
|
77
|
-
imports: [CoreConfig_module_1.CoreConfigModule
|
|
78
|
-
useFactory: async (configService
|
|
77
|
+
imports: [CoreConfig_module_1.CoreConfigModule],
|
|
78
|
+
useFactory: async (configService
|
|
79
79
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
80
80
|
) => {
|
|
81
|
-
console.log("BullModule configService.bullQueueHost", {
|
|
82
|
-
queueHost: configService.bullQueueHost,
|
|
83
|
-
});
|
|
84
|
-
logger.log("BullModule configService.bullQueueHost", {
|
|
85
|
-
queueHost: configService.bullQueueHost,
|
|
86
|
-
});
|
|
87
81
|
return {
|
|
88
|
-
redis:
|
|
89
|
-
host: configService.bullQueueHost,
|
|
90
|
-
commandTimeout: 500,
|
|
91
|
-
maxRetriesPerRequest: 2,
|
|
92
|
-
},
|
|
82
|
+
redis: configService.bullQueueHost,
|
|
93
83
|
};
|
|
94
84
|
},
|
|
95
|
-
inject: [CoreConfigurationService_1.CoreConfigurationService
|
|
85
|
+
inject: [CoreConfigurationService_1.CoreConfigurationService],
|
|
96
86
|
}),
|
|
97
87
|
],
|
|
98
88
|
controllers: [app_controller_1.AppController],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-app.module.js","sourceRoot":"","sources":["../../src/root-app/core-app.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAsD;AACtD,+DAA+D;AAC/D,4DAA4D;AAC5D,4BAA0B;AAC1B,2CAMwB;AACxB,2DAAqD;AACrD,qDAA+C;AAC/C,+CAAyC;AACzC,6CAAwC;AACxC,uCAAoD;AACpD,oFAA4D;AAC5D,sFAAiF;AACjF,qEAAgE;AAChE,wEAAkE;AAClE,2CAA4C;AAC5C,uCAAwC;
|
|
1
|
+
{"version":3,"file":"core-app.module.js","sourceRoot":"","sources":["../../src/root-app/core-app.module.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sDAAsD;AACtD,+DAA+D;AAC/D,4DAA4D;AAC5D,4BAA0B;AAC1B,2CAMwB;AACxB,2DAAqD;AACrD,qDAA+C;AAC/C,+CAAyC;AACzC,6CAAwC;AACxC,uCAAoD;AACpD,oFAA4D;AAC5D,sFAAiF;AACjF,qEAAgE;AAChE,wEAAkE;AAClE,2CAA4C;AAC5C,uCAAwC;AA0BjC,IAAM,UAAU,GAAh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BAEF,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC;aACvB;YAAC,OAAO,mBAAmB,EAAE;gBAC1B,uEAAuE;gBACvE,OAAO,CAAC,KAAK;gBACT,4EAA4E;gBAC5E,iCAAiC,mBAAmB,EAAE,CACzD,CAAC;gBACF,mDAAmD;gBACnD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;aACnB;QACL,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;CACJ,CAAA;AAvDY,UAAU;IAxBtB,IAAA,eAAM,EAAC;QACJ,OAAO,EAAE;YACL,qBAAY,CAAC,OAAO,CAAC,EAAC,KAAK,EAAE,IAAI,EAAC,CAAC;YACnC,4BAAY;YACZ,oCAAgB;YAChB,iBAAU,CAAC,YAAY,CAAC;gBACpB,OAAO,EAAE,CAAC,oCAAgB,CAAC;gBAE3B,UAAU,EAAE,KAAK,EACb,aAAuC;gBAEvC,4DAA4D;kBAC9D,EAAE;oBACA,OAAO;wBACH,KAAK,EAAE,aAAa,CAAC,aAAa;qBACrC,CAAC;gBACN,CAAC;gBACD,MAAM,EAAE,CAAC,mDAAwB,CAAC;aACrC,CAAC;SACL;QACD,WAAW,EAAE,CAAC,8BAAa,CAAC;QAC5B,SAAS,EAAE,CAAC,wBAAU,EAAE,uBAAU,CAAC;QACnC,OAAO,EAAE,CAAC,uBAAU,EAAE,iBAAU,CAAC;KACpC,CAAC;GACW,UAAU,CAuDtB;AAvDY,gCAAU"}
|
|
@@ -4,7 +4,7 @@ import Stripe from "stripe";
|
|
|
4
4
|
export declare class StripeEventHandler {
|
|
5
5
|
private readonly logger;
|
|
6
6
|
constructor(logger: CoreLoggerService);
|
|
7
|
-
onError(job: Job<Stripe.Event>, error:
|
|
7
|
+
onError(job: Job<Stripe.Event>, error: Error): void;
|
|
8
8
|
onActive(job: Job<Stripe.Event>): void;
|
|
9
9
|
onComplete(job: Job<Stripe.Event>): void;
|
|
10
10
|
handleEvent(job: Job<Stripe.Event>): Promise<void>;
|
|
@@ -27,15 +27,15 @@ let StripeEventHandler = class StripeEventHandler {
|
|
|
27
27
|
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions, @typescript-eslint/no-unnecessary-type-assertion, @typescript-eslint/no-unsafe-member-access
|
|
28
28
|
`Failed job ${job.id} of type ${job.name}: ${error.message}`,
|
|
29
29
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
30
|
-
error
|
|
30
|
+
{ errorStack: error });
|
|
31
31
|
}
|
|
32
32
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
33
33
|
onActive(job) {
|
|
34
|
-
this.logger.log(`Active job ${job.id} of type ${job.name}
|
|
34
|
+
this.logger.log(`Active job ${job.id} of type ${job.name}`);
|
|
35
35
|
}
|
|
36
36
|
// eslint-disable-next-line sonarjs/no-identical-functions
|
|
37
37
|
onComplete(job) {
|
|
38
|
-
this.logger.log(`Completed job ${job.id} of type ${job.name}
|
|
38
|
+
this.logger.log(`Completed job ${job.id} of type ${job.name}`);
|
|
39
39
|
}
|
|
40
40
|
// eslint-disable-next-line @typescript-eslint/require-await
|
|
41
41
|
async handleEvent(job) {
|
|
@@ -48,10 +48,15 @@ let StripeEventHandler = class StripeEventHandler {
|
|
|
48
48
|
// see - https://stripe.com/docs/billing/subscriptions/webhooks
|
|
49
49
|
switch (eventType) {
|
|
50
50
|
case "checkout.session.completed": {
|
|
51
|
-
// Payment is successful and the subscription
|
|
51
|
+
// Payment is successful and for example the subscription can be created.
|
|
52
52
|
// You should provision the subscription and save the customer ID to your database.
|
|
53
53
|
// e.g. set the billing status as paid until the next billing cycle + 1 or 2 days for grace period
|
|
54
54
|
// also called for payment links! - see https://stripe.com/docs/payments/checkout/fulfill-orders
|
|
55
|
+
/*
|
|
56
|
+
this object has customer_details.email
|
|
57
|
+
payment_status: 'paid',
|
|
58
|
+
status: 'complete',
|
|
59
|
+
*/
|
|
55
60
|
return;
|
|
56
61
|
}
|
|
57
62
|
case "checkout.session.async_payment_succeeded": {
|
|
@@ -62,6 +67,30 @@ let StripeEventHandler = class StripeEventHandler {
|
|
|
62
67
|
// Payment link payment is NOT successful for async payment methods. (bank drafts, etc.)
|
|
63
68
|
return;
|
|
64
69
|
}
|
|
70
|
+
case "charge.succeeded": {
|
|
71
|
+
// Payment is successful.
|
|
72
|
+
/*
|
|
73
|
+
event.data.object is the main model
|
|
74
|
+
|
|
75
|
+
object.object = "charge" has these fields
|
|
76
|
+
|
|
77
|
+
billing_details.email = dar@gmail.com
|
|
78
|
+
paid: true
|
|
79
|
+
receipt_url: <a url>
|
|
80
|
+
|
|
81
|
+
this was followed by a payment_intent.succeeded event - no billing deets present
|
|
82
|
+
lastly a checkout.session.completed event
|
|
83
|
+
*/
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
case "payment_intent.succeeded": {
|
|
87
|
+
// These are triggered but you can use the checkout.session.completed event instead
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
case "payment_intent.created": {
|
|
91
|
+
// These are triggered but you can use the checkout.session.completed event instead
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
65
94
|
case "invoice.paid": {
|
|
66
95
|
// Continue to provision the subscription as payments continue to be made.
|
|
67
96
|
// Store the status in your database and check when a user accesses your service.
|
|
@@ -95,7 +124,7 @@ let StripeEventHandler = class StripeEventHandler {
|
|
|
95
124
|
}
|
|
96
125
|
case "customer.subscription.updated": {
|
|
97
126
|
/**
|
|
98
|
-
*
|
|
127
|
+
* Sent when the subscription is successfully started, after the payment is confirmed.
|
|
99
128
|
* Also sent whenever a subscription is changed.
|
|
100
129
|
* For example, adding a coupon, applying a discount,
|
|
101
130
|
* adding an invoice item, and changing plans all trigger this event.
|
|
@@ -115,7 +144,7 @@ let StripeEventHandler = class StripeEventHandler {
|
|
|
115
144
|
__decorate([
|
|
116
145
|
(0, bull_1.OnQueueFailed)(),
|
|
117
146
|
__metadata("design:type", Function),
|
|
118
|
-
__metadata("design:paramtypes", [Object,
|
|
147
|
+
__metadata("design:paramtypes", [Object, Error]),
|
|
119
148
|
__metadata("design:returntype", void 0)
|
|
120
149
|
], StripeEventHandler.prototype, "onError", null);
|
|
121
150
|
__decorate([
|
|
@@ -143,8 +172,8 @@ __decorate([
|
|
|
143
172
|
StripeEventHandler = __decorate([
|
|
144
173
|
(0, common_1.Injectable)(),
|
|
145
174
|
(0, bull_1.Processor)("stripe-events")
|
|
146
|
-
// This
|
|
147
|
-
//
|
|
175
|
+
// This is just an example with notes. You should create your own handler
|
|
176
|
+
//
|
|
148
177
|
// eslint-disable-next-line @darraghor/nestjs-typed/injectable-should-be-provided
|
|
149
178
|
,
|
|
150
179
|
__metadata("design:paramtypes", [CoreLoggerService_1.default])
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-event-handler.js","sourceRoot":"","sources":["../../../src/stripe-client/services/stripe-event-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAmD;AACnD,2CAA0C;AAC1C,uCAMsB;AAEtB,uFAA+D;AAQxD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACE;IAA7B,YAA6B,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IAE1D,OAAO,CAAC,GAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"stripe-event-handler.js","sourceRoot":"","sources":["../../../src/stripe-client/services/stripe-event-handler.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,mDAAmD;AACnD,2CAA0C;AAC1C,uCAMsB;AAEtB,uFAA+D;AAQxD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IACE;IAA7B,YAA6B,MAAyB;QAAzB,WAAM,GAAN,MAAM,CAAmB;IAAG,CAAC;IAE1D,OAAO,CAAC,GAAsB,EAAE,KAAY;QACxC,IAAI,CAAC,MAAM,CAAC,KAAK;QACb,0KAA0K;QAC1K,cAAc,GAAG,CAAC,EAAE,YAAY,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,OAAc,EAAE;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nF,OAAO;aACV;YAED,KAAK,cAAc,CAAC,CAAC;gBACjB,0EAA0E;gBAC1E,iFAAiF;gBACjF,qDAAqD;gBAErD,kGAAkG;gBAClG,OAAO;aACV;YACD,KAAK,sCAAsC,CAAC,CAAC;gBACzC,wDAAwD;gBACxD,OAAO;aACV;YAED,KAAK,wBAAwB,CAAC,CAAC;gBAC3B,2EAA2E;gBAE3E,+EAA+E;gBAC/E,uDAAuD;gBACvD,OAAO;aACV;YACD,KAAK,+BAA+B,CAAC,CAAC;gBAClC;;;;;;kBAME;gBACF,OAAO;aACV;YACD,KAAK,+BAA+B,CAAC,CAAC;gBAClC,6CAA6C;gBAC7C,OAAO;aACV;YACD,KAAK,+BAA+B,CAAC,CAAC;gBAClC;;;;;mBAKG;gBACH,OAAO;aACV;YAED,OAAO,CAAC,CAAC;gBACL,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,mCAAmC,EAAE;oBAClD,SAAS;oBACT,KAAK,EAAE,GAAG,CAAC,IAAI;oBACf,IAAI;iBACP,CAAC,CAAC;aACN;SACJ;IACL,CAAC;CACJ,CAAA;AAvIG;IAAC,IAAA,oBAAa,GAAE;;6CACuB,KAAK;;iDAO3C;AAED;IAAC,IAAA,oBAAa,GAAE;IAChB,0DAA0D;;;;;kDAGzD;AAED;IAAC,IAAA,uBAAgB,GAAE;IACnB,0DAA0D;;;;;oDAGzD;AAIY;IADZ,IAAA,cAAO,GAAE;;;;qDA+GT;AAxIQ,kBAAkB;IAL9B,IAAA,mBAAU,GAAE;IACZ,IAAA,gBAAS,EAAC,eAAe,CAAC;IAC3B,yEAAyE;IACzE,EAAE;IACF,iFAAiF;;qCAExC,2BAAiB;GAD7C,kBAAkB,CAyI9B;AAzIY,gDAAkB"}
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"organisation-membership.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/organisation-membership.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AA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