wenum 1.51.0 → 1.52.1

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.d.mts CHANGED
@@ -302,4 +302,43 @@ declare enum NotificationType {
302
302
  }
303
303
  declare const getNotificationTypeName: (type: NotificationType) => "AddBuddy" | "AcceptBuddy" | "UoiJoinCircle" | "AcceptUoiJoinCircle" | "InviteUoiToCircle" | "AcceptInviteUoiToCircle" | "TeamJoinCircle" | "AcceptTeamJoinCircle" | "InviteTeamToCircle" | "AcceptInviteTeamToCircle" | "AddGameToLeaderboard" | "AcceptAddGameToLeaderboard" | "InviteGameToLeaderboard" | "AcceptInviteGameToLeaderboard" | "CreatePost" | "Unknown";
304
304
 
305
- export { AccountStatus, AdminAccountStatus, AttendanceStatus, AvatarType, BasketballPosition, BuddyingStatus, type CardGamesInterestType, type CategoryType, ChallengeStatus, CollectionMetaStatus, type CollectionType, DuelGameResultType, FollowingStatus, type GameType, Gender, Handedness, type InterestType, LeaderboardType, LengthUnit, LocationType, MarketMetaStatus, type MarketType, MemberingStatus, type MusicInterestType, NotificationType, type PIDPrefixType, PID_LENGTH, PID_PREFIX_LENGTH, PageType, type PetsInterestType, PostPrivacy, PostType, ProfileJoiningType, ProfilePermission, ProfilePrivacy, ProfileStatus, ProfileType, type SportsInterestType, SubjectType, TennisBackhand, TennisLevel, UserPronoun, WeightUnit, getBuddyingStatusName, getMemberingStatusName, getNotificationTypeName, getPIDPrefixByProfileType, getProfileTypeByPID, getProfileTypeName, isGamePID, isLeaderboardPID, isTeamPID, isUoiPID };
305
+ type AttributeTypeCommon = 'handedness' | 'gender' | 'dob';
306
+
307
+ declare const ATTRIBUTE_LABEL_COMMON: Record<AttributeTypeCommon, string>;
308
+
309
+ type AttributeTypeUoiSportsTennis = 'level' | 'backhand' | 'handedness';
310
+
311
+ declare const ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS: Record<AttributeTypeUoiSportsTennis, string>;
312
+
313
+ type AttributeTypeUoiSportsBasketball = 'positions';
314
+
315
+ declare const ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL: Record<AttributeTypeUoiSportsBasketball, string>;
316
+
317
+ declare const ATTRIBUTE_LABEL_UOI_SPORTS: Partial<Record<SportsInterestType, any>>;
318
+
319
+ type AttributeTypeUoiSports = AttributeTypeUoiSportsTennis | AttributeTypeUoiSportsBasketball;
320
+
321
+ declare const ATTRIBUTE_LABEL_UOI: Partial<Record<CategoryType, any>>;
322
+
323
+ type AttributeTypeUoi = AttributeTypeUoiSports;
324
+
325
+ type AttributeTypeCollectionPets = 'dob' | 'breed' | 'father' | 'mother' | 'gender' | 'height' | 'weight' | 'children';
326
+
327
+ declare const ATTRIBUTE_LABEL_COLLECTION_PETS: Record<AttributeTypeCollectionPets, string>;
328
+
329
+ type AttributeTypeCollection = AttributeTypeCollectionPets;
330
+
331
+ declare const ATTRIBUTE_LABEL_COLLECTION: Partial<Record<CategoryType, any>>;
332
+
333
+ declare const ATTRIBUTE_LABEL: Partial<Record<ProfileType, any>>;
334
+
335
+ type AttributeType = AttributeTypeUoi | AttributeTypeCollection | AttributeTypeCommon;
336
+
337
+ declare const getProfileAttributeLabel: ({ profileType, categoryType, interestType, attributeType }: {
338
+ profileType: ProfileType;
339
+ categoryType?: CategoryType;
340
+ interestType?: InterestType;
341
+ attributeType: AttributeType;
342
+ }) => any;
343
+
344
+ export { ATTRIBUTE_LABEL, ATTRIBUTE_LABEL_COLLECTION, ATTRIBUTE_LABEL_COLLECTION_PETS, ATTRIBUTE_LABEL_COMMON, ATTRIBUTE_LABEL_UOI, ATTRIBUTE_LABEL_UOI_SPORTS, ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL, ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS, AccountStatus, AdminAccountStatus, AttendanceStatus, type AttributeType, type AttributeTypeCollection, type AttributeTypeCollectionPets, type AttributeTypeCommon, type AttributeTypeUoi, type AttributeTypeUoiSports, type AttributeTypeUoiSportsBasketball, type AttributeTypeUoiSportsTennis, AvatarType, BasketballPosition, BuddyingStatus, type CardGamesInterestType, type CategoryType, ChallengeStatus, CollectionMetaStatus, type CollectionType, DuelGameResultType, FollowingStatus, type GameType, Gender, Handedness, type InterestType, LeaderboardType, LengthUnit, LocationType, MarketMetaStatus, type MarketType, MemberingStatus, type MusicInterestType, NotificationType, type PIDPrefixType, PID_LENGTH, PID_PREFIX_LENGTH, PageType, type PetsInterestType, PostPrivacy, PostType, ProfileJoiningType, ProfilePermission, ProfilePrivacy, ProfileStatus, ProfileType, type SportsInterestType, SubjectType, TennisBackhand, TennisLevel, UserPronoun, WeightUnit, getBuddyingStatusName, getMemberingStatusName, getNotificationTypeName, getPIDPrefixByProfileType, getProfileAttributeLabel, getProfileTypeByPID, getProfileTypeName, isGamePID, isLeaderboardPID, isTeamPID, isUoiPID };
package/dist/index.d.ts CHANGED
@@ -302,4 +302,43 @@ declare enum NotificationType {
302
302
  }
