@venturialstd/organization 0.0.12 → 0.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/constants/settings-encryption.constants.d.ts +4 -0
- package/dist/constants/settings-encryption.constants.d.ts.map +1 -0
- package/dist/constants/settings-encryption.constants.js +8 -0
- package/dist/constants/settings-encryption.constants.js.map +1 -0
- package/dist/dtos/CreateOrganization.dto.d.ts +1 -1
- package/dist/dtos/CreateOrganization.dto.d.ts.map +1 -1
- package/dist/dtos/CreateOrganization.dto.js +8 -8
- package/dist/dtos/CreateOrganization.dto.js.map +1 -1
- package/dist/entities/organization-user.entity.d.ts +2 -2
- package/dist/entities/organization-user.entity.js +18 -18
- package/dist/entities/organization.entity.d.ts +1 -1
- package/dist/entities/organization.entity.d.ts.map +1 -1
- package/dist/entities/organization.entity.js +16 -16
- package/dist/entities/organization.entity.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/organization.module.d.ts.map +1 -1
- package/dist/organization.module.js +18 -4
- package/dist/organization.module.js.map +1 -1
- package/dist/services/organization-settings-encryption.service.d.ts +13 -0
- package/dist/services/organization-settings-encryption.service.d.ts.map +1 -0
- package/dist/services/organization-settings-encryption.service.js +121 -0
- package/dist/services/organization-settings-encryption.service.js.map +1 -0
- package/dist/services/organization-settings.service.d.ts +6 -4
- package/dist/services/organization-settings.service.d.ts.map +1 -1
- package/dist/services/organization-settings.service.js +22 -6
- package/dist/services/organization-settings.service.js.map +1 -1
- package/dist/services/organization-user.service.d.ts +6 -6
- package/dist/services/organization-user.service.d.ts.map +1 -1
- package/dist/services/organization-user.service.js +15 -16
- package/dist/services/organization-user.service.js.map +1 -1
- package/dist/services/organization.service.d.ts +5 -5
- package/dist/services/organization.service.d.ts.map +1 -1
- package/dist/services/organization.service.js +2 -2
- package/dist/services/organization.service.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-encryption.constants.d.ts","sourceRoot":"","sources":["../../src/constants/settings-encryption.constants.ts"],"names":[],"mappings":"AAAA,oBAAY,oBAAoB;IAC9B,MAAM,gBAAgB;CACvB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ENCRYPTION_ALGORITHM = void 0;
|
|
4
|
+
var ENCRYPTION_ALGORITHM;
|
|
5
|
+
(function (ENCRYPTION_ALGORITHM) {
|
|
6
|
+
ENCRYPTION_ALGORITHM["AES256"] = "aes-256-gcm";
|
|
7
|
+
})(ENCRYPTION_ALGORITHM || (exports.ENCRYPTION_ALGORITHM = ENCRYPTION_ALGORITHM = {}));
|
|
8
|
+
//# sourceMappingURL=settings-encryption.constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"settings-encryption.constants.js","sourceRoot":"","sources":["../../src/constants/settings-encryption.constants.ts"],"names":[],"mappings":";;;AAAA,IAAY,oBAEX;AAFD,WAAY,oBAAoB;IAC9B,8CAAsB,CAAA;AACxB,CAAC,EAFW,oBAAoB,oCAApB,oBAAoB,QAE/B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ORGANIZATION_EXPECTED_TEAM_SIZE, ORGANIZATION_INDUSTRY, ORGANIZATION_PRIMARY_USE_CASE, ORGANIZATION_SECURITY_REQUIREMENT, ORGANIZATION_TIMEZONE, ORGANIZATION_TYPE } from
|
|
1
|
+
import { ORGANIZATION_EXPECTED_TEAM_SIZE, ORGANIZATION_INDUSTRY, ORGANIZATION_PRIMARY_USE_CASE, ORGANIZATION_SECURITY_REQUIREMENT, ORGANIZATION_TIMEZONE, ORGANIZATION_TYPE } from '../constants/organization.constant';
|
|
2
2
|
export declare class CreateOrganizationDto {
|
|
3
3
|
name: string;
|
|
4
4
|
slug: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrganization.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/CreateOrganization.dto.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CreateOrganization.dto.d.ts","sourceRoot":"","sources":["../../src/dtos/CreateOrganization.dto.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,EACrB,6BAA6B,EAC7B,iCAAiC,EACjC,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,oCAAoC,CAAC;AAE5C,qBAAa,qBAAqB;IAIhC,IAAI,EAAE,MAAM,CAAC;IAQb,IAAI,EAAE,MAAM,CAAC;IAIb,MAAM,CAAC,EAAE,MAAM,CAAC;IAIhB,WAAW,CAAC,EAAE,MAAM,CAAC;IAIrB,OAAO,CAAC,EAAE,MAAM,CAAC;IAIjB,OAAO,CAAC,EAAE,MAAM,CAAC;IAKjB,IAAI,EAAE,iBAAiB,CAAC;IAKxB,gBAAgB,EAAE,+BAA+B,CAAC;IAMlD,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAMjC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAMjC,cAAc,CAAC,EAAE,6BAA6B,CAAC;IAM/C,oBAAoB,CAAC,EAAE,iCAAiC,EAAE,CAAC;CAC5D"}
|
|
@@ -30,15 +30,15 @@ exports.CreateOrganizationDto = CreateOrganizationDto;
|
|
|
30
30
|
__decorate([
|
|
31
31
|
(0, class_validator_1.IsString)(),
|
|
32
32
|
(0, class_validator_1.IsNotEmpty)(),
|
|
33
|
-
(0, class_validator_1.Length)(3, 50, { message:
|
|
33
|
+
(0, class_validator_1.Length)(3, 50, { message: 'Name must be between 3 and 50 characters' }),
|
|
34
34
|
__metadata("design:type", String)
|
|
35
35
|
], CreateOrganizationDto.prototype, "name", void 0);
|
|
36
36
|
__decorate([
|
|
37
37
|
(0, class_validator_1.IsString)(),
|
|
38
38
|
(0, class_validator_1.IsNotEmpty)(),
|
|
39
|
-
(0, class_validator_1.Length)(3, 50, { message:
|
|
39
|
+
(0, class_validator_1.Length)(3, 50, { message: 'Slug must be between 3 and 50 characters' }),
|
|
40
40
|
(0, class_validator_1.Matches)(/^[a-z0-9-]+$/, {
|
|
41
|
-
message:
|
|
41
|
+
message: 'Slug can only contain lowercase letters, numbers and dashes',
|
|
42
42
|
}),
|
|
43
43
|
__metadata("design:type", String)
|
|
44
44
|
], CreateOrganizationDto.prototype, "slug", void 0);
|
|
@@ -64,33 +64,33 @@ __decorate([
|
|
|
64
64
|
], CreateOrganizationDto.prototype, "logoUrl", void 0);
|
|
65
65
|
__decorate([
|
|
66
66
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_TYPE, {
|
|
67
|
-
message:
|
|
67
|
+
message: 'Invalid organization type',
|
|
68
68
|
}),
|
|
69
69
|
__metadata("design:type", String)
|
|
70
70
|
], CreateOrganizationDto.prototype, "type", void 0);
|
|
71
71
|
__decorate([
|
|
72
72
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_EXPECTED_TEAM_SIZE, {
|
|
73
|
-
message:
|
|
73
|
+
message: 'Invalid expected team size',
|
|
74
74
|
}),
|
|
75
75
|
__metadata("design:type", String)
|
|
76
76
|
], CreateOrganizationDto.prototype, "expectedTeamSize", void 0);
|
|
77
77
|
__decorate([
|
|
78
78
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_INDUSTRY, {
|
|
79
|
-
message:
|
|
79
|
+
message: 'Invalid industry',
|
|
80
80
|
}),
|
|
81
81
|
(0, class_validator_1.IsOptional)(),
|
|
82
82
|
__metadata("design:type", String)
|
|
83
83
|
], CreateOrganizationDto.prototype, "industry", void 0);
|
|
84
84
|
__decorate([
|
|
85
85
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_TIMEZONE, {
|
|
86
|
-
message:
|
|
86
|
+
message: 'Invalid timezone',
|
|
87
87
|
}),
|
|
88
88
|
(0, class_validator_1.IsOptional)(),
|
|
89
89
|
__metadata("design:type", String)
|
|
90
90
|
], CreateOrganizationDto.prototype, "timezone", void 0);
|
|
91
91
|
__decorate([
|
|
92
92
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_PRIMARY_USE_CASE, {
|
|
93
|
-
message:
|
|
93
|
+
message: 'Invalid primary use case',
|
|
94
94
|
}),
|
|
95
95
|
(0, class_validator_1.IsOptional)(),
|
|
96
96
|
__metadata("design:type", String)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CreateOrganization.dto.js","sourceRoot":"","sources":["../../src/dtos/CreateOrganization.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDASyB;
|
|
1
|
+
{"version":3,"file":"CreateOrganization.dto.js","sourceRoot":"","sources":["../../src/dtos/CreateOrganization.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDASyB;AAEzB,8EAO4C;AAE5C,MAAa,qBAAqB;IAIhC,IAAI,CAAS;IAQb,IAAI,CAAS;IAIb,MAAM,CAAU;IAIhB,WAAW,CAAU;IAIrB,OAAO,CAAU;IAIjB,OAAO,CAAU;IAKjB,IAAI,CAAoB;IAKxB,gBAAgB,CAAkC;IAMlD,QAAQ,CAAyB;IAMjC,QAAQ,CAAyB;IAMjC,cAAc,CAAiC;IAM/C,oBAAoB,CAAuC;CAC5D;AA/DD,sDA+DC;AA3DC;IAHC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;;mDAC1D;AAQb;IANC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,wBAAM,EAAC,CAAC,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,0CAA0C,EAAE,CAAC;IACtE,IAAA,yBAAO,EAAC,cAAc,EAAE;QACvB,OAAO,EAAE,6DAA6D;KACvE,CAAC;;mDACW;AAIb;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;qDACG;AAIhB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;0DACQ;AAIrB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACI;AAIjB;IAFC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACI;AAKjB;IAHC,IAAA,wBAAM,EAAC,yCAAiB,EAAE;QACzB,OAAO,EAAE,2BAA2B;KACrC,CAAC;;mDACsB;AAKxB;IAHC,IAAA,wBAAM,EAAC,uDAA+B,EAAE;QACvC,OAAO,EAAE,4BAA4B;KACtC,CAAC;;+DACgD;AAMlD;IAJC,IAAA,wBAAM,EAAC,6CAAqB,EAAE;QAC7B,OAAO,EAAE,kBAAkB;KAC5B,CAAC;IACD,IAAA,4BAAU,GAAE;;uDACoB;AAMjC;IAJC,IAAA,wBAAM,EAAC,6CAAqB,EAAE;QAC7B,OAAO,EAAE,kBAAkB;KAC5B,CAAC;IACD,IAAA,4BAAU,GAAE;;uDACoB;AAMjC;IAJC,IAAA,wBAAM,EAAC,qDAA6B,EAAE;QACrC,OAAO,EAAE,0BAA0B;KACpC,CAAC;IACD,IAAA,4BAAU,GAAE;;6DACkC;AAM/C;IAJC,IAAA,yBAAO,GAAE;IACT,IAAA,6BAAW,GAAE;IACb,IAAA,wBAAM,EAAC,yDAAiC,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACzD,IAAA,4BAAU,GAAE;;mEAC8C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ORGANIZATION_USER_ROLE, ORGANIZATION_USER_STATUS } from
|
|
2
|
-
import { Organization } from
|
|
1
|
+
import { ORGANIZATION_USER_ROLE, ORGANIZATION_USER_STATUS } from '../constants/organization.constant';
|
|
2
|
+
import { Organization } from './organization.entity';
|
|
3
3
|
export declare class OrganizationUser {
|
|
4
4
|
id: string;
|
|
5
5
|
organizationId: string;
|
|
@@ -31,25 +31,25 @@ let OrganizationUser = class OrganizationUser {
|
|
|
31
31
|
};
|
|
32
32
|
exports.OrganizationUser = OrganizationUser;
|
|
33
33
|
__decorate([
|
|
34
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(
|
|
34
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
35
35
|
__metadata("design:type", String)
|
|
36
36
|
], OrganizationUser.prototype, "id", void 0);
|
|
37
37
|
__decorate([
|
|
38
38
|
(0, class_validator_1.IsString)(),
|
|
39
39
|
(0, class_validator_1.IsNotEmpty)(),
|
|
40
|
-
(0, typeorm_1.Column)({ type:
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'uuid' }),
|
|
41
41
|
(0, typeorm_1.Index)(),
|
|
42
42
|
__metadata("design:type", String)
|
|
43
43
|
], OrganizationUser.prototype, "organizationId", void 0);
|
|
44
44
|
__decorate([
|
|
45
|
-
(0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete:
|
|
46
|
-
(0, typeorm_1.JoinColumn)({ name:
|
|
45
|
+
(0, typeorm_1.ManyToOne)(() => organization_entity_1.Organization, { onDelete: 'CASCADE' }),
|
|
46
|
+
(0, typeorm_1.JoinColumn)({ name: 'organizationId' }),
|
|
47
47
|
__metadata("design:type", organization_entity_1.Organization)
|
|
48
48
|
], OrganizationUser.prototype, "organization", void 0);
|
|
49
49
|
__decorate([
|
|
50
50
|
(0, class_validator_1.IsString)(),
|
|
51
51
|
(0, class_validator_1.IsNotEmpty)(),
|
|
52
|
-
(0, typeorm_1.Column)({ type:
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'uuid' }),
|
|
53
53
|
(0, typeorm_1.Index)(),
|
|
54
54
|
__metadata("design:type", String)
|
|
55
55
|
], OrganizationUser.prototype, "userId", void 0);
|
|
@@ -57,7 +57,7 @@ __decorate([
|
|
|
57
57
|
(0, class_validator_1.IsString)(),
|
|
58
58
|
(0, class_validator_1.IsNotEmpty)(),
|
|
59
59
|
(0, typeorm_1.Column)({
|
|
60
|
-
type:
|
|
60
|
+
type: 'enum',
|
|
61
61
|
enum: organization_constant_1.ORGANIZATION_USER_ROLE,
|
|
62
62
|
default: organization_constant_1.ORGANIZATION_USER_ROLE.MEMBER,
|
|
63
63
|
}),
|
|
@@ -67,7 +67,7 @@ __decorate([
|
|
|
67
67
|
(0, class_validator_1.IsString)(),
|
|
68
68
|
(0, class_validator_1.IsNotEmpty)(),
|
|
69
69
|
(0, typeorm_1.Column)({
|
|
70
|
-
type:
|
|
70
|
+
type: 'enum',
|
|
71
71
|
enum: organization_constant_1.ORGANIZATION_USER_STATUS,
|
|
72
72
|
default: organization_constant_1.ORGANIZATION_USER_STATUS.ACTIVE,
|
|
73
73
|
}),
|
|
@@ -87,41 +87,41 @@ __decorate([
|
|
|
87
87
|
__decorate([
|
|
88
88
|
(0, class_validator_1.IsString)(),
|
|
89
89
|
(0, class_validator_1.IsOptional)(),
|
|
90
|
-
(0, typeorm_1.Column)({ type:
|
|
90
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
91
91
|
__metadata("design:type", Date)
|
|
92
92
|
], OrganizationUser.prototype, "invitedAt", void 0);
|
|
93
93
|
__decorate([
|
|
94
94
|
(0, class_validator_1.IsString)(),
|
|
95
95
|
(0, class_validator_1.IsOptional)(),
|
|
96
|
-
(0, typeorm_1.Column)({ type:
|
|
96
|
+
(0, typeorm_1.Column)({ type: 'timestamptz', nullable: true }),
|
|
97
97
|
__metadata("design:type", Date)
|
|
98
98
|
], OrganizationUser.prototype, "joinedAt", void 0);
|
|
99
99
|
__decorate([
|
|
100
100
|
(0, class_validator_1.IsString)(),
|
|
101
101
|
(0, class_validator_1.IsOptional)(),
|
|
102
|
-
(0, typeorm_1.Column)({ type:
|
|
102
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
103
103
|
__metadata("design:type", Object)
|
|
104
104
|
], OrganizationUser.prototype, "permissions", void 0);
|
|
105
105
|
__decorate([
|
|
106
106
|
(0, typeorm_1.CreateDateColumn)({
|
|
107
|
-
name:
|
|
107
|
+
name: 'createdAt',
|
|
108
108
|
nullable: false,
|
|
109
|
-
type:
|
|
110
|
-
default: () =>
|
|
109
|
+
type: 'timestamptz',
|
|
110
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
111
111
|
}),
|
|
112
112
|
__metadata("design:type", Date)
|
|
113
113
|
], OrganizationUser.prototype, "createdAt", void 0);
|
|
114
114
|
__decorate([
|
|
115
115
|
(0, typeorm_1.UpdateDateColumn)({
|
|
116
|
-
name:
|
|
116
|
+
name: 'updatedAt',
|
|
117
117
|
nullable: false,
|
|
118
|
-
type:
|
|
119
|
-
default: () =>
|
|
118
|
+
type: 'timestamptz',
|
|
119
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
120
120
|
}),
|
|
121
121
|
__metadata("design:type", Date)
|
|
122
122
|
], OrganizationUser.prototype, "updatedAt", void 0);
|
|
123
123
|
exports.OrganizationUser = OrganizationUser = __decorate([
|
|
124
|
-
(0, typeorm_1.Entity)(
|
|
125
|
-
(0, typeorm_1.Index)([
|
|
124
|
+
(0, typeorm_1.Entity)('organization_user'),
|
|
125
|
+
(0, typeorm_1.Index)(['organizationId', 'userId'], { unique: true })
|
|
126
126
|
], OrganizationUser);
|
|
127
127
|
//# sourceMappingURL=organization-user.entity.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ORGANIZATION_EXPECTED_TEAM_SIZE, ORGANIZATION_INDUSTRY, ORGANIZATION_PRIMARY_USE_CASE, ORGANIZATION_SECURITY_REQUIREMENT, ORGANIZATION_TIMEZONE, ORGANIZATION_TYPE } from
|
|
1
|
+
import { ORGANIZATION_EXPECTED_TEAM_SIZE, ORGANIZATION_INDUSTRY, ORGANIZATION_PRIMARY_USE_CASE, ORGANIZATION_SECURITY_REQUIREMENT, ORGANIZATION_TIMEZONE, ORGANIZATION_TYPE } from '../constants/organization.constant';
|
|
2
2
|
export declare class Organization {
|
|
3
3
|
id: string;
|
|
4
4
|
name: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.entity.d.ts","sourceRoot":"","sources":["../../src/entities/organization.entity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organization.entity.d.ts","sourceRoot":"","sources":["../../src/entities/organization.entity.ts"],"names":[],"mappings":"AAiBA,OAAO,EACL,+BAA+B,EAC/B,qBAAqB,EACrB,6BAA6B,EAC7B,iCAAiC,EACjC,qBAAqB,EACrB,iBAAiB,EAClB,MAAM,oCAAoC,CAAC;AAE5C,qBACa,YAAY;IAEvB,EAAE,EAAE,MAAM,CAAC;IAKX,IAAI,EAAE,MAAM,CAAC;IAKb,IAAI,EAAE,MAAM,CAAC;IAKb,MAAM,EAAE,MAAM,CAAC;IAKf,WAAW,EAAE,MAAM,CAAC;IASpB,QAAQ,EAAE,qBAAqB,CAAC;IAShC,QAAQ,EAAE,qBAAqB,CAAC;IAQhC,IAAI,EAAE,iBAAiB,CAAC;IAQxB,gBAAgB,EAAE,+BAA+B,CAAC;IASlD,cAAc,EAAE,6BAA6B,CAAC;IAY9C,oBAAoB,EAAE,iCAAiC,EAAE,CAAC;IAI1D,QAAQ,EAAE,OAAO,CAAC;IAKlB,OAAO,EAAE,MAAM,CAAC;IAKhB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAKlC,OAAO,EAAE,MAAM,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;IAQhB,SAAS,EAAE,IAAI,CAAC;CACjB"}
|
|
@@ -34,7 +34,7 @@ let Organization = class Organization {
|
|
|
34
34
|
};
|
|
35
35
|
exports.Organization = Organization;
|
|
36
36
|
__decorate([
|
|
37
|
-
(0, typeorm_1.PrimaryGeneratedColumn)(
|
|
37
|
+
(0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
|
|
38
38
|
__metadata("design:type", String)
|
|
39
39
|
], Organization.prototype, "id", void 0);
|
|
40
40
|
__decorate([
|
|
@@ -65,7 +65,7 @@ __decorate([
|
|
|
65
65
|
(0, class_validator_1.IsString)(),
|
|
66
66
|
(0, class_validator_1.IsNotEmpty)(),
|
|
67
67
|
(0, typeorm_1.Column)({
|
|
68
|
-
type:
|
|
68
|
+
type: 'enum',
|
|
69
69
|
enum: organization_constant_1.ORGANIZATION_INDUSTRY,
|
|
70
70
|
default: organization_constant_1.ORGANIZATION_INDUSTRY.TECHNOLOGY,
|
|
71
71
|
}),
|
|
@@ -75,7 +75,7 @@ __decorate([
|
|
|
75
75
|
(0, class_validator_1.IsString)(),
|
|
76
76
|
(0, class_validator_1.IsNotEmpty)(),
|
|
77
77
|
(0, typeorm_1.Column)({
|
|
78
|
-
type:
|
|
78
|
+
type: 'enum',
|
|
79
79
|
enum: organization_constant_1.ORGANIZATION_TIMEZONE,
|
|
80
80
|
default: organization_constant_1.ORGANIZATION_TIMEZONE.UTC_MINUS_5,
|
|
81
81
|
}),
|
|
@@ -85,7 +85,7 @@ __decorate([
|
|
|
85
85
|
(0, class_validator_1.IsString)(),
|
|
86
86
|
(0, class_validator_1.IsNotEmpty)(),
|
|
87
87
|
(0, typeorm_1.Column)({
|
|
88
|
-
type:
|
|
88
|
+
type: 'enum',
|
|
89
89
|
enum: organization_constant_1.ORGANIZATION_TYPE,
|
|
90
90
|
}),
|
|
91
91
|
__metadata("design:type", String)
|
|
@@ -94,7 +94,7 @@ __decorate([
|
|
|
94
94
|
(0, class_validator_1.IsString)(),
|
|
95
95
|
(0, class_validator_1.IsNotEmpty)(),
|
|
96
96
|
(0, typeorm_1.Column)({
|
|
97
|
-
type:
|
|
97
|
+
type: 'enum',
|
|
98
98
|
enum: organization_constant_1.ORGANIZATION_EXPECTED_TEAM_SIZE,
|
|
99
99
|
}),
|
|
100
100
|
__metadata("design:type", String)
|
|
@@ -103,7 +103,7 @@ __decorate([
|
|
|
103
103
|
(0, class_validator_1.IsString)(),
|
|
104
104
|
(0, class_validator_1.IsOptional)(),
|
|
105
105
|
(0, typeorm_1.Column)({
|
|
106
|
-
type:
|
|
106
|
+
type: 'enum',
|
|
107
107
|
enum: organization_constant_1.ORGANIZATION_PRIMARY_USE_CASE,
|
|
108
108
|
nullable: true,
|
|
109
109
|
}),
|
|
@@ -115,7 +115,7 @@ __decorate([
|
|
|
115
115
|
(0, class_validator_1.ArrayUnique)(),
|
|
116
116
|
(0, class_validator_1.IsEnum)(organization_constant_1.ORGANIZATION_SECURITY_REQUIREMENT, { each: true }),
|
|
117
117
|
(0, typeorm_1.Column)({
|
|
118
|
-
type:
|
|
118
|
+
type: 'enum',
|
|
119
119
|
enum: organization_constant_1.ORGANIZATION_SECURITY_REQUIREMENT,
|
|
120
120
|
array: true,
|
|
121
121
|
nullable: true,
|
|
@@ -130,13 +130,13 @@ __decorate([
|
|
|
130
130
|
__decorate([
|
|
131
131
|
(0, class_validator_1.IsString)(),
|
|
132
132
|
(0, class_validator_1.IsOptional)(),
|
|
133
|
-
(0, typeorm_1.Column)({ type:
|
|
133
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: true }),
|
|
134
134
|
__metadata("design:type", String)
|
|
135
135
|
], Organization.prototype, "logoUrl", void 0);
|
|
136
136
|
__decorate([
|
|
137
137
|
(0, class_validator_1.IsString)(),
|
|
138
138
|
(0, class_validator_1.IsOptional)(),
|
|
139
|
-
(0, typeorm_1.Column)({ type:
|
|
139
|
+
(0, typeorm_1.Column)({ type: 'jsonb', nullable: true }),
|
|
140
140
|
__metadata("design:type", Object)
|
|
141
141
|
], Organization.prototype, "settings", void 0);
|
|
142
142
|
__decorate([
|
|
@@ -147,23 +147,23 @@ __decorate([
|
|
|
147
147
|
], Organization.prototype, "ownerId", void 0);
|
|
148
148
|
__decorate([
|
|
149
149
|
(0, typeorm_1.CreateDateColumn)({
|
|
150
|
-
name:
|
|
150
|
+
name: 'createdAt',
|
|
151
151
|
nullable: false,
|
|
152
|
-
type:
|
|
153
|
-
default: () =>
|
|
152
|
+
type: 'timestamptz',
|
|
153
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
154
154
|
}),
|
|
155
155
|
__metadata("design:type", Date)
|
|
156
156
|
], Organization.prototype, "createdAt", void 0);
|
|
157
157
|
__decorate([
|
|
158
158
|
(0, typeorm_1.UpdateDateColumn)({
|
|
159
|
-
name:
|
|
159
|
+
name: 'updatedAt',
|
|
160
160
|
nullable: false,
|
|
161
|
-
type:
|
|
162
|
-
default: () =>
|
|
161
|
+
type: 'timestamptz',
|
|
162
|
+
default: () => 'CURRENT_TIMESTAMP',
|
|
163
163
|
}),
|
|
164
164
|
__metadata("design:type", Date)
|
|
165
165
|
], Organization.prototype, "updatedAt", void 0);
|
|
166
166
|
exports.Organization = Organization = __decorate([
|
|
167
|
-
(0, typeorm_1.Entity)(
|
|
167
|
+
(0, typeorm_1.Entity)('organization')
|
|
168
168
|
], Organization);
|
|
169
169
|
//# sourceMappingURL=organization.entity.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.entity.js","sourceRoot":"","sources":["../../src/entities/organization.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAQyB;AACzB,qCAMiB;
|
|
1
|
+
{"version":3,"file":"organization.entity.js","sourceRoot":"","sources":["../../src/entities/organization.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAQyB;AACzB,qCAMiB;AAEjB,8EAO4C;AAGrC,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEvB,EAAE,CAAS;IAKX,IAAI,CAAS;IAKb,IAAI,CAAS;IAKb,MAAM,CAAS;IAKf,WAAW,CAAS;IASpB,QAAQ,CAAwB;IAShC,QAAQ,CAAwB;IAQhC,IAAI,CAAoB;IAQxB,gBAAgB,CAAkC;IASlD,cAAc,CAAgC;IAY9C,oBAAoB,CAAsC;IAI1D,QAAQ,CAAU;IAKlB,OAAO,CAAS;IAKhB,QAAQ,CAA0B;IAKlC,OAAO,CAAS;IAQh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GAAG,EAAE,CAAC,mBAAmB;KACnC,CAAC;8BACS,IAAI;+CAAC;AAQhB;IANC,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;+CAAC;uBAhHL,YAAY;IADxB,IAAA,gBAAM,EAAC,cAAc,CAAC;GACV,YAAY,CAiHxB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./constants/organization.settings.constant";
|
|
|
3
3
|
export * from "./constants/settings-type.constant";
|
|
4
4
|
export * from "./decorators/organization.decorator";
|
|
5
5
|
export * from "./decorators/roles.decorator";
|
|
6
|
+
export * from "./dtos/CreateOrganization.dto";
|
|
6
7
|
export * from "./entities/organization.entity";
|
|
7
8
|
export * from "./entities/organization-settings.entity";
|
|
8
9
|
export * from "./entities/organization-user.entity";
|
|
@@ -11,6 +12,6 @@ export * from "./organization.module";
|
|
|
11
12
|
export * from "./services/organization.service";
|
|
12
13
|
export * from "./services/organization-settings.service";
|
|
13
14
|
export * from "./services/organization-user.service";
|
|
15
|
+
export * from "./services/organization-settings-encryption.service";
|
|
14
16
|
export * from "./settings/organization.settings";
|
|
15
|
-
export * from "./dtos/CreateOrganization.dto";
|
|
16
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,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,
|
|
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,+BAA+B,CAAC;AAC9C,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,qDAAqD,CAAC;AACpE,cAAc,kCAAkC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __exportStar(require("./constants/organization.settings.constant"), exports);
|
|
|
19
19
|
__exportStar(require("./constants/settings-type.constant"), exports);
|
|
20
20
|
__exportStar(require("./decorators/organization.decorator"), exports);
|
|
21
21
|
__exportStar(require("./decorators/roles.decorator"), exports);
|
|
22
|
+
__exportStar(require("./dtos/CreateOrganization.dto"), exports);
|
|
22
23
|
__exportStar(require("./entities/organization.entity"), exports);
|
|
23
24
|
__exportStar(require("./entities/organization-settings.entity"), exports);
|
|
24
25
|
__exportStar(require("./entities/organization-user.entity"), exports);
|
|
@@ -27,6 +28,6 @@ __exportStar(require("./organization.module"), exports);
|
|
|
27
28
|
__exportStar(require("./services/organization.service"), exports);
|
|
28
29
|
__exportStar(require("./services/organization-settings.service"), exports);
|
|
29
30
|
__exportStar(require("./services/organization-user.service"), exports);
|
|
31
|
+
__exportStar(require("./services/organization-settings-encryption.service"), exports);
|
|
30
32
|
__exportStar(require("./settings/organization.settings"), exports);
|
|
31
|
-
__exportStar(require("./dtos/CreateOrganization.dto"), exports);
|
|
32
33
|
//# 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,qEAAmD;AACnD,sEAAoD;AACpD,+DAA6C;AAC7C,iEAA+C;AAC/C,0EAAwD;AACxD,sEAAoD;AACpD,8DAA4C;AAC5C,wDAAsC;AACtC,kEAAgD;AAChD,2EAAyD;AACzD,uEAAqD;AACrD,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oEAAkD;AAClD,6EAA2D;AAC3D,qEAAmD;AACnD,sEAAoD;AACpD,+DAA6C;AAC7C,gEAA8C;AAC9C,iEAA+C;AAC/C,0EAAwD;AACxD,sEAAoD;AACpD,8DAA4C;AAC5C,wDAAsC;AACtC,kEAAgD;AAChD,2EAAyD;AACzD,uEAAqD;AACrD,sFAAoE;AACpE,mEAAiD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.module.d.ts","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"organization.module.d.ts","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":"AAYA,qBAsBa,kBAAkB;CAAG"}
|
|
@@ -16,6 +16,7 @@ const organization_user_entity_1 = require("./entities/organization-user.entity"
|
|
|
16
16
|
const organization_service_1 = require("./services/organization.service");
|
|
17
17
|
const organization_settings_service_1 = require("./services/organization-settings.service");
|
|
18
18
|
const organization_user_service_1 = require("./services/organization-user.service");
|
|
19
|
+
const organization_settings_encryption_service_1 = require("./services/organization-settings-encryption.service");
|
|
19
20
|
let OrganizationModule = class OrganizationModule {
|
|
20
21
|
};
|
|
21
22
|
exports.OrganizationModule = OrganizationModule;
|
|
@@ -23,11 +24,24 @@ exports.OrganizationModule = OrganizationModule = __decorate([
|
|
|
23
24
|
(0, common_1.Module)({
|
|
24
25
|
imports: [
|
|
25
26
|
core_1.SharedModule.forRoot({}),
|
|
26
|
-
typeorm_1.TypeOrmModule.forFeature([
|
|
27
|
+
typeorm_1.TypeOrmModule.forFeature([
|
|
28
|
+
organization_entity_1.Organization,
|
|
29
|
+
organization_user_entity_1.OrganizationUser,
|
|
30
|
+
organization_settings_entity_1.OrganizationSettings,
|
|
31
|
+
]),
|
|
32
|
+
],
|
|
33
|
+
providers: [
|
|
34
|
+
organization_service_1.OrganizationService,
|
|
35
|
+
organization_user_service_1.OrganizationUserService,
|
|
36
|
+
organization_settings_service_1.OrganizationSettingsService,
|
|
37
|
+
organization_settings_encryption_service_1.OrganizationSettingsEncryptionService,
|
|
38
|
+
],
|
|
39
|
+
exports: [
|
|
40
|
+
organization_service_1.OrganizationService,
|
|
41
|
+
organization_user_service_1.OrganizationUserService,
|
|
42
|
+
organization_settings_service_1.OrganizationSettingsService,
|
|
43
|
+
organization_settings_encryption_service_1.OrganizationSettingsEncryptionService,
|
|
27
44
|
],
|
|
28
|
-
providers: [organization_service_1.OrganizationService, organization_user_service_1.OrganizationUserService, organization_settings_service_1.OrganizationSettingsService],
|
|
29
|
-
controllers: [],
|
|
30
|
-
exports: [organization_service_1.OrganizationService, organization_user_service_1.OrganizationUserService, organization_settings_service_1.OrganizationSettingsService],
|
|
31
45
|
})
|
|
32
46
|
], OrganizationModule);
|
|
33
47
|
//# 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,0FAA+E;AAC/E,kFAAuE;AACvE,0EAAsE;AACtE,4FAAuF;AACvF,oFAA+E;
|
|
1
|
+
{"version":3,"file":"organization.module.js","sourceRoot":"","sources":["../src/organization.module.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAwC;AACxC,6CAAgD;AAChD,6CAAkD;AAElD,wEAA8D;AAC9D,0FAA+E;AAC/E,kFAAuE;AACvE,0EAAsE;AACtE,4FAAuF;AACvF,oFAA+E;AAC/E,kHAA4G;AAwBrG,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;CAAG,CAAA;AAArB,gDAAkB;6BAAlB,kBAAkB;IAtB9B,IAAA,eAAM,EAAC;QACN,OAAO,EAAE;YACP,mBAAY,CAAC,OAAO,CAAC,EAAE,CAAC;YACxB,uBAAa,CAAC,UAAU,CAAC;gBACvB,kCAAY;gBACZ,2CAAgB;gBAChB,mDAAoB;aACrB,CAAC;SACH;QACD,SAAS,EAAE;YACT,0CAAmB;YACnB,mDAAuB;YACvB,2DAA2B;YAC3B,gFAAqC;SACtC;QACD,OAAO,EAAE;YACP,0CAAmB;YACnB,mDAAuB;YACvB,2DAA2B;YAC3B,gFAAqC;SACtC;KACF,CAAC;GACW,kBAAkB,CAAG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { AppLogger } from "@venturialstd/core";
|
|
2
|
+
export declare class OrganizationSettingsEncryptionService {
|
|
3
|
+
private readonly logger;
|
|
4
|
+
private readonly algorithm;
|
|
5
|
+
private readonly keyLength;
|
|
6
|
+
private readonly ivLength;
|
|
7
|
+
private readonly encryptionKey;
|
|
8
|
+
constructor(logger: AppLogger);
|
|
9
|
+
encrypt(plainText: string): string;
|
|
10
|
+
decrypt(encryptedText: string): string;
|
|
11
|
+
isEncrypted(value: string): boolean;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=organization-settings-encryption.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-settings-encryption.service.d.ts","sourceRoot":"","sources":["../../src/services/organization-settings-encryption.service.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,qBACa,qCAAqC;IAMpC,OAAO,CAAC,QAAQ,CAAC,MAAM;IALnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IACzD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAM;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAM;IAC/B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAEV,MAAM,EAAE,SAAS;IA6B9C,OAAO,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;IAsBlC,OAAO,CAAC,aAAa,EAAE,MAAM,GAAG,MAAM;IA+BtC,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;CAUpC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
19
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
20
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
21
|
+
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;
|
|
22
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
23
|
+
};
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
41
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
42
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
43
|
+
};
|
|
44
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
+
exports.OrganizationSettingsEncryptionService = void 0;
|
|
46
|
+
const common_1 = require("@nestjs/common");
|
|
47
|
+
const crypto = __importStar(require("crypto"));
|
|
48
|
+
const settings_encryption_constants_1 = require("../constants/settings-encryption.constants");
|
|
49
|
+
const core_1 = require("@venturialstd/core");
|
|
50
|
+
let OrganizationSettingsEncryptionService = class OrganizationSettingsEncryptionService {
|
|
51
|
+
logger;
|
|
52
|
+
algorithm = settings_encryption_constants_1.ENCRYPTION_ALGORITHM.AES256;
|
|
53
|
+
keyLength = 32;
|
|
54
|
+
ivLength = 16;
|
|
55
|
+
encryptionKey;
|
|
56
|
+
constructor(logger) {
|
|
57
|
+
this.logger = logger;
|
|
58
|
+
const secret = process.env.SETTINGS_ENCRYPTION_KEY;
|
|
59
|
+
const salt = process.env.SETTINGS_ENCRYPTION_SALT;
|
|
60
|
+
const MIN_KEY_LENGTH = 16;
|
|
61
|
+
if (!secret || !salt) {
|
|
62
|
+
this.logger.error("ENCRYPTION KEY or SALT is not defined in environment variables");
|
|
63
|
+
throw new Error("ENCRYPTION KEY or SALT is required in environment variables");
|
|
64
|
+
}
|
|
65
|
+
if (Buffer.from(secret).length < MIN_KEY_LENGTH) {
|
|
66
|
+
this.logger.warn("SETTINGS_ENCRYPTION_KEY is too short; consider using at least 16 characters");
|
|
67
|
+
}
|
|
68
|
+
if (Buffer.from(salt).length < MIN_KEY_LENGTH) {
|
|
69
|
+
this.logger.warn("SETTINGS_ENCRYPTION_SALT is too short; consider using at least 16 characters");
|
|
70
|
+
}
|
|
71
|
+
this.encryptionKey = crypto.scryptSync(secret, salt, this.keyLength);
|
|
72
|
+
}
|
|
73
|
+
encrypt(plainText) {
|
|
74
|
+
try {
|
|
75
|
+
const initVector = crypto.randomBytes(this.ivLength);
|
|
76
|
+
const cipher = crypto.createCipheriv(this.algorithm, this.encryptionKey, initVector);
|
|
77
|
+
let encrypted = cipher.update(plainText, "utf8", "hex");
|
|
78
|
+
encrypted += cipher.final("hex");
|
|
79
|
+
const authTag = cipher.getAuthTag();
|
|
80
|
+
return `${initVector.toString("hex")}:${encrypted}:${authTag.toString("hex")}`;
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
this.logger.error("Encryption failed:", error);
|
|
84
|
+
throw error;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
decrypt(encryptedText) {
|
|
88
|
+
try {
|
|
89
|
+
const parts = encryptedText.split(":");
|
|
90
|
+
if (parts.length !== 3) {
|
|
91
|
+
throw new Error("Invalid encrypted text format");
|
|
92
|
+
}
|
|
93
|
+
const [ivHex, encryptedHex, authTagHex] = parts;
|
|
94
|
+
const iv = Buffer.from(ivHex, "hex");
|
|
95
|
+
const encrypted = Buffer.from(encryptedHex, "hex");
|
|
96
|
+
const authTag = Buffer.from(authTagHex, "hex");
|
|
97
|
+
const decipher = crypto.createDecipheriv(this.algorithm, this.encryptionKey, iv);
|
|
98
|
+
decipher.setAuthTag(authTag);
|
|
99
|
+
let decrypted = decipher.update(encrypted, undefined, "utf8");
|
|
100
|
+
decrypted += decipher.final("utf8");
|
|
101
|
+
return decrypted;
|
|
102
|
+
}
|
|
103
|
+
catch (error) {
|
|
104
|
+
this.logger.error("Descryption failed:", error);
|
|
105
|
+
throw error;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
isEncrypted(value) {
|
|
109
|
+
if (!value || typeof value !== "string") {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
const parts = value.split(":");
|
|
113
|
+
return (parts.length === 3 && parts.every((part) => /^[0-9a-f]+$/i.test(part)));
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
exports.OrganizationSettingsEncryptionService = OrganizationSettingsEncryptionService;
|
|
117
|
+
exports.OrganizationSettingsEncryptionService = OrganizationSettingsEncryptionService = __decorate([
|
|
118
|
+
(0, common_1.Injectable)(),
|
|
119
|
+
__metadata("design:paramtypes", [core_1.AppLogger])
|
|
120
|
+
], OrganizationSettingsEncryptionService);
|
|
121
|
+
//# sourceMappingURL=organization-settings-encryption.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization-settings-encryption.service.js","sourceRoot":"","sources":["../../src/services/organization-settings-encryption.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA4C;AAC5C,+CAAiC;AACjC,8FAAkF;AAClF,6CAA+C;AAGxC,IAAM,qCAAqC,GAA3C,MAAM,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AAM,CAAC,CAAC;YAC9D,SAAS,IAAI,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAEpC,OAAO,SAAS,CAAC;QACnB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,KAAc,CAAC,CAAC;YACzD,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC;IAED,WAAW,CAAC,KAAa;QACvB,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;YACxC,OAAO,KAAK,CAAC;QACf,CAAC;QAED,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,OAAO,CACL,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CACvE,CAAC;IACJ,CAAC;CACF,CAAA;AAlGY,sFAAqC;gDAArC,qCAAqC;IADjD,IAAA,mBAAU,GAAE;qCAO0B,gBAAS;GANnC,qCAAqC,CAkGjD"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { TypeOrmCrudService } from
|
|
2
|
-
import { DeepPartial, Repository } from
|
|
3
|
-
import { OrganizationSettings } from
|
|
1
|
+
import { TypeOrmCrudService } from "@dataui/crud-typeorm";
|
|
2
|
+
import { DeepPartial, Repository } from "typeorm";
|
|
3
|
+
import { OrganizationSettings } from "../entities/organization-settings.entity";
|
|
4
|
+
import { OrganizationSettingsEncryptionService } from "./organization-settings-encryption.service";
|
|
4
5
|
export declare class OrganizationSettingsService extends TypeOrmCrudService<OrganizationSettings> {
|
|
5
6
|
private readonly organizationSettingsRepo;
|
|
6
|
-
|
|
7
|
+
private readonly settingsEncryptionService;
|
|
8
|
+
constructor(organizationSettingsRepo: Repository<OrganizationSettings>, settingsEncryptionService: OrganizationSettingsEncryptionService);
|
|
7
9
|
get(organizationId: string, key: string): Promise<string | undefined>;
|
|
8
10
|
getManySettings(organizationId: string, keys: string[]): Promise<Record<string, string>>;
|
|
9
11
|
getAllForOrganization(organizationId: string, module?: string): Promise<OrganizationSettings[]>;
|
|
@@ -1 +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;
|
|
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;AAEhF,OAAO,EAAE,qCAAqC,EAAE,MAAM,4CAA4C,CAAC;AAOnG,qBACa,2BAA4B,SAAQ,kBAAkB,CAAC,oBAAoB,CAAC;IAGrF,OAAO,CAAC,QAAQ,CAAC,wBAAwB;IACzC,OAAO,CAAC,QAAQ,CAAC,yBAAyB;gBADzB,wBAAwB,EAAE,UAAU,CAAC,oBAAoB,CAAC,EAC1D,yBAAyB,EAAE,qCAAqC;IAW7E,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAmCrE,eAAe,CACnB,cAAc,EAAE,MAAM,EACtB,IAAI,EAAE,MAAM,EAAE,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAiB5B,qBAAqB,CACzB,cAAc,EAAE,MAAM,EACtB,MAAM,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAsB5B,sBAAsB,CAC1B,cAAc,EAAE,MAAM,EACtB,GAAG,EAAE,WAAW,CAAC,oBAAoB,CAAC,GACrC,OAAO,CAAC,oBAAoB,CAAC;IAwC1B,yBAAyB,CAC7B,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,IAAI,CAAC;IAcV,mBAAmB,CACvB,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;IAYV,kBAAkB,CACtB,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,WAAW,CAAC,oBAAoB,CAAC,EAAE,GAC5C,OAAO,CAAC,oBAAoB,EAAE,CAAC;CAUnC"}
|
|
@@ -18,16 +18,20 @@ const common_1 = require("@nestjs/common");
|
|
|
18
18
|
const typeorm_1 = require("@nestjs/typeorm");
|
|
19
19
|
const typeorm_2 = require("typeorm");
|
|
20
20
|
const organization_settings_entity_1 = require("../entities/organization-settings.entity");
|
|
21
|
+
const settings_type_constant_1 = require("../constants/settings-type.constant");
|
|
22
|
+
const organization_settings_encryption_service_1 = require("./organization-settings-encryption.service");
|
|
21
23
|
let OrganizationSettingsService = class OrganizationSettingsService extends crud_typeorm_1.TypeOrmCrudService {
|
|
22
24
|
organizationSettingsRepo;
|
|
23
|
-
|
|
25
|
+
settingsEncryptionService;
|
|
26
|
+
constructor(organizationSettingsRepo, settingsEncryptionService) {
|
|
24
27
|
super(organizationSettingsRepo);
|
|
25
28
|
this.organizationSettingsRepo = organizationSettingsRepo;
|
|
29
|
+
this.settingsEncryptionService = settingsEncryptionService;
|
|
26
30
|
}
|
|
27
31
|
async get(organizationId, key) {
|
|
28
|
-
const keyParts = key.split(
|
|
32
|
+
const keyParts = key.split(":");
|
|
29
33
|
if (keyParts.length !== 3) {
|
|
30
|
-
throw new Error(
|
|
34
|
+
throw new Error("Invalid key format. Expected format: module:section:key");
|
|
31
35
|
}
|
|
32
36
|
const [module, section, configKey] = keyParts;
|
|
33
37
|
const orgSetting = await this.organizationSettingsRepo.findOne({
|
|
@@ -38,6 +42,10 @@ let OrganizationSettingsService = class OrganizationSettingsService extends crud
|
|
|
38
42
|
key: configKey,
|
|
39
43
|
},
|
|
40
44
|
});
|
|
45
|
+
if (orgSetting?.type === settings_type_constant_1.SETTINGS_TYPE.SECRET &&
|
|
46
|
+
this.settingsEncryptionService.isEncrypted(orgSetting.value)) {
|
|
47
|
+
return this.settingsEncryptionService.decrypt(orgSetting.value);
|
|
48
|
+
}
|
|
41
49
|
return orgSetting?.value;
|
|
42
50
|
}
|
|
43
51
|
async getManySettings(organizationId, keys) {
|
|
@@ -51,17 +59,24 @@ let OrganizationSettingsService = class OrganizationSettingsService extends crud
|
|
|
51
59
|
return results;
|
|
52
60
|
}
|
|
53
61
|
async getAllForOrganization(organizationId, module) {
|
|
54
|
-
const whereClause = {
|
|
62
|
+
const whereClause = {
|
|
63
|
+
organizationId,
|
|
64
|
+
};
|
|
55
65
|
if (module) {
|
|
56
66
|
whereClause.module = module;
|
|
57
67
|
}
|
|
58
68
|
const orgSettings = await this.organizationSettingsRepo.find({
|
|
59
69
|
where: whereClause,
|
|
60
|
-
order: { sortOrder:
|
|
70
|
+
order: { sortOrder: "ASC" },
|
|
61
71
|
});
|
|
62
72
|
return orgSettings;
|
|
63
73
|
}
|
|
64
74
|
async setOrganizationSetting(organizationId, dto) {
|
|
75
|
+
if (dto.type === settings_type_constant_1.SETTINGS_TYPE.SECRET &&
|
|
76
|
+
dto.value &&
|
|
77
|
+
!this.settingsEncryptionService.isEncrypted(dto.value)) {
|
|
78
|
+
dto.value = this.settingsEncryptionService.encrypt(dto.value);
|
|
79
|
+
}
|
|
65
80
|
const existingSetting = await this.organizationSettingsRepo.findOne({
|
|
66
81
|
where: {
|
|
67
82
|
organizationId,
|
|
@@ -109,6 +124,7 @@ exports.OrganizationSettingsService = OrganizationSettingsService;
|
|
|
109
124
|
exports.OrganizationSettingsService = OrganizationSettingsService = __decorate([
|
|
110
125
|
(0, common_1.Injectable)(),
|
|
111
126
|
__param(0, (0, typeorm_1.InjectRepository)(organization_settings_entity_1.OrganizationSettings)),
|
|
112
|
-
__metadata("design:paramtypes", [typeorm_2.Repository
|
|
127
|
+
__metadata("design:paramtypes", [typeorm_2.Repository,
|
|
128
|
+
organization_settings_encryption_service_1.OrganizationSettingsEncryptionService])
|
|
113
129
|
], OrganizationSettingsService);
|
|
114
130
|
//# sourceMappingURL=organization-settings.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-settings.service.js","sourceRoot":"","sources":["../../src/services/organization-settings.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAkD;AAElD,2FAAgF;
|
|
1
|
+
{"version":3,"file":"organization-settings.service.js","sourceRoot":"","sources":["../../src/services/organization-settings.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAA4C;AAC5C,6CAAmD;AACnD,qCAAkD;AAElD,2FAAgF;AAChF,gFAAoE;AACpE,yGAAmG;AAQ5F,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,iCAAwC;IAGpE;IACA;IAHnB,YAEmB,wBAA0D,EAC1D,yBAAgE;QAEjF,KAAK,CAAC,wBAAwB,CAAC,CAAC;QAHf,6BAAwB,GAAxB,wBAAwB,CAAkC;QAC1D,8BAAyB,GAAzB,yBAAyB,CAAuC;IAGnF,CAAC;IAQD,KAAK,CAAC,GAAG,CAAC,cAAsB,EAAE,GAAW;QAC3C,MAAM,QAAQ,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,C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zC,cAAc;YACd,MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAOD,KAAK,CAAC,kBAAkB,CACtB,cAAsB,EACtB,QAA6C;QAE7C,MAAM,OAAO,GAA2B,EAAE,CAAC;QAE3C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,sBAAsB,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YAC1E,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACvB,CAAC;QAED,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AAzLY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,mDAAoB,CAAC,CAAA;qCACI,oBAAU;QACT,gFAAqC;GAJxE,2BAA2B,CAyLvC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { TypeOrmCrudService } from
|
|
2
|
-
import { AppLogger } from
|
|
3
|
-
import { Repository } from
|
|
4
|
-
import { ORGANIZATION_USER_ROLE } from
|
|
5
|
-
import { Organization } from
|
|
6
|
-
import { OrganizationUser } from
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { AppLogger } from '@venturialstd/core';
|
|
3
|
+
import { Repository } from 'typeorm';
|
|
4
|
+
import { ORGANIZATION_USER_ROLE } from '../constants/organization.constant';
|
|
5
|
+
import { Organization } from '../entities/organization.entity';
|
|
6
|
+
import { OrganizationUser } from '../entities/organization-user.entity';
|
|
7
7
|
export declare class OrganizationUserService extends TypeOrmCrudService<OrganizationUser> {
|
|
8
8
|
readonly repo: Repository<OrganizationUser>;
|
|
9
9
|
private readonly organizationRepo;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-user.service.d.ts","sourceRoot":"","sources":["../../src/services/organization-user.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EA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B,OAAO,CAAC,OAAO,CAAC;IAgBb,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAsBxE,WAAW,CACf,cAAc,EAAE,MAAM,EACtB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,sBAAsB,GAAG,IAAI,CAAC;IAenC,eAAe,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAyBlF,iBAAiB,CACrB,cAAc,EAAE,MAAM,EACtB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAuCV,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAS/D,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuB9E,cAAc,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAmBxF"}
|
|
@@ -41,13 +41,13 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
41
41
|
throw new common_1.NotFoundException(`Organization with id "${organizationId}" not found`);
|
|
42
42
|
}
|
|
43
43
|
if (!organization.isActive) {
|
|
44
|
-
throw new common_1.BadRequestException(
|
|
44
|
+
throw new common_1.BadRequestException('Cannot add users to an inactive organization');
|
|
45
45
|
}
|
|
46
46
|
const existing = await this.repo.findOne({
|
|
47
47
|
where: { organizationId, userId },
|
|
48
48
|
});
|
|
49
49
|
if (existing) {
|
|
50
|
-
throw new common_1.BadRequestException(
|
|
50
|
+
throw new common_1.BadRequestException('User is already a member of this organization');
|
|
51
51
|
}
|
|
52
52
|
const organizationUser = this.repo.create({
|
|
53
53
|
organizationId,
|
|
@@ -73,7 +73,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
73
73
|
where: { organizationId, userId },
|
|
74
74
|
});
|
|
75
75
|
if (existing) {
|
|
76
|
-
throw new common_1.BadRequestException(
|
|
76
|
+
throw new common_1.BadRequestException('User is already a member or has a pending invitation');
|
|
77
77
|
}
|
|
78
78
|
const organizationUser = this.repo.create({
|
|
79
79
|
organizationId,
|
|
@@ -97,7 +97,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
97
97
|
},
|
|
98
98
|
});
|
|
99
99
|
if (!organizationUser) {
|
|
100
|
-
throw new common_1.NotFoundException(
|
|
100
|
+
throw new common_1.NotFoundException('Invitation not found');
|
|
101
101
|
}
|
|
102
102
|
organizationUser.status = organization_constant_1.ORGANIZATION_USER_STATUS.ACTIVE;
|
|
103
103
|
organizationUser.joinedAt = new Date();
|
|
@@ -110,10 +110,10 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
110
110
|
where: { organizationId, userId },
|
|
111
111
|
});
|
|
112
112
|
if (!organizationUser) {
|
|
113
|
-
throw new common_1.NotFoundException(
|
|
113
|
+
throw new common_1.NotFoundException('User is not a member of this organization');
|
|
114
114
|
}
|
|
115
115
|
if (organizationUser.isPrimary) {
|
|
116
|
-
throw new common_1.BadRequestException(
|
|
116
|
+
throw new common_1.BadRequestException('Cannot remove the primary owner of an organization');
|
|
117
117
|
}
|
|
118
118
|
await this.repo.remove(organizationUser);
|
|
119
119
|
this.logger.log(`User ${userId} removed from organization ${organizationId}`);
|
|
@@ -123,11 +123,10 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
123
123
|
where: { organizationId, userId },
|
|
124
124
|
});
|
|
125
125
|
if (!organizationUser) {
|
|
126
|
-
throw new common_1.NotFoundException(
|
|
126
|
+
throw new common_1.NotFoundException('User is not a member of this organization');
|
|
127
127
|
}
|
|
128
|
-
if (organizationUser.isPrimary &&
|
|
129
|
-
|
|
130
|
-
throw new common_1.BadRequestException("Cannot change role of primary owner");
|
|
128
|
+
if (organizationUser.isPrimary && newRole !== organization_constant_1.ORGANIZATION_USER_ROLE.OWNER) {
|
|
129
|
+
throw new common_1.BadRequestException('Cannot change role of primary owner');
|
|
131
130
|
}
|
|
132
131
|
organizationUser.role = newRole;
|
|
133
132
|
const updated = await this.repo.save(organizationUser);
|
|
@@ -203,7 +202,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
203
202
|
where: { organizationId, userId },
|
|
204
203
|
});
|
|
205
204
|
if (!organizationUser) {
|
|
206
|
-
throw new common_1.NotFoundException(
|
|
205
|
+
throw new common_1.NotFoundException('User is not a member of this organization');
|
|
207
206
|
}
|
|
208
207
|
organizationUser.isPrimary = true;
|
|
209
208
|
organizationUser.role = organization_constant_1.ORGANIZATION_USER_ROLE.OWNER;
|
|
@@ -216,7 +215,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
216
215
|
where: { organizationId, userId: fromUserId, isPrimary: true },
|
|
217
216
|
});
|
|
218
217
|
if (!currentOwner) {
|
|
219
|
-
throw new common_1.ForbiddenException(
|
|
218
|
+
throw new common_1.ForbiddenException('Only the primary owner can transfer ownership');
|
|
220
219
|
}
|
|
221
220
|
const newOwner = await this.repo.findOne({
|
|
222
221
|
where: {
|
|
@@ -226,7 +225,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
226
225
|
},
|
|
227
226
|
});
|
|
228
227
|
if (!newOwner) {
|
|
229
|
-
throw new common_1.NotFoundException(
|
|
228
|
+
throw new common_1.NotFoundException('New owner must be an active member of the organization');
|
|
230
229
|
}
|
|
231
230
|
await this.setPrimaryOwner(organizationId, toUserId);
|
|
232
231
|
currentOwner.isPrimary = false;
|
|
@@ -244,10 +243,10 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
244
243
|
where: { organizationId, userId },
|
|
245
244
|
});
|
|
246
245
|
if (!organizationUser) {
|
|
247
|
-
throw new common_1.NotFoundException(
|
|
246
|
+
throw new common_1.NotFoundException('User is not a member of this organization');
|
|
248
247
|
}
|
|
249
248
|
if (organizationUser.isPrimary) {
|
|
250
|
-
throw new common_1.BadRequestException(
|
|
249
|
+
throw new common_1.BadRequestException('Cannot suspend the primary owner');
|
|
251
250
|
}
|
|
252
251
|
organizationUser.status = organization_constant_1.ORGANIZATION_USER_STATUS.SUSPENDED;
|
|
253
252
|
const updated = await this.repo.save(organizationUser);
|
|
@@ -263,7 +262,7 @@ let OrganizationUserService = OrganizationUserService_1 = class OrganizationUser
|
|
|
263
262
|
},
|
|
264
263
|
});
|
|
265
264
|
if (!organizationUser) {
|
|
266
|
-
throw new common_1.NotFoundException(
|
|
265
|
+
throw new common_1.NotFoundException('User is not suspended in this organization');
|
|
267
266
|
}
|
|
268
267
|
organizationUser.status = organization_constant_1.ORGANIZATION_USER_STATUS.ACTIVE;
|
|
269
268
|
const updated = await this.repo.save(organizationUser);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization-user.service.js","sourceRoot":"","sources":["../../src/services/organization-user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAKwB;AACxB,6CAAmD;AACnD,6CAA+C;AAC/C,qCAAqC;AAErC,8EAG4C;AAC5C,yEAA+D;AAC/D,mFAAwE;AAGjE,IAAM,uBAAuB,+BAA7B,MAAM,uBAAwB,SAAQ,iCAAoC;IAG7D;IAEC;IACA;IALnB,YAEkB,IAAkC,EAEjC,gBAA0C,EAC1C,MAAiB;QAElC,KAAK,CAAC,IAAI,CAAC,CAAC;QALI,SAAI,GAAJ,IAAI,CAA8B;QAEjC,qBAAgB,GAAhB,gBAAgB,CAA0B;QAC1C,WAAM,GAAN,MAAM,CAAW;QAGlC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAKD,KAAK,CAAC,qBAAqB,CACzB,cAAsB,EACtB,MAAc,EACd,OAA+B,8CAAsB,CAAC,MAAM,EAC5D,SAAkB;QAGlB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YACvD,KAAK,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE;SAC9B,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,0BAAiB,
|
|
1
|
+
{"version":3,"file":"organization-user.service.js","sourceRoot":"","sources":["../../src/services/organization-user.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAKwB;AACxB,6CAAmD;AACnD,6CAA+C;AAC/C,qCAAqC;AAErC,8EAG4C;AAC5C,yEAA+D;AAC/D,mFAAwE;AAGjE,IAAM,uBAAuB,+BAA7B,MAAM,uBAAwB,SAAQ,iCAAoC;IAG7D;IAEC;IACA;IALnB,YAEkB,IAAkC,EAEjC,gBAA0C,EAC1C,MAAiB;QAElC,KAAK,CAAC,IAAI,CAAC,CAAC;QALI,SAAI,GAAJ,IAAI,CAA8B;QAEjC,qBAAgB,GAAhB,gBAAgB,CAA0B;QAC1C,WAAM,GAAN,MAAM,CAAW;QAGlC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,yBAAuB,CAAC,IAAI,CAAC,CAAC;IACvD,CAAC;IAKD,KAAK,CAAC,qBAAqB,CACzB,cAAsB,EACtB,MAAc,EACd,OAA+B,8CAAsB,CAAC,MAAM,EAC5D,SAAkB;QAGlB,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO,CAAC;YACvD,KAAK,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE;SAC9B,CAAC,CAAC;QACH,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,MAAM,IAAI,0BAAiB,CAAC,yBAAyB,cAAc,aAAa,CAAC,CAAC;QACpF,CAAC;QAED,IAAI,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YAC3B,MAAM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CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,MAAM,gCAAgC,cAAc,EAAE,CAAC,CAAC;QAEhF,OAAO,OAAO,CAAC;IACjB,CAAC;CACF,CAAA;AA/YY,0DAAuB;kCAAvB,uBAAuB;IADnC,IAAA,mBAAU,GAAE;IAGR,WAAA,IAAA,0BAAgB,EAAC,2CAAgB,CAAC,CAAA;IAElC,WAAA,IAAA,0BAAgB,EAAC,kCAAY,CAAC,CAAA;qCADT,oBAAU;QAEG,oBAAU;QACpB,gBAAS;GANzB,uBAAuB,CA+YnC"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { TypeOrmCrudService } from
|
|
2
|
-
import { AppLogger, SettingsService } from
|
|
3
|
-
import { Repository } from
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { TypeOrmCrudService } from '@dataui/crud-typeorm';
|
|
2
|
+
import { AppLogger, SettingsService } from '@venturialstd/core';
|
|
3
|
+
import { Repository } from 'typeorm';
|
|
4
|
+
import { CreateOrganizationDto } from '../dtos/CreateOrganization.dto';
|
|
5
|
+
import { Organization } from '../entities/organization.entity';
|
|
6
6
|
export declare class OrganizationService extends TypeOrmCrudService<Organization> {
|
|
7
7
|
readonly repo: Repository<Organization>;
|
|
8
8
|
private readonly settingsService;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.service.d.ts","sourceRoot":"","sources":["../../src/services/organization.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"organization.service.d.ts","sourceRoot":"","sources":["../../src/services/organization.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAE/D,qBACa,mBAAoB,SAAQ,kBAAkB,CAAC,YAAY,CAAC;aAGrD,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC;IAC9C,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFP,IAAI,EAAE,UAAU,CAAC,YAAY,CAAC,EAC7B,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,SAAS;IAS9B,kBAAkB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,YAAY,CAAC;IAyEtE,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAW1D,uBAAuB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC;IAW9D,0BAA0B,CAC9B,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,OAAO,CAAC,YAAY,CAAC;IAkBlB,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,YAAY,CAAC;IAkBvF,sBAAsB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAOjD,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CAGxE"}
|
|
@@ -63,7 +63,7 @@ let OrganizationService = OrganizationService_1 = class OrganizationService exte
|
|
|
63
63
|
return savedOrganization;
|
|
64
64
|
}
|
|
65
65
|
catch (error) {
|
|
66
|
-
this.logger.error(
|
|
66
|
+
this.logger.error('Error creating organization:', error);
|
|
67
67
|
throw error;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
@@ -102,7 +102,7 @@ let OrganizationService = OrganizationService_1 = class OrganizationService exte
|
|
|
102
102
|
}
|
|
103
103
|
organization.isActive = isActive;
|
|
104
104
|
const updatedOrganization = await this.repo.save(organization);
|
|
105
|
-
this.logger.log(`Organization ${isActive ?
|
|
105
|
+
this.logger.log(`Organization ${isActive ? 'activated' : 'deactivated'}: ${organizationId}`);
|
|
106
106
|
return updatedOrganization;
|
|
107
107
|
}
|
|
108
108
|
async getActiveOrganizations() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"organization.service.js","sourceRoot":"","sources":["../../src/services/organization.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"organization.service.js","sourceRoot":"","sources":["../../src/services/organization.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAA0D;AAC1D,2CAAoF;AACpF,6CAAmD;AACnD,6CAAgE;AAChE,qCAAqC;AAGrC,yEAA+D;AAGxD,IAAM,mBAAmB,2BAAzB,MAAM,mBAAoB,SAAQ,iCAAgC;IAGrD;IACC;IACA;IAJnB,YAEkB,IAA8B,EAC7B,eAAgC,EAChC,MAAiB;QAElC,KAAK,CAAC,IAAI,CAAC,CAAC;QAJI,SAAI,GAAJ,IAAI,CAA0B;QAC7B,oBAAe,GAAf,eAAe,CAAiB;QAChC,WAAM,GAAN,MAAM,CAAW;QAGlC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,qBAAmB,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAKD,KAAK,CAAC,kBAAkB,CAAC,IAA2B;QAClD,IAAI,CAAC;YAeH,MAAM,EACJ,IAAI,EACJ,IAAI,EACJ,MAAM,EACN,WAAW,EACX,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,gBAAgB,EAChB,cAAc,EACd,oBAAoB,EACpB,OAAO,EACP,OAAO,GACR,GAAG,IAAI,CAAC;YAET,MAAM,cAAc,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,CA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