vista-co
Version:
1,019 lines • 94.6 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const __1 = require("..");
const axios_master_1 = require("axios-master");
const AddressModuleConfigs = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/AddressModuleConfigs${query}`,
headers: {
connectapitoken: `${__1.config.token}`,
"Content-Type": "application/json",
},
}, {
name: "AddressModuleConfigs",
timeout: 20000,
logger(data) {
console.log("Request data:", data);
},
});
return {
success: true,
message: "Request successful",
data: res.value, // Returning the 'value' array from the response
};
}
catch (error) {
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches the list of all AdvanceBookingRuleExceptions from the OData service.
// It accepts an optional 'body' object with OData query parameters like $expand, $filter, $select, $orderby, $top, and $skip.
const AdvanceBookingRuleExceptions = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData endpoint using Axios with the given parameters in the query string.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/AdvanceBookingRuleExceptions${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // Authorization token.
"Content-Type": "application/json", // Ensure the response is in JSON format.
},
}, {
name: "AdvanceBookingRuleExceptions", // Name for logging and debugging purposes.
timeout: 20000, // Set a timeout of 20 seconds for the request.
logger(data) {
console.log("Request data:", data); // Logs request data for debugging.
},
});
// Implementation Notes: Returns the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message in case of failure.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all AdvanceBookingRules from the OData service.
// The function accepts optional parameters that can be used to filter, expand, or sort the results.
const AdvanceBookingRules = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/AdvanceBookingRules${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensure the response format is JSON
},
}, {
name: "AdvanceBookingRules", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all AdvertisingMediaSets from the OData service.
// Accepts OData query parameters to filter, expand, or limit the results.
const AdvertisingMediaSets = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/AdvertisingMediaSets${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "AdvertisingMediaSets", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all AdvertisingProfiles from the OData service.
// It accepts optional OData parameters for filtering, expanding, or sorting the results.
const AdvertisingProfiles = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/AdvertisingProfiles${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "AdvertisingProfiles", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all Attributes from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const Attributes = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/Attributes${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "Attributes", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all CinemaEvents from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const CinemaEvents = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/CinemaEvents${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "CinemaEvents", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all CinemaOperatorGroups from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const CinemaOperatorGroups = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/CinemaOperatorGroups${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "CinemaOperatorGroups", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all CinemaOperators from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const CinemaOperators = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/CinemaOperators${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "CinemaOperators", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all Cinemas from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const Cinemas = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/Cinemas${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "Cinemas", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all Clients from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const Clients = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/Clients${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "Clients", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all Clubs from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const Clubs = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/Clubs${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "Clubs", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all CustomerRatingTypes from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const CustomerRatingTypes = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/CustomerRatingTypes${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "CustomerRatingTypes", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all Deals from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const Deals = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/Deals${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "Deals", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all EducationLevels from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const EducationLevels = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/EducationLevels${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "EducationLevels", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all FilmGenres from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const FilmGenres = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/FilmGenres${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "FilmGenres", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all FilmPersonLinks from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const FilmPersonLinks = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/FilmPersonLinks${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "FilmPersonLinks", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all FilmPersons from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const FilmPersons = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/FilmPersons${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "FilmPersons", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all Films from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const Films = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/Films${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "Films", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a specific client based on the provided client ID.
const GetClient = async (id) => {
var _a, _b, _c;
try {
// Implementation Notes: Sending a GET request to the OData service with the provided client ID.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/GetClient?id=${id}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "GetClient", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the client data from the successful response.
return {
success: true,
message: "Request successful",
data: res,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of all Coming Soon Scheduled Films from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const GetComingSoonScheduledFilms = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/GetComingSoonScheduledFilms${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "GetComingSoonScheduledFilms", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches a list of delivery windows for a specific cinema from the OData service.
// It accepts optional OData parameters to filter, expand, or sort the results.
const GetDeliveryWindowsForCinema = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Implementation Notes: Sending a GET request to the OData service with the provided cinema ID and query parameters.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/GetDeliveryWindowsForCinema?cinemaid=${body.cinemaid}${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "GetDeliveryWindowsForCinema", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the 'value' array from the successful response.
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches the Loyalty configuration settings from the OData service.
const GetLoyaltySettings = async () => {
var _a, _b, _c;
try {
// Implementation Notes: Sending a GET request to the OData service to retrieve loyalty settings.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/GetLoyaltySettings`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "GetLoyaltySettings", // Request identifier for logging and debugging
timeout: 200000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Return the data from the successful response.
return {
success: true,
message: "Request successful",
data: res,
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches the Member Field Settings for Loyalty Membership from the OData service.
// It accepts a `postype` parameter to specify the type of member field settings.
const GetMemberFieldSettings = async (postype) => {
var _a, _b, _c;
try {
// Implementation Notes: Sending a GET request to the OData service with the specified postype parameter.
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/GetMemberFieldSettings?postype=${postype}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "GetMemberFieldSettings", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Implementation Notes: Returning the response data.
return {
success: true,
message: "Request successful",
data: res, // The response contains the required, editable, and displayable fields for the loyalty member settings
};
}
catch (error) {
// Implementation Notes: Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches the scheduled films that are currently showing from the OData service.
const GetNowShowingScheduledFilms = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Sending a GET request to the OData service with the query parameters
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/GetNowShowingScheduledFilms${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "GetNowShowingScheduledFilms", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Returning the successful response
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || error === void 0 ? void 0 : error.response) === null || _a === void 0 ? void 0 : _a.data);
return {
success: false,
message: ((_c = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.data) === null || _c === void 0 ? void 0 : _c.message) || "An error occurred",
};
}
};
// Implementation Notes: This function fetches the sessions currently showing.
const GetNowShowingSessions = async (body) => {
var _a, _b, _c;
// Convert body to query string
const query = (0, __1.jsonToQueryString)(body);
try {
// Sending a GET request to the OData service with the query parameters
const res = await (0, axios_master_1.axiosMasterMain)({
method: "GET",
url: `${__1.config.host}/WSVistaWebClient/OData.svc/GetNowShowingSessions${query}`,
headers: {
connectapitoken: `${__1.config.token}`, // API token for authentication
"Content-Type": "application/json", // Ensures the response format is JSON
},
}, {
name: "GetNowShowingSessions", // Request identifier for logging and debugging
timeout: 20000, // Timeout of 20 seconds for the request
logger(data) {
if (__1.config.logger) {
console.log(data); // Logs request data for debugging purposes
}
},
});
// Returning the successful response
return {
success: true,
message: "Request successful",
data: res.value,
};
}
catch (error) {
// Logs and returns an error message if the request fails.
console.error("Request failed", (_a = error === null || err