whitelabel-db 1.1.75 → 1.1.77
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/libs/liteapiv3.d.ts +4 -0
- package/dist/libs/translation.d.ts +4 -0
- package/dist/libs/translation.js +21 -0
- package/dist/migrations/010-add-user-resetToken.d.ts +3 -0
- package/dist/migrations/010-add-user-resetToken.js +60 -0
- package/dist/models/User.d.ts +2 -0
- package/dist/models/User.js +15 -0
- package/package.json +1 -1
- package/dist/models/Search.d.ts +0 -8
- package/dist/models/Search.js +0 -61
package/dist/libs/liteapiv3.d.ts
CHANGED
|
@@ -154,6 +154,10 @@ export interface PrebookRateV3 {
|
|
|
154
154
|
checkin: string;
|
|
155
155
|
checkout: string;
|
|
156
156
|
paymentTypes: string[];
|
|
157
|
+
creditLine: {
|
|
158
|
+
remainingCredit: number;
|
|
159
|
+
currency: string;
|
|
160
|
+
};
|
|
157
161
|
}
|
|
158
162
|
export interface GuestInfoV3 {
|
|
159
163
|
guestFirstName: string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getTranslationFallback = void 0;
|
|
4
|
+
const sequelize_1 = require("sequelize");
|
|
5
|
+
const HotelTranslation_1 = require("../models/HotelTranslation");
|
|
6
|
+
function getTranslationFallback(language = 'en', attributes) {
|
|
7
|
+
return {
|
|
8
|
+
include: [
|
|
9
|
+
{
|
|
10
|
+
model: HotelTranslation_1.HotelTranslation,
|
|
11
|
+
as: 'translations',
|
|
12
|
+
attributes,
|
|
13
|
+
where: {
|
|
14
|
+
[sequelize_1.Op.or]: [{ language }],
|
|
15
|
+
},
|
|
16
|
+
required: false,
|
|
17
|
+
},
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.getTranslationFallback = getTranslationFallback;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.down = exports.up = void 0;
|
|
13
|
+
// Purpose: Add video column to static_hotels table.
|
|
14
|
+
const sequelize_1 = require("sequelize");
|
|
15
|
+
const up = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
try {
|
|
17
|
+
// Add all columns in parallel
|
|
18
|
+
yield queryInterface.addColumn('users', 'passwordResetToken', {
|
|
19
|
+
type: sequelize_1.DataTypes.STRING,
|
|
20
|
+
allowNull: true,
|
|
21
|
+
});
|
|
22
|
+
yield queryInterface.addColumn('users', 'passwordResetTokenExpiresAt', {
|
|
23
|
+
type: sequelize_1.DataTypes.DATE,
|
|
24
|
+
allowNull: true,
|
|
25
|
+
});
|
|
26
|
+
console.log('All columns added successfully.');
|
|
27
|
+
// Add index
|
|
28
|
+
yield queryInterface.addIndex('users', {
|
|
29
|
+
fields: ['passwordResetToken'],
|
|
30
|
+
name: 'users_password_reset_token',
|
|
31
|
+
});
|
|
32
|
+
// Add index
|
|
33
|
+
yield queryInterface.addIndex('users', {
|
|
34
|
+
fields: ['passwordResetTokenExpiresAt'],
|
|
35
|
+
name: 'users_password_reset_token_expires_at',
|
|
36
|
+
});
|
|
37
|
+
console.log('All indexes added successfully.');
|
|
38
|
+
}
|
|
39
|
+
catch (error) {
|
|
40
|
+
console.error('Error while adding columns:', error.message);
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
exports.up = up;
|
|
44
|
+
const down = (queryInterface) => __awaiter(void 0, void 0, void 0, function* () {
|
|
45
|
+
try {
|
|
46
|
+
// Remove columns
|
|
47
|
+
yield queryInterface.removeColumn('users', 'passwordResetToken');
|
|
48
|
+
yield queryInterface.removeColumn('users', 'passwordResetTokenExpiresAt');
|
|
49
|
+
console.log('All columns removed successfully.');
|
|
50
|
+
// Remove index
|
|
51
|
+
yield queryInterface.removeIndex('users', 'users_password_reset_token');
|
|
52
|
+
// Remove index
|
|
53
|
+
yield queryInterface.removeIndex('users', 'users_password_reset_token_expires_at');
|
|
54
|
+
console.log('All indexes removed successfully.');
|
|
55
|
+
}
|
|
56
|
+
catch (error) {
|
|
57
|
+
console.error('Error while removing columns:', error.message);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
exports.down = down;
|
package/dist/models/User.d.ts
CHANGED
|
@@ -14,6 +14,8 @@ export declare class User extends Model<Partial<User>> {
|
|
|
14
14
|
otp?: string;
|
|
15
15
|
role?: Role;
|
|
16
16
|
isVerified: boolean;
|
|
17
|
+
passwordResetToken?: string;
|
|
18
|
+
passwordResetTokenExpiresAt?: Date;
|
|
17
19
|
static checkEmail(email: string): Promise<void>;
|
|
18
20
|
generateSession(secret: string): string;
|
|
19
21
|
}
|
package/dist/models/User.js
CHANGED
|
@@ -128,6 +128,21 @@ __decorate([
|
|
|
128
128
|
}),
|
|
129
129
|
__metadata("design:type", Boolean)
|
|
130
130
|
], User.prototype, "isVerified", void 0);
|
|
131
|
+
__decorate([
|
|
132
|
+
sequelize_typescript_1.Index,
|
|
133
|
+
(0, sequelize_typescript_1.Column)({
|
|
134
|
+
type: sequelize_typescript_1.DataType.STRING,
|
|
135
|
+
allowNull: true,
|
|
136
|
+
}),
|
|
137
|
+
__metadata("design:type", String)
|
|
138
|
+
], User.prototype, "passwordResetToken", void 0);
|
|
139
|
+
__decorate([
|
|
140
|
+
(0, sequelize_typescript_1.Column)({
|
|
141
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
142
|
+
allowNull: true,
|
|
143
|
+
}),
|
|
144
|
+
__metadata("design:type", Date)
|
|
145
|
+
], User.prototype, "passwordResetTokenExpiresAt", void 0);
|
|
131
146
|
exports.User = User = User_1 = __decorate([
|
|
132
147
|
(0, sequelize_typescript_1.Table)({
|
|
133
148
|
tableName: 'users',
|
package/package.json
CHANGED
package/dist/models/Search.d.ts
DELETED
package/dist/models/Search.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
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.Search = void 0;
|
|
13
|
-
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
-
let Search = class Search extends sequelize_typescript_1.Model {
|
|
15
|
-
};
|
|
16
|
-
exports.Search = Search;
|
|
17
|
-
__decorate([
|
|
18
|
-
sequelize_typescript_1.PrimaryKey,
|
|
19
|
-
sequelize_typescript_1.Index,
|
|
20
|
-
(0, sequelize_typescript_1.Column)({
|
|
21
|
-
type: sequelize_typescript_1.DataType.STRING(32),
|
|
22
|
-
}),
|
|
23
|
-
__metadata("design:type", String)
|
|
24
|
-
], Search.prototype, "id", void 0);
|
|
25
|
-
__decorate([
|
|
26
|
-
(0, sequelize_typescript_1.Column)({
|
|
27
|
-
type: sequelize_typescript_1.DataType.INTEGER,
|
|
28
|
-
allowNull: false,
|
|
29
|
-
defaultValue: 0,
|
|
30
|
-
}),
|
|
31
|
-
__metadata("design:type", Number)
|
|
32
|
-
], Search.prototype, "hits", void 0);
|
|
33
|
-
__decorate([
|
|
34
|
-
sequelize_typescript_1.Unique,
|
|
35
|
-
sequelize_typescript_1.Index,
|
|
36
|
-
(0, sequelize_typescript_1.Column)({
|
|
37
|
-
type: sequelize_typescript_1.DataType.DATE,
|
|
38
|
-
}),
|
|
39
|
-
__metadata("design:type", Date)
|
|
40
|
-
], Search.prototype, "cacheUpdatedAt", void 0);
|
|
41
|
-
__decorate([
|
|
42
|
-
sequelize_typescript_1.Unique,
|
|
43
|
-
sequelize_typescript_1.Index,
|
|
44
|
-
(0, sequelize_typescript_1.Column)({
|
|
45
|
-
type: sequelize_typescript_1.DataType.DATE,
|
|
46
|
-
}),
|
|
47
|
-
__metadata("design:type", Date)
|
|
48
|
-
], Search.prototype, "cacheQueuedAt", void 0);
|
|
49
|
-
__decorate([
|
|
50
|
-
(0, sequelize_typescript_1.Column)({
|
|
51
|
-
type: sequelize_typescript_1.DataType.JSONB,
|
|
52
|
-
allowNull: false,
|
|
53
|
-
defaultValue: {},
|
|
54
|
-
}),
|
|
55
|
-
__metadata("design:type", Object)
|
|
56
|
-
], Search.prototype, "data", void 0);
|
|
57
|
-
exports.Search = Search = __decorate([
|
|
58
|
-
(0, sequelize_typescript_1.Table)({
|
|
59
|
-
tableName: 'searches',
|
|
60
|
-
})
|
|
61
|
-
], Search);
|