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,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_INTEGRATIONS_API = exports.HOTEL_INTEGRATIONS_CONTROLLER = void 0;
|
|
4
|
+
const utils_1 = require("../../common/utils");
|
|
5
|
+
exports.HOTEL_INTEGRATIONS_CONTROLLER = {
|
|
6
|
+
prefix: 'hotels/by-id/:hotelId/integrations',
|
|
7
|
+
endpoints: {
|
|
8
|
+
findAll: 'findAll',
|
|
9
|
+
findOne: ':integrationId',
|
|
10
|
+
create: '',
|
|
11
|
+
update: ':integrationId',
|
|
12
|
+
delete: ':integrationId',
|
|
13
|
+
enable: ':integrationId/enable',
|
|
14
|
+
disable: ':integrationId/disable',
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
exports.HOTEL_INTEGRATIONS_API = (0, utils_1.createApi)(exports.HOTEL_INTEGRATIONS_CONTROLLER);
|
|
@@ -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-integration.model"), exports);
|
|
18
|
+
__exportStar(require("./hotel-integrations.api"), exports);
|
|
19
|
+
__exportStar(require("./contracts"), exports);
|
|
@@ -0,0 +1,51 @@
|
|
|
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.HotelLocationSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../common");
|
|
39
|
+
exports.HotelLocationSchema = z
|
|
40
|
+
.object({
|
|
41
|
+
hotelId: z.uuid(),
|
|
42
|
+
countryCode: z.string().length(2),
|
|
43
|
+
regionCode: z.string().max(32).optional(),
|
|
44
|
+
city: z.string().min(1).max(128),
|
|
45
|
+
addressLine1: z.string().min(1).max(256),
|
|
46
|
+
addressLine2: z.string().max(256).optional(),
|
|
47
|
+
postalCode: z.string().max(16).optional(),
|
|
48
|
+
latitude: z.number().min(-90).max(90),
|
|
49
|
+
longitude: z.number().min(-180).max(180),
|
|
50
|
+
})
|
|
51
|
+
.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-location.model"), exports);
|
|
@@ -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.HotelPolicySchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../common");
|
|
39
|
+
const constants_1 = require("../constants");
|
|
40
|
+
exports.HotelPolicySchema = z
|
|
41
|
+
.object({
|
|
42
|
+
hotelId: z.uuid(),
|
|
43
|
+
policyType: z.enum(constants_1.HOTEL_POLICY_TYPE_VALUES),
|
|
44
|
+
valueKey: z.string().min(1).optional(),
|
|
45
|
+
valueJson: z.record(z.string(), z.unknown()).optional(),
|
|
46
|
+
effectiveFrom: z.date().optional(),
|
|
47
|
+
effectiveTo: z.date().optional(),
|
|
48
|
+
})
|
|
49
|
+
.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-policy.model"), exports);
|
|
@@ -0,0 +1,48 @@
|
|
|
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.HotelRatingSchema = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
38
|
+
const common_1 = require("../../common");
|
|
39
|
+
const constants_1 = require("../constants");
|
|
40
|
+
exports.HotelRatingSchema = z
|
|
41
|
+
.object({
|
|
42
|
+
hotelId: z.uuid(),
|
|
43
|
+
source: z.enum(constants_1.HOTEL_RATING_SOURCE_VALUES),
|
|
44
|
+
value: z.number().min(0).max(10),
|
|
45
|
+
reviewsCount: z.number().int().nonnegative().optional(),
|
|
46
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
47
|
+
})
|
|
48
|
+
.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-rating.model"), exports);
|
|
@@ -36,7 +36,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
36
36
|
exports.FindHotelSitePageByLangContract = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
38
|
const common_1 = require("../../../common");
|
|
39
|
-
const
|
|
39
|
+
const hotel_pages_api_1 = require("../hotel-pages.api");
|
|
40
40
|
const pages_1 = require("../../../pages");
|
|
41
41
|
const FindHotelSitePageByLangContractRequestSchema = z.object({
|
|
42
42
|
lang: common_1.LanguageKeysSchema,
|
|
@@ -48,8 +48,8 @@ const FindHotelSitePageByLangContractResponseSchema = pages_1.PageSchema.omit({
|
|
|
48
48
|
});
|
|
49
49
|
var FindHotelSitePageByLangContract;
|
|
50
50
|
(function (FindHotelSitePageByLangContract) {
|
|
51
|
-
FindHotelSitePageByLangContract.getUrl =
|
|
52
|
-
FindHotelSitePageByLangContract.endpoint =
|
|
51
|
+
FindHotelSitePageByLangContract.getUrl = hotel_pages_api_1.HOTEL_PAGES_PUBLIC_API.findBySlugAndLang;
|
|
52
|
+
FindHotelSitePageByLangContract.endpoint = hotel_pages_api_1.HOTEL_PAGES_PUBLIC_CONTROLLER.endpoints.findBySlugAndLang;
|
|
53
53
|
FindHotelSitePageByLangContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
54
54
|
FindHotelSitePageByLangContract.RequestSchema = FindHotelSitePageByLangContractRequestSchema;
|
|
55
55
|
FindHotelSitePageByLangContract.ResponseSchema = FindHotelSitePageByLangContractResponseSchema;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_PAGES_PUBLIC_API = exports.HOTEL_PAGES_API = exports.HOTEL_PAGES_PUBLIC_CONTROLLER = exports.HOTEL_PAGES_CONTROLLER = void 0;
|
|
4
|
+
const utils_1 = require("../../common/utils");
|
|
5
|
+
exports.HOTEL_PAGES_CONTROLLER = {
|
|
6
|
+
prefix: 'hotels/by-id/:hotelId/sites/pages',
|
|
7
|
+
endpoints: {
|
|
8
|
+
findMany: '',
|
|
9
|
+
findBySlug: ':slug',
|
|
10
|
+
findBySlugAndLang: ':slug/lang/:lang',
|
|
11
|
+
create: '',
|
|
12
|
+
update: ':slug',
|
|
13
|
+
delete: ':slug',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
16
|
+
exports.HOTEL_PAGES_PUBLIC_CONTROLLER = {
|
|
17
|
+
prefix: 'hotels/by-slug/:hotelSlug/sites/pages',
|
|
18
|
+
endpoints: {
|
|
19
|
+
findBySlug: ':slug',
|
|
20
|
+
findBySlugAndLang: ':slug/lang/:lang',
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
exports.HOTEL_PAGES_API = (0, utils_1.createApi)(exports.HOTEL_PAGES_CONTROLLER);
|
|
24
|
+
exports.HOTEL_PAGES_PUBLIC_API = (0, utils_1.createApi)(exports.HOTEL_PAGES_PUBLIC_CONTROLLER);
|
|
@@ -14,4 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./hotel-pages.api"), exports);
|
|
17
18
|
__exportStar(require("./contracts"), exports);
|
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FindHotelThemeContract = void 0;
|
|
4
4
|
const common_1 = require("../../../common");
|
|
5
5
|
const theme_models_1 = require("../theme.models");
|
|
6
|
-
const
|
|
6
|
+
const hotel_themes_api_1 = require("../hotel-themes.api");
|
|
7
7
|
var FindHotelThemeContract;
|
|
8
8
|
(function (FindHotelThemeContract) {
|
|
9
|
-
FindHotelThemeContract.getUrl =
|
|
10
|
-
FindHotelThemeContract.endpoint =
|
|
9
|
+
FindHotelThemeContract.getUrl = hotel_themes_api_1.HOTEL_THEMES_PUBLIC_API.get;
|
|
10
|
+
FindHotelThemeContract.endpoint = hotel_themes_api_1.HOTEL_THEMES_PUBLIC_CONTROLLER.endpoints.get;
|
|
11
11
|
FindHotelThemeContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
12
12
|
FindHotelThemeContract.ResponseSchema = theme_models_1.ThemePersistedSchema;
|
|
13
13
|
})(FindHotelThemeContract || (exports.FindHotelThemeContract = FindHotelThemeContract = {}));
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HOTEL_THEMES_PUBLIC_API = exports.HOTEL_THEMES_API = exports.HOTEL_THEMES_PUBLIC_CONTROLLER = exports.HOTEL_THEMES_CONTROLLER = void 0;
|
|
4
|
+
const utils_1 = require("../../common/utils");
|
|
5
|
+
exports.HOTEL_THEMES_CONTROLLER = {
|
|
6
|
+
prefix: 'hotels/by-id/:hotelId/theme',
|
|
7
|
+
endpoints: {
|
|
8
|
+
get: '',
|
|
9
|
+
upsert: '',
|
|
10
|
+
delete: '',
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
exports.HOTEL_THEMES_PUBLIC_CONTROLLER = {
|
|
14
|
+
prefix: 'hotels/by-slug/:hotelSlug/theme',
|
|
15
|
+
endpoints: {
|
|
16
|
+
get: '',
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
exports.HOTEL_THEMES_API = (0, utils_1.createApi)(exports.HOTEL_THEMES_CONTROLLER);
|
|
20
|
+
exports.HOTEL_THEMES_PUBLIC_API = (0, utils_1.createApi)(exports.HOTEL_THEMES_PUBLIC_CONTROLLER);
|
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants"), exports);
|
|
18
18
|
__exportStar(require("./theme.models"), exports);
|
|
19
|
+
__exportStar(require("./hotel-themes.api"), exports);
|
|
19
20
|
__exportStar(require("./contracts"), exports);
|
|
@@ -4,16 +4,12 @@ exports.CreatePermissionContract = void 0;
|
|
|
4
4
|
const common_1 = require("../../common");
|
|
5
5
|
const permissions_api_1 = require("../permissions.api");
|
|
6
6
|
const permission_models_1 = require("../permission.models");
|
|
7
|
-
const CreatePermissionContractRequestSchema = permission_models_1.
|
|
8
|
-
id: true,
|
|
9
|
-
createdAt: true,
|
|
10
|
-
updatedAt: true,
|
|
11
|
-
});
|
|
7
|
+
const CreatePermissionContractRequestSchema = permission_models_1.PermissionWriteSchema;
|
|
12
8
|
var CreatePermissionContract;
|
|
13
9
|
(function (CreatePermissionContract) {
|
|
14
10
|
CreatePermissionContract.getUrl = permissions_api_1.PERMISSIONS_API.create;
|
|
15
11
|
CreatePermissionContract.endpoint = permissions_api_1.PERMISSIONS_CONTROLLER.endpoints.create;
|
|
16
12
|
CreatePermissionContract.httpMethod = common_1.HTTP_METHODS.post;
|
|
17
13
|
CreatePermissionContract.RequestSchema = CreatePermissionContractRequestSchema;
|
|
18
|
-
CreatePermissionContract.ResponseSchema = permission_models_1.
|
|
14
|
+
CreatePermissionContract.ResponseSchema = permission_models_1.PermissionDetailSchema;
|
|
19
15
|
})(CreatePermissionContract || (exports.CreatePermissionContract = CreatePermissionContract = {}));
|
|
@@ -1,13 +1,46 @@
|
|
|
1
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
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.DeletePermissionContract = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
4
38
|
const common_1 = require("../../common");
|
|
5
39
|
const permissions_api_1 = require("../permissions.api");
|
|
6
|
-
const permission_models_1 = require("../permission.models");
|
|
7
40
|
var DeletePermissionContract;
|
|
8
41
|
(function (DeletePermissionContract) {
|
|
9
42
|
DeletePermissionContract.getUrl = permissions_api_1.PERMISSIONS_API.delete;
|
|
10
43
|
DeletePermissionContract.endpoint = permissions_api_1.PERMISSIONS_CONTROLLER.endpoints.delete;
|
|
11
44
|
DeletePermissionContract.httpMethod = common_1.HTTP_METHODS.delete;
|
|
12
|
-
DeletePermissionContract.ResponseSchema =
|
|
45
|
+
DeletePermissionContract.ResponseSchema = z.void();
|
|
13
46
|
})(DeletePermissionContract || (exports.DeletePermissionContract = DeletePermissionContract = {}));
|
|
@@ -4,17 +4,10 @@ exports.FindPermissionContract = void 0;
|
|
|
4
4
|
const common_1 = require("../../common");
|
|
5
5
|
const permission_models_1 = require("../permission.models");
|
|
6
6
|
const permissions_api_1 = require("../permissions.api");
|
|
7
|
-
// const FindPermissionContractResponseSchema = PersistedPermissionSchema.transform(
|
|
8
|
-
// ({ conditions, ...permission }) => ({
|
|
9
|
-
// ...permission,
|
|
10
|
-
// conditions: conditions === null ? undefined : conditions,
|
|
11
|
-
// }),
|
|
12
|
-
// );
|
|
13
7
|
var FindPermissionContract;
|
|
14
8
|
(function (FindPermissionContract) {
|
|
15
9
|
FindPermissionContract.getUrl = permissions_api_1.PERMISSIONS_API.find;
|
|
16
10
|
FindPermissionContract.endpoint = permissions_api_1.PERMISSIONS_CONTROLLER.endpoints.find;
|
|
17
11
|
FindPermissionContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
18
|
-
|
|
19
|
-
FindPermissionContract.ResponseSchema = permission_models_1.PermissionWithTranslationsSchema;
|
|
12
|
+
FindPermissionContract.ResponseSchema = permission_models_1.PermissionDetailSchema;
|
|
20
13
|
})(FindPermissionContract || (exports.FindPermissionContract = FindPermissionContract = {}));
|
|
@@ -11,5 +11,5 @@ var UpdatePermissionContract;
|
|
|
11
11
|
UpdatePermissionContract.endpoint = permissions_api_1.PERMISSIONS_CONTROLLER.endpoints.update;
|
|
12
12
|
UpdatePermissionContract.httpMethod = common_1.HTTP_METHODS.put;
|
|
13
13
|
UpdatePermissionContract.RequestSchema = create_permission_contract_1.CreatePermissionContract.RequestSchema;
|
|
14
|
-
UpdatePermissionContract.ResponseSchema = permission_models_1.
|
|
14
|
+
UpdatePermissionContract.ResponseSchema = permission_models_1.PermissionDetailSchema;
|
|
15
15
|
})(UpdatePermissionContract || (exports.UpdatePermissionContract = UpdatePermissionContract = {}));
|
|
@@ -33,39 +33,26 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.PermissionListItemSchema = exports.
|
|
36
|
+
exports.PermissionListItemSchema = exports.PermissionDetailSchema = exports.PermissionWriteSchema = exports.PermissionTranslationsSchema = exports.PermissionPersistedSchema = exports.PermissionSchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
38
|
const common_1 = require("../common");
|
|
39
|
-
exports.
|
|
40
|
-
.string()
|
|
41
|
-
.transform(val => (val === '' ? undefined : val))
|
|
42
|
-
.optional()
|
|
43
|
-
.nullable()
|
|
44
|
-
.refine(val => {
|
|
45
|
-
if (val === undefined || val === null)
|
|
46
|
-
return true;
|
|
47
|
-
try {
|
|
48
|
-
JSON.parse(val);
|
|
49
|
-
return true;
|
|
50
|
-
}
|
|
51
|
-
catch {
|
|
52
|
-
return false;
|
|
53
|
-
}
|
|
54
|
-
}, { params: { messageKey: 'errors.validation.invalidJson' } });
|
|
55
|
-
exports.PermissionPersistedSchema = z
|
|
56
|
-
.object({
|
|
57
|
-
id: z.uuid(),
|
|
39
|
+
exports.PermissionSchema = z.object({
|
|
58
40
|
action: z.enum(common_1.AppAbility.ACTION_VALUES),
|
|
59
41
|
subject: z.enum(common_1.AppAbility.SUBJECT_VALUES),
|
|
60
|
-
conditions:
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
42
|
+
conditions: z.json().nullable().optional(),
|
|
43
|
+
});
|
|
44
|
+
exports.PermissionPersistedSchema = exports.PermissionSchema.required({ conditions: true }).extend({
|
|
45
|
+
id: common_1.UuidSchema,
|
|
46
|
+
...common_1.TimestampSchema.shape,
|
|
47
|
+
});
|
|
64
48
|
exports.PermissionTranslationsSchema = z.object({
|
|
65
49
|
name: z.string().min(3),
|
|
66
50
|
description: z.string().optional(),
|
|
67
51
|
});
|
|
68
|
-
exports.
|
|
52
|
+
exports.PermissionWriteSchema = exports.PermissionSchema.extend({
|
|
53
|
+
translations: (0, common_1.makeTranslations)(exports.PermissionTranslationsSchema),
|
|
54
|
+
});
|
|
55
|
+
exports.PermissionDetailSchema = exports.PermissionPersistedSchema.extend({
|
|
69
56
|
translations: (0, common_1.makeTranslations)(exports.PermissionTranslationsSchema),
|
|
70
57
|
});
|
|
71
58
|
exports.PermissionListItemSchema = exports.PermissionPersistedSchema.extend({
|
|
@@ -9,10 +9,6 @@ var CreateRoleContract;
|
|
|
9
9
|
CreateRoleContract.getUrl = roles_api_1.ROLES_API.create;
|
|
10
10
|
CreateRoleContract.endpoint = roles_api_1.ROLES_CONTROLLER.endpoints.create;
|
|
11
11
|
CreateRoleContract.httpMethod = common_1.HTTP_METHODS.post;
|
|
12
|
-
CreateRoleContract.RequestSchema = role_models_1.
|
|
13
|
-
|
|
14
|
-
createdAt: true,
|
|
15
|
-
updatedAt: true,
|
|
16
|
-
});
|
|
17
|
-
CreateRoleContract.ResponseSchema = role_models_1.RoleWithTranslationsSchema;
|
|
12
|
+
CreateRoleContract.RequestSchema = role_models_1.RoleWriteSchema;
|
|
13
|
+
CreateRoleContract.ResponseSchema = role_models_1.RoleDetailSchema;
|
|
18
14
|
})(CreateRoleContract || (exports.CreateRoleContract = CreateRoleContract = {}));
|
|
@@ -1,13 +1,46 @@
|
|
|
1
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
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.DeleteRoleContract = void 0;
|
|
37
|
+
const z = __importStar(require("zod"));
|
|
4
38
|
const common_1 = require("../../common");
|
|
5
|
-
const role_models_1 = require("../role.models");
|
|
6
39
|
const roles_api_1 = require("../roles.api");
|
|
7
40
|
var DeleteRoleContract;
|
|
8
41
|
(function (DeleteRoleContract) {
|
|
9
42
|
DeleteRoleContract.getUrl = roles_api_1.ROLES_API.delete;
|
|
10
43
|
DeleteRoleContract.endpoint = roles_api_1.ROLES_CONTROLLER.endpoints.delete;
|
|
11
44
|
DeleteRoleContract.httpMethod = common_1.HTTP_METHODS.delete;
|
|
12
|
-
DeleteRoleContract.ResponseSchema =
|
|
45
|
+
DeleteRoleContract.ResponseSchema = z.void();
|
|
13
46
|
})(DeleteRoleContract || (exports.DeleteRoleContract = DeleteRoleContract = {}));
|
|
@@ -9,5 +9,5 @@ var FindRoleContract;
|
|
|
9
9
|
FindRoleContract.getUrl = roles_api_1.ROLES_API.find;
|
|
10
10
|
FindRoleContract.endpoint = roles_api_1.ROLES_CONTROLLER.endpoints.find;
|
|
11
11
|
FindRoleContract.httpMethod = common_1.HTTP_METHODS.get;
|
|
12
|
-
FindRoleContract.ResponseSchema = role_models_1.
|
|
12
|
+
FindRoleContract.ResponseSchema = role_models_1.RoleDetailSchema;
|
|
13
13
|
})(FindRoleContract || (exports.FindRoleContract = FindRoleContract = {}));
|
|
@@ -11,5 +11,5 @@ var UpdateRoleContract;
|
|
|
11
11
|
UpdateRoleContract.endpoint = roles_api_1.ROLES_CONTROLLER.endpoints.update;
|
|
12
12
|
UpdateRoleContract.httpMethod = common_1.HTTP_METHODS.put;
|
|
13
13
|
UpdateRoleContract.RequestSchema = create_role_contract_1.CreateRoleContract.RequestSchema;
|
|
14
|
-
UpdateRoleContract.ResponseSchema = role_models_1.
|
|
14
|
+
UpdateRoleContract.ResponseSchema = role_models_1.RoleDetailSchema;
|
|
15
15
|
})(UpdateRoleContract || (exports.UpdateRoleContract = UpdateRoleContract = {}));
|
|
@@ -33,27 +33,30 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.RoleListItemSchema = exports.
|
|
36
|
+
exports.RoleListItemSchema = exports.RoleDetailSchema = exports.RoleWriteSchema = exports.RoleTranslationsSchema = exports.RolePersistedSchema = exports.RoleSchema = void 0;
|
|
37
37
|
const z = __importStar(require("zod"));
|
|
38
38
|
const common_1 = require("../common");
|
|
39
39
|
const permissions_1 = require("../permissions");
|
|
40
|
-
exports.
|
|
41
|
-
.object({
|
|
42
|
-
id: z.uuid(),
|
|
40
|
+
exports.RoleSchema = z.object({
|
|
43
41
|
type: z.enum(common_1.ROLE_TYPE_VALUES),
|
|
44
|
-
isActive: z.boolean().
|
|
45
|
-
isDefault: z.boolean().
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
42
|
+
isActive: z.boolean().optional(),
|
|
43
|
+
isDefault: z.boolean().optional(),
|
|
44
|
+
});
|
|
45
|
+
exports.RolePersistedSchema = exports.RoleSchema.required({ isActive: true, isDefault: true }).extend({
|
|
46
|
+
id: common_1.UuidSchema,
|
|
47
|
+
...common_1.TimestampSchema.shape,
|
|
50
48
|
});
|
|
51
49
|
exports.RoleTranslationsSchema = z.object({
|
|
52
50
|
name: z.string().min(3),
|
|
53
51
|
description: z.string().optional(),
|
|
54
52
|
});
|
|
55
|
-
exports.
|
|
53
|
+
exports.RoleWriteSchema = exports.RoleSchema.extend({
|
|
54
|
+
translations: (0, common_1.makeTranslations)(exports.RoleTranslationsSchema),
|
|
55
|
+
permissionIds: common_1.UuidArraySchema.optional(),
|
|
56
|
+
});
|
|
57
|
+
exports.RoleDetailSchema = exports.RolePersistedSchema.extend({
|
|
56
58
|
translations: (0, common_1.makeTranslations)(exports.RoleTranslationsSchema),
|
|
59
|
+
permissionIds: common_1.UuidArraySchema.optional(),
|
|
57
60
|
});
|
|
58
61
|
exports.RoleListItemSchema = exports.RolePersistedSchema.extend({
|
|
59
62
|
name: z.string().nullable(),
|
|
@@ -40,6 +40,7 @@ const translate_api_1 = require("../translate.api");
|
|
|
40
40
|
const permissions_1 = require("../../permissions");
|
|
41
41
|
const roles_1 = require("../../roles");
|
|
42
42
|
const translate_schemas_1 = require("../translate.schemas");
|
|
43
|
+
const hotels_1 = require("../../hotels");
|
|
43
44
|
const makeReqVariant = (entity, schema) => z.object({
|
|
44
45
|
entity: z.literal(entity),
|
|
45
46
|
object: schema,
|
|
@@ -52,10 +53,12 @@ const makeResVariant = (entity, schema) => z.object({
|
|
|
52
53
|
const TranslateObjectRequestVariants = [
|
|
53
54
|
makeReqVariant(common_1.ENTITIES.permission, permissions_1.PermissionTranslationsSchema),
|
|
54
55
|
makeReqVariant(common_1.ENTITIES.role, roles_1.RoleTranslationsSchema),
|
|
56
|
+
makeReqVariant(common_1.ENTITIES.hotel, hotels_1.HotelTranslationsSchema),
|
|
55
57
|
];
|
|
56
58
|
const TranslateObjectResponseVariants = [
|
|
57
59
|
makeResVariant(common_1.ENTITIES.permission, permissions_1.PermissionTranslationsSchema),
|
|
58
60
|
makeResVariant(common_1.ENTITIES.role, roles_1.RoleTranslationsSchema),
|
|
61
|
+
makeResVariant(common_1.ENTITIES.hotel, hotels_1.HotelTranslationsSchema),
|
|
59
62
|
];
|
|
60
63
|
const TranslateObjectContractRequestSchema = translate_schemas_1.BaseTranslateSchema.extend({
|
|
61
64
|
payload: z.discriminatedUnion('entity', TranslateObjectRequestVariants),
|