@merkaly/api 0.2.2-12 → 0.2.2-13

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 (141) hide show
  1. package/package.json +1 -1
  2. package/.output/abstract/app.controller.d.ts +0 -11
  3. package/.output/abstract/app.controller.d.ts.map +0 -1
  4. package/.output/abstract/app.controller.js +0 -22
  5. package/.output/abstract/app.controller.js.map +0 -1
  6. package/.output/abstract/app.entity.d.ts +0 -9
  7. package/.output/abstract/app.entity.d.ts.map +0 -1
  8. package/.output/abstract/app.entity.js +0 -28
  9. package/.output/abstract/app.entity.js.map +0 -1
  10. package/.output/abstract/app.exception.d.ts +0 -11
  11. package/.output/abstract/app.exception.d.ts.map +0 -1
  12. package/.output/abstract/app.exception.js +0 -37
  13. package/.output/abstract/app.exception.js.map +0 -1
  14. package/.output/abstract/app.repository.d.ts +0 -20
  15. package/.output/abstract/app.repository.d.ts.map +0 -1
  16. package/.output/abstract/app.repository.js +0 -73
  17. package/.output/abstract/app.repository.js.map +0 -1
  18. package/.output/abstract/app.router.d.ts +0 -6
  19. package/.output/abstract/app.router.d.ts.map +0 -1
  20. package/.output/abstract/app.router.js +0 -8
  21. package/.output/abstract/app.router.js.map +0 -1
  22. package/.output/configs/app.controller.d.ts +0 -11
  23. package/.output/configs/app.controller.d.ts.map +0 -1
  24. package/.output/configs/app.controller.js +0 -22
  25. package/.output/configs/app.controller.js.map +0 -1
  26. package/.output/configs/app.entity.d.ts +0 -9
  27. package/.output/configs/app.entity.d.ts.map +0 -1
  28. package/.output/configs/app.entity.js +0 -28
  29. package/.output/configs/app.entity.js.map +0 -1
  30. package/.output/configs/app.exception.d.ts +0 -11
  31. package/.output/configs/app.exception.d.ts.map +0 -1
  32. package/.output/configs/app.exception.js +0 -37
  33. package/.output/configs/app.exception.js.map +0 -1
  34. package/.output/configs/app.repository.d.ts +0 -20
  35. package/.output/configs/app.repository.d.ts.map +0 -1
  36. package/.output/configs/app.repository.js +0 -73
  37. package/.output/configs/app.repository.js.map +0 -1
  38. package/.output/configs/app.router.d.ts +0 -6
  39. package/.output/configs/app.router.d.ts.map +0 -1
  40. package/.output/configs/app.router.js +0 -8
  41. package/.output/configs/app.router.js.map +0 -1
  42. package/.output/decorators/organization.decorator.d.ts +0 -2
  43. package/.output/decorators/organization.decorator.d.ts.map +0 -1
  44. package/.output/decorators/organization.decorator.js +0 -10
  45. package/.output/decorators/organization.decorator.js.map +0 -1
  46. package/.output/globals/global.controller.d.ts +0 -20
  47. package/.output/globals/global.controller.d.ts.map +0 -1
  48. package/.output/globals/global.controller.js +0 -76
  49. package/.output/globals/global.controller.js.map +0 -1
  50. package/.output/interceptors/logger.interceptor.d.ts +0 -9
  51. package/.output/interceptors/logger.interceptor.d.ts.map +0 -1
  52. package/.output/interceptors/logger.interceptor.js +0 -54
  53. package/.output/interceptors/logger.interceptor.js.map +0 -1
  54. package/.output/modules/app.module.d.ts +0 -12
  55. package/.output/modules/app.module.d.ts.map +0 -1
  56. package/.output/modules/app.module.js +0 -37
  57. package/.output/modules/app.module.js.map +0 -1
  58. package/.output/modules/auth/auth.controller.d.ts +0 -7
  59. package/.output/modules/auth/auth.controller.d.ts.map +0 -1
  60. package/.output/modules/auth/auth.controller.js +0 -31
  61. package/.output/modules/auth/auth.controller.js.map +0 -1
  62. package/.output/modules/auth/connections/connection.controller.d.ts +0 -8
  63. package/.output/modules/auth/connections/connection.controller.d.ts.map +0 -1
  64. package/.output/modules/auth/connections/connection.controller.js +0 -30
  65. package/.output/modules/auth/connections/connection.controller.js.map +0 -1
  66. package/.output/modules/auth/connections/connection.module.d.ts +0 -8
  67. package/.output/modules/auth/connections/connection.module.d.ts.map +0 -1
  68. package/.output/modules/auth/connections/connection.module.js +0 -22
  69. package/.output/modules/auth/connections/connection.module.js.map +0 -1
  70. package/.output/modules/auth/connections/connection.validator.d.ts +0 -10
  71. package/.output/modules/auth/connections/connection.validator.d.ts.map +0 -1
  72. package/.output/modules/auth/connections/connection.validator.js +0 -24
  73. package/.output/modules/auth/connections/connection.validator.js.map +0 -1
  74. package/.output/modules/auth/members/member.controller.d.ts +0 -8
  75. package/.output/modules/auth/members/member.controller.d.ts.map +0 -1
  76. package/.output/modules/auth/members/member.controller.js +0 -30
  77. package/.output/modules/auth/members/member.controller.js.map +0 -1
  78. package/.output/modules/auth/members/member.module.d.ts +0 -8
  79. package/.output/modules/auth/members/member.module.d.ts.map +0 -1
  80. package/.output/modules/auth/members/member.module.js +0 -22
  81. package/.output/modules/auth/members/member.module.js.map +0 -1
  82. package/.output/modules/auth/members/member.validator.d.ts +0 -4
  83. package/.output/modules/auth/members/member.validator.d.ts.map +0 -1
  84. package/.output/modules/auth/members/member.validator.js +0 -4
  85. package/.output/modules/auth/members/member.validator.js.map +0 -1
  86. package/.output/modules/auth/organizations/organization.controller.d.ts +0 -16
  87. package/.output/modules/auth/organizations/organization.controller.d.ts.map +0 -1
  88. package/.output/modules/auth/organizations/organization.controller.js +0 -101
  89. package/.output/modules/auth/organizations/organization.controller.js.map +0 -1
  90. package/.output/modules/auth/organizations/organization.module.d.ts +0 -9
  91. package/.output/modules/auth/organizations/organization.module.d.ts.map +0 -1
  92. package/.output/modules/auth/organizations/organization.module.js +0 -24
  93. package/.output/modules/auth/organizations/organization.module.js.map +0 -1
  94. package/.output/modules/auth/organizations/organization.repository.d.ts +0 -9
  95. package/.output/modules/auth/organizations/organization.repository.d.ts.map +0 -1
  96. package/.output/modules/auth/organizations/organization.repository.js +0 -42
  97. package/.output/modules/auth/organizations/organization.repository.js.map +0 -1
  98. package/.output/modules/auth/organizations/organization.validator.d.ts +0 -7
  99. package/.output/modules/auth/organizations/organization.validator.d.ts.map +0 -1
  100. package/.output/modules/auth/organizations/organization.validator.js +0 -22
  101. package/.output/modules/auth/organizations/organization.validator.js.map +0 -1
  102. package/.output/modules/health/health.controller.d.ts +0 -8
  103. package/.output/modules/health/health.controller.d.ts.map +0 -1
  104. package/.output/modules/health/health.controller.js +0 -29
  105. package/.output/modules/health/health.controller.js.map +0 -1
  106. package/.output/modules/health/health.module.d.ts +0 -9
  107. package/.output/modules/health/health.module.d.ts.map +0 -1
  108. package/.output/modules/health/health.module.js +0 -24
  109. package/.output/modules/health/health.module.js.map +0 -1
  110. package/.output/modules/health.module.d.ts +0 -3
  111. package/.output/modules/health.module.d.ts.map +0 -1
  112. package/.output/modules/health.module.js +0 -14
  113. package/.output/modules/health.module.js.map +0 -1
  114. package/.output/modules/settings/organization/organization.entity.d.ts +0 -10
  115. package/.output/modules/settings/organization/organization.entity.d.ts.map +0 -1
  116. package/.output/modules/settings/organization/organization.entity.js +0 -11
  117. package/.output/modules/settings/organization/organization.entity.js.map +0 -1
  118. package/.output/modules/settings/organizations/organization.controller.d.ts +0 -16
  119. package/.output/modules/settings/organizations/organization.controller.d.ts.map +0 -1
  120. package/.output/modules/settings/organizations/organization.controller.js +0 -101
  121. package/.output/modules/settings/organizations/organization.controller.js.map +0 -1
  122. package/.output/modules/settings/organizations/organization.module.d.ts +0 -9
  123. package/.output/modules/settings/organizations/organization.module.d.ts.map +0 -1
  124. package/.output/modules/settings/organizations/organization.module.js +0 -24
  125. package/.output/modules/settings/organizations/organization.module.js.map +0 -1
  126. package/.output/modules/settings/organizations/organization.repository.d.ts +0 -9
  127. package/.output/modules/settings/organizations/organization.repository.d.ts.map +0 -1
  128. package/.output/modules/settings/organizations/organization.repository.js +0 -42
  129. package/.output/modules/settings/organizations/organization.repository.js.map +0 -1
  130. package/.output/modules/settings/organizations/organization.validator.d.ts +0 -7
  131. package/.output/modules/settings/organizations/organization.validator.d.ts.map +0 -1
  132. package/.output/modules/settings/organizations/organization.validator.js +0 -22
  133. package/.output/modules/settings/organizations/organization.validator.js.map +0 -1
  134. package/.output/providers/mongo.provider.d.ts +0 -20
  135. package/.output/providers/mongo.provider.d.ts.map +0 -1
  136. package/.output/providers/mongo.provider.js +0 -41
  137. package/.output/providers/mongo.provider.js.map +0 -1
  138. package/.output/providers/schema.provider.d.ts +0 -12
  139. package/.output/providers/schema.provider.d.ts.map +0 -1
  140. package/.output/providers/schema.provider.js +0 -33
  141. package/.output/providers/schema.provider.js.map +0 -1
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrganizationController = void 0;
4
- const common_1 = require("@nestjs/common");
5
- const swagger_1 = require("@nestjs/swagger");
6
- const organization_decorator_1 = require("../../../decorators/organization.decorator");
7
- const public_decorator_1 = require("../../../decorators/public.decorator");
8
- const user_decorator_1 = require("../../../decorators/user.decorator");
9
- const auth0_service_1 = require("../../../services/auth0.service");
10
- const organization_repository_1 = require("./organization.repository");
11
- const organization_validator_1 = require("./organization.validator");
12
- let OrganizationController = class OrganizationController {
13
- findAll(id) {
14
- return __awaiter(this, void 0, void 0, function* () {
15
- return this.$repository.find(id);
16
- });
17
- }
18
- create(validator) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- const organization = yield this.$repository.create(validator)
21
- .catch(reason => {
22
- throw new common_1.ConflictException(reason);
23
- });
24
- const { user_id } = yield this.$auth0.createUser({
25
- email: validator.email,
26
- password: validator.password,
27
- connection: 'default',
28
- });
29
- const params = { id: organization.id };
30
- const members = { members: [user_id] };
31
- yield this.$auth0.organizations.addMembers(params, members);
32
- return organization;
33
- });
34
- }
35
- validate(slug) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- const result = yield this.$auth0.organizations.getByName({ name: slug })
38
- .catch(() => ({}));
39
- if ('id' in result) {
40
- throw new common_1.ConflictException('Ja existe uma loja com esse nome');
41
- }
42
- return ({
43
- name: slug,
44
- available: true,
45
- });
46
- });
47
- }
48
- current(id) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- return this.$auth0.organizations.getByID({ id })
51
- .catch(reason => {
52
- throw new common_1.HttpException(`${reason.message}: [${id}]`, reason.statusCode);
53
- });
54
- });
55
- }
56
- };
57
- __decorate([
58
- (0, common_1.Inject)(),
59
- __metadata("design:type", auth0_service_1.Auth0Service)
60
- ], OrganizationController.prototype, "$auth0", void 0);
61
- __decorate([
62
- (0, common_1.Inject)(),
63
- __metadata("design:type", organization_repository_1.OrganizationRepository)
64
- ], OrganizationController.prototype, "$repository", void 0);
65
- __decorate([
66
- (0, common_1.Get)('/'),
67
- __param(0, (0, user_decorator_1.GetUser)('sub')),
68
- __metadata("design:type", Function),
69
- __metadata("design:paramtypes", [String]),
70
- __metadata("design:returntype", Promise)
71
- ], OrganizationController.prototype, "findAll", null);
72
- __decorate([
73
- (0, common_1.Post)('/'),
74
- __param(0, (0, common_1.Body)()),
75
- __metadata("design:type", Function),
76
- __metadata("design:paramtypes", [organization_validator_1.CreateOrganizationValidator]),
77
- __metadata("design:returntype", Promise)
78
- ], OrganizationController.prototype, "create", null);
79
- __decorate([
80
- (0, common_1.Post)('/validate'),
81
- (0, public_decorator_1.Public)(),
82
- (0, common_1.HttpCode)(common_1.HttpStatus.ACCEPTED),
83
- __param(0, (0, common_1.Body)('slug')),
84
- __metadata("design:type", Function),
85
- __metadata("design:paramtypes", [String]),
86
- __metadata("design:returntype", Promise)
87
- ], OrganizationController.prototype, "validate", null);
88
- __decorate([
89
- (0, common_1.Get)('/current'),
90
- (0, public_decorator_1.Public)(),
91
- __param(0, (0, organization_decorator_1.GetOrganization)()),
92
- __metadata("design:type", Function),
93
- __metadata("design:paramtypes", [String]),
94
- __metadata("design:returntype", Promise)
95
- ], OrganizationController.prototype, "current", null);
96
- OrganizationController = __decorate([
97
- (0, common_1.Controller)(),
98
- (0, swagger_1.ApiTags)('auth')
99
- ], OrganizationController);
100
- exports.OrganizationController = OrganizationController;
101
- //# sourceMappingURL=organization.controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.controller.js","sourceRoot":"","sources":["../../../../src/modules/auth/organizations/organization.controller.ts"],"names":[],"mappings":"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"}
@@ -1,9 +0,0 @@
1
- import { ModuleMetadata } from '@nestjs/common';
2
- import { AppRouter } from '../../../configs/app.router';
3
- export declare const metadata: ModuleMetadata;
4
- export declare class OrganizationModule extends AppRouter {
5
- static readonly path = "/organizations";
6
- static readonly module: typeof OrganizationModule;
7
- static readonly children: any[];
8
- }
9
- //# sourceMappingURL=organization.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.module.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/organizations/organization.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAIxD,eAAO,MAAM,QAAQ,EAAE,cAKtB,CAAC;AAEF,qBACa,kBAAmB,SAAQ,SAAS;IAC/C,gBAAuB,IAAI,oBAAoB;IAE/C,gBAAuB,MAAM,4BAAsB;IAEnD,gBAAuB,QAAQ,QAAM;CACtC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var OrganizationModule_1;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.OrganizationModule = exports.metadata = void 0;
5
- const common_1 = require("@nestjs/common");
6
- const app_router_1 = require("../../../configs/app.router");
7
- const organization_controller_1 = require("./organization.controller");
8
- const organization_repository_1 = require("./organization.repository");
9
- exports.metadata = {
10
- imports: [],
11
- controllers: [organization_controller_1.OrganizationController],
12
- providers: [organization_repository_1.OrganizationRepository],
13
- exports: [organization_repository_1.OrganizationRepository],
14
- };
15
- let OrganizationModule = OrganizationModule_1 = class OrganizationModule extends app_router_1.AppRouter {
16
- };
17
- OrganizationModule.path = '/organizations';
18
- OrganizationModule.module = OrganizationModule_1;
19
- OrganizationModule.children = [];
20
- OrganizationModule = OrganizationModule_1 = __decorate([
21
- (0, common_1.Module)(exports.metadata)
22
- ], OrganizationModule);
23
- exports.OrganizationModule = OrganizationModule;
24
- //# sourceMappingURL=organization.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.module.js","sourceRoot":"","sources":["../../../../src/modules/auth/organizations/organization.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwD;AACxD,4DAAwD;AACxD,uEAAmE;AACnE,uEAAmE;AAEtD,QAAA,QAAQ,GAAmB;IACtC,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,CAAC,gDAAsB,CAAC;IACrC,SAAS,EAAE,CAAC,gDAAsB,CAAC;IACnC,OAAO,EAAE,CAAC,gDAAsB,CAAC;CAClC,CAAC;AAGF,IAAa,kBAAkB,0BAA/B,MAAa,kBAAmB,SAAQ,sBAAS;CAMhD,CAAA;AALwB,uBAAI,GAAG,gBAAiB,CAAA;AAExB,yBAAM,GAAG,oBAAmB,CAAA;AAE5B,2BAAQ,GAAG,EAAG,CAAA;AAL1B,kBAAkB;IAD9B,IAAA,eAAM,EAAC,gBAAQ,CAAC;GACJ,kBAAkB,CAM9B;AANY,gDAAkB"}
@@ -1,9 +0,0 @@
1
- import { Organization } from 'auth0';
2
- import { Auth0Service } from '../../../services/auth0.service';
3
- import { CreateOrganizationValidator } from './organization.validator';
4
- export declare class OrganizationRepository {
5
- protected readonly $auth0: Auth0Service;
6
- find(userId: string): Promise<Organization[]>;
7
- create(validator: CreateOrganizationValidator): Promise<Organization>;
8
- }
9
- //# sourceMappingURL=organization.repository.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.repository.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/organizations/organization.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,qBACa,sBAAsB;IACvB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAErC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAI7C,MAAM,CAAC,SAAS,EAAE,2BAA2B,GAAG,OAAO,CAAC,YAAY,CAAC;CAyBnF"}
@@ -1,42 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrganizationRepository = void 0;
4
- const common_1 = require("@nestjs/common");
5
- const short_unique_id_1 = __importDefault(require("short-unique-id"));
6
- const auth0_service_1 = require("../../../services/auth0.service");
7
- let OrganizationRepository = class OrganizationRepository {
8
- find(userId) {
9
- return __awaiter(this, void 0, void 0, function* () {
10
- return this.$auth0.users.getUserOrganizations({ id: userId });
11
- });
12
- }
13
- create(validator) {
14
- return __awaiter(this, void 0, void 0, function* () {
15
- const uid = new short_unique_id_1.default({ length: 10 });
16
- const createOrg = {
17
- name: uid(),
18
- display_name: validator.name,
19
- };
20
- const organization = yield this.$auth0.organizations.create(createOrg);
21
- const allConnections = yield this.$auth0.getConnections()
22
- .then(connections => connections.filter(({ name }) => name !== 'sms'));
23
- const connectionsPromise = [];
24
- for (const connection of allConnections) {
25
- connectionsPromise.push(this.$auth0.organizations.addEnabledConnection({ id: organization.id }, {
26
- connection_id: connection.id,
27
- }));
28
- }
29
- return Promise.all(connectionsPromise)
30
- .then(() => organization);
31
- });
32
- }
33
- };
34
- __decorate([
35
- (0, common_1.Inject)(),
36
- __metadata("design:type", auth0_service_1.Auth0Service)
37
- ], OrganizationRepository.prototype, "$auth0", void 0);
38
- OrganizationRepository = __decorate([
39
- (0, common_1.Injectable)()
40
- ], OrganizationRepository);
41
- exports.OrganizationRepository = OrganizationRepository;
42
- //# sourceMappingURL=organization.repository.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.repository.js","sourceRoot":"","sources":["../../../../src/modules/auth/organizations/organization.repository.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AAEpD,sEAA4C;AAC5C,mEAA+D;AAI/D,IAAa,sBAAsB,GAAnC,MAAa,sBAAsB;IAGpB,IAAI,CAAC,MAAc;;YAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAChE,CAAC;KAAA;IAEY,MAAM,CAAC,SAAsC;;YACxD,MAAM,GAAG,GAAG,IAAI,yBAAa,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,CAAC;YAE9C,MAAM,SAAS,GAAuB;gBACpC,IAAI,EAAE,GAAG,EAAE;gBACX,YAAY,EAAE,SAAS,CAAC,IAAI;aAC7B,CAAC;YAEF,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAGvE,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,cAAc,EAAE;iBACtD,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC;YAEzE,MAAM,kBAAkB,GAAG,EAAE,CAAC;YAE9B,KAAK,MAAM,UAAU,IAAI,cAAc,EAAE;gBACvC,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,YAAY,CAAC,EAAE,EAAE,EAAE;oBAC9F,aAAa,EAAE,UAAU,CAAC,EAAE;iBAC7B,CAAC,CAAC,CAAC;aACL;YAED,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;iBACnC,IAAI,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC;QAC9B,CAAC;KAAA;CACF,CAAA;AA/BW;IAAT,IAAA,eAAM,GAAE;8BAA4B,4BAAY;sDAAC;AADvC,sBAAsB;IADlC,IAAA,mBAAU,GAAE;GACA,sBAAsB,CAgClC;AAhCY,wDAAsB"}
@@ -1,7 +0,0 @@
1
- import { CreateOrganization } from 'auth0';
2
- export declare class CreateOrganizationValidator implements CreateOrganization {
3
- name: string;
4
- email: string;
5
- password?: string;
6
- }
7
- //# sourceMappingURL=organization.validator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.validator.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/organizations/organization.validator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,OAAO,CAAC;AAG3C,qBAAa,2BAA4B,YAAW,kBAAkB;IAG7D,IAAI,EAAE,MAAM,CAAC;IAIb,KAAK,EAAE,MAAM,CAAC;IAGd,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC1B"}
@@ -1,22 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CreateOrganizationValidator = void 0;
4
- const class_validator_1 = require("class-validator");
5
- class CreateOrganizationValidator {
6
- }
7
- __decorate([
8
- (0, class_validator_1.IsString)(),
9
- (0, class_validator_1.Length)(3, 255),
10
- __metadata("design:type", String)
11
- ], CreateOrganizationValidator.prototype, "name", void 0);
12
- __decorate([
13
- (0, class_validator_1.IsString)(),
14
- (0, class_validator_1.IsEmail)(),
15
- __metadata("design:type", String)
16
- ], CreateOrganizationValidator.prototype, "email", void 0);
17
- __decorate([
18
- (0, class_validator_1.IsString)(),
19
- __metadata("design:type", String)
20
- ], CreateOrganizationValidator.prototype, "password", void 0);
21
- exports.CreateOrganizationValidator = CreateOrganizationValidator;
22
- //# sourceMappingURL=organization.validator.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.validator.js","sourceRoot":"","sources":["../../../../src/modules/auth/organizations/organization.validator.ts"],"names":[],"mappings":";;;AACA,qDAA4D;AAE5D,MAAa,2BAA2B;CAWvC;AARC;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAM,EAAC,CAAC,EAAE,GAAG,CAAC;;yDACK;AAIpB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,yBAAO,GAAE;;0DACW;AAGrB;IADC,IAAA,0BAAQ,GAAE;;6DACc;AAV3B,kEAWC"}
@@ -1,8 +0,0 @@
1
- import { HealthCheckService, MongooseHealthIndicator } from '@nestjs/terminus';
2
- export declare class HealthController {
3
- private health;
4
- private http;
5
- constructor(health: HealthCheckService, http: MongooseHealthIndicator);
6
- check(): Promise<import("@nestjs/terminus").HealthCheckResult>;
7
- }
8
- //# sourceMappingURL=health.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health.controller.d.ts","sourceRoot":"","sources":["../../../src/modules/health/health.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,kBAAkB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAE5F,qBACa,gBAAgB;IACf,OAAO,CAAC,MAAM;IAAsB,OAAO,CAAC,IAAI;gBAAxC,MAAM,EAAE,kBAAkB,EAAU,IAAI,EAAE,uBAAuB;IAKrF,KAAK;CAKN"}
@@ -1,29 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HealthController = void 0;
4
- const common_1 = require("@nestjs/common");
5
- const terminus_1 = require("@nestjs/terminus");
6
- let HealthController = class HealthController {
7
- constructor(health, http) {
8
- this.health = health;
9
- this.http = http;
10
- }
11
- check() {
12
- return this.health.check([
13
- () => this.http.pingCheck('mongodb', { timeout: 1500 }),
14
- ]);
15
- }
16
- };
17
- __decorate([
18
- (0, common_1.Get)(),
19
- (0, terminus_1.HealthCheck)(),
20
- __metadata("design:type", Function),
21
- __metadata("design:paramtypes", []),
22
- __metadata("design:returntype", void 0)
23
- ], HealthController.prototype, "check", null);
24
- HealthController = __decorate([
25
- (0, common_1.Controller)('/'),
26
- __metadata("design:paramtypes", [terminus_1.HealthCheckService, terminus_1.MongooseHealthIndicator])
27
- ], HealthController);
28
- exports.HealthController = HealthController;
29
- //# sourceMappingURL=health.controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health.controller.js","sourceRoot":"","sources":["../../../src/modules/health/health.controller.ts"],"names":[],"mappings":";;;AAAA,2CAAiD;AACjD,+CAA4F;AAG5F,IAAa,gBAAgB,GAA7B,MAAa,gBAAgB;IAC3B,YAAoB,MAA0B,EAAU,IAA6B;QAAjE,WAAM,GAAN,MAAM,CAAoB;QAAU,SAAI,GAAJ,IAAI,CAAyB;IACrF,CAAC;IAID,KAAK;QACH,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;YACvB,GAAG,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;SACxD,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AALC;IAFC,IAAA,YAAG,GAAE;IACL,IAAA,sBAAW,GAAE;;;;6CAKb;AAVU,gBAAgB;IAD5B,IAAA,mBAAU,EAAC,GAAG,CAAC;qCAEc,6BAAkB,EAAgB,kCAAuB;GAD1E,gBAAgB,CAW5B;AAXY,4CAAgB"}
@@ -1,9 +0,0 @@
1
- import { ModuleMetadata } from '@nestjs/common';
2
- import { AppRouter } from '../../configs/app.router';
3
- export declare const metadata: ModuleMetadata;
4
- export declare class HealthModule extends AppRouter {
5
- static readonly path = "/health";
6
- static readonly module: typeof HealthModule;
7
- static readonly children: (import("@nestjs/common").DynamicModule | import("@nestjs/common").Type<any> | Promise<import("@nestjs/common").DynamicModule> | import("@nestjs/common").ForwardReference<any>)[];
8
- }
9
- //# sourceMappingURL=health.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health.module.d.ts","sourceRoot":"","sources":["../../../src/modules/health/health.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAExD,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAGrD,eAAO,MAAM,QAAQ,EAAE,cAKtB,CAAC;AAEF,qBACa,YAAa,SAAQ,SAAS;IACzC,gBAAuB,IAAI,aAAa;IAExC,gBAAuB,MAAM,sBAAgB;IAE7C,gBAAuB,QAAQ,qLAAoB;CACpD"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var HealthModule_1;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.HealthModule = exports.metadata = void 0;
5
- const common_1 = require("@nestjs/common");
6
- const terminus_1 = require("@nestjs/terminus");
7
- const app_router_1 = require("../../configs/app.router");
8
- const health_controller_1 = require("./health.controller");
9
- exports.metadata = {
10
- controllers: [health_controller_1.HealthController],
11
- imports: [terminus_1.TerminusModule],
12
- providers: [],
13
- exports: [],
14
- };
15
- let HealthModule = HealthModule_1 = class HealthModule extends app_router_1.AppRouter {
16
- };
17
- HealthModule.path = '/health';
18
- HealthModule.module = HealthModule_1;
19
- HealthModule.children = exports.metadata.imports;
20
- HealthModule = HealthModule_1 = __decorate([
21
- (0, common_1.Module)(exports.metadata)
22
- ], HealthModule);
23
- exports.HealthModule = HealthModule;
24
- //# sourceMappingURL=health.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health.module.js","sourceRoot":"","sources":["../../../src/modules/health/health.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwD;AACxD,+CAAkD;AAClD,yDAAqD;AACrD,2DAAuD;AAE1C,QAAA,QAAQ,GAAmB;IACtC,WAAW,EAAE,CAAC,oCAAgB,CAAC;IAC/B,OAAO,EAAE,CAAC,yBAAc,CAAC;IACzB,SAAS,EAAE,EAAE;IACb,OAAO,EAAE,EAAE;CACZ,CAAC;AAGF,IAAa,YAAY,oBAAzB,MAAa,YAAa,SAAQ,sBAAS;CAM1C,CAAA;AALwB,iBAAI,GAAG,SAAU,CAAA;AAEjB,mBAAM,GAAG,cAAa,CAAA;AAEtB,qBAAQ,GAAG,gBAAQ,CAAC,OAAQ,CAAA;AALxC,YAAY;IADxB,IAAA,eAAM,EAAC,gBAAQ,CAAC;GACJ,YAAY,CAMxB;AANY,oCAAY"}
@@ -1,3 +0,0 @@
1
- export declare class HealthModule {
2
- }
3
- //# sourceMappingURL=health.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health.module.d.ts","sourceRoot":"","sources":["../../src/modules/health.module.ts"],"names":[],"mappings":"AAGA,qBAGa,YAAY;CACxB"}
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HealthModule = void 0;
4
- const common_1 = require("@nestjs/common");
5
- const terminus_1 = require("@nestjs/terminus");
6
- let HealthModule = class HealthModule {
7
- };
8
- HealthModule = __decorate([
9
- (0, common_1.Module)({
10
- imports: [terminus_1.TerminusModule],
11
- })
12
- ], HealthModule);
13
- exports.HealthModule = HealthModule;
14
- //# sourceMappingURL=health.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"health.module.js","sourceRoot":"","sources":["../../src/modules/health.module.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AACxC,+CAAkD;AAKlD,IAAa,YAAY,GAAzB,MAAa,YAAY;CACxB,CAAA;AADY,YAAY;IAHxB,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,yBAAc,CAAC;KAC1B,CAAC;GACW,YAAY,CACxB;AADY,oCAAY"}
@@ -1,10 +0,0 @@
1
- export declare class OrganizationEntity {
2
- _id: string;
3
- active: boolean;
4
- description: string;
5
- legalName: string;
6
- name: string;
7
- logoUrl: string;
8
- address: string;
9
- }
10
- //# sourceMappingURL=organization.entity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.entity.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/organization/organization.entity.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAkB;IACtB,GAAG,SAAM;IAET,MAAM,UAAQ;IAEd,WAAW,EAAE,MAAM,CAAC;IAEpB,SAAS,EAAE,MAAM,CAAC;IAElB,IAAI,EAAE,MAAM,CAAC;IAEb,OAAO,EAAE,MAAM,CAAC;IAEhB,OAAO,EAAE,MAAM,CAAC;CACxB"}
@@ -1,11 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrganizationEntity = void 0;
4
- class OrganizationEntity {
5
- constructor() {
6
- this._id = '';
7
- this.active = true;
8
- }
9
- }
10
- exports.OrganizationEntity = OrganizationEntity;
11
- //# sourceMappingURL=organization.entity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.entity.js","sourceRoot":"","sources":["../../../../src/modules/settings/organization/organization.entity.ts"],"names":[],"mappings":";;;AAAA,MAAa,kBAAkB;IAA/B;QACS,QAAG,GAAG,EAAE,CAAC;QAET,WAAM,GAAG,IAAI,CAAC;IAWvB,CAAC;CAAA;AAdD,gDAcC"}
@@ -1,16 +0,0 @@
1
- import { Organization } from 'auth0';
2
- import { Auth0Service } from '../../../services/auth0.service';
3
- import { OrganizationRepository } from './organization.repository';
4
- import { CreateOrganizationValidator } from './organization.validator';
5
- export declare class OrganizationController {
6
- protected readonly $auth0: Auth0Service;
7
- protected readonly $repository: OrganizationRepository;
8
- findAll(id: string): Promise<Organization[]>;
9
- create(validator: CreateOrganizationValidator): Promise<Organization>;
10
- validate(slug: string): Promise<{
11
- name: string;
12
- available: boolean;
13
- }>;
14
- current(id: string): Promise<Organization>;
15
- }
16
- //# sourceMappingURL=organization.controller.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.controller.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/organizations/organization.controller.ts"],"names":[],"mappings":"AAYA,OAAO,EAAwC,YAAY,EAAE,MAAM,OAAO,CAAC;AAI3E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,qBAEa,sBAAsB;IACvB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IACxC,SAAS,CAAC,QAAQ,CAAC,WAAW,EAAE,sBAAsB,CAAC;IAGpD,OAAO,CAAiB,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAM5D,MAAM,CAAS,SAAS,EAAE,2BAA2B,GAAG,OAAO,CAAC,YAAY,CAAC;IAwB7E,QAAQ,CAAe,IAAI,EAAE,MAAM;;;;IAiBnC,OAAO,CAAoB,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;CAO3E"}
@@ -1,101 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OrganizationController = void 0;
4
- const common_1 = require("@nestjs/common");
5
- const swagger_1 = require("@nestjs/swagger");
6
- const organization_decorator_1 = require("../../../decorators/organization.decorator");
7
- const public_decorator_1 = require("../../../decorators/public.decorator");
8
- const user_decorator_1 = require("../../../decorators/user.decorator");
9
- const auth0_service_1 = require("../../../services/auth0.service");
10
- const organization_repository_1 = require("./organization.repository");
11
- const organization_validator_1 = require("./organization.validator");
12
- let OrganizationController = class OrganizationController {
13
- findAll(id) {
14
- return __awaiter(this, void 0, void 0, function* () {
15
- return this.$repository.find(id);
16
- });
17
- }
18
- create(validator) {
19
- return __awaiter(this, void 0, void 0, function* () {
20
- const organization = yield this.$repository.create(validator)
21
- .catch(reason => {
22
- throw new common_1.ConflictException(reason);
23
- });
24
- const { user_id } = yield this.$auth0.createUser({
25
- email: validator.email,
26
- password: validator.password,
27
- connection: 'default',
28
- });
29
- const params = { id: organization.id };
30
- const members = { members: [user_id] };
31
- yield this.$auth0.organizations.addMembers(params, members);
32
- return organization;
33
- });
34
- }
35
- validate(slug) {
36
- return __awaiter(this, void 0, void 0, function* () {
37
- const result = yield this.$auth0.organizations.getByName({ name: slug })
38
- .catch(() => ({}));
39
- if ('id' in result) {
40
- throw new common_1.ConflictException('Ja existe uma loja com esse nome');
41
- }
42
- return ({
43
- name: slug,
44
- available: true,
45
- });
46
- });
47
- }
48
- current(id) {
49
- return __awaiter(this, void 0, void 0, function* () {
50
- return this.$auth0.organizations.getByID({ id })
51
- .catch(reason => {
52
- throw new common_1.HttpException(`${reason.message}: [${id}]`, reason.statusCode);
53
- });
54
- });
55
- }
56
- };
57
- __decorate([
58
- (0, common_1.Inject)(),
59
- __metadata("design:type", auth0_service_1.Auth0Service)
60
- ], OrganizationController.prototype, "$auth0", void 0);
61
- __decorate([
62
- (0, common_1.Inject)(),
63
- __metadata("design:type", organization_repository_1.OrganizationRepository)
64
- ], OrganizationController.prototype, "$repository", void 0);
65
- __decorate([
66
- (0, common_1.Get)('/'),
67
- __param(0, (0, user_decorator_1.GetUser)('sub')),
68
- __metadata("design:type", Function),
69
- __metadata("design:paramtypes", [String]),
70
- __metadata("design:returntype", Promise)
71
- ], OrganizationController.prototype, "findAll", null);
72
- __decorate([
73
- (0, common_1.Post)('/'),
74
- __param(0, (0, common_1.Body)()),
75
- __metadata("design:type", Function),
76
- __metadata("design:paramtypes", [organization_validator_1.CreateOrganizationValidator]),
77
- __metadata("design:returntype", Promise)
78
- ], OrganizationController.prototype, "create", null);
79
- __decorate([
80
- (0, common_1.Post)('/validate'),
81
- (0, public_decorator_1.Public)(),
82
- (0, common_1.HttpCode)(common_1.HttpStatus.ACCEPTED),
83
- __param(0, (0, common_1.Body)('slug')),
84
- __metadata("design:type", Function),
85
- __metadata("design:paramtypes", [String]),
86
- __metadata("design:returntype", Promise)
87
- ], OrganizationController.prototype, "validate", null);
88
- __decorate([
89
- (0, common_1.Get)('/current'),
90
- (0, public_decorator_1.Public)(),
91
- __param(0, (0, organization_decorator_1.GetOrganization)()),
92
- __metadata("design:type", Function),
93
- __metadata("design:paramtypes", [String]),
94
- __metadata("design:returntype", Promise)
95
- ], OrganizationController.prototype, "current", null);
96
- OrganizationController = __decorate([
97
- (0, common_1.Controller)(),
98
- (0, swagger_1.ApiTags)('auth')
99
- ], OrganizationController);
100
- exports.OrganizationController = OrganizationController;
101
- //# sourceMappingURL=organization.controller.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.controller.js","sourceRoot":"","sources":["../../../../src/modules/settings/organizations/organization.controller.ts"],"names":[],"mappings":"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"}
@@ -1,9 +0,0 @@
1
- import { ModuleMetadata } from '@nestjs/common';
2
- import { AppRouter } from '../../../configs/app.router';
3
- export declare const metadata: ModuleMetadata;
4
- export declare class OrganizationModule extends AppRouter {
5
- static readonly path = "/organizations";
6
- static readonly module: typeof OrganizationModule;
7
- static readonly children: any[];
8
- }
9
- //# sourceMappingURL=organization.module.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.module.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/organizations/organization.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,cAAc,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAIxD,eAAO,MAAM,QAAQ,EAAE,cAKtB,CAAC;AAEF,qBACa,kBAAmB,SAAQ,SAAS;IAC/C,gBAAuB,IAAI,oBAAoB;IAE/C,gBAAuB,MAAM,4BAAsB;IAEnD,gBAAuB,QAAQ,QAAM;CACtC"}
@@ -1,24 +0,0 @@
1
- "use strict";
2
- var OrganizationModule_1;
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.OrganizationModule = exports.metadata = void 0;
5
- const common_1 = require("@nestjs/common");
6
- const app_router_1 = require("../../../configs/app.router");
7
- const organization_controller_1 = require("./organization.controller");
8
- const organization_repository_1 = require("./organization.repository");
9
- exports.metadata = {
10
- imports: [],
11
- controllers: [organization_controller_1.OrganizationController],
12
- providers: [organization_repository_1.OrganizationRepository],
13
- exports: [organization_repository_1.OrganizationRepository],
14
- };
15
- let OrganizationModule = OrganizationModule_1 = class OrganizationModule extends app_router_1.AppRouter {
16
- };
17
- OrganizationModule.path = '/organizations';
18
- OrganizationModule.module = OrganizationModule_1;
19
- OrganizationModule.children = [];
20
- OrganizationModule = OrganizationModule_1 = __decorate([
21
- (0, common_1.Module)(exports.metadata)
22
- ], OrganizationModule);
23
- exports.OrganizationModule = OrganizationModule;
24
- //# sourceMappingURL=organization.module.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.module.js","sourceRoot":"","sources":["../../../../src/modules/settings/organizations/organization.module.ts"],"names":[],"mappings":";;;;AAAA,2CAAwD;AACxD,4DAAwD;AACxD,uEAAmE;AACnE,uEAAmE;AAEtD,QAAA,QAAQ,GAAmB;IACtC,OAAO,EAAE,EAAE;IACX,WAAW,EAAE,CAAC,gDAAsB,CAAC;IACrC,SAAS,EAAE,CAAC,gDAAsB,CAAC;IACnC,OAAO,EAAE,CAAC,gDAAsB,CAAC;CAClC,CAAC;AAGF,IAAa,kBAAkB,0BAA/B,MAAa,kBAAmB,SAAQ,sBAAS;CAMhD,CAAA;AALwB,uBAAI,GAAG,gBAAiB,CAAA;AAExB,yBAAM,GAAG,oBAAmB,CAAA;AAE5B,2BAAQ,GAAG,EAAG,CAAA;AAL1B,kBAAkB;IAD9B,IAAA,eAAM,EAAC,gBAAQ,CAAC;GACJ,kBAAkB,CAM9B;AANY,gDAAkB"}
@@ -1,9 +0,0 @@
1
- import { Organization } from 'auth0';
2
- import { Auth0Service } from '../../../services/auth0.service';
3
- import { CreateOrganizationValidator } from './organization.validator';
4
- export declare class OrganizationRepository {
5
- protected readonly $auth0: Auth0Service;
6
- find(userId: string): Promise<Organization[]>;
7
- create(validator: CreateOrganizationValidator): Promise<Organization>;
8
- }
9
- //# sourceMappingURL=organization.repository.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"organization.repository.d.ts","sourceRoot":"","sources":["../../../../src/modules/settings/organizations/organization.repository.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,YAAY,EAAE,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAEvE,qBACa,sBAAsB;IACvB,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE,YAAY,CAAC;IAErC,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAI7C,MAAM,CAAC,SAAS,EAAE,2BAA2B,GAAG,OAAO,CAAC,YAAY,CAAC;CAyBnF"}