hh-contracts 0.0.95 → 0.0.97
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/CHANGELOG.md +5 -0
- package/app-menu/get.query.ts +2 -2
- package/build/app-menu/get.query.js +1 -1
- package/build/common/constants/domain-name.constant.js +9 -0
- package/build/common/constants/index.js +2 -0
- package/build/common/constants/slug.constant.js +1 -0
- package/build/common/constants/time-zone.constant.js +7 -0
- package/build/common/models/domain-name.schema.js +47 -0
- package/build/common/models/index.js +3 -1
- package/build/common/models/slug.schema.js +5 -1
- package/build/common/models/timestamp.schemas.js +4 -1
- package/build/common/models/timezone.schema.js +43 -0
- package/build/common/models/{uuid-array.schema.js → uuid.schemas.js} +3 -2
- package/build/companies/company.models.js +1 -1
- package/build/hotels/amenities/hotel-amenity.model.js +44 -0
- package/build/hotels/amenities/index.js +17 -0
- package/build/hotels/constants/hotel-amenity.constant.js +15 -0
- package/build/hotels/constants/hotel-contact-type.constant.js +9 -0
- package/build/hotels/constants/hotel-feature.constant.js +11 -0
- package/build/hotels/constants/hotel-integration-connection-state.constant.js +10 -0
- package/build/hotels/constants/hotel-integration-credential-status.constant.js +9 -0
- package/build/hotels/constants/hotel-integration-provider.constant.js +7 -0
- package/build/hotels/constants/hotel-integration-sync-status.constant.js +10 -0
- package/build/hotels/constants/hotel-policy-type.constant.js +11 -0
- package/build/hotels/constants/hotel-rating-source.constant.js +9 -0
- package/build/hotels/constants/index.js +25 -0
- package/build/hotels/contacts/hotel-contact.model.js +48 -0
- package/build/hotels/contacts/index.js +17 -0
- package/build/hotels/contracts/create-hotel.contract.js +14 -0
- package/build/hotels/contracts/delete-hotel.contract.js +46 -0
- package/build/hotels/contracts/find-hotel.contract.js +18 -0
- package/build/hotels/contracts/find-many-hotels.contract.js +67 -0
- package/build/hotels/contracts/index.js +4 -0
- package/build/hotels/contracts/update-hotel.contract.js +15 -0
- package/build/hotels/domains/contracts/find-hotel-domain-settings.contract.js +13 -0
- package/build/hotels/domains/contracts/index.js +18 -0
- package/build/hotels/domains/contracts/update-hotel-domain-settings.contract.js +14 -0
- package/build/hotels/domains/hotel-domains.api.js +12 -0
- package/build/hotels/domains/hotel-domains.schema.js +49 -0
- package/build/hotels/domains/index.js +19 -0
- package/build/hotels/{hotel.model.js → features/hotel-feature.model.js} +8 -9
- package/build/hotels/features/index.js +17 -0
- package/build/hotels/hotel.models.js +83 -0
- package/build/hotels/hotels.api.js +14 -5
- package/build/hotels/index.js +10 -1
- package/build/hotels/integrations/configs/index.js +17 -0
- package/build/hotels/integrations/configs/opera-integration-config.model.js +41 -0
- package/build/hotels/integrations/contracts/create-hotel-integration.contract.js +14 -0
- package/build/hotels/integrations/contracts/delete-hotel-integration.contract.js +46 -0
- package/build/hotels/integrations/contracts/find-all-hotel-integrations.contract.js +47 -0
- package/build/hotels/integrations/contracts/find-hotel-integration.contract.js +13 -0
- package/build/hotels/integrations/contracts/index.js +21 -0
- package/build/hotels/integrations/contracts/update-hotel-integration.contract.js +14 -0
- package/build/hotels/integrations/hotel-integration.model.js +97 -0
- package/build/hotels/integrations/hotel-integrations.api.js +17 -0
- package/build/hotels/integrations/index.js +19 -0
- package/build/hotels/location/hotel-location.model.js +51 -0
- package/build/hotels/location/index.js +17 -0
- package/build/hotels/policies/hotel-policy.model.js +49 -0
- package/build/hotels/policies/index.js +17 -0
- package/build/hotels/ratings/hotel-rating.model.js +48 -0
- package/build/hotels/ratings/index.js +17 -0
- package/build/hotels/sites/contracts/find-hotel-site-page-by-lang.contract.js +3 -3
- package/build/hotels/sites/hotel-pages.api.js +24 -0
- package/build/hotels/sites/index.js +1 -0
- package/build/hotels/themes/contracts/find-hotel-theme.contract.js +3 -3
- package/build/hotels/themes/hotel-themes.api.js +20 -0
- package/build/hotels/themes/index.js +1 -0
- package/build/permissions/contracts/create-permission.contract.js +2 -6
- package/build/permissions/contracts/delete-permission.contract.js +35 -2
- package/build/permissions/contracts/find-permission.contract.js +1 -8
- package/build/permissions/contracts/update-permission.contract.js +1 -1
- package/build/permissions/permission.models.js +12 -25
- package/build/roles/contracts/create-role.contract.js +2 -6
- package/build/roles/contracts/delete-role.contract.js +35 -2
- package/build/roles/contracts/find-role.contract.js +1 -1
- package/build/roles/contracts/update-role.contract.js +1 -1
- package/build/roles/role.models.js +14 -11
- package/build/translate/contracts/translate-object.contract.js +3 -0
- package/common/constants/domain-name.constant.ts +8 -0
- package/common/constants/index.ts +2 -0
- package/common/constants/slug.constant.ts +2 -1
- package/common/constants/time-zone.constant.ts +4 -0
- package/common/models/domain-name.schema.ts +14 -0
- package/common/models/index.ts +3 -1
- package/common/models/slug.schema.ts +5 -1
- package/common/models/timestamp.schemas.ts +4 -0
- package/common/models/timezone.schema.ts +10 -0
- package/common/models/uuid.schemas.ts +4 -0
- package/companies/company.models.ts +2 -2
- package/hotels/amenities/hotel-amenity.model.ts +10 -0
- package/hotels/amenities/index.ts +1 -0
- package/hotels/constants/hotel-amenity.constant.ts +18 -0
- package/hotels/constants/hotel-contact-type.constant.ts +12 -0
- package/hotels/constants/hotel-feature.constant.ts +14 -0
- package/hotels/constants/hotel-integration-connection-state.constant.ts +13 -0
- package/hotels/constants/hotel-integration-credential-status.constant.ts +12 -0
- package/hotels/constants/hotel-integration-provider.constant.ts +11 -0
- package/hotels/constants/hotel-integration-sync-status.constant.ts +13 -0
- package/hotels/constants/hotel-policy-type.constant.ts +15 -0
- package/hotels/constants/hotel-rating-source.constant.ts +12 -0
- package/hotels/constants/index.ts +9 -0
- package/hotels/contacts/hotel-contact.model.ts +15 -0
- package/hotels/contacts/index.ts +1 -0
- package/hotels/contracts/create-hotel.contract.ts +16 -0
- package/hotels/contracts/delete-hotel.contract.ts +12 -0
- package/hotels/contracts/find-hotel.contract.ts +27 -1
- package/hotels/contracts/find-many-hotels.contract.ts +43 -0
- package/hotels/contracts/index.ts +4 -0
- package/hotels/contracts/update-hotel.contract.ts +17 -0
- package/hotels/domains/contracts/find-hotel-domain-settings.contract.ts +13 -0
- package/hotels/domains/contracts/index.ts +2 -0
- package/hotels/domains/contracts/update-hotel-domain-settings.contract.ts +16 -0
- package/hotels/domains/hotel-domains.api.ts +11 -0
- package/hotels/domains/hotel-domains.schema.ts +25 -0
- package/hotels/domains/index.ts +3 -0
- package/hotels/features/hotel-feature.model.ts +14 -0
- package/hotels/features/index.ts +1 -0
- package/hotels/hotel.models.ts +70 -0
- package/hotels/hotels.api.ts +14 -4
- package/hotels/index.ts +10 -1
- package/hotels/integrations/configs/index.ts +1 -0
- package/hotels/integrations/configs/opera-integration-config.model.ts +6 -0
- package/hotels/integrations/contracts/create-hotel-integration.contract.ts +21 -0
- package/hotels/integrations/contracts/delete-hotel-integration.contract.ts +14 -0
- package/hotels/integrations/contracts/find-all-hotel-integrations.contract.ts +15 -0
- package/hotels/integrations/contracts/find-hotel-integration.contract.ts +15 -0
- package/hotels/integrations/contracts/index.ts +5 -0
- package/hotels/integrations/contracts/update-hotel-integration.contract.ts +21 -0
- package/hotels/integrations/hotel-integration.model.ts +80 -0
- package/hotels/integrations/hotel-integrations.api.ts +16 -0
- package/hotels/integrations/index.ts +3 -0
- package/hotels/location/hotel-location.model.ts +17 -0
- package/hotels/location/index.ts +1 -0
- package/hotels/policies/hotel-policy.model.ts +16 -0
- package/hotels/policies/index.ts +1 -0
- package/hotels/ratings/hotel-rating.model.ts +15 -0
- package/hotels/ratings/index.ts +1 -0
- package/hotels/sites/contracts/find-hotel-site-page-by-lang.contract.ts +3 -3
- package/hotels/sites/hotel-pages.api.ts +24 -0
- package/hotels/sites/index.ts +1 -0
- package/hotels/themes/contracts/find-hotel-theme.contract.ts +3 -3
- package/hotels/themes/hotel-themes.api.ts +20 -0
- package/hotels/themes/index.ts +1 -0
- package/package.json +1 -1
- package/permissions/contracts/create-permission.contract.ts +3 -7
- package/permissions/contracts/delete-permission.contract.ts +1 -2
- package/permissions/contracts/find-permission.contract.ts +2 -10
- package/permissions/contracts/update-permission.contract.ts +2 -2
- package/permissions/permission.models.ts +18 -31
- package/roles/contracts/create-role.contract.ts +3 -7
- package/roles/contracts/delete-role.contract.ts +1 -2
- package/roles/contracts/find-role.contract.ts +2 -2
- package/roles/contracts/update-role.contract.ts +2 -2
- package/roles/role.models.ts +26 -15
- package/translate/contracts/translate-object.contract.ts +3 -0
- package/build/permissions/permission.response.schema.js +0 -8
- package/common/models/uuid-array.schema.ts +0 -3
- package/hotels/hotel.model.ts +0 -14
- package/permissions/permission.response.schema.ts +0 -8
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateHotelContract = void 0;
|
|
4
|
+
const common_1 = require("../../common");
|
|
5
|
+
const hotels_api_1 = require("../hotels.api");
|
|
6
|
+
const hotel_models_1 = require("../hotel.models");
|
|
7
|
+
const create_hotel_contract_1 = require("./create-hotel.contract");
|
|
8
|
+
var UpdateHotelContract;
|
|
9
|
+
(function (UpdateHotelContract) {
|
|
10
|
+
UpdateHotelContract.getUrl = hotels_api_1.HOTELS_API.updateById;
|
|
11
|
+
UpdateHotelContract.endpoint = hotels_api_1.HOTELS_CONTROLLER.endpoints.updateById;
|
|
12
|
+
UpdateHotelContract.httpMethod = common_1.HTTP_METHODS.put;
|
|
13
|
+
UpdateHotelContract.RequestSchema = create_hotel_contract_1.CreateHotelContract.RequestSchema;
|
|
14
|
+
UpdateHotelContract.ResponseSchema = hotel_models_1.HotelDetailSchema;
|
|
15
|
+
})(UpdateHotelContract || (exports.UpdateHotelContract = UpdateHotelContract = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindHotelDomainsContract = void 0;
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const hotel_domains_api_1 = require("../hotel-domains.api");
|
|
6
|
+
const hotel_domains_schema_1 = require("../hotel-domains.schema");
|
|
7
|
+
var FindHotelDomainsContract;
|
|
8
|
+
(function (FindHotelDomainsContract) {
|
|
9
|
+
FindHotelDomainsContract.getUrl = hotel_domains_api_1.HOTEL_DOMAINS_API.find;
|
|
10
|
+
FindHotelDomainsContract.endpoint = hotel_domains_api_1.HOTEL_DOMAINS_CONTROLLER.endpoints.find;
|
|
11
|
+
FindHotelDomainsContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
12
|
+
FindHotelDomainsContract.ResponseSchema = hotel_domains_schema_1.HotelDomainListSchema;
|
|
13
|
+
})(FindHotelDomainsContract || (exports.FindHotelDomainsContract = FindHotelDomainsContract = {}));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./find-hotel-domain-settings.contract"), exports);
|
|
18
|
+
__exportStar(require("./update-hotel-domain-settings.contract"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateHotelDomainContract = void 0;
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const hotel_domains_api_1 = require("../hotel-domains.api");
|
|
6
|
+
const hotel_domains_schema_1 = require("../hotel-domains.schema");
|
|
7
|
+
var UpdateHotelDomainContract;
|
|
8
|
+
(function (UpdateHotelDomainContract) {
|
|
9
|
+
UpdateHotelDomainContract.getUrl = hotel_domains_api_1.HOTEL_DOMAINS_API.update;
|
|
10
|
+
UpdateHotelDomainContract.endpoint = hotel_domains_api_1.HOTEL_DOMAINS_CONTROLLER.endpoints.update;
|
|
11
|
+
UpdateHotelDomainContract.httpMethod = common_1.HTTP_METHODS.put;
|
|
12
|
+
UpdateHotelDomainContract.RequestSchema = hotel_domains_schema_1.HotelDomainSchema;
|
|
13
|
+
UpdateHotelDomainContract.ResponseSchema = hotel_domains_schema_1.HotelDomainPersistedSchema;
|
|
14
|
+
})(UpdateHotelDomainContract || (exports.UpdateHotelDomainContract = UpdateHotelDomainContract = {}));
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_DOMAINS_API = exports.HOTEL_DOMAINS_CONTROLLER = void 0;
|
|
4
|
+
const utils_1 = require("../../common/utils");
|
|
5
|
+
exports.HOTEL_DOMAINS_CONTROLLER = {
|
|
6
|
+
prefix: 'hotels/by-id/:hotelId/domains',
|
|
7
|
+
endpoints: {
|
|
8
|
+
find: '',
|
|
9
|
+
update: '',
|
|
10
|
+
},
|
|
11
|
+
};
|
|
12
|
+
exports.HOTEL_DOMAINS_API = (0, utils_1.createApi)(exports.HOTEL_DOMAINS_CONTROLLER);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.HotelDomainListSchema = exports.HotelDomainPersistedSchema = exports.HotelDomainSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../common");
|
|
39
|
+
exports.HotelDomainSchema = z.object({
|
|
40
|
+
kindOfApp: z.enum(common_1.KIND_OF_APP_VALUES),
|
|
41
|
+
customDomain: common_1.DomainNameSchema.optional(),
|
|
42
|
+
isCustomDomainVerified: z.boolean().default(false),
|
|
43
|
+
customDomainVerifiedAt: common_1.IsoDatetimeSchema.optional(),
|
|
44
|
+
});
|
|
45
|
+
exports.HotelDomainPersistedSchema = exports.HotelDomainSchema.extend({
|
|
46
|
+
id: common_1.UuidSchema,
|
|
47
|
+
hotelId: common_1.UuidSchema,
|
|
48
|
+
}).extend(common_1.TimestampSchema.shape);
|
|
49
|
+
exports.HotelDomainListSchema = z.array(exports.HotelDomainPersistedSchema);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hotel-domains.schema"), exports);
|
|
18
|
+
__exportStar(require("./hotel-domains.api"), exports);
|
|
19
|
+
__exportStar(require("./contracts"), exports);
|
|
@@ -33,16 +33,15 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.
|
|
36
|
+
exports.HotelFeatureSchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
|
-
const common_1 = require("
|
|
39
|
-
|
|
38
|
+
const common_1 = require("../../common");
|
|
39
|
+
const constants_1 = require("../constants");
|
|
40
|
+
exports.HotelFeatureSchema = z
|
|
40
41
|
.object({
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
defaultLang: z.enum(common_1.LANGUAGE_KEYS),
|
|
46
|
-
availableLangs: z.array(z.enum(common_1.LANGUAGE_KEYS)),
|
|
42
|
+
hotelId: z.uuid(),
|
|
43
|
+
feature: z.enum(constants_1.HOTEL_FEATURE_VALUES),
|
|
44
|
+
enabled: z.boolean(),
|
|
45
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
47
46
|
})
|
|
48
47
|
.extend(common_1.TimestampSchema.shape);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hotel-feature.model"), exports);
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.HotelListItemSchema = exports.HotelDetailSchema = exports.HotelWithTranslationsSchema = exports.HotelWriteSchema = exports.HotelTranslationsSchema = exports.HotelPersistedSchema = exports.HotelSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../common");
|
|
39
|
+
exports.HotelSchema = z.object({
|
|
40
|
+
slug: common_1.SlugSchema,
|
|
41
|
+
chainId: common_1.UuidSchema.optional(),
|
|
42
|
+
status: z.enum(common_1.AppStatuses.HOTEL_VALUES).optional(), // сервер может проставить дефолт
|
|
43
|
+
category: z.string().min(1).max(64).optional(),
|
|
44
|
+
timezone: common_1.TimezoneSchema,
|
|
45
|
+
currency: z.string().length(3),
|
|
46
|
+
defaultLang: z.enum(common_1.LANGUAGE_KEYS),
|
|
47
|
+
availableLangs: z.array(z.enum(common_1.LANGUAGE_KEYS)),
|
|
48
|
+
stars: z.number().int().min(1).max(5).optional(),
|
|
49
|
+
checkInFrom: common_1.IsoTimeSchema,
|
|
50
|
+
checkOutUntil: common_1.IsoTimeSchema,
|
|
51
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
52
|
+
});
|
|
53
|
+
exports.HotelPersistedSchema = exports.HotelSchema.required({ status: true }).extend({
|
|
54
|
+
id: common_1.UuidSchema,
|
|
55
|
+
version: z.number().int().nonnegative(),
|
|
56
|
+
...common_1.TimestampSchema.shape,
|
|
57
|
+
});
|
|
58
|
+
exports.HotelTranslationsSchema = z.object({
|
|
59
|
+
name: z.string().min(3),
|
|
60
|
+
description: z.string().optional(),
|
|
61
|
+
});
|
|
62
|
+
exports.HotelWriteSchema = exports.HotelSchema.extend({
|
|
63
|
+
translations: (0, common_1.makeTranslations)(exports.HotelTranslationsSchema),
|
|
64
|
+
});
|
|
65
|
+
exports.HotelWithTranslationsSchema = exports.HotelPersistedSchema.extend({
|
|
66
|
+
translations: (0, common_1.makeTranslations)(exports.HotelTranslationsSchema),
|
|
67
|
+
});
|
|
68
|
+
exports.HotelDetailSchema = exports.HotelPersistedSchema.extend({
|
|
69
|
+
translations: (0, common_1.makeTranslations)(exports.HotelTranslationsSchema),
|
|
70
|
+
});
|
|
71
|
+
exports.HotelListItemSchema = exports.HotelPersistedSchema.omit({
|
|
72
|
+
chainId: true,
|
|
73
|
+
metadata: true,
|
|
74
|
+
timezone: true,
|
|
75
|
+
currency: true,
|
|
76
|
+
defaultLang: true,
|
|
77
|
+
availableLangs: true,
|
|
78
|
+
checkInFrom: true,
|
|
79
|
+
checkOutUntil: true,
|
|
80
|
+
version: true,
|
|
81
|
+
}).extend({
|
|
82
|
+
name: z.string().nullable(),
|
|
83
|
+
});
|
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HOTELS_BY_SLUG_API = exports.HOTELS_BY_SLUG_CONTROLLER = void 0;
|
|
3
|
+
exports.HOTELS_BY_SLUG_API = exports.HOTELS_API = exports.HOTELS_BY_SLUG_CONTROLLER = exports.HOTELS_CONTROLLER = void 0;
|
|
4
4
|
const utils_1 = require("../common/utils");
|
|
5
|
+
exports.HOTELS_CONTROLLER = {
|
|
6
|
+
prefix: 'hotels',
|
|
7
|
+
endpoints: {
|
|
8
|
+
create: '',
|
|
9
|
+
findMany: '',
|
|
10
|
+
findById: 'by-id/:hotelId',
|
|
11
|
+
updateById: 'by-id/:hotelId',
|
|
12
|
+
deleteById: 'by-id/:hotelId',
|
|
13
|
+
},
|
|
14
|
+
};
|
|
5
15
|
exports.HOTELS_BY_SLUG_CONTROLLER = {
|
|
6
|
-
prefix: 'hotels/by-slug',
|
|
16
|
+
prefix: 'hotels/by-slug/:hotelSlug',
|
|
7
17
|
endpoints: {
|
|
8
|
-
|
|
9
|
-
findSitePageByLang: ':hotelSlug/sites/pages/:slug',
|
|
10
|
-
findSitePage: ':hotelSlug/sites/pages/:slug',
|
|
18
|
+
find: '',
|
|
11
19
|
},
|
|
12
20
|
};
|
|
21
|
+
exports.HOTELS_API = (0, utils_1.createApi)(exports.HOTELS_CONTROLLER);
|
|
13
22
|
exports.HOTELS_BY_SLUG_API = (0, utils_1.createApi)(exports.HOTELS_BY_SLUG_CONTROLLER);
|
package/build/hotels/index.js
CHANGED
|
@@ -15,7 +15,16 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./contracts"), exports);
|
|
18
|
+
__exportStar(require("./constants"), exports);
|
|
19
|
+
__exportStar(require("./amenities"), exports);
|
|
20
|
+
__exportStar(require("./contacts"), exports);
|
|
21
|
+
__exportStar(require("./features"), exports);
|
|
22
|
+
__exportStar(require("./integrations"), exports);
|
|
23
|
+
__exportStar(require("./location"), exports);
|
|
24
|
+
__exportStar(require("./policies"), exports);
|
|
25
|
+
__exportStar(require("./ratings"), exports);
|
|
18
26
|
__exportStar(require("./sites"), exports);
|
|
27
|
+
__exportStar(require("./domains"), exports);
|
|
19
28
|
__exportStar(require("./themes"), exports);
|
|
20
|
-
__exportStar(require("./hotel.
|
|
29
|
+
__exportStar(require("./hotel.models"), exports);
|
|
21
30
|
__exportStar(require("./hotels.api"), exports);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./opera-integration-config.model"), exports);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.OperaIntegrationConfigSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const constants_1 = require("../../constants");
|
|
39
|
+
exports.OperaIntegrationConfigSchema = z.object({
|
|
40
|
+
provider: z.literal(constants_1.HOTEL_INTEGRATION_PROVIDERS.opera),
|
|
41
|
+
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CreateHotelIntegrationContract = void 0;
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const hotel_integrations_api_1 = require("../hotel-integrations.api");
|
|
6
|
+
const hotel_integration_model_1 = require("../hotel-integration.model");
|
|
7
|
+
var CreateHotelIntegrationContract;
|
|
8
|
+
(function (CreateHotelIntegrationContract) {
|
|
9
|
+
CreateHotelIntegrationContract.getUrl = hotel_integrations_api_1.HOTEL_INTEGRATIONS_API.create;
|
|
10
|
+
CreateHotelIntegrationContract.endpoint = hotel_integrations_api_1.HOTEL_INTEGRATIONS_CONTROLLER.endpoints.create;
|
|
11
|
+
CreateHotelIntegrationContract.httpMethod = common_1.HTTP_METHODS.post;
|
|
12
|
+
CreateHotelIntegrationContract.RequestSchema = hotel_integration_model_1.HotelIntegrationWriteSchema;
|
|
13
|
+
CreateHotelIntegrationContract.ResponseSchema = hotel_integration_model_1.HotelIntegrationDetailSchema;
|
|
14
|
+
})(CreateHotelIntegrationContract || (exports.CreateHotelIntegrationContract = CreateHotelIntegrationContract = {}));
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.DeleteHotelIntegrationContract = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../../common");
|
|
39
|
+
const hotel_integrations_api_1 = require("../hotel-integrations.api");
|
|
40
|
+
var DeleteHotelIntegrationContract;
|
|
41
|
+
(function (DeleteHotelIntegrationContract) {
|
|
42
|
+
DeleteHotelIntegrationContract.getUrl = hotel_integrations_api_1.HOTEL_INTEGRATIONS_API.delete;
|
|
43
|
+
DeleteHotelIntegrationContract.endpoint = hotel_integrations_api_1.HOTEL_INTEGRATIONS_CONTROLLER.endpoints.delete;
|
|
44
|
+
DeleteHotelIntegrationContract.httpMethod = common_1.HTTP_METHODS.delete;
|
|
45
|
+
DeleteHotelIntegrationContract.ResponseSchema = z.void();
|
|
46
|
+
})(DeleteHotelIntegrationContract || (exports.DeleteHotelIntegrationContract = DeleteHotelIntegrationContract = {}));
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.FindAllHotelIntegrationsContract = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../../common");
|
|
39
|
+
const hotel_integrations_api_1 = require("../hotel-integrations.api");
|
|
40
|
+
const hotel_integration_model_1 = require("../hotel-integration.model");
|
|
41
|
+
var FindAllHotelIntegrationsContract;
|
|
42
|
+
(function (FindAllHotelIntegrationsContract) {
|
|
43
|
+
FindAllHotelIntegrationsContract.getUrl = hotel_integrations_api_1.HOTEL_INTEGRATIONS_API.findAll;
|
|
44
|
+
FindAllHotelIntegrationsContract.endpoint = hotel_integrations_api_1.HOTEL_INTEGRATIONS_CONTROLLER.endpoints.findAll;
|
|
45
|
+
FindAllHotelIntegrationsContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
46
|
+
FindAllHotelIntegrationsContract.ResponseSchema = z.array(hotel_integration_model_1.HotelIntegrationSchema);
|
|
47
|
+
})(FindAllHotelIntegrationsContract || (exports.FindAllHotelIntegrationsContract = FindAllHotelIntegrationsContract = {}));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FindHotelIntegrationContract = void 0;
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const hotel_integrations_api_1 = require("../hotel-integrations.api");
|
|
6
|
+
const hotel_integration_model_1 = require("../hotel-integration.model");
|
|
7
|
+
var FindHotelIntegrationContract;
|
|
8
|
+
(function (FindHotelIntegrationContract) {
|
|
9
|
+
FindHotelIntegrationContract.getUrl = hotel_integrations_api_1.HOTEL_INTEGRATIONS_API.findOne;
|
|
10
|
+
FindHotelIntegrationContract.endpoint = hotel_integrations_api_1.HOTEL_INTEGRATIONS_CONTROLLER.endpoints.findOne;
|
|
11
|
+
FindHotelIntegrationContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
12
|
+
FindHotelIntegrationContract.ResponseSchema = hotel_integration_model_1.HotelIntegrationDetailSchema;
|
|
13
|
+
})(FindHotelIntegrationContract || (exports.FindHotelIntegrationContract = FindHotelIntegrationContract = {}));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./find-all-hotel-integrations.contract"), exports);
|
|
18
|
+
__exportStar(require("./find-hotel-integration.contract"), exports);
|
|
19
|
+
__exportStar(require("./create-hotel-integration.contract"), exports);
|
|
20
|
+
__exportStar(require("./update-hotel-integration.contract"), exports);
|
|
21
|
+
__exportStar(require("./delete-hotel-integration.contract"), exports);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UpdateHotelIntegrationContract = void 0;
|
|
4
|
+
const common_1 = require("../../../common");
|
|
5
|
+
const hotel_integrations_api_1 = require("../hotel-integrations.api");
|
|
6
|
+
const hotel_integration_model_1 = require("../hotel-integration.model");
|
|
7
|
+
var UpdateHotelIntegrationContract;
|
|
8
|
+
(function (UpdateHotelIntegrationContract) {
|
|
9
|
+
UpdateHotelIntegrationContract.getUrl = hotel_integrations_api_1.HOTEL_INTEGRATIONS_API.update;
|
|
10
|
+
UpdateHotelIntegrationContract.endpoint = hotel_integrations_api_1.HOTEL_INTEGRATIONS_CONTROLLER.endpoints.update;
|
|
11
|
+
UpdateHotelIntegrationContract.httpMethod = common_1.HTTP_METHODS.put;
|
|
12
|
+
UpdateHotelIntegrationContract.RequestSchema = hotel_integration_model_1.HotelIntegrationWriteSchema;
|
|
13
|
+
UpdateHotelIntegrationContract.ResponseSchema = hotel_integration_model_1.HotelIntegrationDetailSchema;
|
|
14
|
+
})(UpdateHotelIntegrationContract || (exports.UpdateHotelIntegrationContract = UpdateHotelIntegrationContract = {}));
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.HotelIntegrationCredentialSchema = exports.HotelIntegrationConnectionSchema = exports.HotelIntegrationHotelSchema = exports.HotelIntegrationDetailSchema = exports.HotelIntegrationWriteSchema = exports.HotelIntegrationPersistedSchema = exports.HotelIntegrationSchema = exports.HotelIntegrationConfigSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../common");
|
|
39
|
+
const constants_1 = require("../constants");
|
|
40
|
+
const configs_1 = require("./configs");
|
|
41
|
+
exports.HotelIntegrationConfigSchema = z.discriminatedUnion('provider', [
|
|
42
|
+
configs_1.OperaIntegrationConfigSchema,
|
|
43
|
+
]);
|
|
44
|
+
exports.HotelIntegrationSchema = z.object({
|
|
45
|
+
alias: common_1.SlugSchema,
|
|
46
|
+
config: exports.HotelIntegrationConfigSchema,
|
|
47
|
+
credentialId: z.uuid().nullable().optional(),
|
|
48
|
+
});
|
|
49
|
+
exports.HotelIntegrationPersistedSchema = exports.HotelIntegrationSchema.required({
|
|
50
|
+
credentialId: true,
|
|
51
|
+
}).extend({
|
|
52
|
+
id: z.uuid(),
|
|
53
|
+
secretHash: z.string().min(1),
|
|
54
|
+
secretSalt: z.string().min(1),
|
|
55
|
+
...common_1.TimestampSchema.shape,
|
|
56
|
+
});
|
|
57
|
+
exports.HotelIntegrationWriteSchema = exports.HotelIntegrationSchema;
|
|
58
|
+
exports.HotelIntegrationDetailSchema = exports.HotelIntegrationPersistedSchema.omit({
|
|
59
|
+
secretHash: true,
|
|
60
|
+
secretSalt: true,
|
|
61
|
+
});
|
|
62
|
+
exports.HotelIntegrationHotelSchema = z
|
|
63
|
+
.object({
|
|
64
|
+
id: z.uuid(),
|
|
65
|
+
integrationId: z.uuid(),
|
|
66
|
+
hotelId: z.uuid(),
|
|
67
|
+
hotelExternalId: z.string(),
|
|
68
|
+
isActive: z.boolean().default(true),
|
|
69
|
+
})
|
|
70
|
+
.extend(common_1.TimestampSchema.shape);
|
|
71
|
+
exports.HotelIntegrationConnectionSchema = z
|
|
72
|
+
.object({
|
|
73
|
+
id: z.uuid(),
|
|
74
|
+
integrationId: z.uuid(),
|
|
75
|
+
connectionState: z.enum(constants_1.HOTEL_INTEGRATION_CONNECTION_STATE_VALUES),
|
|
76
|
+
lastHeartbeatAt: z.date(),
|
|
77
|
+
lastSeenAt: z.date(),
|
|
78
|
+
lastSyncStatus: z.enum(constants_1.HOTEL_INTEGRATION_SYNC_STATUS_VALUES),
|
|
79
|
+
lastSyncAt: z.date().nullable(),
|
|
80
|
+
failedAt: z.date().nullable(),
|
|
81
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
82
|
+
})
|
|
83
|
+
.extend(common_1.TimestampSchema.shape);
|
|
84
|
+
exports.HotelIntegrationCredentialSchema = z
|
|
85
|
+
.object({
|
|
86
|
+
id: z.uuid(),
|
|
87
|
+
integrationId: z.uuid(),
|
|
88
|
+
provider: z.enum(constants_1.HOTEL_INTEGRATION_PROVIDER_VALUES),
|
|
89
|
+
login: z.string().min(1),
|
|
90
|
+
encryptedSecret: z.string().min(1),
|
|
91
|
+
encryptionVersion: z.string().min(1),
|
|
92
|
+
status: z.enum(constants_1.HOTEL_INTEGRATION_CREDENTIAL_STATUS_VALUES),
|
|
93
|
+
expiresAt: z.date().nullable(),
|
|
94
|
+
meta: z.record(z.string(), z.unknown()).optional(),
|
|
95
|
+
rotatedAt: z.date().nullable(),
|
|
96
|
+
})
|
|
97
|
+
.extend(common_1.TimestampSchema.shape);
|