@oxyfoo/whymeet-types 0.0.22 → 0.0.23

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,11 +1,11 @@
1
1
  import type { InterestCategoryKey } from './InterestCategory.js';
2
- export declare const SOCIAL_MOMENT_KEYS: readonly ["do_something_together", "go_out_or_move", "talk_and_share", "build_connection", "see_if_it_clicks", "grow_or_build"];
3
- export type SocialMomentKey = (typeof SOCIAL_MOMENT_KEYS)[number];
2
+ export declare const INTENTION_CATEGORY_KEYS: readonly ["do_something_together", "go_out_or_move", "talk_and_share", "build_connection", "see_if_it_clicks", "grow_or_build"];
3
+ export type IntentionCategoryKey = (typeof INTENTION_CATEGORY_KEYS)[number];
4
4
  export declare const INTENTION_KEYS: readonly ["go_out_coffee", "go_out_drink", "go_out_meal", "go_out_walk", "go_out_tonight", "go_out_discover", "activity_sports", "activity_play", "activity_play_video_games", "activity_play_board_games", "activity_culture", "activity_creative", "activity_food", "activity_outdoor", "talk_light", "talk_deep", "talk_topic", "talk_media", "talk_language_exchange", "talk_online", "meet_make_acquaintance", "meet_feeling", "meet_simple_first_date", "meet_relaxed_date", "meet_spontaneous", "meet_online_first", "regular_sports_partner", "regular_game_partner", "regular_talk_buddy", "regular_social_habit", "regular_small_group", "regular_go_out_often", "build_coworking", "build_project", "build_entrepreneurship", "build_create_together", "build_learn_together", "build_mentoring", "build_collaboration"];
5
5
  export type IntentionKey = (typeof INTENTION_KEYS)[number];
6
- export type IntentionParentKey = SocialMomentKey | IntentionKey;
6
+ export type IntentionParentKey = IntentionCategoryKey | IntentionKey;
7
7
  export type SupportedLocale = 'fr' | 'en';
