@thejob/schema 1.0.35 → 1.0.38

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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NewResumePromptSchema = exports.ResumeSchema = exports.ResumeSchemaV2 = void 0;
3
+ exports.NewResumePromptSchema = exports.ResumeSchema = exports.ResumeSchemaV2 = exports.ResumeSocialAccountSectionSchema = void 0;
4
4
  const common_1 = require("../common");
5
5
  const user_1 = require("../user");
6
6
  const yup_extended_1 = require("../yup-extended");
@@ -53,6 +53,7 @@ const ResumeInterestSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema,
53
53
  */
54
54
  }
55
55
  const ResumeLanguageSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema, "languages");
56
+ exports.ResumeSocialAccountSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema, "socialAccounts");
56
57
  {
57
58
  /**
58
59
  * Note: Not supported yet.
@@ -90,54 +91,66 @@ const ResumeLanguageSectionSchema = (0, yup_extended_1.reach)(user_1.UserSchema,
90
91
  * ResumeSchemaV2 is a lazy schema that dynamically loads the appropriate schema based on the section type.
91
92
  */
92
93
  }
93
- exports.ResumeSchemaV2 = (0, yup_extended_1.array)()
94
- .of((0, yup_extended_1.lazy)((section) => {
95
- const { id } = section;
96
- return (0, yup_extended_1.object)({
97
- id: (0, yup_extended_1.string)()
98
- .oneOf(resume_constant_1.SupportedResumeSectionTypes)
99
- .required()
100
- .label("Section"),
101
- data: (0, yup_extended_1.lazy)(() => {
102
- switch (id) {
103
- case resume_constant_1.ResumeSectionType.GeneralInfo:
104
- // GeneralInfo schema is a single object schema, use it directly with null default
105
- return ResumeGeneralInfoSectionSchema.nullable().default(null);
106
- case resume_constant_1.ResumeSectionType.WorkExperience:
107
- // WorkExperience schema is already an array schema, use it directly with empty array default
108
- return ResumeWorkExperienceSectionSchema.default([]);
109
- case resume_constant_1.ResumeSectionType.Education:
110
- // Education schema is already an array schema, use it directly with empty array default
111
- return ResumeEducationSectionSchema.default([]);
112
- case resume_constant_1.ResumeSectionType.Skill:
113
- // Skill schema is already an array schema, use it directly with empty array default
114
- return ResumeSkillSectionSchema.default([]);
115
- case resume_constant_1.ResumeSectionType.Project:
116
- // Project schema is already an array schema, use it directly with empty array default
117
- return ResumeProjectSectionSchema.default([]);
118
- case resume_constant_1.ResumeSectionType.Certification:
119
- // Certification schema is already an array schema, use it directly with empty array default
120
- return ResumeCertificationSectionSchema.default([]);
121
- case resume_constant_1.ResumeSectionType.Interest:
122
- // Interest schema is already an array schema, use it directly with empty array default
123
- return ResumeInterestSectionSchema.default([]);
124
- case resume_constant_1.ResumeSectionType.Language:
125
- // Language schema is already an array schema, use it directly with empty array default
126
- return ResumeLanguageSectionSchema.default([]);
127
- // case ResumeSectionType.AdditionalInfo:
128
- // // AdditionalInfo schema is already an array schema, use it directly with empty array default
129
- // return ResumeAdditionalInfoSectionSchema.default([]);
130
- // case ResumeSectionType.Reference:
131
- // return array().of(ResumeReferenceSectionSchema).required().label("Data");
132
- default:
133
- throw new yup_extended_1.ValidationError(`Invalid Section Type: ${id}`);
134
- }
135
- }),
136
- });
137
- }))
138
- .required()
139
- .default([])
140
- .label("Resume Schema V2");
94
+ exports.ResumeSchemaV2 = (0, yup_extended_1.object)()
95
+ .shape({
96
+ userId: (0, yup_extended_1.string)().objectId().required().label("User ID"),
97
+ slug: (0, yup_extended_1.string)().required().label("Slug"),
98
+ sections: (0, yup_extended_1.array)()
99
+ .of((0, yup_extended_1.lazy)((section) => {
100
+ const { id } = section;
101
+ return (0, yup_extended_1.object)({
102
+ id: (0, yup_extended_1.string)()
103
+ .oneOf(resume_constant_1.SupportedResumeSectionTypes)
104
+ .required()
105
+ .label("Section"),
106
+ data: (0, yup_extended_1.lazy)(() => {
107
+ switch (id) {
108
+ case resume_constant_1.ResumeSectionType.GeneralInfo:
109
+ // GeneralInfo schema is a single object schema, use it directly with null default
110
+ return ResumeGeneralInfoSectionSchema.nullable().default(null);
111
+ case resume_constant_1.ResumeSectionType.WorkExperiences:
112
+ // WorkExperience schema is already an array schema, use it directly with empty array default
113
+ return ResumeWorkExperienceSectionSchema.default([]);
114
+ case resume_constant_1.ResumeSectionType.Educations:
115
+ // Education schema is already an array schema, use it directly with empty array default
116
+ return ResumeEducationSectionSchema.default([]);
117
+ case resume_constant_1.ResumeSectionType.Skills:
118
+ // Skill schema is already an array schema, use it directly with empty array default
119
+ return ResumeSkillSectionSchema.default([]);
120
+ case resume_constant_1.ResumeSectionType.Projects:
121
+ // Project schema is already an array schema, use it directly with empty array default
122
+ return ResumeProjectSectionSchema.default([]);
123
+ case resume_constant_1.ResumeSectionType.Certifications:
124
+ // Certification schema is already an array schema, use it directly with empty array default
125
+ return ResumeCertificationSectionSchema.default([]);
126
+ case resume_constant_1.ResumeSectionType.Interests:
127
+ // Interest schema is already an array schema, use it directly with empty array default
128
+ return ResumeInterestSectionSchema.default([]);
129
+ case resume_constant_1.ResumeSectionType.Languages:
130
+ // Language schema is already an array schema, use it directly with empty array default
131
+ return ResumeLanguageSectionSchema.default([]);
132
+ case resume_constant_1.ResumeSectionType.SocialAccounts:
133
+ // SocialAccounts schema is already an array schema, use it directly with empty array default
134
+ return exports.ResumeSocialAccountSectionSchema.default([]);
135
+ // case ResumeSectionType.AdditionalInfo:
136
+ // // AdditionalInfo schema is already an array schema, use it directly with empty array default
137
+ // return ResumeAdditionalInfoSectionSchema.default([]);
138
+ // case ResumeSectionType.Reference:
139
+ // return array().of(ResumeReferenceSectionSchema).required().label("Data");
140
+ default:
141
+ throw new yup_extended_1.ValidationError(`Invalid Section Type: ${id}`);
142
+ }
143
+ }),
144
+ });
145
+ }))
146
+ .required()
147
+ .default([])
148
+ .label("Resume sections"),
149
+ })
150
+ .concat(common_1.DbDefaultSchema)
151
+ .noUnknown()
152
+ .strict()
153
+ .label("Resume V2 Schema");
141
154
  // export type TResumeSectionMap = {
