@attraccess/database-entities 0.0.9
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/README.md +11 -0
- package/package.json +26 -0
- package/src/index.d.ts +2 -0
- package/src/index.js +6 -0
- package/src/index.js.map +1 -0
- package/src/lib/entities/authenticationDetail.entity.d.ts +9 -0
- package/src/lib/entities/authenticationDetail.entity.js +58 -0
- package/src/lib/entities/authenticationDetail.entity.js.map +1 -0
- package/src/lib/entities/mqttResourceConfig.entity.d.ts +15 -0
- package/src/lib/entities/mqttResourceConfig.entity.js +95 -0
- package/src/lib/entities/mqttResourceConfig.entity.js.map +1 -0
- package/src/lib/entities/mqttServer.entity.d.ts +14 -0
- package/src/lib/entities/mqttServer.entity.js +99 -0
- package/src/lib/entities/mqttServer.entity.js.map +1 -0
- package/src/lib/entities/resource.entity.d.ts +24 -0
- package/src/lib/entities/resource.entity.js +120 -0
- package/src/lib/entities/resource.entity.js.map +1 -0
- package/src/lib/entities/resourceGroup.entity.d.ts +13 -0
- package/src/lib/entities/resourceGroup.entity.js +67 -0
- package/src/lib/entities/resourceGroup.entity.js.map +1 -0
- package/src/lib/entities/resourceIntroduction.entity.d.ts +17 -0
- package/src/lib/entities/resourceIntroduction.entity.js +101 -0
- package/src/lib/entities/resourceIntroduction.entity.js.map +1 -0
- package/src/lib/entities/resourceIntroductionHistoryItem.entity.d.ts +16 -0
- package/src/lib/entities/resourceIntroductionHistoryItem.entity.js +87 -0
- package/src/lib/entities/resourceIntroductionHistoryItem.entity.js.map +1 -0
- package/src/lib/entities/resourceIntroductionUser.entity.d.ts +12 -0
- package/src/lib/entities/resourceIntroductionUser.entity.js +66 -0
- package/src/lib/entities/resourceIntroductionUser.entity.js.map +1 -0
- package/src/lib/entities/resourceUsage.entity.d.ts +14 -0
- package/src/lib/entities/resourceUsage.entity.js +108 -0
- package/src/lib/entities/resourceUsage.entity.js.map +1 -0
- package/src/lib/entities/revokedToken.entity.d.ts +10 -0
- package/src/lib/entities/revokedToken.entity.js +63 -0
- package/src/lib/entities/revokedToken.entity.js.map +1 -0
- package/src/lib/entities/ssoProvider.entity.d.ts +12 -0
- package/src/lib/entities/ssoProvider.entity.js +71 -0
- package/src/lib/entities/ssoProvider.entity.js.map +1 -0
- package/src/lib/entities/ssoProvider.oidc.d.ts +14 -0
- package/src/lib/entities/ssoProvider.oidc.js +97 -0
- package/src/lib/entities/ssoProvider.oidc.js.map +1 -0
- package/src/lib/entities/user.entity.d.ts +27 -0
- package/src/lib/entities/user.entity.js +144 -0
- package/src/lib/entities/user.entity.js.map +1 -0
- package/src/lib/entities/webhookConfig.entity.d.ts +20 -0
- package/src/lib/entities/webhookConfig.entity.js +148 -0
- package/src/lib/entities/webhookConfig.entity.js.map +1 -0
- package/src/lib/entities-index.d.ts +32 -0
- package/src/lib/entities-index.js +55 -0
- package/src/lib/entities-index.js.map +1 -0
- package/src/lib/types/authenticationType.enum.d.ts +4 -0
- package/src/lib/types/authenticationType.enum.js +9 -0
- package/src/lib/types/authenticationType.enum.js.map +1 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceIntroduction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const resource_entity_1 = require("./resource.entity");
|
|
8
|
+
const user_entity_1 = require("./user.entity");
|
|
9
|
+
const resourceIntroductionHistoryItem_entity_1 = require("./resourceIntroductionHistoryItem.entity");
|
|
10
|
+
const resourceGroup_entity_1 = require("./resourceGroup.entity");
|
|
11
|
+
let ResourceIntroduction = class ResourceIntroduction {
|
|
12
|
+
};
|
|
13
|
+
exports.ResourceIntroduction = ResourceIntroduction;
|
|
14
|
+
tslib_1.__decorate([
|
|
15
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
16
|
+
(0, swagger_1.ApiProperty)({
|
|
17
|
+
description: 'The unique identifier of the introduction',
|
|
18
|
+
example: 1,
|
|
19
|
+
}),
|
|
20
|
+
tslib_1.__metadata("design:type", Number)
|
|
21
|
+
], ResourceIntroduction.prototype, "id", void 0);
|
|
22
|
+
tslib_1.__decorate([
|
|
23
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
24
|
+
(0, swagger_1.ApiProperty)({
|
|
25
|
+
description: 'The ID of the resource',
|
|
26
|
+
example: 1,
|
|
27
|
+
}),
|
|
28
|
+
tslib_1.__metadata("design:type", Number)
|
|
29
|
+
], ResourceIntroduction.prototype, "resourceId", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
32
|
+
(0, swagger_1.ApiProperty)({
|
|
33
|
+
description: 'The ID of the user who received the introduction',
|
|
34
|
+
example: 1,
|
|
35
|
+
}),
|
|
36
|
+
tslib_1.__metadata("design:type", Number)
|
|
37
|
+
], ResourceIntroduction.prototype, "receiverUserId", void 0);
|
|
38
|
+
tslib_1.__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ nullable: true, type: 'integer' }),
|
|
40
|
+
(0, swagger_1.ApiProperty)({
|
|
41
|
+
description: 'The ID of the user who tutored the receiver',
|
|
42
|
+
example: 2,
|
|
43
|
+
}),
|
|
44
|
+
tslib_1.__metadata("design:type", Number)
|
|
45
|
+
], ResourceIntroduction.prototype, "tutorUserId", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'datetime', default: () => "datetime('now')" }),
|
|
48
|
+
(0, swagger_1.ApiProperty)({
|
|
49
|
+
description: 'When the introduction was completed',
|
|
50
|
+
example: '2021-01-01T00:00:00.000Z',
|
|
51
|
+
}),
|
|
52
|
+
tslib_1.__metadata("design:type", Date)
|
|
53
|
+
], ResourceIntroduction.prototype, "completedAt", void 0);
|
|
54
|
+
tslib_1.__decorate([
|
|
55
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
56
|
+
(0, swagger_1.ApiProperty)({
|
|
57
|
+
description: 'When the introduction record was created',
|
|
58
|
+
example: '2021-01-01T00:00:00.000Z',
|
|
59
|
+
}),
|
|
60
|
+
tslib_1.__metadata("design:type", Date)
|
|
61
|
+
], ResourceIntroduction.prototype, "createdAt", void 0);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource, (resource) => resource.introductions),
|
|
64
|
+
(0, typeorm_1.JoinColumn)({ name: 'resourceId' }),
|
|
65
|
+
tslib_1.__metadata("design:type", resource_entity_1.Resource)
|
|
66
|
+
], ResourceIntroduction.prototype, "resource", void 0);
|
|
67
|
+
tslib_1.__decorate([
|
|
68
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.resourceIntroductions),
|
|
69
|
+
(0, typeorm_1.JoinColumn)({ name: 'receiverUserId' }),
|
|
70
|
+
(0, swagger_1.ApiProperty)({
|
|
71
|
+
description: 'The user who received the introduction',
|
|
72
|
+
type: () => user_entity_1.User,
|
|
73
|
+
}),
|
|
74
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
75
|
+
], ResourceIntroduction.prototype, "receiverUser", void 0);
|
|
76
|
+
tslib_1.__decorate([
|
|
77
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
78
|
+
(0, typeorm_1.JoinColumn)({ name: 'tutorUserId' }),
|
|
79
|
+
(0, swagger_1.ApiProperty)({
|
|
80
|
+
description: 'The user who tutored the receiver',
|
|
81
|
+
type: () => user_entity_1.User,
|
|
82
|
+
}),
|
|
83
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
84
|
+
], ResourceIntroduction.prototype, "tutorUser", void 0);
|
|
85
|
+
tslib_1.__decorate([
|
|
86
|
+
(0, typeorm_1.OneToMany)(() => resourceIntroductionHistoryItem_entity_1.ResourceIntroductionHistoryItem, (history) => history.introduction),
|
|
87
|
+
(0, swagger_1.ApiProperty)({
|
|
88
|
+
description: 'History of revoke/unrevoke actions for this introduction',
|
|
89
|
+
type: () => [resourceIntroductionHistoryItem_entity_1.ResourceIntroductionHistoryItem],
|
|
90
|
+
}),
|
|
91
|
+
tslib_1.__metadata("design:type", Array)
|
|
92
|
+
], ResourceIntroduction.prototype, "history", void 0);
|
|
93
|
+
tslib_1.__decorate([
|
|
94
|
+
(0, typeorm_1.ManyToOne)(() => resourceGroup_entity_1.ResourceGroup, (group) => group.introductions),
|
|
95
|
+
(0, typeorm_1.JoinColumn)({ name: 'resourceGroupId' }),
|
|
96
|
+
tslib_1.__metadata("design:type", resourceGroup_entity_1.ResourceGroup)
|
|
97
|
+
], ResourceIntroduction.prototype, "resourceGroup", void 0);
|
|
98
|
+
exports.ResourceIntroduction = ResourceIntroduction = tslib_1.__decorate([
|
|
99
|
+
(0, typeorm_1.Entity)()
|
|
100
|
+
], ResourceIntroduction);
|
|
101
|
+
//# sourceMappingURL=resourceIntroduction.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceIntroduction.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resourceIntroduction.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAAqH;AACrH,6CAA8C;AAC9C,uDAA6C;AAC7C,+CAAqC;AACrC,qGAA2F;AAC3F,iEAAuD;AAGhD,IAAM,oBAAoB,GAA1B,MAAM,oBAAoB;CAyEhC,CAAA;AAzEY,oDAAoB;AAM/B;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,2CAA2C;QACxD,OAAO,EAAE,CAAC;KACX,CAAC;;gDACU;AAOZ;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,wBAAwB;QACrC,OAAO,EAAE,CAAC;KACX,CAAC;;w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DAAC;AAQpB;IANC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;IACrB,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;IACnC,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,mCAAmC;QAChD,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAI;KACjB,CAAC;sCACU,kBAAI;uDAAC;AAOjB;IALC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,wEAA+B,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC;IACnF,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,0DAA0D;QACvE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,wEAA+B,CAAC;KAC9C,CAAC;;qDAC0C;AAI5C;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oCAAa,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;IAC9D,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;sCACxB,oCAAa;2DAAC;+BAxEnB,oBAAoB;IADhC,IAAA,gBAAM,GAAE;GACI,oBAAoB,CAyEhC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ResourceIntroduction } from './resourceIntroduction.entity';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
|
+
export declare enum IntroductionHistoryAction {
|
|
4
|
+
REVOKE = "revoke",
|
|
5
|
+
UNREVOKE = "unrevoke"
|
|
6
|
+
}
|
|
7
|
+
export declare class ResourceIntroductionHistoryItem {
|
|
8
|
+
id: number;
|
|
9
|
+
introductionId: number;
|
|
10
|
+
action: IntroductionHistoryAction;
|
|
11
|
+
performedByUserId: number;
|
|
12
|
+
comment: string | null;
|
|
13
|
+
createdAt: Date;
|
|
14
|
+
introduction: ResourceIntroduction;
|
|
15
|
+
performedByUser: User;
|
|
16
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceIntroductionHistoryItem = exports.IntroductionHistoryAction = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const resourceIntroduction_entity_1 = require("./resourceIntroduction.entity");
|
|
8
|
+
const user_entity_1 = require("./user.entity");
|
|
9
|
+
var IntroductionHistoryAction;
|
|
10
|
+
(function (IntroductionHistoryAction) {
|
|
11
|
+
IntroductionHistoryAction["REVOKE"] = "revoke";
|
|
12
|
+
IntroductionHistoryAction["UNREVOKE"] = "unrevoke";
|
|
13
|
+
})(IntroductionHistoryAction || (exports.IntroductionHistoryAction = IntroductionHistoryAction = {}));
|
|
14
|
+
let ResourceIntroductionHistoryItem = class ResourceIntroductionHistoryItem {
|
|
15
|
+
};
|
|
16
|
+
exports.ResourceIntroductionHistoryItem = ResourceIntroductionHistoryItem;
|
|
17
|
+
tslib_1.__decorate([
|
|
18
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
19
|
+
(0, swagger_1.ApiProperty)({
|
|
20
|
+
description: 'The unique identifier of the introduction history entry',
|
|
21
|
+
example: 1,
|
|
22
|
+
}),
|
|
23
|
+
tslib_1.__metadata("design:type", Number)
|
|
24
|
+
], ResourceIntroductionHistoryItem.prototype, "id", void 0);
|
|
25
|
+
tslib_1.__decorate([
|
|
26
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
27
|
+
(0, swagger_1.ApiProperty)({
|
|
28
|
+
description: 'The ID of the related introduction',
|
|
29
|
+
example: 1,
|
|
30
|
+
}),
|
|
31
|
+
tslib_1.__metadata("design:type", Number)
|
|
32
|
+
], ResourceIntroductionHistoryItem.prototype, "introductionId", void 0);
|
|
33
|
+
tslib_1.__decorate([
|
|
34
|
+
(0, typeorm_1.Column)({
|
|
35
|
+
type: 'simple-enum',
|
|
36
|
+
enum: IntroductionHistoryAction,
|
|
37
|
+
}),
|
|
38
|
+
(0, swagger_1.ApiProperty)({
|
|
39
|
+
description: 'The action performed (revoke or unrevoke)',
|
|
40
|
+
enum: IntroductionHistoryAction,
|
|
41
|
+
example: IntroductionHistoryAction.REVOKE,
|
|
42
|
+
}),
|
|
43
|
+
tslib_1.__metadata("design:type", String)
|
|
44
|
+
], ResourceIntroductionHistoryItem.prototype, "action", void 0);
|
|
45
|
+
tslib_1.__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
47
|
+
(0, swagger_1.ApiProperty)({
|
|
48
|
+
description: 'The ID of the user who performed the action',
|
|
49
|
+
example: 1,
|
|
50
|
+
}),
|
|
51
|
+
tslib_1.__metadata("design:type", Number)
|
|
52
|
+
], ResourceIntroductionHistoryItem.prototype, "performedByUserId", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
55
|
+
(0, swagger_1.ApiProperty)({
|
|
56
|
+
description: 'Optional comment explaining the reason for the action',
|
|
57
|
+
example: 'User no longer requires access to this resource',
|
|
58
|
+
required: false,
|
|
59
|
+
}),
|
|
60
|
+
tslib_1.__metadata("design:type", String)
|
|
61
|
+
], ResourceIntroductionHistoryItem.prototype, "comment", void 0);
|
|
62
|
+
tslib_1.__decorate([
|
|
63
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
64
|
+
(0, swagger_1.ApiProperty)({
|
|
65
|
+
description: 'When the action was performed',
|
|
66
|
+
example: '2021-01-01T00:00:00.000Z',
|
|
67
|
+
}),
|
|
68
|
+
tslib_1.__metadata("design:type", Date)
|
|
69
|
+
], ResourceIntroductionHistoryItem.prototype, "createdAt", void 0);
|
|
70
|
+
tslib_1.__decorate([
|
|
71
|
+
(0, typeorm_1.ManyToOne)(() => resourceIntroduction_entity_1.ResourceIntroduction, (introduction) => introduction.history),
|
|
72
|
+
(0, typeorm_1.JoinColumn)({ name: 'introductionId' }),
|
|
73
|
+
tslib_1.__metadata("design:type", resourceIntroduction_entity_1.ResourceIntroduction)
|
|
74
|
+
], ResourceIntroductionHistoryItem.prototype, "introduction", void 0);
|
|
75
|
+
tslib_1.__decorate([
|
|
76
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
77
|
+
(0, typeorm_1.JoinColumn)({ name: 'performedByUserId' }),
|
|
78
|
+
(0, swagger_1.ApiProperty)({
|
|
79
|
+
description: 'The user who performed the action',
|
|
80
|
+
type: () => user_entity_1.User,
|
|
81
|
+
}),
|
|
82
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
83
|
+
], ResourceIntroductionHistoryItem.prototype, "performedByUser", void 0);
|
|
84
|
+
exports.ResourceIntroductionHistoryItem = ResourceIntroductionHistoryItem = tslib_1.__decorate([
|
|
85
|
+
(0, typeorm_1.Entity)()
|
|
86
|
+
], ResourceIntroductionHistoryItem);
|
|
87
|
+
//# sourceMappingURL=resourceIntroductionHistoryItem.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceIntroductionHistoryItem.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resourceIntroductionHistoryItem.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAOiB;AACjB,6CAA8C;AAC9C,+EAAqE;AACrE,+CAAqC;AAErC,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACnC,8CAAiB,CAAA;IACjB,kDAAqB,CAAA;AACvB,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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AAA,qBAAW,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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Resource } from './resource.entity';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
|
+
import { ResourceGroup } from './resourceGroup.entity';
|
|
4
|
+
export declare class ResourceIntroductionUser {
|
|
5
|
+
id: number;
|
|
6
|
+
resourceId: number;
|
|
7
|
+
userId: number;
|
|
8
|
+
grantedAt: Date;
|
|
9
|
+
resource: Resource;
|
|
10
|
+
user: User;
|
|
11
|
+
resourceGroup: ResourceGroup;
|
|
12
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceIntroductionUser = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const resource_entity_1 = require("./resource.entity");
|
|
8
|
+
const user_entity_1 = require("./user.entity");
|
|
9
|
+
const resourceGroup_entity_1 = require("./resourceGroup.entity");
|
|
10
|
+
let ResourceIntroductionUser = class ResourceIntroductionUser {
|
|
11
|
+
};
|
|
12
|
+
exports.ResourceIntroductionUser = ResourceIntroductionUser;
|
|
13
|
+
tslib_1.__decorate([
|
|
14
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
15
|
+
(0, swagger_1.ApiProperty)({
|
|
16
|
+
description: 'The unique identifier of the introduction permission',
|
|
17
|
+
example: 1,
|
|
18
|
+
}),
|
|
19
|
+
tslib_1.__metadata("design:type", Number)
|
|
20
|
+
], ResourceIntroductionUser.prototype, "id", void 0);
|
|
21
|
+
tslib_1.__decorate([
|
|
22
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
23
|
+
(0, swagger_1.ApiProperty)({
|
|
24
|
+
description: 'The ID of the resource',
|
|
25
|
+
example: 1,
|
|
26
|
+
}),
|
|
27
|
+
tslib_1.__metadata("design:type", Number)
|
|
28
|
+
], ResourceIntroductionUser.prototype, "resourceId", void 0);
|
|
29
|
+
tslib_1.__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'integer' }),
|
|
31
|
+
(0, swagger_1.ApiProperty)({
|
|
32
|
+
description: 'The ID of the user who can give introductions',
|
|
33
|
+
example: 1,
|
|
34
|
+
}),
|
|
35
|
+
tslib_1.__metadata("design:type", Number)
|
|
36
|
+
], ResourceIntroductionUser.prototype, "userId", void 0);
|
|
37
|
+
tslib_1.__decorate([
|
|
38
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
39
|
+
(0, swagger_1.ApiProperty)({
|
|
40
|
+
description: 'When the permission was granted',
|
|
41
|
+
}),
|
|
42
|
+
tslib_1.__metadata("design:type", Date)
|
|
43
|
+
], ResourceIntroductionUser.prototype, "grantedAt", void 0);
|
|
44
|
+
tslib_1.__decorate([
|
|
45
|
+
(0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource),
|
|
46
|
+
(0, typeorm_1.JoinColumn)({ name: 'resourceId' }),
|
|
47
|
+
tslib_1.__metadata("design:type", resource_entity_1.Resource)
|
|
48
|
+
], ResourceIntroductionUser.prototype, "resource", void 0);
|
|
49
|
+
tslib_1.__decorate([
|
|
50
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User),
|
|
51
|
+
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
52
|
+
(0, swagger_1.ApiProperty)({
|
|
53
|
+
description: 'The user who can give introductions',
|
|
54
|
+
type: () => user_entity_1.User,
|
|
55
|
+
}),
|
|
56
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
57
|
+
], ResourceIntroductionUser.prototype, "user", void 0);
|
|
58
|
+
tslib_1.__decorate([
|
|
59
|
+
(0, typeorm_1.ManyToOne)(() => resourceGroup_entity_1.ResourceGroup),
|
|
60
|
+
(0, typeorm_1.JoinColumn)({ name: 'resourceGroupId' }),
|
|
61
|
+
tslib_1.__metadata("design:type", resourceGroup_entity_1.ResourceGroup)
|
|
62
|
+
], ResourceIntroductionUser.prototype, "resourceGroup", void 0);
|
|
63
|
+
exports.ResourceIntroductionUser = ResourceIntroductionUser = tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Entity)()
|
|
65
|
+
], ResourceIntroductionUser);
|
|
66
|
+
//# sourceMappingURL=resourceIntroductionUser.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceIntroductionUser.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resourceIntroductionUser.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA0G;AAC1G,6CAA8C;AAC9C,uDAA6C;AAC7C,+CAAqC;AACrC,iEAAuD;AAGhD,IAAM,wBAAwB,GAA9B,MAAM,wBAAwB;CA2CpC,CAAA;AA3CY,4DAAwB;AAMnC;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,sDAAsD;QACnE,OAAO,EAAE,CAAC;KACX,CAAC;;oDACU;AAOZ;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,wBAAwB;QACrC,OAAO,EAAE,CAAC;KACX,CAAC;;4DACkB;AAOpB;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,+CAA+C;QAC5D,OAAO,EAAE,CAAC;KACX,CAAC;;wDACc;AAMhB;IAJC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,iCAAiC;KAC/C,CAAC;sCACU,IAAI;2DAAC;AAIjB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAQ,CAAC;IACzB,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;sCACxB,0BAAQ;0DAAC;AAQpB;IANC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,CAAC;IACrB,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC9B,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,qCAAqC;QAClD,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAI;KACjB,CAAC;sCACK,kBAAI;sDAAC;AAIZ;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oCAAa,CAAC;IAC9B,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;sCACxB,oCAAa;+DAAC;mCA1CnB,wBAAwB;IADpC,IAAA,gBAAM,GAAE;GACI,wBAAwB,CA2CpC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Resource } from './resource.entity';
|
|
2
|
+
import { User } from './user.entity';
|
|
3
|
+
export declare class ResourceUsage {
|
|
4
|
+
id: number;
|
|
5
|
+
resourceId: number;
|
|
6
|
+
userId: number | null;
|
|
7
|
+
startTime: Date;
|
|
8
|
+
startNotes: string | null;
|
|
9
|
+
endTime: Date | null;
|
|
10
|
+
endNotes: string | null;
|
|
11
|
+
resource: Resource;
|
|
12
|
+
user: User | null;
|
|
13
|
+
usageInMinutes: number;
|
|
14
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ResourceUsage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const resource_entity_1 = require("./resource.entity");
|
|
8
|
+
const user_entity_1 = require("./user.entity");
|
|
9
|
+
let ResourceUsage = class ResourceUsage {
|
|
10
|
+
};
|
|
11
|
+
exports.ResourceUsage = ResourceUsage;
|
|
12
|
+
tslib_1.__decorate([
|
|
13
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
14
|
+
(0, swagger_1.ApiProperty)({
|
|
15
|
+
description: 'The unique identifier of the resource usage',
|
|
16
|
+
example: 1,
|
|
17
|
+
}),
|
|
18
|
+
tslib_1.__metadata("design:type", Number)
|
|
19
|
+
], ResourceUsage.prototype, "id", void 0);
|
|
20
|
+
tslib_1.__decorate([
|
|
21
|
+
(0, typeorm_1.Column)({
|
|
22
|
+
type: 'integer',
|
|
23
|
+
}),
|
|
24
|
+
(0, swagger_1.ApiProperty)({
|
|
25
|
+
description: 'The ID of the resource being used',
|
|
26
|
+
example: 1,
|
|
27
|
+
}),
|
|
28
|
+
tslib_1.__metadata("design:type", Number)
|
|
29
|
+
], ResourceUsage.prototype, "resourceId", void 0);
|
|
30
|
+
tslib_1.__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ nullable: true, type: 'integer' }),
|
|
32
|
+
(0, swagger_1.ApiProperty)({
|
|
33
|
+
description: 'The ID of the user using the resource (null if user was deleted)',
|
|
34
|
+
example: 1,
|
|
35
|
+
required: false,
|
|
36
|
+
}),
|
|
37
|
+
tslib_1.__metadata("design:type", Number)
|
|
38
|
+
], ResourceUsage.prototype, "userId", void 0);
|
|
39
|
+
tslib_1.__decorate([
|
|
40
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
41
|
+
(0, swagger_1.ApiProperty)({
|
|
42
|
+
description: 'When the usage session started',
|
|
43
|
+
}),
|
|
44
|
+
tslib_1.__metadata("design:type", Date)
|
|
45
|
+
], ResourceUsage.prototype, "startTime", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
48
|
+
(0, swagger_1.ApiProperty)({
|
|
49
|
+
description: 'Notes provided when starting the session',
|
|
50
|
+
example: 'Starting prototype development for client XYZ',
|
|
51
|
+
required: false,
|
|
52
|
+
}),
|
|
53
|
+
tslib_1.__metadata("design:type", String)
|
|
54
|
+
], ResourceUsage.prototype, "startNotes", void 0);
|
|
55
|
+
tslib_1.__decorate([
|
|
56
|
+
(0, typeorm_1.Column)({ type: 'datetime', nullable: true }),
|
|
57
|
+
(0, swagger_1.ApiProperty)({
|
|
58
|
+
description: 'When the usage session ended',
|
|
59
|
+
required: false,
|
|
60
|
+
}),
|
|
61
|
+
tslib_1.__metadata("design:type", Date)
|
|
62
|
+
], ResourceUsage.prototype, "endTime", void 0);
|
|
63
|
+
tslib_1.__decorate([
|
|
64
|
+
(0, typeorm_1.Column)({ type: 'text', nullable: true }),
|
|
65
|
+
(0, swagger_1.ApiProperty)({
|
|
66
|
+
description: 'Notes provided when ending the session',
|
|
67
|
+
example: 'Completed initial prototype, material usage: 500g',
|
|
68
|
+
required: false,
|
|
69
|
+
}),
|
|
70
|
+
tslib_1.__metadata("design:type", String)
|
|
71
|
+
], ResourceUsage.prototype, "endNotes", void 0);
|
|
72
|
+
tslib_1.__decorate([
|
|
73
|
+
(0, typeorm_1.ManyToOne)(() => resource_entity_1.Resource, (resource) => resource.usages),
|
|
74
|
+
(0, typeorm_1.JoinColumn)({ name: 'resourceId' }),
|
|
75
|
+
tslib_1.__metadata("design:type", resource_entity_1.Resource)
|
|
76
|
+
], ResourceUsage.prototype, "resource", void 0);
|
|
77
|
+
tslib_1.__decorate([
|
|
78
|
+
(0, typeorm_1.ManyToOne)(() => user_entity_1.User, (user) => user.resourceUsages, { nullable: true }),
|
|
79
|
+
(0, typeorm_1.JoinColumn)({ name: 'userId' }),
|
|
80
|
+
(0, swagger_1.ApiProperty)({
|
|
81
|
+
description: 'The user who used the resource',
|
|
82
|
+
example: 1,
|
|
83
|
+
required: false,
|
|
84
|
+
type: () => user_entity_1.User,
|
|
85
|
+
}),
|
|
86
|
+
tslib_1.__metadata("design:type", user_entity_1.User)
|
|
87
|
+
], ResourceUsage.prototype, "user", void 0);
|
|
88
|
+
tslib_1.__decorate([
|
|
89
|
+
(0, typeorm_1.Column)({
|
|
90
|
+
generatedType: 'STORED',
|
|
91
|
+
asExpression: `CASE
|
|
92
|
+
WHEN "endTime" IS NULL THEN -1
|
|
93
|
+
ELSE (julianday("endTime") - julianday("startTime")) * 1440
|
|
94
|
+
END`,
|
|
95
|
+
insert: false,
|
|
96
|
+
update: false,
|
|
97
|
+
type: 'integer',
|
|
98
|
+
}),
|
|
99
|
+
(0, swagger_1.ApiProperty)({
|
|
100
|
+
description: 'The duration of the usage session in minutes',
|
|
101
|
+
example: 120,
|
|
102
|
+
}),
|
|
103
|
+
tslib_1.__metadata("design:type", Number)
|
|
104
|
+
], ResourceUsage.prototype, "usageInMinutes", void 0);
|
|
105
|
+
exports.ResourceUsage = ResourceUsage = tslib_1.__decorate([
|
|
106
|
+
(0, typeorm_1.Entity)()
|
|
107
|
+
], ResourceUsage);
|
|
108
|
+
//# sourceMappingURL=resourceUsage.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resourceUsage.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/resourceUsage.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA0G;AAC1G,6CAA8C;AAC9C,uDAA6C;AAC7C,+CAAqC;AAG9B,IAAM,aAAa,GAAnB,MAAM,aAAa;CAmFzB,CAAA;AAnFY,sCAAa;AAMxB;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE,CAAC;KACX,CAAC;;yCACU;AASZ;IAPC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,SAAS;KAChB,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,CAAC;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AE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IACxE,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;IAC9B,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,gCAAgC;QAC7C,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,KAAK;QACf,IAAI,EAAE,GAAG,EAAE,CAAC,kBAAI;KACjB,CAAC;sCACK,kBAAI;2CAAQ;AAgBnB;IAdC,IAAA,gBAAM,EAAC;QACN,aAAa,EAAE,QAAQ;QACvB,YAAY,EAAE;;;QAGV;QACJ,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,KAAK;QACb,IAAI,EAAE,SAAS;KAChB,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,8CAA8C;QAC3D,OAAO,EAAE,GAAG;KACb,CAAC;;qDACsB;wBAlFb,aAAa;IADzB,IAAA,gBAAM,GAAE;GACI,aAAa,CAmFzB"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RevokedToken = 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 RevokedToken = class RevokedToken {
|
|
9
|
+
};
|
|
10
|
+
exports.RevokedToken = RevokedToken;
|
|
11
|
+
tslib_1.__decorate([
|
|
12
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
13
|
+
(0, swagger_1.ApiProperty)({
|
|
14
|
+
description: 'The unique identifier of the revoked token',
|
|
15
|
+
example: 1,
|
|
16
|
+
}),
|
|
17
|
+
tslib_1.__metadata("design:type", Number)
|
|
18
|
+
], 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
|
+
tslib_1.__decorate([
|
|
28
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
29
|
+
(0, swagger_1.ApiProperty)({
|
|
30
|
+
description: 'The JWT token that was revoked',
|
|
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',
|
|
38
|
+
}),
|
|
39
|
+
tslib_1.__metadata("design:type", String)
|
|
40
|
+
], 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
|
+
tslib_1.__decorate([
|
|
49
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
50
|
+
(0, swagger_1.ApiProperty)({
|
|
51
|
+
description: 'When the token was revoked',
|
|
52
|
+
}),
|
|
53
|
+
tslib_1.__metadata("design:type", Date)
|
|
54
|
+
], 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
|
+
exports.RevokedToken = RevokedToken = tslib_1.__decorate([
|
|
61
|
+
(0, typeorm_1.Entity)()
|
|
62
|
+
], RevokedToken);
|
|
63
|
+
//# sourceMappingURL=revokedToken.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"revokedToken.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/revokedToken.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAOiB;AACjB,6CAA8C;AAC9C,+CAAqC;AAG9B,IAAM,YAAY,GAAlB,MAAM,YAAY;CA0CxB,CAAA;AA1CY,oCAAY;AAMvB;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,4CAA4C;QACzD,OAAO,EAAE,CAAC;KACX,CAAC;;wCACU;AAOZ;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;IAC3B,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,wCAAwC;QACrD,OAAO,EAAE,CAAC;KACX,CAAC;;4CACc;AAMhB;IAJC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,gCAAgC;KAC9C,CAAC;;2CACa;AAMf;IAJC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,oCAAoC;KAClD,CAAC;;6CACe;AAMjB;IAJC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC;IAC5B,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,wBAAwB;KACtC,CAAC;sCACU,IAAI;+CAAC;AAMjB;IAJC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,4BAA4B;KAC1C,CAAC;sCACU,IAAI;+CAAC;AAIjB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC;IACnD,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC;sCACxB,kBAAI;0CAAC;uBAzCD,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CA0CxB"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SSOProviderOIDCConfiguration } from './ssoProvider.oidc';
|
|
2
|
+
export declare enum SSOProviderType {
|
|
3
|
+
OIDC = "OIDC"
|
|
4
|
+
}
|
|
5
|
+
export declare class SSOProvider {
|
|
6
|
+
id: number;
|
|
7
|
+
name: string;
|
|
8
|
+
type: SSOProviderType;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
updatedAt: Date;
|
|
11
|
+
oidcConfiguration: SSOProviderOIDCConfiguration;
|
|
12
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SSOProvider = exports.SSOProviderType = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const typeorm_1 = require("typeorm");
|
|
6
|
+
const swagger_1 = require("@nestjs/swagger");
|
|
7
|
+
const ssoProvider_oidc_1 = require("./ssoProvider.oidc");
|
|
8
|
+
const class_validator_1 = require("class-validator");
|
|
9
|
+
var SSOProviderType;
|
|
10
|
+
(function (SSOProviderType) {
|
|
11
|
+
SSOProviderType["OIDC"] = "OIDC";
|
|
12
|
+
})(SSOProviderType || (exports.SSOProviderType = SSOProviderType = {}));
|
|
13
|
+
let SSOProvider = class SSOProvider {
|
|
14
|
+
};
|
|
15
|
+
exports.SSOProvider = SSOProvider;
|
|
16
|
+
tslib_1.__decorate([
|
|
17
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
18
|
+
(0, swagger_1.ApiProperty)({
|
|
19
|
+
description: 'The unique identifier of the provider',
|
|
20
|
+
example: 1,
|
|
21
|
+
}),
|
|
22
|
+
tslib_1.__metadata("design:type", Number)
|
|
23
|
+
], SSOProvider.prototype, "id", void 0);
|
|
24
|
+
tslib_1.__decorate([
|
|
25
|
+
(0, typeorm_1.Column)({ type: 'text' }),
|
|
26
|
+
(0, swagger_1.ApiProperty)({
|
|
27
|
+
description: 'The internal name of the provider',
|
|
28
|
+
example: 'Keycloak',
|
|
29
|
+
}),
|
|
30
|
+
tslib_1.__metadata("design:type", String)
|
|
31
|
+
], SSOProvider.prototype, "name", void 0);
|
|
32
|
+
tslib_1.__decorate([
|
|
33
|
+
(0, typeorm_1.Column)({
|
|
34
|
+
type: 'simple-enum',
|
|
35
|
+
enum: SSOProviderType,
|
|
36
|
+
}),
|
|
37
|
+
(0, swagger_1.ApiProperty)({
|
|
38
|
+
description: 'The type of the provider',
|
|
39
|
+
example: 'OIDC',
|
|
40
|
+
enum: SSOProviderType,
|
|
41
|
+
enumName: 'SSOProviderType',
|
|
42
|
+
}),
|
|
43
|
+
(0, class_validator_1.IsEnum)(SSOProviderType),
|
|
44
|
+
tslib_1.__metadata("design:type", String)
|
|
45
|
+
], SSOProvider.prototype, "type", void 0);
|
|
46
|
+
tslib_1.__decorate([
|
|
47
|
+
(0, typeorm_1.CreateDateColumn)(),
|
|
48
|
+
(0, swagger_1.ApiProperty)({
|
|
49
|
+
description: 'When the user was created',
|
|
50
|
+
}),
|
|
51
|
+
tslib_1.__metadata("design:type", Date)
|
|
52
|
+
], SSOProvider.prototype, "createdAt", void 0);
|
|
53
|
+
tslib_1.__decorate([
|
|
54
|
+
(0, typeorm_1.UpdateDateColumn)(),
|
|
55
|
+
(0, swagger_1.ApiProperty)({
|
|
56
|
+
description: 'When the user was last updated',
|
|
57
|
+
}),
|
|
58
|
+
tslib_1.__metadata("design:type", Date)
|
|
59
|
+
], SSOProvider.prototype, "updatedAt", void 0);
|
|
60
|
+
tslib_1.__decorate([
|
|
61
|
+
(0, typeorm_1.OneToOne)(() => ssoProvider_oidc_1.SSOProviderOIDCConfiguration, (oidcConfiguration) => oidcConfiguration.ssoProvider),
|
|
62
|
+
(0, swagger_1.ApiProperty)({
|
|
63
|
+
description: 'The OIDC configuration of the provider',
|
|
64
|
+
type: ssoProvider_oidc_1.SSOProviderOIDCConfiguration,
|
|
65
|
+
}),
|
|
66
|
+
tslib_1.__metadata("design:type", ssoProvider_oidc_1.SSOProviderOIDCConfiguration)
|
|
67
|
+
], SSOProvider.prototype, "oidcConfiguration", void 0);
|
|
68
|
+
exports.SSOProvider = SSOProvider = tslib_1.__decorate([
|
|
69
|
+
(0, typeorm_1.Entity)()
|
|
70
|
+
], SSOProvider);
|
|
71
|
+
//# sourceMappingURL=ssoProvider.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ssoProvider.entity.js","sourceRoot":"","sources":["../../../../../../libs/database-entities/src/lib/entities/ssoProvider.entity.ts"],"names":[],"mappings":";;;;AAAA,qCAA+G;AAC/G,6CAA8C;AAC9C,yDAAkE;AAClE,qDAAyC;AAEzC,IAAY,eAEX;AAFD,WAAY,eAAe;IACzB,gCAAa,CAAA;AACf,CAAC,EAFW,eAAe,+BAAf,eAAe,QAE1B;AAGM,IAAM,WAAW,GAAjB,MAAM,WAAW;CA8CvB,CAAA;AA9CY,kCAAW;AAMtB;IALC,IAAA,gCAAsB,GAAE;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,CAAC;KACX,CAAC;;uCACU;AAOZ;IALC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;IACxB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,mCAAmC;QAChD,OAAO,EAAE,UAAU;KACpB,CAAC;;yCACY;AAad;IAXC,IAAA,gBAAM,EAAC;QACN,IAAI,EAAE,aAAa;QACnB,IAAI,EAAE,eAAe;KACtB,CAAC;IACD,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,0BAA0B;QACvC,OAAO,EAAE,MAAM;QACf,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE,iBAAiB;KAC5B,CAAC;IACD,IAAA,wBAAM,EAAC,eAAe,CAAC;;yCACD;AAMvB;IAJC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,2BAA2B;KACzC,CAAC;sCACU,IAAI;8CAAC;AAMjB;IAJC,IAAA,0BAAgB,GAAE;IAClB,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,gCAAgC;KAC9C,CAAC;sCACU,IAAI;8CAAC;AAOjB;IALC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,+CAA4B,EAAE,CAAC,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,WAAW,CAAC;IAClG,IAAA,qBAAW,EAAC;QACX,WAAW,EAAE,wCAAwC;QACrD,IAAI,EAAE,+CAA4B;KACnC,CAAC;sCACkB,+CAA4B;sDAAC;sBA7CtC,WAAW;IADvB,IAAA,gBAAM,GAAE;GACI,WAAW,CA8CvB"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SSOProvider } from './ssoProvider.entity';
|
|
2
|
+
export declare class SSOProviderOIDCConfiguration {
|
|
3
|
+
id: number;
|
|
4
|
+
ssoProviderId: number;
|
|
5
|
+
issuer: string;
|
|
6
|
+
authorizationURL: string;
|
|
7
|
+
tokenURL: string;
|
|
8
|
+
userInfoURL: string;
|
|
9
|
+
clientId: string;
|
|
10
|
+
clientSecret: string;
|
|
11
|
+
createdAt: Date;
|
|
12
|
+
updatedAt: Date;
|
|
13
|
+
ssoProvider: SSOProvider;
|
|
14
|
+
}
|