@venturialstd/organization 0.0.1 → 0.0.3

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 (36) hide show
  1. package/README.md +910 -678
  2. package/dist/constants/repository-provider.constant.d.ts +6 -0
  3. package/dist/constants/repository-provider.constant.d.ts.map +1 -0
  4. package/dist/constants/repository-provider.constant.js +10 -0
  5. package/dist/constants/repository-provider.constant.js.map +1 -0
  6. package/dist/constants/settings-type.constant.d.ts +12 -0
  7. package/dist/constants/settings-type.constant.d.ts.map +1 -0
  8. package/dist/constants/settings-type.constant.js +16 -0
  9. package/dist/constants/settings-type.constant.js.map +1 -0
  10. package/dist/controllers/organization-repository.controller.d.ts +16 -0
  11. package/dist/controllers/organization-repository.controller.d.ts.map +1 -0
  12. package/dist/controllers/organization-repository.controller.js +84 -0
  13. package/dist/controllers/organization-repository.controller.js.map +1 -0
  14. package/dist/decorators/organization.decorator.d.ts.map +1 -1
  15. package/dist/decorators/organization.decorator.js +6 -2
  16. package/dist/decorators/organization.decorator.js.map +1 -1
  17. package/dist/dtos/repository-auth.dto.d.ts +6 -0
  18. package/dist/dtos/repository-auth.dto.d.ts.map +1 -0
  19. package/dist/dtos/repository-auth.dto.js +28 -0
  20. package/dist/dtos/repository-auth.dto.js.map +1 -0
  21. package/dist/entities/organization-settings.entity.d.ts +19 -0
  22. package/dist/entities/organization-settings.entity.d.ts.map +1 -0
  23. package/dist/entities/organization-settings.entity.js +124 -0
  24. package/dist/entities/organization-settings.entity.js.map +1 -0
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +3 -0
  28. package/dist/index.js.map +1 -1
  29. package/dist/organization.module.d.ts.map +1 -1
  30. package/dist/organization.module.js +11 -4
  31. package/dist/organization.module.js.map +1 -1
  32. package/dist/services/organization-settings.service.d.ts +15 -0
  33. package/dist/services/organization-settings.service.d.ts.map +1 -0
  34. package/dist/services/organization-settings.service.js +114 -0
  35. package/dist/services/organization-settings.service.js.map +1 -0
  36. package/package.json +42 -42
