lancer-shared 1.2.132 → 1.2.134

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.
@@ -13148,14 +13148,15 @@ const limitsSchema = objectType({
13148
13148
  extraCredits: numberType(),
13149
13149
  });
13150
13150
  const oneTimePaymentSchema = z.object({
13151
- paidAt: z.number(),
13152
- amount: z.number(),
13153
- currency: z.string(),
13151
+ paidAt: z.number().optional(),
13152
+ amount: z.number().optional(),
13153
+ currency: z.string().optional(),
13154
13154
  status: z.string(),
13155
- paymentIntentId: z.string(),
13155
+ paymentIntentId: z.string().optional(),
13156
+ error: z.string().optional(),
13156
13157
  });
13157
13158
  const oneTimePaymentsSchema = z.object({
13158
- usAccountRental: oneTimePaymentSchema.optional(),
13159
+ usBidderAccountPayment: oneTimePaymentSchema.optional(),
13159
13160
  });
13160
13161
  const organizationSchema = objectType({
13161
13162
  id: stringType(),
@@ -13882,6 +13883,7 @@ const planFeatureSchema = objectType({
13882
13883
  const planSchema = objectType({
13883
13884
  id: stringType().regex(/^prod_[a-zA-Z0-9]+$/),
13884
13885
  name: stringType(),
13886
+ displayName: stringType(),
13885
13887
  slug: stringType().regex(/^[a-z0-9-]+$/),
13886
13888
  description: stringType(),
13887
13889
  price: numberType(),
@@ -14145,19 +14147,25 @@ const sendAlertPayloadSchema = z.object({
14145
14147
  errorMessage: z.string(),
14146
14148
  });
14147
14149
 
14148
- const bidderInstanceGCPMetadata = objectType({
14150
+ const gcpMetadataSchema = objectType({
14149
14151
  instanceName: stringType(),
14150
14152
  machineType: stringType(),
14151
14153
  zone: stringType(),
14152
14154
  region: stringType(),
14153
14155
  });
14156
+ const hetznerMetadataSchema = objectType({
14157
+ id: stringType(),
14158
+ type: stringType(),
14159
+ image: stringType(),
14160
+ });
14154
14161
  const bidderInstanceStatusEnum = z.enum(["available", "unavailable"]);
14155
14162
  const bidderInstanceSchema = objectType({
14156
14163
  id: stringType(),
14157
14164
  ipAddress: stringType(),
14158
14165
  domain: stringType().nullable(),
14159
14166
  bidderAccounts: arrayType(stringType()),
14160
- gcp: bidderInstanceGCPMetadata,
14167
+ gcp: gcpMetadataSchema,
14168
+ hetzner: hetznerMetadataSchema,
14161
14169
  status: bidderInstanceStatusEnum,
14162
14170
  createdAt: numberType(),
14163
14171
  updatedAt: numberType(),
@@ -14516,6 +14524,24 @@ const stringify = (object, space = 4) => {
14516
14524
  return JSON.stringify(object, getCircularReplacer(), space);
14517
14525
  };
14518
14526
  const pluralize = (val, quantity) => `${val}${quantity === 1 ? "" : "s"}`;
14527
+ const formatDuration = (ms) => {
14528
+ const duration = moment.duration(ms);
14529
+ if (ms < 1000) {
14530
+ return `${ms} ms`;
14531
+ }
14532
+ else if (ms < 60 * 1000) {
14533
+ return `${duration.asSeconds().toFixed(2)} sec`;
14534
+ }
14535
+ else if (ms < 60 * 60 * 1000) {
14536
+ return `${duration.asMinutes().toFixed(2)} min`;
14537
+ }
14538
+ else if (ms < 24 * 60 * 60 * 1000) {
14539
+ return `${duration.asHours().toFixed(2)} hr`;
14540
+ }
14541
+ else {
14542
+ return `${duration.asDays().toFixed(2)} days`;
14543
+ }
14544
+ };
14519
14545
 
14520
14546
  exports.BidderAccountAlreadyConnectedException = BidderAccountAlreadyConnectedException;
14521
14547
  exports.CAMPAIGN_NOTIFICATION_SETTINGS = CAMPAIGN_NOTIFICATION_SETTINGS;
@@ -14654,6 +14680,7 @@ exports.findLeadsRequestSchema = findLeadsRequestSchema;
14654
14680
  exports.findLeadsResponseSchema = findLeadsResponseSchema;
14655
14681
  exports.forgotPasswordSchema = forgotPasswordSchema;
14656
14682
  exports.formatCurrency = formatCurrency;
14683
+ exports.formatDuration = formatDuration;
14657
14684
  exports.freelancerBidPayloadSchema = freelancerBidPayloadSchema;
14658
14685
  exports.freelancerBidProposalDataSchema = freelancerBidProposalDataSchema;
14659
14686
  exports.generateLeadCountsRequestSchema = generateLeadCountsRequestSchema;
@@ -21,6 +21,19 @@ export declare const bidderInstanceSchema: z.ZodObject<{
21
21
  zone: string;
22
22
  region: string;
23
23
  }>;
24
+ hetzner: z.ZodObject<{
25
+ id: z.ZodString;
26
+ type: z.ZodString;
27
+ image: z.ZodString;
28
+ }, "strip", z.ZodTypeAny, {
29
+ type: string;
30
+ id: string;
31
+ image: string;
32
+ }, {
33
+ type: string;
34
+ id: string;
35
+ image: string;
36
+ }>;
24
37
  status: z.ZodEnum<["available", "unavailable"]>;
25
38
  createdAt: z.ZodNumber;
26
39
  updatedAt: z.ZodNumber;
@@ -36,6 +49,11 @@ export declare const bidderInstanceSchema: z.ZodObject<{
36
49
  zone: string;
37
50
  region: string;
38
51
  };
52
+ hetzner: {
53
+ type: string;
54
+ id: string;
55
+ image: string;
56
+ };
39
57
  createdAt: number;
40
58
  updatedAt: number;
41
59
  }, {
@@ -50,6 +68,11 @@ export declare const bidderInstanceSchema: z.ZodObject<{
50
68
  zone: string;
51
69
  region: string;
52
70
  };
71
+ hetzner: {
72
+ type: string;
73
+ id: string;
74
+ image: string;
75
+ };
53
76
  createdAt: number;
54
77
  updatedAt: number;
55
78
  }>;
@@ -16,6 +16,70 @@ export declare const limitsSchema: z.ZodObject<{
16
16
  usedCredits: number;
17
17
  extraCredits: number;
18
18
  }>;
19
+ declare const oneTimePaymentSchema: z.ZodObject<{
20
+ paidAt: z.ZodOptional<z.ZodNumber>;
21
+ amount: z.ZodOptional<z.ZodNumber>;
22
+ currency: z.ZodOptional<z.ZodString>;
23
+ status: z.ZodString;
24
+ paymentIntentId: z.ZodOptional<z.ZodString>;
25
+ error: z.ZodOptional<z.ZodString>;
26
+ }, "strip", z.ZodTypeAny, {
27
+ status: string;
28
+ paidAt?: number | undefined;
29
+ amount?: number | undefined;
30
+ currency?: string | undefined;
31
+ paymentIntentId?: string | undefined;
32
+ error?: string | undefined;
33
+ }, {
34
+ status: string;
35
+ paidAt?: number | undefined;
36
+ amount?: number | undefined;
37
+ currency?: string | undefined;
38
+ paymentIntentId?: string | undefined;
39
+ error?: string | undefined;
40
+ }>;
41
+ declare const oneTimePaymentsSchema: z.ZodObject<{
42
+ usBidderAccountPayment: z.ZodOptional<z.ZodObject<{
43
+ paidAt: z.ZodOptional<z.ZodNumber>;
44
+ amount: z.ZodOptional<z.ZodNumber>;
45
+ currency: z.ZodOptional<z.ZodString>;
46
+ status: z.ZodString;
47
+ paymentIntentId: z.ZodOptional<z.ZodString>;
48
+ error: z.ZodOptional<z.ZodString>;
49
+ }, "strip", z.ZodTypeAny, {
50
+ status: string;
51
+ paidAt?: number | undefined;
52
+ amount?: number | undefined;
53
+ currency?: string | undefined;
54
+ paymentIntentId?: string | undefined;
55
+ error?: string | undefined;
56
+ }, {
57
+ status: string;
58
+ paidAt?: number | undefined;
59
+ amount?: number | undefined;
60
+ currency?: string | undefined;
61
+ paymentIntentId?: string | undefined;
62
+ error?: string | undefined;
63
+ }>>;
64
+ }, "strip", z.ZodTypeAny, {
65
+ usBidderAccountPayment?: {
66
+ status: string;
67
+ paidAt?: number | undefined;
68
+ amount?: number | undefined;
69
+ currency?: string | undefined;
70
+ paymentIntentId?: string | undefined;
71
+ error?: string | undefined;
72
+ } | undefined;
73
+ }, {
74
+ usBidderAccountPayment?: {
75
+ status: string;
76
+ paidAt?: number | undefined;
77
+ amount?: number | undefined;
78
+ currency?: string | undefined;
79
+ paymentIntentId?: string | undefined;
80
+ error?: string | undefined;
81
+ } | undefined;
82
+ }>;
19
83
  export declare const organizationSchema: z.ZodObject<{
20
84
  id: z.ZodString;
21
85
  name: z.ZodString;
@@ -184,40 +248,45 @@ export declare const organizationSchema: z.ZodObject<{
184
248
  openRouterApiKey: z.ZodNullable<z.ZodString>;
185
249
  appTrialEndsAt: z.ZodNullable<z.ZodNumber>;
186
250
  oneTimePayments: z.ZodOptional<z.ZodObject<{
187
- usAccountRental: z.ZodOptional<z.ZodObject<{
188
- paidAt: z.ZodNumber;
189
- amount: z.ZodNumber;
190
- currency: z.ZodString;
251
+ usBidderAccountPayment: z.ZodOptional<z.ZodObject<{
252
+ paidAt: z.ZodOptional<z.ZodNumber>;
253
+ amount: z.ZodOptional<z.ZodNumber>;
254
+ currency: z.ZodOptional<z.ZodString>;
191
255
  status: z.ZodString;
192
- paymentIntentId: z.ZodString;
256
+ paymentIntentId: z.ZodOptional<z.ZodString>;
257
+ error: z.ZodOptional<z.ZodString>;
193
258
  }, "strip", z.ZodTypeAny, {
194
259
  status: string;
195
- paidAt: number;
196
- amount: number;
197
- currency: string;
198
- paymentIntentId: string;
260
+ paidAt?: number | undefined;
261
+ amount?: number | undefined;
262
+ currency?: string | undefined;
263
+ paymentIntentId?: string | undefined;
264
+ error?: string | undefined;
199
265
  }, {
200
266
  status: string;
201
- paidAt: number;
202
- amount: number;
203
- currency: string;
204
- paymentIntentId: string;
267
+ paidAt?: number | undefined;
268
+ amount?: number | undefined;
269
+ currency?: string | undefined;
270
+ paymentIntentId?: string | undefined;
271
+ error?: string | undefined;
205
272
  }>>;
206
273
  }, "strip", z.ZodTypeAny, {
207
- usAccountRental?: {
274
+ usBidderAccountPayment?: {
208
275
  status: string;
209
- paidAt: number;
210
- amount: number;
211
- currency: string;
212
- paymentIntentId: string;
276
+ paidAt?: number | undefined;
277
+ amount?: number | undefined;
278
+ currency?: string | undefined;
279
+ paymentIntentId?: string | undefined;
280
+ error?: string | undefined;
213
281
  } | undefined;
214
282
  }, {
215
- usAccountRental?: {
283
+ usBidderAccountPayment?: {
216
284
  status: string;
217
- paidAt: number;
218
- amount: number;
219
- currency: string;
220
- paymentIntentId: string;
285
+ paidAt?: number | undefined;
286
+ amount?: number | undefined;
287
+ currency?: string | undefined;
288
+ paymentIntentId?: string | undefined;
289
+ error?: string | undefined;
221
290
  } | undefined;
222
291
  }>>;
223
292
  }, "strip", z.ZodTypeAny, {
@@ -268,12 +337,13 @@ export declare const organizationSchema: z.ZodObject<{
268
337
  openRouterApiKey: string | null;
269
338
  appTrialEndsAt: number | null;
270
339
  oneTimePayments?: {
271
- usAccountRental?: {
340
+ usBidderAccountPayment?: {
272
341
  status: string;
273
- paidAt: number;
274
- amount: number;
275
- currency: string;
276
- paymentIntentId: string;
342
+ paidAt?: number | undefined;
343
+ amount?: number | undefined;
344
+ currency?: string | undefined;
345
+ paymentIntentId?: string | undefined;
346
+ error?: string | undefined;
277
347
  } | undefined;
278
348
  } | undefined;
279
349
  }, {
@@ -324,12 +394,13 @@ export declare const organizationSchema: z.ZodObject<{
324
394
  openRouterApiKey: string | null;
325
395
  appTrialEndsAt: number | null;
326
396
  oneTimePayments?: {
327
- usAccountRental?: {
397
+ usBidderAccountPayment?: {
328
398
  status: string;
329
- paidAt: number;
330
- amount: number;
331
- currency: string;
332
- paymentIntentId: string;
399
+ paidAt?: number | undefined;
400
+ amount?: number | undefined;
401
+ currency?: string | undefined;
402
+ paymentIntentId?: string | undefined;
403
+ error?: string | undefined;
333
404
  } | undefined;
334
405
  } | undefined;
335
406
  }>;
@@ -593,40 +664,45 @@ export declare const createOrganizationSchema: z.ZodObject<Pick<{
593
664
  openRouterApiKey: z.ZodNullable<z.ZodString>;
594
665
  appTrialEndsAt: z.ZodNullable<z.ZodNumber>;
595
666
  oneTimePayments: z.ZodOptional<z.ZodObject<{
596
- usAccountRental: z.ZodOptional<z.ZodObject<{
597
- paidAt: z.ZodNumber;
598
- amount: z.ZodNumber;
599
- currency: z.ZodString;
667
+ usBidderAccountPayment: z.ZodOptional<z.ZodObject<{
668
+ paidAt: z.ZodOptional<z.ZodNumber>;
669
+ amount: z.ZodOptional<z.ZodNumber>;
670
+ currency: z.ZodOptional<z.ZodString>;
600
671
  status: z.ZodString;
601
- paymentIntentId: z.ZodString;
672
+ paymentIntentId: z.ZodOptional<z.ZodString>;
673
+ error: z.ZodOptional<z.ZodString>;
602
674
  }, "strip", z.ZodTypeAny, {
603
675
  status: string;
604
- paidAt: number;
605
- amount: number;
606
- currency: string;
607
- paymentIntentId: string;
676
+ paidAt?: number | undefined;
677
+ amount?: number | undefined;
678
+ currency?: string | undefined;
679
+ paymentIntentId?: string | undefined;
680
+ error?: string | undefined;
608
681
  }, {
609
682
  status: string;
610
- paidAt: number;
611
- amount: number;
612
- currency: string;
613
- paymentIntentId: string;
683
+ paidAt?: number | undefined;
684
+ amount?: number | undefined;
685
+ currency?: string | undefined;
686
+ paymentIntentId?: string | undefined;
687
+ error?: string | undefined;
614
688
  }>>;
615
689
  }, "strip", z.ZodTypeAny, {
616
- usAccountRental?: {
690
+ usBidderAccountPayment?: {
617
691
  status: string;
618
- paidAt: number;
619
- amount: number;
620
- currency: string;
621
- paymentIntentId: string;
692
+ paidAt?: number | undefined;
693
+ amount?: number | undefined;
694
+ currency?: string | undefined;
695
+ paymentIntentId?: string | undefined;
696
+ error?: string | undefined;
622
697
  } | undefined;
623
698
  }, {
624
- usAccountRental?: {
699
+ usBidderAccountPayment?: {
625
700
  status: string;
626
- paidAt: number;
627
- amount: number;
628
- currency: string;
629
- paymentIntentId: string;
701
+ paidAt?: number | undefined;
702
+ amount?: number | undefined;
703
+ currency?: string | undefined;
704
+ paymentIntentId?: string | undefined;
705
+ error?: string | undefined;
630
706
  } | undefined;
631
707
  }>>;
632
708
  }, "type" | "name">, "strip", z.ZodTypeAny, {
@@ -787,11 +863,17 @@ export declare const subscribePayloadSchema: z.ZodObject<{
787
863
  toltReferral?: string | undefined;
788
864
  couponCode?: string | null | undefined;
789
865
  }>;
866
+ export interface OneTimePayment extends z.infer<typeof oneTimePaymentSchema> {
867
+ }
868
+ export interface OneTimePayments extends z.infer<typeof oneTimePaymentsSchema> {
869
+ usBidderAccountPayment?: OneTimePayment;
870
+ }
790
871
  export interface Organization extends infer<typeof organizationSchema> {
791
872
  coverLetterTemplates: CoverLetterTemplate[] | null;
792
873
  settings: OrganizationSettings | null;
793
874
  profile: OrganizationProfile | null;
794
875
  onboarding: OnboardingProgress | null;
876
+ oneTimePayments: OneTimePayments;
795
877
  }
796
878
  export interface TrackUsagePayloadSchema extends infer<typeof trackUsagePayloadSchema> {
797
879
  }
@@ -48,6 +48,7 @@ export declare const planFeatureSchema: import("zod").ZodObject<{
48
48
  export declare const planSchema: import("zod").ZodObject<{
49
49
  id: import("zod").ZodString;
50
50
  name: import("zod").ZodString;
51
+ displayName: import("zod").ZodString;
51
52
  slug: import("zod").ZodString;
52
53
  description: import("zod").ZodString;
53
54
  price: import("zod").ZodNumber;
@@ -106,6 +107,7 @@ export declare const planSchema: import("zod").ZodObject<{
106
107
  id: string;
107
108
  name: string;
108
109
  description: string;
110
+ displayName: string;
109
111
  slug: string;
110
112
  price: number;
111
113
  stripe: {
@@ -131,6 +133,7 @@ export declare const planSchema: import("zod").ZodObject<{
131
133
  id: string;
132
134
  name: string;
133
135
  description: string;
136
+ displayName: string;
134
137
  slug: string;
135
138
  price: number;
136
139
  stripe: {
@@ -4,3 +4,4 @@ export declare const capitalize: (str: string) => string;
4
4
  export declare const generateSlug: (name: string) => string;
5
5
  export declare const stringify: (object: any, space?: number) => string;
6
6
  export declare const pluralize: (val: string, quantity: number) => string;
7
+ export declare const formatDuration: (ms: number) => string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lancer-shared",
3
- "version": "1.2.132",
3
+ "version": "1.2.134",
4
4
  "description": "This package contains shared stuff.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "dist/bundle.cjs.js",