@ministryofjustice/hmpps-digital-prison-reporting-frontend
Version:
The Digital Prison Reporting Frontend contains templates and code to help display data effectively in UI applications.
37 lines (34 loc) • 1.2 kB
JavaScript
import logger from '../utils/logger.js';
class SubscriptionService {
reportingClient;
enabled;
constructor(reportingClient, serviceFeatureConfig) {
this.reportingClient = reportingClient;
this.reportingClient = reportingClient;
this.enabled = Boolean(serviceFeatureConfig.subscriptions);
if (!this.enabled)
logger.info(`Subsriptions Service: disabled `);
}
async subscribe(token, reportId, id) {
if (!this.enabled)
return undefined;
return this.reportingClient.subscribe(token, reportId, id);
}
async unsubscribe(token, reportId, id) {
if (!this.enabled)
return undefined;
return this.reportingClient.unsubscribe(token, reportId, id);
}
async getSubscription(token, reportId, id) {
if (!this.enabled)
return [];
return this.reportingClient.getSubscription(token, reportId, id);
}
async getSubscriptions(token) {
if (!this.enabled)
return [];
return this.reportingClient.getSubscriptions(token);
}
}
export { SubscriptionService as default };
//# sourceMappingURL=subscriptionService.js.map