@plyaz/types 1.14.12 → 1.15.0

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.
package/dist/index.cjs CHANGED
@@ -3419,6 +3419,184 @@ var CHAIN_ID = {
3419
3419
  BaseSepolia: 84532
3420
3420
  };
3421
3421
 
3422
+ // src/user/enums.ts
3423
+ var COUNTRIES = {
3424
+ unitedKingdom: "unitedKingdom",
3425
+ germany: "germany",
3426
+ france: "france",
3427
+ spain: "spain",
3428
+ italy: "italy",
3429
+ netherlands: "netherlands",
3430
+ belgium: "belgium",
3431
+ austria: "austria",
3432
+ switzerland: "switzerland",
3433
+ sweden: "sweden",
3434
+ norway: "norway",
3435
+ denmark: "denmark",
3436
+ finland: "finland",
3437
+ portugal: "portugal",
3438
+ ireland: "ireland",
3439
+ poland: "poland",
3440
+ czechRepublic: "czechRepublic",
3441
+ hungary: "hungary",
3442
+ romania: "romania",
3443
+ bulgaria: "bulgaria",
3444
+ croatia: "croatia",
3445
+ slovenia: "slovenia",
3446
+ slovakia: "slovakia",
3447
+ estonia: "estonia",
3448
+ latvia: "latvia",
3449
+ lithuania: "lithuania",
3450
+ greece: "greece",
3451
+ cyprus: "cyprus",
3452
+ malta: "malta",
3453
+ luxembourg: "luxembourg",
3454
+ other: "other"
3455
+ };
3456
+ var BASIC_PROFILE_ERRORS = /* @__PURE__ */ ((BASIC_PROFILE_ERRORS2) => {
3457
+ BASIC_PROFILE_ERRORS2["NameMin"] = "components.BasicProfileForm.errors.nameMin";
3458
+ BASIC_PROFILE_ERRORS2["NameMax"] = "components.BasicProfileForm.errors.nameMax";
3459
+ BASIC_PROFILE_ERRORS2["EmailValid"] = "components.BasicProfileForm.errors.emailValid";
3460
+ BASIC_PROFILE_ERRORS2["EmailRequired"] = "components.BasicProfileForm.errors.emailRequired";
3461
+ BASIC_PROFILE_ERRORS2["CountryRequired"] = "components.BasicProfileForm.errors.countryRequired";
3462
+ BASIC_PROFILE_ERRORS2["BioMax"] = "components.BasicProfileForm.errors.bioMax";
3463
+ BASIC_PROFILE_ERRORS2["ProfileImageSize"] = "components.BasicProfileForm.errors.profileImageSize";
3464
+ BASIC_PROFILE_ERRORS2["ProfileImageTypes"] = "components.BasicProfileForm.errors.profileImageTypes";
3465
+ return BASIC_PROFILE_ERRORS2;
3466
+ })(BASIC_PROFILE_ERRORS || {});
3467
+ var ATHLETE_PROFILE_ERRORS = /* @__PURE__ */ ((ATHLETE_PROFILE_ERRORS2) => {
3468
+ ATHLETE_PROFILE_ERRORS2["DobMax"] = "components.AthleteProfileForm.errors.dobMax";
3469
+ ATHLETE_PROFILE_ERRORS2["DobMin"] = "components.AthleteProfileForm.errors.dobMin";
3470
+ ATHLETE_PROFILE_ERRORS2["HeightMin"] = "components.AthleteProfileForm.errors.heightMin";
3471
+ ATHLETE_PROFILE_ERRORS2["HeightMax"] = "components.AthleteProfileForm.errors.heightMax";
3472
+ ATHLETE_PROFILE_ERRORS2["HeightInvalid"] = "components.AthleteProfileForm.errors.heightInvalid";
3473
+ ATHLETE_PROFILE_ERRORS2["WeightMin"] = "components.AthleteProfileForm.errors.weightMin";
3474
+ ATHLETE_PROFILE_ERRORS2["WeightMax"] = "components.AthleteProfileForm.errors.weightMax";
3475
+ ATHLETE_PROFILE_ERRORS2["WeightInvalid"] = "components.AthleteProfileForm.errors.weightInvalid";
3476
+ ATHLETE_PROFILE_ERRORS2["PositionMin"] = "components.AthleteProfileForm.errors.positionMin";
3477
+ ATHLETE_PROFILE_ERRORS2["PositionMax"] = "components.AthleteProfileForm.errors.positionMax";
3478
+ ATHLETE_PROFILE_ERRORS2["TeamMin"] = "components.AthleteProfileForm.errors.teamMin";
3479
+ ATHLETE_PROFILE_ERRORS2["TeamMax"] = "components.AthleteProfileForm.errors.teamMax";
3480
+ ATHLETE_PROFILE_ERRORS2["InstagramInvalid"] = "components.AthleteProfileForm.errors.instagramInvalid";
3481
+ ATHLETE_PROFILE_ERRORS2["TiktokInvalid"] = "components.AthleteProfileForm.errors.tiktokInvalid";
3482
+ ATHLETE_PROFILE_ERRORS2["HighlightImageSize"] = "components.AthleteProfileForm.errors.highlightImageSize";
3483
+ ATHLETE_PROFILE_ERRORS2["HighlightImageTypes"] = "components.AthleteProfileForm.errors.highlightImageTypes";
3484
+ return ATHLETE_PROFILE_ERRORS2;
3485
+ })(ATHLETE_PROFILE_ERRORS || {});
3486
+ var MIN_NAME_LENGTH = 2;
3487
+ var MAX_NAME_LENGTH = 50;
3488
+ var MAX_BIO_LENGTH = 275;
3489
+ var basicProfileSchema = zod.z.object({
3490
+ name: zod.z.string().min(MIN_NAME_LENGTH, "components.BasicProfileForm.errors.nameMin" /* NameMin */).max(MAX_NAME_LENGTH, "components.BasicProfileForm.errors.nameMax" /* NameMax */),
3491
+ email: zod.z.string().email("components.BasicProfileForm.errors.emailValid" /* EmailValid */).min(1, "components.BasicProfileForm.errors.emailRequired" /* EmailRequired */),
3492
+ country: zod.z.string().min(1, "components.BasicProfileForm.errors.countryRequired" /* CountryRequired */),
3493
+ bio: zod.z.string().max(MAX_BIO_LENGTH, "components.BasicProfileForm.errors.bioMax" /* BioMax */).optional(),
3494
+ profileImage: zod.z.union([
3495
+ zod.z.instanceof(File).refine(
3496
+ (file) => file.size <= 5 * 1024 * 1024,
3497
+ // 5MB
3498
+ "components.BasicProfileForm.errors.profileImageSize" /* ProfileImageSize */
3499
+ ).refine(
3500
+ (file) => ["image/png", "image/jpeg", "image/jpg", "image/webp"].includes(file.type),
3501
+ "components.BasicProfileForm.errors.profileImageTypes" /* ProfileImageTypes */
3502
+ ),
3503
+ zod.z.string(),
3504
+ zod.z.null()
3505
+ ]).optional()
3506
+ });
3507
+ var fanProfileSchema = basicProfileSchema.extend({});
3508
+ var athleteProfileSchema = basicProfileSchema.extend({
3509
+ dateOfBirth: zod.z.date().max(/* @__PURE__ */ new Date(), "components.AthleteProfileForm.errors.dobMax" /* DobMax */).min(new Date(1900, 0, 1), "components.AthleteProfileForm.errors.dobMin" /* DobMin */).optional(),
3510
+ height: zod.z.number().min(50, "components.AthleteProfileForm.errors.heightMin" /* HeightMin */).max(300, "components.AthleteProfileForm.errors.heightMax" /* HeightMax */).optional(),
3511
+ weight: zod.z.number().min(10, "components.AthleteProfileForm.errors.weightMin" /* WeightMin */).max(500, "components.AthleteProfileForm.errors.weightMax" /* WeightMax */).optional(),
3512
+ position: zod.z.string().min(2, "components.AthleteProfileForm.errors.positionMin" /* PositionMin */).max(50, "components.AthleteProfileForm.errors.positionMax" /* PositionMax */).optional(),
3513
+ teamName: zod.z.string().min(2, "components.AthleteProfileForm.errors.teamMin" /* TeamMin */).max(100, "components.AthleteProfileForm.errors.teamMax" /* TeamMax */).optional(),
3514
+ instagramHandle: zod.z.string().regex(/^@?[a-zA-Z0-9._]{1,30}$/, "components.AthleteProfileForm.errors.instagramInvalid" /* InstagramInvalid */).optional(),
3515
+ tiktokHandle: zod.z.string().regex(/^@?[a-zA-Z0-9._]{1,24}$/, "components.AthleteProfileForm.errors.tiktokInvalid" /* TiktokInvalid */).optional(),
3516
+ highlightImage: zod.z.union([
3517
+ zod.z.instanceof(File).refine(
3518
+ (file) => file.size <= 5 * 1024 * 1024,
3519
+ // 5MB
3520
+ "components.AthleteProfileForm.errors.highlightImageSize" /* HighlightImageSize */
3521
+ ).refine(
3522
+ (file) => ["image/png", "image/jpeg", "image/jpg"].includes(file.type),
3523
+ "components.AthleteProfileForm.errors.highlightImageTypes" /* HighlightImageTypes */
3524
+ ),
3525
+ zod.z.string(),
3526
+ zod.z.null()
3527
+ ]).optional()
3528
+ });
3529
+
3530
+ // src/campaign/enums.ts
3531
+ var CREATE_CAMPAIGN_ERRORS = /* @__PURE__ */ ((CREATE_CAMPAIGN_ERRORS2) => {
3532
+ CREATE_CAMPAIGN_ERRORS2["TitleRequired"] = "components.CreateCampaign.Form.errors.titleRequired";
3533
+ CREATE_CAMPAIGN_ERRORS2["TitleMax"] = "components.CreateCampaign.Form.errors.titleMax";
3534
+ CREATE_CAMPAIGN_ERRORS2["SubtitleRequired"] = "components.CreateCampaign.Form.errors.subtitleRequired";
3535
+ CREATE_CAMPAIGN_ERRORS2["SubtitleMax"] = "components.CreateCampaign.Form.errors.subtitleMax";
3536
+ CREATE_CAMPAIGN_ERRORS2["CampaignImageRequired"] = "components.CreateCampaign.Form.errors.campaignImageRequired";
3537
+ CREATE_CAMPAIGN_ERRORS2["StartDateRequired"] = "components.CreateCampaign.Form.errors.startDateRequired";
3538
+ CREATE_CAMPAIGN_ERRORS2["StartDateInvalid"] = "components.CreateCampaign.Form.errors.startDateInvalid";
3539
+ CREATE_CAMPAIGN_ERRORS2["StartDateFuture"] = "components.CreateCampaign.Form.errors.startDateFuture";
3540
+ CREATE_CAMPAIGN_ERRORS2["DurationRequired"] = "components.CreateCampaign.Form.errors.durationRequired";
3541
+ CREATE_CAMPAIGN_ERRORS2["StoryRequired"] = "components.CreateCampaign.Form.errors.storyRequired";
3542
+ CREATE_CAMPAIGN_ERRORS2["StoryMax"] = "components.CreateCampaign.Form.errors.storyMax";
3543
+ CREATE_CAMPAIGN_ERRORS2["VideoInvalidProvider"] = "components.CreateCampaign.Form.errors.videoInvalidProvider";
3544
+ CREATE_CAMPAIGN_ERRORS2["FundingRequired"] = "components.CreateCampaign.Form.errors.fundingRequired";
3545
+ CREATE_CAMPAIGN_ERRORS2["FundingRange"] = "components.CreateCampaign.Form.errors.fundingRange";
3546
+ CREATE_CAMPAIGN_ERRORS2["InstagramMax"] = "components.CreateCampaign.Form.errors.instagramMax";
3547
+ CREATE_CAMPAIGN_ERRORS2["InstagramInvalid"] = "components.CreateCampaign.Form.errors.instagramInvalid";
3548
+ CREATE_CAMPAIGN_ERRORS2["TiktokMax"] = "components.CreateCampaign.Form.errors.tiktokMax";
3549
+ CREATE_CAMPAIGN_ERRORS2["TiktokInvalid"] = "components.CreateCampaign.Form.errors.tiktokInvalid";
3550
+ CREATE_CAMPAIGN_ERRORS2["YoutubeMax"] = "components.CreateCampaign.Form.errors.youtubeMax";
3551
+ CREATE_CAMPAIGN_ERRORS2["YoutubeInvalid"] = "components.CreateCampaign.Form.errors.youtubeInvalid";
3552
+ return CREATE_CAMPAIGN_ERRORS2;
3553
+ })(CREATE_CAMPAIGN_ERRORS || {});
3554
+ var formCampaignSchema = /* @__PURE__ */ __name(({ maxFunding }) => zod.z.object({
3555
+ title: zod.z.string().min(1, "components.CreateCampaign.Form.errors.titleRequired" /* TitleRequired */).max(60, "components.CreateCampaign.Form.errors.titleMax" /* TitleMax */),
3556
+ subtitle: zod.z.string().min(1, "components.CreateCampaign.Form.errors.subtitleRequired" /* SubtitleRequired */).max(200, "components.CreateCampaign.Form.errors.subtitleMax" /* SubtitleMax */),
3557
+ campaignImage: zod.z.any().refine((val) => val instanceof File, {
3558
+ message: "components.CreateCampaign.Form.errors.campaignImageRequired" /* CampaignImageRequired */
3559
+ }),
3560
+ startDate: zod.z.date({
3561
+ error: "components.CreateCampaign.Form.errors.startDateRequired" /* StartDateRequired */
3562
+ }).refine((date) => date instanceof Date && !isNaN(date.getTime()), {
3563
+ message: "components.CreateCampaign.Form.errors.startDateInvalid" /* StartDateInvalid */
3564
+ }).refine((date) => date >= /* @__PURE__ */ new Date(), {
3565
+ message: "components.CreateCampaign.Form.errors.startDateFuture" /* StartDateFuture */
3566
+ }),
3567
+ duration: zod.z.union([zod.z.literal(30), zod.z.literal(60), zod.z.literal(90)]).nullable().refine((val) => val !== null, {
3568
+ message: "components.CreateCampaign.Form.errors.durationRequired" /* DurationRequired */
3569
+ }),
3570
+ story: zod.z.string().min(1, "components.CreateCampaign.Form.errors.storyRequired" /* StoryRequired */).max(1e4, "components.CreateCampaign.Form.errors.storyMax" /* StoryMax */),
3571
+ videoHighlight: zod.z.string().refine(
3572
+ (url) => {
3573
+ if (!url || url.trim() === "") return true;
3574
+ try {
3575
+ const urlObj = new URL(url);
3576
+ const hostname = urlObj.hostname.toLowerCase();
3577
+ return hostname.includes("youtube.com") || hostname.includes("youtu.be") || hostname.includes("tiktok.com") || hostname.includes("vimeo.com");
3578
+ } catch {
3579
+ return false;
3580
+ }
3581
+ },
3582
+ {
3583
+ message: "components.CreateCampaign.Form.errors.videoInvalidProvider" /* VideoInvalidProvider */
3584
+ }
3585
+ ).optional(),
3586
+ fundingTarget: zod.z.string().min(1, "components.CreateCampaign.Form.errors.fundingRequired" /* FundingRequired */).refine(
3587
+ (val) => {
3588
+ const num = Number.parseFloat(val ?? "");
3589
+ return !isNaN(num) && num > 0 && num <= maxFunding;
3590
+ },
3591
+ {
3592
+ message: "components.CreateCampaign.Form.errors.fundingRange" /* FundingRange */
3593
+ }
3594
+ ),
3595
+ instagramHandle: zod.z.string().max(30, "components.CreateCampaign.Form.errors.instagramMax" /* InstagramMax */).regex(/^@?[a-zA-Z0-9._]{1,30}$/, "components.CreateCampaign.Form.errors.instagramInvalid" /* InstagramInvalid */).optional(),
3596
+ tiktokHandle: zod.z.string().max(24, "components.CreateCampaign.Form.errors.tiktokMax" /* TiktokMax */).regex(/^@?[a-zA-Z0-9._]{1,24}$/, "components.CreateCampaign.Form.errors.tiktokInvalid" /* TiktokInvalid */).optional(),
3597
+ youtubeHandle: zod.z.string().max(50, "components.CreateCampaign.Form.errors.youtubeMax" /* YoutubeMax */).regex(/^@?[a-zA-Z0-9._]{1,50}$/, "components.CreateCampaign.Form.errors.youtubeInvalid" /* YoutubeInvalid */).optional()
3598
+ }), "formCampaignSchema");
3599
+
3422
3600
  // src/logger/enums.ts
