@oxyfoo/whymeet-types 0.0.17 → 0.0.19

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.
@@ -0,0 +1,16 @@
1
+ export type EmailScope = 'server' | 'console';
2
+ export type EmailDelivery = 'automatic' | 'manual';
3
+ export type EmailTypeDescriptor = {
4
+ key: EmailTypeKey;
5
+ scope: EmailScope;
6
+ delivery: EmailDelivery;
7
+ label: string;
8
+ trigger: string;
9
+ toggleable: boolean;
10
+ };
11
+ export declare const EMAIL_TYPE_KEYS: readonly ["auth.device_confirmation", "admin.invite", "admin.password_reset", "moderation.custom", "moderation.user_banned", "moderation.user_unbanned", "moderation.user_suspended", "moderation.user_unsuspended", "report.received_ack", "report.action_taken", "appeal.accepted", "appeal.rejected"];
12
+ export type EmailTypeKey = (typeof EMAIL_TYPE_KEYS)[number];
13
+ export declare const EMAIL_TYPES: readonly EmailTypeDescriptor[];
14
+ export declare function getEmailTypeDescriptor(key: EmailTypeKey): EmailTypeDescriptor;
15
+ export type EmailLogStatus = 'sent' | 'failed' | 'skipped';
16
+ export declare const EMAIL_LOG_STATUSES: readonly EmailLogStatus[];
@@ -0,0 +1,119 @@
1
+ export const EMAIL_TYPE_KEYS = [
2
+ 'auth.device_confirmation',
3
+ 'admin.invite',
4
+ 'admin.password_reset',
5
+ 'moderation.custom',
6
+ 'moderation.user_banned',
7
+ 'moderation.user_unbanned',
8
+ 'moderation.user_suspended',
9
+ 'moderation.user_unsuspended',
10
+ 'report.received_ack',
11
+ 'report.action_taken',
12
+ 'appeal.accepted',
13
+ 'appeal.rejected'
14
+ ];
15
+ export const EMAIL_TYPES = [
16
+ {
17
+ key: 'auth.device_confirmation',
18
+ scope: 'server',
19
+ delivery: 'automatic',
20
+ label: 'Confirmation d’appareil',
21
+ trigger: 'À chaque nouvelle tentative de connexion sur un appareil non confirmé.',
22
+ toggleable: false
23
+ },
24
+ {
25
+ key: 'admin.invite',
26
+ scope: 'console',
27
+ delivery: 'manual',
28
+ label: 'Invitation administrateur',
29
+ trigger: 'Lorsqu’un admin invite un nouveau modérateur ou administrateur.',
30
+ toggleable: false
31
+ },
32
+ {
33
+ key: 'admin.password_reset',
34
+ scope: 'console',
35
+ delivery: 'automatic',
36
+ label: 'Reset mot de passe (Console)',
37
+ trigger: 'Lorsqu’un admin/modérateur demande la réinitialisation de son mot de passe.',
38
+ toggleable: false
39
+ },
40
+ {
41
+ key: 'moderation.custom',
42
+ scope: 'console',
43
+ delivery: 'manual',
44
+ label: 'Email modération personnalisé',
45
+ trigger: 'Lorsqu’un modérateur envoie un email libre depuis la fiche utilisateur.',
46
+ toggleable: false
47
+ },
48
+ {
49
+ key: 'moderation.user_banned',
50
+ scope: 'console',
51
+ delivery: 'automatic',
52
+ label: 'Bannissement notifié à l’utilisateur',
53
+ trigger: 'Après un bannissement définitif depuis la Console.',
54
+ toggleable: true
55
+ },
56
+ {
57
+ key: 'moderation.user_unbanned',
58
+ scope: 'console',
59
+ delivery: 'automatic',
60
+ label: 'Levée de bannissement',
61
+ trigger: 'Après la levée d’un bannissement depuis la Console.',
62
+ toggleable: true
63
+ },
64
+ {
65
+ key: 'moderation.user_suspended',
66
+ scope: 'console',
67
+ delivery: 'automatic',
68
+ label: 'Suspension notifiée à l’utilisateur',
69
+ trigger: 'Après une suspension depuis la Console (mentionne la possibilité de recours).',
70
+ toggleable: true
71
+ },
72
+ {
73
+ key: 'moderation.user_unsuspended',
74
+ scope: 'console',
75
+ delivery: 'automatic',
76
+ label: 'Levée de suspension',
77
+ trigger: 'Après la levée d’une suspension depuis la Console.',
78
+ toggleable: true
79
+ },
80
+ {
81
+ key: 'report.received_ack',
82
+ scope: 'server',
83
+ delivery: 'automatic',
84
+ label: 'Accusé de réception de signalement',
85
+ trigger: 'Envoyé à l’auteur d’un signalement après création (utilisateur ou activité).',
86
+ toggleable: true
87
+ },
88
+ {
89
+ key: 'report.action_taken',
90
+ scope: 'console',
91
+ delivery: 'automatic',
92
+ label: 'Suite donnée à un signalement',
93
+ trigger: 'Envoyé aux auteurs de signalements quand l’utilisateur signalé est banni ou suspendu.',
94
+ toggleable: true
95
+ },
96
+ {
97
+ key: 'appeal.accepted',
98
+ scope: 'console',
99
+ delivery: 'manual',
100
+ label: 'Recours accepté',
101
+ trigger: 'Optionnellement envoyé quand un admin accepte un recours.',
102
+ toggleable: false
103
+ },
104
+ {
105
+ key: 'appeal.rejected',
106
+ scope: 'console',
107
+ delivery: 'manual',
108
+ label: 'Recours rejeté',
109
+ trigger: 'Optionnellement envoyé quand un admin rejette un recours.',
110
+ toggleable: false
111
+ }
112
+ ];
113
+ export function getEmailTypeDescriptor(key) {
114
+ const found = EMAIL_TYPES.find((t) => t.key === key);
115
+ if (!found)
116
+ throw new Error(`Unknown EmailTypeKey: ${key}`);
117
+ return found;
118
+ }
119
+ export const EMAIL_LOG_STATUSES = ['sent', 'failed', 'skipped'];
@@ -26,6 +26,30 @@ export interface SwipeQuotaInfo {
26
26
  swipesRemaining: number;
27
27
  dailySwipeLimit: number;
28
28
  }
