lancer-shared 1.2.10 → 1.2.11

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.
@@ -5674,6 +5674,14 @@ const organizationMemberSchema = objectType({
5674
5674
  invitedBy: stringType(),
5675
5675
  });
5676
5676
 
5677
+ const onboardingProgressSchema = z.object({
5678
+ profileSetup: z.boolean(),
5679
+ campaignCreated: z.boolean(),
5680
+ filtersAdded: z.boolean(),
5681
+ rulesConfigured: z.boolean(),
5682
+ automationEnabled: z.boolean(),
5683
+ });
5684
+
5677
5685
  const bidConfigSchema = objectType({
5678
5686
  agencyName: stringType().nullable(),
5679
5687
  bidderId: stringType().nullable(),
@@ -5705,6 +5713,9 @@ const organizationSchema = objectType({
5705
5713
  createdAt: numberType(),
5706
5714
  updatedAt: numberType(),
5707
5715
  });
5716
+ const createOrganizationSchema = organizationSchema.omit({
5717
+ id: true,
5718
+ });
5708
5719
  const creditDeductionEventTypeEnum = LogEventTypeEnum.extract([
5709
5720
  "suitabilityComplete",
5710
5721
  "proposalComplete",
@@ -6057,9 +6068,7 @@ const checkLeadStatusPayloadSchema = objectType({
6057
6068
 
6058
6069
  const userSchema = objectType({
6059
6070
  id: stringType(),
6060
- firstName: stringType(),
6061
- lastName: stringType(),
6062
- displayName: stringType(),
6071
+ name: stringType(),
6063
6072
  email: stringType(),
6064
6073
  organizationIds: z.array(stringType()),
6065
6074
  createdAt: numberType(),
@@ -6070,12 +6079,12 @@ const loginSchema = objectType({
6070
6079
  password: passwordSchema,
6071
6080
  });
6072
6081
  const registerSchema = objectType({
6073
- firstName: stringType().min(1, "First name is required").max(255),
6074
- lastName: stringType().min(1, "Last name is required").max(255),
6082
+ name: stringType().min(1, "First name is required").max(255),
6075
6083
  email: stringType()
6076
6084
  .email("Must be a valid email address")
6077
6085
  .max(255)
6078
6086
  .min(1, "Email address is required"),
6087
+ teamName: stringType().min(1, "Team name is required").max(255),
6079
6088
  password: passwordSchema,
6080
6089
  confirmPassword: passwordSchema,
6081
6090
  }).refine(({ password, confirmPassword }) => password === confirmPassword, {
@@ -12385,17 +12394,12 @@ const ROUTES = {
12385
12394
  FILTER_OPTIONS: "jobs/filter-options",
12386
12395
  TOTAL_JOBS: "jobs/total-jobs",
12387
12396
  GET_JOB_TITLE: (jobId) => `jobs/get-job-title/${jobId}`,
12388
- SEARCH: "jobs/search",
12389
12397
  },
12390
12398
  USERS: {
12391
12399
  BASE: "users",
12392
12400
  BY_ID: (id) => `users/${id}`,
12393
12401
  ORGANIZATIONS: (id) => `users/${id}/organizations`,
12394
12402
  },
12395
- AI_CONFIG: {
12396
- BASE: "ai-config",
12397
- GENERATE_KNOWLEDGE_BASE: "ai-config/generate-knowledge-base",
12398
- },
12399
12403
  COOKIES: {
12400
12404
  BASE: "cookies",
12401
12405
  SCRAPE: "cookies/scrape-cookies",
@@ -12452,8 +12456,13 @@ const ROUTES = {
12452
12456
  ORGANIZATIONS: {
12453
12457
  BASE: "organizations",
12454
12458
  BY_ID: (id) => `organizations/${id}`,
12459
+ ONBOARDING: (id) => `organizations/${id}/onboarding/progress`,
12455
12460
  AI_CONFIG: (id) => `organizations/${id}/settings/ai-config`,
12456
12461
  KNOWLEDGE_BASE: (id) => `organizations/${id}/settings/knowledge-base`,
12462
+ MEMBERS: {
12463
+ BASE: (id) => `organizations/${id}/members`,
12464
+ BY_ID: (id, memberId) => `organizations/${id}/members/${memberId}`,
12465
+ },
12457
12466
  NOTIFICATIONS: (id) => `organizations/${id}/settings/notifications`,
12458
12467
  SETTINGS: (id) => `organizations/${id}/settings`,
12459
12468
  CHARGES: (id) => `organizations/${id}/charges`,
@@ -12524,9 +12533,10 @@ const ROUTES = {
12524
12533
  },
12525
12534
  AGENT: {
12526
12535
  BASE: "agent",
12527
- TEST_RULES: "agent/test-rules",
12528
12536
  GENERATE_KNOWLEDGE_BASE: "agent/generate-knowledge-base",
12529
- TEST_PROMPTS: "agent/test-prompts",
12537
+ GENERATE_DEFAULT_AI_CONFIG: "agent/generate-ai-config",
12538
+ TEST_AI_CONFIG: "agent/test-ai-config",
12539
+ TEST_SYSTEM_PROMPTS: "agent/test-system-prompts",
12530
12540
  },
12531
12541
  BIDDERS: {
12532
12542
  BASE: "bidders",
@@ -12570,16 +12580,6 @@ const creditDeductionAmountMap = {
12570
12580
  proposalComplete: 5,
12571
12581
  };
12572
12582
 
12573
- const paths = {
12574
- auth: {
12575
- register: `auth/register`,
12576
- },
12577
- users: {
12578
- root: "users",
12579
- details: (id) => `users/${id}`,
12580
- },
12581
- };
12582
-
12583
12583
  // Main wrapper function
12584
12584
  async function tryCatch(promise) {
12585
12585
  try {
@@ -12891,6 +12891,7 @@ exports.commonQuestions = commonQuestions;
12891
12891
  exports.countryMapping = countryMapping;
12892
12892
  exports.createBidderAccountSchema = createBidderAccountSchema;
12893
12893
  exports.createCampaignSchema = createCampaignSchema;
12894
+ exports.createOrganizationSchema = createOrganizationSchema;
12894
12895
  exports.createScraperAccountSchema = createScraperAccountSchema;
12895
12896
  exports.creditDeductionAmountMap = creditDeductionAmountMap;
12896
12897
  exports.creditDeductionEventTypeEnum = creditDeductionEventTypeEnum;
@@ -12938,6 +12939,7 @@ exports.loginSchema = loginSchema;
12938
12939
  exports.metadataSchema = metadataSchema;
12939
12940
  exports.notificationConfigSchema = notificationConfigSchema;
12940
12941
  exports.nuxtStateJobSchema = nuxtStateJobSchema;
12942
+ exports.onboardingProgressSchema = onboardingProgressSchema;
12941
12943
  exports.organizationBillingSchema = organizationBillingSchema;
12942
12944
  exports.organizationLimitsSchema = organizationLimitsSchema;
12943
12945
  exports.organizationMemberRoleEnum = organizationMemberRoleEnum;
@@ -12948,7 +12950,6 @@ exports.organizationSubscriptionSchema = organizationSubscriptionSchema;
12948
12950
  exports.organizationTierEnum = organizationTierEnum;
12949
12951
  exports.organizationTypeSchema = organizationTypeSchema;
12950
12952
  exports.passwordSchema = passwordSchema;
12951
- exports.paths = paths;
12952
12953
  exports.paymentTypeEnum = paymentTypeEnum;
12953
12954
  exports.periodUsageSchema = periodUsageSchema;
12954
12955
  exports.projectDurationEnum = projectDurationEnum;
@@ -1,12 +1,3 @@
1
- export declare const paths: {
2
- auth: {
3
- register: string;
4
- };
5
- users: {
6
- root: string;
7
- details: (id: string) => string;
8
- };
9
- };
10
1
  export * from "./common-questions";
11
2
  export * from "./job-filter-options";
12
3
  export * from "./job-status";
@@ -22,17 +22,12 @@ export declare const ROUTES: {
22
22
  readonly FILTER_OPTIONS: "jobs/filter-options";
23
23
  readonly TOTAL_JOBS: "jobs/total-jobs";
24
24
  readonly GET_JOB_TITLE: (jobId: string) => string;
25
- readonly SEARCH: "jobs/search";
26
25
  };
27
26
  readonly USERS: {
28
27
  readonly BASE: "users";
29
28
  readonly BY_ID: (id: string) => string;
30
29
  readonly ORGANIZATIONS: (id: string) => string;
31
30
  };
32
- readonly AI_CONFIG: {
33
- readonly BASE: "ai-config";
34
- readonly GENERATE_KNOWLEDGE_BASE: "ai-config/generate-knowledge-base";
35
- };
36
31
  readonly COOKIES: {
37
32
  readonly BASE: "cookies";
38
33
  readonly SCRAPE: "cookies/scrape-cookies";
@@ -89,8 +84,13 @@ export declare const ROUTES: {
89
84
  readonly ORGANIZATIONS: {
90
85
  readonly BASE: "organizations";
91
86
  readonly BY_ID: (id: string) => string;
87
+ readonly ONBOARDING: (id: string) => string;
92
88
  readonly AI_CONFIG: (id: string) => string;
93
89
  readonly KNOWLEDGE_BASE: (id: string) => string;
90
+ readonly MEMBERS: {
91
+ readonly BASE: (id: string) => string;
92
+ readonly BY_ID: (id: string, memberId: string) => string;
93
+ };
94
94
  readonly NOTIFICATIONS: (id: string) => string;
95
95
  readonly SETTINGS: (id: string) => string;
96
96
  readonly CHARGES: (id: string) => string;
@@ -158,9 +158,10 @@ export declare const ROUTES: {
158
158
  };
159
159
  readonly AGENT: {
160
160
  readonly BASE: "agent";
161
- readonly TEST_RULES: "agent/test-rules";
162
161
  readonly GENERATE_KNOWLEDGE_BASE: "agent/generate-knowledge-base";
163
- readonly TEST_PROMPTS: "agent/test-prompts";
162
+ readonly GENERATE_DEFAULT_AI_CONFIG: "agent/generate-ai-config";
163
+ readonly TEST_AI_CONFIG: "agent/test-ai-config";
164
+ readonly TEST_SYSTEM_PROMPTS: "agent/test-system-prompts";
164
165
  };
165
166
  readonly BIDDERS: {
166
167
  readonly BASE: "bidders";
@@ -185,6 +185,147 @@ export declare const organizationSchema: z.ZodObject<{
185
185
  createdAt: number;
186
186
  updatedAt: number;
187
187
  }>;
188
+ export declare const createOrganizationSchema: z.ZodObject<Omit<{
189
+ id: z.ZodString;
190
+ name: z.ZodString;
191
+ type: z.ZodEnum<["agency", "freelancer"]>;
192
+ tierId: z.ZodEnum<["free", "premium"]>;
193
+ subscription: z.ZodNullable<z.ZodObject<{
194
+ tierId: z.ZodString;
195
+ status: z.ZodEnum<["active", "trialing", "cancelled", "paused"]>;
196
+ creditsRemaining: z.ZodNumber;
197
+ startedAt: z.ZodNumber;
198
+ currentPeriodEnd: z.ZodNumber;
199
+ stripeSubscriptionId: z.ZodString;
200
+ source: z.ZodEnum<["stripe", "manual"]>;
201
+ }, "strip", z.ZodTypeAny, {
202
+ status: "active" | "trialing" | "cancelled" | "paused";
203
+ creditsRemaining: number;
204
+ tierId: string;
205
+ startedAt: number;
206
+ currentPeriodEnd: number;
207
+ stripeSubscriptionId: string;
208
+ source: "stripe" | "manual";
209
+ }, {
210
+ status: "active" | "trialing" | "cancelled" | "paused";
211
+ creditsRemaining: number;
212
+ tierId: string;
213
+ startedAt: number;
214
+ currentPeriodEnd: number;
215
+ stripeSubscriptionId: string;
216
+ source: "stripe" | "manual";
217
+ }>>;
218
+ bidConfig: z.ZodObject<{
219
+ agencyName: z.ZodNullable<z.ZodString>;
220
+ bidderId: z.ZodNullable<z.ZodString>;
221
+ contractorName: z.ZodNullable<z.ZodString>;
222
+ specialisedProfile: z.ZodNullable<z.ZodString>;
223
+ }, "strip", z.ZodTypeAny, {
224
+ agencyName: string | null;
225
+ bidderId: string | null;
226
+ contractorName: string | null;
227
+ specialisedProfile: string | null;
228
+ }, {
229
+ agencyName: string | null;
230
+ bidderId: string | null;
231
+ contractorName: string | null;
232
+ specialisedProfile: string | null;
233
+ }>;
234
+ active: z.ZodBoolean;
235
+ limits: z.ZodObject<{
236
+ monthlyCredits: z.ZodNumber;
237
+ usedCredits: z.ZodNumber;
238
+ extraCredits: z.ZodNumber;
239
+ }, "strip", z.ZodTypeAny, {
240
+ monthlyCredits: number;
241
+ usedCredits: number;
242
+ extraCredits: number;
243
+ }, {
244
+ monthlyCredits: number;
245
+ usedCredits: number;
246
+ extraCredits: number;
247
+ }>;
248
+ billing: z.ZodNullable<z.ZodObject<{
249
+ stripeCustomerId: z.ZodString;
250
+ savedCard: z.ZodBoolean;
251
+ creditsRemaining: z.ZodNumber;
252
+ }, "strip", z.ZodTypeAny, {
253
+ stripeCustomerId: string;
254
+ savedCard: boolean;
255
+ creditsRemaining: number;
256
+ }, {
257
+ stripeCustomerId: string;
258
+ savedCard: boolean;
259
+ creditsRemaining: number;
260
+ }>>;
261
+ createdAt: z.ZodNumber;
262
+ updatedAt: z.ZodNumber;
263
+ }, "id">, "strip", z.ZodTypeAny, {
264
+ type: "agency" | "freelancer";
265
+ name: string;
266
+ tierId: "free" | "premium";
267
+ active: boolean;
268
+ subscription: {
269
+ status: "active" | "trialing" | "cancelled" | "paused";
270
+ creditsRemaining: number;
271
+ tierId: string;
272
+ startedAt: number;
273
+ currentPeriodEnd: number;
274
+ stripeSubscriptionId: string;
275
+ source: "stripe" | "manual";
276
+ } | null;
277
+ bidConfig: {
278
+ agencyName: string | null;
279
+ bidderId: string | null;
280
+ contractorName: string | null;
281
+ specialisedProfile: string | null;
282
+ };
283
+ limits: {
284
+ monthlyCredits: number;
285
+ usedCredits: number;
286
+ extraCredits: number;
287
+ };
288
+ billing: {
289
+ stripeCustomerId: string;
290
+ savedCard: boolean;
291
+ creditsRemaining: number;
292
+ } | null;
293
+ createdAt: number;
294
+ updatedAt: number;
295
+ }, {
296
+ type: "agency" | "freelancer";
297
+ name: string;
298
+ tierId: "free" | "premium";
299
+ active: boolean;
300
+ subscription: {
301
+ status: "active" | "trialing" | "cancelled" | "paused";
302
+ creditsRemaining: number;
303
+ tierId: string;
304
+ startedAt: number;
305
+ currentPeriodEnd: number;
306
+ stripeSubscriptionId: string;
307
+ source: "stripe" | "manual";
308
+ } | null;
309
+ bidConfig: {
310
+ agencyName: string | null;
311
+ bidderId: string | null;
312
+ contractorName: string | null;
313
+ specialisedProfile: string | null;
314
+ };
315
+ limits: {
316
+ monthlyCredits: number;
317
+ usedCredits: number;
318
+ extraCredits: number;
319
+ };
320
+ billing: {
321
+ stripeCustomerId: string;
322
+ savedCard: boolean;
323
+ creditsRemaining: number;
324
+ } | null;
325
+ createdAt: number;
326
+ updatedAt: number;
327
+ }>;
328
+ export type CreateOrganization = z.infer<typeof createOrganizationSchema>;
188
329
  export declare const creditDeductionEventTypeEnum: z.ZodEnum<["suitabilityComplete", "proposalComplete"]>;
189
330
  export declare const creditDeductionPayloadSchema: z.ZodObject<{
190
331
  event: z.ZodEnum<["suitabilityComplete", "proposalComplete"]>;
@@ -347,3 +488,4 @@ export interface BidConfig extends infer<typeof bidConfigSchema> {
347
488
  export type OrganizationType = z.infer<typeof organizationTypeSchema>;
348
489
  export * from "./member";
349
490
  export * from "./subscription";
491
+ export * from "./onboarding";
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ export declare const onboardingProgressSchema: z.ZodObject<{
3
+ profileSetup: z.ZodBoolean;
4
+ campaignCreated: z.ZodBoolean;
5
+ filtersAdded: z.ZodBoolean;
6
+ rulesConfigured: z.ZodBoolean;
7
+ automationEnabled: z.ZodBoolean;
8
+ }, "strip", z.ZodTypeAny, {
9
+ profileSetup: boolean;
10
+ campaignCreated: boolean;
11
+ filtersAdded: boolean;
12
+ rulesConfigured: boolean;
13
+ automationEnabled: boolean;
14
+ }, {
15
+ profileSetup: boolean;
16
+ campaignCreated: boolean;
17
+ filtersAdded: boolean;
18
+ rulesConfigured: boolean;
19
+ automationEnabled: boolean;
20
+ }>;
21
+ export type OnboardingProgress = z.infer<typeof onboardingProgressSchema>;
@@ -2,27 +2,21 @@ import { z } from "zod";
2
2
  import { Organization } from "../organization";
3
3
  export declare const userSchema: z.ZodObject<{
4
4
  id: z.ZodString;
5
- firstName: z.ZodString;
6
- lastName: z.ZodString;
7
- displayName: z.ZodString;
5
+ name: z.ZodString;
8
6
  email: z.ZodString;
9
7
  organizationIds: z.ZodArray<z.ZodString, "many">;
10
8
  createdAt: z.ZodNumber;
11
9
  updatedAt: z.ZodNumber;
12
10
  }, "strip", z.ZodTypeAny, {
13
11
  id: string;
14
- firstName: string;
15
- lastName: string;
16
- displayName: string;
12
+ name: string;
17
13
  email: string;
18
14
  organizationIds: string[];
19
15
  createdAt: number;
20
16
  updatedAt: number;
21
17
  }, {
22
18
  id: string;
23
- firstName: string;
24
- lastName: string;
25
- displayName: string;
19
+ name: string;
26
20
  email: string;
27
21
  organizationIds: string[];
28
22
  createdAt: number;
@@ -39,34 +33,34 @@ export declare const loginSchema: z.ZodObject<{
39
33
  password: string;
40
34
  }>;
41
35
  export declare const registerSchema: z.ZodEffects<z.ZodObject<{
42
- firstName: z.ZodString;
43
- lastName: z.ZodString;
36
+ name: z.ZodString;
44
37
  email: z.ZodString;
38
+ teamName: z.ZodString;
45
39
  password: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
46
40
  confirmPassword: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, string, string>;
47
41
  }, "strip", z.ZodTypeAny, {
48
- firstName: string;
49
- lastName: string;
42
+ name: string;
50
43
  email: string;
51
44
  password: string;
45
+ teamName: string;
52
46
  confirmPassword: string;
53
47
  }, {
54
- firstName: string;
55
- lastName: string;
48
+ name: string;
56
49
  email: string;
57
50
  password: string;
51
+ teamName: string;
58
52
  confirmPassword: string;
59
53
  }>, {
60
- firstName: string;
61
- lastName: string;
54
+ name: string;
62
55
  email: string;
63
56
  password: string;
57
+ teamName: string;
64
58
  confirmPassword: string;
65
59
  }, {
66
- firstName: string;
67
- lastName: string;
60
+ name: string;
68
61
  email: string;
69
62
  password: string;
63
+ teamName: string;
70
64
  confirmPassword: string;
71
65
  }>;
72
66
  export declare const upworkProfileSchema: z.ZodObject<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lancer-shared",
3
- "version": "1.2.10",
3
+ "version": "1.2.11",
4
4
  "description": "This package contains shared stuff.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "dist/bundle.cjs.js",