lancer-shared 1.0.11 → 1.0.12

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.
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.leadResponseSchema = exports.jobListItemSchema = exports.leadSchema = exports.upworkJobSchema = exports.metadataSchema = exports.clientInfoSchema = exports.vendorQualificationSchema = exports.jobSkillsSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const lead_note_1 = require("./lead-note");
6
+ const lead_status_1 = require("./lead-status");
7
+ const proposal_1 = require("../ai/proposal");
8
+ exports.jobSkillsSchema = zod_1.z.object({
9
+ name: zod_1.z.string(),
10
+ });
11
+ exports.vendorQualificationSchema = zod_1.z.object({
12
+ location: zod_1.z.string().nullable(),
13
+ talentType: zod_1.z.enum(["Agency", "Independent", "unspecified"]).nullable(),
14
+ englishLevel: zod_1.z.string().nullable(),
15
+ minimumEarnings: zod_1.z.number().nullable(),
16
+ jobSuccessScore: zod_1.z.string().nullable(),
17
+ });
18
+ exports.clientInfoSchema = zod_1.z.object({
19
+ isPaymentVerified: zod_1.z.boolean().nullable(),
20
+ numberOfReviews: zod_1.z.number().nullable(),
21
+ rating: zod_1.z.number().nullable(),
22
+ country: zod_1.z.string().nullable(),
23
+ region: zod_1.z.string().nullable(),
24
+ jobsPosted: zod_1.z.number().nullable(),
25
+ totalSpent: zod_1.z.number().nullable(),
26
+ numberOfHires: zod_1.z.number().nullable(),
27
+ activeEngagements: zod_1.z.number().nullable(),
28
+ openJobs: zod_1.z.number().nullable(),
29
+ hireRate: zod_1.z.number().nullable(),
30
+ memberSince: zod_1.z.string().nullable(),
31
+ companyIndustry: zod_1.z.string().nullable(),
32
+ companySize: zod_1.z.string().nullable(),
33
+ enterpriseClient: zod_1.z.boolean().nullable(),
34
+ });
35
+ exports.metadataSchema = zod_1.z.object({
36
+ hours: zod_1.z.string().nullable(),
37
+ duration: zod_1.z.string().nullable(),
38
+ experienceLevel: zod_1.z.string().nullable(),
39
+ hourlyRate: zod_1.z
40
+ .object({
41
+ min: zod_1.z.number().nullable(),
42
+ max: zod_1.z.number().nullable(),
43
+ })
44
+ .nullable(),
45
+ paymentType: zod_1.z.string().nullable(),
46
+ fixedPrice: zod_1.z.number().nullable(),
47
+ });
48
+ exports.upworkJobSchema = zod_1.z.object({
49
+ id: zod_1.z.string().nullable(),
50
+ createdAt: zod_1.z.number().nullable(),
51
+ title: zod_1.z.string().nullable(),
52
+ category: zod_1.z.string().nullable(),
53
+ skills: zod_1.z.array(exports.jobSkillsSchema).nullable(),
54
+ datetime: zod_1.z.number().nullable(),
55
+ description: zod_1.z.string().nullable(),
56
+ descriptionLength: zod_1.z.number().nullable(),
57
+ connectsRequired: zod_1.z.number().nullable(),
58
+ projectType: zod_1.z.string().nullable(),
59
+ projectDuration: zod_1.z.string().nullable(),
60
+ questions: zod_1.z.array(zod_1.z.string()).nullable(),
61
+ jobUrl: zod_1.z.string().nullable(),
62
+ metadata: exports.metadataSchema.nullable(),
63
+ clientInfo: exports.clientInfoSchema.nullable(),
64
+ vendorQualifications: exports.vendorQualificationSchema.nullable(),
65
+ processed: (0, zod_1.boolean)().nullable(),
66
+ });
67
+ exports.leadSchema = exports.upworkJobSchema.extend({
68
+ jobId: zod_1.z.string(),
69
+ updatedAt: zod_1.z.number().nullable(),
70
+ suitabilityRating: zod_1.z.number().nullable(),
71
+ suitabilityReason: zod_1.z.string().nullable(),
72
+ proposal: zod_1.z.string().nullable(),
73
+ questionAnswerPairs: zod_1.z.array(proposal_1.questionAnswerPairSchema).nullable(),
74
+ agentStatus: lead_status_1.agentStatusSchema.nullable(),
75
+ leadStatus: lead_status_1.leadStatusSchema.nullable(),
76
+ notes: zod_1.z.array(lead_note_1.leadNoteSchema).nullable(),
77
+ biddingAmount: (0, zod_1.number)().nullable(),
78
+ boosted: (0, zod_1.boolean)().nullable(),
79
+ boostingAmount: (0, zod_1.number)().nullable(),
80
+ });
81
+ exports.jobListItemSchema = zod_1.z.object({
82
+ title: zod_1.z.string().nullable(),
83
+ jobUrl: zod_1.z.string().nullable(),
84
+ datetime: zod_1.z.string().nullable(),
85
+ });
86
+ exports.leadResponseSchema = zod_1.z.object({
87
+ leads: zod_1.z.array(exports.leadSchema),
88
+ nextCursor: zod_1.z.string().nullable(),
89
+ hasMore: zod_1.z.boolean(),
90
+ leadCounts: zod_1.z.number().nullable(),
91
+ });
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.scrapeResultSchema = void 0;
4
4
  const zod_1 = require("zod");
