whitelabel-db 1.1.92 → 1.1.93
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/index.d.ts +4 -0
- package/dist/index.js +12 -1
- package/dist/libs/database.js +8 -0
- package/dist/models/Collection.d.ts +19 -0
- package/dist/models/Collection.js +90 -0
- package/dist/models/CollectionItem.d.ts +18 -0
- package/dist/models/CollectionItem.js +84 -0
- package/dist/models/CollectionItemCustomField.d.ts +10 -0
- package/dist/models/CollectionItemCustomField.js +67 -0
- package/dist/models/Creator.d.ts +12 -0
- package/dist/models/Creator.js +82 -0
- package/dist/models/Project.d.ts +4 -0
- package/dist/models/Project.js +10 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ export { FacilityTranslation } from './models/FacilityTranslation';
|
|
|
21
21
|
export { Amenity } from './models/Amenity';
|
|
22
22
|
export { RoomAmenity } from './models/RoomAmenity';
|
|
23
23
|
export { AmenityTranslation } from './models/AmenityTranslation';
|
|
24
|
+
export { Creator } from './models/Creator';
|
|
25
|
+
export { Collection, CollectionStatus } from './models/Collection';
|
|
26
|
+
export { CollectionItem, CollectionType } from './models/CollectionItem';
|
|
27
|
+
export { CollectionItemCustomField } from './models/CollectionItemCustomField';
|
|
24
28
|
export { LiteApiClient, HotelsRequest, AvailabilityResult, FullRateAvailabilityResult, RoomType, Rate, PrebookRateRequest, PrebookRate, CheckoutRequest, BookingInfo, CancelBooking, } from './libs/liteapi';
|
|
25
29
|
export { LiteApiClientV3, HotelsRequestV3, AvailabilityResultV3, FullRateAvailabilityResultV3, RoomTypeV3, RateV3, PrebookRateRequestV3, PrebookRateV3, CheckoutRequestV3, BookingInfoV3, CancelBookingV3, BookedRoomV3, OccupancyV3, GuestV3, GuestBookingV3, PromoCodeRequest, PromoCodeResponse, EsimplyPackage, Addon, AddonResponse, } from './libs/liteapiv3';
|
|
26
30
|
export { LiteApiUser, LiteApiUserRequest } from './libs/liteapiuser';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LiteApiUser = exports.LiteApiClientV3 = exports.LiteApiClient = exports.AmenityTranslation = exports.RoomAmenity = exports.Amenity = exports.FacilityTranslation = exports.HotelFacility = exports.Facility = exports.AnalyticsSummary = exports.HotelRate = exports.Feedback = exports.Referral = exports.HotelAccessibility = exports.Guest = exports.HotelTranslation = exports.Role = exports.Booking = exports.Project = exports.User = exports.Hotel = exports.Country = exports.City = exports.Agency = exports.runMigrations = exports.connect = void 0;
|
|
3
|
+
exports.LiteApiUser = exports.LiteApiClientV3 = exports.LiteApiClient = exports.CollectionItemCustomField = exports.CollectionType = exports.CollectionItem = exports.CollectionStatus = exports.Collection = exports.Creator = exports.AmenityTranslation = exports.RoomAmenity = exports.Amenity = exports.FacilityTranslation = exports.HotelFacility = exports.Facility = exports.AnalyticsSummary = exports.HotelRate = exports.Feedback = exports.Referral = exports.HotelAccessibility = exports.Guest = exports.HotelTranslation = exports.Role = exports.Booking = exports.Project = exports.User = exports.Hotel = exports.Country = exports.City = exports.Agency = exports.runMigrations = exports.connect = void 0;
|
|
4
4
|
var database_1 = require("./libs/database");
|
|
5
5
|
Object.defineProperty(exports, "connect", { enumerable: true, get: function () { return database_1.connect; } });
|
|
6
6
|
var migration_1 = require("./libs/migration");
|
|
@@ -48,6 +48,17 @@ var RoomAmenity_1 = require("./models/RoomAmenity");
|
|
|
48
48
|
Object.defineProperty(exports, "RoomAmenity", { enumerable: true, get: function () { return RoomAmenity_1.RoomAmenity; } });
|
|
49
49
|
var AmenityTranslation_1 = require("./models/AmenityTranslation");
|
|
50
50
|
Object.defineProperty(exports, "AmenityTranslation", { enumerable: true, get: function () { return AmenityTranslation_1.AmenityTranslation; } });
|
|
51
|
+
// Collection and Creator models
|
|
52
|
+
var Creator_1 = require("./models/Creator");
|
|
53
|
+
Object.defineProperty(exports, "Creator", { enumerable: true, get: function () { return Creator_1.Creator; } });
|
|
54
|
+
var Collection_1 = require("./models/Collection");
|
|
55
|
+
Object.defineProperty(exports, "Collection", { enumerable: true, get: function () { return Collection_1.Collection; } });
|
|
56
|
+
Object.defineProperty(exports, "CollectionStatus", { enumerable: true, get: function () { return Collection_1.CollectionStatus; } });
|
|
57
|
+
var CollectionItem_1 = require("./models/CollectionItem");
|
|
58
|
+
Object.defineProperty(exports, "CollectionItem", { enumerable: true, get: function () { return CollectionItem_1.CollectionItem; } });
|
|
59
|
+
Object.defineProperty(exports, "CollectionType", { enumerable: true, get: function () { return CollectionItem_1.CollectionType; } });
|
|
60
|
+
var CollectionItemCustomField_1 = require("./models/CollectionItemCustomField");
|
|
61
|
+
Object.defineProperty(exports, "CollectionItemCustomField", { enumerable: true, get: function () { return CollectionItemCustomField_1.CollectionItemCustomField; } });
|
|
51
62
|
var liteapi_1 = require("./libs/liteapi");
|
|
52
63
|
Object.defineProperty(exports, "LiteApiClient", { enumerable: true, get: function () { return liteapi_1.LiteApiClient; } });
|
|
53
64
|
var liteapiv3_1 = require("./libs/liteapiv3");
|
package/dist/libs/database.js
CHANGED
|
@@ -32,6 +32,10 @@ const Amenity_1 = require("../models/Amenity");
|
|
|
32
32
|
const RoomAmenity_1 = require("../models/RoomAmenity");
|
|
33
33
|
const AmenityTranslation_1 = require("../models/AmenityTranslation");
|
|
34
34
|
const AnalyticsSummary_1 = require("../models/AnalyticsSummary");
|
|
35
|
+
const Creator_1 = require("../models/Creator");
|
|
36
|
+
const Collection_1 = require("../models/Collection");
|
|
37
|
+
const CollectionItem_1 = require("../models/CollectionItem");
|
|
38
|
+
const CollectionItemCustomField_1 = require("../models/CollectionItemCustomField");
|
|
35
39
|
const connect = (connectionDetails) => __awaiter(void 0, void 0, void 0, function* () {
|
|
36
40
|
const connection = new sequelize_typescript_1.Sequelize({
|
|
37
41
|
dialect: 'postgres',
|
|
@@ -62,6 +66,10 @@ const connect = (connectionDetails) => __awaiter(void 0, void 0, void 0, functio
|
|
|
62
66
|
RoomAmenity_1.RoomAmenity,
|
|
63
67
|
AmenityTranslation_1.AmenityTranslation,
|
|
64
68
|
AnalyticsSummary_1.AnalyticsSummary,
|
|
69
|
+
Creator_1.Creator,
|
|
70
|
+
Collection_1.Collection,
|
|
71
|
+
CollectionItem_1.CollectionItem,
|
|
72
|
+
CollectionItemCustomField_1.CollectionItemCustomField,
|
|
65
73
|
],
|
|
66
74
|
});
|
|
67
75
|
return connection
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Project } from './Project';
|
|
3
|
+
import { CollectionItem } from './CollectionItem';
|
|
4
|
+
export declare enum CollectionStatus {
|
|
5
|
+
PUBLISHED = "published",
|
|
6
|
+
UNPUBLISHED = "unpublished",
|
|
7
|
+
ARCHIVED = "archived",
|
|
8
|
+
DELETED = "deleted"
|
|
9
|
+
}
|
|
10
|
+
export declare class Collection extends Model<Partial<Collection>> {
|
|
11
|
+
id: string;
|
|
12
|
+
projectId: string;
|
|
13
|
+
project?: Project;
|
|
14
|
+
title: string;
|
|
15
|
+
status: CollectionStatus;
|
|
16
|
+
items?: CollectionItem[];
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
updatedAt: Date;
|
|
19
|
+
}
|
|
@@ -0,0 +1,90 @@
|
|
|
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.Collection = exports.CollectionStatus = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const Project_1 = require("./Project");
|
|
15
|
+
const CollectionItem_1 = require("./CollectionItem");
|
|
16
|
+
var CollectionStatus;
|
|
17
|
+
(function (CollectionStatus) {
|
|
18
|
+
CollectionStatus["PUBLISHED"] = "published";
|
|
19
|
+
CollectionStatus["UNPUBLISHED"] = "unpublished";
|
|
20
|
+
CollectionStatus["ARCHIVED"] = "archived";
|
|
21
|
+
CollectionStatus["DELETED"] = "deleted";
|
|
22
|
+
})(CollectionStatus || (exports.CollectionStatus = CollectionStatus = {}));
|
|
23
|
+
let Collection = class Collection extends sequelize_typescript_1.Model {
|
|
24
|
+
};
|
|
25
|
+
exports.Collection = Collection;
|
|
26
|
+
__decorate([
|
|
27
|
+
(0, sequelize_typescript_1.IsUUID)(4),
|
|
28
|
+
sequelize_typescript_1.PrimaryKey,
|
|
29
|
+
(0, sequelize_typescript_1.Column)({
|
|
30
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
31
|
+
defaultValue: sequelize_typescript_1.DataType.UUIDV4,
|
|
32
|
+
}),
|
|
33
|
+
__metadata("design:type", String)
|
|
34
|
+
], Collection.prototype, "id", void 0);
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, sequelize_typescript_1.ForeignKey)(() => Project_1.Project),
|
|
37
|
+
sequelize_typescript_1.Index,
|
|
38
|
+
(0, sequelize_typescript_1.Column)({
|
|
39
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
40
|
+
allowNull: false,
|
|
41
|
+
}),
|
|
42
|
+
__metadata("design:type", String)
|
|
43
|
+
], Collection.prototype, "projectId", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
(0, sequelize_typescript_1.BelongsTo)(() => Project_1.Project),
|
|
46
|
+
__metadata("design:type", Project_1.Project)
|
|
47
|
+
], Collection.prototype, "project", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, sequelize_typescript_1.Column)({
|
|
50
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
51
|
+
allowNull: false,
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], Collection.prototype, "title", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
sequelize_typescript_1.Index,
|
|
57
|
+
(0, sequelize_typescript_1.Column)({
|
|
58
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
59
|
+
allowNull: false,
|
|
60
|
+
validate: {
|
|
61
|
+
isIn: [Object.values(CollectionStatus)],
|
|
62
|
+
},
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", String)
|
|
65
|
+
], Collection.prototype, "status", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
(0, sequelize_typescript_1.HasMany)(() => CollectionItem_1.CollectionItem),
|
|
68
|
+
__metadata("design:type", Array)
|
|
69
|
+
], Collection.prototype, "items", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, sequelize_typescript_1.Column)({
|
|
72
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
73
|
+
allowNull: false,
|
|
74
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Date)
|
|
77
|
+
], Collection.prototype, "createdAt", void 0);
|
|
78
|
+
__decorate([
|
|
79
|
+
(0, sequelize_typescript_1.Column)({
|
|
80
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
81
|
+
allowNull: false,
|
|
82
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
83
|
+
}),
|
|
84
|
+
__metadata("design:type", Date)
|
|
85
|
+
], Collection.prototype, "updatedAt", void 0);
|
|
86
|
+
exports.Collection = Collection = __decorate([
|
|
87
|
+
(0, sequelize_typescript_1.Table)({
|
|
88
|
+
tableName: 'collections',
|
|
89
|
+
})
|
|
90
|
+
], Collection);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Collection } from './Collection';
|
|
3
|
+
import { CollectionItemCustomField } from './CollectionItemCustomField';
|
|
4
|
+
export declare enum CollectionType {
|
|
5
|
+
PROPERTY = "property",
|
|
6
|
+
CITY = "city",
|
|
7
|
+
COUNTRY = "country"
|
|
8
|
+
}
|
|
9
|
+
export declare class CollectionItem extends Model<Partial<CollectionItem>> {
|
|
10
|
+
id: string;
|
|
11
|
+
collectionId: string;
|
|
12
|
+
collection?: Collection;
|
|
13
|
+
item: string;
|
|
14
|
+
type: CollectionType;
|
|
15
|
+
order: number;
|
|
16
|
+
customFields?: CollectionItemCustomField[];
|
|
17
|
+
createdAt: Date;
|
|
18
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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.CollectionItem = exports.CollectionType = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const Collection_1 = require("./Collection");
|
|
15
|
+
const CollectionItemCustomField_1 = require("./CollectionItemCustomField");
|
|
16
|
+
var CollectionType;
|
|
17
|
+
(function (CollectionType) {
|
|
18
|
+
CollectionType["PROPERTY"] = "property";
|
|
19
|
+
CollectionType["CITY"] = "city";
|
|
20
|
+
CollectionType["COUNTRY"] = "country";
|
|
21
|
+
})(CollectionType || (exports.CollectionType = CollectionType = {}));
|
|
22
|
+
let CollectionItem = class CollectionItem extends sequelize_typescript_1.Model {
|
|
23
|
+
};
|
|
24
|
+
exports.CollectionItem = CollectionItem;
|
|
25
|
+
__decorate([
|
|
26
|
+
(0, sequelize_typescript_1.IsUUID)(4),
|
|
27
|
+
sequelize_typescript_1.PrimaryKey,
|
|
28
|
+
(0, sequelize_typescript_1.Column)({
|
|
29
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
30
|
+
defaultValue: sequelize_typescript_1.DataType.UUIDV4,
|
|
31
|
+
}),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], CollectionItem.prototype, "id", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
(0, sequelize_typescript_1.ForeignKey)(() => Collection_1.Collection),
|
|
36
|
+
sequelize_typescript_1.Index,
|
|
37
|
+
(0, sequelize_typescript_1.Column)({
|
|
38
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
39
|
+
allowNull: false,
|
|
40
|
+
}),
|
|
41
|
+
__metadata("design:type", String)
|
|
42
|
+
], CollectionItem.prototype, "collectionId", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
(0, sequelize_typescript_1.BelongsTo)(() => Collection_1.Collection),
|
|
45
|
+
__metadata("design:type", Collection_1.Collection)
|
|
46
|
+
], CollectionItem.prototype, "collection", void 0);
|
|
47
|
+
__decorate([
|
|
48
|
+
(0, sequelize_typescript_1.Column)({
|
|
49
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
50
|
+
allowNull: false,
|
|
51
|
+
}),
|
|
52
|
+
__metadata("design:type", String)
|
|
53
|
+
], CollectionItem.prototype, "item", void 0);
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, sequelize_typescript_1.Column)({
|
|
56
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
57
|
+
allowNull: false,
|
|
58
|
+
}),
|
|
59
|
+
__metadata("design:type", String)
|
|
60
|
+
], CollectionItem.prototype, "type", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
(0, sequelize_typescript_1.Column)({
|
|
63
|
+
type: sequelize_typescript_1.DataType.INTEGER,
|
|
64
|
+
allowNull: false,
|
|
65
|
+
}),
|
|
66
|
+
__metadata("design:type", Number)
|
|
67
|
+
], CollectionItem.prototype, "order", void 0);
|
|
68
|
+
__decorate([
|
|
69
|
+
(0, sequelize_typescript_1.HasMany)(() => CollectionItemCustomField_1.CollectionItemCustomField),
|
|
70
|
+
__metadata("design:type", Array)
|
|
71
|
+
], CollectionItem.prototype, "customFields", void 0);
|
|
72
|
+
__decorate([
|
|
73
|
+
(0, sequelize_typescript_1.Column)({
|
|
74
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
75
|
+
allowNull: false,
|
|
76
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
77
|
+
}),
|
|
78
|
+
__metadata("design:type", Date)
|
|
79
|
+
], CollectionItem.prototype, "createdAt", void 0);
|
|
80
|
+
exports.CollectionItem = CollectionItem = __decorate([
|
|
81
|
+
(0, sequelize_typescript_1.Table)({
|
|
82
|
+
tableName: 'collection_items',
|
|
83
|
+
})
|
|
84
|
+
], CollectionItem);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { CollectionItem } from './CollectionItem';
|
|
3
|
+
export declare class CollectionItemCustomField extends Model<Partial<CollectionItemCustomField>> {
|
|
4
|
+
id: string;
|
|
5
|
+
collectionItemId: string;
|
|
6
|
+
collectionItem?: CollectionItem;
|
|
7
|
+
key: string;
|
|
8
|
+
value: string;
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
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.CollectionItemCustomField = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const CollectionItem_1 = require("./CollectionItem");
|
|
15
|
+
let CollectionItemCustomField = class CollectionItemCustomField extends sequelize_typescript_1.Model {
|
|
16
|
+
};
|
|
17
|
+
exports.CollectionItemCustomField = CollectionItemCustomField;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, sequelize_typescript_1.IsUUID)(4),
|
|
20
|
+
sequelize_typescript_1.PrimaryKey,
|
|
21
|
+
(0, sequelize_typescript_1.Column)({
|
|
22
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
23
|
+
defaultValue: sequelize_typescript_1.DataType.UUIDV4,
|
|
24
|
+
}),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], CollectionItemCustomField.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, sequelize_typescript_1.ForeignKey)(() => CollectionItem_1.CollectionItem),
|
|
29
|
+
sequelize_typescript_1.Index,
|
|
30
|
+
(0, sequelize_typescript_1.Column)({
|
|
31
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
32
|
+
allowNull: false,
|
|
33
|
+
}),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], CollectionItemCustomField.prototype, "collectionItemId", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
(0, sequelize_typescript_1.BelongsTo)(() => CollectionItem_1.CollectionItem),
|
|
38
|
+
__metadata("design:type", CollectionItem_1.CollectionItem)
|
|
39
|
+
], CollectionItemCustomField.prototype, "collectionItem", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
sequelize_typescript_1.Index,
|
|
42
|
+
(0, sequelize_typescript_1.Column)({
|
|
43
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
44
|
+
allowNull: false,
|
|
45
|
+
}),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], CollectionItemCustomField.prototype, "key", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, sequelize_typescript_1.Column)({
|
|
50
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
51
|
+
allowNull: false,
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], CollectionItemCustomField.prototype, "value", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.Column)({
|
|
57
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
58
|
+
allowNull: false,
|
|
59
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
60
|
+
}),
|
|
61
|
+
__metadata("design:type", Date)
|
|
62
|
+
], CollectionItemCustomField.prototype, "createdAt", void 0);
|
|
63
|
+
exports.CollectionItemCustomField = CollectionItemCustomField = __decorate([
|
|
64
|
+
(0, sequelize_typescript_1.Table)({
|
|
65
|
+
tableName: 'collection_item_custom_fields',
|
|
66
|
+
})
|
|
67
|
+
], CollectionItemCustomField);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Model } from 'sequelize-typescript';
|
|
2
|
+
import { Project } from './Project';
|
|
3
|
+
export declare class Creator extends Model<Partial<Creator>> {
|
|
4
|
+
id: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
project?: Project;
|
|
7
|
+
name: string;
|
|
8
|
+
profileImage?: string;
|
|
9
|
+
coverImage?: string;
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
updatedAt: Date;
|
|
12
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
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.Creator = void 0;
|
|
13
|
+
const sequelize_typescript_1 = require("sequelize-typescript");
|
|
14
|
+
const Project_1 = require("./Project");
|
|
15
|
+
let Creator = class Creator extends sequelize_typescript_1.Model {
|
|
16
|
+
};
|
|
17
|
+
exports.Creator = Creator;
|
|
18
|
+
__decorate([
|
|
19
|
+
(0, sequelize_typescript_1.IsUUID)(4),
|
|
20
|
+
sequelize_typescript_1.PrimaryKey,
|
|
21
|
+
(0, sequelize_typescript_1.Column)({
|
|
22
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
23
|
+
defaultValue: sequelize_typescript_1.DataType.UUIDV4,
|
|
24
|
+
}),
|
|
25
|
+
__metadata("design:type", String)
|
|
26
|
+
], Creator.prototype, "id", void 0);
|
|
27
|
+
__decorate([
|
|
28
|
+
(0, sequelize_typescript_1.ForeignKey)(() => Project_1.Project),
|
|
29
|
+
sequelize_typescript_1.Unique,
|
|
30
|
+
sequelize_typescript_1.Index,
|
|
31
|
+
(0, sequelize_typescript_1.Column)({
|
|
32
|
+
type: sequelize_typescript_1.DataType.UUID,
|
|
33
|
+
allowNull: false,
|
|
34
|
+
}),
|
|
35
|
+
__metadata("design:type", String)
|
|
36
|
+
], Creator.prototype, "projectId", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, sequelize_typescript_1.BelongsTo)(() => Project_1.Project),
|
|
39
|
+
__metadata("design:type", Project_1.Project)
|
|
40
|
+
], Creator.prototype, "project", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, sequelize_typescript_1.Column)({
|
|
43
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
44
|
+
allowNull: false,
|
|
45
|
+
}),
|
|
46
|
+
__metadata("design:type", String)
|
|
47
|
+
], Creator.prototype, "name", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
(0, sequelize_typescript_1.Column)({
|
|
50
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
51
|
+
allowNull: true,
|
|
52
|
+
}),
|
|
53
|
+
__metadata("design:type", String)
|
|
54
|
+
], Creator.prototype, "profileImage", void 0);
|
|
55
|
+
__decorate([
|
|
56
|
+
(0, sequelize_typescript_1.Column)({
|
|
57
|
+
type: sequelize_typescript_1.DataType.TEXT,
|
|
58
|
+
allowNull: true,
|
|
59
|
+
}),
|
|
60
|
+
__metadata("design:type", String)
|
|
61
|
+
], Creator.prototype, "coverImage", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, sequelize_typescript_1.Column)({
|
|
64
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
65
|
+
allowNull: false,
|
|
66
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
67
|
+
}),
|
|
68
|
+
__metadata("design:type", Date)
|
|
69
|
+
], Creator.prototype, "createdAt", void 0);
|
|
70
|
+
__decorate([
|
|
71
|
+
(0, sequelize_typescript_1.Column)({
|
|
72
|
+
type: sequelize_typescript_1.DataType.DATE,
|
|
73
|
+
allowNull: false,
|
|
74
|
+
defaultValue: sequelize_typescript_1.DataType.NOW,
|
|
75
|
+
}),
|
|
76
|
+
__metadata("design:type", Date)
|
|
77
|
+
], Creator.prototype, "updatedAt", void 0);
|
|
78
|
+
exports.Creator = Creator = __decorate([
|
|
79
|
+
(0, sequelize_typescript_1.Table)({
|
|
80
|
+
tableName: 'creators',
|
|
81
|
+
})
|
|
82
|
+
], Creator);
|
package/dist/models/Project.d.ts
CHANGED
|
@@ -3,6 +3,8 @@ import { Agency } from './Agency';
|
|
|
3
3
|
import { LiteApiClient } from '../libs/liteapi';
|
|
4
4
|
import { LiteApiClientV3 } from '../libs/liteapiv3';
|
|
5
5
|
import { Booking } from './Booking';
|
|
6
|
+
import { Creator } from './Creator';
|
|
7
|
+
import { Collection } from './Collection';
|
|
6
8
|
export declare class Project extends Model<Partial<Project>> {
|
|
7
9
|
id: string;
|
|
8
10
|
name: string;
|
|
@@ -14,6 +16,8 @@ export declare class Project extends Model<Partial<Project>> {
|
|
|
14
16
|
agencyId?: string;
|
|
15
17
|
agency?: Agency;
|
|
16
18
|
bookings?: Booking[];
|
|
19
|
+
creators?: Creator[];
|
|
20
|
+
collections?: Collection[];
|
|
17
21
|
preferences?: object;
|
|
18
22
|
appearance?: object;
|
|
19
23
|
isActive?: boolean;
|
package/dist/models/Project.js
CHANGED
|
@@ -19,6 +19,8 @@ const Agency_1 = require("./Agency");
|
|
|
19
19
|
const liteapi_1 = require("../libs/liteapi");
|
|
20
20
|
const liteapiv3_1 = require("../libs/liteapiv3");
|
|
21
21
|
const Booking_1 = require("./Booking");
|
|
22
|
+
const Creator_1 = require("./Creator");
|
|
23
|
+
const Collection_1 = require("./Collection");
|
|
22
24
|
const clients = {};
|
|
23
25
|
const clientV3 = {};
|
|
24
26
|
const defaultLiteApiEnvironment = process.env.COPILOT_ENVIRONMENT_NAME === 'production' ? 'production' : 'dev';
|
|
@@ -137,6 +139,14 @@ __decorate([
|
|
|
137
139
|
(0, sequelize_typescript_1.HasMany)(() => Booking_1.Booking),
|
|
138
140
|
__metadata("design:type", Array)
|
|
139
141
|
], Project.prototype, "bookings", void 0);
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, sequelize_typescript_1.HasMany)(() => Creator_1.Creator),
|
|
144
|
+
__metadata("design:type", Array)
|
|
145
|
+
], Project.prototype, "creators", void 0);
|
|
146
|
+
__decorate([
|
|
147
|
+
(0, sequelize_typescript_1.HasMany)(() => Collection_1.Collection),
|
|
148
|
+
__metadata("design:type", Array)
|
|
149
|
+
], Project.prototype, "collections", void 0);
|
|
140
150
|
__decorate([
|
|
141
151
|
(0, sequelize_typescript_1.Column)({
|
|
142
152
|
type: sequelize_typescript_1.DataType.JSONB,
|