@@ -0,0 +1,6 @@
1
+ export declare enum REPOSITORY_PROVIDERS {
2
+ BITBUCKET = "BITBUCKET",
3
+ GITLAB = "GITLAB",
4
+ GITHUB = "GITHUB"
5
+ }
6
+ //# sourceMappingURL=repository-provider.constant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-provider.constant.d.ts","sourceRoot":"","sources":["../../src/constants/repository-provider.constant.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,SAAS,cAAc;IACvB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REPOSITORY_PROVIDERS = void 0;
4
+ var REPOSITORY_PROVIDERS;
5
+ (function (REPOSITORY_PROVIDERS) {
6
+ REPOSITORY_PROVIDERS["BITBUCKET"] = "BITBUCKET";
7
+ REPOSITORY_PROVIDERS["GITLAB"] = "GITLAB";
8
+ REPOSITORY_PROVIDERS["GITHUB"] = "GITHUB";
9
+ })(REPOSITORY_PROVIDERS || (exports.REPOSITORY_PROVIDERS = REPOSITORY_PROVIDERS = {}));
10
+ //# sourceMappingURL=repository-provider.constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-provider.constant.js","sourceRoot":"","sources":["../../src/constants/repository-provider.constant.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,+CAAuB,CAAA;IACvB,yCAAiB,CAAA;IACjB,yCAAiB,CAAA;AACnB,CAAC,EAJW,oBAAoB,oCAApB,oBAAoB,QAI/B"}
@@ -0,0 +1,12 @@
1
+ export declare enum SETTINGS_TYPE {
2
+ TEXT = "text",
3
+ TEXTAREA = "textarea",
4
+ NUMBER = "number",
5
+ BOOLEAN = "boolean",
6
+ SELECT = "select",
7
+ MULTISELECT = "multiselect",
8
+ JSON = "json",
9
+ DATE = "date",
10
+ SECRET = "secret"
11
+ }
12
+ //# sourceMappingURL=settings-type.constant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-type.constant.d.ts","sourceRoot":"","sources":["../../src/constants/settings-type.constant.ts"],"names":[],"mappings":"AAGA,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,MAAM,WAAW;IACjB,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,IAAI,SAAS;IACb,MAAM,WAAW;CAClB"}
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SETTINGS_TYPE = void 0;
4
+ var SETTINGS_TYPE;
5
+ (function (SETTINGS_TYPE) {
6
+ SETTINGS_TYPE["TEXT"] = "text";
7
+ SETTINGS_TYPE["TEXTAREA"] = "textarea";
8
+ SETTINGS_TYPE["NUMBER"] = "number";
9
+ SETTINGS_TYPE["BOOLEAN"] = "boolean";
10
+ SETTINGS_TYPE["SELECT"] = "select";
11
+ SETTINGS_TYPE["MULTISELECT"] = "multiselect";
12
+ SETTINGS_TYPE["JSON"] = "json";
13
+ SETTINGS_TYPE["DATE"] = "date";
14
+ SETTINGS_TYPE["SECRET"] = "secret";
15
+ })(SETTINGS_TYPE || (exports.SETTINGS_TYPE = SETTINGS_TYPE = {}));
16
+ //# sourceMappingURL=settings-type.constant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings-type.constant.js","sourceRoot":"","sources":["../../src/constants/settings-type.constant.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAUX;AAVD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,sCAAqB,CAAA;IACrB,kCAAiB,CAAA;IACjB,oCAAmB,CAAA;IACnB,kCAAiB,CAAA;IACjB,4CAA2B,CAAA;IAC3B,8BAAa,CAAA;IACb,8BAAa,CAAA;IACb,kCAAiB,CAAA;AACnB,CAAC,EAVW,aAAa,6BAAb,aAAa,QAUxB"}
@@ -0,0 +1,16 @@
1
+ import { BitbucketOAuthService } from '@venturialstd/bitbucket';
2
+ import { GithubOAuthService } from '@venturialstd/github';
3
+ import { GitlabOAuthService } from '@venturialstd/gitlab';
4
+ import { RepositoryAuthDto } from '../dtos/repository-auth.dto';
5
+ import { OrganizationSettingsService } from '../services/organization-settings.service';
6
+ export declare class OrganizationRepositoryController {
7
+ private readonly githubOAuthService;
8
+ private readonly gitlabOAuthService;
9
+ private readonly bitbucketOAuthService;
10
+ private readonly organizationSettingsService;
11
+ constructor(githubOAuthService: GithubOAuthService, gitlabOAuthService: GitlabOAuthService, bitbucketOAuthService: BitbucketOAuthService, organizationSettingsService: OrganizationSettingsService);
12
+ authenticateRepository(organizationId: string, body: RepositoryAuthDto): Promise<{
13
+ success: boolean;
14
+ }>;
15
+ }
16
+ //# sourceMappingURL=organization-repository.controller.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-repository.controller.d.ts","sourceRoot":"","sources":["../../src/controllers/organization-repository.controller.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2CAA2C,CAAC;AAExF,qBACa,gCAAgC;IAEzC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,kBAAkB;IACnC,OAAO,CAAC,QAAQ,CAAC,qBAAqB;IACtC,OAAO,CAAC,QAAQ,CAAC,2BAA2B;gBAH3B,kBAAkB,EAAE,kBAAkB,EACtC,kBAAkB,EAAE,kBAAkB,EACtC,qBAAqB,EAAE,qBAAqB,EAC5C,2BAA2B,EAAE,2BAA2B;IAKrE,sBAAsB,CACb,cAAc,EAAE,MAAM,EAC3B,IAAI,EAAE,iBAAiB,GAC9B,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAA;KAAE,CAAC;CA6CjC"}
@@ -0,0 +1,84 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ var __param = (this && this.__param) || function (paramIndex, decorator) {
12
+ return function (target, key) { decorator(target, key, paramIndex); }
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ exports.OrganizationRepositoryController = void 0;
16
+ const common_1 = require("@nestjs/common");
17
+ const bitbucket_1 = require("@venturialstd/bitbucket");
18
+ const github_1 = require("@venturialstd/github");
19
+ const gitlab_1 = require("@venturialstd/gitlab");
20
+ const repository_provider_constant_1 = require("../constants/repository-provider.constant");
21
+ const repository_auth_dto_1 = require("../dtos/repository-auth.dto");
22
+ const organization_settings_service_1 = require("../services/organization-settings.service");
23
+ let OrganizationRepositoryController = class OrganizationRepositoryController {
24
+ githubOAuthService;
25
+ gitlabOAuthService;
26
+ bitbucketOAuthService;
27
+ organizationSettingsService;
28
+ constructor(githubOAuthService, gitlabOAuthService, bitbucketOAuthService, organizationSettingsService) {
29
+ this.githubOAuthService = githubOAuthService;
30
+ this.gitlabOAuthService = gitlabOAuthService;
31
+ this.bitbucketOAuthService = bitbucketOAuthService;
32
+ this.organizationSettingsService = organizationSettingsService;
33
+ }
34
+ async authenticateRepository(organizationId, body) {
35
+ try {
36
+ const { provider, code } = body;
37
+ let tokenResponse;
38
+ switch (provider) {
39
+ case repository_provider_constant_1.REPOSITORY_PROVIDERS.GITHUB:
40
+ tokenResponse = await this.githubOAuthService.exchangeCode(code);
41
+ break;
42
+ case repository_provider_constant_1.REPOSITORY_PROVIDERS.GITLAB:
43
+ tokenResponse = await this.gitlabOAuthService.exchangeCode(code);
44
+ break;
45
+ case repository_provider_constant_1.REPOSITORY_PROVIDERS.BITBUCKET:
46
+ tokenResponse = await this.bitbucketOAuthService.exchangeCode(code);
47
+ break;
48
+ default:
49
+ return { success: false };
50
+ }
51
+ if (!tokenResponse?.access_token) {
52
+ return { success: false };
53
+ }
54
+ await this.organizationSettingsService.setOrganizationSetting(organizationId, {
55
+ module: 'repository',
56
+ section: provider.toLowerCase(),
57
+ key: 'access_token',
58
+ value: tokenResponse.access_token,
59
+ });
60
+ return { success: true };
61
+ }
62
+ catch {
63
+ return { success: false };
64
+ }
65
+ }
66
+ };
67
+ exports.OrganizationRepositoryController = OrganizationRepositoryController;
68
+ __decorate([
69
+ (0, common_1.Post)(':id/repository/auth'),
70
+ (0, common_1.HttpCode)(common_1.HttpStatus.OK),
71
+ __param(0, (0, common_1.Param)('id')),
72
+ __param(1, (0, common_1.Body)()),
73
+ __metadata("design:type", Function),
74
+ __metadata("design:paramtypes", [String, repository_auth_dto_1.RepositoryAuthDto]),
75
+ __metadata("design:returntype", Promise)
76
+ ], OrganizationRepositoryController.prototype, "authenticateRepository", null);
77
+ exports.OrganizationRepositoryController = OrganizationRepositoryController = __decorate([
78
+ (0, common_1.Controller)('organization'),
79
+ __metadata("design:paramtypes", [github_1.GithubOAuthService,
80
+ gitlab_1.GitlabOAuthService,
81
+ bitbucket_1.BitbucketOAuthService,
82
+ organization_settings_service_1.OrganizationSettingsService])
83
+ ], OrganizationRepositoryController);
84
+ //# sourceMappingURL=organization-repository.controller.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-repository.controller.js","sourceRoot":"","sources":["../../src/controllers/organization-repository.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAAqF;AACrF,uDAAgE;AAChE,iDAA0D;AAC1D,iDAA0D;AAE1D,4FAAiF;AACjF,qEAAgE;AAChE,6FAAwF;AAGjF,IAAM,gCAAgC,GAAtC,MAAM,gCAAgC;IAExB;IACA;IACA;IACA;IAJnB,YACmB,kBAAsC,EACtC,kBAAsC,EACtC,qBAA4C,EAC5C,2BAAwD;QAHxD,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,uBAAkB,GAAlB,kBAAkB,CAAoB;QACtC,0BAAqB,GAArB,qBAAqB,CAAuB;QAC5C,gCAA2B,GAA3B,2BAA2B,CAA6B;IACxE,CAAC;IAIE,AAAN,KAAK,CAAC,sBAAsB,CACb,cAAsB,EAC3B,IAAuB;QAE/B,IAAI,CAAC;YACH,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;YAEhC,IAAI,aAMS,CAAC;YAEd,QAAQ,QAAQ,EAAE,CAAC;gBACjB,KAAK,mDAAoB,CAAC,MAAM;oBAC9B,aAAa,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;oBACjE,MAAM;gBAER,KAAK,mDAAoB,CAAC,MAAM;oBAC9B,aAAa,GAAG,MAAM,IAAI,CAAC,kBAAkB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;oBACjE,MAAM;gBAER,KAAK,mDAAoB,CAAC,SAAS;oBACjC,aAAa,GAAG,MAAM,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;oBACpE,MAAM;gBAER;oBACE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;YAC9B,CAAC;YAED,IAAI,CAAC,aAAa,EAAE,YAAY,EAAE,CAAC;gBACjC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;YAC5B,CAAC;YAED,MAAM,IAAI,CAAC,2BAA2B,CAAC,sBAAsB,CAAC,cAAc,EAAE;gBAC5E,MAAM,EAAE,YAAY;gBACpB,OAAO,EAAE,QAAQ,CAAC,WAAW,EAAE;gBAC/B,GAAG,EAAE,cAAc;gBACnB,KAAK,EAAE,aAAa,CAAC,YAAY;aAClC,CAAC,CAAC;YAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;QAC5B,CAAC;IACH,CAAC;CACF,CAAA;AA1DY,4EAAgC;AAUrC;IAFL,IAAA,aAAI,EAAC,qBAAqB,CAAC;IAC3B,IAAA,iBAAQ,EAAC,mBAAU,CAAC,EAAE,CAAC;IAErB,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;6CAAO,uCAAiB;;8EA6ChC;2CAzDU,gCAAgC;IAD5C,IAAA,mBAAU,EAAC,cAAc,CAAC;qCAGc,2BAAkB;QAClB,2BAAkB;QACf,iCAAqB;QACf,2DAA2B;GALhE,gCAAgC,CA0D5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"organization.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/organization.decorator.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,cAAc,mDAK1B,CAAC;AAWF,eAAO,MAAM,MAAM,mDAGjB,CAAC;AAWH,eAAO,MAAM,mBAAmB,mDAQ9B,CAAC"}
1
+ {"version":3,"file":"organization.decorator.d.ts","sourceRoot":"","sources":["../../src/decorators/organization.decorator.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,cAAc,mDAS1B,CAAC;AAWF,eAAO,MAAM,MAAM,mDAGjB,CAAC;AAWH,eAAO,MAAM,mBAAmB,mDAW9B,CAAC"}
@@ -4,7 +4,9 @@ exports.OrganizationContext = exports.UserId = exports.OrganizationId = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  exports.OrganizationId = (0, common_1.createParamDecorator)((data, ctx) => {
6
6
  const request = ctx.switchToHttp().getRequest();
7
- return request.organizationId || request.headers['x-organization-id'];
7
+ return (request.organizationId ||
8
+ request.params.organizationId ||
9
+ request.headers['x-organization-id']);
8
10
  });
9
11
  exports.UserId = (0, common_1.createParamDecorator)((data, ctx) => {
10
12
  const request = ctx.switchToHttp().getRequest();
@@ -13,7 +15,9 @@ exports.UserId = (0, common_1.createParamDecorator)((data, ctx) => {
13
15
  exports.OrganizationContext = (0, common_1.createParamDecorator)((data, ctx) => {
14
16
  const request = ctx.switchToHttp().getRequest();
15
17
  return {
16
- organizationId: request.organizationId || request.headers['x-organization-id'],
18
+ organizationId: request.organizationId ||
19
+ request.params.organizationId ||
20
+ request.headers['x-organization-id'],
17
21
  userId: request.user?.id || request.userId,
18
22
  role: request.organizationRole,
19
23
  user: request.user,
@@ -1 +1 @@
1
- {"version":3,"file":"organization.decorator.js","sourceRoot":"","sources":["../../src/decorators/organization.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AAW3D,QAAA,cAAc,GAAG,IAAA,6BAAoB,EAChD,CAAC,IAAa,EAAE,GAAqB,EAAU,EAAE;IAC/C,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,OAAO,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;AACxE,CAAC,CACF,CAAC;AAWW,QAAA,MAAM,GAAG,IAAA,6BAAoB,EAAC,CAAC,IAAa,EAAE,GAAqB,EAAU,EAAE;IAC1F,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,OAAO,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,OAAO,CAAC,MAAM,CAAC;AAC5C,CAAC,CAAC,CAAC;AAWU,QAAA,mBAAmB,GAAG,IAAA,6BAAoB,EAAC,CAAC,IAAa,EAAE,GAAqB,EAAE,EAAE;IAC/F,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,OAAO;QACL,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC;QAC9E,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,OAAO,CAAC,MAAM;QAC1C,IAAI,EAAE,OAAO,CAAC,gBAAgB;QAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC;AACJ,CAAC,CAAC,CAAC"}
1
+ {"version":3,"file":"organization.decorator.js","sourceRoot":"","sources":["../../src/decorators/organization.decorator.ts"],"names":[],"mappings":";;;AAAA,2CAAwE;AAW3D,QAAA,cAAc,GAAG,IAAA,6BAAoB,EAChD,CAAC,IAAa,EAAE,GAAqB,EAAU,EAAE;IAC/C,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,OAAO,CACL,OAAO,CAAC,cAAc;QACtB,OAAO,CAAC,MAAM,CAAC,cAAc;QAC7B,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,CACrC,CAAC;AACJ,CAAC,CACF,CAAC;AAWW,QAAA,MAAM,GAAG,IAAA,6BAAoB,EAAC,CAAC,IAAa,EAAE,GAAqB,EAAU,EAAE;IAC1F,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,OAAO,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,OAAO,CAAC,MAAM,CAAC;AAC5C,CAAC,CAAC,CAAC;AAWU,QAAA,mBAAmB,GAAG,IAAA,6BAAoB,EAAC,CAAC,IAAa,EAAE,GAAqB,EAAE,EAAE;IAC/F,MAAM,OAAO,GAAG,GAAG,CAAC,YAAY,EAAE,CAAC,UAAU,EAAE,CAAC;IAChD,OAAO;QACL,cAAc,EACZ,OAAO,CAAC,cAAc;YACtB,OAAO,CAAC,MAAM,CAAC,cAAc;YAC7B,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC;QACtC,MAAM,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,OAAO,CAAC,MAAM;QAC1C,IAAI,EAAE,OAAO,CAAC,gBAAgB;QAC9B,IAAI,EAAE,OAAO,CAAC,IAAI;KACnB,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { REPOSITORY_PROVIDERS } from '../constants/repository-provider.constant';
2
+ export declare class RepositoryAuthDto {
3
+ provider: REPOSITORY_PROVIDERS;
4
+ code: string;
5
+ }
6
+ //# sourceMappingURL=repository-auth.dto.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-auth.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/repository-auth.dto.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,qBAAa,iBAAiB;IAE5B,QAAQ,EAAE,oBAAoB,CAAC;IAG/B,IAAI,EAAE,MAAM,CAAC;CACd"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.RepositoryAuthDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const repository_provider_constant_1 = require("../constants/repository-provider.constant");
15
+ class RepositoryAuthDto {
16
+ provider;
17
+ code;
18
+ }
19
+ exports.RepositoryAuthDto = RepositoryAuthDto;
20
+ __decorate([
21
+ (0, class_validator_1.IsEnum)(repository_provider_constant_1.REPOSITORY_PROVIDERS),
22
+ __metadata("design:type", String)
23
+ ], RepositoryAuthDto.prototype, "provider", void 0);
24
+ __decorate([
25
+ (0, class_validator_1.IsString)(),
26
+ __metadata("design:type", String)
27
+ ], RepositoryAuthDto.prototype, "code", void 0);
28
+ //# sourceMappingURL=repository-auth.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repository-auth.dto.js","sourceRoot":"","sources":["../../src/dtos/repository-auth.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAAmD;AAEnD,4FAAiF;AACjF,MAAa,iBAAiB;IAE5B,QAAQ,CAAuB;IAG/B,IAAI,CAAS;CACd;AAND,8CAMC;AAJC;IADC,IAAA,wBAAM,EAAC,mDAAoB,CAAC;;mDACE;AAG/B;IADC,IAAA,0BAAQ,GAAE;;+CACE"}
@@ -0,0 +1,19 @@
1
+ import { SETTINGS_TYPE } from '../constants/settings-type.constant';
2
+ import { Organization } from './organization.entity';
3
+ export declare class OrganizationSettings {
4
+ id: string;
5
+ organizationId: string;
6
+ organization: Organization;
7
+ label: string;
8
+ description: string;
9
+ module: string;
10
+ section: string;
11
+ key: string;
12
+ value: string;
13
+ type: SETTINGS_TYPE;
14
+ options: object | null | string;
15
+ sortOrder: number;
16
+ createdAt: Date;
17
+ updatedAt: Date;
18
+ }
19
+ //# sourceMappingURL=organization-settings.entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-settings.entity.d.ts","sourceRoot":"","sources":["../../src/entities/organization-settings.entity.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAarD,qBAEa,oBAAoB;IAG/B,EAAE,EAAE,MAAM,CAAC;IAIX,cAAc,EAAE,MAAM,CAAC;IAIvB,YAAY,EAAE,YAAY,CAAC;IAI3B,KAAK,EAAE,MAAM,CAAC;IAId,WAAW,EAAE,MAAM,CAAC;IAIpB,MAAM,EAAE,MAAM,CAAC;IAIf,OAAO,EAAE,MAAM,CAAC;IAIhB,GAAG,EAAE,MAAM,CAAC;IAIZ,KAAK,EAAE,MAAM,CAAC;IAQd,IAAI,EAAE,aAAa,CAAC;IAMpB,OAAO,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,CAAC;IAGhC,SAAS,EAAE,MAAM,CAAC;IASlB,SAAS,EAAE,IAAI,CAAC;IAShB,SAAS,EAAE,IAAI,CAAC;CACjB"}
@@ -0,0 +1,124 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.OrganizationSettings = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const typeorm_1 = require("typeorm");
16
+ const settings_type_constant_1 = require("../constants/settings-type.constant");
17
+ const organization_entity_1 = require("./organization.entity");
18
+ let OrganizationSettings = class OrganizationSettings {
19
+ id;
20
+ organizationId;
21
+ organization;
22
+ label;
23
+ description;
24
+ module;
25
+ section;
26
+ key;
27
+ value;
28
+ type;
29
+ options;
30
+ sortOrder;
31
+ createdAt;
32
+ updatedAt;
33
+ };
34
+ exports.OrganizationSettings = OrganizationSettings;
35
+ __decorate([
36
+ (0, class_transformer_1.Exclude)(),
37
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
38
+ __metadata("design:type", String)
39
+ ], OrganizationSettings.prototype, "id", void 0);
40
+ __decorate([
41
+ (0, class_validator_1.IsNotEmpty)(),
42
+ (0, typeorm_1.Column)({ type: 'uuid' }),
43
+ __metadata("design:type", String)
44
+ ], OrganizationSettings.prototype, "organizationId", void 0);
45
+ __decorate([
46
+ (0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete: 'CASCADE' }),
47
+ (0, typeorm_1.JoinColumn)({ name: 'organizationId' }),
48
+ __metadata("design:type", organization_entity_1.Organization)
49
+ ], OrganizationSettings.prototype, "organization", void 0);
50
+ __decorate([
51
+ (0, class_validator_1.IsNotEmpty)(),
52
+ (0, typeorm_1.Column)(),
53
+ __metadata("design:type", String)
54
+ ], OrganizationSettings.prototype, "label", void 0);
55
+ __decorate([
56
+ (0, class_validator_1.IsOptional)(),
57
+ (0, typeorm_1.Column)({ nullable: true }),
58
+ __metadata("design:type", String)
59
+ ], OrganizationSettings.prototype, "description", void 0);
60
+ __decorate([
61
+ (0, class_validator_1.IsNotEmpty)(),
62
+ (0, typeorm_1.Column)(),
63
+ __metadata("design:type", String)
64
+ ], OrganizationSettings.prototype, "module", void 0);
65
+ __decorate([
66
+ (0, class_validator_1.IsNotEmpty)(),
67
+ (0, typeorm_1.Column)(),
68
+ __metadata("design:type", String)
69
+ ], OrganizationSettings.prototype, "section", void 0);
70
+ __decorate([
71
+ (0, class_validator_1.IsNotEmpty)(),
72
+ (0, typeorm_1.Column)(),
73
+ __metadata("design:type", String)
74
+ ], OrganizationSettings.prototype, "key", void 0);
75
+ __decorate([
76
+ (0, class_validator_1.IsNotEmpty)(),
77
+ (0, typeorm_1.Column)(),
78
+ __metadata("design:type", String)
79
+ ], OrganizationSettings.prototype, "value", void 0);
80
+ __decorate([
81
+ (0, class_validator_1.IsNotEmpty)(),
82
+ (0, typeorm_1.Column)({
83
+ type: 'enum',
84
+ enum: settings_type_constant_1.SETTINGS_TYPE,
85
+ default: settings_type_constant_1.SETTINGS_TYPE.TEXT,
86
+ }),
87
+ __metadata("design:type", String)
88
+ ], OrganizationSettings.prototype, "type", void 0);
89
+ __decorate([
90
+ (0, class_validator_1.IsOptional)(),
91
+ (0, typeorm_1.Column)('jsonb', {
92
+ nullable: true,
93
+ }),
94
+ __metadata("design:type", Object)
95
+ ], OrganizationSettings.prototype, "options", void 0);
96
+ __decorate([
97
+ (0, typeorm_1.Column)({ default: 0 }),
98
+ __metadata("design:type", Number)
99
+ ], OrganizationSettings.prototype, "sortOrder", void 0);
100
+ __decorate([
101
+ (0, class_transformer_1.Exclude)(),
102
+ (0, typeorm_1.CreateDateColumn)({
103
+ name: 'createdAt',
104
+ nullable: false,
105
+ type: 'timestamptz',
106
+ default: () => 'CURRENT_TIMESTAMP',
107
+ }),
108
+ __metadata("design:type", Date)
109
+ ], OrganizationSettings.prototype, "createdAt", void 0);
110
+ __decorate([
111
+ (0, class_transformer_1.Exclude)(),
112
+ (0, typeorm_1.UpdateDateColumn)({
113
+ name: 'updatedAt',
114
+ nullable: false,
115
+ type: 'timestamptz',
116
+ default: () => 'CURRENT_TIMESTAMP',
117
+ }),
118
+ __metadata("design:type", Date)
119
+ ], OrganizationSettings.prototype, "updatedAt", void 0);
120
+ exports.OrganizationSettings = OrganizationSettings = __decorate([
121
+ (0, typeorm_1.Entity)('organization_settings'),
122
+ (0, typeorm_1.Index)(['organizationId', 'module', 'section', 'key'], { unique: true })
123
+ ], OrganizationSettings);
124
+ //# sourceMappingURL=organization-settings.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-settings.entity.js","sourceRoot":"","sources":["../../src/entities/organization-settings.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA4C;AAC5C,qDAAyD;AACzD,qCASiB;AAEjB,gFAAoE;AACpE,+DAAqD;AAe9C,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;IAG/B,EAAE,CAAS;IAIX,cAAc,CAAS;IAIvB,YAAY,CAAe;IAI3B,KAAK,CAAS;IAId,WAAW,CAAS;IAIpB,MAAM,CAAS;IAIf,OAAO,CAAS;IAIhB,GAAG,CAAS;IAIZ,KAAK,CAAS;IAQd,IAAI,CAAgB;IAMpB,OAAO,CAAyB;IAGhC,SAAS,CAAS;IASlB,SAAS,CAAO;IAShB,SAAS,CAAO;CACjB,CAAA;AAvEY,oDAAoB;AAG/B;IAFC,IAAA,2BAAO,GAAE;IACT,IAAA,gCAAsB,EAAC,MAAM,CAAC;;gDACpB;AAIX;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;4DACF;AAIvB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kCAAY,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACtD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,CAAC;8BACzB,kCAAY;0DAAC;AAI3B;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,GAAE;;mDACK;AAId;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yDACP;AAIpB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,GAAE;;oDACM;AAIf;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,GAAE;;qDACO;AAIhB;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,GAAE;;iDACG;AAIZ;IAFC,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,GAAE;;mDACK;AAQd;IANC,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,IAAI,EAAE,sCAAa;QACnB,OAAO,EAAE,sCAAa,CAAC,IAAI;KAC5B,CAAC;;kDACkB;AAMpB;IAJC,IAAA,4BAAU,GAAE;IACZ,IAAA,gBAAM,EAAC,OAAO,EAAE;QACf,QAAQ,EAAE,IAAI;KACf,CAAC;;qDAC8B;AAGhC;IADC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uDACL;AASlB;IAPC,IAAA,2BAAO,GAAE;IACT,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB;KACnC,CAAC;8BACS,IAAI;uDAAC;AAShB;IAPC,IAAA,2BAAO,GAAE;IACT,IAAA,0BAAgB,EAAC;QAChB,IAAI,EAAE,WAAW;QACjB,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,aAAa;QACnB,OAAO,EAAE,GAAG,EAAE,CAAC,mBAAmB;KACnC,CAAC;8BACS,IAAI;uDAAC;+BAtEL,oBAAoB;IAFhC,IAAA,gBAAM,EAAC,uBAAuB,CAAC;IAC/B,IAAA,eAAK,EAAC,CAAC,gBAAgB,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GAC3D,oBAAoB,CAuEhC"}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,15 @@
1
1
  export * from './constants/organization.constant';
2
2
  export * from './constants/organization.settings.constant';
3
+ export * from './constants/settings-type.constant';
3
4
  export * from './decorators/organization.decorator';
4
5
  export * from './decorators/roles.decorator';
5
6
  export * from './entities/organization.entity';
7
+ export * from './entities/organization-settings.entity';
6
8
  export * from './entities/organization-user.entity';
7
9
  export * from './guards/organization.guard';
8
10
  export * from './organization.module';
9
11
  export * from './services/organization.service';
12
+ export * from './services/organization-settings.service';
10
13
  export * from './services/organization-user.service';
11
14
  export * from './settings/organization.settings';
12
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC;AAClD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,gCAAgC,CAAC;AAC/C,cAAc,yCAAyC,CAAC;AACxD,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,iCAAiC,CAAC;AAChD,cAAc,0CAA0C,CAAC;AACzD,cAAc,sCAAsC,CAAC;AACrD,cAAc,kCAAkC,CAAC"}
package/dist/index.js CHANGED
@@ -16,13 +16,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./constants/organization.constant"), exports);
18
18
  __exportStar(require("./constants/organization.settings.constant"), exports);
19
+ __exportStar(require("./constants/settings-type.constant"), exports);
19
20
  __exportStar(require("./decorators/organization.decorator"), exports);
20
21
  __exportStar(require("./decorators/roles.decorator"), exports);
21
22
  __exportStar(require("./entities/organization.entity"), exports);
23
+ __exportStar(require("./entities/organization-settings.entity"), exports);
22
24
  __exportStar(require("./entities/organization-user.entity"), exports);
23
25
  __exportStar(require("./guards/organization.guard"), exports);
24
26
  __exportStar(require("./organization.module"), exports);
25
27
  __exportStar(require("./services/organization.service"), exports);
28
+ __exportStar(require("./services/organization-settings.service"), exports);
26
29
  __exportStar(require("./services/organization-user.service"), exports);
27
30
  __exportStar(require("./settings/organization.settings"), exports);
28
31
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD;AAClD,6EAA2D;AAC3D,sEAAoD;AACpD,+DAA6C;AAC7C,iEAA+C;AAC/C,sEAAoD;AACpD,8DAA4C;AAC5C,wDAAsC;AACtC,kEAAgD;AAChD,uEAAqD;AACrD,mEAAiD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD;AAClD,6EAA2D;AAC3D,qEAAmD;AACnD,sEAAoD;AACpD,+DAA6C;AAC7C,iEAA+C;AAC/C,0EAAwD;AACxD,sEAAoD;AACpD,8DAA4C;AAC5C,wDAAsC;AACtC,kEAAgD;AAChD,2EAAyD;AACzD,uEAAqD;AACrD,mEAAiD"}
@@ -1 +1 @@
1
- {"version":3,"file":"organization.module.d.ts","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":"AASA,qBAMa,kBAAkB;CAAG"}
1
+ {"version":3,"file":"organization.module.d.ts","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":"AAaA,qBASa,kBAAkB;CAAG"}
@@ -10,19 +10,26 @@ exports.OrganizationModule = void 0;
10
10
  const common_1 = require("@nestjs/common");
11
11
  const typeorm_1 = require("@nestjs/typeorm");
12
12
  const core_1 = require("@venturialstd/core");
13
+ const github_1 = require("@venturialstd/github");
14
+ const organization_repository_controller_1 = require("./controllers/organization-repository.controller");
13
15
  const organization_entity_1 = require("./entities/organization.entity");
16
+ const organization_settings_entity_1 = require("./entities/organization-settings.entity");
14
17
  const organization_user_entity_1 = require("./entities/organization-user.entity");
15
18
  const organization_service_1 = require("./services/organization.service");
19
+ const organization_settings_service_1 = require("./services/organization-settings.service");
16
20
  const organization_user_service_1 = require("./services/organization-user.service");
17
21
  let OrganizationModule = class OrganizationModule {
18
22
  };
19
23
  exports.OrganizationModule = OrganizationModule;
20
24
  exports.OrganizationModule = OrganizationModule = __decorate([
21
25
  (0, common_1.Module)({
22
- imports: [core_1.SharedModule.forRoot({}), typeorm_1.TypeOrmModule.forFeature([organization_entity_1.Organization, organization_user_entity_1.OrganizationUser])],
23
- providers: [organization_service_1.OrganizationService, organization_user_service_1.OrganizationUserService],
24
- controllers: [],
25
- exports: [organization_service_1.OrganizationService, organization_user_service_1.OrganizationUserService],
26
+ imports: [
27
+ core_1.SharedModule.forRoot({}),
28
+ typeorm_1.TypeOrmModule.forFeature([organization_entity_1.Organization, organization_user_entity_1.OrganizationUser, organization_settings_entity_1.OrganizationSettings, github_1.GithubModule]),
29
+ ],
30
+ providers: [organization_service_1.OrganizationService, organization_user_service_1.OrganizationUserService, organization_settings_service_1.OrganizationSettingsService],
31
+ controllers: [organization_repository_controller_1.OrganizationRepositoryController],
32
+ exports: [organization_service_1.OrganizationService, organization_user_service_1.OrganizationUserService, organization_settings_service_1.OrganizationSettingsService],
26
33
  })
27
34
  ], OrganizationModule);
28
35
  //# sourceMappingURL=organization.module.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"organization.module.js","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6CAAkD;AAElD,wEAA8D;AAC9D,kFAAuE;AACvE,0EAAsE;AACtE,oFAA+E;AAQxE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAN9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE,CAAC,mBAAY,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,uBAAa,CAAC,UAAU,CAAC,CAAC,kCAAY,EAAE,2CAAgB,CAAC,CAAC,CAAC;QAC/F,SAAS,EAAE,CAAC,0CAAmB,EAAE,mDAAuB,CAAC;QACzD,WAAW,EAAE,EAAE;QACf,OAAO,EAAE,CAAC,0CAAmB,EAAE,mDAAuB,CAAC;KACxD,CAAC;GACW,kBAAkB,CAAG"}
1
+ {"version":3,"file":"organization.module.js","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6CAAkD;AAClD,iDAAoD;AAEpD,yGAAoG;AACpG,wEAA8D;AAC9D,0FAA+E;AAC/E,kFAAuE;AACvE,0EAAsE;AACtE,4FAAuF;AACvF,oFAA+E;AAWxE,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAT9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,mBAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YACxB,uBAAa,CAAC,UAAU,CAAC,CAAC,kCAAY,EAAE,2CAAgB,EAAE,mDAAoB,EAAE,qBAAY,CAAC,CAAC;SAC/F;QACD,SAAS,EAAE,CAAC,0CAAmB,EAAE,mDAAuB,EAAE,2DAA2B,CAAC;QACtF,WAAW,EAAE,CAAC,qEAAgC,CAAC;QAC/C,OAAO,EAAE,CAAC,0CAAmB,EAAE,mDAAuB,EAAE,2DAA2B,CAAC;KACrF,CAAC;GACW,kBAAkB,CAAG"}
@@ -0,0 +1,15 @@
1
+ import { TypeOrmCrudService } from '@dataui/crud-typeorm';
2
+ import { DeepPartial, Repository } from 'typeorm';
3
+ import { OrganizationSettings } from '../entities/organization-settings.entity';
4
+ export declare class OrganizationSettingsService extends TypeOrmCrudService<OrganizationSettings> {
5
+ private readonly organizationSettingsRepo;
6
+ constructor(organizationSettingsRepo: Repository<OrganizationSettings>);
7
+ get(organizationId: string, key: string): Promise<string | undefined>;
8
+ getManySettings(organizationId: string, keys: string[]): Promise<Record<string, string>>;
9
+ getAllForOrganization(organizationId: string, module?: string): Promise<OrganizationSettings[]>;
10
+ setOrganizationSetting(organizationId: string, dto: DeepPartial<OrganizationSettings>): Promise<OrganizationSettings>;
11
+ deleteOrganizationSetting(organizationId: string, module: string, section: string, key: string): Promise<void>;
12
+ resetModuleSettings(organizationId: string, module: string): Promise<void>;
13
+ bulkUpdateSettings(organizationId: string, settings: DeepPartial<OrganizationSettings>[]): Promise<OrganizationSettings[]>;
14
+ }
15
+ //# sourceMappingURL=organization-settings.service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"organization-settings.service.d.ts","sourceRoot":"","sources":["../../src/services/organization-settings.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAElD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAC;AAOhF,qBACa,2BAA4B,SAAQ,kBAAkB,CAAC,oBAAoB,CAAC;IAGrF,OAAO,CAAC,QAAQ,CAAC,wBAAwB;gBAAxB,wBAAwB,EAAE,UAAU,CAAC,oBAAoB,CAAC;IAWvE,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IA0BrE,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAiBxF,qBAAqB,CACzB,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAoB5B,sBAAsB,CAC1B,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,WAAW,CAAC,oBAAoB,CAAC,GACrC,OAAO,CAAC,oBAAoB,CAAC;IAiC1B,yBAAyB,CAC7B,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC;IAcV,mBAAmB,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAY1E,kBAAkB,CACtB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,WAAW,CAAC,oBAAoB,CAAC,EAAE,GAC5C,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAUnC"}