29
+ export declare const APP_CONFIG_KEYS: {
30
+ readonly searchDailyFree: "counter.search.daily.free";
31
+ readonly searchDailyPremium: "counter.search.daily.premium";
32
+ readonly swipeDailyFree: "counter.swipe.daily.free";
33
+ readonly swipeDailyPremium: "counter.swipe.daily.premium";
34
+ readonly activityOpenDailyFree: "counter.activity_open.daily.free";
35
+ readonly activityOpenDailyPremium: "counter.activity_open.daily.premium";
36
+ readonly initialSearchTokens: "counter.search.initial";
37
+ readonly subscriptionBoostDays: "subscription.boost.days";
38
+ };
39
+ export interface UsageLimitConfig {
40
+ searchDailyFree: number;
41
+ searchDailyPremium: number;
42
+ swipeDailyFree: number;
43
+ swipeDailyPremium: number;
44
+ activityOpenDailyFree: number;
45
+ activityOpenDailyPremium: number;
46
+ initialSearchTokens: number;
47
+ subscriptionBoostDays: number;
48
+ }
49
+ export interface ActivityViewQuotaInfo {
50
+ activityViewsRemaining: number;
51
+ dailyActivityOpenLimit: number;
52
+ }
29
53
  export declare const PRODUCT_IDS: {
30
54
  readonly subscriptions: {
31
55
  readonly monthly: "com.whymeet.sub.monthly";
@@ -6,6 +6,16 @@ export const BOOST_DURATION_DAYS = {
6
6
  boost_3d: 3,
7
7
  boost_7d: 7
8
8
  };
9
+ export const APP_CONFIG_KEYS = {
10
+ searchDailyFree: 'counter.search.daily.free',
11
+ searchDailyPremium: 'counter.search.daily.premium',
12
+ swipeDailyFree: 'counter.swipe.daily.free',
13
+ swipeDailyPremium: 'counter.swipe.daily.premium',
14
+ activityOpenDailyFree: 'counter.activity_open.daily.free',
15
+ activityOpenDailyPremium: 'counter.activity_open.daily.premium',
16
+ initialSearchTokens: 'counter.search.initial',
17
+ subscriptionBoostDays: 'subscription.boost.days'
18
+ };
9
19
  export const PRODUCT_IDS = {
10
20
  subscriptions: {
11
21
  monthly: 'com.whymeet.sub.monthly',
@@ -17,8 +17,10 @@ export type { PlaceSuggestion, PlaceSuggestionLite } from './Place.js';
17
17
  export type { BlockedUser } from './Block.js';
18
18
  export type { PreferredPeriod } from './Availability.js';
19
19
  export { PREFERRED_PERIODS } from './Availability.js';
20
- export type { SubscriptionPlan, SubscriptionStatus, SubscriptionPlatform, UserSubscription, BoostPack, BoostSource, UserBoost, TokenBalance, SwipeQuotaInfo } from './Subscription.js';
21
- export { SUBSCRIPTION_PLANS, SUBSCRIPTION_STATUSES, BOOST_PACKS, BOOST_DURATION_DAYS, PRODUCT_IDS } from './Subscription.js';
20
+ export type { SubscriptionPlan, SubscriptionStatus, SubscriptionPlatform, UserSubscription, BoostPack, BoostSource, UserBoost, TokenBalance, SwipeQuotaInfo, UsageLimitConfig, ActivityViewQuotaInfo } from './Subscription.js';
21
+ export { SUBSCRIPTION_PLANS, SUBSCRIPTION_STATUSES, BOOST_PACKS, BOOST_DURATION_DAYS, PRODUCT_IDS, APP_CONFIG_KEYS } from './Subscription.js';
22
22
  export type { BadgeCategory, BadgeKey, BadgeDefinition, UserBadge } from './Badge.js';
23
23
  export type { HostLevelKey, HostLevel, HostLevelDefinition } from './TrustScore.js';
24
24
  export { HOST_LEVEL_KEYS, HOST_LEVELS, getHostLevel } from './TrustScore.js';
25
+ export type { EmailTypeKey, EmailTypeDescriptor, EmailScope, EmailDelivery, EmailLogStatus } from './EmailType.js';
26
+ export { EMAIL_TYPES, EMAIL_TYPE_KEYS, EMAIL_LOG_STATUSES, getEmailTypeDescriptor } from './EmailType.js';
@@ -2,5 +2,6 @@ export { SOCIAL_VIBES } from './Profile.js';
2
2
  export { INTENTION_KEYS, INTENTIONS, INTEREST_CATEGORY_KEYS, INTEREST_CATEGORIES, SUB_INTENTIONS } from './Intention.js';
3
3
  export { GENDERS, DEFAULT_PEOPLE, DEFAULT_ACTIVITY, DEFAULT_VISIBILITY } from './Settings.js';
4
4
  export { PREFERRED_PERIODS } from './Availability.js';
5
- export { SUBSCRIPTION_PLANS, SUBSCRIPTION_STATUSES, BOOST_PACKS, BOOST_DURATION_DAYS, PRODUCT_IDS } from './Subscription.js';
5
+ export { SUBSCRIPTION_PLANS, SUBSCRIPTION_STATUSES, BOOST_PACKS, BOOST_DURATION_DAYS, PRODUCT_IDS, APP_CONFIG_KEYS } from './Subscription.js';
6
6
  export { HOST_LEVEL_KEYS, HOST_LEVELS, getHostLevel } from './TrustScore.js';
7
+ export { EMAIL_TYPES, EMAIL_TYPE_KEYS, EMAIL_LOG_STATUSES, getEmailTypeDescriptor } from './EmailType.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oxyfoo/whymeet-types",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
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",