@tomei/sso 0.38.9 → 0.39.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/src/components/api-key/api-key.d.ts +39 -0
- package/dist/src/components/api-key/api-key.js +125 -0
- package/dist/src/components/api-key/api-key.js.map +1 -0
- package/dist/src/components/api-key/api-key.repository.d.ts +6 -0
- package/dist/src/components/api-key/api-key.repository.js +26 -0
- package/dist/src/components/api-key/api-key.repository.js.map +1 -0
- package/dist/src/components/api-key/index.d.ts +3 -0
- package/dist/src/components/api-key/index.js +8 -0
- package/dist/src/components/api-key/index.js.map +1 -0
- package/dist/src/components/login-user/user.js +4 -4
- package/dist/src/components/login-user/user.js.map +1 -1
- package/dist/src/enum/api-key.enum.d.ts +5 -0
- package/dist/src/enum/api-key.enum.js +10 -0
- package/dist/src/enum/api-key.enum.js.map +1 -0
- package/dist/src/enum/index.d.ts +1 -0
- package/dist/src/enum/index.js +1 -0
- package/dist/src/enum/index.js.map +1 -1
- package/dist/src/interfaces/api-key-attr.interface.d.ts +13 -0
- package/dist/src/interfaces/api-key-attr.interface.js +3 -0
- package/dist/src/interfaces/api-key-attr.interface.js.map +1 -0
- package/dist/src/interfaces/index.d.ts +1 -0
- package/dist/src/interfaces/index.js +1 -0
- package/dist/src/interfaces/index.js.map +1 -1
- package/dist/src/models/api-key-entity.d.ts +17 -0
- package/dist/src/models/api-key-entity.js +105 -0
- package/dist/src/models/api-key-entity.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/migrations/20240528063108-create-api-key-table.js +89 -0
- package/package.json +1 -1
- package/src/components/api-key/api-key.repository.ts +15 -0
- package/src/components/api-key/api-key.ts +196 -0
- package/src/components/api-key/index.ts +4 -0
- package/src/components/login-user/user.ts +4 -4
- package/src/enum/api-key.enum.ts +5 -0
- package/src/enum/index.ts +1 -0
- package/src/interfaces/api-key-attr.interface.ts +14 -0
- package/src/interfaces/index.ts +1 -0
- package/src/models/api-key-entity.ts +87 -0
@@ -0,0 +1,105 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
7
|
+
};
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
13
|
+
const user_entity_1 = require("./user.entity");
|
14
|
+
const api_key_enum_1 = require("../enum/api-key.enum");
|
15
|
+
let APIKeyModel = class APIKeyModel extends sequelize_typescript_1.Model {
|
16
|
+
};
|
17
|
+
__decorate([
|
18
|
+
(0, sequelize_typescript_1.Column)({
|
19
|
+
primaryKey: true,
|
20
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
21
|
+
allowNull: false,
|
22
|
+
autoIncrement: true,
|
23
|
+
}),
|
24
|
+
__metadata("design:type", Number)
|
25
|
+
], APIKeyModel.prototype, "APIKeyId", void 0);
|
26
|
+
__decorate([
|
27
|
+
(0, sequelize_typescript_1.Column)({
|
28
|
+
type: sequelize_typescript_1.DataType.STRING(128),
|
29
|
+
}),
|
30
|
+
(0, sequelize_typescript_1.Index)('IDX_ApiKey'),
|
31
|
+
__metadata("design:type", String)
|
32
|
+
], APIKeyModel.prototype, "ApiKey", void 0);
|
33
|
+
__decorate([
|
34
|
+
(0, sequelize_typescript_1.Column)({
|
35
|
+
type: sequelize_typescript_1.DataType.STRING(255),
|
36
|
+
allowNull: false,
|
37
|
+
}),
|
38
|
+
__metadata("design:type", String)
|
39
|
+
], APIKeyModel.prototype, "Name", void 0);
|
40
|
+
__decorate([
|
41
|
+
(0, sequelize_typescript_1.Column)({
|
42
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
43
|
+
allowNull: true,
|
44
|
+
}),
|
45
|
+
__metadata("design:type", String)
|
46
|
+
], APIKeyModel.prototype, "Description", void 0);
|
47
|
+
__decorate([
|
48
|
+
(0, sequelize_typescript_1.Column)({
|
49
|
+
type: sequelize_typescript_1.DataType.STRING(50),
|
50
|
+
allowNull: false,
|
51
|
+
}),
|
52
|
+
__metadata("design:type", String)
|
53
|
+
], APIKeyModel.prototype, "Status", void 0);
|
54
|
+
__decorate([
|
55
|
+
(0, sequelize_typescript_1.Column)({
|
56
|
+
type: sequelize_typescript_1.DataType.DATE,
|
57
|
+
allowNull: true,
|
58
|
+
}),
|
59
|
+
__metadata("design:type", Date)
|
60
|
+
], APIKeyModel.prototype, "ExperationDate", void 0);
|
61
|
+
__decorate([
|
62
|
+
(0, sequelize_typescript_1.ForeignKey)(() => user_entity_1.default),
|
63
|
+
(0, sequelize_typescript_1.Column)({
|
64
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
65
|
+
}),
|
66
|
+
(0, sequelize_typescript_1.Index)('IDX_CreatedById'),
|
67
|
+
__metadata("design:type", Number)
|
68
|
+
], APIKeyModel.prototype, "CreatedById", void 0);
|
69
|
+
__decorate([
|
70
|
+
(0, sequelize_typescript_1.ForeignKey)(() => user_entity_1.default),
|
71
|
+
(0, sequelize_typescript_1.Column)({
|
72
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
73
|
+
}),
|
74
|
+
(0, sequelize_typescript_1.Index)('IDX_InvokedById'),
|
75
|
+
__metadata("design:type", Number)
|
76
|
+
], APIKeyModel.prototype, "InvokedById", void 0);
|
77
|
+
__decorate([
|
78
|
+
sequelize_typescript_1.CreatedAt,
|
79
|
+
__metadata("design:type", Date)
|
80
|
+
], APIKeyModel.prototype, "CreatedAt", void 0);
|
81
|
+
__decorate([
|
82
|
+
(0, sequelize_typescript_1.Column)({
|
83
|
+
type: sequelize_typescript_1.DataType.DATE,
|
84
|
+
allowNull: true,
|
85
|
+
}),
|
86
|
+
__metadata("design:type", Date)
|
87
|
+
], APIKeyModel.prototype, "InvokedAt", void 0);
|
88
|
+
__decorate([
|
89
|
+
(0, sequelize_typescript_1.BelongsTo)(() => user_entity_1.default, 'CreatedById'),
|
90
|
+
__metadata("design:type", user_entity_1.default)
|
91
|
+
], APIKeyModel.prototype, "CreatedByUser", void 0);
|
92
|
+
__decorate([
|
93
|
+
(0, sequelize_typescript_1.BelongsTo)(() => user_entity_1.default, 'RevokedById'),
|
94
|
+
__metadata("design:type", user_entity_1.default)
|
95
|
+
], APIKeyModel.prototype, "UpdatedByUser", void 0);
|
96
|
+
APIKeyModel = __decorate([
|
97
|
+
(0, sequelize_typescript_1.Table)({
|
98
|
+
tableName: 'sso_ApiKey',
|
99
|
+
timestamps: true,
|
100
|
+
createdAt: 'CreatedAt',
|
101
|
+
updatedAt: false,
|
102
|
+
})
|
103
|
+
], APIKeyModel);
|
104
|
+
exports.default = APIKeyModel;
|
105
|
+
//# sourceMappingURL=api-key-entity.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"api-key-entity.js","sourceRoot":"","sources":["../../../src/models/api-key-entity.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAS8B;AAC9B,+CAAiC;AACjC,uDAAwD;AAQzC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,4BAAK;CAmE7C,CAAA;AAlEC;IAAC,IAAA,6BAAM,EAAC;QACN,UAAU,EAAE,IAAI;QAChB,IAAI,EAAE,+BAAQ,CAAC,OAAO;QACtB,SAAS,EAAE,KAAK;QAChB,aAAa,EAAE,IAAI;KACpB,CAAC;;6CACe;AAEjB;IAAC,IAAA,6BAAM,EAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM,CAAC,GAA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