hunk.code_window:         $gte: currentJob.createdAt,
         },
         _templateId: currentJob._templateId,
         status: JobStatusEnum.COMPLETED,
         type: StepTypeEnum.TRIGGER,
         _environmentId: currentJob._environmentId,
         ...(digestKey && { [`payload.${digestKey}`]: digestValue }),
         _subscriberId: command._subscriberId,
       });
  
hunk.labels: keep keep keep replace replace keep keep keep keep keep
hunk.after_edit:       status: JobStatusEnum.MERGED,
         type: StepTypeEnum.DIGEST,
  
hunk.file_path: apps/worker/src/app/workflow/usecases/send-message/digest/get-digest-events-backoff.usecase.ts
hunk.type: replace
file: import { UserSession } from '@novu/testing';
  import { IUpdateNotificationTemplateDto } from '@novu/shared';
  import axios from 'axios';
  
  import { UpdateSubscriberOnlineFlagRequestDto } from '../../dtos/update-subscriber-online-flag-request.dto';
  import { UpdateSubscriberPreferenceRequestDto } from '../../../widgets/dtos/update-subscriber-preference-request.dto';
  
  const axiosInstance = axios.create();
  
  export async function getNotificationTemplate(session: UserSession, id: string) {
    return await axiosInstance.get(`${session.serverUrl}/v1/workflows/${id}`, {
      headers: {
        authorization: `ApiKey ${session.apiKey}`,
      },
    });
  }
  
  export async function updateNotificationTemplate(
    session: UserSession,
    id: string,
    data: IUpdateNotificationTemplateDto
  ) {
    return await axiosInstance.put(`${session.serverUrl}/v1/workflows/${id}`, data, {
      headers: {
        authorization: `ApiKey ${session.apiKey}`,
      },
    });
  }
  
  export async function getPreference(session: UserSession, subscriberId?: string) {
    return await axiosInstance.get(
      `${session.serverUrl}/v1/subscribers/${subscriberId || session.subscriberId}/preferences`,
      {
        headers: {
          authorization: `ApiKey ${session.apiKey}`,
        },
      }
    );
  }
  
  export async function updateSubscriberOnlineFlag(
    data: UpdateSubscriberOnlineFlagRequestDto,
    session: UserSession,
    subscriberId: string
  ) {
    return await axiosInstance.patch(`${session.serverUrl}/v1/subscribers/${subscriberId}/online-status`, data, {
      headers: {
        authorization: `ApiKey ${session.apiKey}`,
      },
    });
  }
  
  export async function updatePreference(
    data: UpdateSubscriberPreferenceRequestDto,
    session: UserSession,
    templateId: string
  ) {
    return await axiosInstance.patch(
      `${session.serverUrl}/v1/subscribers/${session.subscriberId}/preferences/${templateId}`,
      data,
      {
        headers: {
          authorization: `ApiKey ${session.apiKey}`,
        },
      }
    );
  }
  