onehook-api-client 1.0.19 → 1.0.21
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-cjs/membership/index.js +61 -0
- package/dist-cjs/models/models_0.js +6 -1
- package/dist-cjs/telemetry/index.js +585 -0
- package/dist-es/membership/index.js +50 -0
- package/dist-es/models/models_0.js +5 -0
- package/dist-es/telemetry/index.js +580 -0
- package/dist-types/commands/GetMyProfileCommand.d.ts +1 -1
- package/dist-types/commands/GetProfileCommand.d.ts +1 -1
- package/dist-types/commands/GetStateCommand.d.ts +1 -1
- package/dist-types/commands/UpdateEntitlementsCommand.d.ts +2 -2
- package/dist-types/commands/UpgradeUserCommand.d.ts +1 -1
- package/dist-types/membership/index.d.ts +47 -0
- package/dist-types/models/models_0.d.ts +45 -4
- package/dist-types/telemetry/index.d.ts +413 -0
- package/membership/SubscriptionTierCatalog.kt +30 -0
- package/membership/SubscriptionTierCatalog.swift +31 -0
- package/membership/membership-catalog.json +20 -0
- package/package.json +20 -2
- package/telemetry/TelemetryCatalog.kt +457 -0
- package/telemetry/TelemetryCatalog.swift +621 -0
- package/telemetry/telemetry-catalog.json +4137 -0
|
@@ -47,7 +47,7 @@ declare const GetStateCommand_base: {
|
|
|
47
47
|
* // matchIds: [ // StringList // required
|
|
48
48
|
* // "STRING_VALUE",
|
|
49
49
|
* // ],
|
|
50
|
-
* // subscriptionTier: "
|
|
50
|
+
* // subscriptionTier: "MUST" || "SUPER" || "INFINITY", // required
|
|
51
51
|
* // };
|
|
52
52
|
*
|
|
53
53
|
* ```
|
|
@@ -41,7 +41,7 @@ declare const UpdateEntitlementsCommand_base: {
|
|
|
41
41
|
* const client = new OneHookClient(config);
|
|
42
42
|
* const input = { // UpdateEntitlementsRequest
|
|
43
43
|
* userId: "STRING_VALUE", // required
|
|
44
|
-
* subscriptionTier: "
|
|
44
|
+
* subscriptionTier: "MUST" || "SUPER" || "INFINITY", // required
|
|
45
45
|
* source: "STRING_VALUE",
|
|
46
46
|
* purchaseRef: "STRING_VALUE",
|
|
47
47
|
* effectiveAt: Number("long"),
|
|
@@ -50,7 +50,7 @@ declare const UpdateEntitlementsCommand_base: {
|
|
|
50
50
|
* const response = await client.send(command);
|
|
51
51
|
* // { // UpdateEntitlementsResponse
|
|
52
52
|
* // status: "STRING_VALUE", // required
|
|
53
|
-
* // subscriptionTier: "
|
|
53
|
+
* // subscriptionTier: "MUST" || "SUPER" || "INFINITY", // required
|
|
54
54
|
* // };
|
|
55
55
|
*
|
|
56
56
|
* ```
|
|
@@ -45,7 +45,7 @@ declare const UpgradeUserCommand_base: {
|
|
|
45
45
|
* // matchIds: [ // StringList // required
|
|
46
46
|
* // "STRING_VALUE",
|
|
47
47
|
* // ],
|
|
48
|
-
* // subscriptionTier: "
|
|
48
|
+
* // subscriptionTier: "MUST" || "SUPER" || "INFINITY", // required
|
|
49
49
|
* // };
|
|
50
50
|
*
|
|
51
51
|
* ```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { SubscriptionTier } from '../models/models_0';
|
|
2
|
+
export { SubscriptionTier };
|
|
3
|
+
/** Customer-facing brand name of a tier. */
|
|
4
|
+
export type SubscriptionTierDisplayName = 'Must' | 'Super' | 'Infinity';
|
|
5
|
+
export interface SubscriptionTierInfo {
|
|
6
|
+
/** Wire value — the ONLY form that is persisted or sent to the backend. */
|
|
7
|
+
readonly wire: SubscriptionTier;
|
|
8
|
+
/** Presentation-only brand name. */
|
|
9
|
+
readonly displayName: SubscriptionTierDisplayName;
|
|
10
|
+
/** Default concurrent-connection (hook) ceiling. */
|
|
11
|
+
readonly maxConnections: number;
|
|
12
|
+
}
|
|
13
|
+
/** Every tier, lowest first. */
|
|
14
|
+
export declare const SUBSCRIPTION_TIERS: readonly SubscriptionTierInfo[];
|
|
15
|
+
/** Tier wire values, lowest first. */
|
|
16
|
+
export declare const SUBSCRIPTION_TIER_ORDER: readonly SubscriptionTier[];
|
|
17
|
+
/** The lowest tier — what an unknown / missing tier fails closed to. */
|
|
18
|
+
export declare const DEFAULT_SUBSCRIPTION_TIER: SubscriptionTier;
|
|
19
|
+
/** Paid tiers (every tier above the lowest), lowest first. */
|
|
20
|
+
export declare const PAID_SUBSCRIPTION_TIERS: readonly SubscriptionTierInfo[];
|
|
21
|
+
/** Metadata for a wire value. */
|
|
22
|
+
export declare function subscriptionTierInfo(tier: SubscriptionTier): SubscriptionTierInfo;
|
|
23
|
+
/** Customer-facing name for a wire value. */
|
|
24
|
+
export declare function subscriptionTierDisplayName(tier: SubscriptionTier): SubscriptionTierDisplayName;
|
|
25
|
+
/**
|
|
26
|
+
* Strict parser for an UNTRUSTED tier string (token claim, stored row, config key). Accepts a tier
|
|
27
|
+
* name (wire value or display name), case-insensitively and trimmed. Returns undefined otherwise.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseSubscriptionTier(raw: unknown): SubscriptionTier | undefined;
|
|
30
|
+
/** Called with the raw value whenever {@link resolveSubscriptionTier} meets a non-empty unknown tier. */
|
|
31
|
+
export type UnknownSubscriptionTierHandler = (raw: string) => void;
|
|
32
|
+
/**
|
|
33
|
+
* Registers the process-wide handler for unknown tiers (e.g. log an error / page a developer).
|
|
34
|
+
* The tier still resolves to {@link DEFAULT_SUBSCRIPTION_TIER}; the handler is for investigation.
|
|
35
|
+
*/
|
|
36
|
+
export declare function onUnknownSubscriptionTier(handler: UnknownSubscriptionTierHandler): void;
|
|
37
|
+
/**
|
|
38
|
+
* Like {@link parseSubscriptionTier} but fails closed to {@link DEFAULT_SUBSCRIPTION_TIER}. A missing
|
|
39
|
+
* value is normal (new account); a non-empty unknown value is reported to the registered handler.
|
|
40
|
+
*/
|
|
41
|
+
export declare function resolveSubscriptionTier(raw: unknown): SubscriptionTier;
|
|
42
|
+
/** Zero-based rank of a tier (lowest = 0). */
|
|
43
|
+
export declare function subscriptionTierRank(tier: SubscriptionTier): number;
|
|
44
|
+
/** True for any tier above the lowest tier. */
|
|
45
|
+
export declare function isPaidSubscriptionTier(tier: unknown): boolean;
|
|
46
|
+
/** Default connection ceiling for a (possibly unknown) tier; unknown fails closed to the lowest tier. */
|
|
47
|
+
export declare function maxConnectionsForTier(raw: unknown): number;
|
|
@@ -784,12 +784,32 @@ export interface UnlinkSocialRequest {
|
|
|
784
784
|
export interface UnlinkSocialResponse {
|
|
785
785
|
status: string | undefined;
|
|
786
786
|
}
|
|
787
|
+
/**
|
|
788
|
+
* @public
|
|
789
|
+
* @enum
|
|
790
|
+
*/
|
|
791
|
+
export declare const SubscriptionTier: {
|
|
792
|
+
readonly INFINITY: "INFINITY";
|
|
793
|
+
readonly MUST: "MUST";
|
|
794
|
+
readonly SUPER: "SUPER";
|
|
795
|
+
};
|
|
796
|
+
/**
|
|
797
|
+
* @public
|
|
798
|
+
*/
|
|
799
|
+
export type SubscriptionTier = typeof SubscriptionTier[keyof typeof SubscriptionTier];
|
|
787
800
|
/**
|
|
788
801
|
* @public
|
|
789
802
|
*/
|
|
790
803
|
export interface UpdateEntitlementsRequest {
|
|
791
804
|
userId: string | undefined;
|
|
792
|
-
|
|
805
|
+
/**
|
|
806
|
+
* A OneHook membership tier. The member values are the wire values persisted in Cognito
|
|
807
|
+
* (`custom:subscriptionTier`), DynamoDB and Postgres. Members are declared in ascending order
|
|
808
|
+
* (lowest tier first); consumers rely on that order. A stored value that is not one of these is
|
|
809
|
+
* treated as the lowest tier (Must) and raises the UnknownSubscriptionTier alarm.
|
|
810
|
+
* @public
|
|
811
|
+
*/
|
|
812
|
+
subscriptionTier: SubscriptionTier | undefined;
|
|
793
813
|
/**
|
|
794
814
|
* Provenance of the entitlement decision (e.g. stripe / apple / google / sync). Advisory/audit.
|
|
795
815
|
* @public
|
|
@@ -811,7 +831,14 @@ export interface UpdateEntitlementsRequest {
|
|
|
811
831
|
*/
|
|
812
832
|
export interface UpdateEntitlementsResponse {
|
|
813
833
|
status: string | undefined;
|
|
814
|
-
|
|
834
|
+
/**
|
|
835
|
+
* A OneHook membership tier. The member values are the wire values persisted in Cognito
|
|
836
|
+
* (`custom:subscriptionTier`), DynamoDB and Postgres. Members are declared in ascending order
|
|
837
|
+
* (lowest tier first); consumers rely on that order. A stored value that is not one of these is
|
|
838
|
+
* treated as the lowest tier (Must) and raises the UnknownSubscriptionTier alarm.
|
|
839
|
+
* @public
|
|
840
|
+
*/
|
|
841
|
+
subscriptionTier: SubscriptionTier | undefined;
|
|
815
842
|
}
|
|
816
843
|
/**
|
|
817
844
|
* @public
|
|
@@ -1421,7 +1448,14 @@ export interface ProfileResponse {
|
|
|
1421
1448
|
* @public
|
|
1422
1449
|
*/
|
|
1423
1450
|
verified?: boolean | undefined;
|
|
1424
|
-
|
|
1451
|
+
/**
|
|
1452
|
+
* A OneHook membership tier. The member values are the wire values persisted in Cognito
|
|
1453
|
+
* (`custom:subscriptionTier`), DynamoDB and Postgres. Members are declared in ascending order
|
|
1454
|
+
* (lowest tier first); consumers rely on that order. A stored value that is not one of these is
|
|
1455
|
+
* treated as the lowest tier (Must) and raises the UnknownSubscriptionTier alarm.
|
|
1456
|
+
* @public
|
|
1457
|
+
*/
|
|
1458
|
+
subscriptionTier?: SubscriptionTier | undefined;
|
|
1425
1459
|
pictures?: (string)[] | undefined;
|
|
1426
1460
|
/**
|
|
1427
1461
|
* Display-only preview transforms keyed by picture object key. Values use `v1:x,y,zoom`.
|
|
@@ -1547,7 +1581,14 @@ export interface UserStateResponse {
|
|
|
1547
1581
|
state: string | undefined;
|
|
1548
1582
|
activeConnections: number | undefined;
|
|
1549
1583
|
matchIds: (string)[] | undefined;
|
|
1550
|
-
|
|
1584
|
+
/**
|
|
1585
|
+
* A OneHook membership tier. The member values are the wire values persisted in Cognito
|
|
1586
|
+
* (`custom:subscriptionTier`), DynamoDB and Postgres. Members are declared in ascending order
|
|
1587
|
+
* (lowest tier first); consumers rely on that order. A stored value that is not one of these is
|
|
1588
|
+
* treated as the lowest tier (Must) and raises the UnknownSubscriptionTier alarm.
|
|
1589
|
+
* @public
|
|
1590
|
+
*/
|
|
1591
|
+
subscriptionTier: SubscriptionTier | undefined;
|
|
1551
1592
|
}
|
|
1552
1593
|
/**
|
|
1553
1594
|
* @public
|
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
export declare const TELEMETRY_CATALOG_VERSION = "1.3.0";
|
|
2
|
+
export declare const TELEMETRY_CATALOG_HASH = "25955dd2f9856888";
|
|
3
|
+
/** Every signal type the ingest accepts. */
|
|
4
|
+
export declare const SignalType: {
|
|
5
|
+
readonly SCREEN_VIEW: "screen_view";
|
|
6
|
+
readonly UI_INTERACTION: "ui_interaction";
|
|
7
|
+
readonly CARD_IMPRESSION: "card_impression";
|
|
8
|
+
readonly CARD_SWIPE_UI: "card_swipe_ui";
|
|
9
|
+
readonly PROMPT_VIEW: "prompt_view";
|
|
10
|
+
readonly MEDIA_VIEW: "media_view";
|
|
11
|
+
readonly MEDIA_FULLSCREEN_OPEN: "media_fullscreen_open";
|
|
12
|
+
readonly SECTION_VIEW: "section_view";
|
|
13
|
+
readonly NOTIFICATION_OPENED: "notification_opened";
|
|
14
|
+
readonly SESSION_HEARTBEAT: "session_heartbeat";
|
|
15
|
+
readonly LIKE_COMPOSER_OPEN: "like_composer_open";
|
|
16
|
+
readonly LIKE_COMMENT_ABANDONED: "like_comment_abandoned";
|
|
17
|
+
readonly CONVERSATION_OPENED: "conversation_opened";
|
|
18
|
+
readonly COMPOSE_ABANDONED: "compose_abandoned";
|
|
19
|
+
readonly PROFILE_REVISIT: "profile_revisit";
|
|
20
|
+
readonly HOOKED_STATE_VIEW: "hooked_state_view";
|
|
21
|
+
readonly LIKES_YOU_VIEW: "likes_you_view";
|
|
22
|
+
readonly SAFETY_UI_OPEN: "safety_ui_open";
|
|
23
|
+
};
|
|
24
|
+
export type SignalType = (typeof SignalType)[keyof typeof SignalType];
|
|
25
|
+
/** Client platform (from the X-OneHook-Platform header). */
|
|
26
|
+
export declare const Platform: {
|
|
27
|
+
readonly WEB: "web";
|
|
28
|
+
readonly IOS: "ios";
|
|
29
|
+
readonly ANDROID: "android";
|
|
30
|
+
};
|
|
31
|
+
export type Platform = (typeof Platform)[keyof typeof Platform];
|
|
32
|
+
/** Any product surface (incl. non-viewable chrome). */
|
|
33
|
+
export declare const Screen: {
|
|
34
|
+
readonly NAV: "NAV";
|
|
35
|
+
readonly LANDING: "LANDING";
|
|
36
|
+
readonly LOGIN: "LOGIN";
|
|
37
|
+
readonly REDEEM_INVITE: "REDEEM_INVITE";
|
|
38
|
+
readonly ONBOARDING: "ONBOARDING";
|
|
39
|
+
readonly DISCOVER: "DISCOVER";
|
|
40
|
+
readonly LIKE_COMPOSER: "LIKE_COMPOSER";
|
|
41
|
+
readonly LIKES_YOU: "LIKES_YOU";
|
|
42
|
+
readonly CHAT: "CHAT";
|
|
43
|
+
readonly CHAT_SETTINGS: "CHAT_SETTINGS";
|
|
44
|
+
readonly NOTIFICATIONS: "NOTIFICATIONS";
|
|
45
|
+
readonly PROFILE: "PROFILE";
|
|
46
|
+
readonly PROFILE_EDIT: "PROFILE_EDIT";
|
|
47
|
+
readonly PROFILE_PREVIEW: "PROFILE_PREVIEW";
|
|
48
|
+
readonly PREFERENCES: "PREFERENCES";
|
|
49
|
+
readonly SETTINGS: "SETTINGS";
|
|
50
|
+
readonly PAYWALL: "PAYWALL";
|
|
51
|
+
readonly LIVENESS: "LIVENESS";
|
|
52
|
+
readonly PHOTO_VIEWER: "PHOTO_VIEWER";
|
|
53
|
+
readonly SEARCH: "SEARCH";
|
|
54
|
+
readonly CREATE: "CREATE";
|
|
55
|
+
readonly SHARED: "SHARED";
|
|
56
|
+
};
|
|
57
|
+
export type Screen = (typeof Screen)[keyof typeof Screen];
|
|
58
|
+
/** A surface that can be the subject of screen_view, or the `context` of another signal. */
|
|
59
|
+
export declare const ViewableScreen: {
|
|
60
|
+
readonly LANDING: "LANDING";
|
|
61
|
+
readonly LOGIN: "LOGIN";
|
|
62
|
+
readonly REDEEM_INVITE: "REDEEM_INVITE";
|
|
63
|
+
readonly ONBOARDING: "ONBOARDING";
|
|
64
|
+
readonly DISCOVER: "DISCOVER";
|
|
65
|
+
readonly LIKE_COMPOSER: "LIKE_COMPOSER";
|
|
66
|
+
readonly LIKES_YOU: "LIKES_YOU";
|
|
67
|
+
readonly CHAT: "CHAT";
|
|
68
|
+
readonly CHAT_SETTINGS: "CHAT_SETTINGS";
|
|
69
|
+
readonly NOTIFICATIONS: "NOTIFICATIONS";
|
|
70
|
+
readonly PROFILE: "PROFILE";
|
|
71
|
+
readonly PROFILE_EDIT: "PROFILE_EDIT";
|
|
72
|
+
readonly PROFILE_PREVIEW: "PROFILE_PREVIEW";
|
|
73
|
+
readonly PREFERENCES: "PREFERENCES";
|
|
74
|
+
readonly SETTINGS: "SETTINGS";
|
|
75
|
+
readonly PAYWALL: "PAYWALL";
|
|
76
|
+
readonly LIVENESS: "LIVENESS";
|
|
77
|
+
readonly PHOTO_VIEWER: "PHOTO_VIEWER";
|
|
78
|
+
readonly SEARCH: "SEARCH";
|
|
79
|
+
readonly CREATE: "CREATE";
|
|
80
|
+
};
|
|
81
|
+
export type ViewableScreen = (typeof ViewableScreen)[keyof typeof ViewableScreen];
|
|
82
|
+
/** Main-shell tabs. */
|
|
83
|
+
export declare const TabScreen: {
|
|
84
|
+
readonly DISCOVER: "DISCOVER";
|
|
85
|
+
readonly LIKES_YOU: "LIKES_YOU";
|
|
86
|
+
readonly CHAT: "CHAT";
|
|
87
|
+
readonly PROFILE: "PROFILE";
|
|
88
|
+
};
|
|
89
|
+
export type TabScreen = (typeof TabScreen)[keyof typeof TabScreen];
|
|
90
|
+
/** The standard verbs for a UI interaction. Every platform uses these and only these. */
|
|
91
|
+
export declare const UiAction: {
|
|
92
|
+
readonly TAP: "tap";
|
|
93
|
+
readonly LONG_PRESS: "long_press";
|
|
94
|
+
readonly SUBMIT: "submit";
|
|
95
|
+
readonly TOGGLE: "toggle";
|
|
96
|
+
readonly SELECT: "select";
|
|
97
|
+
readonly DISMISS: "dismiss";
|
|
98
|
+
};
|
|
99
|
+
export type UiAction = (typeof UiAction)[keyof typeof UiAction];
|
|
100
|
+
/** Kind of control (informational; drives the default action). */
|
|
101
|
+
export declare const UiElementKind: {
|
|
102
|
+
readonly BUTTON: "button";
|
|
103
|
+
readonly TAB: "tab";
|
|
104
|
+
readonly TOGGLE: "toggle";
|
|
105
|
+
readonly LINK: "link";
|
|
106
|
+
readonly LIST_ITEM: "list_item";
|
|
107
|
+
readonly MENU_ITEM: "menu_item";
|
|
108
|
+
readonly DIALOG_BUTTON: "dialog_button";
|
|
109
|
+
readonly GESTURE: "gesture";
|
|
110
|
+
readonly SEGMENTED: "segmented";
|
|
111
|
+
};
|
|
112
|
+
export type UiElementKind = (typeof UiElementKind)[keyof typeof UiElementKind];
|
|
113
|
+
/** Discovery decision direction: left = pass, right = like, up = rose/super. */
|
|
114
|
+
export declare const SwipeDirection: {
|
|
115
|
+
readonly LEFT: "left";
|
|
116
|
+
readonly RIGHT: "right";
|
|
117
|
+
readonly UP: "up";
|
|
118
|
+
};
|
|
119
|
+
export type SwipeDirection = (typeof SwipeDirection)[keyof typeof SwipeDirection];
|
|
120
|
+
/** Media element type. */
|
|
121
|
+
export declare const MediaType: {
|
|
122
|
+
readonly IMAGE: "image";
|
|
123
|
+
readonly VIDEO: "video";
|
|
124
|
+
readonly VOICE: "voice";
|
|
125
|
+
};
|
|
126
|
+
export type MediaType = (typeof MediaType)[keyof typeof MediaType];
|
|
127
|
+
/** Profile sections a viewer can dwell on. */
|
|
128
|
+
export declare const ProfileSection: {
|
|
129
|
+
readonly PHOTOS: "PHOTOS";
|
|
130
|
+
readonly BIO: "BIO";
|
|
131
|
+
readonly INTERESTS: "INTERESTS";
|
|
132
|
+
readonly PROMPTS: "PROMPTS";
|
|
133
|
+
readonly VOICE: "VOICE";
|
|
134
|
+
};
|
|
135
|
+
export type ProfileSection = (typeof ProfileSection)[keyof typeof ProfileSection];
|
|
136
|
+
/** Profile element a comment-to-like targets. */
|
|
137
|
+
export declare const LikeTargetType: {
|
|
138
|
+
readonly PHOTO: "PHOTO";
|
|
139
|
+
readonly VIDEO: "VIDEO";
|
|
140
|
+
readonly VOICE: "VOICE";
|
|
141
|
+
readonly PROMPT: "PROMPT";
|
|
142
|
+
readonly INTEREST: "INTEREST";
|
|
143
|
+
readonly BIO: "BIO";
|
|
144
|
+
};
|
|
145
|
+
export type LikeTargetType = (typeof LikeTargetType)[keyof typeof LikeTargetType];
|
|
146
|
+
/** Safety UI intents (the action itself is server-authoritative). */
|
|
147
|
+
export declare const SafetyAction: {
|
|
148
|
+
readonly UNMATCH: "unmatch";
|
|
149
|
+
readonly BLOCK: "block";
|
|
150
|
+
readonly REPORT: "report";
|
|
151
|
+
};
|
|
152
|
+
export type SafetyAction = (typeof SafetyAction)[keyof typeof SafetyAction];
|
|
153
|
+
/** Which discovery card design produced the signal (segment metrics by design). */
|
|
154
|
+
export declare const CardVariant: {
|
|
155
|
+
readonly INTERLEAVED: "interleaved";
|
|
156
|
+
readonly SWIPE: "swipe";
|
|
157
|
+
readonly FEED: "feed";
|
|
158
|
+
};
|
|
159
|
+
export type CardVariant = (typeof CardVariant)[keyof typeof CardVariant];
|
|
160
|
+
/** Kind of notification that was opened. */
|
|
161
|
+
export declare const NotificationType: {
|
|
162
|
+
readonly NEW_MATCH: "new_match";
|
|
163
|
+
readonly NEW_LIKE: "new_like";
|
|
164
|
+
readonly NEW_MESSAGE: "new_message";
|
|
165
|
+
readonly REENGAGEMENT: "reengagement";
|
|
166
|
+
readonly OTHER: "other";
|
|
167
|
+
};
|
|
168
|
+
export type NotificationType = (typeof NotificationType)[keyof typeof NotificationType];
|
|
169
|
+
/** Delivery channel of an opened notification. */
|
|
170
|
+
export declare const NotificationChannel: {
|
|
171
|
+
readonly PUSH: "push";
|
|
172
|
+
readonly IN_APP: "in_app";
|
|
173
|
+
};
|
|
174
|
+
export type NotificationChannel = (typeof NotificationChannel)[keyof typeof NotificationChannel];
|
|
175
|
+
/** Reaction to the "one connection at a time" (hooked) overlay. */
|
|
176
|
+
export declare const HookedStateAction: {
|
|
177
|
+
readonly SHOWN: "shown";
|
|
178
|
+
readonly GO_TO_CHAT: "go_to_chat";
|
|
179
|
+
readonly DISMISS: "dismiss";
|
|
180
|
+
};
|
|
181
|
+
export type HookedStateAction = (typeof HookedStateAction)[keyof typeof HookedStateAction];
|
|
182
|
+
/** Registered UI element ids (`<screen>.<subject>`). Use with trackUi / data-track-id. */
|
|
183
|
+
export declare const UiElement: {
|
|
184
|
+
readonly NAV_TAB_SELECT: "nav.tab_select";
|
|
185
|
+
readonly NAV_SEARCH_OPEN: "nav.search_open";
|
|
186
|
+
readonly NAV_MENU_OPEN: "nav.menu_open";
|
|
187
|
+
readonly NAV_BACK: "nav.back";
|
|
188
|
+
readonly NAV_HOME_LOGO: "nav.home_logo";
|
|
189
|
+
readonly NAV_HOOKED_GO_TO_CHAT: "nav.hooked_go_to_chat";
|
|
190
|
+
readonly NAV_HOOKED_DISMISS: "nav.hooked_dismiss";
|
|
191
|
+
readonly LANDING_GET_STARTED: "landing.get_started";
|
|
192
|
+
readonly LANDING_LOGIN: "landing.login";
|
|
193
|
+
readonly LANDING_POLICY_LINK: "landing.policy_link";
|
|
194
|
+
readonly LANDING_HOME_LINK: "landing.home_link";
|
|
195
|
+
readonly LANDING_OPEN_IN_APP: "landing.open_in_app";
|
|
196
|
+
readonly LANDING_NAV_LINK: "landing.nav_link";
|
|
197
|
+
readonly LANDING_SOCIAL_LINK: "landing.social_link";
|
|
198
|
+
readonly LANDING_MOBILE_MENU_TOGGLE: "landing.mobile_menu_toggle";
|
|
199
|
+
readonly LANDING_SECTION_NAV: "landing.section_nav";
|
|
200
|
+
readonly LANDING_EMAIL_LINK: "landing.email_link";
|
|
201
|
+
readonly LANDING_PRICING_PERIOD_SELECT: "landing.pricing_period_select";
|
|
202
|
+
readonly LANDING_CAREERS_APPLY: "landing.careers_apply";
|
|
203
|
+
readonly LANDING_DEMO_INTERACT: "landing.demo_interact";
|
|
204
|
+
readonly LANDING_CHATBOT_WIDGET: "landing.chatbot_widget";
|
|
205
|
+
readonly LANDING_NOTICE_RETRY: "landing.notice_retry";
|
|
206
|
+
readonly LOGIN_SUBMIT: "login.submit";
|
|
207
|
+
readonly LOGIN_GOOGLE: "login.google";
|
|
208
|
+
readonly LOGIN_APPLE: "login.apple";
|
|
209
|
+
readonly LOGIN_PASSKEY: "login.passkey";
|
|
210
|
+
readonly LOGIN_IDENTIFIER_MODE: "login.identifier_mode";
|
|
211
|
+
readonly LOGIN_PASSWORD_MODE: "login.password_mode";
|
|
212
|
+
readonly LOGIN_FORGOT_PASSWORD: "login.forgot_password";
|
|
213
|
+
readonly LOGIN_RESEND_CODE: "login.resend_code";
|
|
214
|
+
readonly LOGIN_REDEEM_INVITE: "login.redeem_invite";
|
|
215
|
+
readonly LOGIN_CLOSE: "login.close";
|
|
216
|
+
readonly LOGIN_PASSKEY_SETUP: "login.passkey_setup";
|
|
217
|
+
readonly REDEEM_INVITE_SUBMIT: "redeem_invite.submit";
|
|
218
|
+
readonly REDEEM_INVITE_BACK: "redeem_invite.back";
|
|
219
|
+
readonly REDEEM_INVITE_LOGIN: "redeem_invite.login";
|
|
220
|
+
readonly REDEEM_INVITE_CLOSE: "redeem_invite.close";
|
|
221
|
+
readonly REDEEM_INVITE_RESEND_CODE: "redeem_invite.resend_code";
|
|
222
|
+
readonly ONBOARDING_NEXT: "onboarding.next";
|
|
223
|
+
readonly ONBOARDING_BACK: "onboarding.back";
|
|
224
|
+
readonly ONBOARDING_FINISH: "onboarding.finish";
|
|
225
|
+
readonly ONBOARDING_SKIP_SIGN_OUT: "onboarding.skip_sign_out";
|
|
226
|
+
readonly ONBOARDING_SKIP_SIGN_OUT_CONFIRM: "onboarding.skip_sign_out_confirm";
|
|
227
|
+
readonly ONBOARDING_PHOTO_ADD: "onboarding.photo_add";
|
|
228
|
+
readonly ONBOARDING_PHOTO_REMOVE: "onboarding.photo_remove";
|
|
229
|
+
readonly ONBOARDING_PHOTO_REMOVE_CONFIRM: "onboarding.photo_remove_confirm";
|
|
230
|
+
readonly ONBOARDING_PROMPT_ADD: "onboarding.prompt_add";
|
|
231
|
+
readonly ONBOARDING_PROMPT_REMOVE: "onboarding.prompt_remove";
|
|
232
|
+
readonly ONBOARDING_VOICE_ADD: "onboarding.voice_add";
|
|
233
|
+
readonly ONBOARDING_VOICE_REMOVE: "onboarding.voice_remove";
|
|
234
|
+
readonly ONBOARDING_CHOICE_SELECT: "onboarding.choice_select";
|
|
235
|
+
readonly DISCOVER_PASS_BUTTON: "discover.pass_button";
|
|
236
|
+
readonly DISCOVER_LIKE_BUTTON: "discover.like_button";
|
|
237
|
+
readonly DISCOVER_ROSE_BUTTON: "discover.rose_button";
|
|
238
|
+
readonly DISCOVER_UNDO_BUTTON: "discover.undo_button";
|
|
239
|
+
readonly DISCOVER_ELEMENT_LIKE: "discover.element_like";
|
|
240
|
+
readonly DISCOVER_PHOTO_OPEN: "discover.photo_open";
|
|
241
|
+
readonly DISCOVER_VOICE_PLAY: "discover.voice_play";
|
|
242
|
+
readonly DISCOVER_PREFERENCES_OPEN: "discover.preferences_open";
|
|
243
|
+
readonly DISCOVER_LIKES_YOU_OPEN: "discover.likes_you_open";
|
|
244
|
+
readonly DISCOVER_ADD_HOOK_OPEN: "discover.add_hook_open";
|
|
245
|
+
readonly DISCOVER_RETRY: "discover.retry";
|
|
246
|
+
readonly DISCOVER_ADD_HOOK_SUBMIT: "discover.add_hook_submit";
|
|
247
|
+
readonly DISCOVER_UPGRADE_OPEN: "discover.upgrade_open";
|
|
248
|
+
readonly LIKE_COMPOSER_SEND: "like_composer.send";
|
|
249
|
+
readonly LIKE_COMPOSER_SEND_WITHOUT_COMMENT: "like_composer.send_without_comment";
|
|
250
|
+
readonly LIKE_COMPOSER_CANCEL: "like_composer.cancel";
|
|
251
|
+
readonly LIKE_COMPOSER_UPGRADE: "like_composer.upgrade";
|
|
252
|
+
readonly LIKES_YOU_PROFILE_OPEN: "likes_you.profile_open";
|
|
253
|
+
readonly LIKES_YOU_LIKED_ITEM_OPEN: "likes_you.liked_item_open";
|
|
254
|
+
readonly LIKES_YOU_REFRESH: "likes_you.refresh";
|
|
255
|
+
readonly LIKES_YOU_RETRY: "likes_you.retry";
|
|
256
|
+
readonly LIKES_YOU_CLOSE: "likes_you.close";
|
|
257
|
+
readonly CHAT_SEND_BUTTON: "chat.send_button";
|
|
258
|
+
readonly CHAT_ATTACH_BUTTON: "chat.attach_button";
|
|
259
|
+
readonly CHAT_ATTACH_OPTION: "chat.attach_option";
|
|
260
|
+
readonly CHAT_CAPTURE_OPTION: "chat.capture_option";
|
|
261
|
+
readonly CHAT_VOICE_RECORD_START: "chat.voice_record_start";
|
|
262
|
+
readonly CHAT_VOICE_RECORD_STOP: "chat.voice_record_stop";
|
|
263
|
+
readonly CHAT_VOICE_RECORD_CANCEL: "chat.voice_record_cancel";
|
|
264
|
+
readonly CHAT_VOICE_SEND: "chat.voice_send";
|
|
265
|
+
readonly CHAT_CONVERSATION_SWITCH: "chat.conversation_switch";
|
|
266
|
+
readonly CHAT_CONVERSATION_SORT: "chat.conversation_sort";
|
|
267
|
+
readonly CHAT_CONVERSATION_SORT_OPEN: "chat.conversation_sort_open";
|
|
268
|
+
readonly CHAT_CONVERSATION_SWITCHER_OPEN: "chat.conversation_switcher_open";
|
|
269
|
+
readonly CHAT_PROFILE_OPEN: "chat.profile_open";
|
|
270
|
+
readonly CHAT_SAFETY_MENU_OPEN: "chat.safety_menu_open";
|
|
271
|
+
readonly CHAT_UNMATCH: "chat.unmatch";
|
|
272
|
+
readonly CHAT_REPORT_SPAM: "chat.report_spam";
|
|
273
|
+
readonly CHAT_REPORT_BLOCK: "chat.report_block";
|
|
274
|
+
readonly CHAT_BLOCK_CONFIRM: "chat.block_confirm";
|
|
275
|
+
readonly CHAT_SETTINGS_OPEN: "chat.settings_open";
|
|
276
|
+
readonly CHAT_WALLPAPER_OPEN: "chat.wallpaper_open";
|
|
277
|
+
readonly CHAT_ADD_HOOK_OPEN: "chat.add_hook_open";
|
|
278
|
+
readonly CHAT_PRIVACY_TOGGLE: "chat.privacy_toggle";
|
|
279
|
+
readonly CHAT_CALL: "chat.call";
|
|
280
|
+
readonly CHAT_VIDEO_CALL: "chat.video_call";
|
|
281
|
+
readonly CHAT_MEDIA_OPEN: "chat.media_open";
|
|
282
|
+
readonly CHAT_AUDIO_PLAY: "chat.audio_play";
|
|
283
|
+
readonly CHAT_FILE_OPEN: "chat.file_open";
|
|
284
|
+
readonly CHAT_MESSAGE_DELETE: "chat.message_delete";
|
|
285
|
+
readonly CHAT_MESSAGE_MENU_OPEN: "chat.message_menu_open";
|
|
286
|
+
readonly CHAT_REPORT_REASON_SELECT: "chat.report_reason_select";
|
|
287
|
+
readonly CHAT_SENSITIVE_REVEAL_CONFIRM: "chat.sensitive_reveal_confirm";
|
|
288
|
+
readonly CHAT_ATTACHMENT_RETRY: "chat.attachment_retry";
|
|
289
|
+
readonly CHAT_HISTORY_RECOVER: "chat.history_recover";
|
|
290
|
+
readonly CHAT_MR_ONEHOOK_OPEN: "chat.mr_onehook_open";
|
|
291
|
+
readonly CHAT_MR_ONEHOOK_CLOSE: "chat.mr_onehook_close";
|
|
292
|
+
readonly CHAT_RETRY: "chat.retry";
|
|
293
|
+
readonly CHAT_UNMATCH_CONFIRM: "chat.unmatch_confirm";
|
|
294
|
+
readonly CHAT_PROFILE_CLOSE: "chat.profile_close";
|
|
295
|
+
readonly CHAT_MR_ONEHOOK_CONTEXT_SHARE: "chat.mr_onehook_context_share";
|
|
296
|
+
readonly CHAT_MR_ONEHOOK_SCOPE_OPEN: "chat.mr_onehook_scope_open";
|
|
297
|
+
readonly CHAT_MR_ONEHOOK_SCOPE_SELECT: "chat.mr_onehook_scope_select";
|
|
298
|
+
readonly CHAT_INTRO_TOUR_OPEN: "chat.intro_tour_open";
|
|
299
|
+
readonly CHAT_INTRO_DISMISS: "chat.intro_dismiss";
|
|
300
|
+
readonly CHAT_INTRO_GET_STARTED: "chat.intro_get_started";
|
|
301
|
+
readonly CHAT_HISTORY_RECOVER_METHOD: "chat.history_recover_method";
|
|
302
|
+
readonly CHAT_HISTORY_RECOVER_STEP: "chat.history_recover_step";
|
|
303
|
+
readonly CHAT_HISTORY_RESET_CONFIRM: "chat.history_reset_confirm";
|
|
304
|
+
readonly CHAT_SETTINGS_LAST_SEEN_SELECT: "chat_settings.last_seen_select";
|
|
305
|
+
readonly CHAT_SETTINGS_DISAPPEARING_SELECT: "chat_settings.disappearing_select";
|
|
306
|
+
readonly CHAT_SETTINGS_NOTIFICATION_TOGGLE: "chat_settings.notification_toggle";
|
|
307
|
+
readonly CHAT_SETTINGS_PRIVACY_TOGGLE: "chat_settings.privacy_toggle";
|
|
308
|
+
readonly CHAT_SETTINGS_FONT_SIZE_SELECT: "chat_settings.font_size_select";
|
|
309
|
+
readonly CHAT_SETTINGS_WALLPAPER_SELECT: "chat_settings.wallpaper_select";
|
|
310
|
+
readonly CHAT_SETTINGS_EXPORT_CHAT: "chat_settings.export_chat";
|
|
311
|
+
readonly CHAT_SETTINGS_CLEAR_CACHE: "chat_settings.clear_cache";
|
|
312
|
+
readonly NOTIFICATIONS_ITEM_OPEN: "notifications.item_open";
|
|
313
|
+
readonly NOTIFICATIONS_ITEM_DISMISS: "notifications.item_dismiss";
|
|
314
|
+
readonly PROFILE_EDIT_OPEN: "profile.edit_open";
|
|
315
|
+
readonly PROFILE_PREVIEW_OPEN: "profile.preview_open";
|
|
316
|
+
readonly PROFILE_PREFERENCES_OPEN: "profile.preferences_open";
|
|
317
|
+
readonly PROFILE_SETTINGS_OPEN: "profile.settings_open";
|
|
318
|
+
readonly PROFILE_CHAT_SETTINGS_OPEN: "profile.chat_settings_open";
|
|
319
|
+
readonly PROFILE_CHAT_TOUR_OPEN: "profile.chat_tour_open";
|
|
320
|
+
readonly PROFILE_PHOTO_OPEN: "profile.photo_open";
|
|
321
|
+
readonly PROFILE_VERIFY_IDENTITY: "profile.verify_identity";
|
|
322
|
+
readonly PROFILE_SHARE_INVITE: "profile.share_invite";
|
|
323
|
+
readonly PROFILE_INVITE_CODE_COPY: "profile.invite_code_copy";
|
|
324
|
+
readonly PROFILE_INVITE_CODE_SHARE: "profile.invite_code_share";
|
|
325
|
+
readonly PROFILE_UPGRADE_OPEN: "profile.upgrade_open";
|
|
326
|
+
readonly PROFILE_UNHOOK: "profile.unhook";
|
|
327
|
+
readonly PROFILE_UNHOOK_CONFIRM: "profile.unhook_confirm";
|
|
328
|
+
readonly PROFILE_TAB_SELECT: "profile.tab_select";
|
|
329
|
+
readonly PROFILE_RETRY: "profile.retry";
|
|
330
|
+
readonly PROFILE_VOICE_PLAY: "profile.voice_play";
|
|
331
|
+
readonly PROFILE_EDIT_SAVE: "profile_edit.save";
|
|
332
|
+
readonly PROFILE_EDIT_PREVIEW: "profile_edit.preview";
|
|
333
|
+
readonly PROFILE_EDIT_PHOTO_ADD: "profile_edit.photo_add";
|
|
334
|
+
readonly PROFILE_EDIT_PHOTO_REMOVE: "profile_edit.photo_remove";
|
|
335
|
+
readonly PROFILE_EDIT_PHOTO_REMOVE_CONFIRM: "profile_edit.photo_remove_confirm";
|
|
336
|
+
readonly PROFILE_EDIT_PHOTO_SET_PRIMARY: "profile_edit.photo_set_primary";
|
|
337
|
+
readonly PROFILE_EDIT_PHOTO_ADJUST: "profile_edit.photo_adjust";
|
|
338
|
+
readonly PROFILE_EDIT_PHOTO_REORDER: "profile_edit.photo_reorder";
|
|
339
|
+
readonly PROFILE_EDIT_PROMPT_ADD: "profile_edit.prompt_add";
|
|
340
|
+
readonly PROFILE_EDIT_PROMPT_REMOVE: "profile_edit.prompt_remove";
|
|
341
|
+
readonly PROFILE_EDIT_VOICE_ADD: "profile_edit.voice_add";
|
|
342
|
+
readonly PROFILE_EDIT_VOICE_REMOVE: "profile_edit.voice_remove";
|
|
343
|
+
readonly PROFILE_EDIT_CHOICE_SELECT: "profile_edit.choice_select";
|
|
344
|
+
readonly PREFERENCES_SAVE: "preferences.save";
|
|
345
|
+
readonly PREFERENCES_UPGRADE_OPEN: "preferences.upgrade_open";
|
|
346
|
+
readonly PREFERENCES_LOCKED_FILTER_TAP: "preferences.locked_filter_tap";
|
|
347
|
+
readonly SETTINGS_EMAIL_MANAGE: "settings.email_manage";
|
|
348
|
+
readonly SETTINGS_PHONE_UPDATE: "settings.phone_update";
|
|
349
|
+
readonly SETTINGS_GOOGLE_LINK: "settings.google_link";
|
|
350
|
+
readonly SETTINGS_APPLE_LINK: "settings.apple_link";
|
|
351
|
+
readonly SETTINGS_PASSKEY_ADD: "settings.passkey_add";
|
|
352
|
+
readonly SETTINGS_PASSWORD_SET: "settings.password_set";
|
|
353
|
+
readonly SETTINGS_RECOVERY_SETUP: "settings.recovery_setup";
|
|
354
|
+
readonly SETTINGS_DEVICE_REVOKE: "settings.device_revoke";
|
|
355
|
+
readonly SETTINGS_DEVICE_REVOKE_CONFIRM: "settings.device_revoke_confirm";
|
|
356
|
+
readonly SETTINGS_SAFETY_OPEN: "settings.safety_open";
|
|
357
|
+
readonly SETTINGS_THEME_SELECT: "settings.theme_select";
|
|
358
|
+
readonly SETTINGS_THEME_OPEN: "settings.theme_open";
|
|
359
|
+
readonly SETTINGS_SIGN_OUT: "settings.sign_out";
|
|
360
|
+
readonly SETTINGS_SIGN_OUT_CONFIRM: "settings.sign_out_confirm";
|
|
361
|
+
readonly SETTINGS_DELETE_ACCOUNT_OPEN: "settings.delete_account_open";
|
|
362
|
+
readonly SETTINGS_DELETE_ACCOUNT_CONFIRM: "settings.delete_account_confirm";
|
|
363
|
+
readonly SETTINGS_UNBLOCK_USER: "settings.unblock_user";
|
|
364
|
+
readonly SETTINGS_UNBLOCK_CONFIRM: "settings.unblock_confirm";
|
|
365
|
+
readonly SETTINGS_VERIFY_CODE_SUBMIT: "settings.verify_code_submit";
|
|
366
|
+
readonly SETTINGS_PASSWORD_SET_CONFIRM: "settings.password_set_confirm";
|
|
367
|
+
readonly SETTINGS_HELP_LINK: "settings.help_link";
|
|
368
|
+
readonly SETTINGS_RECOVERY_APPROVE: "settings.recovery_approve";
|
|
369
|
+
readonly SETTINGS_RECOVERY_QR_SAVE: "settings.recovery_qr_save";
|
|
370
|
+
readonly SETTINGS_RECOVERY_QR_SHARE: "settings.recovery_qr_share";
|
|
371
|
+
readonly PAYWALL_PURCHASE: "paywall.purchase";
|
|
372
|
+
readonly PAYWALL_RESTORE: "paywall.restore";
|
|
373
|
+
readonly PAYWALL_FEATURES_EXPAND: "paywall.features_expand";
|
|
374
|
+
readonly PHOTO_VIEWER_CLOSE: "photo_viewer.close";
|
|
375
|
+
readonly PHOTO_VIEWER_PREVIOUS: "photo_viewer.previous";
|
|
376
|
+
readonly PHOTO_VIEWER_NEXT: "photo_viewer.next";
|
|
377
|
+
readonly SEARCH_CLOSE: "search.close";
|
|
378
|
+
readonly SEARCH_QUERY_CLEAR: "search.query_clear";
|
|
379
|
+
readonly SEARCH_FILTER_SELECT: "search.filter_select";
|
|
380
|
+
readonly SEARCH_RESULT_OPEN: "search.result_open";
|
|
381
|
+
readonly CREATE_CLOSE: "create.close";
|
|
382
|
+
readonly CREATE_OPTION_SELECT: "create.option_select";
|
|
383
|
+
readonly SHARED_ALERT_DISMISS: "shared.alert_dismiss";
|
|
384
|
+
readonly SHARED_ERROR_RECOVER: "shared.error_recover";
|
|
385
|
+
readonly SHARED_COUNTRY_CODE_OPEN: "shared.country_code_open";
|
|
386
|
+
readonly SHARED_COUNTRY_CODE_SELECT: "shared.country_code_select";
|
|
387
|
+
readonly SHARED_VOICE_RECORDER: "shared.voice_recorder";
|
|
388
|
+
readonly SHARED_PROMPT_PRESET_SELECT: "shared.prompt_preset_select";
|
|
389
|
+
readonly LIVENESS_BEGIN: "liveness.begin";
|
|
390
|
+
readonly LIVENESS_DISMISS: "liveness.dismiss";
|
|
391
|
+
readonly LIVENESS_RETRY: "liveness.retry";
|
|
392
|
+
readonly LIVENESS_OPEN_SETTINGS: "liveness.open_settings";
|
|
393
|
+
readonly LIVENESS_CLOSE: "liveness.close";
|
|
394
|
+
};
|
|
395
|
+
export type UiElementId = (typeof UiElement)[keyof typeof UiElement];
|
|
396
|
+
export interface UiElementSpec {
|
|
397
|
+
readonly screen: Screen;
|
|
398
|
+
readonly kind: UiElementKind;
|
|
399
|
+
/** Allowed actions; the first is the default. */
|
|
400
|
+
readonly actions: readonly UiAction[];
|
|
401
|
+
/** When non-null, `value` is required and must be one of these. */
|
|
402
|
+
readonly values: readonly string[] | null;
|
|
403
|
+
/** Platforms this element is in scope for (parity contract; see PLATFORM_GAPS in the catalog). */
|
|
404
|
+
readonly platforms: readonly Platform[];
|
|
405
|
+
}
|
|
406
|
+
export declare const UI_ELEMENTS: {
|
|
407
|
+
readonly [K in UiElementId]: UiElementSpec;
|
|
408
|
+
};
|
|
409
|
+
/** UI element ids in scope for `platform` (what its coverage test must find instrumented). */
|
|
410
|
+
export declare function uiElementsForPlatform(platform: Platform): UiElementId[];
|
|
411
|
+
/** The only allowed `telemetry-exempt: <category>: <reason>` categories (see the catalog). */
|
|
412
|
+
export declare const TELEMETRY_EXEMPT_CATEGORIES: readonly ["duplicate", "backdrop", "gesture", "continuous", "disabled"];
|
|
413
|
+
export declare function isUiElementId(v: unknown): v is UiElementId;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// GENERATED from OneHookBackend packages/api-models/model/smithy/common.smithy (SubscriptionTier).
|
|
2
|
+
// DO NOT EDIT. Regenerate: (OneHookBackend) npm run generate && npm run membership:sync
|
|
3
|
+
|
|
4
|
+
package club.onehook.membership
|
|
5
|
+
|
|
6
|
+
/** Backend-owned membership catalogue (wire value, display name, connection ceiling), lowest first. */
|
|
7
|
+
object SubscriptionTierCatalog {
|
|
8
|
+
data class Entry(val wire: String, val displayName: String, val maxConnections: Int)
|
|
9
|
+
|
|
10
|
+
val tiers: List<Entry> = listOf(
|
|
11
|
+
Entry(wire = "MUST", displayName = "Must", maxConnections = 1),
|
|
12
|
+
Entry(wire = "SUPER", displayName = "Super", maxConnections = 1),
|
|
13
|
+
Entry(wire = "INFINITY", displayName = "Infinity", maxConnections = 3),
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
/** The lowest tier wire value — what an unknown tier fails closed to. */
|
|
17
|
+
val defaultWire: String = tiers.first().wire
|
|
18
|
+
|
|
19
|
+
/** Parser: tier name (wire value or display name), case-insensitive + trimmed; null if unknown. */
|
|
20
|
+
fun parse(raw: String?): Entry? {
|
|
21
|
+
val key = raw?.trim()?.uppercase().orEmpty()
|
|
22
|
+
return tiers.firstOrNull { it.wire == key }
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/** Parses [raw], failing closed to the lowest tier (Must). The server alarms on unknown stored tiers. */
|
|
26
|
+
fun resolve(raw: String?): Entry = parse(raw) ?: tiers.first()
|
|
27
|
+
|
|
28
|
+
/** True for any known tier above the lowest tier. */
|
|
29
|
+
fun isPaid(raw: String?): Boolean = parse(raw)?.let { it.wire != defaultWire } ?: false
|
|
30
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// GENERATED from OneHookBackend packages/api-models/model/smithy/common.smithy (SubscriptionTier).
|
|
2
|
+
// DO NOT EDIT. Regenerate: (OneHookBackend) npm run generate && npm run membership:sync
|
|
3
|
+
|
|
4
|
+
import Foundation
|
|
5
|
+
|
|
6
|
+
/// Backend-owned membership catalogue (wire value, display name, connection ceiling), lowest first.
|
|
7
|
+
enum SubscriptionTierCatalog {
|
|
8
|
+
struct Entry: Equatable, Sendable {
|
|
9
|
+
let wire: String
|
|
10
|
+
let displayName: String
|
|
11
|
+
let maxConnections: Int
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
static let tiers: [Entry] = [
|
|
15
|
+
.init(wire: "MUST", displayName: "Must", maxConnections: 1),
|
|
16
|
+
.init(wire: "SUPER", displayName: "Super", maxConnections: 1),
|
|
17
|
+
.init(wire: "INFINITY", displayName: "Infinity", maxConnections: 3),
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
/// The lowest tier wire value — what an unknown tier fails closed to.
|
|
21
|
+
static let defaultWire: String = tiers[0].wire
|
|
22
|
+
|
|
23
|
+
static func entry(wire: String) -> Entry? { tiers.first { $0.wire == wire } }
|
|
24
|
+
|
|
25
|
+
/// Parser: tier name (wire value or display name), case-insensitive + trimmed; nil if unknown.
|
|
26
|
+
/// Callers treat nil as the lowest tier (Must) — the server alarms on unknown stored tiers.
|
|
27
|
+
static func parse(_ raw: String?) -> Entry? {
|
|
28
|
+
guard let key = raw?.trimmingCharacters(in: .whitespacesAndNewlines).uppercased() else { return nil }
|
|
29
|
+
return entry(wire: key)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"source": "club.onehook.common#SubscriptionTier",
|
|
3
|
+
"tiers": [
|
|
4
|
+
{
|
|
5
|
+
"wire": "MUST",
|
|
6
|
+
"displayName": "Must",
|
|
7
|
+
"maxConnections": 1
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
"wire": "SUPER",
|
|
11
|
+
"displayName": "Super",
|
|
12
|
+
"maxConnections": 1
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"wire": "INFINITY",
|
|
16
|
+
"displayName": "Infinity",
|
|
17
|
+
"maxConnections": 3
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
}
|