@darraghor/nest-backend-libs 2.12.19 → 2.14.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.
Files changed (85) hide show
  1. package/README.md +1 -1
  2. package/dist/authz/index.d.ts +6 -0
  3. package/dist/authz/index.js +14 -0
  4. package/dist/authz/index.js.map +1 -0
  5. package/dist/index.d.ts +7 -11
  6. package/dist/index.js +7 -19
  7. package/dist/index.js.map +1 -1
  8. package/dist/invitations/entities/invitation.entity.d.ts +1 -0
  9. package/dist/invitations/entities/invitation.entity.js +7 -3
  10. package/dist/invitations/entities/invitation.entity.js.map +1 -1
  11. package/dist/invitations/index.d.ts +4 -0
  12. package/dist/invitations/index.js +12 -0
  13. package/dist/invitations/index.js.map +1 -0
  14. package/dist/invitations/invitation.controller.js +2 -2
  15. package/dist/invitations/invitation.controller.js.map +1 -1
  16. package/dist/invitations/invitation.service.js +3 -2
  17. package/dist/invitations/invitation.service.js.map +1 -1
  18. package/dist/organisation/entities/member-role.entity.d.ts +1 -1
  19. package/dist/organisation/entities/member-role.entity.js +1 -1
  20. package/dist/organisation/entities/member-role.entity.js.map +1 -1
  21. package/dist/organisation/entities/organisation.entity.d.ts +3 -1
  22. package/dist/organisation/entities/organisation.entity.js +10 -8
  23. package/dist/organisation/entities/organisation.entity.js.map +1 -1
  24. package/dist/organisation/index.d.ts +1 -0
  25. package/dist/organisation/index.js +6 -0
  26. package/dist/organisation/index.js.map +1 -0
  27. package/dist/organisation/organisation.controller.js +1 -1
  28. package/dist/organisation/organisation.module.js +3 -1
  29. package/dist/organisation/organisation.module.js.map +1 -1
  30. package/dist/organisation/organisation.service.js +1 -1
  31. package/dist/organisation/organisation.service.js.map +1 -1
  32. package/dist/organisation-memberships/dtos/create-membership-dto.d.ts +4 -0
  33. package/dist/organisation-memberships/dtos/create-membership-dto.js +27 -0
  34. package/dist/organisation-memberships/dtos/create-membership-dto.js.map +1 -0
  35. package/dist/{organisation → organisation-memberships}/entities/organisation-membership.entity.d.ts +1 -1
  36. package/dist/{organisation → organisation-memberships}/entities/organisation-membership.entity.js +3 -1
  37. package/dist/organisation-memberships/entities/organisation-membership.entity.js.map +1 -0
  38. package/dist/organisation-memberships/index.d.ts +2 -0
  39. package/dist/organisation-memberships/index.js +8 -0
  40. package/dist/organisation-memberships/index.js.map +1 -0
  41. package/dist/organisation-memberships/organisation-memberships.controller.d.ts +11 -0
  42. package/dist/organisation-memberships/organisation-memberships.controller.js +78 -0
  43. package/dist/organisation-memberships/organisation-memberships.controller.js.map +1 -0
  44. package/dist/organisation-memberships/organisation-memberships.module.d.ts +2 -0
  45. package/dist/organisation-memberships/organisation-memberships.module.js +36 -0
  46. package/dist/organisation-memberships/organisation-memberships.module.js.map +1 -0
  47. package/dist/organisation-memberships/organisation-memberships.service.d.ts +13 -0
  48. package/dist/organisation-memberships/organisation-memberships.service.js +125 -0
  49. package/dist/organisation-memberships/organisation-memberships.service.js.map +1 -0
  50. package/dist/organisation-subscriptions/entities/organisation-subscription.entity.d.ts +12 -0
  51. package/dist/organisation-subscriptions/entities/organisation-subscription.entity.js +80 -0
  52. package/dist/organisation-subscriptions/entities/organisation-subscription.entity.js.map +1 -0
  53. package/dist/organisation-subscriptions/index.d.ts +2 -0
  54. package/dist/organisation-subscriptions/index.js +8 -0
  55. package/dist/organisation-subscriptions/index.js.map +1 -0
  56. package/dist/organisation-subscriptions/organisation-subscriptions.controller.d.ts +8 -0
  57. package/dist/organisation-subscriptions/organisation-subscriptions.controller.js +47 -0
  58. package/dist/organisation-subscriptions/organisation-subscriptions.controller.js.map +1 -0
  59. package/dist/organisation-subscriptions/organisation-subscriptions.module.d.ts +2 -0
  60. package/dist/organisation-subscriptions/organisation-subscriptions.module.js +33 -0
  61. package/dist/organisation-subscriptions/organisation-subscriptions.module.js.map +1 -0
  62. package/dist/organisation-subscriptions/organisation-subscriptions.service.d.ts +10 -0
  63. package/dist/organisation-subscriptions/organisation-subscriptions.service.js +74 -0
  64. package/dist/organisation-subscriptions/organisation-subscriptions.service.js.map +1 -0
  65. package/dist/person/entities/person.entity.d.ts +1 -1
  66. package/dist/person/entities/person.entity.js +2 -1
  67. package/dist/person/entities/person.entity.js.map +1 -1
  68. package/dist/person/index.d.ts +3 -0
  69. package/dist/person/index.js +10 -0
  70. package/dist/person/index.js.map +1 -0
  71. package/dist/person/person.controller.js +1 -1
  72. package/dist/person/person.service.js +1 -1
  73. package/dist/person/person.service.js.map +1 -1
  74. package/dist/smtp-email-client/email.controller.js +1 -1
  75. package/dist/stripe-client/controllers/stripe-checkout-controller.js +1 -1
  76. package/dist/stripe-client/controllers/stripe-customer-portal-controller.js +1 -1
  77. package/dist/stripe-client/controllers/stripe-unauthenticated-checkout-controller.js +1 -1
  78. package/dist/stripe-client/controllers/stripe-webhook-controller.js +1 -1
  79. package/dist/stripe-client/services/stripe-event-handler.d.ts +1 -1
  80. package/dist/stripe-client/services/stripe-event-handler.js +45 -8
  81. package/dist/stripe-client/services/stripe-event-handler.js.map +1 -1
  82. package/dist/stripe-client/stripe-account.module.js +2 -0
  83. package/dist/stripe-client/stripe-account.module.js.map +1 -1
  84. package/package.json +1 -1
  85. 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 (you can use the example directly in Miller if you haven't modified anything)
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
 
@@ -0,0 +1,6 @@
1
+ export { AuthzModule } from "./authz.module";
2
+ export { JwtStrategy } from "./authzstrategy";
3
+ export { DefaultAuthGuard } from "./DefaultAuthGuard";
4
+ export { RequestWithUser } from "./RequestWithUser";
5
+ export { ClaimsAuthorisationGuard } from "./ClaimsAuthorisationGuard";
6
+ export { MandatoryUserClaims } from "./MandatoryUserClaims.decorator";
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MandatoryUserClaims = exports.ClaimsAuthorisationGuard = exports.DefaultAuthGuard = exports.JwtStrategy = exports.AuthzModule = void 0;
4
+ var authz_module_1 = require("./authz.module");
5
+ Object.defineProperty(exports, "AuthzModule", { enumerable: true, get: function () { return authz_module_1.AuthzModule; } });
6
+ var authzstrategy_1 = require("./authzstrategy");
7
+ Object.defineProperty(exports, "JwtStrategy", { enumerable: true, get: function () { return authzstrategy_1.JwtStrategy; } });
8
+ var DefaultAuthGuard_1 = require("./DefaultAuthGuard");
9
+ Object.defineProperty(exports, "DefaultAuthGuard", { enumerable: true, get: function () { return DefaultAuthGuard_1.DefaultAuthGuard; } });
10
+ var ClaimsAuthorisationGuard_1 = require("./ClaimsAuthorisationGuard");
11
+ Object.defineProperty(exports, "ClaimsAuthorisationGuard", { enumerable: true, get: function () { return ClaimsAuthorisationGuard_1.ClaimsAuthorisationGuard; } });
12
+ var MandatoryUserClaims_decorator_1 = require("./MandatoryUserClaims.decorator");
13
+ Object.defineProperty(exports, "MandatoryUserClaims", { enumerable: true, get: function () { return MandatoryUserClaims_decorator_1.MandatoryUserClaims; } });
14
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/authz/index.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAAnC,2GAAA,WAAW,OAAA;AACnB,iDAA4C;AAApC,4GAAA,WAAW,OAAA;AACnB,uDAAoD;AAA5C,oHAAA,gBAAgB,OAAA;AAExB,uEAAoE;AAA5D,oIAAA,wBAAwB,OAAA;AAChC,iFAAoE;AAA5D,oIAAA,mBAAmB,OAAA"}
package/dist/index.d.ts CHANGED
@@ -2,10 +2,6 @@ import { RunningCommandLineModule } from "./runningCommandLine/RunningCommandLin
2
2
  import { TwitterAccountModule } from "./twitter-client/twitter-account.module";
3
3
  import { SmtpEmailClientModule } from "./smtp-email-client/smtp-email-client.module";
4
4
  import { EUploadMimeType } from "twitter-api-v2";
5
- import { AuthzModule } from "./authz/authz.module";
6
- import { JwtStrategy } from "./authz/authzstrategy";
7
- import { DefaultAuthGuard } from "./authz/DefaultAuthGuard";
8
- import { RequestWithUser } from "./authz/RequestWithUser";
9
5
  import { ValidatedConfigurationService } from "./configuration/ValidatedConfigurationService";
10
6
  import { CoreConfigurationService } from "./core-config/CoreConfigurationService";
11
7
  import { PostgresDatabaseModule } from "./database-postgres/PostgresDatabase.module";
@@ -14,16 +10,16 @@ import { SqliteDatabaseModule } from "./database-sqlite/SqliteDatabase.module";
14
10
  import { SqliteDatabaseConfigurationService } from "./database-sqlite/SqliteDatabaseConfigurationService";
15
11
  import { SmtpEmailClient } from "./smtp-email-client/email-client.service";
16
12
  import CoreLoggerService from "./logger/CoreLoggerService";
17
- import { OrganisationModule } from "./organisation/organisation.module";
18
- import { Person } from "./person/entities/person.entity";
19
- import { PersonModule } from "./person/person.module";
20
- import { PersonService } from "./person/person.service";
21
13
  import { CoreModule } from "./root-app/core-app.module";
22
14
  import { SwaggerGen } from "./root-app/SwaggerGen";
23
15
  import { TwitterClientService } from "./twitter-client/services/twitter-client.service";
24
16
  import { CoreConfigModule } from "./core-config/CoreConfig.module";
25
17
  import { CliCommandService } from "./runningCommandLine/CliCommandService";
26
- import { ClaimsAuthorisationGuard } from "./authz/ClaimsAuthorisationGuard";
27
- import { MandatoryUserClaims } from "./authz/MandatoryUserClaims.decorator";
28
- 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, };
18
+ export { CoreLoggerService, CoreConfigurationService, SmtpEmailClientModule, CoreModule, CoreConfigModule, SwaggerGen, PostgresDatabaseModule as DatabaseModule, PostgresTypeOrmConfigurationProvider as TypeOrmConfigurationProvider, SmtpEmailClient, ValidatedConfigurationService, SqliteDatabaseModule, SqliteDatabaseConfigurationService, TwitterClientService, TwitterAccountModule, EUploadMimeType, RunningCommandLineModule, CliCommandService, };
29
19
  export * from "./stripe-client/index";
