lancer-shared 1.0.31 → 1.0.33

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.
@@ -3,6 +3,10 @@ export declare const ROUTES: {
3
3
  readonly BASE: "auth";
4
4
  readonly REGISTER: "auth/register";
5
5
  };
6
+ readonly EVENTS: {
7
+ readonly BASE: "events";
8
+ readonly BY_ID: (id: string) => string;
9
+ };
6
10
  readonly CAMPAIGNS: {
7
11
  readonly BASE: "campaigns";
8
12
  readonly BY_ID: (id: string) => string;
@@ -6,6 +6,10 @@ exports.ROUTES = {
6
6
  BASE: "auth",
7
7
  REGISTER: "auth/register",
8
8
  },
9
+ EVENTS: {
10
+ BASE: "events",
11
+ BY_ID: (id) => `events/${id}`,
12
+ },
9
13
  CAMPAIGNS: {
10
14
  BASE: "campaigns",
11
15
  BY_ID: (id) => `campaigns/${id}`,
@@ -43,7 +47,7 @@ exports.ROUTES = {
43
47
  FILTER_OPTIONS: "jobs/filter-options",
44
48
  TOTAL_JOBS: "jobs/total-jobs",
45
49
  GET_JOB_TITLE: (jobId) => `jobs/get-job-title/${jobId}`,
46
- SEARCH: 'jobs/search',
50
+ SEARCH: "jobs/search",
47
51
  },
48
52
  USERS: {
49
53
  BASE: "users",
@@ -1,11 +1,12 @@
1
- export * from './lead';
2
- export * from './saved-search';
3
- export * from './shared';
4
- export * from './user';
5
- export * from './chat-message';
6
- export * from './job-filters';
7
- export * from './campaign';
8
- export * from './ai';
9
- export * from './bidding';
10
- export * from './scraper';
11
- export * from './config';
1
+ export * from "./lead";
2
+ export * from "./saved-search";
3
+ export * from "./shared";
4
+ export * from "./user";
5
+ export * from "./chat-message";
6
+ export * from "./job-filters";
7
+ export * from "./campaign";
8
+ export * from "./ai";
9
+ export * from "./bidding";
10
+ export * from "./scraper";
11
+ export * from "./config";
12
+ export * from "./logger";
@@ -25,3 +25,4 @@ __exportStar(require("./ai"), exports);
25
25
  __exportStar(require("./bidding"), exports);
26
26
  __exportStar(require("./scraper"), exports);
27
27
  __exportStar(require("./config"), exports);
28
+ __exportStar(require("./logger"), exports);
@@ -44,9 +44,9 @@ export declare const clientInfoSchema: z.ZodObject<{
44
44
  }, "strip", z.ZodTypeAny, {
45
45
  country: string | null;
46
46
  region: string | null;
47
- rating: number | null;
48
47
  isPaymentVerified: boolean | null;
49
48
  numberOfReviews: number | null;
49
+ rating: number | null;
50
50
  jobsPosted: number | null;
51
51
  totalSpent: number | null;
52
52
  numberOfHires: number | null;
@@ -60,9 +60,9 @@ export declare const clientInfoSchema: z.ZodObject<{
60
60
  }, {
61
61
  country: string | null;
62
62
  region: string | null;
63
- rating: number | null;
64
63
  isPaymentVerified: boolean | null;
65
64
  numberOfReviews: number | null;
65
+ rating: number | null;
66
66
  jobsPosted: number | null;
67
67
  totalSpent: number | null;
68
68
  numberOfHires: number | null;
@@ -187,9 +187,9 @@ export declare const upworkJobSchema: z.ZodObject<{
187
187
  }, "strip", z.ZodTypeAny, {
188
188
  country: string | null;
189
189
  region: string | null;
190
- rating: number | null;
191
190
  isPaymentVerified: boolean | null;
192
191
  numberOfReviews: number | null;
192
+ rating: number | null;
193
193
  jobsPosted: number | null;
194
194
  totalSpent: number | null;
195
195
  numberOfHires: number | null;
@@ -203,9 +203,9 @@ export declare const upworkJobSchema: z.ZodObject<{
203
203
  }, {
204
204
  country: string | null;
205
205
  region: string | null;
206
- rating: number | null;
207
206
  isPaymentVerified: boolean | null;
208
207
  numberOfReviews: number | null;
208
+ rating: number | null;
209
209
  jobsPosted: number | null;
210
210
  totalSpent: number | null;
211
211
  numberOfHires: number | null;
@@ -267,9 +267,9 @@ export declare const upworkJobSchema: z.ZodObject<{
267
267
  clientInfo: {
268
268
  country: string | null;
269
269
  region: string | null;
270
- rating: number | null;
271
270
  isPaymentVerified: boolean | null;
272
271
  numberOfReviews: number | null;
272
+ rating: number | null;
273
273
  jobsPosted: number | null;
274
274
  totalSpent: number | null;
275
275
  numberOfHires: number | null;
@@ -319,9 +319,9 @@ export declare const upworkJobSchema: z.ZodObject<{
319
319
  clientInfo: {
320
320
  country: string | null;
321
321
  region: string | null;
322
- rating: number | null;
323
322
  isPaymentVerified: boolean | null;
324
323
  numberOfReviews: number | null;
324
+ rating: number | null;
325
325
  jobsPosted: number | null;
326
326
  totalSpent: number | null;
327
327
  numberOfHires: number | null;
@@ -342,7 +342,7 @@ export declare const upworkJobSchema: z.ZodObject<{
342
342
  } | null;
343
343
  processed: boolean | null;
344
344
  }>;
345
- export declare const jobSchema: z.ZodObject<z.objectUtil.extendShape<{
345
+ export declare const leadSchema: z.ZodObject<z.objectUtil.extendShape<{
346
346
  id: z.ZodNullable<z.ZodString>;
347
347
  createdAt: z.ZodNullable<z.ZodNumber>;
348
348
  title: z.ZodNullable<z.ZodString>;
@@ -418,9 +418,9 @@ export declare const jobSchema: z.ZodObject<z.objectUtil.extendShape<{
418
418
  }, "strip", z.ZodTypeAny, {
419
419
  country: string | null;
420
420
  region: string | null;
421
- rating: number | null;
422
421
  isPaymentVerified: boolean | null;
423
422
  numberOfReviews: number | null;
423
+ rating: number | null;
424
424
  jobsPosted: number | null;
425
425
  totalSpent: number | null;
426
426
  numberOfHires: number | null;
@@ -434,9 +434,9 @@ export declare const jobSchema: z.ZodObject<z.objectUtil.extendShape<{
434
434
  }, {
435
435
  country: string | null;
436
436
  region: string | null;
437
- rating: number | null;
438
437
  isPaymentVerified: boolean | null;
439
438
  numberOfReviews: number | null;
439
+ rating: number | null;
440
440
  jobsPosted: number | null;
441
441
  totalSpent: number | null;
442
442
  numberOfHires: number | null;
@@ -469,6 +469,7 @@ export declare const jobSchema: z.ZodObject<z.objectUtil.extendShape<{
469
469
  }>>;
470
470
  processed: z.ZodNullable<z.ZodBoolean>;
471
471
  }, {
472
+ jobId: z.ZodString;
472
473
  updatedAt: z.ZodNullable<z.ZodNumber>;
473
474
  suitabilityRating: z.ZodNullable<z.ZodNumber>;
474
475
  suitabilityReason: z.ZodNullable<z.ZodString>;
@@ -530,6 +531,7 @@ export declare const jobSchema: z.ZodObject<z.objectUtil.extendShape<{
530
531
  description: string | null;
531
532
  status: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalPending" | "proposalProcessing" | "proposalComplete" | "biddingPending" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
532
533
  datetime: number | null;
534
+ jobId: string;
533
535
  createdAt: number | null;
534
536
  updatedAt: number | null;
535
537
  questionAnswerPairs: {
@@ -550,9 +552,9 @@ export declare const jobSchema: z.ZodObject<z.objectUtil.extendShape<{
550
552
  clientInfo: {
551
553
  country: string | null;
552
554
  region: string | null;
553
- rating: number | null;
554
555
  isPaymentVerified: boolean | null;
555
556
  numberOfReviews: number | null;
557
+ rating: number | null;
556
558
  jobsPosted: number | null;
557
559
  totalSpent: number | null;
558
560
  numberOfHires: number | null;
@@ -604,6 +606,7 @@ export declare const jobSchema: z.ZodObject<z.objectUtil.extendShape<{
604
606
  description: string | null;
605
607
  status: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalPending" | "proposalProcessing" | "proposalComplete" | "biddingPending" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
606
608
  datetime: number | null;
609
+ jobId: string;
607
610
  createdAt: number | null;
608
611
  updatedAt: number | null;
609
612
  questionAnswerPairs: {
@@ -624,9 +627,9 @@ export declare const jobSchema: z.ZodObject<z.objectUtil.extendShape<{
624
627
  clientInfo: {
625
628
  country: string | null;
626
629
  region: string | null;
627
- rating: number | null;
628
630
  isPaymentVerified: boolean | null;
629
631
  numberOfReviews: number | null;
632
+ rating: number | null;
630
633
  jobsPosted: number | null;
631
634
  totalSpent: number | null;
632
635
  numberOfHires: number | null;
@@ -676,7 +679,7 @@ export declare const jobListItemSchema: z.ZodObject<{
676
679
  jobUrl: string | null;
677
680
  }>;
678
681
  export declare const jobResponseSchema: z.ZodObject<{
679
- jobs: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
682
+ leads: z.ZodArray<z.ZodObject<z.objectUtil.extendShape<{
680
683
  id: z.ZodNullable<z.ZodString>;
681
684
  createdAt: z.ZodNullable<z.ZodNumber>;
682
685
  title: z.ZodNullable<z.ZodString>;
@@ -752,9 +755,9 @@ export declare const jobResponseSchema: z.ZodObject<{
752
755
  }, "strip", z.ZodTypeAny, {
753
756
  country: string | null;
754
757
  region: string | null;
755
- rating: number | null;
756
758
  isPaymentVerified: boolean | null;
757
759
  numberOfReviews: number | null;
760
+ rating: number | null;
758
761
  jobsPosted: number | null;
759
762
  totalSpent: number | null;
760
763
  numberOfHires: number | null;
@@ -768,9 +771,9 @@ export declare const jobResponseSchema: z.ZodObject<{
768
771
  }, {
769
772
  country: string | null;
770
773
  region: string | null;
771
- rating: number | null;
772
774
  isPaymentVerified: boolean | null;
773
775
  numberOfReviews: number | null;
776
+ rating: number | null;
774
777
  jobsPosted: number | null;
775
778
  totalSpent: number | null;
776
779
  numberOfHires: number | null;
@@ -803,6 +806,7 @@ export declare const jobResponseSchema: z.ZodObject<{
803
806
  }>>;
804
807
  processed: z.ZodNullable<z.ZodBoolean>;
805
808
  }, {
809
+ jobId: z.ZodString;
806
810
  updatedAt: z.ZodNullable<z.ZodNumber>;
807
811
  suitabilityRating: z.ZodNullable<z.ZodNumber>;
808
812
  suitabilityReason: z.ZodNullable<z.ZodString>;
@@ -864,6 +868,7 @@ export declare const jobResponseSchema: z.ZodObject<{
864
868
  description: string | null;
865
869
  status: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalPending" | "proposalProcessing" | "proposalComplete" | "biddingPending" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
866
870
  datetime: number | null;
871
+ jobId: string;
867
872
  createdAt: number | null;
868
873
  updatedAt: number | null;
869
874
  questionAnswerPairs: {
@@ -884,9 +889,9 @@ export declare const jobResponseSchema: z.ZodObject<{
884
889
  clientInfo: {
885
890
  country: string | null;
886
891
  region: string | null;
887
- rating: number | null;
888
892
  isPaymentVerified: boolean | null;
889
893
  numberOfReviews: number | null;
894
+ rating: number | null;
890
895
  jobsPosted: number | null;
891
896
  totalSpent: number | null;
892
897
  numberOfHires: number | null;
@@ -938,6 +943,7 @@ export declare const jobResponseSchema: z.ZodObject<{
938
943
  description: string | null;
939
944
  status: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalPending" | "proposalProcessing" | "proposalComplete" | "biddingPending" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
940
945
  datetime: number | null;
946
+ jobId: string;
941
947
  createdAt: number | null;
942
948
  updatedAt: number | null;
943
949
  questionAnswerPairs: {
@@ -958,9 +964,9 @@ export declare const jobResponseSchema: z.ZodObject<{
958
964
  clientInfo: {
959
965
  country: string | null;
960
966
  region: string | null;
961
- rating: number | null;
962
967
  isPaymentVerified: boolean | null;
963
968
  numberOfReviews: number | null;
969
+ rating: number | null;
964
970
  jobsPosted: number | null;
965
971
  totalSpent: number | null;
966
972
  numberOfHires: number | null;
@@ -1000,7 +1006,7 @@ export declare const jobResponseSchema: z.ZodObject<{
1000
1006
  hasMore: z.ZodBoolean;
1001
1007
  jobCounts: z.ZodNullable<z.ZodNumber>;
1002
1008
  }, "strip", z.ZodTypeAny, {
1003
- jobs: {
1009
+ leads: {
1004
1010
  id: string | null;
1005
1011
  title: string | null;
1006
1012
  metadata: {
@@ -1017,6 +1023,7 @@ export declare const jobResponseSchema: z.ZodObject<{
1017
1023
  description: string | null;
1018
1024
  status: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalPending" | "proposalProcessing" | "proposalComplete" | "biddingPending" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1019
1025
  datetime: number | null;
1026
+ jobId: string;
1020
1027
  createdAt: number | null;
1021
1028
  updatedAt: number | null;
1022
1029
  questionAnswerPairs: {
@@ -1037,9 +1044,9 @@ export declare const jobResponseSchema: z.ZodObject<{
1037
1044
  clientInfo: {
1038
1045
  country: string | null;
1039
1046
  region: string | null;
1040
- rating: number | null;
1041
1047
  isPaymentVerified: boolean | null;
1042
1048
  numberOfReviews: number | null;
1049
+ rating: number | null;
1043
1050
  jobsPosted: number | null;
1044
1051
  totalSpent: number | null;
1045
1052
  numberOfHires: number | null;
@@ -1079,7 +1086,7 @@ export declare const jobResponseSchema: z.ZodObject<{
1079
1086
  hasMore: boolean;
1080
1087
  jobCounts: number | null;
1081
1088
  }, {
1082
- jobs: {
1089
+ leads: {
1083
1090
  id: string | null;
1084
1091
  title: string | null;
1085
1092
  metadata: {
@@ -1096,6 +1103,7 @@ export declare const jobResponseSchema: z.ZodObject<{
1096
1103
  description: string | null;
1097
1104
  status: "suitabilityPending" | "suitabilityProcessing" | "suitabilityComplete" | "suitabilityFailed" | "proposalPending" | "proposalProcessing" | "proposalComplete" | "biddingPending" | "biddingProcessing" | "biddingComplete" | "biddingFailed" | "jobArchived" | null;
1098
1105
  datetime: number | null;
1106
+ jobId: string;
1099
1107
  createdAt: number | null;
1100
1108
  updatedAt: number | null;
1101
1109
  questionAnswerPairs: {
@@ -1116,9 +1124,9 @@ export declare const jobResponseSchema: z.ZodObject<{
1116
1124
  clientInfo: {
1117
1125
  country: string | null;
1118
1126
  region: string | null;
1119
- rating: number | null;
1120
1127
  isPaymentVerified: boolean | null;
1121
1128
  numberOfReviews: number | null;
1129
+ rating: number | null;
1122
1130
  jobsPosted: number | null;
1123
1131
  totalSpent: number | null;
1124
1132
  numberOfHires: number | null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jobResponseSchema = exports.jobListItemSchema = exports.jobSchema = exports.upworkJobSchema = exports.metadataSchema = exports.clientInfoSchema = exports.vendorQualificationSchema = exports.jobSkillsSchema = void 0;
3
+ exports.jobResponseSchema = exports.jobListItemSchema = exports.leadSchema = exports.upworkJobSchema = exports.metadataSchema = exports.clientInfoSchema = exports.vendorQualificationSchema = exports.jobSkillsSchema = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const job_note_1 = require("./job-note");
6
6
  const job_status_1 = require("./job-status");
@@ -64,7 +64,8 @@ exports.upworkJobSchema = zod_1.z.object({
64
64
  vendorQualifications: exports.vendorQualificationSchema.nullable(),
65
65
  processed: (0, zod_1.boolean)().nullable(),
66
66
  });
67
- exports.jobSchema = exports.upworkJobSchema.extend({
67
+ exports.leadSchema = exports.upworkJobSchema.extend({
68
+ jobId: zod_1.z.string(),
68
69
  updatedAt: zod_1.z.number().nullable(),
69
70
  suitabilityRating: zod_1.z.number().nullable(),
70
71
  suitabilityReason: zod_1.z.string().nullable(),
@@ -83,7 +84,7 @@ exports.jobListItemSchema = zod_1.z.object({
83
84
  datetime: zod_1.z.string().nullable(),
84
85
  });
85
86
  exports.jobResponseSchema = zod_1.z.object({
86
- jobs: zod_1.z.array(exports.jobSchema),
87
+ leads: zod_1.z.array(exports.leadSchema),
87
88
  nextCursor: zod_1.z.string().nullable(),
88
89
  hasMore: zod_1.z.boolean(),
89
90
  jobCounts: zod_1.z.number().nullable(),
@@ -0,0 +1 @@
1
+ export * from "./log-event";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./log-event"), exports);
@@ -0,0 +1,36 @@
1
+ import { z } from "zod";
2
+ export declare const LogEventTypeEnum: z.ZodEnum<["scraperStarted", "jobScraped", "jobsIndexed", "jobDuplicateSkipped", "jobSyncPublished", "jobSyncReceived", "leadCreated", "leadSkippedCampaignMismatch", "suitabilityPending", "suitabilityTaskCreated", "suitabilityStarted", "suitabilityComplete", "suitabilityFailed", "manualSuitabilityAnalyzed", "suitabilityRateLimited", "suitabilityRetryScheduled", "proposalPending", "proposalTaskCreated", "proposalStarted", "proposalComplete", "proposalFailed", "manualProposalGenerated", "proposalRetryScheduled", "biddingPending", "biddingTaskCreated", "biddingStarted", "biddingComplete", "biddingFailed", "biddingSkipped", "errorLogged", "cloudTaskRetry", "manualLeadEdited", "leadArchived", "auditTrailLogged"]>;
3
+ export declare const logEventSchema: z.ZodObject<{
4
+ type: z.ZodEnum<["scraperStarted", "jobScraped", "jobsIndexed", "jobDuplicateSkipped", "jobSyncPublished", "jobSyncReceived", "leadCreated", "leadSkippedCampaignMismatch", "suitabilityPending", "suitabilityTaskCreated", "suitabilityStarted", "suitabilityComplete", "suitabilityFailed", "manualSuitabilityAnalyzed", "suitabilityRateLimited", "suitabilityRetryScheduled", "proposalPending", "proposalTaskCreated", "proposalStarted", "proposalComplete", "proposalFailed", "manualProposalGenerated", "proposalRetryScheduled", "biddingPending", "biddingTaskCreated", "biddingStarted", "biddingComplete", "biddingFailed", "biddingSkipped", "errorLogged", "cloudTaskRetry", "manualLeadEdited", "leadArchived", "auditTrailLogged"]>;
5
+ source: z.ZodString;
6
+ resourceType: z.ZodDefault<z.ZodString>;
7
+ resourceId: z.ZodNullable<z.ZodString>;
8
+ leadId: z.ZodNullable<z.ZodString>;
9
+ campaignId: z.ZodNullable<z.ZodString>;
10
+ userId: z.ZodNullable<z.ZodString>;
11
+ reason: z.ZodNullable<z.ZodString>;
12
+ metadata: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
13
+ timestamp: z.ZodNumber;
14
+ }, "strip", z.ZodTypeAny, {
15
+ type: "suitabilityPending" | "suitabilityComplete" | "suitabilityFailed" | "proposalPending" | "proposalComplete" | "proposalFailed" | "biddingPending" | "biddingComplete" | "biddingFailed" | "scraperStarted" | "jobScraped" | "jobsIndexed" | "jobDuplicateSkipped" | "jobSyncPublished" | "jobSyncReceived" | "leadCreated" | "leadSkippedCampaignMismatch" | "suitabilityTaskCreated" | "suitabilityStarted" | "manualSuitabilityAnalyzed" | "suitabilityRateLimited" | "suitabilityRetryScheduled" | "proposalTaskCreated" | "proposalStarted" | "manualProposalGenerated" | "proposalRetryScheduled" | "biddingTaskCreated" | "biddingStarted" | "biddingSkipped" | "errorLogged" | "cloudTaskRetry" | "manualLeadEdited" | "leadArchived" | "auditTrailLogged";
16
+ reason: string | null;
17
+ source: string;
18
+ metadata: Record<string, unknown> | null;
19
+ timestamp: number;
20
+ resourceType: string;
21
+ resourceId: string | null;
22
+ leadId: string | null;
23
+ campaignId: string | null;
24
+ userId: string | null;
25
+ }, {
26
+ type: "suitabilityPending" | "suitabilityComplete" | "suitabilityFailed" | "proposalPending" | "proposalComplete" | "proposalFailed" | "biddingPending" | "biddingComplete" | "biddingFailed" | "scraperStarted" | "jobScraped" | "jobsIndexed" | "jobDuplicateSkipped" | "jobSyncPublished" | "jobSyncReceived" | "leadCreated" | "leadSkippedCampaignMismatch" | "suitabilityTaskCreated" | "suitabilityStarted" | "manualSuitabilityAnalyzed" | "suitabilityRateLimited" | "suitabilityRetryScheduled" | "proposalTaskCreated" | "proposalStarted" | "manualProposalGenerated" | "proposalRetryScheduled" | "biddingTaskCreated" | "biddingStarted" | "biddingSkipped" | "errorLogged" | "cloudTaskRetry" | "manualLeadEdited" | "leadArchived" | "auditTrailLogged";
27
+ reason: string | null;
28
+ source: string;
29
+ metadata: Record<string, unknown> | null;
30
+ timestamp: number;
31
+ resourceId: string | null;
32
+ leadId: string | null;
33
+ campaignId: string | null;
34
+ userId: string | null;
35
+ resourceType?: string | undefined;
36
+ }>;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.logEventSchema = exports.LogEventTypeEnum = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.LogEventTypeEnum = zod_1.z.enum([
6
+ // Scraper Events
7
+ "scraperStarted",
8
+ "jobScraped",
9
+ "jobsIndexed",
10
+ "jobDuplicateSkipped",
11
+ // Job Sync & Campaign Matching
12
+ "jobSyncPublished",
13
+ "jobSyncReceived",
14
+ "leadCreated",
15
+ "leadSkippedCampaignMismatch",
16
+ // Suitability Events
17
+ "suitabilityPending",
18
+ "suitabilityTaskCreated",
19
+ "suitabilityStarted",
20
+ "suitabilityComplete",
21
+ "suitabilityFailed",
22
+ "manualSuitabilityAnalyzed",
23
+ "suitabilityRateLimited",
24
+ "suitabilityRetryScheduled",
25
+ // Proposal Events
26
+ "proposalPending",
27
+ "proposalTaskCreated",
28
+ "proposalStarted",
29
+ "proposalComplete",
30
+ "proposalFailed",
31
+ "manualProposalGenerated",
32
+ "proposalRetryScheduled",
33
+ // Bidding Events
34
+ "biddingPending",
35
+ "biddingTaskCreated",
36
+ "biddingStarted",
37
+ "biddingComplete",
38
+ "biddingFailed",
39
+ "biddingSkipped",
40
+ // System/Generic Events
41
+ "errorLogged",
42
+ "cloudTaskRetry",
43
+ "manualLeadEdited",
44
+ "leadArchived",
45
+ "auditTrailLogged",
46
+ ]);
47
+ exports.logEventSchema = zod_1.z.object({
48
+ // The type of event (use a z.enum if possible)
49
+ type: exports.LogEventTypeEnum, // e.g. "suitability-failed", "proposal-generated"
50
+ // The service that triggered the event
51
+ source: zod_1.z.string(), // e.g. "lancer-agents", "lancer-bidding"
52
+ // Optional: Allow logging non-lead events in the future
53
+ resourceType: zod_1.z.string().default("lead"), // e.g. "lead", "campaign", "user"
54
+ // ID of the resource (primary entity affected)
55
+ resourceId: zod_1.z.string().nullable(), // fallback if leadId is not applicable
56
+ // Lead-level metadata
57
+ leadId: zod_1.z.string().nullable(),
58
+ campaignId: zod_1.z.string().nullable(),
59
+ userId: zod_1.z.string().nullable(),
60
+ // Reason or message for the event
61
+ reason: zod_1.z.string().nullable(),
62
+ // Generic metadata (stacktrace, score, raw request, etc.)
63
+ metadata: zod_1.z.record(zod_1.z.unknown()).nullable(),
64
+ // Optional timestamp override
65
+ timestamp: zod_1.z.number(),
66
+ });
@@ -1,10 +1,11 @@
1
- export * from './chat-message';
2
- export * from './job';
3
- export * from './saved-search';
4
- export * from './user';
5
- export * from './job-filters';
6
- export * from './campaign';
7
- export * from './bidding';
8
- export * from './ai';
9
- export * from './scraper';
10
- export * from './config';
1
+ export * from "./chat-message";
2
+ export * from "./job";
3
+ export * from "./saved-search";
4
+ export * from "./user";
5
+ export * from "./job-filters";
6
+ export * from "./campaign";
7
+ export * from "./bidding";
8
+ export * from "./ai";
9
+ export * from "./scraper";
10
+ export * from "./config";
11
+ export * from "./logger";
@@ -24,3 +24,4 @@ __exportStar(require("./bidding"), exports);
24
24
  __exportStar(require("./ai"), exports);
25
25
  __exportStar(require("./scraper"), exports);
26
26
  __exportStar(require("./config"), exports);
27
+ __exportStar(require("./logger"), exports);
@@ -0,0 +1 @@
1
+ export * from "./log-event";
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./log-event"), exports);
@@ -0,0 +1,4 @@
1
+ import { z } from "zod";
2
+ import { logEventSchema, LogEventTypeEnum } from "../../schemas/logger";
3
+ export type LogEventType = z.infer<typeof LogEventTypeEnum>;
4
+ export type LogEvent = z.infer<typeof logEventSchema>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "commonjs",
3
3
  "name": "lancer-shared",
4
- "version": "1.0.31",
4
+ "version": "1.0.33",
5
5
  "description": "This package contains shared stuff.",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.js",