8
- export interface SocialMomentI18n {
8
+ export interface IntentionCategoryI18n {
9
9
  label: string;
10
10
  description: string;
11
11
  }
@@ -14,19 +14,19 @@ export interface IntentionI18n {
14
14
  shortLabel: string;
15
15
  description: string;
16
16
  }
17
- export interface SocialMoment {
18
- key: SocialMomentKey;
17
+ export interface IntentionCategory {
18
+ key: IntentionCategoryKey;
19
19
  emoji: string;
20
20
  order: number;
21
21
  i18n: {
22
- fr: SocialMomentI18n;
23
- en: SocialMomentI18n;
22
+ fr: IntentionCategoryI18n;
23
+ en: IntentionCategoryI18n;
24
24
  };
25
25
  }
26
26
  export interface Intention {
27
27
  key: IntentionKey;
28
28
  parentKey: IntentionParentKey;
29
- momentKey: SocialMomentKey;
29
+ categoryKey: IntentionCategoryKey;
30
30
  level: 2 | 3;
31
31
  emoji: string;
32
32
  tags: readonly string[];
@@ -39,7 +39,7 @@ export interface Intention {
39
39
  };
40
40
  }
41
41
  export interface IntentionSelection {
42
- momentKey: SocialMomentKey;
42
+ categoryKey: IntentionCategoryKey;
43
43
  intentionKey: IntentionKey;
44
44
  tags?: string[];
45
45
  query?: string;
@@ -53,9 +53,9 @@ export interface IntentionDomainMapping {
53
53
  domainKey: InterestCategoryKey;
54
54
  weight: number;
55
55
  }
56
- export type IntentionFallbackLevel = 'none' | 'same_moment' | 'related_domains' | 'broad_intention';
56
+ export type IntentionFallbackLevel = 'none' | 'same_category' | 'related_domains' | 'broad_intention';
57
57
  export interface IntentionMatchSummary {
58
- momentKey: SocialMomentKey;
58
+ categoryKey: IntentionCategoryKey;
59
59
  intentionKey: IntentionKey;
60
60
  fallbackLevel: IntentionFallbackLevel;
61
61
  scoreParts?: {
@@ -66,30 +66,27 @@ export interface IntentionMatchSummary {
66
66
  vibe: number;
67
67
  };
68
68
  }
69
- export declare const SOCIAL_MOMENTS: readonly SocialMoment[];
69
+ export declare const INTENTION_CATEGORIES: readonly IntentionCategory[];
70
70
  export declare const INTENTIONS: readonly Intention[];
71
71
  export declare const INTENTIONS_BY_KEY: Readonly<Record<IntentionKey, Intention>>;
72
- export declare const SOCIAL_MOMENTS_BY_KEY: Readonly<Record<SocialMomentKey, SocialMoment>>;
72
+ export declare const INTENTION_CATEGORIES_BY_KEY: Readonly<Record<IntentionCategoryKey, IntentionCategory>>;
73
73
  export declare const INTENTIONS_BY_PARENT: Readonly<Record<IntentionParentKey, readonly Intention[]>>;
74
- export declare const INTENTIONS_BY_MOMENT: Readonly<Record<SocialMomentKey, readonly Intention[]>>;
75
- export declare const NESTED_INTENTIONS_BY_MOMENT: Readonly<Record<SocialMomentKey, readonly Intention[]>>;
74
+ export declare const INTENTIONS_BY_CATEGORY: Readonly<Record<IntentionCategoryKey, readonly Intention[]>>;
75
+ export declare const NESTED_INTENTIONS_BY_CATEGORY: Readonly<Record<IntentionCategoryKey, readonly Intention[]>>;
76
76
  export declare const INTENTION_TAG_MAPPINGS: readonly IntentionTagMapping[];
77
77
  export declare const INTENTION_DOMAIN_MAPPINGS: readonly IntentionDomainMapping[];
78
- export declare const LEGACY_INTENTION_TO_INTENTIONS: Readonly<Record<string, readonly IntentionKey[]>>;
79
- export declare const DEPRECATED_INTENTION_TO_ACTIVE_INTENTIONS: Readonly<Record<string, readonly IntentionKey[]>>;
80
- export declare const DEPRECATED_INTENTION_TO_ACTIVE_INTENTION: Readonly<Record<string, IntentionKey>>;
81
- export declare function isSocialMomentKey(value: string): value is SocialMomentKey;
78
+ export declare function isIntentionCategoryKey(value: string): value is IntentionCategoryKey;
82
79
  export declare function isIntentionKey(value: string): value is IntentionKey;
83
80
  export declare function normalizeIntentionKey(value: string): IntentionKey | null;
84
81
  export declare function normalizeIntentionKeys(values: readonly string[] | undefined | null): IntentionKey[];
85
- export declare function getSocialMoment(key: SocialMomentKey): SocialMoment;
82
+ export declare function getIntentionCategory(key: IntentionCategoryKey): IntentionCategory;
86
83
  export declare function getIntention(key: IntentionKey): Intention;
87
- export declare function getIntentionsForMoment(momentKey: SocialMomentKey): readonly Intention[];
88
- export declare function getAllIntentionsForMoment(momentKey: SocialMomentKey): readonly Intention[];
84
+ export declare function getIntentionsForCategory(categoryKey: IntentionCategoryKey): readonly Intention[];
85
+ export declare function getAllIntentionsForCategory(categoryKey: IntentionCategoryKey): readonly Intention[];
89
86
  export declare function getChildIntentions(parentKey: IntentionParentKey): readonly Intention[];
90
87
  export declare function hasChildIntentions(parentKey: IntentionParentKey): boolean;
91
88
  export declare function getParentKeyForIntention(intentionKey: IntentionKey): IntentionParentKey;
92
- export declare function getMomentKeyForIntention(intentionKey: IntentionKey): SocialMomentKey;
89
+ export declare function getCategoryKeyForIntention(intentionKey: IntentionKey): IntentionCategoryKey;
93
90
  export declare function getAncestorIntentionKeys(intentionKey: IntentionKey): IntentionKey[];
94
91
  export declare function getDescendantIntentionKeys(parentKey: IntentionParentKey): IntentionKey[];
95
92
  export declare function normalizeIntentionSelection(selection: IntentionSelection): IntentionSelection | null;
@@ -1,4 +1,4 @@
1
- export const SOCIAL_MOMENT_KEYS = [
1
+ export const INTENTION_CATEGORY_KEYS = [
2
2
  'do_something_together',
3
3
  'go_out_or_move',
4
4
  'talk_and_share',
@@ -47,7 +47,7 @@ export const INTENTION_KEYS = [
47
47
  'build_mentoring',
48
48
  'build_collaboration'
49
49
  ];
50
- export const SOCIAL_MOMENTS = [
50
+ export const INTENTION_CATEGORIES = [
51
51
  {
52
52
  key: 'go_out_or_move',
53
53
  emoji: '🌆',
@@ -125,7 +125,7 @@ export const INTENTIONS = [
125
125
  {
126
126
  key: 'go_out_coffee',
127
127
  parentKey: 'go_out_or_move',
128
- momentKey: 'go_out_or_move',
128
+ categoryKey: 'go_out_or_move',
129
129
  level: 2,
130
130
  emoji: '☕',
131
131
  i18n: {
@@ -147,7 +147,7 @@ export const INTENTIONS = [
147
147
  {
148
148
  key: 'go_out_drink',
149
149
  parentKey: 'go_out_or_move',
150
- momentKey: 'go_out_or_move',
150
+ categoryKey: 'go_out_or_move',
151
151
  level: 2,
152
152
  emoji: '🍷',
153
153
  i18n: {
@@ -169,7 +169,7 @@ export const INTENTIONS = [
169
169
  {
170
170
  key: 'go_out_meal',
171
171
  parentKey: 'go_out_or_move',
172
- momentKey: 'go_out_or_move',
172
+ categoryKey: 'go_out_or_move',
173
173
  level: 2,
174
174
  emoji: '🍽️',
175
175
  i18n: {
@@ -191,7 +191,7 @@ export const INTENTIONS = [
191
191
  {
192
192
  key: 'go_out_walk',
193
193
  parentKey: 'go_out_or_move',
194
- momentKey: 'go_out_or_move',
194
+ categoryKey: 'go_out_or_move',
195
195
  level: 2,
196
196
  emoji: '🚶',
197
197
  i18n: {
@@ -213,7 +213,7 @@ export const INTENTIONS = [
213
213
  {
214
214
  key: 'go_out_tonight',
215
215
  parentKey: 'go_out_or_move',
216
- momentKey: 'go_out_or_move',
216
+ categoryKey: 'go_out_or_move',
217
217
  level: 2,
218
218
  emoji: '🌃',
219
219
  i18n: {
@@ -235,7 +235,7 @@ export const INTENTIONS = [
235
235
  {
236
236
  key: 'go_out_discover',
237
237
  parentKey: 'go_out_or_move',
238
- momentKey: 'go_out_or_move',
238
+ categoryKey: 'go_out_or_move',
239
239
  level: 2,
240
240
  emoji: '🗺️',
241
241
  i18n: {
@@ -257,7 +257,7 @@ export const INTENTIONS = [
257
257
  {
258
258
  key: 'activity_sports',
259
259
  parentKey: 'do_something_together',
260
- momentKey: 'do_something_together',
260
+ categoryKey: 'do_something_together',
261
261
  level: 2,
262
262
  emoji: '🏃',
263
263
  i18n: {
@@ -279,7 +279,7 @@ export const INTENTIONS = [
279
279
  {
280
280
  key: 'activity_play',
281
281
  parentKey: 'do_something_together',
282
- momentKey: 'do_something_together',
282
+ categoryKey: 'do_something_together',
283
283
  level: 2,
284
284
  emoji: '🎲',
285
285
  i18n: {
@@ -302,7 +302,7 @@ export const INTENTIONS = [
302
302
  {
303
303
  key: 'activity_play_video_games',
304
304
  parentKey: 'activity_play',
305
- momentKey: 'do_something_together',
305
+ categoryKey: 'do_something_together',
306
306
  level: 3,
307
307
  emoji: '🎮',
308
308
  i18n: {
@@ -324,7 +324,7 @@ export const INTENTIONS = [
324
324
  {
325
325
  key: 'activity_play_board_games',
326
326
  parentKey: 'activity_play',
327
- momentKey: 'do_something_together',
327
+ categoryKey: 'do_something_together',
328
328
  level: 3,
329
329
  emoji: '🃏',
330
330
  i18n: {
@@ -346,7 +346,7 @@ export const INTENTIONS = [
346
346
  {
347
347
  key: 'activity_culture',
348
348
  parentKey: 'do_something_together',
349
- momentKey: 'do_something_together',
349
+ categoryKey: 'do_something_together',
350
350
  level: 2,
351
351
  emoji: '🎭',
352
352
  i18n: {
@@ -368,7 +368,7 @@ export const INTENTIONS = [
368
368
  {
369
369
  key: 'activity_creative',
370
370
  parentKey: 'do_something_together',
371
- momentKey: 'do_something_together',
371
+ categoryKey: 'do_something_together',
372
372
  level: 2,
373
373
  emoji: '🎨',
374
374
  i18n: {
@@ -390,7 +390,7 @@ export const INTENTIONS = [
390
390
  {
391
391
  key: 'activity_food',
392
392
  parentKey: 'do_something_together',
393
- momentKey: 'do_something_together',
393
+ categoryKey: 'do_something_together',
394
394
  level: 2,
395
395
  emoji: '🍳',
396
396
  i18n: {
@@ -412,7 +412,7 @@ export const INTENTIONS = [
412
412
  {
413
413
  key: 'activity_outdoor',
414
414
  parentKey: 'do_something_together',
415
- momentKey: 'do_something_together',
415
+ categoryKey: 'do_something_together',
416
416
  level: 2,
417
417
  emoji: '🌿',
418
418
  i18n: {
@@ -434,7 +434,7 @@ export const INTENTIONS = [
434
434
  {
435
435
  key: 'talk_light',
436
436
  parentKey: 'talk_and_share',
437
- momentKey: 'talk_and_share',
437
+ categoryKey: 'talk_and_share',
438
438
  level: 2,
439
439
  emoji: '🙂',
440
440
  i18n: {
@@ -456,7 +456,7 @@ export const INTENTIONS = [
456
456
  {
457
457
  key: 'talk_deep',
458
458
  parentKey: 'talk_and_share',
459
- momentKey: 'talk_and_share',
459
+ categoryKey: 'talk_and_share',
460
460
  level: 2,
461
461
  emoji: '🫶',
462
462
  i18n: {
@@ -478,7 +478,7 @@ export const INTENTIONS = [
478
478
  {
479
479
  key: 'talk_topic',
480
480
  parentKey: 'talk_and_share',
481
- momentKey: 'talk_and_share',
481
+ categoryKey: 'talk_and_share',
482
482
  level: 2,
483
483
  emoji: '🧠',
484
484
  i18n: {
@@ -500,7 +500,7 @@ export const INTENTIONS = [
500
500
  {
501
501
  key: 'talk_media',
502
502
  parentKey: 'talk_and_share',
503
- momentKey: 'talk_and_share',
503
+ categoryKey: 'talk_and_share',
504
504
  level: 2,
505
505
  emoji: '📚',
506
506
  i18n: {
@@ -522,7 +522,7 @@ export const INTENTIONS = [
522
522
  {
523
523
  key: 'talk_language_exchange',
524
524
  parentKey: 'talk_and_share',
525
- momentKey: 'talk_and_share',
525
+ categoryKey: 'talk_and_share',
526
526
  level: 2,
527
527
  emoji: '🗣️',
528
528
  i18n: {
@@ -544,7 +544,7 @@ export const INTENTIONS = [
544
544
  {
545
545
  key: 'talk_online',
546
546
  parentKey: 'talk_and_share',
547
- momentKey: 'talk_and_share',
547
+ categoryKey: 'talk_and_share',
548
548
  level: 2,
549
549
  emoji: '💻',
550
550
  i18n: {
@@ -566,7 +566,7 @@ export const INTENTIONS = [
566
566
  {
567
567
  key: 'meet_make_acquaintance',
568
568
  parentKey: 'see_if_it_clicks',
569
- momentKey: 'see_if_it_clicks',
569
+ categoryKey: 'see_if_it_clicks',
570
570
  level: 2,
571
571
  emoji: '👋',
572
572
  i18n: {
@@ -588,7 +588,7 @@ export const INTENTIONS = [
588
588
  {
589
589
  key: 'meet_feeling',
590
590
  parentKey: 'see_if_it_clicks',
591
- momentKey: 'see_if_it_clicks',
591
+ categoryKey: 'see_if_it_clicks',
592
592
  level: 2,
593
593
  emoji: '✨',
594
594
  i18n: {
@@ -610,7 +610,7 @@ export const INTENTIONS = [
610
610
  {
611
611
  key: 'meet_simple_first_date',
612
612
  parentKey: 'see_if_it_clicks',
613
- momentKey: 'see_if_it_clicks',
613
+ categoryKey: 'see_if_it_clicks',
614
614
  level: 2,
615
615
  emoji: '☕',
616
616
  i18n: {
@@ -632,7 +632,7 @@ export const INTENTIONS = [
632
632
  {
633
633
  key: 'meet_relaxed_date',
634
634
  parentKey: 'see_if_it_clicks',
635
- momentKey: 'see_if_it_clicks',
635
+ categoryKey: 'see_if_it_clicks',
636
636
  level: 2,
637
637
  emoji: '🌙',
638
638
  i18n: {
@@ -654,7 +654,7 @@ export const INTENTIONS = [
654
654
  {
655
655
  key: 'meet_spontaneous',
656
656
  parentKey: 'see_if_it_clicks',
657
- momentKey: 'see_if_it_clicks',
657
+ categoryKey: 'see_if_it_clicks',
658
658
  level: 2,
659
659
  emoji: '⚡',
660
660
  i18n: {
@@ -676,7 +676,7 @@ export const INTENTIONS = [
676
676
  {
677
677
  key: 'meet_online_first',
678
678
  parentKey: 'see_if_it_clicks',
679
- momentKey: 'see_if_it_clicks',
679
+ categoryKey: 'see_if_it_clicks',
680
680
  level: 2,
681
681
  emoji: '📱',
682
682
  i18n: {
@@ -698,7 +698,7 @@ export const INTENTIONS = [
698
698
  {
699
699
  key: 'regular_sports_partner',
700
700
  parentKey: 'build_connection',
701
- momentKey: 'build_connection',
701
+ categoryKey: 'build_connection',
702
702
  level: 2,
703
703
  emoji: '🏋️',
704
704
  i18n: {
@@ -720,7 +720,7 @@ export const INTENTIONS = [
720
720
  {
721
721
  key: 'regular_game_partner',
722
722
  parentKey: 'build_connection',
723
- momentKey: 'build_connection',
723
+ categoryKey: 'build_connection',
724
724
  level: 2,
725
725
  emoji: '🎲',
726
726
  i18n: {
@@ -742,7 +742,7 @@ export const INTENTIONS = [
742
742
  {
743
743
  key: 'regular_talk_buddy',
744
744
  parentKey: 'build_connection',
745
- momentKey: 'build_connection',
745
+ categoryKey: 'build_connection',
746
746
  level: 2,
747
747
  emoji: '🫱',
748
748
  i18n: {
@@ -764,7 +764,7 @@ export const INTENTIONS = [
764
764
  {
765
765
  key: 'regular_social_habit',
766
766
  parentKey: 'build_connection',
767
- momentKey: 'build_connection',
767
+ categoryKey: 'build_connection',
768
768
  level: 2,
769
769
  emoji: '🗓️',
770
770
  i18n: {
@@ -786,7 +786,7 @@ export const INTENTIONS = [
786
786
  {
787
787
  key: 'regular_small_group',
788
788
  parentKey: 'build_connection',
789
- momentKey: 'build_connection',
789
+ categoryKey: 'build_connection',
790
790
  level: 2,
791
791
  emoji: '👥',
792
792
  i18n: {
@@ -808,7 +808,7 @@ export const INTENTIONS = [
808
808
  {
809
809
  key: 'regular_go_out_often',
810
810
  parentKey: 'build_connection',
811
- momentKey: 'build_connection',
811
+ categoryKey: 'build_connection',
812
812
  level: 2,
813
813
  emoji: '🌙',
814
814
  i18n: {
@@ -830,7 +830,7 @@ export const INTENTIONS = [
830
830
  {
831
831
  key: 'build_coworking',
832
832
  parentKey: 'grow_or_build',
833
- momentKey: 'grow_or_build',
833
+ categoryKey: 'grow_or_build',
834
834
  level: 2,
835
835
  emoji: '🧑‍💻',
836
836
  i18n: {
@@ -852,7 +852,7 @@ export const INTENTIONS = [
852
852
  {
853
853
  key: 'build_project',
854
854
  parentKey: 'grow_or_build',
855
- momentKey: 'grow_or_build',
855
+ categoryKey: 'grow_or_build',
856
856
  level: 2,
857
857
  emoji: '🛠️',
858
858
  i18n: {
@@ -874,7 +874,7 @@ export const INTENTIONS = [
874
874
  {
875
875
  key: 'build_entrepreneurship',
876
876
  parentKey: 'grow_or_build',
877
- momentKey: 'grow_or_build',
877
+ categoryKey: 'grow_or_build',
878
878
  level: 2,
879
879
  emoji: '📈',
880
880
  i18n: {
@@ -896,7 +896,7 @@ export const INTENTIONS = [
896
896
  {
897
897
  key: 'build_create_together',
898
898
  parentKey: 'grow_or_build',
899
- momentKey: 'grow_or_build',
899
+ categoryKey: 'grow_or_build',
900
900
  level: 2,
901
901
  emoji: '🎨',
902
902
  i18n: {
@@ -918,7 +918,7 @@ export const INTENTIONS = [
918
918
  {
919
919
  key: 'build_learn_together',
920
920
  parentKey: 'grow_or_build',
921
- momentKey: 'grow_or_build',
921
+ categoryKey: 'grow_or_build',
922
922
  level: 2,
923
923
  emoji: '📘',
924
924
  i18n: {
@@ -940,7 +940,7 @@ export const INTENTIONS = [
940
940
  {
941
941
  key: 'build_mentoring',
942
942
  parentKey: 'grow_or_build',
943
- momentKey: 'grow_or_build',
943
+ categoryKey: 'grow_or_build',
944
944
  level: 2,
945
945
  emoji: '🎓',
946
946
  i18n: {
@@ -962,7 +962,7 @@ export const INTENTIONS = [
962
962
  {
963
963
  key: 'build_collaboration',
964
964
  parentKey: 'grow_or_build',
965
- momentKey: 'grow_or_build',
965
+ categoryKey: 'grow_or_build',
966
966
  level: 2,
967
967
  emoji: '🤝',
968
968
  i18n: {
@@ -982,23 +982,20 @@ export const INTENTIONS = [
982
982
  order: 70
983
983
  }
984
984
  ];
985
- const SOCIAL_PARENT_KEYS = [...SOCIAL_MOMENT_KEYS, ...INTENTION_KEYS];
985
+ const INTENTION_PARENT_KEYS = [...INTENTION_CATEGORY_KEYS, ...INTENTION_KEYS];
986
986
  function toRecord(entries) {
987
987
  return Object.freeze(Object.fromEntries(entries));
988
988
  }
989
- function getDeprecatedActiveIntentionKeys(value) {
990
- return DEPRECATED_INTENTION_TO_ACTIVE_INTENTIONS[value] ?? [];
991
- }
992
989
  export const INTENTIONS_BY_KEY = toRecord(INTENTIONS.map((intention) => [intention.key, intention]));
993
- export const SOCIAL_MOMENTS_BY_KEY = toRecord(SOCIAL_MOMENTS.map((moment) => [moment.key, moment]));
994
- export const INTENTIONS_BY_PARENT = toRecord(SOCIAL_PARENT_KEYS.map((parentKey) => [
990
+ export const INTENTION_CATEGORIES_BY_KEY = toRecord(INTENTION_CATEGORIES.map((category) => [category.key, category]));
991
+ export const INTENTIONS_BY_PARENT = toRecord(INTENTION_PARENT_KEYS.map((parentKey) => [
995
992
  parentKey,
996
993
  INTENTIONS.filter((intention) => intention.parentKey === parentKey).sort((a, b) => a.order - b.order)
997
994
  ]));
998
- export const INTENTIONS_BY_MOMENT = toRecord(SOCIAL_MOMENT_KEYS.map((momentKey) => [momentKey, INTENTIONS_BY_PARENT[momentKey] ?? []]));
999
- export const NESTED_INTENTIONS_BY_MOMENT = toRecord(SOCIAL_MOMENT_KEYS.map((momentKey) => [
1000
- momentKey,
1001
- INTENTIONS.filter((intention) => intention.momentKey === momentKey).sort((a, b) => a.order - b.order)
995
+ export const INTENTIONS_BY_CATEGORY = toRecord(INTENTION_CATEGORY_KEYS.map((categoryKey) => [categoryKey, INTENTIONS_BY_PARENT[categoryKey] ?? []]));
996
+ export const NESTED_INTENTIONS_BY_CATEGORY = toRecord(INTENTION_CATEGORY_KEYS.map((categoryKey) => [
997
+ categoryKey,
998
+ INTENTIONS.filter((intention) => intention.categoryKey === categoryKey).sort((a, b) => a.order - b.order)
1002
999
  ]));
1003
1000
  export const INTENTION_TAG_MAPPINGS = INTENTIONS.flatMap((intention) => intention.tags.map((tag) => ({ intentionKey: intention.key, tag })));
1004
1001
  export const INTENTION_DOMAIN_MAPPINGS = INTENTIONS.flatMap((intention) => intention.domainKeys.map((domainKey) => ({
@@ -1006,138 +1003,34 @@ export const INTENTION_DOMAIN_MAPPINGS = INTENTIONS.flatMap((intention) => inten
1006
1003
  domainKey,
1007
1004
  weight: intention.broad ? 0.7 : 1
1008
1005
  })));
1009
- export const LEGACY_INTENTION_TO_INTENTIONS = Object.freeze({
1010
- dating: ['meet_feeling', 'meet_simple_first_date', 'meet_relaxed_date'],
1011
- friendship: ['meet_make_acquaintance', 'regular_social_habit', 'regular_small_group'],
1012
- networking: ['build_project', 'build_mentoring', 'build_collaboration'],
1013
- activities: ['activity_sports', 'activity_play', 'activity_culture'],
1014
- discussion: ['talk_light', 'talk_deep', 'talk_media'],
1015
- serious_relationship: ['meet_feeling', 'meet_relaxed_date'],
1016
- activity_partner: ['activity_sports', 'activity_outdoor'],
1017
- group_activity: ['regular_small_group', 'activity_play_board_games'],
1018
- casual_chat: ['talk_light', 'talk_online']
1019
- });
1020
- export const DEPRECATED_INTENTION_TO_ACTIVE_INTENTIONS = Object.freeze({
1021
- do_together_open: [
1022
- 'activity_sports',
1023
- 'activity_play',
1024
- 'activity_culture',
1025
- 'activity_creative',
1026
- 'activity_food',
1027
- 'activity_outdoor'
1028
- ],
1029
- sports_partner: ['activity_sports'],
1030
- food_cooking: ['activity_food'],
1031
- culture_creative: ['activity_culture', 'activity_creative', 'activity_play'],
1032
- go_out_open: [
1033
- 'go_out_coffee',
1034
- 'go_out_drink',
1035
- 'go_out_meal',
1036
- 'go_out_walk',
1037
- 'go_out_tonight',
1038
- 'go_out_discover'
1039
- ],
1040
- coffee_or_drink_now: ['go_out_coffee', 'go_out_drink'],
1041
- walk_and_talk: ['go_out_walk'],
1042
- nightlife_event: ['go_out_tonight', 'go_out_discover'],
1043
- talk_share_open: [
1044
- 'talk_light',
1045
- 'talk_deep',
1046
- 'talk_topic',
1047
- 'talk_media',
1048
- 'talk_language_exchange',
1049
- 'talk_online'
1050
- ],
1051
- light_conversation: ['talk_light'],
1052
- books_ideas: ['talk_topic', 'talk_media'],
1053
- languages_exchange: ['talk_language_exchange'],
1054
- build_connection_open: [
1055
- 'regular_sports_partner',
1056
- 'regular_game_partner',
1057
- 'regular_talk_buddy',
1058
- 'regular_social_habit',
1059
- 'regular_small_group',
1060
- 'regular_go_out_often'
1061
- ],
1062
- new_friends: ['meet_make_acquaintance', 'regular_social_habit'],
1063
- small_group: ['regular_small_group'],
1064
- local_community: ['regular_social_habit', 'regular_small_group'],
1065
- see_if_clicks_open: [
1066
- 'meet_make_acquaintance',
1067
- 'meet_feeling',
1068
- 'meet_simple_first_date',
1069
- 'meet_relaxed_date',
1070
- 'meet_spontaneous',
1071
- 'meet_online_first'
1072
- ],
1073
- simple_first_meet: ['meet_simple_first_date'],
1074
- dinner_date: ['meet_relaxed_date'],
1075
- walk_date: ['meet_simple_first_date', 'meet_spontaneous'],
1076
- grow_build_open: [
1077
- 'build_coworking',
1078
- 'build_project',
1079
- 'build_entrepreneurship',
1080
- 'build_create_together',
1081
- 'build_learn_together',
1082
- 'build_mentoring',
1083
- 'build_collaboration'
1084
- ],
1085
- professional_exchange: ['build_project', 'build_collaboration'],
1086
- mentoring: ['build_mentoring'],
1087
- coworking: ['build_coworking'],
1088
- gaming_tabletop: ['activity_play_board_games'],
1089
- outdoors_adventure: ['activity_outdoor'],
1090
- music_show: ['go_out_discover'],
1091
- brunch_or_lunch: ['go_out_meal'],
1092
- local_event: ['go_out_discover'],
1093
- culture_news: ['talk_topic'],
1094
- movies_series: ['talk_media'],
1095
- support_circle: ['regular_social_habit', 'regular_talk_buddy'],
1096
- cultural_date: ['meet_relaxed_date'],
1097
- online_date: ['meet_online_first'],
1098
- startup_project: ['build_project', 'build_entrepreneurship'],
1099
- freelance_creative: ['build_collaboration'],
1100
- tech_product: ['build_project']
1101
- });
1102
- export const DEPRECATED_INTENTION_TO_ACTIVE_INTENTION = Object.freeze(Object.fromEntries(Object.entries(DEPRECATED_INTENTION_TO_ACTIVE_INTENTIONS)
1103
- .filter(([, intentionKeys]) => intentionKeys.length > 0)
1104
- .map(([deprecatedKey, intentionKeys]) => [deprecatedKey, intentionKeys[0]])));
1105
- export function isSocialMomentKey(value) {
1106
- return SOCIAL_MOMENT_KEYS.includes(value);
1006
+ export function isIntentionCategoryKey(value) {
1007
+ return INTENTION_CATEGORY_KEYS.includes(value);
1107
1008
  }
1108
1009
  export function isIntentionKey(value) {
1109
1010
  return INTENTION_KEYS.includes(value);
1110
1011
  }
1111
1012
  export function normalizeIntentionKey(value) {
1112
- if (isIntentionKey(value))
1113
- return value;
1114
- const [intentionKey] = getDeprecatedActiveIntentionKeys(value);
1115
- return intentionKey ?? null;
1013
+ return isIntentionKey(value) ? value : null;
1116
1014
  }
1117
1015
  export function normalizeIntentionKeys(values) {
1118
1016
  const normalized = new Set();
1119
1017
  for (const value of values ?? []) {
1120
- if (isIntentionKey(value)) {
1018
+ if (isIntentionKey(value))
1121
1019
  normalized.add(value);
1122
- continue;
1123
- }
1124
- for (const intentionKey of getDeprecatedActiveIntentionKeys(value)) {
1125
- normalized.add(intentionKey);
1126
- }
1127
1020
  }
1128
1021
  return [...normalized];
1129
1022
  }
1130
- export function getSocialMoment(key) {
1131
- return SOCIAL_MOMENTS_BY_KEY[key];
1023
+ export function getIntentionCategory(key) {
1024
+ return INTENTION_CATEGORIES_BY_KEY[key];
1132
1025
  }
1133
1026
  export function getIntention(key) {
1134
1027
  return INTENTIONS_BY_KEY[key];
1135
1028
  }
1136
- export function getIntentionsForMoment(momentKey) {
1137
- return INTENTIONS_BY_MOMENT[momentKey] ?? [];
1029
+ export function getIntentionsForCategory(categoryKey) {
1030
+ return INTENTIONS_BY_CATEGORY[categoryKey] ?? [];
1138
1031
  }
1139
- export function getAllIntentionsForMoment(momentKey) {
1140
- return NESTED_INTENTIONS_BY_MOMENT[momentKey] ?? [];
1032
+ export function getAllIntentionsForCategory(categoryKey) {
1033
+ return NESTED_INTENTIONS_BY_CATEGORY[categoryKey] ?? [];
1141
1034
  }
1142
1035
  export function getChildIntentions(parentKey) {
1143
1036
  return INTENTIONS_BY_PARENT[parentKey] ?? [];
@@ -1148,8 +1041,8 @@ export function hasChildIntentions(parentKey) {
1148
1041
  export function getParentKeyForIntention(intentionKey) {
1149
1042
  return INTENTIONS_BY_KEY[intentionKey].parentKey;
1150
1043
  }
1151
- export function getMomentKeyForIntention(intentionKey) {
1152
- return INTENTIONS_BY_KEY[intentionKey].momentKey;
1044
+ export function getCategoryKeyForIntention(intentionKey) {
1045
+ return INTENTIONS_BY_KEY[intentionKey].categoryKey;
1153
1046
  }
1154
1047
  export function getAncestorIntentionKeys(intentionKey) {
1155
1048
  const ancestors = [];
@@ -1172,18 +1065,14 @@ export function getDescendantIntentionKeys(parentKey) {
1172
1065
  return descendants;
1173
1066
  }
1174
1067
  export function normalizeIntentionSelection(selection) {
1175
- const resolvedIntentionKeys = isIntentionKey(selection.intentionKey)
1176
- ? [selection.intentionKey]
1177
- : [...getDeprecatedActiveIntentionKeys(selection.intentionKey)];
1178
- if (resolvedIntentionKeys.length !== 1)
1068
+ if (!isIntentionKey(selection.intentionKey))
1179
1069
  return null;
1180
- const [intentionKey] = resolvedIntentionKeys;
1181
- const intention = INTENTIONS_BY_KEY[intentionKey];
1182
- if (!intention || intention.momentKey !== selection.momentKey)
1070
+ const intention = INTENTIONS_BY_KEY[selection.intentionKey];
1071
+ if (!intention || intention.categoryKey !== selection.categoryKey)
1183
1072
  return null;
1184
1073
  return {
1185
- momentKey: selection.momentKey,
1186
- intentionKey,
1074
+ categoryKey: selection.categoryKey,
1075
+ intentionKey: selection.intentionKey,
1187
1076
  tags: selection.tags?.map((tag) => tag.trim()).filter((tag) => tag.length > 0),
1188
1077
  query: selection.query?.trim() || undefined
1189
1078
  };
@@ -1,5 +1,5 @@
1
1
  import { User } from './User.js';
2
- import type { IntentionMatchSummary, IntentionKey, SocialMomentKey } from './Intention.js';
2
+ import type { IntentionMatchSummary, IntentionKey, IntentionCategoryKey } from './Intention.js';
3
3
  import type { HostLevel } from './TrustScore.js';
4
4
  import type { SocialVibe } from './Profile.js';
5
5
  export interface MatchCandidate {
@@ -24,7 +24,7 @@ export interface Match {
24
24
  id: string;
25
25
  user: User;
26
26
  matchContext: string;
27
- momentKey: SocialMomentKey;
27
+ categoryKey: IntentionCategoryKey;
28
28
  intentionKey: IntentionKey;
29
29
  matchedAt: string;
30
30
  lastMessage?: string;
@@ -37,7 +37,7 @@ export interface MatchRequest {
37
37
  sender: User;
38
38
  intentionKeys: IntentionKey[];
39
39
  intentionMatch?: IntentionMatchSummary;
40
- momentKey?: SocialMomentKey;
40
+ categoryKey?: IntentionCategoryKey;
41
41
  intentionKey?: IntentionKey;
42
42
  matchContext: string;
43
43
  sentAt: string;
@@ -1,9 +1,9 @@
1
1
  import type { InterestCategoryKey } from './InterestCategory.js';
2
- import type { IntentionKey, SocialMomentKey } from './Intention.js';
2
+ import type { IntentionKey, IntentionCategoryKey } from './Intention.js';
3
3
  import type { SocialVibe } from './Profile.js';
4
4
  import type { PreferredPeriod } from './Availability.js';
5
5
  export interface SearchFilters {
6
- momentKey?: SocialMomentKey;
6
+ categoryKey?: IntentionCategoryKey;
7
7
  intentionKey?: IntentionKey;
8
8
  intentionKeys?: IntentionKey[];
9
9
  interestCategory?: InterestCategoryKey;
@@ -5,8 +5,8 @@ export type { Profile, SocialVibe, DiscoveryView } from './Profile.js';
5
5
  export { SOCIAL_VIBES } from './Profile.js';
6
6
  export type { InterestCategory, InterestCategoryKey } from './InterestCategory.js';
7
7
  export { INTEREST_CATEGORY_KEYS, INTEREST_CATEGORIES } from './InterestCategory.js';
8
- export type { IntentionFallbackLevel, IntentionMatchSummary, Intention, IntentionDomainMapping, IntentionKey, IntentionParentKey, IntentionSelection, IntentionTagMapping, SocialMoment, SocialMomentKey } from './Intention.js';
9
- export { DEPRECATED_INTENTION_TO_ACTIVE_INTENTION, DEPRECATED_INTENTION_TO_ACTIVE_INTENTIONS, getAllIntentionsForMoment, getAncestorIntentionKeys, getChildIntentions, getDescendantIntentionKeys, getMomentKeyForIntention, getParentKeyForIntention, getIntention, getIntentionsForMoment, hasChildIntentions, getSocialMoment, isIntentionKey, isSocialMomentKey, LEGACY_INTENTION_TO_INTENTIONS, normalizeIntentionKey, normalizeIntentionKeys, normalizeIntentionSelection, INTENTION_DOMAIN_MAPPINGS, INTENTION_KEYS, INTENTIONS_BY_PARENT, INTENTION_TAG_MAPPINGS, INTENTIONS, INTENTIONS_BY_KEY, INTENTIONS_BY_MOMENT, NESTED_INTENTIONS_BY_MOMENT, SOCIAL_MOMENT_KEYS, SOCIAL_MOMENTS, SOCIAL_MOMENTS_BY_KEY } from './Intention.js';
8
+ export type { IntentionFallbackLevel, IntentionMatchSummary, Intention, IntentionDomainMapping, IntentionKey, IntentionParentKey, IntentionSelection, IntentionTagMapping, IntentionCategory, IntentionCategoryKey } from './Intention.js';
9
+ export { getAllIntentionsForCategory, getAncestorIntentionKeys, getChildIntentions, getDescendantIntentionKeys, getCategoryKeyForIntention, getParentKeyForIntention, getIntention, getIntentionsForCategory, hasChildIntentions, getIntentionCategory, isIntentionKey, isIntentionCategoryKey, normalizeIntentionKey, normalizeIntentionKeys, normalizeIntentionSelection, INTENTION_DOMAIN_MAPPINGS, INTENTION_KEYS, INTENTIONS_BY_PARENT, INTENTION_TAG_MAPPINGS, INTENTIONS, INTENTIONS_BY_KEY, INTENTIONS_BY_CATEGORY, NESTED_INTENTIONS_BY_CATEGORY, INTENTION_CATEGORY_KEYS, INTENTION_CATEGORIES, INTENTION_CATEGORIES_BY_KEY } from './Intention.js';
10
10
  export type { Tag, TagMatchType, TagSuggestion } from './Tag.js';
11
11
  export type { SearchFilters } from './Search.js';
12
12
  export type { MatchCandidate, Match, MatchRequest } from './Match.js';
@@ -1,6 +1,6 @@
1
1
  export { SOCIAL_VIBES } from './Profile.js';
2
2
  export { INTEREST_CATEGORY_KEYS, INTEREST_CATEGORIES } from './InterestCategory.js';
3
- export { DEPRECATED_INTENTION_TO_ACTIVE_INTENTION, DEPRECATED_INTENTION_TO_ACTIVE_INTENTIONS, getAllIntentionsForMoment, getAncestorIntentionKeys, getChildIntentions, getDescendantIntentionKeys, getMomentKeyForIntention, getParentKeyForIntention, getIntention, getIntentionsForMoment, hasChildIntentions, getSocialMoment, isIntentionKey, isSocialMomentKey, LEGACY_INTENTION_TO_INTENTIONS, normalizeIntentionKey, normalizeIntentionKeys, normalizeIntentionSelection, INTENTION_DOMAIN_MAPPINGS, INTENTION_KEYS, INTENTIONS_BY_PARENT, INTENTION_TAG_MAPPINGS, INTENTIONS, INTENTIONS_BY_KEY, INTENTIONS_BY_MOMENT, NESTED_INTENTIONS_BY_MOMENT, SOCIAL_MOMENT_KEYS, SOCIAL_MOMENTS, SOCIAL_MOMENTS_BY_KEY } from './Intention.js';
3
+ export { getAllIntentionsForCategory, getAncestorIntentionKeys, getChildIntentions, getDescendantIntentionKeys, getCategoryKeyForIntention, getParentKeyForIntention, getIntention, getIntentionsForCategory, hasChildIntentions, getIntentionCategory, isIntentionKey, isIntentionCategoryKey, normalizeIntentionKey, normalizeIntentionKeys, normalizeIntentionSelection, INTENTION_DOMAIN_MAPPINGS, INTENTION_KEYS, INTENTIONS_BY_PARENT, INTENTION_TAG_MAPPINGS, INTENTIONS, INTENTIONS_BY_KEY, INTENTIONS_BY_CATEGORY, NESTED_INTENTIONS_BY_CATEGORY, INTENTION_CATEGORY_KEYS, INTENTION_CATEGORIES, INTENTION_CATEGORIES_BY_KEY } from './Intention.js';
4
4
  export { GENDERS, DEFAULT_PEOPLE, DEFAULT_ACTIVITY, DEFAULT_VISIBILITY } from './Settings.js';
5
5
  export { PREFERRED_PERIODS } from './Availability.js';
6
6
  export { SUBSCRIPTION_PLANS, SUBSCRIPTION_STATUSES, BOOST_PACKS, BOOST_DURATION_DAYS, PRODUCT_IDS, APP_CONFIG_KEYS } from './Subscription.js';
@@ -11,7 +11,7 @@ import type { FeedbackType } from '../Models/Feedback.js';
11
11
  import type { BlockedUser } from '../Models/Block.js';
12
12
  import type { Activity, ActivitySummary, ActivitySearchFilters } from '../Models/Activity.js';
13
13
  import type { InterestCategoryKey } from '../Models/InterestCategory.js';
14
- import type { Intention, IntentionSelection, SocialMoment, SocialMomentKey } from '../Models/Intention.js';
14
+ import type { Intention, IntentionSelection, IntentionCategory, IntentionCategoryKey } from '../Models/Intention.js';
15
15
  import type { UserBadge } from '../Models/Badge.js';
16
16
  import type { PlaceSuggestion, PlaceSuggestionLite } from '../Models/Place.js';
17
17
  export interface WSRequest_Handshake {
@@ -47,7 +47,7 @@ export interface WSRequest_GetIntentionCatalog {
47
47
  export interface WSRequest_GetIntentionCounts {
48
48
  command: 'get-intention-counts';
49
49
  payload: {
50
- momentKey: SocialMomentKey;
50
+ categoryKey: IntentionCategoryKey;
51
51
  };
52
52
  }
53
53
  export interface WSRequest_GetIntentionPopularTags {
@@ -482,7 +482,7 @@ export interface WSResponse_GetCandidateCounts {
482
482
  export interface WSResponse_GetIntentionCatalog {
483
483
  command: 'get-intention-catalog';
484
484
  payload: {
485
- moments: SocialMoment[];
485
+ categories: IntentionCategory[];
486
486
  intentions: Intention[];
487
487
  } | {
488
488
  error: string;
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@oxyfoo/whymeet-types",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "description": "WhyMeet Types - Shared TypeScript types for the WhyMeet project.",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "type": "module",
8
8
  "scripts": {
9
- "build": "tsc && tsc-alias && rm -f ./dist/tsconfig.tsbuildinfo",
9
+ "build": "rm -rf dist && tsc && tsc-alias && rm -f ./dist/tsconfig.tsbuildinfo",
10
10
  "lint": "eslint .",
11
11
  "lint:fix": "eslint . --fix",
12
12
  "format": "prettier --check '**/*.{ts,tsx}'",