5
- const job_1 = require("../job");
5
+ const lead_1 = require("../lead");
6
6
  exports.scrapeResultSchema = zod_1.z.object({
7
- jobs: zod_1.z.array(job_1.upworkJobSchema),
7
+ jobs: zod_1.z.array(lead_1.upworkJobSchema),
8
8
  cookies: zod_1.z.array(zod_1.z.any()),
9
9
  });
@@ -1,10 +1,10 @@
1
- import { z } from 'zod';
2
- import { createJobNoteSchema, jobNoteSchema, updateJobNoteSchema, updateJobNotesOrderSchema } from '../../schemas/job';
3
- export interface JobNote extends z.infer<typeof jobNoteSchema> {
1
+ import { z } from "zod";
2
+ import { createLeadNoteSchema, leadNoteSchema, updateLeadNoteSchema, updateLeadNotesOrderSchema } from "../../schemas/lead";
3
+ export interface LeadNote extends z.infer<typeof leadNoteSchema> {
4
4
  }
5
- export interface CreateJobNote extends z.infer<typeof createJobNoteSchema> {
5
+ export interface CreateLeadNote extends z.infer<typeof createLeadNoteSchema> {
6
6
  }
7
- export interface UpdateJobNote extends z.infer<typeof updateJobNoteSchema> {
7
+ export interface UpdateLeadNote extends z.infer<typeof updateLeadNoteSchema> {
8
8
  }
9
- export interface UpdateJobNotesOrder extends z.infer<typeof updateJobNotesOrderSchema> {
9
+ export interface UpdateLeadNotesOrder extends z.infer<typeof updateLeadNotesOrderSchema> {
10
10
  }
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { jobLeadStatusSchema, jobStatusSchema } from "../../schemas/job/job-status";
3
- export type JobLeadStatus = z.infer<typeof jobLeadStatusSchema>;
4
- export declare const jobStatusDisplayMap: Record<JobLeadStatus, string>;
5
- export type JobStatus = z.infer<typeof jobStatusSchema>;
2
+ import { leadStatusSchema, agentStatusSchema } from "../../schemas/lead/lead-status";
3
+ export type LeadStatus = z.infer<typeof leadStatusSchema>;
4
+ export declare const leadStatusDisplayMap: Record<LeadStatus, string>;
5
+ export type LeadAgentStatus = z.infer<typeof agentStatusSchema>;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jobStatusDisplayMap = void 0;
4
- exports.jobStatusDisplayMap = {
3
+ exports.leadStatusDisplayMap = void 0;
4
+ exports.leadStatusDisplayMap = {
5
5
  leads: "Leads",
6
6
  contacted: "Contacted",
7
7
  viewed: "Viewed",
@@ -1,9 +1,9 @@
1
1
  import { z } from "zod";
2
2
  import { SavedSearch } from "../saved-search";
3
- import { JobNote } from "./job-note";
4
- import { JobStatus } from "./job-status";
3
+ import { LeadNote } from "./job-note";
4
+ import { LeadAgentStatus } from "./job-status";
5
5
  import { QuestionAnswerPair } from "../ai";
6
- import { clientInfoSchema, jobListItemSchema, jobResponseSchema, leadSchema, jobSkillsSchema, metadataSchema, upworkJobSchema, vendorQualificationSchema } from "../../schemas/job/job";
6
+ import { clientInfoSchema, jobListItemSchema, leadResponseSchema, leadSchema, jobSkillsSchema, metadataSchema, upworkJobSchema, vendorQualificationSchema } from "../../schemas/lead/lead";
7
7
  export interface UpworkJob extends z.infer<typeof upworkJobSchema> {
8
8
  clientInfo: ClientInfo | null;
9
9
  metadata: JobMetadata | null;
@@ -15,11 +15,11 @@ export interface Lead extends z.infer<typeof leadSchema> {
15
15
  metadata: JobMetadata | null;
16
16
  skills: JobSkill[] | null;
17
17
  vendorQualifications: VendorQualifications | null;
18
- notes: JobNote[] | null;
18
+ notes: LeadNote[] | null;
19
19
  questionAnswerPairs: QuestionAnswerPair[] | null;
20
- status: JobStatus;
20
+ status: LeadAgentStatus;
21
21
  }
22
- export interface LeadResponse extends z.infer<typeof jobResponseSchema> {
22
+ export interface LeadResponse extends z.infer<typeof leadResponseSchema> {
23
23
  leads: Lead[];
24
24
  }
25
25
  export type JobWithSavedSearch = Lead & {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "commonjs",
3
3
  "name": "lancer-shared",
4
- "version": "1.0.11",
4
+ "version": "1.0.12",
5
5
  "description": "This package contains shared stuff.",
6
6
  "types": "./dist/index.d.ts",
7
7
  "main": "./dist/index.js",