@imaginamossas/farmabien-common 1.0.25 → 1.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/entities/customer.entity.d.ts +6 -0
- package/dist/entities/customer.entity.js +18 -0
- package/dist/entities/customer.entity.js.map +1 -1
- package/dist/entities/index.d.ts +3 -0
- package/dist/entities/index.js +3 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/login-attempt.entity.d.ts +7 -0
- package/dist/entities/login-attempt.entity.js +45 -0
- package/dist/entities/login-attempt.entity.js.map +1 -0
- package/dist/entities/password-reset-token.entity.d.ts +10 -0
- package/dist/entities/password-reset-token.entity.js +57 -0
- package/dist/entities/password-reset-token.entity.js.map +1 -0
- package/dist/entities/refresh-token.entity.d.ts +15 -0
- package/dist/entities/refresh-token.entity.js +85 -0
- package/dist/entities/refresh-token.entity.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { PasswordResetToken } from './password-reset-token.entity';
|
|
2
|
+
import { RefreshToken } from './refresh-token.entity';
|
|
3
|
+
import { EmailVerificationTokenEntity } from './email-verification-token.entity';
|
|
1
4
|
export declare class CustomerEntity {
|
|
2
5
|
id: number;
|
|
3
6
|
email: string;
|
|
@@ -20,6 +23,9 @@ export declare class CustomerEntity {
|
|
|
20
23
|
updatedAt: Date;
|
|
21
24
|
deletedAt: Date | null;
|
|
22
25
|
addresses: unknown[];
|
|
26
|
+
refreshTokens: RefreshToken[];
|
|
27
|
+
verificationTokens: EmailVerificationTokenEntity[];
|
|
28
|
+
passwordResetTokens: PasswordResetToken[];
|
|
23
29
|
get customerId(): number;
|
|
24
30
|
get isEmailVerified(): boolean;
|
|
25
31
|
get fullName(): string;
|
|
@@ -11,6 +11,9 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.CustomerEntity = void 0;
|
|
13
13
|
const typeorm_1 = require("typeorm");
|
|
14
|
+
const password_reset_token_entity_1 = require("./password-reset-token.entity");
|
|
15
|
+
const refresh_token_entity_1 = require("./refresh-token.entity");
|
|
16
|
+
const email_verification_token_entity_1 = require("./email-verification-token.entity");
|
|
14
17
|
let CustomerEntity = class CustomerEntity {
|
|
15
18
|
id;
|
|
16
19
|
email;
|
|
@@ -33,6 +36,9 @@ let CustomerEntity = class CustomerEntity {
|
|
|
33
36
|
updatedAt;
|
|
34
37
|
deletedAt;
|
|
35
38
|
addresses;
|
|
39
|
+
refreshTokens;
|
|
40
|
+
verificationTokens;
|
|
41
|
+
passwordResetTokens;
|
|
36
42
|
get customerId() {
|
|
37
43
|
return this.id;
|
|
38
44
|
}
|
|
@@ -131,6 +137,18 @@ __decorate([
|
|
|
131
137
|
(0, typeorm_1.OneToMany)('CustomerAddressEntity', 'customer'),
|
|
132
138
|
__metadata("design:type", Array)
|
|
133
139
|
], CustomerEntity.prototype, "addresses", void 0);
|
|
140
|
+
__decorate([
|
|
141
|
+
(0, typeorm_1.OneToMany)(() => refresh_token_entity_1.RefreshToken, (token) => token.customer),
|
|
142
|
+
__metadata("design:type", Array)
|
|
143
|
+
], CustomerEntity.prototype, "refreshTokens", void 0);
|
|
144
|
+
__decorate([
|
|
145
|
+
(0, typeorm_1.OneToMany)(() => email_verification_token_entity_1.EmailVerificationTokenEntity, (token) => token.customer),
|
|
146
|
+
__metadata("design:type", Array)
|
|
147
|
+
], CustomerEntity.prototype, "verificationTokens", void 0);
|
|
148
|
+
__decorate([
|
|
149
|
+
(0, typeorm_1.OneToMany)(() => password_reset_token_entity_1.PasswordResetToken, (token) => token.customer),
|
|
150
|
+
__metadata("design:type", Array)
|
|
151
|
+
], CustomerEntity.prototype, "passwordResetTokens", void 0);
|
|
134
152
|
exports.CustomerEntity = CustomerEntity = __decorate([
|
|
135
153
|
(0, typeorm_1.Entity)('customers'),
|
|
136
154
|
(0, typeorm_1.Index)('idx_customers_email', ['email'], { unique: true }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customer.entity.js","sourceRoot":"","sources":["../../src/entities/customer.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCASiB;
|
|
1
|
+
{"version":3,"file":"customer.entity.js","sourceRoot":"","sources":["../../src/entities/customer.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCASiB;AACjB,+EAAmE;AACnE,iEAAsD;AACtD,uFAAiF;AAwB1E,IAAM,cAAc,GAApB,MAAM,cAAc;IAMzB,EAAE,CAAS;IAWX,KAAK,CAAS;IAOd,YAAY,CAAS;IAMrB,aAAa,CAAU;IAMvB,eAAe,CAAc;IAU7B,SAAS,CAAS;IAMlB,QAAQ,CAAS;IAOjB,MAAM,CAAS;IAMf,QAAQ,CAAS;IAMjB,gBAAgB,CAAS;IAMzB,WAAW,CAAS;IAMpB,MAAM,CAAgB;IAMtB,SAAS,CAAc;IAMvB,QAAQ,CAAU;IAMlB,iBAAiB,CAAU;IAM3B,YAAY,CAAU;IAMtB,gBAAgB,CAAU;IAO1B,SAAS,CAAO;IAGhB,SAAS,CAAO;IAGhB,SAAS,CAAc;IAWvB,SAAS,CAAY;IAMrB,aAAa,CAAiB;IAG9B,kBAAkB,CAAiC;IAGnD,mBAAmB,CAAuB;IAS1C,IAAI,UAAU;QACZ,OAAO,IAAI,CAAC,EAAE,CAAC;IACjB,CAAC;IAKD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC5B,CAAC;IAKD,IAAI,QAAQ;QACV,OAAO,GAAG,IAAI,CAAC,SAAS,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;IAC9C,CAAC;IAKD,IAAI,SAAS;QACX,OAAO,GAAG,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;IACvD,CAAC;CACF,CAAA;AAtLY,wCAAc;AAMzB;IADC,IAAA,gCAAsB,GA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AC,mCAAY,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;;qDAC3B;AAG9B;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,8DAA4B,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;;0DACtB;AAGnD;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gDAAkB,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC;;2DACrB;yBArJ/B,cAAc;IAJ1B,IAAA,gBAAM,EAAC,WAAW,CAAC;IACnB,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzD,IAAA,eAAK,EAAC,wBAAwB,EAAE,CAAC,QAAQ,EAAE,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzE,IAAA,eAAK,EAAC,qBAAqB,EAAE,CAAC,kBAAkB,EAAE,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GACvE,cAAc,CAsL1B"}
|
package/dist/entities/index.d.ts
CHANGED
|
@@ -6,3 +6,6 @@ export * from './city.entity';
|
|
|
6
6
|
export * from './providers-code.entity';
|
|
7
7
|
export * from './customer-provider.entity';
|
|
8
8
|
export * from './email-verification-token.entity';
|
|
9
|
+
export * from './refresh-token.entity';
|
|
10
|
+
export * from './password-reset-token.entity';
|
|
11
|
+
export * from './login-attempt.entity';
|
package/dist/entities/index.js
CHANGED
|
@@ -22,4 +22,7 @@ __exportStar(require("./city.entity"), exports);
|
|
|
22
22
|
__exportStar(require("./providers-code.entity"), exports);
|
|
23
23
|
__exportStar(require("./customer-provider.entity"), exports);
|
|
24
24
|
__exportStar(require("./email-verification-token.entity"), exports);
|
|
25
|
+
__exportStar(require("./refresh-token.entity"), exports);
|
|
26
|
+
__exportStar(require("./password-reset-token.entity"), exports);
|
|
27
|
+
__exportStar(require("./login-attempt.entity"), exports);
|
|
25
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAaA,gDAA8B;AAC9B,oDAAkC;AAClC,4DAA0C;AAC1C,iDAA+B;AAC/B,gDAA8B;AAC9B,0DAAwC;AACxC,6DAA2C;AAC3C,oEAAkD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/entities/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAaA,gDAA8B;AAC9B,oDAAkC;AAClC,4DAA0C;AAC1C,iDAA+B;AAC/B,gDAA8B;AAC9B,0DAAwC;AACxC,6DAA2C;AAC3C,oEAAkD;AAClD,yDAAuC;AACvC,gEAA8C;AAC9C,yDAAuC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
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
|
+
exports.LoginAttempt = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
let LoginAttempt = class LoginAttempt {
|
|
15
|
+
email;
|
|
16
|
+
attempts;
|
|
17
|
+
first_attempt_at;
|
|
18
|
+
last_attempt_at;
|
|
19
|
+
locked_until;
|
|
20
|
+
};
|
|
21
|
+
exports.LoginAttempt = LoginAttempt;
|
|
22
|
+
__decorate([
|
|
23
|
+
(0, typeorm_1.PrimaryColumn)({ type: 'varchar', length: 255 }),
|
|
24
|
+
__metadata("design:type", String)
|
|
25
|
+
], LoginAttempt.prototype, "email", void 0);
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, typeorm_1.Column)({ type: 'int', default: 0 }),
|
|
28
|
+
__metadata("design:type", Number)
|
|
29
|
+
], LoginAttempt.prototype, "attempts", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'first_attempt_at' }),
|
|
32
|
+
__metadata("design:type", Date)
|
|
33
|
+
], LoginAttempt.prototype, "first_attempt_at", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'last_attempt_at' }),
|
|
36
|
+
__metadata("design:type", Date)
|
|
37
|
+
], LoginAttempt.prototype, "last_attempt_at", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'locked_until', nullable: true }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], LoginAttempt.prototype, "locked_until", void 0);
|
|
42
|
+
exports.LoginAttempt = LoginAttempt = __decorate([
|
|
43
|
+
(0, typeorm_1.Entity)({ name: 'login_attempts' })
|
|
44
|
+
], LoginAttempt);
|
|
45
|
+
//# sourceMappingURL=login-attempt.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login-attempt.entity.js","sourceRoot":"","sources":["../../src/entities/login-attempt.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwD;AAIjD,IAAM,YAAY,GAAlB,MAAM,YAAY;IAEvB,KAAK,CAAS;IAGd,QAAQ,CAAS;IAGjB,gBAAgB,CAAO;IAGvB,eAAe,CAAO;IAGtB,YAAY,CAAc;CAC3B,CAAA;AAfY,oCAAY;AAEvB;IADC,IAAA,uBAAa,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;2CAClC;AAGd;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;;8CACnB;AAGjB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC;8BACtC,IAAI;sDAAC;AAGvB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,iBAAiB,EAAE,CAAC;8BACtC,IAAI;qDAAC;AAGtB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,cAAc,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC1C;uBAdf,YAAY;IADxB,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,gBAAgB,EAAC,CAAC;GACrB,YAAY,CAexB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
exports.PasswordResetToken = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const customer_entity_1 = require("./customer.entity");
|
|
15
|
+
let PasswordResetToken = class PasswordResetToken {
|
|
16
|
+
id;
|
|
17
|
+
tokenHash;
|
|
18
|
+
createdAt;
|
|
19
|
+
expiresAt;
|
|
20
|
+
usedAt;
|
|
21
|
+
sendAt;
|
|
22
|
+
customer;
|
|
23
|
+
};
|
|
24
|
+
exports.PasswordResetToken = PasswordResetToken;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
27
|
+
__metadata("design:type", Number)
|
|
28
|
+
], PasswordResetToken.prototype, "id", void 0);
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, name: 'token_hash' }),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], PasswordResetToken.prototype, "tokenHash", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', type: 'timestamp' }),
|
|
35
|
+
__metadata("design:type", Date)
|
|
36
|
+
], PasswordResetToken.prototype, "createdAt", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'expires_at' }),
|
|
39
|
+
__metadata("design:type", Date)
|
|
40
|
+
], PasswordResetToken.prototype, "expiresAt", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'used_at', nullable: true }),
|
|
43
|
+
__metadata("design:type", Object)
|
|
44
|
+
], PasswordResetToken.prototype, "usedAt", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'send_at', nullable: true }),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], PasswordResetToken.prototype, "sendAt", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, typeorm_1.ManyToOne)(() => customer_entity_1.CustomerEntity, (customer) => customer.passwordResetTokens, { nullable: false, onDelete: 'CASCADE' }),
|
|
51
|
+
(0, typeorm_1.JoinColumn)({ name: 'customer_id' }),
|
|
52
|
+
__metadata("design:type", customer_entity_1.CustomerEntity)
|
|
53
|
+
], PasswordResetToken.prototype, "customer", void 0);
|
|
54
|
+
exports.PasswordResetToken = PasswordResetToken = __decorate([
|
|
55
|
+
(0, typeorm_1.Entity)({ name: 'password_reset_tokens' })
|
|
56
|
+
], PasswordResetToken);
|
|
57
|
+
//# sourceMappingURL=password-reset-token.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"password-reset-token.entity.js","sourceRoot":"","sources":["../../src/entities/password-reset-token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA0G;AAC1G,uDAAmD;AAG5C,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAG7B,EAAE,CAAS;IAGX,SAAS,CAAS;IAGlB,SAAS,CAAO;IAGhB,SAAS,CAAO;IAGhB,MAAM,CAAc;IAGpB,MAAM,CAAc;IAIpB,QAAQ,CAAiB;CAC1B,CAAA;AAvBY,gDAAkB;AAG7B;IADC,IAAA,gCAAsB,GAAE;;8CACd;AAGX;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;;qDAC3C;AAGlB;IADC,IAAA,0BAAgB,EAAC,EAAE,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;8BACjD,IAAI;qDAAC;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC;8BACvC,IAAI;qDAAC;AAGhB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC3C;AAGpB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDAC3C;AAIpB;IAFC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,gCAAc,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,mBAAmB,EAAE,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACrH,IAAA,oBAAU,EAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC;8BAC1B,gCAAc;oDAAC;6BAtBd,kBAAkB;IAD9B,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;GAC7B,kBAAkB,CAuB9B"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CustomerEntity } from './customer.entity';
|
|
2
|
+
export declare class RefreshToken {
|
|
3
|
+
id: number;
|
|
4
|
+
refreshToken: string;
|
|
5
|
+
issuedAt: Date;
|
|
6
|
+
expiresAt: Date;
|
|
7
|
+
revokedAt: Date | null;
|
|
8
|
+
ip: string;
|
|
9
|
+
userAgent: string;
|
|
10
|
+
customer: CustomerEntity;
|
|
11
|
+
replacedBy: RefreshToken | null;
|
|
12
|
+
createdAt: Date;
|
|
13
|
+
updatedAt: Date;
|
|
14
|
+
deletedAt: Date | null;
|
|
15
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
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
|
+
exports.RefreshToken = void 0;
|
|
13
|
+
const typeorm_1 = require("typeorm");
|
|
14
|
+
const customer_entity_1 = require("./customer.entity");
|
|
15
|
+
let RefreshToken = class RefreshToken {
|
|
16
|
+
id;
|
|
17
|
+
refreshToken;
|
|
18
|
+
issuedAt;
|
|
19
|
+
expiresAt;
|
|
20
|
+
revokedAt;
|
|
21
|
+
ip;
|
|
22
|
+
userAgent;
|
|
23
|
+
customer;
|
|
24
|
+
replacedBy;
|
|
25
|
+
createdAt;
|
|
26
|
+
updatedAt;
|
|
27
|
+
deletedAt;
|
|
28
|
+
};
|
|
29
|
+
exports.RefreshToken = RefreshToken;
|
|
30
|
+
__decorate([
|
|
31
|
+
(0, typeorm_1.PrimaryGeneratedColumn)(),
|
|
32
|
+
__metadata("design:type", Number)
|
|
33
|
+
], RefreshToken.prototype, "id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, typeorm_1.Index)('idx_refresh_tokens_token'),
|
|
36
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, name: 'refresh_token' }),
|
|
37
|
+
__metadata("design:type", String)
|
|
38
|
+
], RefreshToken.prototype, "refreshToken", void 0);
|
|
39
|
+
__decorate([
|
|
40
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'issued_at' }),
|
|
41
|
+
__metadata("design:type", Date)
|
|
42
|
+
], RefreshToken.prototype, "issuedAt", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, typeorm_1.Index)('idx_refresh_tokens_expires_at'),
|
|
45
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'expires_at' }),
|
|
46
|
+
__metadata("design:type", Date)
|
|
47
|
+
], RefreshToken.prototype, "expiresAt", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, typeorm_1.Column)({ type: 'timestamp', name: 'revoked_at', nullable: true }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], RefreshToken.prototype, "revokedAt", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 64, nullable: true }),
|
|
54
|
+
__metadata("design:type", String)
|
|
55
|
+
], RefreshToken.prototype, "ip", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
(0, typeorm_1.Column)({ type: 'varchar', length: 255, name: 'user_agent', nullable: true }),
|
|
58
|
+
__metadata("design:type", String)
|
|
59
|
+
], RefreshToken.prototype, "userAgent", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
(0, typeorm_1.ManyToOne)(() => customer_entity_1.CustomerEntity, (customer) => customer.refreshTokens, { nullable: false, onDelete: 'CASCADE' }),
|
|
62
|
+
(0, typeorm_1.JoinColumn)({ name: 'customer_id' }),
|
|
63
|
+
__metadata("design:type", customer_entity_1.CustomerEntity)
|
|
64
|
+
], RefreshToken.prototype, "customer", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
(0, typeorm_1.OneToOne)(() => RefreshToken, { nullable: true, onDelete: 'SET NULL' }),
|
|
67
|
+
(0, typeorm_1.JoinColumn)({ name: 'replaced_by_token_id' }),
|
|
68
|
+
__metadata("design:type", Object)
|
|
69
|
+
], RefreshToken.prototype, "replacedBy", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, typeorm_1.CreateDateColumn)({ name: 'created_at', select: false }),
|
|
72
|
+
__metadata("design:type", Date)
|
|
73
|
+
], RefreshToken.prototype, "createdAt", void 0);
|
|
74
|
+
__decorate([
|
|
75
|
+
(0, typeorm_1.UpdateDateColumn)({ name: 'updated_at', select: false }),
|
|
76
|
+
__metadata("design:type", Date)
|
|
77
|
+
], RefreshToken.prototype, "updatedAt", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, typeorm_1.DeleteDateColumn)({ name: 'deleted_at', nullable: true, select: false }),
|
|
80
|
+
__metadata("design:type", Object)
|
|
81
|
+
], RefreshToken.prototype, "deletedAt", void 0);
|
|
82
|
+
exports.RefreshToken = RefreshToken = __decorate([
|
|
83
|
+
(0, typeorm_1.Entity)({ name: 'refresh_tokens' })
|
|
84
|
+
], RefreshToken);
|
|
85
|
+
//# sourceMappingURL=refresh-token.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-token.entity.js","sourceRoot":"","sources":["../../src/entities/refresh-token.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA+J;AAC/J,uDAAmD;AAG5C,IAAM,YAAY,GAAlB,MAAM,YAAY;IAGvB,EAAE,CAAS;IAIX,YAAY,CAAS;IAGrB,QAAQ,CAAO;IAIf,SAAS,CAAO;IAGhB,SAAS,CAAc;IAGvB,EAAE,CAAS;IAGX,SAAS,CAAS;IAIlB,QAAQ,CAAiB;IAIzB,UAAU,CAAsB;IAGhC,SAAS,CAAO;IAGhB,SAAS,CAAO;IAGhB,SAAS,CAAc;CACxB,CAAA;AAzCY,oCAAY;AAGvB;IADC,IAAA,gCAAsB,GAAE;;wCACd;AAIX;IAFC,IAAA,eAAK,EAAC,0BAA0B,CAAC;IACjC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,eAAe,EAAE,CAAC;;kDAC3C;AAGrB;IADC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,WAAW,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