@merkaly/api 0.2.2-11 → 0.2.2-12

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 (137) hide show
  1. package/.output/abstract/abstract.entity.d.ts +8 -0
  2. package/.output/abstract/abstract.entity.js +34 -0
  3. package/.output/abstract/abstract.validator.d.ts +9 -0
  4. package/.output/abstract/abstract.validator.js +41 -0
  5. package/.output/abstract/app.controller.d.ts +11 -0
  6. package/.output/abstract/app.controller.d.ts.map +1 -0
  7. package/.output/abstract/app.controller.js +22 -0
  8. package/.output/abstract/app.controller.js.map +1 -0
  9. package/.output/abstract/app.entity.d.ts +9 -0
  10. package/.output/abstract/app.entity.d.ts.map +1 -0
  11. package/.output/abstract/app.entity.js +28 -0
  12. package/.output/abstract/app.entity.js.map +1 -0
  13. package/.output/abstract/app.exception.d.ts +11 -0
  14. package/.output/abstract/app.exception.d.ts.map +1 -0
  15. package/.output/abstract/app.exception.js +37 -0
  16. package/.output/abstract/app.exception.js.map +1 -0
  17. package/.output/abstract/app.repository.d.ts +20 -0
  18. package/.output/abstract/app.repository.d.ts.map +1 -0
  19. package/.output/abstract/app.repository.js +73 -0
  20. package/.output/abstract/app.repository.js.map +1 -0
  21. package/.output/abstract/app.router.d.ts +6 -0
  22. package/.output/abstract/app.router.d.ts.map +1 -0
  23. package/.output/abstract/app.router.js +8 -0
  24. package/.output/abstract/app.router.js.map +1 -0
  25. package/.output/configs/app.controller.d.ts +11 -0
  26. package/.output/configs/app.controller.d.ts.map +1 -0
  27. package/.output/configs/app.controller.js +22 -0
  28. package/.output/configs/app.controller.js.map +1 -0
  29. package/.output/configs/app.entity.d.ts +2 -1
  30. package/.output/configs/app.entity.d.ts.map +1 -0
  31. package/.output/configs/app.entity.js +10 -16
  32. package/.output/configs/app.entity.js.map +1 -0
  33. package/.output/configs/app.exception.d.ts +11 -0
  34. package/.output/configs/app.exception.d.ts.map +1 -0
  35. package/.output/configs/app.exception.js +37 -0
  36. package/.output/configs/app.exception.js.map +1 -0
  37. package/.output/configs/app.repository.d.ts +20 -0
  38. package/.output/configs/app.repository.d.ts.map +1 -0
  39. package/.output/configs/app.repository.js +73 -0
  40. package/.output/configs/app.repository.js.map +1 -0
  41. package/.output/configs/app.router.d.ts +6 -0
  42. package/.output/configs/app.router.d.ts.map +1 -0
  43. package/.output/configs/app.router.js +8 -0
  44. package/.output/configs/app.router.js.map +1 -0
  45. package/.output/decorators/organization.decorator.d.ts +2 -0
  46. package/.output/decorators/organization.decorator.d.ts.map +1 -0
  47. package/.output/decorators/organization.decorator.js +10 -0
  48. package/.output/decorators/organization.decorator.js.map +1 -0
  49. package/.output/globals/global.controller.d.ts +20 -0
  50. package/.output/globals/global.controller.d.ts.map +1 -0
  51. package/.output/globals/global.controller.js +76 -0
  52. package/.output/globals/global.controller.js.map +1 -0
  53. package/.output/interceptors/logger.interceptor.d.ts +9 -0
  54. package/.output/interceptors/logger.interceptor.d.ts.map +1 -0
  55. package/.output/interceptors/logger.interceptor.js +54 -0
  56. package/.output/interceptors/logger.interceptor.js.map +1 -0
  57. package/.output/modules/app.module.d.ts +12 -0
  58. package/.output/modules/app.module.d.ts.map +1 -0
  59. package/.output/modules/app.module.js +37 -0
  60. package/.output/modules/app.module.js.map +1 -0
  61. package/.output/modules/assets/asset.entity.d.ts +2 -2
  62. package/.output/modules/assets/asset.entity.js +2 -2
  63. package/.output/modules/auth/auth.controller.d.ts +7 -0
  64. package/.output/modules/auth/auth.controller.d.ts.map +1 -0
  65. package/.output/modules/auth/auth.controller.js +31 -0
  66. package/.output/modules/auth/auth.controller.js.map +1 -0
  67. package/.output/modules/auth/connections/connection.controller.d.ts +8 -0
  68. package/.output/modules/auth/connections/connection.controller.d.ts.map +1 -0
  69. package/.output/modules/auth/connections/connection.controller.js +30 -0
  70. package/.output/modules/auth/connections/connection.controller.js.map +1 -0
  71. package/.output/modules/auth/connections/connection.module.d.ts +8 -0
  72. package/.output/modules/auth/connections/connection.module.d.ts.map +1 -0
  73. package/.output/modules/auth/connections/connection.module.js +22 -0
  74. package/.output/modules/auth/connections/connection.module.js.map +1 -0
  75. package/.output/modules/auth/connections/connection.validator.d.ts +1 -0
  76. package/.output/modules/auth/connections/connection.validator.d.ts.map +1 -0
  77. package/.output/modules/auth/connections/connection.validator.js +1 -12
  78. package/.output/modules/auth/connections/connection.validator.js.map +1 -0
  79. package/.output/modules/auth/members/member.controller.d.ts +8 -0
  80. package/.output/modules/auth/members/member.controller.d.ts.map +1 -0
  81. package/.output/modules/auth/members/member.controller.js +30 -0
  82. package/.output/modules/auth/members/member.controller.js.map +1 -0
  83. package/.output/modules/auth/members/member.module.d.ts +8 -0
  84. package/.output/modules/auth/members/member.module.d.ts.map +1 -0
  85. package/.output/modules/auth/members/member.module.js +22 -0
  86. package/.output/modules/auth/members/member.module.js.map +1 -0
  87. package/.output/modules/auth/members/member.validator.d.ts +1 -0
  88. package/.output/modules/auth/members/member.validator.d.ts.map +1 -0
  89. package/.output/modules/auth/members/member.validator.js +1 -0
  90. package/.output/modules/auth/members/member.validator.js.map +1 -0
  91. package/.output/modules/health/health.controller.d.ts +8 -0
  92. package/.output/modules/health/health.controller.d.ts.map +1 -0
  93. package/.output/modules/health/health.controller.js +29 -0
  94. package/.output/modules/health/health.controller.js.map +1 -0
  95. package/.output/modules/health/health.module.d.ts +9 -0
  96. package/.output/modules/health/health.module.d.ts.map +1 -0
  97. package/.output/modules/health/health.module.js +24 -0
  98. package/.output/modules/health/health.module.js.map +1 -0
  99. package/.output/modules/health.module.d.ts +3 -0
  100. package/.output/modules/health.module.d.ts.map +1 -0
  101. package/.output/modules/health.module.js +14 -0
  102. package/.output/modules/health.module.js.map +1 -0
  103. package/.output/modules/inventory/brands/brand.entity.d.ts +2 -2
  104. package/.output/modules/inventory/brands/brand.entity.js +2 -2
  105. package/.output/modules/inventory/categories/category.entity.d.ts +5 -2
  106. package/.output/modules/inventory/categories/category.entity.js +13 -2
  107. package/.output/modules/inventory/categories/category.validator.d.ts +2 -0
  108. package/.output/modules/inventory/categories/category.validator.js +12 -0
  109. package/.output/modules/inventory/products/product.entity.d.ts +2 -2
  110. package/.output/modules/inventory/products/product.entity.js +2 -2
  111. package/.output/modules/inventory/properties/property.entity.d.ts +7 -0
  112. package/.output/modules/inventory/properties/property.entity.js +38 -0
  113. package/.output/modules/inventory/properties/property.validator.d.ts +12 -0
  114. package/.output/modules/inventory/properties/property.validator.js +50 -0
  115. package/.output/modules/settings/connections/connection.validator.d.ts +9 -0
  116. package/.output/modules/settings/connections/connection.validator.js +35 -0
  117. package/.output/modules/settings/members/member.validator.d.ts +3 -0
  118. package/.output/modules/settings/members/member.validator.js +3 -0
  119. package/.output/modules/settings/organization/organization.validator.d.ts +1 -1
  120. package/.output/modules/settings/organization/organization.validator.js +2 -2
  121. package/.output/modules/settings/payments/payment.entity.d.ts +2 -2
  122. package/.output/modules/settings/payments/payment.entity.js +2 -2
  123. package/.output/modules/store/cart/cart.entity.d.ts +2 -2
  124. package/.output/modules/store/cart/cart.entity.js +2 -2
  125. package/.output/modules/store/orders/item/item.entity.d.ts +2 -2
  126. package/.output/modules/store/orders/item/item.entity.js +2 -2
  127. package/.output/modules/store/orders/order.entity.d.ts +2 -2
  128. package/.output/modules/store/orders/order.entity.js +2 -2
  129. package/.output/providers/mongo.provider.d.ts +20 -0
  130. package/.output/providers/mongo.provider.d.ts.map +1 -0
  131. package/.output/providers/mongo.provider.js +41 -0
  132. package/.output/providers/mongo.provider.js.map +1 -0
  133. package/.output/providers/schema.provider.d.ts +12 -0
  134. package/.output/providers/schema.provider.d.ts.map +1 -0
  135. package/.output/providers/schema.provider.js +33 -0
  136. package/.output/providers/schema.provider.js.map +1 -0
  137. package/package.json +7 -3
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppRepository = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const core_1 = require("@nestjs/core");
6
+ class AppRepository {
7
+ get $user() {
8
+ var _a;
9
+ return (_a = this.$request) === null || _a === void 0 ? void 0 : _a.user;
10
+ }
11
+ find(...params) {
12
+ return __awaiter(this, void 0, void 0, function* () {
13
+ return this.$find();
14
+ });
15
+ }
16
+ create(...params) {
17
+ return __awaiter(this, void 0, void 0, function* () {
18
+ const entity = new this.$model();
19
+ const [validator] = params;
20
+ for (const key in validator) {
21
+ entity[key] = validator[key];
22
+ }
23
+ return this.$create(entity);
24
+ });
25
+ }
26
+ read(id) {
27
+ return __awaiter(this, void 0, void 0, function* () {
28
+ return this.$read(id);
29
+ });
30
+ }
31
+ update(id, ...params) {
32
+ return __awaiter(this, void 0, void 0, function* () {
33
+ const entity = yield this.$model.findById(id, params);
34
+ return this.$update(id, { $set: entity });
35
+ });
36
+ }
37
+ delete(id) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ return this.$delete(id);
40
+ });
41
+ }
42
+ $find() {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ return this.$model.find();
45
+ });
46
+ }
47
+ $read(id) {
48
+ return __awaiter(this, void 0, void 0, function* () {
49
+ return this.$model.findById(id);
50
+ });
51
+ }
52
+ $create(model) {
53
+ return __awaiter(this, void 0, void 0, function* () {
54
+ return this.$model.create(model);
55
+ });
56
+ }
57
+ $update(id, query) {
58
+ return __awaiter(this, void 0, void 0, function* () {
59
+ return this.$model.findByIdAndUpdate(id, query);
60
+ });
61
+ }
62
+ $delete(id) {
63
+ return __awaiter(this, void 0, void 0, function* () {
64
+ return this.$model.findByIdAndDelete(id);
65
+ });
66
+ }
67
+ }
68
+ __decorate([
69
+ (0, common_1.Inject)(core_1.REQUEST),
70
+ __metadata("design:type", Object)
71
+ ], AppRepository.prototype, "$request", void 0);
72
+ exports.AppRepository = AppRepository;
73
+ //# sourceMappingURL=app.repository.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.repository.js","sourceRoot":"","sources":["../../src/configs/app.repository.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,uCAA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,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnC,CAAC;KAAA;IAEe,OAAO,CAAC,EAAU,EAAE,KAAqB;;YAEvD,OAAO,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;QAClD,CAAC;KAAA;IAEe,OAAO,CAAC,EAAU;;YAChC,OAAO,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;QAC3C,CAAC;KAAA;CACF;AAxDC;IADC,IAAA,eAAM,EAAC,cAAO,CAAC;;+CACqB;AAJvC,sCA4DC"}
@@ -0,0 +1,6 @@
1
+ export declare class AppRouter {
2
+ static readonly path: string;
3
+ static readonly module: typeof AppRouter;
4
+ static readonly children?: any[];
5
+ }
6
+ //# sourceMappingURL=app.router.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.router.d.ts","sourceRoot":"","sources":["../../src/configs/app.router.ts"],"names":[],"mappings":"AAAA,qBAAa,SAAS;IACpB,gBAAuB,IAAI,EAAE,MAAM,CAAC;IAEpC,gBAAuB,MAAM,EAAE,OAAO,SAAS,CAAC;IAEhD,gBAAuB,QAAQ,CAAC,QAAM;CACvC"}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppRouter = void 0;
4
+ class AppRouter {
5
+ }
6
+ exports.AppRouter = AppRouter;
7
+ AppRouter.children = [];
8
+ //# sourceMappingURL=app.router.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.router.js","sourceRoot":"","sources":["../../src/configs/app.router.ts"],"names":[],"mappings":";;;AAAA,MAAa,SAAS;;AAAtB,8BAMC;AADwB,kBAAQ,GAAI,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const GetOrganization: (...dataOrPipes: (import("@nestjs/common").PipeTransform<any, any> | import("@nestjs/common").Type<import("@nestjs/common").PipeTransform<any, any>>)[]) => ParameterDecorator;
2
+ //# sourceMappingURL=organization.decorator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/organization.decorator.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,gLAK1B,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GetOrganization = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ exports.GetOrganization = (0, common_1.createParamDecorator)((key, ctx) => {
6
+ const request = ctx.switchToHttp().getRequest();
7
+ const { organization } = request.headers;
8
+ return organization;
9
+ });
10
+ //# sourceMappingURL=organization.decorator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization.decorator.js","sourceRoot":"","sources":["../../src/decorators/organization.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AAG3D,QAAA,eAAe,GAAG,IAAA,6BAAoB,EAAC,CAAC,GAAU,EAAE,GAAqB,EAAU,EAAE;IAChG,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAW,CAAC;IACzD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;IAEzC,OAAO,YAAY,CAAC;AACtB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { SessionData } from 'express-session';
2
+ import { Auth0Service } from '../services/auth0.service';
3
+ export declare class GlobalController {
4
+ private readonly $connection;
5
+ readonly $auth0: Auth0Service;
6
+ private readonly $health;
7
+ private readonly $mongodb;
8
+ private readonly $axios;
9
+ private readonly $memory;
10
+ health(): Promise<import("@nestjs/terminus").HealthCheckResult>;
11
+ main(session: SessionData): Promise<{
12
+ hostname: string;
13
+ version: string;
14
+ totalmem: number;
15
+ freemem: number;
16
+ platform: NodeJS.Platform;
17
+ uptime: number;
18
+ }>;
19
+ }
20
+ //# sourceMappingURL=global.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.controller.d.ts","sourceRoot":"","sources":["../../src/globals/global.controller.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAI9C,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAEzD,qBACa,gBAAgB;IACP,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IAC7D,SAA0B,MAAM,EAAE,YAAY,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAqB;IAC7C,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA0B;IACnD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAwB;IAK1D,MAAM;IAUO,IAAI,CAAY,OAAO,EAAE,WAAW;;;;;;;;CAYlD"}
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GlobalController = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const mongoose_1 = require("@nestjs/mongoose");
6
+ const terminus_1 = require("@nestjs/terminus");
7
+ const os_1 = __importDefault(require("os"));
8
+ const config_1 = require("../config");
9
+ const public_decorator_1 = require("../decorators/public.decorator");
10
+ const auth0_service_1 = require("../services/auth0.service");
11
+ let GlobalController = class GlobalController {
12
+ health() {
13
+ return this.$health.check([
14
+ () => this.$mongodb.pingCheck('mongodb', { timeout: 1500, connection: this.$connection }),
15
+ () => this.$axios.pingCheck('auth0', `https://${config_1.AppConfig.auth0.domain}`),
16
+ () => this.$memory.checkHeap('memory', 150 * 1024 * 1024),
17
+ ]);
18
+ }
19
+ main(session) {
20
+ return __awaiter(this, void 0, void 0, function* () {
21
+ return {
22
+ hostname: os_1.default.hostname(),
23
+ version: os_1.default.version(),
24
+ totalmem: os_1.default.totalmem(),
25
+ freemem: os_1.default.freemem(),
26
+ platform: os_1.default.platform(),
27
+ uptime: os_1.default.uptime(),
28
+ };
29
+ });
30
+ }
31
+ };
32
+ __decorate([
33
+ (0, mongoose_1.InjectConnection)(),
34
+ __metadata("design:type", Object)
35
+ ], GlobalController.prototype, "$connection", void 0);
36
+ __decorate([
37
+ (0, common_1.Inject)(),
38
+ __metadata("design:type", auth0_service_1.Auth0Service)
39
+ ], GlobalController.prototype, "$auth0", void 0);
40
+ __decorate([
41
+ (0, common_1.Inject)(),
42
+ __metadata("design:type", terminus_1.HealthCheckService)
43
+ ], GlobalController.prototype, "$health", void 0);
44
+ __decorate([
45
+ (0, common_1.Inject)(),
46
+ __metadata("design:type", terminus_1.MongooseHealthIndicator)
47
+ ], GlobalController.prototype, "$mongodb", void 0);
48
+ __decorate([
49
+ (0, common_1.Inject)(),
50
+ __metadata("design:type", terminus_1.HttpHealthIndicator)
51
+ ], GlobalController.prototype, "$axios", void 0);
52
+ __decorate([
53
+ (0, common_1.Inject)(),
54
+ __metadata("design:type", terminus_1.MemoryHealthIndicator)
55
+ ], GlobalController.prototype, "$memory", void 0);
56
+ __decorate([
57
+ (0, common_1.Get)('/'),
58
+ (0, terminus_1.HealthCheck)(),
59
+ (0, public_decorator_1.Public)(),
60
+ __metadata("design:type", Function),
61
+ __metadata("design:paramtypes", []),
62
+ __metadata("design:returntype", void 0)
63
+ ], GlobalController.prototype, "health", null);
64
+ __decorate([
65
+ (0, common_1.Get)('/'),
66
+ (0, public_decorator_1.Public)(),
67
+ __param(0, (0, common_1.Session)()),
68
+ __metadata("design:type", Function),
69
+ __metadata("design:paramtypes", [Object]),
70
+ __metadata("design:returntype", Promise)
71
+ ], GlobalController.prototype, "main", null);
72
+ GlobalController = __decorate([
73
+ (0, common_1.Controller)()
74
+ ], GlobalController);
75
+ exports.GlobalController = GlobalController;
76
+ //# sourceMappingURL=global.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global.controller.js","sourceRoot":"","sources":["../../src/globals/global.controller.ts"],"names":[],"mappings":";;;AAAA,2CAAkE;AAClE,+CAAoD;AACpD,+CAM0B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AAC;AAK1D;IAHC,IAAA,YAAG,EAAC,GAAG,CAAC;IACR,IAAA,sBAAW,GAAE;IACb,IAAA,yBAAM,GAAE;;;;8CAOR;AAID;IAFC,IAAA,YAAG,EAAC,GAAG,CAAC;IACR,IAAA,yBAAM,GAAE;IACU,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;4CAU3B;AA/BU,gBAAgB;IAD5B,IAAA,mBAAU,GAAE;GACA,gBAAgB,CAiC5B;AAjCY,4CAAgB"}
@@ -0,0 +1,9 @@
1
+ import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
2
+ export declare class LoggerInterceptor implements NestInterceptor {
3
+ intercept(context: ExecutionContext, next: CallHandler): import("rxjs").Observable<any>;
4
+ protected generateEmptySpace(word: string, lenght: number, char?: string): string;
5
+ private paintHostName;
6
+ private paintIdentity;
7
+ private paintMethod;
8
+ }
9
+ //# sourceMappingURL=logger.interceptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.interceptor.d.ts","sourceRoot":"","sources":["../../src/interceptors/logger.interceptor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAc,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAM5F,qBACa,iBAAkB,YAAW,eAAe;IAEhD,SAAS,CAAC,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,WAAW;IAiC7D,SAAS,CAAC,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,SAAM;IAQrE,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,WAAW;CAKpB"}
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LoggerInterceptor = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const chalk_1 = __importDefault(require("chalk"));
6
+ const nestjs_console_1 = require("nestjs-console");
7
+ const rxjs_1 = require("rxjs");
8
+ let LoggerInterceptor = class LoggerInterceptor {
9
+ intercept(context, next) {
10
+ const request = context.switchToHttp().getRequest();
11
+ const startDate = Date.now();
12
+ const readableDate = new Intl.DateTimeFormat('es-ES', { dateStyle: 'short', timeStyle: 'long' }).format(startDate);
13
+ const coloredDate = chalk_1.default.yellow(readableDate);
14
+ const coloredIdentity = this.paintIdentity(request.headers.organization || request.headers.host);
15
+ const coloredMethod = this.paintMethod(request.method);
16
+ const coloredUrl = chalk_1.default.cyan(request.originalUrl);
17
+ const spinner = (0, nestjs_console_1.createSpinner)({ prefixText: this.paintHostName(request.hostname) });
18
+ const coloredFullMessage = `[${coloredDate}] ${coloredIdentity} ${coloredMethod}:${coloredUrl} `;
19
+ spinner.start(coloredFullMessage);
20
+ return next
21
+ .handle()
22
+ .pipe((0, rxjs_1.tap)(() => {
23
+ const coloredTime = chalk_1.default.green(`${Date.now() - startDate}ms`);
24
+ spinner.succeed(`${coloredFullMessage} => ${coloredTime}`);
25
+ }), (0, rxjs_1.catchError)((err) => (0, rxjs_1.throwError)(() => {
26
+ const coloredTime = chalk_1.default.redBright(`${Date.now() - startDate}ms || ${err.message}`);
27
+ spinner.fail(`${coloredFullMessage} => ${coloredTime}`);
28
+ return err;
29
+ })));
30
+ }
31
+ generateEmptySpace(word, lenght, char = ' ') {
32
+ const space = new Array(lenght).join(char);
33
+ return word.length > lenght
34
+ ? word
35
+ : space.replace(new Array(word.length).join(char), word);
36
+ }
37
+ paintHostName(hostname) {
38
+ const spacedName = this.generateEmptySpace(hostname, 30);
39
+ return chalk_1.default.black(chalk_1.default.bgWhite(spacedName));
40
+ }
41
+ paintIdentity(identity) {
42
+ const spacedName = this.generateEmptySpace(`[${identity}]`, 30);
43
+ return chalk_1.default.magenta(spacedName);
44
+ }
45
+ paintMethod(method) {
46
+ const spacedName = this.generateEmptySpace(`[${method}]`, 8);
47
+ return chalk_1.default.blue(spacedName);
48
+ }
49
+ };
50
+ LoggerInterceptor = __decorate([
51
+ (0, common_1.Injectable)()
52
+ ], LoggerInterceptor);
53
+ exports.LoggerInterceptor = LoggerInterceptor;
54
+ //# sourceMappingURL=logger.interceptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.interceptor.js","sourceRoot":"","sources":["../../src/interceptors/logger.interceptor.ts"],"names":[],"mappings":";;;AAAA,2CAA4F;AAC5F,kDAA0B;AAE1B,mDAA+C;AAC/C,+BAAmD;AAGnD,IAAa,iBAAiB,GAA9B,MAAa,iBAAiB;IAErB,SAAS,CAAC,OAAyB,EAAE,IAAiB;QAC3D,MAAM,OAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC,UAAU,EAAW,CAAC;QAE7D,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC7B,MAAM,YAAY,GAAG,IAAI,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAEnH,MAAM,WAAW,GAAG,eAAK,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC/C,MAAM,eAAe,GAAG,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACjG,MAAM,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QACvD,MAAM,UAAU,GAAG,eAAK,CAAC,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;QAEnD,MAAM,OAAO,GAAG,IAAA,8BAAa,EAAC,EAAE,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACpF,MAAM,kBAAkB,GAAG,IAAI,WAAW,YAAY,eAAe,IAAI,aAAa,IAAI,UAAU,GAAG,CAAC;QAExG,OAAO,CAAC,KAAK,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;IAChD,CAAC;IAEO,aAAa,CAAC,QAAgB;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,QAAQ,GAAG,EAAE,EAAE,CAAC,CAAC;QAEhE,OAAO,eAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;IACnC,CAAC;IAEO,WAAW,CAAC,MAAc;QAChC,MAAM,UAAU,GAAG,IAAI,CAAC,kBAAkB,CAAC,IAAI,MAAM,GAAG,EAAE,CAAC,CAAC,CAAC;QAE7D,OAAO,eAAK,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAChC,CAAC;CACF,CAAA;AA5DY,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CA4D7B;AA5DY,8CAAiB"}
@@ -0,0 +1,12 @@
1
+ import { MiddlewareConsumer, ModuleMetadata, NestModule } from '@nestjs/common';
2
+ import { AssetModule } from './assets/asset.module';
3
+ import { AuthModule } from './auth/auth.module';
4
+ import { InventoryModule } from './inventory/inventory.module';
5
+ import { SettingModule } from './settings/setting.module';
6
+ import { StoreModule } from './store/store.module';
7
+ export declare const router: (typeof AuthModule | typeof InventoryModule | typeof StoreModule | typeof SettingModule | typeof AssetModule)[];
8
+ export declare const metadata: ModuleMetadata;
9
+ export declare class AppModule implements NestModule {
10
+ configure(consumer: MiddlewareConsumer): MiddlewareConsumer;
11
+ }
12
+ //# sourceMappingURL=app.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.module.d.ts","sourceRoot":"","sources":["../../src/modules/app.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,kBAAkB,EAAU,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAIrG,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEnD,eAAO,MAAM,MAAM,iHAAyE,CAAC;AAW7F,eAAO,MAAM,QAAQ,EAAE,cAItB,CAAC;AAEF,qBACa,SAAU,YAAW,UAAU;IACnC,SAAS,CAAC,QAAQ,EAAE,kBAAkB,GAAG,kBAAkB;CAInE"}
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AppModule = exports.metadata = exports.router = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const config_1 = require("@nestjs/config");
6
+ const core_1 = require("@nestjs/core");
7
+ const asset_module_1 = require("./assets/asset.module");
8
+ const auth_module_1 = require("./auth/auth.module");
9
+ const command_module_1 = require("./command.module");
10
+ const global_module_1 = require("./global.module");
11
+ const inventory_module_1 = require("./inventory/inventory.module");
12
+ const setting_module_1 = require("./settings/setting.module");
13
+ const store_module_1 = require("./store/store.module");
14
+ exports.router = [auth_module_1.AuthModule, inventory_module_1.InventoryModule, store_module_1.StoreModule, setting_module_1.SettingModule, asset_module_1.AssetModule];
15
+ const modules = [
16
+ ...exports.router,
17
+ global_module_1.GlobalModule.register(),
18
+ command_module_1.CommandsModule.register(),
19
+ core_1.RouterModule.register(exports.router),
20
+ common_1.CacheModule.register({ isGlobal: true }),
21
+ config_1.ConfigModule.forRoot({ isGlobal: true }),
22
+ ];
23
+ exports.metadata = {
24
+ imports: modules,
25
+ providers: [],
26
+ exports: [],
27
+ };
28
+ let AppModule = class AppModule {
29
+ configure(consumer) {
30
+ return consumer;
31
+ }
32
+ };
33
+ AppModule = __decorate([
34
+ (0, common_1.Module)(exports.metadata)
35
+ ], AppModule);
36
+ exports.AppModule = AppModule;
37
+ //# sourceMappingURL=app.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app.module.js","sourceRoot":"","sources":["../../src/modules/app.module.ts"],"names":[],"mappings":";;;AAAA,2CAAqG;AACrG,2CAA8C;AAC9C,uCAA4C;AAE5C,wDAAoD;AACpD,oDAAgD;AAChD,qDAAkD;AAClD,mDAA+C;AAC/C,mEAA+D;AAC/D,8DAA0D;AAC1D,uDAAmD;AAEtC,QAAA,MAAM,GAAG,CAAC,wBAAU,EAAE,kCAAe,EAAE,0BAAW,EAAE,8BAAa,EAAE,0BAAW,CAAC,CAAC;AAE7F,MAAM,OAAO,GAAG;IACd,GAAG,cAAM;IACT,4BAAY,CAAC,QAAQ,EAAE;IACvB,+BAAc,CAAC,QAAQ,EAAE;IACzB,mBAAY,CAAC,QAAQ,CAAC,cAAgB,CAAC;IACvC,oBAAW,CAAC,QAAQ,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxC,qBAAY,CAAC,OAAO,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;CACzC,CAAC;AAEW,QAAA,QAAQ,GAAmB;IACtC,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;CACZ,CAAC;AAGF,IAAa,SAAS,GAAtB,MAAa,SAAS;IACb,SAAS,CAAC,QAA4B;QAE3C,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF,CAAA;AALY,SAAS;IADrB,IAAA,eAAM,EAAC,gBAAQ,CAAC;GACJ,SAAS,CAKrB;AALY,8BAAS"}
@@ -1,5 +1,5 @@
1
- import { AppEntity } from '../../configs/app.entity';
2
- export declare class AssetEntity extends AppEntity {
1
+ import { AbstractEntity } from '../../abstract/abstract.entity';
2
+ export declare class AssetEntity extends AbstractEntity {
3
3
  static readonly $index = "assets";
4
4
  name: string;
5
5
  url: string;
@@ -12,8 +12,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.AssetEntity = void 0;
13
13
  const mongoose_1 = require("@nestjs/mongoose");
14
14
  const mongoose_2 = require("mongoose");
15
- const app_entity_1 = require("../../configs/app.entity");
16
- let AssetEntity = class AssetEntity extends app_entity_1.AppEntity {
15
+ const abstract_entity_1 = require("../../abstract/abstract.entity");
16
+ let AssetEntity = class AssetEntity extends abstract_entity_1.AbstractEntity {
17
17
  static $index = 'assets';
18
18
  name;
19
19
  url;
@@ -0,0 +1,7 @@
1
+ import { User } from 'auth0';
2
+ import { Auth0Service } from '../../services/auth0.service';
3
+ export declare class AuthController {
4
+ protected readonly $auth0: Auth0Service;
5
+ user(userId: string): Promise<User>;
6
+ }
7
+ //# sourceMappingURL=auth.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.controller.d.ts","sourceRoot":"","sources":["../../../src/modules/auth/auth.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAgB,IAAI,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,qBAEa,cAAc;IACf,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAGrC,IAAI,CAAiB,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAIjE"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AuthController = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const user_decorator_1 = require("../../decorators/user.decorator");
7
+ const auth0_service_1 = require("../../services/auth0.service");
8
+ let AuthController = class AuthController {
9
+ user(userId) {
10
+ return __awaiter(this, void 0, void 0, function* () {
11
+ return this.$auth0.getUser({ id: userId });
12
+ });
13
+ }
14
+ };
15
+ __decorate([
16
+ (0, common_1.Inject)(),
17
+ __metadata("design:type", auth0_service_1.Auth0Service)
18
+ ], AuthController.prototype, "$auth0", void 0);
19
+ __decorate([
20
+ (0, common_1.Get)('/user'),
21
+ __param(0, (0, user_decorator_1.GetUser)('sub')),
22
+ __metadata("design:type", Function),
23
+ __metadata("design:paramtypes", [String]),
24
+ __metadata("design:returntype", Promise)
25
+ ], AuthController.prototype, "user", null);
26
+ AuthController = __decorate([
27
+ (0, common_1.Controller)(),
28
+ (0, swagger_1.ApiTags)('auth')
29
+ ], AuthController);
30
+ exports.AuthController = AuthController;
31
+ //# sourceMappingURL=auth.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"auth.controller.js","sourceRoot":"","sources":["../../../src/modules/auth/auth.controller.ts"],"names":[],"mappings":";;;AAAA,2CAAyD;AACzD,6CAA0C;AAE1C,oEAA0D;AAC1D,gEAA4D;AAI5D,IAAa,cAAc,GAA3B,MAAa,cAAc;IAIZ,IAAI,CAAiB,MAAc;;YAC9C,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7C,CAAC;KAAA;CAEF,CAAA;AAPW;IAAT,IAAA,eAAM,GAAE;8BAA4B,4BAAY;8CAAC;AAGlD;IADC,IAAA,YAAG,EAAC,OAAO,CAAC;IACM,WAAA,IAAA,wBAAO,EAAC,KAAK,CAAC,CAAA;;;;0CAEhC;AANU,cAAc;IAF1B,IAAA,mBAAU,GAAE;IACZ,IAAA,iBAAO,EAAC,MAAM,CAAC;GACH,cAAc,CAQ1B;AARY,wCAAc"}
@@ -0,0 +1,8 @@
1
+ import { OrganizationConnection } from 'auth0';
2
+ import { SessionData } from 'express-session';
3
+ import { Auth0Service } from '../../../services/auth0.service';
4
+ export declare class ConnectionController {
5
+ protected readonly auth0: Auth0Service;
6
+ find(session: SessionData): Promise<OrganizationConnection[]>;
7
+ }
8
+ //# sourceMappingURL=connection.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/connections/connection.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,qBAEa,oBAAoB;IACrB,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAGpC,IAAI,CAAY,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,sBAAsB,EAAE,CAAC;CAItF"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConnectionController = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const auth0_service_1 = require("../../../services/auth0.service");
7
+ let ConnectionController = class ConnectionController {
8
+ find(session) {
9
+ return __awaiter(this, void 0, void 0, function* () {
10
+ return this.auth0.organizations.getEnabledConnections({ id: session.organization.id });
11
+ });
12
+ }
13
+ };
14
+ __decorate([
15
+ (0, common_1.Inject)(),
16
+ __metadata("design:type", auth0_service_1.Auth0Service)
17
+ ], ConnectionController.prototype, "auth0", void 0);
18
+ __decorate([
19
+ (0, common_1.Get)('/'),
20
+ __param(0, (0, common_1.Session)()),
21
+ __metadata("design:type", Function),
22
+ __metadata("design:paramtypes", [Object]),
23
+ __metadata("design:returntype", Promise)
24
+ ], ConnectionController.prototype, "find", null);
25
+ ConnectionController = __decorate([
26
+ (0, common_1.Controller)(),
27
+ (0, swagger_1.ApiTags)('organization')
28
+ ], ConnectionController);
29
+ exports.ConnectionController = ConnectionController;
30
+ //# sourceMappingURL=connection.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/connections/connection.controller.ts"],"names":[],"mappings":";;;AAAA,2CAAkE;AAClE,6CAA0C;AAG1C,mEAA+D;AAI/D,IAAa,oBAAoB,GAAjC,MAAa,oBAAoB;IAIlB,IAAI,CAAY,OAAoB;;YAC/C,OAAO,IAAI,CAAC,KAAK,CAAC,aAAa,CAAC,qBAAqB,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC;QACzF,CAAC;KAAA;CAEF,CAAA;AAPW;IAAT,IAAA,eAAM,GAAE;8BAA2B,4BAAY;mDAAC;AAGjD;IADC,IAAA,YAAG,EAAC,GAAG,CAAC;IACU,WAAA,IAAA,gBAAO,GAAE,CAAA;;;;gDAE3B;AANU,oBAAoB;IAFhC,IAAA,mBAAU,GAAE;IACZ,IAAA,iBAAO,EAAC,cAAc,CAAC;GACX,oBAAoB,CAQhC;AARY,oDAAoB"}
@@ -0,0 +1,8 @@
1
+ import { ModuleMetadata } from '@nestjs/common';
2
+ import { AppRouter } from '../../../configs/app.router';
3
+ export declare const metadata: ModuleMetadata;
4
+ export declare class ConnectionModule extends AppRouter {
5
+ static readonly path = "/connections";
6
+ static readonly module: typeof ConnectionModule;
7
+ }
8
+ //# sourceMappingURL=connection.module.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.module.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/connections/connection.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAGxD,eAAO,MAAM,QAAQ,EAAE,cAKtB,CAAC;AAEF,qBACa,gBAAiB,SAAQ,SAAS;IAC7C,gBAAuB,IAAI,kBAAkB;IAE7C,gBAAuB,MAAM,0BAAoB;CAClD"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ var ConnectionModule_1;
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.ConnectionModule = exports.metadata = void 0;
5
+ const common_1 = require("@nestjs/common");
6
+ const app_router_1 = require("../../../configs/app.router");
7
+ const connection_controller_1 = require("./connection.controller");
8
+ exports.metadata = {
9
+ imports: [],
10
+ controllers: [connection_controller_1.ConnectionController],
11
+ providers: [],
12
+ exports: [],
13
+ };
14
+ let ConnectionModule = ConnectionModule_1 = class ConnectionModule extends app_router_1.AppRouter {
15
+ };
16
+ ConnectionModule.path = '/connections';
17
+ ConnectionModule.module = ConnectionModule_1;
18
+ ConnectionModule = ConnectionModule_1 = __decorate([
19
+ (0, common_1.Module)(exports.metadata)
20
+ ], ConnectionModule);
21
+ exports.ConnectionModule = ConnectionModule;
22
+ //# sourceMappingURL=connection.module.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.module.js","sourceRoot":"","sources":["../../../../src/modules/auth/connections/connection.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwD;AACxD,4DAAwD;AACxD,mEAA+D;AAElD,QAAA,QAAQ,GAAmB;IACtC,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,CAAC,4CAAoB,CAAC;IACnC,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;CACZ,CAAC;AAGF,IAAa,gBAAgB,wBAA7B,MAAa,gBAAiB,SAAQ,sBAAS;CAI9C,CAAA;AAHwB,qBAAI,GAAG,cAAe,CAAA;AAEtB,uBAAM,GAAG,kBAAiB,CAAA;AAHtC,gBAAgB;IAD5B,IAAA,eAAM,EAAC,gBAAQ,CAAC;GACJ,gBAAgB,CAI5B;AAJY,4CAAgB"}
@@ -7,3 +7,4 @@ export declare class CreateConnectionValidator implements AddOrganizationEnabled
7
7
  export declare class UpdateConnectionValidator implements UpdateOrganizationEnabledConnection {
8
8
  assign_membership_on_login: UpdateOrganizationEnabledConnection['assign_membership_on_login'];
9
9
  }
10
+ //# sourceMappingURL=connection.validator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.validator.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/connections/connection.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gCAAgC,EAAE,mCAAmC,EAAE,MAAM,OAAO,CAAC;AAE9F,OAAO,kBAAkB,CAAC;AAE1B,qBAAa,yBAA0B,YAAW,gCAAgC;IAEzE,aAAa,EAAE,gCAAgC,CAAC,eAAe,CAAC,CAAC;IAGjE,0BAA0B,EAAE,gCAAgC,CAAC,4BAA4B,CAAC,CAAC;CACnG;AAED,qBAAa,yBAA0B,YAAW,mCAAmC;IAE5E,0BAA0B,EAAE,mCAAmC,CAAC,4BAA4B,CAAC,CAAC;CACtG"}
@@ -1,20 +1,9 @@
1
1
  "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.UpdateConnectionValidator = exports.CreateConnectionValidator = void 0;
13
4
  const class_validator_1 = require("class-validator");
14
5
  require("reflect-metadata");
15
6
  class CreateConnectionValidator {
16
- connection_id;
17
- assign_membership_on_login;
18
7
  }
19
8
  __decorate([
20
9
  (0, class_validator_1.IsString)(),
@@ -26,10 +15,10 @@ __decorate([
26
15
  ], CreateConnectionValidator.prototype, "assign_membership_on_login", void 0);
27
16
  exports.CreateConnectionValidator = CreateConnectionValidator;
28
17
  class UpdateConnectionValidator {
29
- assign_membership_on_login;
30
18
  }
31
19
  __decorate([
32
20
  (0, class_validator_1.IsBoolean)(),
33
21
  __metadata("design:type", Object)
34
22
  ], UpdateConnectionValidator.prototype, "assign_membership_on_login", void 0);
35
23
  exports.UpdateConnectionValidator = UpdateConnectionValidator;
24
+ //# sourceMappingURL=connection.validator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.validator.js","sourceRoot":"","sources":["../../../../src/modules/auth/connections/connection.validator.ts"],"names":[],"mappings":";;;AACA,qDAAsD;AACtD,4BAA0B;AAE1B,MAAa,yBAAyB;CAMrC;AAJC;IADC,IAAA,0BAAQ,GAAE;;gEAC6D;AAGxE;IADC,IAAA,2BAAS,GAAE;;6EACsF;AALpG,8DAMC;AAED,MAAa,yBAAyB;CAGrC;AADC;IADC,IAAA,2BAAS,GAAE;;6EACyF;AAFvG,8DAGC"}
@@ -0,0 +1,8 @@
1
+ import { OrganizationMember } from 'auth0';
2
+ import { SessionData } from 'express-session';
3
+ import { Auth0Service } from '../../../services/auth0.service';
4
+ export declare class MemberController {
5
+ protected readonly auth0: Auth0Service;
6
+ find(session: SessionData): Promise<OrganizationMember[]>;
7
+ }
8
+ //# sourceMappingURL=member.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"member.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/members/member.controller.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,qBAEa,gBAAgB;IACjB,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAGpC,IAAI,CAAY,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,kBAAkB,EAAE,CAAC;CAIlF"}
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MemberController = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ const swagger_1 = require("@nestjs/swagger");
6
+ const auth0_service_1 = require("../../../services/auth0.service");
7
+ let MemberController = class MemberController {
8
+ find(session) {
9
+ return __awaiter(this, void 0, void 0, function* () {
10
+ return this.auth0.organizations.getMembers({ id: session.organization.id });
11
+ });
12
+ }
13
+ };
14
+ __decorate([
15
+ (0, common_1.Inject)(),
16
+ __metadata("design:type", auth0_service_1.Auth0Service)
17
+ ], MemberController.prototype, "auth0", void 0);
18
+ __decorate([
19
+ (0, common_1.Get)('/'),
20
+ __param(0, (0, common_1.Session)()),
21
+ __metadata("design:type", Function),
22
+ __metadata("design:paramtypes", [Object]),
23
+ __metadata("design:returntype", Promise)
24
+ ], MemberController.prototype, "find", null);
25
+ MemberController = __decorate([
26
+ (0, common_1.Controller)(),
27
+ (0, swagger_1.ApiTags)('organization')
28
+ ], MemberController);
29
+ exports.MemberController = MemberController;
30
+ //# sourceMappingURL=member.controller.js.map