303
303
  declare const getNotificationTypeName: (type: NotificationType) => "AddBuddy" | "AcceptBuddy" | "UoiJoinCircle" | "AcceptUoiJoinCircle" | "InviteUoiToCircle" | "AcceptInviteUoiToCircle" | "TeamJoinCircle" | "AcceptTeamJoinCircle" | "InviteTeamToCircle" | "AcceptInviteTeamToCircle" | "AddGameToLeaderboard" | "AcceptAddGameToLeaderboard" | "InviteGameToLeaderboard" | "AcceptInviteGameToLeaderboard" | "CreatePost" | "Unknown";
304
304
 
305
- export { AccountStatus, AdminAccountStatus, AttendanceStatus, AvatarType, BasketballPosition, BuddyingStatus, type CardGamesInterestType, type CategoryType, ChallengeStatus, CollectionMetaStatus, type CollectionType, DuelGameResultType, FollowingStatus, type GameType, Gender, Handedness, type InterestType, LeaderboardType, LengthUnit, LocationType, MarketMetaStatus, type MarketType, MemberingStatus, type MusicInterestType, NotificationType, type PIDPrefixType, PID_LENGTH, PID_PREFIX_LENGTH, PageType, type PetsInterestType, PostPrivacy, PostType, ProfileJoiningType, ProfilePermission, ProfilePrivacy, ProfileStatus, ProfileType, type SportsInterestType, SubjectType, TennisBackhand, TennisLevel, UserPronoun, WeightUnit, getBuddyingStatusName, getMemberingStatusName, getNotificationTypeName, getPIDPrefixByProfileType, getProfileTypeByPID, getProfileTypeName, isGamePID, isLeaderboardPID, isTeamPID, isUoiPID };
305
+ type AttributeTypeCommon = 'handedness' | 'gender' | 'dob';
306
+
307
+ declare const ATTRIBUTE_LABEL_COMMON: Record<AttributeTypeCommon, string>;
308
+
309
+ type AttributeTypeUoiSportsTennis = 'level' | 'backhand' | 'handedness';
310
+
311
+ declare const ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS: Record<AttributeTypeUoiSportsTennis, string>;
312
+
313
+ type AttributeTypeUoiSportsBasketball = 'positions';
314
+
315
+ declare const ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL: Record<AttributeTypeUoiSportsBasketball, string>;
316
+
317
+ declare const ATTRIBUTE_LABEL_UOI_SPORTS: Partial<Record<SportsInterestType, any>>;
318
+
319
+ type AttributeTypeUoiSports = AttributeTypeUoiSportsTennis | AttributeTypeUoiSportsBasketball;
320
+
321
+ declare const ATTRIBUTE_LABEL_UOI: Partial<Record<CategoryType, any>>;
322
+
323
+ type AttributeTypeUoi = AttributeTypeUoiSports;
324
+
325
+ type AttributeTypeCollectionPets = 'dob' | 'breed' | 'father' | 'mother' | 'gender' | 'height' | 'weight' | 'children';
326
+
327
+ declare const ATTRIBUTE_LABEL_COLLECTION_PETS: Record<AttributeTypeCollectionPets, string>;
328
+
329
+ type AttributeTypeCollection = AttributeTypeCollectionPets;
330
+
331
+ declare const ATTRIBUTE_LABEL_COLLECTION: Partial<Record<CategoryType, any>>;
332
+
333
+ declare const ATTRIBUTE_LABEL: Partial<Record<ProfileType, any>>;
334
+
335
+ type AttributeType = AttributeTypeUoi | AttributeTypeCollection | AttributeTypeCommon;
336
+
337
+ declare const getProfileAttributeLabel: ({ profileType, categoryType, interestType, attributeType }: {
338
+ profileType: ProfileType;
339
+ categoryType?: CategoryType;
340
+ interestType?: InterestType;
341
+ attributeType: AttributeType;
342
+ }) => any;
343
+
344
+ export { ATTRIBUTE_LABEL, ATTRIBUTE_LABEL_COLLECTION, ATTRIBUTE_LABEL_COLLECTION_PETS, ATTRIBUTE_LABEL_COMMON, ATTRIBUTE_LABEL_UOI, ATTRIBUTE_LABEL_UOI_SPORTS, ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL, ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS, AccountStatus, AdminAccountStatus, AttendanceStatus, type AttributeType, type AttributeTypeCollection, type AttributeTypeCollectionPets, type AttributeTypeCommon, type AttributeTypeUoi, type AttributeTypeUoiSports, type AttributeTypeUoiSportsBasketball, type AttributeTypeUoiSportsTennis, AvatarType, BasketballPosition, BuddyingStatus, type CardGamesInterestType, type CategoryType, ChallengeStatus, CollectionMetaStatus, type CollectionType, DuelGameResultType, FollowingStatus, type GameType, Gender, Handedness, type InterestType, LeaderboardType, LengthUnit, LocationType, MarketMetaStatus, type MarketType, MemberingStatus, type MusicInterestType, NotificationType, type PIDPrefixType, PID_LENGTH, PID_PREFIX_LENGTH, PageType, type PetsInterestType, PostPrivacy, PostType, ProfileJoiningType, ProfilePermission, ProfilePrivacy, ProfileStatus, ProfileType, type SportsInterestType, SubjectType, TennisBackhand, TennisLevel, UserPronoun, WeightUnit, getBuddyingStatusName, getMemberingStatusName, getNotificationTypeName, getPIDPrefixByProfileType, getProfileAttributeLabel, getProfileTypeByPID, getProfileTypeName, isGamePID, isLeaderboardPID, isTeamPID, isUoiPID };
package/dist/index.js CHANGED
@@ -20,6 +20,14 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // src/index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ ATTRIBUTE_LABEL: () => ATTRIBUTE_LABEL,
24
+ ATTRIBUTE_LABEL_COLLECTION: () => ATTRIBUTE_LABEL_COLLECTION,
25
+ ATTRIBUTE_LABEL_COLLECTION_PETS: () => ATTRIBUTE_LABEL_COLLECTION_PETS,
26
+ ATTRIBUTE_LABEL_COMMON: () => ATTRIBUTE_LABEL_COMMON,
27
+ ATTRIBUTE_LABEL_UOI: () => ATTRIBUTE_LABEL_UOI,
28
+ ATTRIBUTE_LABEL_UOI_SPORTS: () => ATTRIBUTE_LABEL_UOI_SPORTS,
29
+ ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL: () => ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL,
30
+ ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS: () => ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS,
23
31
  AccountStatus: () => AccountStatus,
