@merkl/api 0.10.197 → 0.10.199

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.
@@ -1,5 +1,5 @@
1
1
  import type { CampaignUnique, CreateCampaignModel, GetCampaignQueryModel } from "./";
2
- import { type Prisma } from "../../../../database/api/.generated";
2
+ import { Prisma } from "../../../../database/api/.generated";
3
3
  import { type ChainId } from "@sdk";
4
4
  import { type OpportunityMetadata } from "../opportunity";
5
5
  export declare abstract class CampaignRepository {
@@ -2,7 +2,7 @@ import { CampaignService } from "./";
2
2
  import { log } from "../../../utils/logger";
3
3
  import { apiDbClient, engineDbClient } from "../../../utils/prisma";
4
4
  import { ALL_CAMPAIGNS_FOR_CHAIN_AFTER } from "../../../utils/queries/allCampaigns";
5
- import { RunStatus, Status } from "../../../../database/api/.generated";
5
+ import { Prisma, RunStatus, Status } from "../../../../database/api/.generated";
6
6
  import { MAX_COMPUTE_JOB_TIME, WEEK } from "@sdk";
7
7
  import moment from "moment";
8
8
  import { OpportunityService } from "../opportunity";
@@ -264,8 +264,8 @@ export class CampaignRepository {
264
264
  startTimestamp: { lte: currentTime }, // The campaign has started
265
265
  endTimestamp: { gte: currentTime - WEEK }, // The campaign ended less than a week ago
266
266
  params: {
267
- path: ["shouldIgnore"], // There is no "shouldIgnore" flag in the api database
268
- not: "true",
267
+ path: ["shouldIgnore"],
268
+ equals: Prisma.AnyNull,
269
269
  },
270
270
  CampaignStatus: {
271
271
  some: {
@@ -279,7 +279,7 @@ export class CampaignRepository {
279
279
  {
280
280
  status: RunStatus.PROCESSING,
281
281
  processingStarted: {
282
- lt: currentTime - MAX_COMPUTE_JOB_TIME,
282
+ lt: currentTime - MAX_COMPUTE_JOB_TIME, // more than 12 hours ago
283
283
  },
284
284
  },
285
285
  ],
@@ -217,7 +217,6 @@ export class RewardService {
217
217
  return res;
218
218
  }
219
219
  static async registerClaims(claims) {
220
- console.log(claims);
221
220
  for (const claim of claims) {
222
221
  const tokenId = TokenService.hashId({
223
222
  chainId: claim.chainId,
@@ -18,7 +18,6 @@ export class StatusService {
18
18
  return await StatusRepository.findUnique(campaignUnique);
19
19
  }
20
20
  static async update(campaignUnique, status) {
21
- console.log(campaignUnique, status);
22
21
  // Check if the status exists already, otherwise create it
23
22
  const campaignExists = await StatusRepository.findUnique(campaignUnique);
24
23
  if (!campaignExists) {