@attraccess/database-entities 1.2.0 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +46 -0
- package/package.json +4 -4
- package/src/index.d.ts +2 -0
- package/src/index.js +5 -1
- package/src/index.js.map +1 -1
- package/src/lib/entities/attractap.entity.d.ts +9 -0
- package/src/lib/entities/attractap.entity.js +77 -0
- package/src/lib/entities/attractap.entity.js.map +1 -1
- package/src/lib/entities/authenticationDetail.entity.d.ts +6 -0
- package/src/lib/entities/authenticationDetail.entity.js +55 -1
- package/src/lib/entities/authenticationDetail.entity.js.map +1 -1
- package/src/lib/entities/billing-transaction.entity.js +5 -1
- package/src/lib/entities/billing-transaction.entity.js.map +1 -1
- package/src/lib/entities/email-template.entity.d.ts +5 -1
- package/src/lib/entities/email-template.entity.js +4 -1
- package/src/lib/entities/email-template.entity.js.map +1 -1
- package/src/lib/entities/form.d.ts +56 -0
- package/src/lib/entities/form.js +201 -0
- package/src/lib/entities/form.js.map +1 -0
- package/src/lib/entities/mqttServer.entity.js +3 -0
- package/src/lib/entities/mqttServer.entity.js.map +1 -1
- package/src/lib/entities/password-history.entity.d.ts +8 -0
- package/src/lib/entities/password-history.entity.js +44 -0
- package/src/lib/entities/password-history.entity.js.map +1 -0
- package/src/lib/entities/password-policy-audit.entity.d.ts +19 -0
- package/src/lib/entities/password-policy-audit.entity.js +83 -0
- package/src/lib/entities/password-policy-audit.entity.js.map +1 -0
- package/src/lib/entities/password-policy-override.entity.d.ts +22 -0
- package/src/lib/entities/password-policy-override.entity.js +100 -0
- package/src/lib/entities/password-policy-override.entity.js.map +1 -0
- package/src/lib/entities/password-policy.entity.d.ts +19 -0
- package/src/lib/entities/password-policy.entity.js +94 -0
- package/src/lib/entities/password-policy.entity.js.map +1 -0
- package/src/lib/entities/project-invitation.entity.d.ts +23 -0
- package/src/lib/entities/project-invitation.entity.js +98 -0
- package/src/lib/entities/project-invitation.entity.js.map +1 -0
- package/src/lib/entities/project-member.entity.d.ts +14 -0
- package/src/lib/entities/project-member.entity.js +61 -0
- package/src/lib/entities/project-member.entity.js.map +1 -0
- package/src/lib/entities/project.d.ts +17 -0
- package/src/lib/entities/project.js +89 -0
- package/src/lib/entities/project.js.map +1 -0
- package/src/lib/entities/resource-maintenance-schedule-time-interval-config.entity.d.ts +14 -0
- package/src/lib/entities/resource-maintenance-schedule-time-interval-config.entity.js +54 -0
- package/src/lib/entities/resource-maintenance-schedule-time-interval-config.entity.js.map +1 -0
- package/src/lib/entities/resource-maintenance-schedule-usage-count-config.entity.d.ts +11 -0
- package/src/lib/entities/resource-maintenance-schedule-usage-count-config.entity.js +40 -0
- package/src/lib/entities/resource-maintenance-schedule-usage-count-config.entity.js.map +1 -0
- package/src/lib/entities/resource-maintenance-schedule-usage-hours-config.entity.d.ts +13 -0
- package/src/lib/entities/resource-maintenance-schedule-usage-hours-config.entity.js +53 -0
- package/src/lib/entities/resource-maintenance-schedule-usage-hours-config.entity.js.map +1 -0
- package/src/lib/entities/resource-maintenance-schedule.entity.d.ts +23 -0
- package/src/lib/entities/resource-maintenance-schedule.entity.js +99 -0
- package/src/lib/entities/resource-maintenance-schedule.entity.js.map +1 -0
- package/src/lib/entities/resource.entity.d.ts +7 -0
- package/src/lib/entities/resource.entity.js +32 -0
- package/src/lib/entities/resource.entity.js.map +1 -1
- package/src/lib/entities/resource.maintenance.d.ts +6 -0
- package/src/lib/entities/resource.maintenance.js +37 -0
- package/src/lib/entities/resource.maintenance.js.map +1 -1
- package/src/lib/entities/resourceFlowLog.js +1 -0
- package/src/lib/entities/resourceFlowLog.js.map +1 -1
- package/src/lib/entities/resourceFlowNode.d.ts +65 -50
- package/src/lib/entities/resourceFlowNode.js +88 -3
- package/src/lib/entities/resourceFlowNode.js.map +1 -1
- package/src/lib/entities/resourceFlowVariable.d.ts +17 -0
- package/src/lib/entities/resourceFlowVariable.js +66 -0
- package/src/lib/entities/resourceFlowVariable.js.map +1 -0
- package/src/lib/entities/resourceHealthState.entity.d.ts +22 -0
- package/src/lib/entities/resourceHealthState.entity.js +114 -0
- package/src/lib/entities/resourceHealthState.entity.js.map +1 -0
- package/src/lib/entities/resourceIntroductionHistoryItem.entity.js +1 -0
- package/src/lib/entities/resourceIntroductionHistoryItem.entity.js.map +1 -1
- package/src/lib/entities/resourceUsage.entity.d.ts +6 -0
- package/src/lib/entities/resourceUsage.entity.js +36 -0
- package/src/lib/entities/resourceUsage.entity.js.map +1 -1
- package/src/lib/entities/session.entity.js +3 -0
- package/src/lib/entities/session.entity.js.map +1 -1
- package/src/lib/entities/ssoProvider.entity.d.ts +5 -2
- package/src/lib/entities/ssoProvider.entity.js +12 -0
- package/src/lib/entities/ssoProvider.entity.js.map +1 -1
- package/src/lib/entities/ssoProvider.oidc.d.ts +2 -0
- package/src/lib/entities/ssoProvider.oidc.js +17 -2
- package/src/lib/entities/ssoProvider.oidc.js.map +1 -1
- package/src/lib/entities/ssoProvider.saml.d.ts +23 -0
- package/src/lib/entities/ssoProvider.saml.js +177 -0
- package/src/lib/entities/ssoProvider.saml.js.map +1 -0
- package/src/lib/entities/user.entity.d.ts +16 -0
- package/src/lib/entities/user.entity.js +77 -0
- package/src/lib/entities/user.entity.js.map +1 -1
- package/src/lib/entities-index.d.ts +35 -4
- package/src/lib/entities-index.js +74 -4
- package/src/lib/entities-index.js.map +1 -1
- package/src/lib/types/authenticationType.enum.d.ts +2 -1
- package/src/lib/types/authenticationType.enum.js +1 -0
- package/src/lib/types/authenticationType.enum.js.map +1 -1
- package/src/lib/types/usageDurationUnit.enum.d.ts +5 -0
- package/src/lib/types/usageDurationUnit.enum.js +10 -0
- package/src/lib/types/usageDurationUnit.enum.js.map +1 -0
- package/src/lib/entities/revokedToken.entity.d.ts +0 -5
- package/src/lib/entities/revokedToken.entity.js +0 -35
- package/src/lib/entities/revokedToken.entity.js.map +0 -1
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PasswordPolicy = exports.PASSWORD_POLICY_SINGLETON_ID = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
exports.PASSWORD_POLICY_SINGLETON_ID = 1;
|
|
8
|
+
let PasswordPolicy = class PasswordPolicy {
|
|
9
|
+
};
|
|
10
|
+
exports.PasswordPolicy = PasswordPolicy;
|
|
11
|
+
tslib_1.__decorate([
|
|
12
|
+
(0, typeorm_1.PrimaryColumn)({ type: 'integer' }),
|
|
13
|
+
(0, swagger_1.ApiProperty)({ description: 'Singleton row identifier', example: exports.PASSWORD_POLICY_SINGLETON_ID }),
|
|
14
|
+
tslib_1.__metadata("design:type", Number)
|
|
15
|
+
], PasswordPolicy.prototype, "id", void 0);
|
|
16
|
+
tslib_1.__decorate([
|
|
17
|
+
(0, typeorm_1.Column)({ type: 'integer', default: 12 }),
|
|
18
|
+
(0, swagger_1.ApiProperty)({ description: 'Minimum allowed password length', example: 12 }),
|
|
19
|
+
tslib_1.__metadata("design:type", Number)
|
|
20
|
+
], PasswordPolicy.prototype, "minLength", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ type: 'integer', default: 128 }),
|
|
23
|
+
(0, swagger_1.ApiProperty)({ description: 'Maximum allowed password length', example: 128 }),
|
|
24
|
+
tslib_1.__metadata("design:type", Number)
|
|
25
|
+
], PasswordPolicy.prototype, "maxLength", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
28
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether all Unicode characters are allowed', example: true }),
|
|
29
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
30
|
+
], PasswordPolicy.prototype, "allowAllUnicode", void 0);
|
|
31
|
+
tslib_1.__decorate([
|
|
32
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
33
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether at least one uppercase letter is required', example: false }),
|
|
34
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
35
|
+
], PasswordPolicy.prototype, "requireUppercase", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
38
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether at least one lowercase letter is required', example: false }),
|
|
39
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
40
|
+
], PasswordPolicy.prototype, "requireLowercase", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
43
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether at least one digit is required', example: false }),
|
|
44
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
45
|
+
], PasswordPolicy.prototype, "requireDigit", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: false }),
|
|
48
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether at least one special character is required', example: false }),
|
|
49
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
50
|
+
], PasswordPolicy.prototype, "requireSpecial", void 0);
|
|
51
|
+
tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
53
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether to check the password against the HIBP breach corpus', example: true }),
|
|
54
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
55
|
+
], PasswordPolicy.prototype, "checkHIBP", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'boolean', default: true }),
|
|
58
|
+
(0, swagger_1.ApiProperty)({ description: 'Whether to reject common passwords (top-10k list)', example: true }),
|
|
59
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
60
|
+
], PasswordPolicy.prototype, "checkCommonPasswords", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.Column)({ type: 'integer', default: 3 }),
|
|
63
|
+
(0, swagger_1.ApiProperty)({ description: 'Minimum required zxcvbn score (0-4)', example: 3 }),
|
|
64
|
+
tslib_1.__metadata("design:type", Number)
|
|
65
|
+
], PasswordPolicy.prototype, "minZxcvbnScore", void 0);
|
|
66
|
+
tslib_1.__decorate([
|
|
67
|
+
(0, typeorm_1.Column)({ type: 'integer', default: 0 }),
|
|
68
|
+
(0, swagger_1.ApiProperty)({ description: 'How many previous passwords to remember (0 disables)', example: 0 }),
|
|
69
|
+
tslib_1.__metadata("design:type", Number)
|
|
70
|
+
], PasswordPolicy.prototype, "historySize", void 0);
|
|
71
|
+
tslib_1.__decorate([
|
|
72
|
+
(0, typeorm_1.Column)({ type: 'integer', default: 0 }),
|
|
73
|
+
(0, swagger_1.ApiProperty)({ description: 'Forced rotation interval in days (0 disables)', example: 0 }),
|
|
74
|
+
tslib_1.__metadata("design:type", Number)
|
|
75
|
+
], PasswordPolicy.prototype, "rotationDays", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
78
|
+
(0, swagger_1.ApiProperty)({ description: 'When the policy record was created' }),
|
|
79
|
+
tslib_1.__metadata("design:type", Date)
|
|
80
|
+
], PasswordPolicy.prototype, "createdAt", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
83
|
+
(0, swagger_1.ApiProperty)({ description: 'When the policy record was last updated' }),
|
|
84
|
+
tslib_1.__metadata("design:type", Date)
|
|
85
|
+
], PasswordPolicy.prototype, "updatedAt", void 0);
|
|
86
|
+
tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.VersionColumn)(),
|
|
88
|
+
(0, swagger_1.ApiProperty)({ description: 'Row version for optimistic concurrency control', example: 1 }),
|
|
89
|
+
tslib_1.__metadata("design:type", Number)
|
|
90
|
+
], PasswordPolicy.prototype, "version", void 0);
|
|
91
|
+
exports.PasswordPolicy = PasswordPolicy = tslib_1.__decorate([
|
|
92
|
+
(0, typeorm_1.Entity)()
|
|
93
|
+
], PasswordPolicy);
|
|
94
|
+
//# sourceMappingURL=password-policy.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-policy.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/password-policy.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA2G;AAC3G,6CAA8C;AAEjC,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAGvC,IAAM,cAAc,GAApB,MAAM,cAAc;CAgE1B,CAAA;AAhEY,wCAAc;AAGzB;IAFC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAClC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,OAAO,EAAE,oCAA4B,EAAE,CAAC;;0CACpF;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;IACxC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;iDAC1D;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IACzC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;;iDAC3D;AAInB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC1C,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,4CAA4C,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;uDAChE;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C;IACvC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;sDACxD;AAIxB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACvC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,sDAAsD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;mDAC5E;AAIrB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACvC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+CAA+C,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;oDACpE;AAItB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,oCAAoC,EAAE,CAAC;sCACvD,IAAI;iDAAC;AAIjB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;sCAC5D,IAAI;iDAAC;AAIjB;IAFC,IAAA,uBAAa,GAAE;IACf,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gDAAgD,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+CAC1E;yBA/DN,cAAc;IAD1B,IAAA,gBAAM,GAAE;GACI,cAAc,CAgE1B"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Project } from './project';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
|
+
import { ProjectMemberRole } from './project-member.entity';
|
|
4
|
+
export declare enum ProjectInvitationStatus {
|
|
5
|
+
PENDING = "pending",
|
|
6
|
+
ACCEPTED = "accepted",
|
|
7
|
+
DECLINED = "declined",
|
|
8
|
+
CANCELED = "canceled"
|
|
9
|
+
}
|
|
10
|
+
export declare class ProjectInvitation {
|
|
11
|
+
id: number;
|
|
12
|
+
projectId: number;
|
|
13
|
+
project: Project;
|
|
14
|
+
inviterId: number;
|
|
15
|
+
inviter: User;
|
|
16
|
+
invitedUserId: number;
|
|
17
|
+
invitedUser: User;
|
|
18
|
+
status: ProjectInvitationStatus;
|
|
19
|
+
requestedRole: ProjectMemberRole;
|
|
20
|
+
respondedAt: Date | null;
|
|
21
|
+
createdAt: Date;
|
|
22
|
+
updatedAt: Date;
|
|
23
|
+
}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectInvitation = exports.ProjectInvitationStatus = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const project_1 = require("./project");
|
|
8
|
+
const user_entity_1 = require("./user.entity");
|
|
9
|
+
const project_member_entity_1 = require("./project-member.entity");
|
|
10
|
+
var ProjectInvitationStatus;
|
|
11
|
+
(function (ProjectInvitationStatus) {
|
|
12
|
+
ProjectInvitationStatus["PENDING"] = "pending";
|
|
13
|
+
ProjectInvitationStatus["ACCEPTED"] = "accepted";
|
|
14
|
+
ProjectInvitationStatus["DECLINED"] = "declined";
|
|
15
|
+
ProjectInvitationStatus["CANCELED"] = "canceled";
|
|
16
|
+
})(ProjectInvitationStatus || (exports.ProjectInvitationStatus = ProjectInvitationStatus = {}));
|
|
17
|
+
let ProjectInvitation = class ProjectInvitation {
|
|
18
|
+
};
|
|
19
|
+
exports.ProjectInvitation = ProjectInvitation;
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
22
|
+
(0, swagger_1.ApiProperty)({ description: 'Unique identifier of the project invitation' }),
|
|
23
|
+
tslib_1.__metadata("design:type", Number)
|
|
24
|
+
], ProjectInvitation.prototype, "id", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
27
|
+
(0, swagger_1.ApiProperty)({ description: 'Project ID for which the invitation was created' }),
|
|
28
|
+
tslib_1.__metadata("design:type", Number)
|
|
29
|
+
], ProjectInvitation.prototype, "projectId", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.ManyToOne)(() => project_1.Project, (project) => project.invitations, { onDelete: 'CASCADE' }),
|
|
32
|
+
(0, typeorm_1.JoinColumn)({ name: 'projectId' }),
|
|
33
|
+
(0, swagger_1.ApiProperty)({ description: 'Project for which the invitation was created', type: () => project_1.Project }),
|
|
34
|
+
tslib_1.__metadata("design:type", project_1.Project)
|
|
35
|
+
], ProjectInvitation.prototype, "project", void 0);
|
|
36
|
+
tslib_1.__decorate([
|
|
37
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
38
|
+
(0, swagger_1.ApiProperty)({ description: 'User ID that created the invitation' }),
|
|
39
|
+
tslib_1.__metadata("design:type", Number)
|
|
40
|
+
], ProjectInvitation.prototype, "inviterId", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.sentProjectInvitations, { onDelete: 'CASCADE' }),
|
|
43
|
+
(0, typeorm_1.JoinColumn)({ name: 'inviterId' }),
|
|
44
|
+
(0, swagger_1.ApiProperty)({ description: 'Inviter user', type: () => user_entity_1.User }),
|
|
45
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
46
|
+
], ProjectInvitation.prototype, "inviter", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
49
|
+
(0, swagger_1.ApiProperty)({ description: 'User ID that is being invited' }),
|
|
50
|
+
tslib_1.__metadata("design:type", Number)
|
|
51
|
+
], ProjectInvitation.prototype, "invitedUserId", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.receivedProjectInvitations, { onDelete: 'CASCADE' }),
|
|
54
|
+
(0, typeorm_1.JoinColumn)({ name: 'invitedUserId' }),
|
|
55
|
+
(0, swagger_1.ApiProperty)({ description: 'Invited user', type: () => user_entity_1.User }),
|
|
56
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
57
|
+
], ProjectInvitation.prototype, "invitedUser", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.Column)({ type: 'text', enum: ProjectInvitationStatus, default: ProjectInvitationStatus.PENDING }),
|
|
60
|
+
(0, swagger_1.ApiProperty)({
|
|
61
|
+
description: 'Current status of the invitation',
|
|
62
|
+
enum: ProjectInvitationStatus,
|
|
63
|
+
enumName: 'ProjectInvitationStatus',
|
|
64
|
+
}),
|
|
65
|
+
tslib_1.__metadata("design:type", String)
|
|
66
|
+
], ProjectInvitation.prototype, "status", void 0);
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
(0, typeorm_1.Column)({ type: 'text', enum: project_member_entity_1.ProjectMemberRole, default: project_member_entity_1.ProjectMemberRole.VIEWER }),
|
|
69
|
+
(0, swagger_1.ApiProperty)({
|
|
70
|
+
description: 'Role that should be granted upon acceptance',
|
|
71
|
+
enum: project_member_entity_1.ProjectMemberRole,
|
|
72
|
+
enumName: 'ProjectMemberRole',
|
|
73
|
+
}),
|
|
74
|
+
tslib_1.__metadata("design:type", String)
|
|
75
|
+
], ProjectInvitation.prototype, "requestedRole", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
78
|
+
(0, swagger_1.ApiProperty)({
|
|
79
|
+
description: 'Timestamp when the invitation was responded to (accept/decline/cancel)',
|
|
80
|
+
required: false,
|
|
81
|
+
}),
|
|
82
|
+
tslib_1.__metadata("design:type", Date)
|
|
83
|
+
], ProjectInvitation.prototype, "respondedAt", void 0);
|
|
84
|
+
tslib_1.__decorate([
|
|
85
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
86
|
+
(0, swagger_1.ApiProperty)({ description: 'When the invitation was created' }),
|
|
87
|
+
tslib_1.__metadata("design:type", Date)
|
|
88
|
+
], ProjectInvitation.prototype, "createdAt", void 0);
|
|
89
|
+
tslib_1.__decorate([
|
|
90
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
91
|
+
(0, swagger_1.ApiProperty)({ description: 'When the invitation was last updated' }),
|
|
92
|
+
tslib_1.__metadata("design:type", Date)
|
|
93
|
+
], ProjectInvitation.prototype, "updatedAt", void 0);
|
|
94
|
+
exports.ProjectInvitation = ProjectInvitation = tslib_1.__decorate([
|
|
95
|
+
(0, typeorm_1.Entity)('project_invitations'),
|
|
96
|
+
(0, typeorm_1.Index)('IDX_project_invitation_unique_by_user_and_status', ['invitedUserId', 'status'])
|
|
97
|
+
], ProjectInvitation);
|
|
98
|
+
//# sourceMappingURL=project-invitation.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-invitation.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/project-invitation.entity.ts"],"names":[],"mappings":";;;;AAAA,6CAA8C;AAC9C,qCASiB;AACjB,uCAAoC;AACpC,+CAAqC;AACrC,mEAA4D;AAE5D,IAAY,uBAKX;AALD,WAAY,uBAAuB;IACjC,8CAAmB,CAAA;IACnB,gDAAqB,CAAA;IACrB,gDAAqB,CAAA;IACrB,gDAAqB,CAAA;AACvB,CAAC,EALW,uBAAuB,uCAAvB,uBAAuB,QAKlC;AAIM,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;CA8D7B,CAAA;AA9DY,8CAAiB;AAG5B;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,6CAA6C,EAAE,CAAC;;6CAChE;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,I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,CAAC,CAAC;GAC1E,iBAAiB,CA8D7B"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Project } from './project';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
|
+
export declare enum ProjectMemberRole {
|
|
4
|
+
VIEWER = "viewer"
|
|
5
|
+
}
|
|
6
|
+
export declare class ProjectMember {
|
|
7
|
+
id: number;
|
|
8
|
+
projectId: number;
|
|
9
|
+
project: Project;
|
|
10
|
+
userId: number;
|
|
11
|
+
user: User;
|
|
12
|
+
role: ProjectMemberRole;
|
|
13
|
+
joinedAt: Date;
|
|
14
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProjectMember = exports.ProjectMemberRole = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const project_1 = require("./project");
|
|
8
|
+
const user_entity_1 = require("./user.entity");
|
|
9
|
+
var ProjectMemberRole;
|
|
10
|
+
(function (ProjectMemberRole) {
|
|
11
|
+
ProjectMemberRole["VIEWER"] = "viewer";
|
|
12
|
+
})(ProjectMemberRole || (exports.ProjectMemberRole = ProjectMemberRole = {}));
|
|
13
|
+
let ProjectMember = class ProjectMember {
|
|
14
|
+
};
|
|
15
|
+
exports.ProjectMember = ProjectMember;
|
|
16
|
+
tslib_1.__decorate([
|
|
17
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
18
|
+
(0, swagger_1.ApiProperty)({ description: 'Unique identifier of the project member' }),
|
|
19
|
+
tslib_1.__metadata("design:type", Number)
|
|
20
|
+
], ProjectMember.prototype, "id", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
23
|
+
(0, swagger_1.ApiProperty)({ description: 'Project ID the member belongs to' }),
|
|
24
|
+
tslib_1.__metadata("design:type", Number)
|
|
25
|
+
], ProjectMember.prototype, "projectId", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, typeorm_1.ManyToOne)(() => project_1.Project, (project) => project.members, { onDelete: 'CASCADE' }),
|
|
28
|
+
(0, typeorm_1.JoinColumn)({ name: 'projectId' }),
|
|
29
|
+
(0, swagger_1.ApiProperty)({ description: 'Project the member belongs to', type: () => project_1.Project }),
|
|
30
|
+
tslib_1.__metadata("design:type", project_1.Project)
|
|
31
|
+
], ProjectMember.prototype, "project", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
34
|
+
(0, swagger_1.ApiProperty)({ description: 'User ID of the member' }),
|
|
35
|
+
tslib_1.__metadata("design:type", Number)
|
|
36
|
+
], ProjectMember.prototype, "userId", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.projectMemberships, { onDelete: 'CASCADE' }),
|
|
39
|
+
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
40
|
+
(0, swagger_1.ApiProperty)({ description: 'User that belongs to the project', type: () => user_entity_1.User }),
|
|
41
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
42
|
+
], ProjectMember.prototype, "user", void 0);
|
|
43
|
+
tslib_1.__decorate([
|
|
44
|
+
(0, typeorm_1.Column)({ type: 'text', enum: ProjectMemberRole, default: ProjectMemberRole.VIEWER }),
|
|
45
|
+
(0, swagger_1.ApiProperty)({
|
|
46
|
+
description: 'Role of the member within the project',
|
|
47
|
+
enum: ProjectMemberRole,
|
|
48
|
+
enumName: 'ProjectMemberRole',
|
|
49
|
+
}),
|
|
50
|
+
tslib_1.__metadata("design:type", String)
|
|
51
|
+
], ProjectMember.prototype, "role", void 0);
|
|
52
|
+
tslib_1.__decorate([
|
|
53
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
54
|
+
(0, swagger_1.ApiProperty)({ description: 'When the membership started' }),
|
|
55
|
+
tslib_1.__metadata("design:type", Date)
|
|
56
|
+
], ProjectMember.prototype, "joinedAt", void 0);
|
|
57
|
+
exports.ProjectMember = ProjectMember = tslib_1.__decorate([
|
|
58
|
+
(0, typeorm_1.Entity)('project_members'),
|
|
59
|
+
(0, typeorm_1.Unique)(['projectId', 'userId'])
|
|
60
|
+
], ProjectMember);
|
|
61
|
+
//# sourceMappingURL=project-member.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project-member.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/project-member.entity.ts"],"names":[],"mappings":";;;;AAAA,6CAA8C;AAC9C,qCAAkH;AAClH,uCAAoC;AACpC,+CAAqC;AAErC,IAAY,iBAEX;AAFD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;AACnB,CAAC,EAFW,iBAAiB,iCAAjB,iBAAiB,QAE5B;AAIM,IAAM,aAAa,GAAnB,MAAM,aAAa;CAkCzB,CAAA;AAlCY,sCAAa;AAGxB;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yCAAyC,EAAE,CAAC;;yCAC5D;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kCAAkC,EAAE,CAAC;;gDAC9C;AAKnB;IAHC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,iBAAO,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC/E,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IACjC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,+BAA+B,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,iBAAO,EAAE,CAAC;sCACzE,iBAAO;8CAAC;AAIlB;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uBAAuB,EAAE,CAAC;;6CACtC;AAKhB;IAHC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACjF,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC9B,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kCAAkC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC;sCAC5E,kBAAI;2CAAC;AAQZ;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,iBAAiB,EAAE,OAAO,EAAE,iBAAiB,CAAC,MAAM,EAAE,CAAC;IACpF,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,uCAAuC;QACpD,IAAI,EAAE,iBAAiB;QACvB,QAAQ,EAAE,mBAAmB;KAC9B,CAAC;;2CACuB;AAIzB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,6BAA6B,EAAE,CAAC;sCACjD,IAAI;+CAAC;wBAjCL,aAAa;IAFzB,IAAA,gBAAM,EAAC,iBAAiB,CAAC;IACzB,IAAA,gBAAM,EAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;GACnB,aAAa,CAkCzB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
import { ResourceUsage } from './resourceUsage.entity';
|
|
3
|
+
import { ProjectMember } from './project-member.entity';
|
|
4
|
+
import { ProjectInvitation } from './project-invitation.entity';
|
|
5
|
+
export declare class Project {
|
|
6
|
+
id: number;
|
|
7
|
+
createdAt: Date;
|
|
8
|
+
updatedAt: Date;
|
|
9
|
+
archivedAt: Date | null;
|
|
10
|
+
owner: User;
|
|
11
|
+
name: string;
|
|
12
|
+
description: string | null;
|
|
13
|
+
logo: string | null;
|
|
14
|
+
resourceUsages: ResourceUsage[];
|
|
15
|
+
members: ProjectMember[];
|
|
16
|
+
invitations: ProjectInvitation[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Project = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
6
|
+
const typeorm_1 = require("typeorm");
|
|
7
|
+
const typeorm_2 = require("typeorm");
|
|
8
|
+
const user_entity_1 = require("./user.entity");
|
|
9
|
+
const resourceUsage_entity_1 = require("./resourceUsage.entity");
|
|
10
|
+
const project_member_entity_1 = require("./project-member.entity");
|
|
11
|
+
const project_invitation_entity_1 = require("./project-invitation.entity");
|
|
12
|
+
let Project = class Project {
|
|
13
|
+
};
|
|
14
|
+
exports.Project = Project;
|
|
15
|
+
tslib_1.__decorate([
|
|
16
|
+
(0, typeorm_2.PrimaryGeneratedColumn)(),
|
|
17
|
+
(0, swagger_1.ApiProperty)({ description: 'The ID of the project' }),
|
|
18
|
+
tslib_1.__metadata("design:type", Number)
|
|
19
|
+
], Project.prototype, "id", void 0);
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
22
|
+
(0, swagger_1.ApiProperty)({ description: 'The date and time the NFC card was created' }),
|
|
23
|
+
tslib_1.__metadata("design:type", Date)
|
|
24
|
+
], Project.prototype, "createdAt", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
27
|
+
(0, swagger_1.ApiProperty)({ description: 'The date and time the NFC card was last updated' }),
|
|
28
|
+
tslib_1.__metadata("design:type", Date)
|
|
29
|
+
], Project.prototype, "updatedAt", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({
|
|
32
|
+
type: 'datetime',
|
|
33
|
+
nullable: true,
|
|
34
|
+
}),
|
|
35
|
+
(0, swagger_1.ApiProperty)({
|
|
36
|
+
description: 'The date and time the project was archived',
|
|
37
|
+
required: false,
|
|
38
|
+
nullable: true,
|
|
39
|
+
}),
|
|
40
|
+
tslib_1.__metadata("design:type", Date)
|
|
41
|
+
], Project.prototype, "archivedAt", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.ownedProjects),
|
|
44
|
+
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
45
|
+
(0, swagger_1.ApiProperty)({ description: 'The ID of the user that owns the project', type: () => user_entity_1.User }),
|
|
46
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
47
|
+
], Project.prototype, "owner", void 0);
|
|
48
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({
|
|
50
|
+
type: 'text',
|
|
51
|
+
nullable: false,
|
|
52
|
+
}),
|
|
53
|
+
(0, swagger_1.ApiProperty)({ description: 'The name of the project' }),
|
|
54
|
+
tslib_1.__metadata("design:type", String)
|
|
55
|
+
], Project.prototype, "name", void 0);
|
|
56
|
+
tslib_1.__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({
|
|
58
|
+
type: 'text',
|
|
59
|
+
nullable: true,
|
|
60
|
+
}),
|
|
61
|
+
(0, swagger_1.ApiProperty)({ description: 'The description of the project' }),
|
|
62
|
+
tslib_1.__metadata("design:type", String)
|
|
63
|
+
], Project.prototype, "description", void 0);
|
|
64
|
+
tslib_1.__decorate([
|
|
65
|
+
(0, typeorm_1.Column)({
|
|
66
|
+
type: 'text',
|
|
67
|
+
nullable: true,
|
|
68
|
+
}),
|
|
69
|
+
(0, swagger_1.ApiProperty)({ description: 'The logo of the project' }),
|
|
70
|
+
tslib_1.__metadata("design:type", String)
|
|
71
|
+
], Project.prototype, "logo", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, typeorm_1.OneToMany)(() => resourceUsage_entity_1.ResourceUsage, (usage) => usage.project),
|
|
74
|
+
tslib_1.__metadata("design:type", Array)
|
|
75
|
+
], Project.prototype, "resourceUsages", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.OneToMany)(() => project_member_entity_1.ProjectMember, (member) => member.project),
|
|
78
|
+
(0, swagger_1.ApiProperty)({ description: 'Members that have access to the project', type: () => [project_member_entity_1.ProjectMember] }),
|
|
79
|
+
tslib_1.__metadata("design:type", Array)
|
|
80
|
+
], Project.prototype, "members", void 0);
|
|
81
|
+
tslib_1.__decorate([
|
|
82
|
+
(0, typeorm_1.OneToMany)(() => project_invitation_entity_1.ProjectInvitation, (invitation) => invitation.project),
|
|
83
|
+
(0, swagger_1.ApiProperty)({ description: 'Pending invitations for the project', type: () => [project_invitation_entity_1.ProjectInvitation] }),
|
|
84
|
+
tslib_1.__metadata("design:type", Array)
|
|
85
|
+
], Project.prototype, "invitations", void 0);
|
|
86
|
+
exports.Project = Project = tslib_1.__decorate([
|
|
87
|
+
(0, typeorm_1.Entity)()
|
|
88
|
+
], Project);
|
|
89
|
+
//# sourceMappingURL=project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/project.ts"],"names":[],"mappings":";;;;AAAA,6CAA8C;AAC9C,qCAA+G;AAC/G,qCAAiD;AACjD,+CAAqC;AACrC,iEAAuD;AACvD,mEAAwD;AACxD,2EAAgE;AAGzD,IAAM,OAAO,GAAb,MAAM,OAAO;CA4DnB,CAAA;AA5DY,0BAAO;AAGlB;IAFC,IAAA,gCAAs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QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yBAAyB,EAAE,CAAC;;qCACnC;AAGrB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oCAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC;;+CACxB;AAIjC;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,qCAAa,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC;IAC1D,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,yCAAyC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,qCAAa,CAAC,EAAE,CAAC;;wCAC3E;AAI1B;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,6CAAiB,EAAE,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;IACtE,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,qCAAqC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,6CAAiB,CAAC,EAAE,CAAC;;4CACnE;kBA3DvB,OAAO;IADnB,IAAA,gBAAM,GAAE;GACI,OAAO,CA4DnB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ResourceMaintenanceSchedule } from './resource-maintenance-schedule.entity';
|
|
2
|
+
import { UsageDurationUnit } from '../types/usageDurationUnit.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Config for TIME_INTERVAL trigger. Uses duration + unit (same as USAGE_HOURS).
|
|
5
|
+
* Trigger after N duration (in unit) has passed since baseline (wall-clock).
|
|
6
|
+
* Baseline = when last maintenance for this schedule was done.
|
|
7
|
+
*/
|
|
8
|
+
export declare class ResourceMaintenanceScheduleTimeIntervalConfig {
|
|
9
|
+
id: number;
|
|
10
|
+
scheduleId: number;
|
|
11
|
+
schedule: ResourceMaintenanceSchedule;
|
|
12
|
+
duration: number;
|
|
13
|
+
unit: UsageDurationUnit;
|
|
14
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceMaintenanceScheduleTimeIntervalConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const resource_maintenance_schedule_entity_1 = require("./resource-maintenance-schedule.entity");
|
|
8
|
+
const usageDurationUnit_enum_1 = require("../types/usageDurationUnit.enum");
|
|
9
|
+
/**
|
|
10
|
+
* Config for TIME_INTERVAL trigger. Uses duration + unit (same as USAGE_HOURS).
|
|
11
|
+
* Trigger after N duration (in unit) has passed since baseline (wall-clock).
|
|
12
|
+
* Baseline = when last maintenance for this schedule was done.
|
|
13
|
+
*/
|
|
14
|
+
let ResourceMaintenanceScheduleTimeIntervalConfig = class ResourceMaintenanceScheduleTimeIntervalConfig {
|
|
15
|
+
};
|
|
16
|
+
exports.ResourceMaintenanceScheduleTimeIntervalConfig = ResourceMaintenanceScheduleTimeIntervalConfig;
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
19
|
+
(0, swagger_1.ApiProperty)({ description: 'Unique identifier', example: 1 }),
|
|
20
|
+
tslib_1.__metadata("design:type", Number)
|
|
21
|
+
], ResourceMaintenanceScheduleTimeIntervalConfig.prototype, "id", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'int', unique: true }),
|
|
24
|
+
(0, swagger_1.ApiProperty)({ description: 'Schedule this config belongs to', example: 1 }),
|
|
25
|
+
tslib_1.__metadata("design:type", Number)
|
|
26
|
+
], ResourceMaintenanceScheduleTimeIntervalConfig.prototype, "scheduleId", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, typeorm_1.OneToOne)(() => resource_maintenance_schedule_entity_1.ResourceMaintenanceSchedule, (schedule) => schedule.timeIntervalConfig, {
|
|
29
|
+
onDelete: 'CASCADE',
|
|
30
|
+
}),
|
|
31
|
+
(0, typeorm_1.JoinColumn)({ name: 'scheduleId' }),
|
|
32
|
+
tslib_1.__metadata("design:type", resource_maintenance_schedule_entity_1.ResourceMaintenanceSchedule)
|
|
33
|
+
], ResourceMaintenanceScheduleTimeIntervalConfig.prototype, "schedule", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
36
|
+
(0, swagger_1.ApiProperty)({
|
|
37
|
+
description: 'Duration value (combined with unit)',
|
|
38
|
+
example: 30,
|
|
39
|
+
}),
|
|
40
|
+
tslib_1.__metadata("design:type", Number)
|
|
41
|
+
], ResourceMaintenanceScheduleTimeIntervalConfig.prototype, "duration", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ type: 'simple-enum', enum: usageDurationUnit_enum_1.UsageDurationUnit }),
|
|
44
|
+
(0, swagger_1.ApiProperty)({
|
|
45
|
+
description: 'Unit for duration (MINUTES, HOURS, or DAYS)',
|
|
46
|
+
enum: usageDurationUnit_enum_1.UsageDurationUnit,
|
|
47
|
+
enumName: 'UsageDurationUnit',
|
|
48
|
+
}),
|
|
49
|
+
tslib_1.__metadata("design:type", String)
|
|
50
|
+
], ResourceMaintenanceScheduleTimeIntervalConfig.prototype, "unit", void 0);
|
|
51
|
+
exports.ResourceMaintenanceScheduleTimeIntervalConfig = ResourceMaintenanceScheduleTimeIntervalConfig = tslib_1.__decorate([
|
|
52
|
+
(0, typeorm_1.Entity)()
|
|
53
|
+
], ResourceMaintenanceScheduleTimeIntervalConfig);
|
|
54
|
+
//# sourceMappingURL=resource-maintenance-schedule-time-interval-config.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-maintenance-schedule-time-interval-config.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resource-maintenance-schedule-time-interval-config.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAMiB;AACjB,6CAA8C;AAC9C,iGAAqF;AACrF,4EAAoE;AAEpE;;;;GAIG;AAEI,IAAM,6CAA6C,GAAnD,MAAM,6CAA6C;CA6BzD,CAAA;AA7BY,sGAA6C;AAGxD;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;yEAClD;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;iFACxD;AAMpB;IAJC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,kEAA2B,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,kBAAkB,EAAE;QACtF,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;sCACxB,kEAA2B;+EAAC;AAOvC;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACvB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,qCAAqC;QAClD,OAAO,EAAE,EAAE;KACZ,CAAC;;+EACgB;AAQlB;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,0CAAiB,EAAE,CAAC;IACxD,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,6CAA6C;QAC1D,IAAI,EAAE,0CAAiB;QACvB,QAAQ,EAAE,mBAAmB;KAC9B,CAAC;;2EACuB;wDA5Bd,6CAA6C;IADzD,IAAA,gBAAM,GAAE;GACI,6CAA6C,CA6BzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ResourceMaintenanceSchedule } from './resource-maintenance-schedule.entity';
|
|
2
|
+
/**
|
|
3
|
+
* Config for USAGE_COUNT trigger. Baseline is always the end of the last maintenance
|
|
4
|
+
* created by this schedule (when that maintenance was marked done).
|
|
5
|
+
*/
|
|
6
|
+
export declare class ResourceMaintenanceScheduleUsageCountConfig {
|
|
7
|
+
id: number;
|
|
8
|
+
scheduleId: number;
|
|
9
|
+
schedule: ResourceMaintenanceSchedule;
|
|
10
|
+
thresholdSessions: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceMaintenanceScheduleUsageCountConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const resource_maintenance_schedule_entity_1 = require("./resource-maintenance-schedule.entity");
|
|
8
|
+
/**
|
|
9
|
+
* Config for USAGE_COUNT trigger. Baseline is always the end of the last maintenance
|
|
10
|
+
* created by this schedule (when that maintenance was marked done).
|
|
11
|
+
*/
|
|
12
|
+
let ResourceMaintenanceScheduleUsageCountConfig = class ResourceMaintenanceScheduleUsageCountConfig {
|
|
13
|
+
};
|
|
14
|
+
exports.ResourceMaintenanceScheduleUsageCountConfig = ResourceMaintenanceScheduleUsageCountConfig;
|
|
15
|
+
tslib_1.__decorate([
|
|
16
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
17
|
+
(0, swagger_1.ApiProperty)({ description: 'Unique identifier', example: 1 }),
|
|
18
|
+
tslib_1.__metadata("design:type", Number)
|
|
19
|
+
], ResourceMaintenanceScheduleUsageCountConfig.prototype, "id", void 0);
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.Column)({ type: 'int', unique: true }),
|
|
22
|
+
(0, swagger_1.ApiProperty)({ description: 'Schedule this config belongs to', example: 1 }),
|
|
23
|
+
tslib_1.__metadata("design:type", Number)
|
|
24
|
+
], ResourceMaintenanceScheduleUsageCountConfig.prototype, "scheduleId", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.OneToOne)(() => resource_maintenance_schedule_entity_1.ResourceMaintenanceSchedule, (schedule) => schedule.usageCountConfig, {
|
|
27
|
+
onDelete: 'CASCADE',
|
|
28
|
+
}),
|
|
29
|
+
(0, typeorm_1.JoinColumn)({ name: 'scheduleId' }),
|
|
30
|
+
tslib_1.__metadata("design:type", resource_maintenance_schedule_entity_1.ResourceMaintenanceSchedule)
|
|
31
|
+
], ResourceMaintenanceScheduleUsageCountConfig.prototype, "schedule", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
34
|
+
(0, swagger_1.ApiProperty)({ description: 'Trigger after this many usage sessions (since last maintenance done for this schedule)', example: 50 }),
|
|
35
|
+
tslib_1.__metadata("design:type", Number)
|
|
36
|
+
], ResourceMaintenanceScheduleUsageCountConfig.prototype, "thresholdSessions", void 0);
|
|
37
|
+
exports.ResourceMaintenanceScheduleUsageCountConfig = ResourceMaintenanceScheduleUsageCountConfig = tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.Entity)()
|
|
39
|
+
], ResourceMaintenanceScheduleUsageCountConfig);
|
|
40
|
+
//# sourceMappingURL=resource-maintenance-schedule-usage-count-config.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-maintenance-schedule-usage-count-config.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resource-maintenance-schedule-usage-count-config.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAMiB;AACjB,6CAA8C;AAC9C,iGAAqF;AAErF;;;GAGG;AAEI,IAAM,2CAA2C,GAAjD,MAAM,2CAA2C;CAkBvD,CAAA;AAlBY,kGAA2C;AAGtD;IAFC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mBAAmB,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;uEAClD;AAIZ;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACrC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;+EACxD;AAMpB;IAJC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,kEAA2B,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,gBAAgB,EAAE;QACpF,QAAQ,EAAE,SAAS;KACpB,CAAC;IACD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;sCACxB,kEAA2B;6EAAC;AAIvC;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACvB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,wFAAwF,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC;;sFACzG;sDAjBhB,2CAA2C;IADvD,IAAA,gBAAM,GAAE;GACI,2CAA2C,CAkBvD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ResourceMaintenanceSchedule } from './resource-maintenance-schedule.entity';
|
|
2
|
+
import { UsageDurationUnit } from '../types/usageDurationUnit.enum';
|
|
3
|
+
/**
|
|
4
|
+
* Config for USAGE_HOURS trigger. Baseline is always the end of the last maintenance
|
|
5
|
+
* created by this schedule (when that maintenance was marked done).
|
|
6
|
+
*/
|
|
7
|
+
export declare class ResourceMaintenanceScheduleUsageHoursConfig {
|
|
8
|
+
id: number;
|
|
9
|
+
scheduleId: number;
|
|
10
|
+
schedule: ResourceMaintenanceSchedule;
|
|
11
|
+
duration: number;
|
|
12
|
+
unit: UsageDurationUnit;
|
|
13
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceMaintenanceScheduleUsageHoursConfig = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const resource_maintenance_schedule_entity_1 = require("./resource-maintenance-schedule.entity");
|
|
8
|
+
const usageDurationUnit_enum_1 = require("../types/usageDurationUnit.enum");
|
|
9
|
+
/**
|
|
10
|
+
* Config for USAGE_HOURS trigger. Baseline is always the end of the last maintenance
|
|
11
|
+
* created by this schedule (when that maintenance was marked done).
|
|
12
|
+
*/
|
|
13
|
+
let ResourceMaintenanceScheduleUsageHoursConfig = class ResourceMaintenanceScheduleUsageHoursConfig {
|
|
14
|
+
};
|
|
15
|
+
exports.ResourceMaintenanceScheduleUsageHoursConfig = ResourceMaintenanceScheduleUsageHoursConfig;
|
|
16
|
+
tslib_1.__decorate([
|
|
17
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
18
|
+
(0, swagger_1.ApiProperty)({ description: 'Unique identifier', example: 1 }),
|
|
19
|
+
tslib_1.__metadata("design:type", Number)
|
|
20
|
+
], ResourceMaintenanceScheduleUsageHoursConfig.prototype, "id", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ type: 'int', unique: true }),
|
|
23
|
+
(0, swagger_1.ApiProperty)({ description: 'Schedule this config belongs to', example: 1 }),
|
|
24
|
+
tslib_1.__metadata("design:type", Number)
|
|
25
|
+
], ResourceMaintenanceScheduleUsageHoursConfig.prototype, "scheduleId", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, typeorm_1.OneToOne)(() => resource_maintenance_schedule_entity_1.ResourceMaintenanceSchedule, (schedule) => schedule.usageHoursConfig, {
|
|
28
|
+
onDelete: 'CASCADE',
|
|
29
|
+
}),
|
|
30
|
+
(0, typeorm_1.JoinColumn)({ name: 'scheduleId' }),
|
|
31
|
+
tslib_1.__metadata("design:type", resource_maintenance_schedule_entity_1.ResourceMaintenanceSchedule)
|
|
32
|
+
], ResourceMaintenanceScheduleUsageHoursConfig.prototype, "schedule", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
35
|
+
(0, swagger_1.ApiProperty)({
|
|
36
|
+
description: 'Duration value (combined with unit) for usage threshold',
|
|
37
|
+
example: 100,
|
|
38
|
+
}),
|
|
39
|
+
tslib_1.__metadata("design:type", Number)
|
|
40
|
+
], ResourceMaintenanceScheduleUsageHoursConfig.prototype, "duration", void 0);
|
|
41
|
+
tslib_1.__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'simple-enum', enum: usageDurationUnit_enum_1.UsageDurationUnit }),
|
|
43
|
+
(0, swagger_1.ApiProperty)({
|
|
44
|
+
description: 'Unit for duration (MINUTES, HOURS, or DAYS)',
|
|
45
|
+
enum: usageDurationUnit_enum_1.UsageDurationUnit,
|
|
46
|
+
enumName: 'UsageDurationUnit',
|
|
47
|
+
}),
|
|
48
|
+
tslib_1.__metadata("design:type", String)
|
|
49
|
+
], ResourceMaintenanceScheduleUsageHoursConfig.prototype, "unit", void 0);
|
|
50
|
+
exports.ResourceMaintenanceScheduleUsageHoursConfig = ResourceMaintenanceScheduleUsageHoursConfig = tslib_1.__decorate([
|
|
51
|
+
(0, typeorm_1.Entity)()
|
|
52
|
+
], ResourceMaintenanceScheduleUsageHoursConfig);
|
|
53
|
+
//# sourceMappingURL=resource-maintenance-schedule-usage-hours-config.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-maintenance-schedule-usage-hours-config.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resource-maintenance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