24
32
  AdminAccountStatus: () => AdminAccountStatus,
25
33
  AttendanceStatus: () => AttendanceStatus,
@@ -57,6 +65,7 @@ __export(index_exports, {
57
65
  getMemberingStatusName: () => getMemberingStatusName,
58
66
  getNotificationTypeName: () => getNotificationTypeName,
59
67
  getPIDPrefixByProfileType: () => getPIDPrefixByProfileType,
68
+ getProfileAttributeLabel: () => getProfileAttributeLabel,
60
69
  getProfileTypeByPID: () => getProfileTypeByPID,
61
70
  getProfileTypeName: () => getProfileTypeName,
62
71
  isGamePID: () => isGamePID,
@@ -540,8 +549,87 @@ var getNotificationTypeName = (type) => {
540
549
  return "Unknown";
541
550
  }
542
551
  };
552
+
553
+ // src/meta/common/label.ts
554
+ var ATTRIBUTE_LABEL_COMMON = {
555
+ handedness: "Handedness",
556
+ gender: "Gender",
557
+ dob: "Date of Birth"
558
+ };
559
+
560
+ // src/meta/uoi/sports/tennis/label.ts
561
+ var ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS = {
562
+ level: "Level",
563
+ backhand: "Backhand",
564
+ handedness: "Handedness"
565
+ };
566
+
567
+ // src/meta/uoi/sports/basketball/label.ts
568
+ var ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL = {
569
+ positions: "Positions"
570
+ };
571
+
572
+ // src/meta/uoi/sports/label.ts
573
+ var ATTRIBUTE_LABEL_UOI_SPORTS = {
574
+ tennis: ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS,
575
+ basketball: ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL
576
+ };
577
+
578
+ // src/meta/uoi/label.ts
579
+ var ATTRIBUTE_LABEL_UOI = {
580
+ sports: ATTRIBUTE_LABEL_UOI_SPORTS
581
+ };
582
+
583
+ // src/meta/collection/pets/label.ts
584
+ var ATTRIBUTE_LABEL_COLLECTION_PETS = {
585
+ breed: "Breed",
586
+ father: "Father",
587
+ mother: "Mother",
588
+ gender: "Gender",
589
+ height: "Height",
590
+ weight: "Weight",
591
+ children: "Children",
592
+ dob: "Date of Birth"
593
+ };
594
+
595
+ // src/meta/collection/label.ts
596
+ var ATTRIBUTE_LABEL_COLLECTION = {
597
+ pets: ATTRIBUTE_LABEL_COLLECTION_PETS
598
+ };
599
+
600
+ // src/meta/label.ts
601
+ var ATTRIBUTE_LABEL = {
602
+ [2 /* Uoi */]: ATTRIBUTE_LABEL_UOI,
603
+ [5 /* Collection */]: ATTRIBUTE_LABEL_COLLECTION,
604
+ [0 /* None */]: ATTRIBUTE_LABEL_COMMON
605
+ };
606
+
607
+ // src/meta/util.ts
608
+ var getProfileAttributeLabel = ({
609
+ profileType,
610
+ categoryType,
611
+ interestType,
612
+ attributeType
613
+ }) => {
614
+ let titles = ATTRIBUTE_LABEL[profileType];
615
+ if (categoryType) {
616
+ titles = (titles == null ? void 0 : titles[categoryType]) || {};
617
+ }
618
+ if (interestType) {
619
+ titles = (titles == null ? void 0 : titles[interestType]) || {};
620
+ }
621
+ return (titles == null ? void 0 : titles[attributeType]) || "";
622
+ };
543
623
  // Annotate the CommonJS export names for ESM import in node:
544
624
  0 && (module.exports = {
625
+ ATTRIBUTE_LABEL,
626
+ ATTRIBUTE_LABEL_COLLECTION,
627
+ ATTRIBUTE_LABEL_COLLECTION_PETS,
628
+ ATTRIBUTE_LABEL_COMMON,
629
+ ATTRIBUTE_LABEL_UOI,
630
+ ATTRIBUTE_LABEL_UOI_SPORTS,
631
+ ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL,
632
+ ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS,
545
633
  AccountStatus,
546
634
  AdminAccountStatus,
547
635
  AttendanceStatus,
@@ -579,6 +667,7 @@ var getNotificationTypeName = (type) => {
579
667
  getMemberingStatusName,
580
668
  getNotificationTypeName,
581
669
  getPIDPrefixByProfileType,
670
+ getProfileAttributeLabel,
582
671
  getProfileTypeByPID,
583
672
  getProfileTypeName,
584
673
  isGamePID,
package/dist/index.mjs CHANGED
@@ -472,7 +472,86 @@ var getNotificationTypeName = (type) => {
472
472
  return "Unknown";
473
473
  }
474
474
  };
475
+
476
+ // src/meta/common/label.ts
477
+ var ATTRIBUTE_LABEL_COMMON = {
478
+ handedness: "Handedness",
479
+ gender: "Gender",
480
+ dob: "Date of Birth"
481
+ };
482
+
483
+ // src/meta/uoi/sports/tennis/label.ts
484
+ var ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS = {
485
+ level: "Level",
486
+ backhand: "Backhand",
487
+ handedness: "Handedness"
488
+ };
489
+
490
+ // src/meta/uoi/sports/basketball/label.ts
491
+ var ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL = {
492
+ positions: "Positions"
493
+ };
494
+
495
+ // src/meta/uoi/sports/label.ts
496
+ var ATTRIBUTE_LABEL_UOI_SPORTS = {
497
+ tennis: ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS,
498
+ basketball: ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL
499
+ };
500
+
501
+ // src/meta/uoi/label.ts
502
+ var ATTRIBUTE_LABEL_UOI = {
503
+ sports: ATTRIBUTE_LABEL_UOI_SPORTS
504
+ };
505
+
506
+ // src/meta/collection/pets/label.ts
507
+ var ATTRIBUTE_LABEL_COLLECTION_PETS = {
508
+ breed: "Breed",
509
+ father: "Father",
510
+ mother: "Mother",
511
+ gender: "Gender",
512
+ height: "Height",
513
+ weight: "Weight",
514
+ children: "Children",
515
+ dob: "Date of Birth"
516
+ };
517
+
518
+ // src/meta/collection/label.ts
519
+ var ATTRIBUTE_LABEL_COLLECTION = {
520
+ pets: ATTRIBUTE_LABEL_COLLECTION_PETS
521
+ };
522
+
523
+ // src/meta/label.ts
524
+ var ATTRIBUTE_LABEL = {
525
+ [2 /* Uoi */]: ATTRIBUTE_LABEL_UOI,
526
+ [5 /* Collection */]: ATTRIBUTE_LABEL_COLLECTION,
527
+ [0 /* None */]: ATTRIBUTE_LABEL_COMMON
528
+ };
529
+
530
+ // src/meta/util.ts
531
+ var getProfileAttributeLabel = ({
532
+ profileType,
533
+ categoryType,
534
+ interestType,
535
+ attributeType
536
+ }) => {
537
+ let titles = ATTRIBUTE_LABEL[profileType];
538
+ if (categoryType) {
539
+ titles = (titles == null ? void 0 : titles[categoryType]) || {};
540
+ }
541
+ if (interestType) {
542
+ titles = (titles == null ? void 0 : titles[interestType]) || {};
543
+ }
544
+ return (titles == null ? void 0 : titles[attributeType]) || "";
545
+ };
475
546
  export {
547
+ ATTRIBUTE_LABEL,
548
+ ATTRIBUTE_LABEL_COLLECTION,
549
+ ATTRIBUTE_LABEL_COLLECTION_PETS,
550
+ ATTRIBUTE_LABEL_COMMON,
551
+ ATTRIBUTE_LABEL_UOI,
552
+ ATTRIBUTE_LABEL_UOI_SPORTS,
553
+ ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL,
554
+ ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS,
476
555
  AccountStatus,
477
556
  AdminAccountStatus,
478
557
  AttendanceStatus,
@@ -510,6 +589,7 @@ export {
510
589
  getMemberingStatusName,
511
590
  getNotificationTypeName,
512
591
  getPIDPrefixByProfileType,
592
+ getProfileAttributeLabel,
513
593
  getProfileTypeByPID,
514
594
  getProfileTypeName,
515
595
  isGamePID,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wenum",
3
- "version": "1.51.0",
3
+ "version": "1.52.1",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",
package/src/index.ts CHANGED
@@ -5,4 +5,5 @@ export * from './attribute';
5
5
  export * from './comment';
6
6
  export * from './interest';
7
7
  export * from './common';
8
- export * from './notification';
8
+ export * from './notification';
9
+ export * from './meta';
@@ -0,0 +1,3 @@
1
+ export * from './pets';
2
+ export * from './type';
3
+ export * from './label';
@@ -0,0 +1,6 @@
1
+ import { CategoryType } from 'src/interest';
2
+ import { ATTRIBUTE_LABEL_COLLECTION_PETS } from './pets';
3
+
4
+ export const ATTRIBUTE_LABEL_COLLECTION: Partial<Record<CategoryType, any>> = {
5
+ pets: ATTRIBUTE_LABEL_COLLECTION_PETS
6
+ };
@@ -0,0 +1,2 @@
1
+ export * from './type';
2
+ export * from './label';
@@ -0,0 +1,12 @@
1
+ import { AttributeTypeCollectionPets } from './type';
2
+
3
+ export const ATTRIBUTE_LABEL_COLLECTION_PETS: Record<AttributeTypeCollectionPets, string> = {
4
+ breed: 'Breed',
5
+ father: 'Father',
6
+ mother: 'Mother',
7
+ gender: 'Gender',
8
+ height: 'Height',
9
+ weight: 'Weight',
10
+ children: 'Children',
11
+ dob: 'Date of Birth',
12
+ };
@@ -0,0 +1,8 @@
1
+ export type AttributeTypeCollectionPets = 'dob'
2
+ | 'breed'
3
+ | 'father'
4
+ | 'mother'
5
+ | 'gender'
6
+ | 'height'
7
+ | 'weight'
8
+ | 'children';
@@ -0,0 +1,3 @@
1
+ import { AttributeTypeCollectionPets } from './pets';
2
+
3
+ export type AttributeTypeCollection = AttributeTypeCollectionPets;
@@ -0,0 +1,2 @@
1
+ export * from './label';
2
+ export * from './type';
@@ -0,0 +1,7 @@
1
+ import { AttributeTypeCommon } from './type';
2
+
3
+ export const ATTRIBUTE_LABEL_COMMON: Record<AttributeTypeCommon, string> = {
4
+ handedness: 'Handedness',
5
+ gender: 'Gender',
6
+ dob: 'Date of Birth'
7
+ };
@@ -0,0 +1,5 @@
1
+ export type AttributeTypeCommon =
2
+ | 'handedness'
3
+ | 'gender'
4
+ | 'dob'
5
+ ;
@@ -0,0 +1,6 @@
1
+ export * from './common';
2
+ export * from './uoi';
3
+ export * from './collection';
4
+ export * from './label';
5
+ export * from './type';
6
+ export * from './util';
@@ -0,0 +1,11 @@
1
+
2
+ import { ProfileType } from 'src/page';
3
+ import { ATTRIBUTE_LABEL_COLLECTION } from './collection';
4
+ import { ATTRIBUTE_LABEL_COMMON } from './common';
5
+ import { ATTRIBUTE_LABEL_UOI } from './uoi';
6
+
7
+ export const ATTRIBUTE_LABEL:Partial<Record<ProfileType, any>> = {
8
+ [ProfileType.Uoi]: ATTRIBUTE_LABEL_UOI,
9
+ [ProfileType.Collection]: ATTRIBUTE_LABEL_COLLECTION,
10
+ [ProfileType.None]: ATTRIBUTE_LABEL_COMMON,
11
+ };
@@ -0,0 +1,9 @@
1
+
2
+ import { AttributeTypeCollection } from './collection';
3
+ import { AttributeTypeCommon } from './common';
4
+ import { AttributeTypeUoi } from './uoi';
5
+
6
+ export type AttributeType =
7
+ | AttributeTypeUoi
8
+ | AttributeTypeCollection
9
+ | AttributeTypeCommon;
@@ -0,0 +1,3 @@
1
+ export * from './sports';
2
+ export * from './label';
3
+ export * from './type';
@@ -0,0 +1,6 @@
1
+ import { CategoryType } from 'src/interest';
2
+ import { ATTRIBUTE_LABEL_UOI_SPORTS } from './sports';
3
+
4
+ export const ATTRIBUTE_LABEL_UOI: Partial<Record<CategoryType, any>> = {
5
+ sports: ATTRIBUTE_LABEL_UOI_SPORTS,
6
+ };
@@ -0,0 +1,2 @@
1
+ export * from './label';
2
+ export * from './type';
@@ -0,0 +1,8 @@
1
+ import { AttributeTypeUoiSportsBasketball } from './type';
2
+
3
+ export const ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL: Record<
4
+ AttributeTypeUoiSportsBasketball,
5
+ string
6
+ > = {
7
+ positions: 'Positions'
8
+ };
@@ -0,0 +1,3 @@
1
+ export type AttributeTypeUoiSportsBasketball = 'positions';
2
+
3
+
@@ -0,0 +1,4 @@
1
+ export * from './tennis';
2
+ export * from './basketball';
3
+ export * from './label';
4
+ export * from './type';
@@ -0,0 +1,8 @@
1
+ import { SportsInterestType } from 'src/interest';
2
+ import { ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL } from './basketball';
3
+ import { ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS } from './tennis';
4
+
5
+ export const ATTRIBUTE_LABEL_UOI_SPORTS: Partial<Record<SportsInterestType, any>> = {
6
+ tennis: ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS,
7
+ basketball: ATTRIBUTE_LABEL_UOI_SPORTS_BASKETBALL,
8
+ };
@@ -0,0 +1,2 @@
1
+ export * from './label';
2
+ export * from './type';
@@ -0,0 +1,7 @@
1
+ import { AttributeTypeUoiSportsTennis } from './type';
2
+
3
+ export const ATTRIBUTE_LABEL_UOI_SPORTS_TENNIS: Record<AttributeTypeUoiSportsTennis, string> = {
4
+ level: 'Level',
5
+ backhand: 'Backhand',
6
+ handedness: 'Handedness'
7
+ };
@@ -0,0 +1,5 @@
1
+ export type AttributeTypeUoiSportsTennis =
2
+ | 'level'
3
+ | 'backhand'
4
+ | 'handedness'
5
+ ;
@@ -0,0 +1,6 @@
1
+ import { AttributeTypeUoiSportsBasketball } from './basketball/type';
2
+ import { AttributeTypeUoiSportsTennis } from './tennis/type';
3
+
4
+ export type AttributeTypeUoiSports =
5
+ | AttributeTypeUoiSportsTennis
6
+ | AttributeTypeUoiSportsBasketball;
@@ -0,0 +1,3 @@
1
+ import { AttributeTypeUoiSports } from './sports';
2
+
3
+ export type AttributeTypeUoi = AttributeTypeUoiSports;
@@ -0,0 +1,25 @@
1
+ import { CategoryType, InterestType } from 'src/interest';
2
+ import { ProfileType } from 'src/page';
3
+ import { ATTRIBUTE_LABEL } from './label';
4
+ import { AttributeType } from './type';
5
+
6
+ export const getProfileAttributeLabel = ({
7
+ profileType,
8
+ categoryType,
9
+ interestType,
10
+ attributeType
11
+ }:{
12
+ profileType: ProfileType,
13
+ categoryType?: CategoryType,
14
+ interestType?: InterestType,
15
+ attributeType: AttributeType,
16
+ }) => {
17
+ let titles: any = ATTRIBUTE_LABEL[profileType];
18
+ if (categoryType) {
19
+ titles = titles?.[categoryType] || {};
20
+ }
21
+ if (interestType) {
22
+ titles = titles?.[interestType] || {};
23
+ }
24
+ return titles?.[attributeType as any] || '';
25
+ };
package/tsconfig.json CHANGED
@@ -27,9 +27,8 @@
27
27
 
28
28
  /* Modules */
29
29
  "module": "commonjs", /* Specify what module code is generated. */
30
- // "rootDir": "./", /* Specify the root folder within your source files. */
31
30
  // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
32
- // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
31
+ "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
33
32
  // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
34
33
  // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
35
34
  // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */