@attraccess/database-entities 0.0.16 → 1.1.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/package.json +3 -4
- package/src/index.d.ts +2 -0
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/lib/entities/attractap.entity.d.ts +15 -0
- package/src/lib/entities/attractap.entity.js +87 -0
- package/src/lib/entities/attractap.entity.js.map +1 -0
- package/src/lib/entities/billing-transaction-item.entity.d.ts +11 -0
- package/src/lib/entities/billing-transaction-item.entity.js +65 -0
- package/src/lib/entities/billing-transaction-item.entity.js.map +1 -0
- package/src/lib/entities/billing-transaction.entity.d.ts +25 -0
- package/src/lib/entities/billing-transaction.entity.js +121 -0
- package/src/lib/entities/billing-transaction.entity.js.map +1 -0
- package/src/lib/entities/email-template.entity.d.ts +15 -0
- package/src/lib/entities/email-template.entity.js +61 -0
- package/src/lib/entities/email-template.entity.js.map +1 -0
- package/src/lib/entities/mqttServer.entity.d.ts +0 -2
- package/src/lib/entities/mqttServer.entity.js +0 -5
- package/src/lib/entities/mqttServer.entity.js.map +1 -1
- package/src/lib/entities/nfcCard.entity.d.ts +15 -0
- package/src/lib/entities/nfcCard.entity.js +76 -0
- package/src/lib/entities/nfcCard.entity.js.map +1 -0
- package/src/lib/entities/resource-billing-configuration.entity.d.ts +10 -0
- package/src/lib/entities/resource-billing-configuration.entity.js +52 -0
- package/src/lib/entities/resource-billing-configuration.entity.js.map +1 -0
- package/src/lib/entities/resource.entity.d.ts +23 -10
- package/src/lib/entities/resource.entity.js +96 -34
- package/src/lib/entities/resource.entity.js.map +1 -1
- package/src/lib/entities/resource.maintenance.d.ts +11 -0
- package/src/lib/entities/resource.maintenance.js +78 -0
- package/src/lib/entities/resource.maintenance.js.map +1 -0
- package/src/lib/entities/resource.type.d.ts +4 -0
- package/src/lib/entities/resource.type.js +9 -0
- package/src/lib/entities/resource.type.js.map +1 -0
- package/src/lib/entities/resourceFlowEdge.d.ts +12 -0
- package/src/lib/entities/resourceFlowEdge.js +86 -0
- package/src/lib/entities/resourceFlowEdge.js.map +1 -0
- package/src/lib/entities/resourceFlowLog.d.ts +18 -0
- package/src/lib/entities/resourceFlowLog.js +94 -0
- package/src/lib/entities/resourceFlowLog.js.map +1 -0
- package/src/lib/entities/resourceFlowNode.d.ts +142 -0
- package/src/lib/entities/resourceFlowNode.js +226 -0
- package/src/lib/entities/resourceFlowNode.js.map +1 -0
- package/src/lib/entities/resourceGroup.entity.d.ts +2 -2
- package/src/lib/entities/resourceGroup.entity.js +3 -3
- package/src/lib/entities/resourceGroup.entity.js.map +1 -1
- package/src/lib/entities/{resourceIntroductionUser.entity.d.ts → resourceIntroducer.entity.d.ts} +5 -4
- package/src/lib/entities/{resourceIntroductionUser.entity.js → resourceIntroducer.entity.js} +27 -17
- package/src/lib/entities/resourceIntroducer.entity.js.map +1 -0
- package/src/lib/entities/resourceIntroduction.entity.d.ts +2 -1
- package/src/lib/entities/resourceIntroduction.entity.js +14 -4
- package/src/lib/entities/resourceIntroduction.entity.js.map +1 -1
- package/src/lib/entities/resourceIntroductionHistoryItem.entity.d.ts +1 -1
- package/src/lib/entities/resourceIntroductionHistoryItem.entity.js +3 -3
- package/src/lib/entities/resourceIntroductionHistoryItem.entity.js.map +1 -1
- package/src/lib/entities/resourceUsage.entity.d.ts +4 -0
- package/src/lib/entities/resourceUsage.entity.js +24 -2
- package/src/lib/entities/resourceUsage.entity.js.map +1 -1
- package/src/lib/entities/resourceUsage.type.d.ts +6 -0
- package/src/lib/entities/resourceUsage.type.js +11 -0
- package/src/lib/entities/resourceUsage.type.js.map +1 -0
- package/src/lib/entities/revokedToken.entity.d.ts +0 -5
- package/src/lib/entities/revokedToken.entity.js +1 -29
- package/src/lib/entities/revokedToken.entity.js.map +1 -1
- package/src/lib/entities/session.entity.d.ts +12 -0
- package/src/lib/entities/session.entity.js +91 -0
- package/src/lib/entities/session.entity.js.map +1 -0
- package/src/lib/entities/setting.entity.d.ts +8 -0
- package/src/lib/entities/setting.entity.js +56 -0
- package/src/lib/entities/setting.entity.js.map +1 -0
- package/src/lib/entities/user.entity.d.ts +17 -4
- package/src/lib/entities/user.entity.js +79 -8
- package/src/lib/entities/user.entity.js.map +1 -1
- package/src/lib/entities-index.d.ts +30 -9
- package/src/lib/entities-index.js +58 -12
- package/src/lib/entities-index.js.map +1 -1
- package/src/lib/types/documentationType.enum.d.ts +7 -0
- package/src/lib/types/documentationType.enum.js +12 -0
- package/src/lib/types/documentationType.enum.js.map +1 -0
- package/src/lib/entities/mqttResourceConfig.entity.d.ts +0 -15
- package/src/lib/entities/mqttResourceConfig.entity.js +0 -95
- package/src/lib/entities/mqttResourceConfig.entity.js.map +0 -1
- package/src/lib/entities/resourceIntroductionUser.entity.js.map +0 -1
- package/src/lib/entities/webhookConfig.entity.d.ts +0 -20
- package/src/lib/entities/webhookConfig.entity.js +0 -148
- package/src/lib/entities/webhookConfig.entity.js.map +0 -1
|
@@ -9,7 +9,7 @@ const user_entity_1 = require("./user.entity");
|
|
|
9
9
|
var IntroductionHistoryAction;
|
|
10
10
|
(function (IntroductionHistoryAction) {
|
|
11
11
|
IntroductionHistoryAction["REVOKE"] = "revoke";
|
|
12
|
-
IntroductionHistoryAction["
|
|
12
|
+
IntroductionHistoryAction["GRANT"] = "grant";
|
|
13
13
|
})(IntroductionHistoryAction || (exports.IntroductionHistoryAction = IntroductionHistoryAction = {}));
|
|
14
14
|
let ResourceIntroductionHistoryItem = class ResourceIntroductionHistoryItem {
|
|
15
15
|
};
|
|
@@ -36,7 +36,7 @@ tslib_1.__decorate([
|
|
|
36
36
|
enum: IntroductionHistoryAction,
|
|
37
37
|
}),
|
|
38
38
|
(0, swagger_1.ApiProperty)({
|
|
39
|
-
description: 'The action performed (revoke or
|
|
39
|
+
description: 'The action performed (revoke or grant)',
|
|
40
40
|
enum: IntroductionHistoryAction,
|
|
41
41
|
example: IntroductionHistoryAction.REVOKE,
|
|
42
42
|
}),
|
|
@@ -68,7 +68,7 @@ tslib_1.__decorate([
|
|
|
68
68
|
tslib_1.__metadata("design:type", Date)
|
|
69
69
|
], ResourceIntroductionHistoryItem.prototype, "createdAt", void 0);
|
|
70
70
|
tslib_1.__decorate([
|
|
71
|
-
(0, typeorm_1.ManyToOne)(() => resourceIntroduction_entity_1.ResourceIntroduction, (introduction) => introduction.history),
|
|
71
|
+
(0, typeorm_1.ManyToOne)(() => resourceIntroduction_entity_1.ResourceIntroduction, (introduction) => introduction.history, { onDelete: 'CASCADE' }),
|
|
72
72
|
(0, typeorm_1.JoinColumn)({ name: 'introductionId' }),
|
|
73
73
|
tslib_1.__metadata("design:type", resourceIntroduction_entity_1.ResourceIntroduction)
|
|
74
74
|
], ResourceIntroductionHistoryItem.prototype, "introduction", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceIntroductionHistoryItem.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resourceIntroductionHistoryItem.entity.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"resourceIntroductionHistoryItem.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resourceIntroductionHistoryItem.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA0G;AAC1G,6CAA8C;AAC9C,+EAAqE;AACrE,+CAAqC;AAErC,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACnC,8CAAiB,CAAA;IACjB,4CAAe,CAAA;AACjB,CAAC,EAHW,yBAAyB,yCAAzB,yBAAyB,QAGpC;AAGM,IAAM,+BAA+B,GAArC,MAAM,+BAA+B;CA2D3C,CAAA;AA3DY,0EAA+B;AAM1C;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,yDAAyD;QACtE,OAAO,EAAE,CAAC;KACX,CAAC;;2DACU;AAOZ;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;I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AW,EAAC;QACX,WAAW,EAAE,mCAAmC;QAChD,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAI;KACjB,CAAC;sCACgB,kBAAI;wEAAC;0CA1DZ,+BAA+B;IAD3C,IAAA,gBAAM,GAAE;GACI,+BAA+B,CA2D3C"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { Resource } from './resource.entity';
|
|
2
2
|
import { User } from './user.entity';
|
|
3
|
+
import { ResourceUsageAction } from './resourceUsage.type';
|
|
4
|
+
import { BillingTransaction } from './billing-transaction.entity';
|
|
3
5
|
export declare class ResourceUsage {
|
|
4
6
|
id: number;
|
|
7
|
+
usageAction: ResourceUsageAction;
|
|
5
8
|
resourceId: number;
|
|
6
9
|
userId: number | null;
|
|
7
10
|
startTime: Date;
|
|
@@ -11,4 +14,5 @@ export declare class ResourceUsage {
|
|
|
11
14
|
resource: Resource;
|
|
12
15
|
user: User | null;
|
|
13
16
|
usageInMinutes: number;
|
|
17
|
+
billingTransaction: BillingTransaction | null;
|
|
14
18
|
}
|
|
@@ -6,6 +6,8 @@ const typeorm_1 = require("typeorm");
|
|
|
6
6
|
const swagger_1 = require("@nestjs/swagger");
|
|
7
7
|
const resource_entity_1 = require("./resource.entity");
|
|
8
8
|
const user_entity_1 = require("./user.entity");
|
|
9
|
+
const resourceUsage_type_1 = require("./resourceUsage.type");
|
|
10
|
+
const billing_transaction_entity_1 = require("./billing-transaction.entity");
|
|
9
11
|
let ResourceUsage = class ResourceUsage {
|
|
10
12
|
};
|
|
11
13
|
exports.ResourceUsage = ResourceUsage;
|
|
@@ -17,6 +19,15 @@ tslib_1.__decorate([
|
|
|
17
19
|
}),
|
|
18
20
|
tslib_1.__metadata("design:type", Number)
|
|
19
21
|
], ResourceUsage.prototype, "id", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'simple-enum', enum: resourceUsage_type_1.ResourceUsageAction }),
|
|
24
|
+
(0, swagger_1.ApiProperty)({
|
|
25
|
+
description: 'The type of usage',
|
|
26
|
+
example: resourceUsage_type_1.ResourceUsageAction.Usage,
|
|
27
|
+
enum: resourceUsage_type_1.ResourceUsageAction,
|
|
28
|
+
}),
|
|
29
|
+
tslib_1.__metadata("design:type", String)
|
|
30
|
+
], ResourceUsage.prototype, "usageAction", void 0);
|
|
20
31
|
tslib_1.__decorate([
|
|
21
32
|
(0, typeorm_1.Column)({
|
|
22
33
|
type: 'integer',
|
|
@@ -70,8 +81,13 @@ tslib_1.__decorate([
|
|
|
70
81
|
tslib_1.__metadata("design:type", String)
|
|
71
82
|
], ResourceUsage.prototype, "endNotes", void 0);
|
|
72
83
|
tslib_1.__decorate([
|
|
73
|
-
(0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource, (resource) => resource.usages),
|
|
84
|
+
(0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource, (resource) => resource.usages, { onDelete: 'CASCADE' }),
|
|
74
85
|
(0, typeorm_1.JoinColumn)({ name: 'resourceId' }),
|
|
86
|
+
(0, swagger_1.ApiProperty)({
|
|
87
|
+
description: 'The resource being used',
|
|
88
|
+
type: () => resource_entity_1.Resource,
|
|
89
|
+
required: false,
|
|
90
|
+
}),
|
|
75
91
|
tslib_1.__metadata("design:type", resource_entity_1.Resource)
|
|
76
92
|
], ResourceUsage.prototype, "resource", void 0);
|
|
77
93
|
tslib_1.__decorate([
|
|
@@ -79,7 +95,6 @@ tslib_1.__decorate([
|
|
|
79
95
|
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
80
96
|
(0, swagger_1.ApiProperty)({
|
|
81
97
|
description: 'The user who used the resource',
|
|
82
|
-
example: 1,
|
|
83
98
|
required: false,
|
|
84
99
|
type: () => user_entity_1.User,
|
|
85
100
|
}),
|
|
@@ -102,6 +117,13 @@ tslib_1.__decorate([
|
|
|
102
117
|
}),
|
|
103
118
|
tslib_1.__metadata("design:type", Number)
|
|
104
119
|
], ResourceUsage.prototype, "usageInMinutes", void 0);
|
|
120
|
+
tslib_1.__decorate([
|
|
121
|
+
(0, typeorm_1.OneToOne)(() => billing_transaction_entity_1.BillingTransaction, (billingTransaction) => billingTransaction.resourceUsage, {
|
|
122
|
+
onDelete: 'CASCADE',
|
|
123
|
+
nullable: true,
|
|
124
|
+
}),
|
|
125
|
+
tslib_1.__metadata("design:type", billing_transaction_entity_1.BillingTransaction)
|
|
126
|
+
], ResourceUsage.prototype, "billingTransaction", void 0);
|
|
105
127
|
exports.ResourceUsage = ResourceUsage = tslib_1.__decorate([
|
|
106
128
|
(0, typeorm_1.Entity)()
|
|
107
129
|
], ResourceUsage);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resourceUsage.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resourceUsage.entity.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"resourceUsage.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resourceUsage.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAoH;AACpH,6CAA8C;AAC9C,uDAA6C;AAC7C,+CAAqC;AACrC,6DAA2D;AAC3D,6EAAkE;AAG3D,IAAM,aAAa,GAAnB,MAAM,aAAa;CAqGzB,CAAA;AArGY,sCAAa;AAMxB;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE,CAAC;KACX,CAAC;;yCACU;AAQZ;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,wCAAmB,EAAE,CAAC;IAC1D,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,wCAAmB,CAAC,KAAK;QAClC,IAAI,EAAE,wCAAmB;KAC1B,CAAC;;kDACgC;AASlC;IAPC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;KAChB,CAAC;IACD,IAAA,qBA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Action;
|
|
5
|
+
(function (ResourceUsageAction) {
|
|
6
|
+
ResourceUsageAction["Usage"] = "usage";
|
|
7
|
+
ResourceUsageAction["DoorLock"] = "door.lock";
|
|
8
|
+
ResourceUsageAction["DoorUnlock"] = "door.unlock";
|
|
9
|
+
ResourceUsageAction["DoorUnlatch"] = "door.unlatch";
|
|
10
|
+
})(ResourceUsageAction || (exports.ResourceUsageAction = ResourceUsageAction = {}));
|
|
11
|
+
//# sourceMappingURL=resourceUsage.type.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceUsage.type.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resourceUsage.type.ts"],"names":[],"mappings":";;;AAAA,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC7B,sCAAe,CAAA;IACf,6CAAsB,CAAA;IACtB,iDAA0B,CAAA;IAC1B,mDAA4B,CAAA;AAC9B,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B"}
|
|
@@ -4,7 +4,6 @@ exports.RevokedToken = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const typeorm_1 = require("typeorm");
|
|
6
6
|
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
-
const user_entity_1 = require("./user.entity");
|
|
8
7
|
let RevokedToken = class RevokedToken {
|
|
9
8
|
};
|
|
10
9
|
exports.RevokedToken = RevokedToken;
|
|
@@ -16,35 +15,13 @@ tslib_1.__decorate([
|
|
|
16
15
|
}),
|
|
17
16
|
tslib_1.__metadata("design:type", Number)
|
|
18
17
|
], RevokedToken.prototype, "id", void 0);
|
|
19
|
-
tslib_1.__decorate([
|
|
20
|
-
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
21
|
-
(0, swagger_1.ApiProperty)({
|
|
22
|
-
description: 'The ID of the user who owned the token',
|
|
23
|
-
example: 1,
|
|
24
|
-
}),
|
|
25
|
-
tslib_1.__metadata("design:type", Number)
|
|
26
|
-
], RevokedToken.prototype, "userId", void 0);
|
|
27
18
|
tslib_1.__decorate([
|
|
28
19
|
(0, typeorm_1.Column)({ type: 'text' }),
|
|
29
20
|
(0, swagger_1.ApiProperty)({
|
|
30
|
-
description:
|
|
31
|
-
}),
|
|
32
|
-
tslib_1.__metadata("design:type", String)
|
|
33
|
-
], RevokedToken.prototype, "token", void 0);
|
|
34
|
-
tslib_1.__decorate([
|
|
35
|
-
(0, typeorm_1.Column)({ type: 'text' }),
|
|
36
|
-
(0, swagger_1.ApiProperty)({
|
|
37
|
-
description: 'The unique identifier of the token',
|
|
21
|
+
description: "The JWT token's ID that was revoked",
|
|
38
22
|
}),
|
|
39
23
|
tslib_1.__metadata("design:type", String)
|
|
40
24
|
], RevokedToken.prototype, "tokenId", void 0);
|
|
41
|
-
tslib_1.__decorate([
|
|
42
|
-
(0, typeorm_1.Column)({ type: 'datetime' }),
|
|
43
|
-
(0, swagger_1.ApiProperty)({
|
|
44
|
-
description: 'When the token expires',
|
|
45
|
-
}),
|
|
46
|
-
tslib_1.__metadata("design:type", Date)
|
|
47
|
-
], RevokedToken.prototype, "expiresAt", void 0);
|
|
48
25
|
tslib_1.__decorate([
|
|
49
26
|
(0, typeorm_1.CreateDateColumn)(),
|
|
50
27
|
(0, swagger_1.ApiProperty)({
|
|
@@ -52,11 +29,6 @@ tslib_1.__decorate([
|
|
|
52
29
|
}),
|
|
53
30
|
tslib_1.__metadata("design:type", Date)
|
|
54
31
|
], RevokedToken.prototype, "revokedAt", void 0);
|
|
55
|
-
tslib_1.__decorate([
|
|
56
|
-
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.revokedTokens),
|
|
57
|
-
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
58
|
-
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
59
|
-
], RevokedToken.prototype, "user", void 0);
|
|
60
32
|
exports.RevokedToken = RevokedToken = tslib_1.__decorate([
|
|
61
33
|
(0, typeorm_1.Entity)()
|
|
62
34
|
], RevokedToken);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revokedToken.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/revokedToken.entity.ts"],"names":[],"mappings":";;;;AAAA,
|
|
1
|
+
{"version":3,"file":"revokedToken.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/revokedToken.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAmF;AACnF,6CAA8C;AAGvC,IAAM,YAAY,GAAlB,MAAM,YAAY;CAmBxB,CAAA;AAnBY,oCAAY;AAMvB;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,CAAC;KACX,CAAC;;wCACU;AAMZ;IAJC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,qCAAqC;KACnD,CAAC;;6CACe;AAMjB;IAJC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,4BAA4B;KAC1C,CAAC;sCACU,IAAI;+CAAC;uBAlBN,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CAmBxB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { User } from './user.entity';
|
|
2
|
+
export declare class Session {
|
|
3
|
+
id: number;
|
|
4
|
+
token: string;
|
|
5
|
+
userId: number;
|
|
6
|
+
userAgent: string | null;
|
|
7
|
+
ipAddress: string | null;
|
|
8
|
+
expiresAt: Date;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
lastAccessedAt: Date;
|
|
11
|
+
user: User;
|
|
12
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Session = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const user_entity_1 = require("./user.entity");
|
|
8
|
+
let Session = class Session {
|
|
9
|
+
};
|
|
10
|
+
exports.Session = Session;
|
|
11
|
+
tslib_1.__decorate([
|
|
12
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
13
|
+
(0, swagger_1.ApiProperty)({
|
|
14
|
+
description: 'The unique identifier of the session',
|
|
15
|
+
example: 1,
|
|
16
|
+
}),
|
|
17
|
+
tslib_1.__metadata("design:type", Number)
|
|
18
|
+
], Session.prototype, "id", void 0);
|
|
19
|
+
tslib_1.__decorate([
|
|
20
|
+
(0, typeorm_1.Column)({ type: 'text', unique: true }),
|
|
21
|
+
(0, swagger_1.ApiProperty)({
|
|
22
|
+
description: 'The session token',
|
|
23
|
+
example: 'abc123def456...',
|
|
24
|
+
}),
|
|
25
|
+
tslib_1.__metadata("design:type", String)
|
|
26
|
+
], Session.prototype, "token", void 0);
|
|
27
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'int' }),
|
|
29
|
+
(0, swagger_1.ApiProperty)({
|
|
30
|
+
description: 'The ID of the user this session belongs to',
|
|
31
|
+
example: 1,
|
|
32
|
+
}),
|
|
33
|
+
tslib_1.__metadata("design:type", Number)
|
|
34
|
+
], Session.prototype, "userId", void 0);
|
|
35
|
+
tslib_1.__decorate([
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
37
|
+
(0, swagger_1.ApiProperty)({
|
|
38
|
+
description: 'The user agent string from the request that created this session',
|
|
39
|
+
example: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
|
|
40
|
+
nullable: true,
|
|
41
|
+
}),
|
|
42
|
+
tslib_1.__metadata("design:type", String)
|
|
43
|
+
], Session.prototype, "userAgent", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
46
|
+
(0, swagger_1.ApiProperty)({
|
|
47
|
+
description: 'The IP address from the request that created this session',
|
|
48
|
+
example: '192.168.1.100',
|
|
49
|
+
nullable: true,
|
|
50
|
+
}),
|
|
51
|
+
tslib_1.__metadata("design:type", String)
|
|
52
|
+
], Session.prototype, "ipAddress", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ type: 'datetime' }),
|
|
55
|
+
(0, swagger_1.ApiProperty)({
|
|
56
|
+
description: 'When this session expires',
|
|
57
|
+
example: '2025-01-19T12:00:00.000Z',
|
|
58
|
+
}),
|
|
59
|
+
tslib_1.__metadata("design:type", Date)
|
|
60
|
+
], Session.prototype, "expiresAt", void 0);
|
|
61
|
+
tslib_1.__decorate([
|
|
62
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
63
|
+
(0, swagger_1.ApiProperty)({
|
|
64
|
+
description: 'When this session was created',
|
|
65
|
+
example: '2025-01-18T12:00:00.000Z',
|
|
66
|
+
}),
|
|
67
|
+
tslib_1.__metadata("design:type", Date)
|
|
68
|
+
], Session.prototype, "createdAt", void 0);
|
|
69
|
+
tslib_1.__decorate([
|
|
70
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
71
|
+
(0, swagger_1.ApiProperty)({
|
|
72
|
+
description: 'When this session was last accessed',
|
|
73
|
+
example: '2025-01-18T12:30:00.000Z',
|
|
74
|
+
}),
|
|
75
|
+
tslib_1.__metadata("design:type", Date)
|
|
76
|
+
], Session.prototype, "lastAccessedAt", void 0);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, { onDelete: 'CASCADE' }),
|
|
79
|
+
(0, swagger_1.ApiProperty)({
|
|
80
|
+
description: 'The user this session belongs to',
|
|
81
|
+
type: () => user_entity_1.User,
|
|
82
|
+
}),
|
|
83
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
84
|
+
], Session.prototype, "user", void 0);
|
|
85
|
+
exports.Session = Session = tslib_1.__decorate([
|
|
86
|
+
(0, typeorm_1.Entity)(),
|
|
87
|
+
(0, typeorm_1.Index)(['token'], { unique: true }),
|
|
88
|
+
(0, typeorm_1.Index)(['userId']),
|
|
89
|
+
(0, typeorm_1.Index)(['expiresAt'])
|
|
90
|
+
], Session);
|
|
91
|
+
//# sourceMappingURL=session.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/session.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAuH;AACvH,6CAA8C;AAC9C,+CAAqC;AAM9B,IAAM,OAAO,GAAb,MAAM,OAAO;CAiEnB,CAAA;AAjEY,0BAAO;AAMlB;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,sCAAsC;QACnD,OAAO,EAAE,CAAC;KACX,CAAC;;mCACU;AAOZ;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACtC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,mBAAmB;QAChC,OAAO,EAAE,iBAAiB;KAC3B,CAAC;;sCACa;AAOf;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACvB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,CAAC;KACX,CAAC;;uCACc;AAQhB;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,kEAAkE;QAC/E,OAAO,EAAE,8DAA8D;QACvE,QAAQ,EAAE,IAAI;KACf,CAAC;;0CACwB;AAQ1B;IANC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,2DAA2D;QACxE,OAAO,EAAE,eAAe;QACxB,QAAQ,EAAE,IAAI;KACf,CAAC;;0CACwB;AAO1B;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,2BAA2B;QACxC,OAAO,EAAE,0BAA0B;KACpC,CAAC;sCACU,IAAI;0CAAC;AAOjB;IALC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,+BAA+B;QAC5C,OAAO,EAAE,0BAA0B;KACpC,CAAC;sCACU,IAAI;0CAAC;AAOjB;IALC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,qCAAqC;QAClD,OAAO,EAAE,0BAA0B;KACpC,CAAC;sCACe,IAAI;+CAAC;AAOtB;IALC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IAC9C,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,kCAAkC;QAC/C,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAI;KACjB,CAAC;sCACK,kBAAI;qCAAC;kBAhED,OAAO;IAJnB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IAClC,IAAA,eAAK,EAAC,CAAC,QAAQ,CAAC,CAAC;IACjB,IAAA,eAAK,EAAC,CAAC,WAAW,CAAC,CAAC;GACR,OAAO,CAiEnB"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Setting = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
let Setting = class Setting {
|
|
8
|
+
};
|
|
9
|
+
exports.Setting = Setting;
|
|
10
|
+
tslib_1.__decorate([
|
|
11
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
12
|
+
(0, swagger_1.ApiProperty)({
|
|
13
|
+
description: 'The unique identifier of the setting',
|
|
14
|
+
example: 1,
|
|
15
|
+
}),
|
|
16
|
+
tslib_1.__metadata("design:type", Number)
|
|
17
|
+
], Setting.prototype, "id", void 0);
|
|
18
|
+
tslib_1.__decorate([
|
|
19
|
+
(0, typeorm_1.Column)({
|
|
20
|
+
type: 'text',
|
|
21
|
+
nullable: false,
|
|
22
|
+
}),
|
|
23
|
+
(0, swagger_1.ApiProperty)({ description: 'The parent "object" this settings key belongs to' }),
|
|
24
|
+
tslib_1.__metadata("design:type", String)
|
|
25
|
+
], Setting.prototype, "parent", void 0);
|
|
26
|
+
tslib_1.__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({
|
|
28
|
+
type: 'text',
|
|
29
|
+
nullable: false,
|
|
30
|
+
}),
|
|
31
|
+
(0, swagger_1.ApiProperty)({ description: 'The key of the setting' }),
|
|
32
|
+
tslib_1.__metadata("design:type", String)
|
|
33
|
+
], Setting.prototype, "key", void 0);
|
|
34
|
+
tslib_1.__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({
|
|
36
|
+
type: 'text',
|
|
37
|
+
nullable: false,
|
|
38
|
+
}),
|
|
39
|
+
(0, swagger_1.ApiProperty)({ description: 'The value of the setting' }),
|
|
40
|
+
tslib_1.__metadata("design:type", String)
|
|
41
|
+
], Setting.prototype, "value", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
44
|
+
(0, swagger_1.ApiProperty)({ description: 'The date and time the setting was created' }),
|
|
45
|
+
tslib_1.__metadata("design:type", Date)
|
|
46
|
+
], Setting.prototype, "createdAt", void 0);
|
|
47
|
+
tslib_1.__decorate([
|
|
48
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
49
|
+
(0, swagger_1.ApiProperty)({ description: 'The date and time the setting was last updated' }),
|
|
50
|
+
tslib_1.__metadata("design:type", Date)
|
|
51
|
+
], Setting.prototype, "updatedAt", void 0);
|
|
52
|
+
exports.Setting = Setting = tslib_1.__decorate([
|
|
53
|
+
(0, typeorm_1.Entity)(),
|
|
54
|
+
(0, typeorm_1.Unique)('settings_identifier', ['parent', 'key'])
|
|
55
|
+
], Setting);
|
|
56
|
+
//# sourceMappingURL=setting.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setting.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/setting.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA6G;AAC7G,6CAA8C;AAIvC,IAAM,OAAO,GAAb,MAAM,OAAO;CAoCnB,CAAA;AApCY,0BAAO;AAMlB;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,sCAAsC;QACnD,OAAO,EAAE,CAAC;KACX,CAAC;;mCACU;AAOZ;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kDAAkD,EAAE,CAAC;;uCAC1D;AAOvB;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,wBAAwB,EAAE,CAAC;;oCAC1C;AAOb;IALC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,0BAA0B,EAAE,CAAC;;sCAC1C;AAIf;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,2CAA2C,EAAE,CAAC;sCAC9D,IAAI;0CAAC;AAIjB;IAFC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,gDAAgD,EAAE,CAAC;sCACnE,IAAI;0CAAC;kBAnCN,OAAO;IAFnB,IAAA,gBAAM,GAAE;IACR,IAAA,gBAAM,EAAC,qBAAqB,EAAE,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;GACpC,OAAO,CAoCnB"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import { ResourceIntroduction } from './resourceIntroduction.entity';
|
|
2
2
|
import { ResourceUsage } from './resourceUsage.entity';
|
|
3
|
-
import { RevokedToken } from './revokedToken.entity';
|
|
4
3
|
import { AuthenticationDetail } from './authenticationDetail.entity';
|
|
5
|
-
import {
|
|
4
|
+
import { ResourceIntroducer } from './resourceIntroducer.entity';
|
|
5
|
+
import { NFCCard } from './nfcCard.entity';
|
|
6
|
+
import { Session } from './session.entity';
|
|
7
|
+
import { BillingTransaction } from './billing-transaction.entity';
|
|
6
8
|
export declare class SystemPermissions {
|
|
7
9
|
canManageResources: boolean;
|
|
8
10
|
canManageSystemConfiguration: boolean;
|
|
9
11
|
canManageUsers: boolean;
|
|
12
|
+
canManageBilling: boolean;
|
|
10
13
|
}
|
|
11
14
|
export type SystemPermission = keyof SystemPermissions;
|
|
12
15
|
export declare class User {
|
|
@@ -16,12 +19,22 @@ export declare class User {
|
|
|
16
19
|
isEmailVerified: boolean;
|
|
17
20
|
emailVerificationToken: string | null;
|
|
18
21
|
emailVerificationTokenExpiresAt: Date | null;
|
|
22
|
+
passwordResetToken: string | null;
|
|
23
|
+
passwordResetTokenExpiresAt: Date | null;
|
|
19
24
|
systemPermissions: SystemPermissions;
|
|
20
25
|
createdAt: Date;
|
|
21
26
|
updatedAt: Date;
|
|
27
|
+
lastUsernameChangeAt: Date | null;
|
|
22
28
|
resourceIntroductions: ResourceIntroduction[];
|
|
23
29
|
resourceUsages: ResourceUsage[];
|
|
24
|
-
revokedTokens: RevokedToken[];
|
|
25
30
|
authenticationDetails: AuthenticationDetail[];
|
|
26
|
-
resourceIntroducerPermissions:
|
|
31
|
+
resourceIntroducerPermissions: ResourceIntroducer[];
|
|
32
|
+
externalIdentifier: string | null;
|
|
33
|
+
nfcCards: NFCCard[];
|
|
34
|
+
nfcKeySeedToken: string | null;
|
|
35
|
+
sessions: Session[];
|
|
36
|
+
billingTransactions: BillingTransaction[];
|
|
37
|
+
initiatedBillingTransactions: BillingTransaction[];
|
|
38
|
+
creditBalance: number;
|
|
39
|
+
billingFactor: number;
|
|
27
40
|
}
|
|
@@ -7,9 +7,11 @@ const swagger_1 = require("@nestjs/swagger");
|
|
|
7
7
|
const class_transformer_1 = require("class-transformer");
|
|
8
8
|
const resourceIntroduction_entity_1 = require("./resourceIntroduction.entity");
|
|
9
9
|
const resourceUsage_entity_1 = require("./resourceUsage.entity");
|
|
10
|
-
const revokedToken_entity_1 = require("./revokedToken.entity");
|
|
11
10
|
const authenticationDetail_entity_1 = require("./authenticationDetail.entity");
|
|
12
|
-
const
|
|
11
|
+
const resourceIntroducer_entity_1 = require("./resourceIntroducer.entity");
|
|
12
|
+
const nfcCard_entity_1 = require("./nfcCard.entity");
|
|
13
|
+
const session_entity_1 = require("./session.entity");
|
|
14
|
+
const billing_transaction_entity_1 = require("./billing-transaction.entity");
|
|
13
15
|
class SystemPermissions {
|
|
14
16
|
}
|
|
15
17
|
exports.SystemPermissions = SystemPermissions;
|
|
@@ -37,6 +39,14 @@ tslib_1.__decorate([
|
|
|
37
39
|
}),
|
|
38
40
|
tslib_1.__metadata("design:type", Boolean)
|
|
39
41
|
], SystemPermissions.prototype, "canManageUsers", void 0);
|
|
42
|
+
tslib_1.__decorate([
|
|
43
|
+
(0, typeorm_1.Column)({ default: false, type: 'boolean' }),
|
|
44
|
+
(0, swagger_1.ApiProperty)({
|
|
45
|
+
description: 'Whether the user can manage billing',
|
|
46
|
+
example: false,
|
|
47
|
+
}),
|
|
48
|
+
tslib_1.__metadata("design:type", Boolean)
|
|
49
|
+
], SystemPermissions.prototype, "canManageBilling", void 0);
|
|
40
50
|
let User = class User {
|
|
41
51
|
};
|
|
42
52
|
exports.User = User;
|
|
@@ -82,6 +92,16 @@ tslib_1.__decorate([
|
|
|
82
92
|
(0, class_transformer_1.Exclude)(),
|
|
83
93
|
tslib_1.__metadata("design:type", Date)
|
|
84
94
|
], User.prototype, "emailVerificationTokenExpiresAt", void 0);
|
|
95
|
+
tslib_1.__decorate([
|
|
96
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
97
|
+
(0, class_transformer_1.Exclude)(),
|
|
98
|
+
tslib_1.__metadata("design:type", String)
|
|
99
|
+
], User.prototype, "passwordResetToken", void 0);
|
|
100
|
+
tslib_1.__decorate([
|
|
101
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
102
|
+
(0, class_transformer_1.Exclude)(),
|
|
103
|
+
tslib_1.__metadata("design:type", Date)
|
|
104
|
+
], User.prototype, "passwordResetTokenExpiresAt", void 0);
|
|
85
105
|
tslib_1.__decorate([
|
|
86
106
|
(0, typeorm_1.Column)(() => SystemPermissions, { prefix: '' }),
|
|
87
107
|
(0, swagger_1.ApiProperty)({
|
|
@@ -108,6 +128,11 @@ tslib_1.__decorate([
|
|
|
108
128
|
}),
|
|
109
129
|
tslib_1.__metadata("design:type", Date)
|
|
110
130
|
], User.prototype, "updatedAt", void 0);
|
|
131
|
+
tslib_1.__decorate([
|
|
132
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
133
|
+
(0, class_transformer_1.Exclude)(),
|
|
134
|
+
tslib_1.__metadata("design:type", Date)
|
|
135
|
+
], User.prototype, "lastUsernameChangeAt", void 0);
|
|
111
136
|
tslib_1.__decorate([
|
|
112
137
|
(0, typeorm_1.OneToMany)(() => resourceIntroduction_entity_1.ResourceIntroduction, (introduction) => introduction.receiverUser, {
|
|
113
138
|
onDelete: 'CASCADE',
|
|
@@ -121,23 +146,69 @@ tslib_1.__decorate([
|
|
|
121
146
|
tslib_1.__metadata("design:type", Array)
|
|
122
147
|
], User.prototype, "resourceUsages", void 0);
|
|
123
148
|
tslib_1.__decorate([
|
|
124
|
-
(0, typeorm_1.OneToMany)(() =>
|
|
149
|
+
(0, typeorm_1.OneToMany)(() => authenticationDetail_entity_1.AuthenticationDetail, (detail) => detail.user, {
|
|
125
150
|
onDelete: 'CASCADE',
|
|
126
151
|
}),
|
|
127
152
|
tslib_1.__metadata("design:type", Array)
|
|
128
|
-
], User.prototype, "
|
|
153
|
+
], User.prototype, "authenticationDetails", void 0);
|
|
129
154
|
tslib_1.__decorate([
|
|
130
|
-
(0, typeorm_1.OneToMany)(() =>
|
|
155
|
+
(0, typeorm_1.OneToMany)(() => resourceIntroducer_entity_1.ResourceIntroducer, (introducer) => introducer.user, {
|
|
131
156
|
onDelete: 'CASCADE',
|
|
132
157
|
}),
|
|
133
158
|
tslib_1.__metadata("design:type", Array)
|
|
134
|
-
], User.prototype, "
|
|
159
|
+
], User.prototype, "resourceIntroducerPermissions", void 0);
|
|
135
160
|
tslib_1.__decorate([
|
|
136
|
-
(0, typeorm_1.
|
|
161
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
162
|
+
(0, swagger_1.ApiProperty)({
|
|
163
|
+
description: 'The external (origin) identifier of the user, if the user is authenticated via SSO',
|
|
164
|
+
example: '1234567890',
|
|
165
|
+
nullable: true,
|
|
166
|
+
required: false,
|
|
167
|
+
}),
|
|
168
|
+
tslib_1.__metadata("design:type", String)
|
|
169
|
+
], User.prototype, "externalIdentifier", void 0);
|
|
170
|
+
tslib_1.__decorate([
|
|
171
|
+
(0, typeorm_1.OneToMany)(() => nfcCard_entity_1.NFCCard, (card) => card.user, {
|
|
137
172
|
onDelete: 'CASCADE',
|
|
138
173
|
}),
|
|
139
174
|
tslib_1.__metadata("design:type", Array)
|
|
140
|
-
], User.prototype, "
|
|
175
|
+
], User.prototype, "nfcCards", void 0);
|
|
176
|
+
tslib_1.__decorate([
|
|
177
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
178
|
+
(0, class_transformer_1.Exclude)(),
|
|
179
|
+
tslib_1.__metadata("design:type", String)
|
|
180
|
+
], User.prototype, "nfcKeySeedToken", void 0);
|
|
181
|
+
tslib_1.__decorate([
|
|
182
|
+
(0, typeorm_1.OneToMany)(() => session_entity_1.Session, (session) => session.user, {
|
|
183
|
+
onDelete: 'CASCADE',
|
|
184
|
+
}),
|
|
185
|
+
tslib_1.__metadata("design:type", Array)
|
|
186
|
+
], User.prototype, "sessions", void 0);
|
|
187
|
+
tslib_1.__decorate([
|
|
188
|
+
(0, typeorm_1.OneToMany)(() => billing_transaction_entity_1.BillingTransaction, (transaction) => transaction.user, {
|
|
189
|
+
onDelete: 'CASCADE',
|
|
190
|
+
}),
|
|
191
|
+
tslib_1.__metadata("design:type", Array)
|
|
192
|
+
], User.prototype, "billingTransactions", void 0);
|
|
193
|
+
tslib_1.__decorate([
|
|
194
|
+
(0, typeorm_1.OneToMany)(() => billing_transaction_entity_1.BillingTransaction, (transaction) => transaction.initiator, {
|
|
195
|
+
onDelete: 'CASCADE',
|
|
196
|
+
}),
|
|
197
|
+
tslib_1.__metadata("design:type", Array)
|
|
198
|
+
], User.prototype, "initiatedBillingTransactions", void 0);
|
|
199
|
+
tslib_1.__decorate([
|
|
200
|
+
(0, typeorm_1.Column)({ type: 'integer', default: 0 }),
|
|
201
|
+
(0, swagger_1.ApiProperty)({ description: 'The credit balance of the user' }),
|
|
202
|
+
tslib_1.__metadata("design:type", Number)
|
|
203
|
+
], User.prototype, "creditBalance", void 0);
|
|
204
|
+
tslib_1.__decorate([
|
|
205
|
+
(0, typeorm_1.Column)({ type: 'integer', default: 100 }),
|
|
206
|
+
(0, swagger_1.ApiProperty)({
|
|
207
|
+
description: 'The percentage rate the user to actually pay for activities that cost credits',
|
|
208
|
+
example: 100,
|
|
209
|
+
}),
|
|
210
|
+
tslib_1.__metadata("design:type", Number)
|
|
211
|
+
], User.prototype, "billingFactor", void 0);
|
|
141
212
|
exports.User = User = tslib_1.__decorate([
|
|
142
213
|
(0, typeorm_1.Entity)()
|
|
143
214
|
], User);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/user.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAgH;AAChH,6CAA8C;AAC9C,yDAA4C;AAC5C,+EAAqE;AACrE,iEAAuD;AACvD,+
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/user.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAgH;AAChH,6CAA8C;AAC9C,yDAA4C;AAC5C,+EAAqE;AACrE,iEAAuD;AACvD,+EAAqE;AACrE,2EAAiE;AACjE,qDAA2C;AAC3C,qDAA2C;AAC3C,6EAAkE;AAElE,MAAa,iBAAiB;CA4B7B;AA5BD,8CA4BC;AAtBC;IALC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3C,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,KAAK;KACf,CAAC;;6DAC2B;AAO7B;IALC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3C,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,kDAAkD;QAC/D,OAAO,EAAE,KAAK;KACf,CAAC;;uEACqC;AAOvC;IALC,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3C,IAAA,qBAAW,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