@oxyfoo/whymeet-types 0.0.2 → 0.0.4

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,5 +1,8 @@
1
1
  import type { User } from './User.js';
2
2
  import type { InterestCategoryKey } from './Intention.js';
3
+ export interface ActivityParticipantInfo extends User {
4
+ confirmedAttendance: boolean | null;
5
+ }
3
6
  export interface ActivityPhoto {
4
7
  id: string;
5
8
  key: string;
@@ -17,11 +20,14 @@ export interface Activity {
17
20
  longitude: number | null;
18
21
  maxParticipants: number | null;
19
22
  participantCount: number;
20
- participants: User[];
23
+ participants: ActivityParticipantInfo[];
21
24
  photos: ActivityPhoto[];
22
25
  conversationId: string | null;
23
26
  isCancelled: boolean;
24
27
  isArchived: boolean;
28
+ isCompleted: boolean;
29
+ hostConfirmedAt: string | null;
30
+ hostReportedAttendees: number | null;
25
31
  isParticipant: boolean;
26
32
  isHost: boolean;
27
33
  distance?: string;
@@ -0,0 +1,24 @@
1
+ export type BadgeCategory = 'verification' | 'seniority' | 'hosting' | 'participation';
2
+ export type BadgeKey = 'verified_profile' | 'veteran' | 'first_event_joined' | 'first_event_hosted' | 'host_5' | 'participant_10' | 'host_10' | 'host_25' | 'participant_50' | 'host_50' | 'host_100';
3
+ export interface BadgeDefinition {
4
+ key: BadgeKey;
5
+ emoji: string;
6
+ category: BadgeCategory;
7
+ threshold: number | null;
8
+ displayOrder: number;
9
+ rewardType: string | null;
10
+ rewardOfferIdApple: string | null;
11
+ rewardOfferIdGoogle: string | null;
12
+ rewardDescription: string | null;
13
+ }
14
+ export interface UserBadge {
15
+ key: BadgeKey;
16
+ emoji: string;
17
+ earned: boolean;
18
+ earnedAt: string | null;
19
+ progress: number;
20
+ threshold: number | null;
21
+ rewardType: string | null;
22
+ rewardDescription: string | null;
23
+ rewardClaimedAt: string | null;
24
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -13,6 +13,7 @@ export interface MatchCandidate {
13
13
  score?: number;
14
14
  blurred?: boolean;
15
15
  alreadyInteracted?: boolean;
16
+ alreadyMatched?: boolean;
16
17
  }
17
18
  export interface Match {
18
19
  id: string;
@@ -1,6 +1,7 @@
1
1
  import { User } from './User.js';
2
2
  import { IntentionKey } from './Intention.js';
3
3
  import { Tag } from './Tag.js';
4
+ import type { HostLevel } from './TrustScore.js';
4
5
  export type SocialVibe = 'reserved' | 'calm' | 'balanced' | 'outgoing' | 'very_social';
5
6
  export declare const SOCIAL_VIBES: readonly SocialVibe[];
6
7
  export interface Profile extends User {
@@ -22,4 +23,5 @@ export interface Profile extends User {
22
23
  matches: number;
23
24
  vibes: number;
24
25
  };
26
+ hostLevel: HostLevel | null;
25
27
  }
@@ -1,4 +1,3 @@
1
- import type { IntentionKey } from './Intention.js';
2
1
  export type Language = 'fr' | 'en';
3
2
  export type Theme = 'light' | 'dark';
4
3
  export type Gender = 'male' | 'female' | 'non_binary' | 'other' | 'prefer_not_to_say';
@@ -6,7 +5,6 @@ export declare const GENDERS: readonly Gender[];
6
5
  export interface DiscoveryPreferences {
7
6
  ageRange: [number, number];
8
7
  genders: Gender[];
9
- intentions: IntentionKey[];
10
8
  maxDistance: number;
11
9
  remoteMode: boolean;
12
10
  verifiedOnly: boolean;
@@ -15,7 +13,6 @@ export interface DiscoveryPreferences {
15
13
  export interface VisibilityPreferences {
16
14
  ageRange: [number, number];
17
15
  genders: Gender[];
18
- intentions: IntentionKey[];
19
16
  maxDistance: number;
20
17
  remoteMode: boolean;
21
18
  }
@@ -2,7 +2,6 @@ export const GENDERS = ['male', 'female', 'non_binary', 'other', 'prefer_not_to_
2
2
  export const DEFAULT_DISCOVERY = {
3
3
  ageRange: [18, 99],
4
4
  genders: ['male', 'female', 'non_binary', 'other', 'prefer_not_to_say'],
5
- intentions: [],
6
5
  maxDistance: 50,
7
6
  remoteMode: false,
8
7
  verifiedOnly: false,
@@ -11,7 +10,6 @@ export const DEFAULT_DISCOVERY = {
11
10
  export const DEFAULT_VISIBILITY = {
12
11
  ageRange: [18, 99],
13
12
  genders: ['male', 'female', 'non_binary', 'other', 'prefer_not_to_say'],
14
- intentions: [],
15
13
  maxDistance: 50,
16
14
  remoteMode: false
17
15
  };
@@ -0,0 +1,14 @@
1
+ export type HostLevelKey = 'novice' | 'reliable' | 'appreciated' | 'recognized' | 'outstanding';
2
+ export interface HostLevel {
3
+ key: HostLevelKey;
4
+ rank: number;
5
+ }
6
+ export interface HostLevelDefinition {
7
+ key: HostLevelKey;
8
+ rank: number;
9
+ minScore: number;
10
+ minCompleted: number;
11
+ }
12
+ export declare const HOST_LEVEL_KEYS: readonly HostLevelKey[];
13
+ export declare const HOST_LEVELS: readonly HostLevelDefinition[];
14
+ export declare function getHostLevel(trustScore: number, completedCount: number): HostLevel | null;
@@ -0,0 +1,27 @@
1
+ export const HOST_LEVEL_KEYS = [
2
+ 'novice',
3
+ 'reliable',
4
+ 'appreciated',
5
+ 'recognized',
6
+ 'outstanding'
7
+ ];
8
+ export const HOST_LEVELS = [
9
+ { key: 'novice', rank: 1, minScore: 0, minCompleted: 1 },
10
+ { key: 'reliable', rank: 2, minScore: 20, minCompleted: 5 },
11
+ { key: 'appreciated', rank: 3, minScore: 40, minCompleted: 5 },
12
+ { key: 'recognized', rank: 4, minScore: 60, minCompleted: 5 },
13
+ { key: 'outstanding', rank: 5, minScore: 80, minCompleted: 5 }
14
+ ];
15
+ export function getHostLevel(trustScore, completedCount) {
16
+ if (completedCount < 1)
17
+ return null;
18
+ if (completedCount < 5)
19
+ return { key: 'novice', rank: 1 };
20
+ for (let i = HOST_LEVELS.length - 1; i >= 0; i--) {
21
+ const level = HOST_LEVELS[i];
22
+ if (trustScore >= level.minScore && completedCount >= level.minCompleted) {
23
+ return { key: level.key, rank: level.rank };
24
+ }
25
+ }
26
+ return { key: 'novice', rank: 1 };
27
+ }
@@ -1,5 +1,6 @@
1
1
  import type { Gender } from './Settings.js';
2
2
  import type { PreferredPeriod } from './Availability.js';
3
+ import type { UserBadge } from './Badge.js';
3
4
  export interface ProfilePhoto {
4
5
  id: string;
5
6
  key: string;
@@ -20,4 +21,5 @@ export interface User {
20
21
  preferredPeriod: PreferredPeriod;
21
22
  isPremium: boolean;
22
23
  isBoosted: boolean;
24
+ badges: UserBadge[];
23
25
  }
@@ -11,9 +11,12 @@ export type { Conversation, Message } from './Conversation.js';
11
11
  export type { Notification } from './Notification.js';
12
12
  export type { Language, Theme, UserSettings, Gender, DiscoveryPreferences, VisibilityPreferences } from './Settings.js';
13
13
  export { GENDERS, DEFAULT_DISCOVERY, DEFAULT_VISIBILITY } from './Settings.js';
14
- export type { Activity, ActivitySummary, ActivitySearchFilters, ActivityPhoto } from './Activity.js';
14
+ export type { Activity, ActivitySummary, ActivitySearchFilters, ActivityPhoto, ActivityParticipantInfo } from './Activity.js';
15
15
  export type { BlockedUser } from './Block.js';
16
16
  export type { PreferredPeriod } from './Availability.js';
17
17
  export { PREFERRED_PERIODS } from './Availability.js';
18
18
  export type { SubscriptionPlan, SubscriptionStatus, SubscriptionPlatform, UserSubscription, BoostPack, BoostSource, UserBoost, TokenBalance, SwipeQuotaInfo } from './Subscription.js';
19
19
  export { SUBSCRIPTION_PLANS, SUBSCRIPTION_STATUSES, BOOST_PACKS, BOOST_DURATION_DAYS, PRODUCT_IDS } from './Subscription.js';
20
+ export type { BadgeCategory, BadgeKey, BadgeDefinition, UserBadge } from './Badge.js';
21
+ export type { HostLevelKey, HostLevel, HostLevelDefinition } from './TrustScore.js';
22
+ export { HOST_LEVEL_KEYS, HOST_LEVELS, getHostLevel } from './TrustScore.js';
@@ -3,3 +3,4 @@ export { INTENTION_KEYS, INTENTIONS, INTEREST_CATEGORY_KEYS, INTEREST_CATEGORIES
3
3
  export { GENDERS, DEFAULT_DISCOVERY, DEFAULT_VISIBILITY } from './Settings.js';
4
4
  export { PREFERRED_PERIODS } from './Availability.js';
5
5
  export { SUBSCRIPTION_PLANS, SUBSCRIPTION_STATUSES, BOOST_PACKS, BOOST_DURATION_DAYS, PRODUCT_IDS } from './Subscription.js';
6
+ export { HOST_LEVEL_KEYS, HOST_LEVELS, getHostLevel } from './TrustScore.js';
@@ -10,6 +10,7 @@ import type { ReportReason, ReportSourceType } from '../Models/Report.js';
10
10
  import type { BlockedUser } from '../Models/Block.js';
11
11
  import type { Activity, ActivitySummary, ActivitySearchFilters } from '../Models/Activity.js';
12
12
  import type { IntentionKey, InterestCategoryKey } from '../Models/Intention.js';
13
+ import type { UserBadge } from '../Models/Badge.js';
13
14
  export interface WSRequest_Handshake {
14
15
  command: 'handshake';
15
16
  payload: {
@@ -49,6 +50,10 @@ export interface WSRequest_GetPopularTags {
49
50
  subCategories: string[];
50
51
  };
51
52
  }
53
+ export interface WSRequest_GetProfilePopularTags {
54
+ command: 'get-profile-popular-tags';
55
+ payload: Record<string, never>;
56
+ }
52
57
  export interface WSRequest_Like {
53
58
  command: 'like';
54
59
  payload: {
@@ -278,6 +283,12 @@ export interface WSRequest_ReportActivity {
278
283
  message?: string;
279
284
  };
280
285
  }
286
+ export interface WSRequest_GetMyActivities {
287
+ command: 'get-my-activities';
288
+ payload: {
289
+ role: 'host' | 'participant';
290
+ };
291
+ }
281
292
  export interface WSRequest_GetBlockedUsers {
282
293
  command: 'get-blocked-users';
283
294
  payload: Record<string, never>;
@@ -328,7 +339,39 @@ export interface WSRequest_GetBoostStatus {
328
339
  command: 'get-boost-status';
329
340
  payload: Record<string, never>;
330
341
  }
331
- export type WSClientRequest = WSRequest_Handshake | WSRequest_GetProfile | WSRequest_UpdateProfile | WSRequest_GetCandidates | WSRequest_GetCandidateCounts | WSRequest_GetSubIntentionCounts | WSRequest_GetPopularTags | WSRequest_Like | WSRequest_Skip | WSRequest_Star | WSRequest_Search | WSRequest_GetConversations | WSRequest_GetMessages | WSRequest_SendMessage | WSRequest_GetRequests | WSRequest_AcceptRequest | WSRequest_DeclineRequest | WSRequest_GetNotifications | WSRequest_MarkNotificationRead | WSRequest_BlockUser | WSRequest_ReportUser | WSRequest_Unmatch | WSRequest_AppealSuspension | WSRequest_GetSettings | WSRequest_UpdateSettings | WSRequest_TagSuggest | WSRequest_GetPreferences | WSRequest_UpdatePreferences | WSRequest_DeleteAccount | WSRequest_RegisterPushToken | WSRequest_GetSubscription | WSRequest_ValidateReceipt | WSRequest_GetTokenBalance | WSRequest_SearchWithToken | WSRequest_PreviewSearch | WSRequest_PurchaseBoost | WSRequest_GetBoostStatus | WSRequest_MarkRead | WSRequest_GetUserProfile | WSRequest_CreateActivity | WSRequest_UpdateActivity | WSRequest_CancelActivity | WSRequest_GetActivity | WSRequest_JoinActivity | WSRequest_LeaveActivity | WSRequest_GetActivities | WSRequest_GetActivityCounts | WSRequest_SearchActivities | WSRequest_ReportActivity | WSRequest_GetBlockedUsers | WSRequest_UnblockUser;
342
+ export interface WSRequest_GetBadges {
343
+ command: 'get-badges';
344
+ payload: Record<string, never>;
345
+ }
346
+ export interface WSRequest_GetUserBadges {
347
+ command: 'get-user-badges';
348
+ payload: {
349
+ userId: string;
350
+ };
351
+ }
352
+ export interface WSRequest_ClaimBadgeReward {
353
+ command: 'claim-badge-reward';
354
+ payload: {
355
+ badgeKey: string;
356
+ platform: 'ios' | 'android';
357
+ };
358
+ }
359
+ export interface WSRequest_ConfirmHostAttendance {
360
+ command: 'confirm-host-attendance';
361
+ payload: {
362
+ activityId: string;
363
+ attendeeCount: number;
364
+ absentUserIds?: string[];
365
+ };
366
+ }
367
+ export interface WSRequest_ConfirmParticipation {
368
+ command: 'confirm-participation';
369
+ payload: {
370
+ activityId: string;
371
+ attended: boolean;
372
+ };
373
+ }
374
+ export type WSClientRequest = WSRequest_Handshake | WSRequest_GetProfile | WSRequest_UpdateProfile | WSRequest_GetCandidates | WSRequest_GetCandidateCounts | WSRequest_GetSubIntentionCounts | WSRequest_GetPopularTags | WSRequest_Like | WSRequest_Skip | WSRequest_Star | WSRequest_Search | WSRequest_GetConversations | WSRequest_GetMessages | WSRequest_SendMessage | WSRequest_GetRequests | WSRequest_AcceptRequest | WSRequest_DeclineRequest | WSRequest_GetNotifications | WSRequest_MarkNotificationRead | WSRequest_BlockUser | WSRequest_ReportUser | WSRequest_Unmatch | WSRequest_AppealSuspension | WSRequest_GetSettings | WSRequest_UpdateSettings | WSRequest_TagSuggest | WSRequest_GetPreferences | WSRequest_UpdatePreferences | WSRequest_DeleteAccount | WSRequest_RegisterPushToken | WSRequest_GetSubscription | WSRequest_ValidateReceipt | WSRequest_GetTokenBalance | WSRequest_SearchWithToken | WSRequest_PreviewSearch | WSRequest_PurchaseBoost | WSRequest_GetBoostStatus | WSRequest_MarkRead | WSRequest_GetUserProfile | WSRequest_CreateActivity | WSRequest_UpdateActivity | WSRequest_CancelActivity | WSRequest_GetActivity | WSRequest_JoinActivity | WSRequest_LeaveActivity | WSRequest_GetActivities | WSRequest_GetActivityCounts | WSRequest_SearchActivities | WSRequest_ReportActivity | WSRequest_GetMyActivities | WSRequest_GetBlockedUsers | WSRequest_UnblockUser | WSRequest_GetProfilePopularTags | WSRequest_GetBadges | WSRequest_GetUserBadges | WSRequest_ClaimBadgeReward | WSRequest_ConfirmHostAttendance | WSRequest_ConfirmParticipation;
332
375
  export type WSClientCommand = WSClientRequest['command'];
333
376
  export interface WSResponse_Handshake {
334
377
  command: 'handshake';
@@ -388,6 +431,15 @@ export interface WSResponse_GetPopularTags {
388
431
  error: string;
389
432
  };
390
433
  }
434
+ export interface WSResponse_GetProfilePopularTags {
435
+ command: 'get-profile-popular-tags';
436
+ payload: {
437
+ interests: string[];
438
+ skills: string[];
439
+ } | {
440
+ error: string;
441
+ };
442
+ }
391
443
  export interface WSResponse_Like {
392
444
  command: 'like';
393
445
  payload: {
@@ -739,6 +791,14 @@ export interface WSResponse_ReportActivity {
739
791
  error: string;
740
792
  };
741
793
  }
794
+ export interface WSResponse_GetMyActivities {
795
+ command: 'get-my-activities';
796
+ payload: {
797
+ activities: ActivitySummary[];
798
+ } | {
799
+ error: string;
800
+ };
801
+ }
742
802
  export interface WSResponse_GetBlockedUsers {
743
803
  command: 'get-blocked-users';
744
804
  payload: {
@@ -755,7 +815,52 @@ export interface WSResponse_UnblockUser {
755
815
  error: string;
756
816
  };
757
817
  }
758
- export type WSServerResponse = WSResponse_Handshake | WSResponse_GetProfile | WSResponse_UpdateProfile | WSResponse_GetCandidates | WSResponse_GetCandidateCounts | WSResponse_GetSubIntentionCounts | WSResponse_GetPopularTags | WSResponse_Like | WSResponse_Skip | WSResponse_Star | WSResponse_Search | WSResponse_GetConversations | WSResponse_GetMessages | WSResponse_SendMessage | WSResponse_GetRequests | WSResponse_AcceptRequest | WSResponse_DeclineRequest | WSResponse_GetNotifications | WSResponse_MarkNotificationRead | WSResponse_BlockUser | WSResponse_ReportUser | WSResponse_Unmatch | WSResponse_AppealSuspension | WSResponse_GetSettings | WSResponse_UpdateSettings | WSResponse_TagSuggest | WSResponse_GetPreferences | WSResponse_UpdatePreferences | WSResponse_DeleteAccount | WSResponse_RegisterPushToken | WSResponse_GetSubscription | WSResponse_ValidateReceipt | WSResponse_GetTokenBalance | WSResponse_SearchWithToken | WSResponse_PreviewSearch | WSResponse_PurchaseBoost | WSResponse_GetBoostStatus | WSResponse_CreateActivity | WSResponse_UpdateActivity | WSResponse_CancelActivity | WSResponse_GetActivity | WSResponse_JoinActivity | WSResponse_LeaveActivity | WSResponse_GetActivities | WSResponse_GetActivityCounts | WSResponse_SearchActivities | WSResponse_ReportActivity | WSResponse_MarkRead | WSResponse_GetUserProfile | WSResponse_GetBlockedUsers | WSResponse_UnblockUser;
818
+ export interface WSResponse_GetBadges {
819
+ command: 'get-badges';
820
+ payload: {
821
+ badges: UserBadge[];
822
+ } | {
823
+ error: string;
824
+ };
825
+ }
826
+ export interface WSResponse_GetUserBadges {
827
+ command: 'get-user-badges';
828
+ payload: {
829
+ badges: UserBadge[];
830
+ } | {
831
+ error: string;
832
+ };
833
+ }
834
+ export interface WSResponse_ClaimBadgeReward {
835
+ command: 'claim-badge-reward';
836
+ payload: {
837
+ offerId: string;
838
+ platform: 'ios' | 'android';
839
+ keyIdentifier?: string;
840
+ nonce?: string;
841
+ signature?: string;
842
+ timestamp?: number;
843
+ } | {
844
+ error: string;
845
+ };
846
+ }
847
+ export interface WSResponse_ConfirmHostAttendance {
848
+ command: 'confirm-host-attendance';
849
+ payload: {
850
+ success: boolean;
851
+ } | {
852
+ error: string;
853
+ };
854
+ }
855
+ export interface WSResponse_ConfirmParticipation {
856
+ command: 'confirm-participation';
857
+ payload: {
858
+ success: boolean;
859
+ } | {
860
+ error: string;
861
+ };
862
+ }
863
+ export type WSServerResponse = WSResponse_Handshake | WSResponse_GetProfile | WSResponse_UpdateProfile | WSResponse_GetCandidates | WSResponse_GetCandidateCounts | WSResponse_GetSubIntentionCounts | WSResponse_GetPopularTags | WSResponse_Like | WSResponse_Skip | WSResponse_Star | WSResponse_Search | WSResponse_GetConversations | WSResponse_GetMessages | WSResponse_SendMessage | WSResponse_GetRequests | WSResponse_AcceptRequest | WSResponse_DeclineRequest | WSResponse_GetNotifications | WSResponse_MarkNotificationRead | WSResponse_BlockUser | WSResponse_ReportUser | WSResponse_Unmatch | WSResponse_AppealSuspension | WSResponse_GetSettings | WSResponse_UpdateSettings | WSResponse_TagSuggest | WSResponse_GetPreferences | WSResponse_UpdatePreferences | WSResponse_DeleteAccount | WSResponse_RegisterPushToken | WSResponse_GetSubscription | WSResponse_ValidateReceipt | WSResponse_GetTokenBalance | WSResponse_SearchWithToken | WSResponse_PreviewSearch | WSResponse_PurchaseBoost | WSResponse_GetBoostStatus | WSResponse_CreateActivity | WSResponse_UpdateActivity | WSResponse_CancelActivity | WSResponse_GetActivity | WSResponse_JoinActivity | WSResponse_LeaveActivity | WSResponse_GetActivities | WSResponse_GetActivityCounts | WSResponse_SearchActivities | WSResponse_ReportActivity | WSResponse_GetMyActivities | WSResponse_MarkRead | WSResponse_GetUserProfile | WSResponse_GetBlockedUsers | WSResponse_UnblockUser | WSResponse_GetProfilePopularTags | WSResponse_GetBadges | WSResponse_GetUserBadges | WSResponse_ClaimBadgeReward | WSResponse_ConfirmHostAttendance | WSResponse_ConfirmParticipation;
759
864
  export interface WSEvent_NewMessage {
760
865
  event: 'new-message';
761
866
  payload: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyfoo/whymeet-types",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
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",