@oxyfoo/whymeet-types 0.0.2 → 0.0.3
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/Models/Activity.d.ts +7 -1
- package/dist/Models/Badge.d.ts +19 -0
- package/dist/Models/Badge.js +29 -0
- package/dist/Models/Profile.d.ts +2 -0
- package/dist/Models/Settings.d.ts +0 -3
- package/dist/Models/Settings.js +0 -2
- package/dist/Models/TrustScore.d.ts +14 -0
- package/dist/Models/TrustScore.js +27 -0
- package/dist/Models/User.d.ts +2 -0
- package/dist/Models/index.d.ts +5 -1
- package/dist/Models/index.js +2 -0
- package/dist/WS/Request.d.ts +73 -2
- package/package.json +1 -1
|
@@ -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:
|
|
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,19 @@
|
|
|
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
|
+
}
|
|
10
|
+
export interface UserBadge {
|
|
11
|
+
key: BadgeKey;
|
|
12
|
+
earned: boolean;
|
|
13
|
+
earnedAt: string | null;
|
|
14
|
+
progress: number;
|
|
15
|
+
threshold: number | null;
|
|
16
|
+
}
|
|
17
|
+
export declare const BADGE_KEYS: readonly BadgeKey[];
|
|
18
|
+
export declare const BADGE_DEFINITIONS: readonly BadgeDefinition[];
|
|
19
|
+
export declare function getBadgeDefinition(key: BadgeKey): BadgeDefinition;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export const BADGE_KEYS = [
|
|
2
|
+
'verified_profile',
|
|
3
|
+
'veteran',
|
|
4
|
+
'first_event_joined',
|
|
5
|
+
'first_event_hosted',
|
|
6
|
+
'host_5',
|
|
7
|
+
'participant_10',
|
|
8
|
+
'host_10',
|
|
9
|
+
'host_25',
|
|
10
|
+
'participant_50',
|
|
11
|
+
'host_50',
|
|
12
|
+
'host_100'
|
|
13
|
+
];
|
|
14
|
+
export const BADGE_DEFINITIONS = [
|
|
15
|
+
{ key: 'verified_profile', emoji: '✅', category: 'verification', threshold: null, displayOrder: 10 },
|
|
16
|
+
{ key: 'veteran', emoji: '🏛️', category: 'seniority', threshold: null, displayOrder: 20 },
|
|
17
|
+
{ key: 'first_event_joined', emoji: '🎉', category: 'participation', threshold: 1, displayOrder: 30 },
|
|
18
|
+
{ key: 'first_event_hosted', emoji: '🌱', category: 'hosting', threshold: 1, displayOrder: 35 },
|
|
19
|
+
{ key: 'host_5', emoji: '⭐', category: 'hosting', threshold: 5, displayOrder: 40 },
|
|
20
|
+
{ key: 'participant_10', emoji: '🤝', category: 'participation', threshold: 10, displayOrder: 45 },
|
|
21
|
+
{ key: 'host_10', emoji: '🔥', category: 'hosting', threshold: 10, displayOrder: 50 },
|
|
22
|
+
{ key: 'host_25', emoji: '💎', category: 'hosting', threshold: 25, displayOrder: 60 },
|
|
23
|
+
{ key: 'participant_50', emoji: '🏅', category: 'participation', threshold: 50, displayOrder: 65 },
|
|
24
|
+
{ key: 'host_50', emoji: '👑', category: 'hosting', threshold: 50, displayOrder: 70 },
|
|
25
|
+
{ key: 'host_100', emoji: '🏆', category: 'hosting', threshold: 100, displayOrder: 80 }
|
|
26
|
+
];
|
|
27
|
+
export function getBadgeDefinition(key) {
|
|
28
|
+
return BADGE_DEFINITIONS.find((b) => b.key === key);
|
|
29
|
+
}
|
package/dist/Models/Profile.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/Models/Settings.js
CHANGED
|
@@ -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
|
+
}
|
package/dist/Models/User.d.ts
CHANGED
|
@@ -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
|
}
|
package/dist/Models/index.d.ts
CHANGED
|
@@ -11,9 +11,13 @@ 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 { BADGE_KEYS, BADGE_DEFINITIONS, getBadgeDefinition } from './Badge.js';
|
|
22
|
+
export type { HostLevelKey, HostLevel, HostLevelDefinition } from './TrustScore.js';
|
|
23
|
+
export { HOST_LEVEL_KEYS, HOST_LEVELS, getHostLevel } from './TrustScore.js';
|
package/dist/Models/index.js
CHANGED
|
@@ -3,3 +3,5 @@ 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 { BADGE_KEYS, BADGE_DEFINITIONS, getBadgeDefinition } from './Badge.js';
|
|
7
|
+
export { HOST_LEVEL_KEYS, HOST_LEVELS, getHostLevel } from './TrustScore.js';
|
package/dist/WS/Request.d.ts
CHANGED
|
@@ -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: {
|
|
@@ -328,7 +333,32 @@ export interface WSRequest_GetBoostStatus {
|
|
|
328
333
|
command: 'get-boost-status';
|
|
329
334
|
payload: Record<string, never>;
|
|
330
335
|
}
|
|
331
|
-
export
|
|
336
|
+
export interface WSRequest_GetBadges {
|
|
337
|
+
command: 'get-badges';
|
|
338
|
+
payload: Record<string, never>;
|
|
339
|
+
}
|
|
340
|
+
export interface WSRequest_GetUserBadges {
|
|
341
|
+
command: 'get-user-badges';
|
|
342
|
+
payload: {
|
|
343
|
+
userId: string;
|
|
344
|
+
};
|
|
345
|
+
}
|
|
346
|
+
export interface WSRequest_ConfirmHostAttendance {
|
|
347
|
+
command: 'confirm-host-attendance';
|
|
348
|
+
payload: {
|
|
349
|
+
activityId: string;
|
|
350
|
+
attendeeCount: number;
|
|
351
|
+
absentUserIds?: string[];
|
|
352
|
+
};
|
|
353
|
+
}
|
|
354
|
+
export interface WSRequest_ConfirmParticipation {
|
|
355
|
+
command: 'confirm-participation';
|
|
356
|
+
payload: {
|
|
357
|
+
activityId: string;
|
|
358
|
+
attended: boolean;
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
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 | WSRequest_GetProfilePopularTags | WSRequest_GetBadges | WSRequest_GetUserBadges | WSRequest_ConfirmHostAttendance | WSRequest_ConfirmParticipation;
|
|
332
362
|
export type WSClientCommand = WSClientRequest['command'];
|
|
333
363
|
export interface WSResponse_Handshake {
|
|
334
364
|
command: 'handshake';
|
|
@@ -388,6 +418,15 @@ export interface WSResponse_GetPopularTags {
|
|
|
388
418
|
error: string;
|
|
389
419
|
};
|
|
390
420
|
}
|
|
421
|
+
export interface WSResponse_GetProfilePopularTags {
|
|
422
|
+
command: 'get-profile-popular-tags';
|
|
423
|
+
payload: {
|
|
424
|
+
interests: string[];
|
|
425
|
+
skills: string[];
|
|
426
|
+
} | {
|
|
427
|
+
error: string;
|
|
428
|
+
};
|
|
429
|
+
}
|
|
391
430
|
export interface WSResponse_Like {
|
|
392
431
|
command: 'like';
|
|
393
432
|
payload: {
|
|
@@ -755,7 +794,39 @@ export interface WSResponse_UnblockUser {
|
|
|
755
794
|
error: string;
|
|
756
795
|
};
|
|
757
796
|
}
|
|
758
|
-
export
|
|
797
|
+
export interface WSResponse_GetBadges {
|
|
798
|
+
command: 'get-badges';
|
|
799
|
+
payload: {
|
|
800
|
+
badges: UserBadge[];
|
|
801
|
+
} | {
|
|
802
|
+
error: string;
|
|
803
|
+
};
|
|
804
|
+
}
|
|
805
|
+
export interface WSResponse_GetUserBadges {
|
|
806
|
+
command: 'get-user-badges';
|
|
807
|
+
payload: {
|
|
808
|
+
badges: UserBadge[];
|
|
809
|
+
} | {
|
|
810
|
+
error: string;
|
|
811
|
+
};
|
|
812
|
+
}
|
|
813
|
+
export interface WSResponse_ConfirmHostAttendance {
|
|
814
|
+
command: 'confirm-host-attendance';
|
|
815
|
+
payload: {
|
|
816
|
+
success: boolean;
|
|
817
|
+
} | {
|
|
818
|
+
error: string;
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
export interface WSResponse_ConfirmParticipation {
|
|
822
|
+
command: 'confirm-participation';
|
|
823
|
+
payload: {
|
|
824
|
+
success: boolean;
|
|
825
|
+
} | {
|
|
826
|
+
error: string;
|
|
827
|
+
};
|
|
828
|
+
}
|
|
829
|
+
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 | WSResponse_GetProfilePopularTags | WSResponse_GetBadges | WSResponse_GetUserBadges | WSResponse_ConfirmHostAttendance | WSResponse_ConfirmParticipation;
|
|
759
830
|
export interface WSEvent_NewMessage {
|
|
760
831
|
event: 'new-message';
|
|
761
832
|
payload: {
|