3423
3601
  var LOGGER_SERVICES = {
3424
3602
  // API Package Services
@@ -4696,9 +4874,11 @@ exports.ALERT_SOURCE = ALERT_SOURCE;
4696
4874
  exports.ALERT_TYPES = ALERT_TYPES;
4697
4875
  exports.ALL_EVENTS = ALL_EVENTS;
4698
4876
  exports.API_ERROR_CODES = API_ERROR_CODES;
4877
+ exports.ATHLETE_PROFILE_ERRORS = ATHLETE_PROFILE_ERRORS;
4699
4878
  exports.AUDIT_OPERATION = AUDIT_OPERATION;
4700
4879
  exports.AUTH_PROVIDER = AUTH_PROVIDER;
4701
4880
  exports.AUTH_PROVIDER_TYPE = AUTH_PROVIDER_TYPE;
4881
+ exports.BASIC_PROFILE_ERRORS = BASIC_PROFILE_ERRORS;
4702
4882
  exports.CACHE_DURATION_MS = CACHE_DURATION_MS;
4703
4883
  exports.CACHE_EVENTS = CACHE_EVENTS;
4704
4884
  exports.CHAIN_ID = CHAIN_ID;
@@ -4713,6 +4893,8 @@ exports.CONFIG_EVENTS = CONFIG_EVENTS;
4713
4893
  exports.COORDINATES = COORDINATES;
4714
4894
  exports.CORRELATION_TYPE = CORRELATION_TYPE;
4715
4895
  exports.COSTOPTIMIZATIONSTRATEGY = COSTOPTIMIZATIONSTRATEGY;
4896
+ exports.COUNTRIES = COUNTRIES;
4897
+ exports.CREATE_CAMPAIGN_ERRORS = CREATE_CAMPAIGN_ERRORS;
4716
4898
  exports.CURRENCY_CODES = CURRENCY_CODES;
4717
4899
  exports.ContactUsFormSchema = ContactUsFormSchema;
4718
4900
  exports.CorrelationIdSchema = CorrelationIdSchema;
@@ -4829,6 +5011,10 @@ exports.VALIDATION_RANGES = VALIDATION_RANGES;
4829
5011
  exports.WEBHOOK_ENCRYPTION_METHOD = WEBHOOK_ENCRYPTION_METHOD;
4830
5012
  exports.WEBHOOK_EVENT_TYPE = WEBHOOK_EVENT_TYPE;
4831
5013
  exports.WEBHOOK_VERIFICATION_REASON = WEBHOOK_VERIFICATION_REASON;
5014
+ exports.athleteProfileSchema = athleteProfileSchema;
5015
+ exports.basicProfileSchema = basicProfileSchema;
5016
+ exports.fanProfileSchema = fanProfileSchema;
5017
+ exports.formCampaignSchema = formCampaignSchema;
4832
5018
  exports.isValidConfigSource = isValidConfigSource;
4833
5019
  exports.isValidHistoryType = isValidHistoryType;
4834
5020
  exports.isValidOperation = isValidOperation;