20
+ export * from "./organisation-memberships/index";
21
+ export * from "./organisation-subscriptions/index";
22
+ export * from "./organisation/index";
23
+ export * from "./authz/index";
24
+ export * from "./invitations/index";
25
+ export * from "./person/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.CliCommandService = exports.RunningCommandLineModule = exports.EUploadMimeType = exports.TwitterAccountModule = exports.TwitterClientService = exports.SqliteDatabaseConfigurationService = exports.SqliteDatabaseModule = exports.ValidatedConfigurationService = exports.SmtpEmailClient = exports.TypeOrmConfigurationProvider = exports.DatabaseModule = 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; } });
@@ -27,12 +27,6 @@ const smtp_email_client_module_1 = require("./smtp-email-client/smtp-email-clien
27
27
  Object.defineProperty(exports, "SmtpEmailClientModule", { enumerable: true, get: function () { return smtp_email_client_module_1.SmtpEmailClientModule; } });
28
28
  const twitter_api_v2_1 = require("twitter-api-v2");
29
29
  Object.defineProperty(exports, "EUploadMimeType", { enumerable: true, get: function () { return twitter_api_v2_1.EUploadMimeType; } });
30
- const authz_module_1 = require("./authz/authz.module");
31
- Object.defineProperty(exports, "AuthzModule", { enumerable: true, get: function () { return authz_module_1.AuthzModule; } });
32
- const authzstrategy_1 = require("./authz/authzstrategy");
33
- Object.defineProperty(exports, "JwtStrategy", { enumerable: true, get: function () { return authzstrategy_1.JwtStrategy; } });
34
- const DefaultAuthGuard_1 = require("./authz/DefaultAuthGuard");
35
- Object.defineProperty(exports, "DefaultAuthGuard", { enumerable: true, get: function () { return DefaultAuthGuard_1.DefaultAuthGuard; } });
36
30
  const ValidatedConfigurationService_1 = require("./configuration/ValidatedConfigurationService");
37
31
  Object.defineProperty(exports, "ValidatedConfigurationService", { enumerable: true, get: function () { return ValidatedConfigurationService_1.ValidatedConfigurationService; } });
38
32
  const CoreConfigurationService_1 = require("./core-config/CoreConfigurationService");
@@ -49,14 +43,6 @@ const email_client_service_1 = require("./smtp-email-client/email-client.service
49
43
  Object.defineProperty(exports, "SmtpEmailClient", { enumerable: true, get: function () { return email_client_service_1.SmtpEmailClient; } });
50
44
  const CoreLoggerService_1 = __importDefault(require("./logger/CoreLoggerService"));
51
45
  exports.CoreLoggerService = CoreLoggerService_1.default;
52
- const organisation_module_1 = require("./organisation/organisation.module");
53
- Object.defineProperty(exports, "OrganisationModule", { enumerable: true, get: function () { return organisation_module_1.OrganisationModule; } });
54
- const person_entity_1 = require("./person/entities/person.entity");
55
- Object.defineProperty(exports, "Person", { enumerable: true, get: function () { return person_entity_1.Person; } });
56
- const person_module_1 = require("./person/person.module");
57
- Object.defineProperty(exports, "PersonModule", { enumerable: true, get: function () { return person_module_1.PersonModule; } });
58
- const person_service_1 = require("./person/person.service");
59
- Object.defineProperty(exports, "PersonService", { enumerable: true, get: function () { return person_service_1.PersonService; } });
60
46
  const core_app_module_1 = require("./root-app/core-app.module");
61
47
  Object.defineProperty(exports, "CoreModule", { enumerable: true, get: function () { return core_app_module_1.CoreModule; } });
62
48
  const SwaggerGen_1 = require("./root-app/SwaggerGen");
@@ -67,9 +53,11 @@ const CoreConfig_module_1 = require("./core-config/CoreConfig.module");
67
53
  Object.defineProperty(exports, "CoreConfigModule", { enumerable: true, get: function () { return CoreConfig_module_1.CoreConfigModule; } });
68
54
  const CliCommandService_1 = require("./runningCommandLine/CliCommandService");
69
55
  Object.defineProperty(exports, "CliCommandService", { enumerable: true, get: function () { return CliCommandService_1.CliCommandService; } });
70
- const ClaimsAuthorisationGuard_1 = require("./authz/ClaimsAuthorisationGuard");
71
- Object.defineProperty(exports, "ClaimsAuthorisationGuard", { enumerable: true, get: function () { return ClaimsAuthorisationGuard_1.ClaimsAuthorisationGuard; } });
72
- const MandatoryUserClaims_decorator_1 = require("./authz/MandatoryUserClaims.decorator");
73
- Object.defineProperty(exports, "MandatoryUserClaims", { enumerable: true, get: function () { return MandatoryUserClaims_decorator_1.MandatoryUserClaims; } });
74
56
  __exportStar(require("./stripe-client/index"), exports);
57
+ __exportStar(require("./organisation-memberships/index"), exports);
58
+ __exportStar(require("./organisation-subscriptions/index"), exports);
59
+ __exportStar(require("./organisation/index"), exports);
60
+ __exportStar(require("./authz/index"), exports);
61
+ __exportStar(require("./invitations/index"), exports);
62
+ __exportStar(require("./person/index"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iDAA+B"}
@@ -8,6 +8,7 @@ export declare class Invitation {
8
8
  expiresOn: Date;
9
9
  acceptedOn?: Date;
10
10
  organisation: Organisation;
11
+ organisationId: Organisation;
11
12
  createdDate: Date;
12
13
  updateDate: Date;
13
14
  deletedDate?: Date;
@@ -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,qCASiB;AACjB,yFAA6E;AAGtE,IAAM,UAAU,GAAhB,MAAM,UAAU;IAGnB,EAAE,CAAU;IAQL,IAAI,CAAU;IAIrB,SAAS,CAAU;IAInB,YAAY,CAAU;IAItB,gBAAgB,CAAQ;IAIxB,SAAS,CAAQ;IAIjB,UAAU,CAAQ;IAMlB,YAAY,CAAgB;IAI5B,WAAW,CAAQ;IAInB,UAAU,CAAQ;IAIlB,WAAW,CAAQ;CACtB,CAAA;AAjDG;IAAC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,GAAE;;sCACF;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;;wCACO;AAErB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;6CACK;AAEnB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;;gDACQ;AAEtB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;8BACK,IAAI;oDAAC;AAExB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,qBAAW,GAAE;8BACF,IAAI;6CAAC;AAEjB;IAAC,IAAA,gBAAM,GAAE;IACR,IAAA,6BAAmB,GAAE;8BACT,IAAI;8CAAC;AAElB;IAAC,IAAA,qBAAW,GAAE;IACb,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kCAAY,EAAE;QAC3B,KAAK,EAAE,IAAI;KACd,CAAC;8BACa,kCAAY;gDAAC;AAE5B;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;+CAAC;AAEnB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;8CAAC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,6BAAmB,GAAE;8BACR,IAAI;+CAAC;AAjDV,UAAU;IADtB,IAAA,gBAAM,GAAE;GACI,UAAU,CAkDtB;AAlDY,gCAAU"}
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,UAAU,GAAhB,M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AgB,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"}
@@ -0,0 +1,4 @@
1
+ export { InvitationModule } from "./invitation.module";
2
+ export { InvitationService } from "./invitation.service";
3
+ export { Invitation } from "./entities/invitation.entity";
4
+ export { CreateInvitationDto } from "./dto/create-invitation.dto";
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CreateInvitationDto = exports.Invitation = exports.InvitationService = exports.InvitationModule = void 0;
4
+ var invitation_module_1 = require("./invitation.module");
5
+ Object.defineProperty(exports, "InvitationModule", { enumerable: true, get: function () { return invitation_module_1.InvitationModule; } });
6
+ var invitation_service_1 = require("./invitation.service");
7
+ Object.defineProperty(exports, "InvitationService", { enumerable: true, get: function () { return invitation_service_1.InvitationService; } });
8
+ var invitation_entity_1 = require("./entities/invitation.entity");
9
+ Object.defineProperty(exports, "Invitation", { enumerable: true, get: function () { return invitation_entity_1.Invitation; } });
10
+ var create_invitation_dto_1 = require("./dto/create-invitation.dto");
11
+ Object.defineProperty(exports, "CreateInvitationDto", { enumerable: true, get: function () { return create_invitation_dto_1.CreateInvitationDto; } });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/invitations/index.ts"],"names":[],"mappings":";;;AAAA,yDAAqD;AAA7C,qHAAA,gBAAgB,OAAA;AACxB,2DAAuD;AAA/C,uHAAA,iBAAiB,OAAA;AACzB,kEAAwD;AAAhD,+GAAA,UAAU,OAAA;AAClB,qEAAgE;AAAxD,4HAAA,mBAAmB,OAAA"}
@@ -53,8 +53,8 @@ __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"),
57
- (0, swagger_1.ApiTags)("organisations"),
56
+ (0, common_1.Controller)("organisations/invitations"),
57
+ (0, swagger_1.ApiTags)("Organisations"),
58
58
  __metadata("design:paramtypes", [invitation_service_1.InvitationService])
59
59
  ], InvitationController);
60
60
  exports.InvitationController = 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,aAAa,CAAC;IACzB,IAAA,iBAAO,EAAC,eAAe,CAAC;qCAE2B,sCAAiB;GADxD,oBAAoB,CAyBhC;AAzBY,oDAAoB"}
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
- const hasUnexpiredInvitations = existingInvitations.some((invitation) => invitation.expiresOn > new Date());
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,qCAAmC;AACnC,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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AA,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 "./organisation-membership.entity";
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("./organisation-membership.entity");
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,qFAAwE;AAGjE,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"}
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"}
@@ -1,8 +1,10 @@
1
- import { OrganisationMembership } from "./organisation-membership.entity";
1
+ import { OrganisationMembership } from "../../organisation-memberships/entities/organisation-membership.entity";
2
+ import { OrganisationSubscriptionRecord } from "../../organisation-subscriptions/entities/organisation-subscription.entity";
2
3
  export declare class Organisation {
3
4
  id: number;
4
5
  uuid: string;
5
6
  memberships: OrganisationMembership[];
7
+ subscriptionRecords: OrganisationSubscriptionRecord[];
6
8
  name: string;
7
9
  createdDate: Date;
8
10
  updateDate: Date;
@@ -12,18 +12,13 @@ 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
- //import {Invitation} from "../../invitations/entities/invitation.entity";
16
- const organisation_membership_entity_1 = require("./organisation-membership.entity");
15
+ const organisation_membership_entity_1 = require("../../organisation-memberships/entities/organisation-membership.entity");
16
+ const organisation_subscription_entity_1 = require("../../organisation-subscriptions/entities/organisation-subscription.entity");
17
17
  let Organisation = class Organisation {
18
18
  id;
19
19
  uuid;
20
20
  memberships;
21
- // @OneToMany(() => Invitation, (om) => om.organisation, {
22
- // eager: true,
23
- // cascade: ["insert", "update"],
24
- // })
25
- // @Index()
26
- // invitations!: Invitation[];
21
+ subscriptionRecords;
27
22
  name;
28
23
  createdDate;
29
24
  updateDate;
@@ -47,6 +42,7 @@ __decorate([
47
42
  }),
48
43
  (0, typeorm_1.Generated)("uuid"),
49
44
  (0, swagger_1.ApiProperty)(),
45
+ (0, typeorm_1.Index)(),
50
46
  __metadata("design:type", String)
51
47
  ], Organisation.prototype, "uuid", void 0);
52
48
  __decorate([
@@ -55,6 +51,12 @@ __decorate([
55
51
  }),
56
52
  __metadata("design:type", Array)
57
53
  ], Organisation.prototype, "memberships", void 0);
54
+ __decorate([
55
+ (0, typeorm_1.OneToMany)(() => organisation_subscription_entity_1.OrganisationSubscriptionRecord, (osr) => osr.organisation, {
56
+ cascade: ["insert", "update"],
57
+ }),
58
+ __metadata("design:type", Array)
59
+ ], Organisation.prototype, "subscriptionRecords", void 0);
58
60
  __decorate([
59
61
  (0, typeorm_1.Column)(),
60
62
  (0, swagger_1.ApiProperty)(),
@@ -1 +1 @@
1
- {"version":3,"file":"organisation.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/organisation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,qCAYiB;AACjB,0EAA0E;AAC1E,qFAAwE;AAGjE,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGrB,EAAE,CAAU;IAQL,IAAI,CAAU;IAKrB,WAAW,CAA4B;IAEvC,0DAA0D;IAC1D,mBAAmB;IACnB,qCAAqC;IACrC,KAAK;IACL,WAAW;IACX,8BAA8B;IAI9B,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;AAjDG;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;AASvC;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;AAjDQ,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CAkDxB;AAlDY,oCAAY"}
1
+ {"version":3,"file":"organisation.entity.js","sourceRoot":"","sources":["../../../src/organisation/entities/organisation.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,6CAA4C;AAE5C,qCAaiB;AACjB,2HAA8G;AAC9G,iIAA0H;AAGnH,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGrB,EAAE,CAAU;IASL,IAAI,CAAU;IAKrB,WAAW,CAA4B;IASvC,mBAAmB,CAAoC;IAIvD,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;AApDG;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;IACb,IAAA,eAAK,GAAE;;0CACa;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,mBAAS,EACN,GAAG,EAAE,CAAC,iEAA8B,EACpC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,EACzB;QACI,OAAO,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC;KAChC,CACJ;;yDACsD;AAEvD;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;AApDQ,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CAqDxB;AArDY,oCAAY"}
@@ -0,0 +1 @@
1
+ export { OrganisationModule } from "./organisation.module";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganisationModule = void 0;
4
+ var organisation_module_1 = require("./organisation.module");
5
+ Object.defineProperty(exports, "OrganisationModule", { enumerable: true, get: function () { return organisation_module_1.OrganisationModule; } });
6
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/organisation/index.ts"],"names":[],"mappings":";;;AAAA,6DAAyD;AAAjD,yHAAA,kBAAkB,OAAA"}
@@ -82,7 +82,7 @@ OrganisationController = __decorate([
82
82
  (0, common_1.UseGuards)((0, passport_1.AuthGuard)("jwt")),
83
83
  (0, swagger_1.ApiBearerAuth)(),
84
84
  (0, common_1.Controller)("organisation"),
85
- (0, swagger_1.ApiTags)("organisations"),
85
+ (0, swagger_1.ApiTags)("Organisations"),
86
86
  __metadata("design:paramtypes", [organisation_service_1.OrganisationService])
87
87
  ], OrganisationController);
88
88
  exports.OrganisationController = OrganisationController;
@@ -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,8FAAiF;AACjF,sEAA6D;AAetD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,kBAAkB;IAb9B,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,gDAAsB,CAAC;QACrC,SAAS,EAAE,CAAC,0CAAmB,CAAC;QAChC,OAAO,EAAE,CAAC,0CAAmB,CAAC;KACjC,CAAC;GACW,kBAAkB,CAAG;AAArB,gDAAkB"}
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,6CAAiD;AACjD,qCAA+D;AAE/D,+CAAsC;AAEtC,sEAA6D;AAC7D,8FAAiF;AACjF,wEAA4D;AAGrD,IAAM,mBAAmB,GAAzB,MAAM,mBAAmB;IAGhB;IAFZ,YAEY,UAAoC;QAApC,eAAU,GAAV,UAAU,CAA0B;IAC7C,CAAC;IAEJ,KAAK,CAAC,MAAM,CACR,qBAA4C;QAE5C,4BAA4B;QAC5B,MAAM,mBAAmB,GAAG,IAAI,kCAAY,EAAE,CAAC;QAC/C,mBAAmB,CAAC,IAAI,GAAG,qBAAqB,CAAC,IAAI,CAAC;QACtD,mBAAmB,CAAC,WAAW,GAAG,EAAE,CAAC;QAErC,gBAAgB;QAChB,MAAM,eAAe,GAAG,IAAI,uDAAsB,EAAE,CAAC;QACrD,eAAe,CAAC,MAAM,GAAG,qBAAqB,CAAC,KAAK,CAAC;QACrD,MAAM,SAAS,GAAG,IAAI,mCAAc,EAAE,CAAC;QACvC,SAAS,CAAC,IAAI,GAAG,iBAAK,CAAC,KAAK,CAAC;QAC7B,eAAe,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEtC,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAEtD,qBAAqB;QACrB,MAAM,iBAAiB,GAAG,qBAAqB,CAAC,OAAO,CAAC,GAAG,CACvD,CAAC,MAAM,EAAE,EAAE;YACP,MAAM,UAAU,GAAG,IAAI,uDAAsB,EAAE,CAAC;YAChD,UAAU,CAAC,MAAM,GAAG,MAAM,CAAC;YAC3B,MAAM,UAAU,GAAG,IAAI,mCAAc,EAAE,CAAC;YACxC,UAA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+ "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"}
@@ -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;
@@ -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;
@@ -45,6 +46,7 @@ __decorate([
45
46
  }),
46
47
  (0, typeorm_1.Generated)("uuid"),
47
48
  (0, swagger_1.ApiProperty)(),
49
+ (0, typeorm_1.Index)(),
48
50
  __metadata("design:type", String)
49
51
  ], OrganisationMembership.prototype, "uuid", void 0);
50
52
  __decorate([
@@ -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,qCAeiB;AACjB,uFAA8E;AAC9E,yFAA6E;AAC7E,uEAA2D;AAGpD,IAAM,sBAAsB,GAA5B,MAAM,sBAAsB;IAG/B,EAAE,CAAU;IASL,IAAI,CAAU;IAMrB,MAAM,CAAU;IAIT,QAAQ,CAAU;IAMzB,YAAY,CAAgB;IAIrB,cAAc,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AAG/B;IAAC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,mCAAc,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,EAAE;QACxD,KAAK,EAAE,IAAI;QACX,OAAO,EAAE,IAAI;KAChB,CAAC;;qDACuB;AAEzB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;2DAAC;AAEnB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACD,IAAI;0DAAC;AAElB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,GAAE;8BACA,IAAI;2DAAC;AAMb;IAHL,IAAA,mBAAS,GAAE;IACX,IAAA,qBAAW,GAAE;IACb,IAAA,qBAAW,GAAE;;;;wDAKb;AA7DQ,sBAAsB;IADlC,IAAA,gBAAM,GAAE;GACI,sBAAsB,CA8DlC;AA9DY,wDAAsB"}
@@ -0,0 +1,2 @@
1
+ export { OrganisationMembershipsService } from "./organisation-memberships.service";
2
+ export { OrganisationMembershipsModule } from "./organisation-memberships.module";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OrganisationMembershipsModule = 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
+ var organisation_memberships_module_1 = require("./organisation-memberships.module");
7
+ Object.defineProperty(exports, "OrganisationMembershipsModule", { enumerable: true, get: function () { return organisation_memberships_module_1.OrganisationMembershipsModule; } });
8
+ //# 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;AACtC,qFAAgF;AAAxE,gJAAA,6BAA6B,OAAA"}
@@ -0,0 +1,11 @@
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
+ findAll(orgUuid: string, request: RequestWithUser): Promise<import("./entities/organisation-membership.entity").OrganisationMembership[]>;
9
+ createOrUpdate(orgUuid: string, updateOrganisationDto: CreateUpdateMembershipDto, request: RequestWithUser): Promise<Organisation>;
10
+ remove(orgUuid: string, membershipUuid: string, request: RequestWithUser): Promise<boolean>;
11
+ }