142
155
  // [ResumeSectionType.GeneralInfo]: TResumeGeneralInfoSectionSchema;
143
156
  // [ResumeSectionType.WorkExperience]: TResumeWorkExperienceSectionSchema;
@@ -1555,7 +1555,303 @@ export interface IResumeInterestSectionSchema {
1555
1555
  }
1556
1556
  export interface IResumeLanguageSectionSchema {
1557
1557
  }
1558
+ export interface IResumeSocialAccountSectionSchema {
1559
+ }
1558
1560
  export interface IResumeSchemaV2 {
1561
+ updatedBy?: string | undefined;
1562
+ updatedAt?: number | undefined;
1563
+ slug: string;
1564
+ id: string;
1565
+ shortId: string;
1566
+ createdBy: string;
1567
+ createdAt: number;
1568
+ userId: string;
1569
+ sections: {
1570
+ id: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/resume/resume.constant").ResumeSectionType | undefined>;
1571
+ data: {
1572
+ type: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/common/constants").SocialAccount | undefined>;
1573
+ isNew: boolean;
1574
+ url: string;
1575
+ }[] | {
1576
+ description?: string | undefined;
1577
+ company: NonNullable<{
1578
+ value: "others" | (string | undefined)[];
1579
+ otherValue: string | string[];
1580
+ } | Pick<{
1581
+ headline?: string | undefined;
1582
+ employeeCount?: string | undefined;
1583
+ yearFounded?: string | undefined;
1584
+ locations?: {
1585
+ coverImage?: string | undefined;
1586
+ name: string;
1587
+ isHeadquarters: boolean;
1588
+ contact: {
1589
+ email?: string | undefined;
1590
+ phone?: string | undefined;
1591
+ address: string;
1592
+ };
1593
+ }[] | undefined;
1594
+ contacts?: {
1595
+ label?: string | undefined;
1596
+ type: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/page/page.constant").ContactTypes | undefined>;
1597
+ value: string;
1598
+ isPrimary: boolean;
1599
+ isVerified: boolean;
1600
+ }[] | undefined;
1601
+ verified?: Date | undefined;
1602
+ socialAccounts?: {
1603
+ type: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/common/constants").SocialAccount | undefined>;
1604
+ isNew: boolean;
1605
+ url: string;
1606
+ }[] | undefined;
1607
+ isOwner?: boolean | undefined;
1608
+ equalOpportunityEmployer?: boolean | undefined;
1609
+ perksAndBenefits?: {
1610
+ category?: {
1611
+ logo?: string | undefined;
1612
+ id: string;
1613
+ name: string;
1614
+ } | {
1615
+ value: "others" | (string | undefined)[];
1616
+ otherValue: string | string[];
1617
+ } | undefined;
1618
+ name: string;
1619
+ description: string;
1620
+ }[] | undefined;
1621
+ updatedBy?: string | undefined;
1622
+ updatedAt?: number | undefined;
1623
+ slug: string;
1624
+ id: string;
1625
+ shortId: string;
1626
+ name: string;
1627
+ about: string;
1628
+ website: string;
1629
+ type: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/page/page.constant").PageType | undefined>;
1630
+ logo: {
1631
+ dark?: string | undefined;
1632
+ light: string;
1633
+ } | null;
1634
+ categories: {
1635
+ logo?: string | undefined;
1636
+ id: string;
1637
+ name: string;
1638
+ }[];
1639
+ status: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/page/page.constant").PageStatus | undefined>;
1640
+ createdBy: string;
1641
+ createdAt: number;
1642
+ }, "slug" | "name" | "type" | "logo"> | undefined>;
1643
+ designation: NonNullable<{
1644
+ logo?: string | undefined;
1645
+ id: string;
1646
+ name: string;
1647
+ } | {
1648
+ value: "others" | (string | undefined)[];
1649
+ otherValue: string | string[];
1650
+ } | undefined>;
1651
+ isRemote: boolean;
1652
+ duration: {
1653
+ startDate: string;
1654
+ endDate: string;
1655
+ isActive: boolean;
1656
+ };
1657
+ location: {
1658
+ state?: string | undefined;
1659
+ stateCode?: string | undefined;
1660
+ address: string;
1661
+ country: string;
1662
+ countryCode: string;
1663
+ city: string;
1664
+ latLong: {
1665
+ country?: (number | undefined)[] | undefined;
1666
+ state?: number[] | undefined;
1667
+ city?: number[] | undefined;
1668
+ };
1669
+ };
1670
+ }[] | {
1671
+ description?: string | undefined;
1672
+ duration: {
1673
+ startDate: string;
1674
+ endDate: string;
1675
+ isActive: boolean;
1676
+ };
1677
+ location: {
1678
+ state?: string | undefined;
1679
+ stateCode?: string | undefined;
1680
+ address: string;
1681
+ country: string;
1682
+ countryCode: string;
1683
+ city: string;
1684
+ latLong: {
1685
+ country?: (number | undefined)[] | undefined;
1686
+ state?: number[] | undefined;
1687
+ city?: number[] | undefined;
1688
+ };
1689
+ };
1690
+ institute: NonNullable<{
1691
+ value: "others" | (string | undefined)[];
1692
+ otherValue: string | string[];
1693
+ } | Pick<{
1694
+ headline?: string | undefined;
1695
+ employeeCount?: string | undefined;
1696
+ yearFounded?: string | undefined;
1697
+ locations?: {
1698
+ coverImage?: string | undefined;
1699
+ name: string;
1700
+ isHeadquarters: boolean;
1701
+ contact: {
1702
+ email?: string | undefined;
1703
+ phone?: string | undefined;
1704
+ address: string;
1705
+ };
1706
+ }[] | undefined;
1707
+ contacts?: {
1708
+ label?: string | undefined;
1709
+ type: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/page/page.constant").ContactTypes | undefined>;
1710
+ value: string;
1711
+ isPrimary: boolean;
1712
+ isVerified: boolean;
1713
+ }[] | undefined;
1714
+ verified?: Date | undefined;
1715
+ socialAccounts?: {
1716
+ type: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/common/constants").SocialAccount | undefined>;
1717
+ isNew: boolean;
1718
+ url: string;
1719
+ }[] | undefined;
1720
+ isOwner?: boolean | undefined;
1721
+ equalOpportunityEmployer?: boolean | undefined;
1722
+ perksAndBenefits?: {
1723
+ category?: {
1724
+ logo?: string | undefined;
1725
+ id: string;
1726
+ name: string;
1727
+ } | {
1728
+ value: "others" | (string | undefined)[];
1729
+ otherValue: string | string[];
1730
+ } | undefined;
1731
+ name: string;
1732
+ description: string;
1733
+ }[] | undefined;
1734
+ updatedBy?: string | undefined;
1735
+ updatedAt?: number | undefined;
1736
+ slug: string;
1737
+ id: string;
1738
+ shortId: string;
1739
+ name: string;
1740
+ about: string;
1741
+ website: string;
1742
+ type: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/page/page.constant").PageType | undefined>;
1743
+ logo: {
1744
+ dark?: string | undefined;
1745
+ light: string;
1746
+ } | null;
1747
+ categories: {
1748
+ logo?: string | undefined;
1749
+ id: string;
1750
+ name: string;
1751
+ }[];
1752
+ status: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/page/page.constant").PageStatus | undefined>;
1753
+ createdBy: string;
1754
+ createdAt: number;
1755
+ }, "slug" | "name" | "type" | "logo"> | undefined>;
1756
+ course: NonNullable<{
1757
+ logo?: string | undefined;
1758
+ id: string;
1759
+ name: string;
1760
+ } | {
1761
+ value: "others" | (string | undefined)[];
1762
+ otherValue: string | string[];
1763
+ } | undefined>;
1764
+ fieldOfStudy: NonNullable<NonNullable<{
1765
+ logo?: string | undefined;
1766
+ id: string;
1767
+ name: string;
1768
+ } | {
1769
+ value: "others" | (string | undefined)[];
1770
+ otherValue: string | string[];
1771
+ } | undefined>>;
1772
+ isDistanceLearning: boolean;
1773
+ studyType: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/common/constants").StudyType | undefined>;
1774
+ }[] | {
1775
+ skill: NonNullable<{
1776
+ logo?: string | undefined;
1777
+ id: string;
1778
+ name: string;
1779
+ } | {
1780
+ value: "others" | (string | undefined)[];
1781
+ otherValue: string | string[];
1782
+ } | undefined>;
1783
+ proficiencyLevel: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/common/constants").ProficiencyLevel | undefined>;
1784
+ lastUsed: string;
1785
+ }[] | {
1786
+ url?: string | undefined;
1787
+ name: string;
1788
+ description: string;
1789
+ duration: {
1790
+ startDate: string;
1791
+ endDate: string;
1792
+ isActive: boolean;
1793
+ };
1794
+ }[] | {
1795
+ url?: string | undefined;
1796
+ licenseNumber?: string | undefined;
1797
+ name: string;
1798
+ duration: {
1799
+ startDate: string;
1800
+ endDate: string;
1801
+ isActive: boolean;
1802
+ };
1803
+ authority: string;
1804
+ }[] | {
1805
+ logo?: string | undefined;
1806
+ id: string;
1807
+ name: string;
1808
+ }[] | {
1809
+ isNew: boolean;
1810
+ proficiencyLevel: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/common/constants").ProficiencyLevel | undefined>;
1811
+ language: NonNullable<{
1812
+ logo?: string | undefined;
1813
+ id: string;
1814
+ name: string;
1815
+ } | {
1816
+ value: "others" | (string | undefined)[];
1817
+ otherValue: string | string[];
1818
+ } | undefined>;
1819
+ }[] | {
1820
+ headline?: string | undefined;
1821
+ id?: string | undefined;
1822
+ emailVerified?: string | null | undefined;
1823
+ image?: string | undefined;
1824
+ aboutMe?: string | undefined;
1825
+ name: {
1826
+ last?: string | undefined;
1827
+ first: string;
1828
+ };
1829
+ email: string;
1830
+ experienceLevel: NonNullable<import("/Users/nadeem.ahmad/Documents/GitHub/thejob-yup-schema/src/common/constants").ExperienceLevel | undefined>;
1831
+ mobile: {
1832
+ number: string;
1833
+ country: {
1834
+ locale?: string | undefined;
1835
+ name: string;
1836
+ dial_code: string;
1837
+ code: string;
1838
+ };
1839
+ };
1840
+ location: {
1841
+ state?: string | undefined;
1842
+ stateCode?: string | undefined;
1843
+ address: string;
1844
+ country: string;
1845
+ countryCode: string;
1846
+ city: string;
1847
+ latLong: {
1848
+ country?: (number | undefined)[] | undefined;
1849
+ state?: number[] | undefined;
1850
+ city?: number[] | undefined;
1851
+ };
1852
+ };
1853
+ } | null;
1854
+ }[];
1559
1855
  }
1560
1856
  export interface IResumeSchema {
1561
1857
  isOwner?: boolean | undefined;