import ProductInsightsSDK from "../core/base"; import MetricModule from "./metric"; import { Events, EntityType } from "../types"; class Tutorials { private metric: MetricModule; constructor(private sdk: ProductInsightsSDK) { this.metric = new MetricModule(this.sdk, EntityType.VIDEO_TUTORIAL); } async getAll() { await this.sdk.sendEvent(Events.FETCH_TUTORIALS, {}); } async initMetric(entityDocumentId: string) { this.metric.initMetric({ entityDocumentId, }); } async setHasCompleted(entityDocumentId: string) { this.metric.complete(entityDocumentId); } async setHasCanceled(entityDocumentId: string) { this.metric.cancel(entityDocumentId); } } export default Tutorials;