@sunsteel/contracts 0.84.0 → 0.86.0
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/index.cjs +96 -0
- package/dist/index.d.cts +161 -1
- package/dist/index.d.ts +161 -1
- package/dist/index.js +78 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -52,6 +52,7 @@ __export(index_exports, {
|
|
|
52
52
|
COMEBACK_REQUIRED_ACTIVE_DAYS: () => COMEBACK_REQUIRED_ACTIVE_DAYS,
|
|
53
53
|
COMEBACK_SESSION_LOOKBACK: () => COMEBACK_SESSION_LOOKBACK,
|
|
54
54
|
COMEBACK_WINDOW_DAYS: () => COMEBACK_WINDOW_DAYS,
|
|
55
|
+
CONVERSATIONS_PAGE_SIZE: () => CONVERSATIONS_PAGE_SIZE,
|
|
55
56
|
CUSTOM_EXERCISES_MAX: () => CUSTOM_EXERCISES_MAX,
|
|
56
57
|
CUSTOM_EXERCISE_NAME_MAX: () => CUSTOM_EXERCISE_NAME_MAX,
|
|
57
58
|
CUSTOM_EXERCISE_NOTE_MAX: () => CUSTOM_EXERCISE_NOTE_MAX,
|
|
@@ -60,6 +61,7 @@ __export(index_exports, {
|
|
|
60
61
|
DASHBOARD_SECTION_IDS: () => DASHBOARD_SECTION_IDS,
|
|
61
62
|
DEFAULT_DASHBOARD_LAYOUT: () => DEFAULT_DASHBOARD_LAYOUT,
|
|
62
63
|
DEFAULT_LOCALE: () => DEFAULT_LOCALE,
|
|
64
|
+
DEFAULT_MESSAGE_PERMISSION: () => DEFAULT_MESSAGE_PERMISSION,
|
|
63
65
|
DEFAULT_WEEK_STARTS_ON: () => DEFAULT_WEEK_STARTS_ON,
|
|
64
66
|
DELOAD_DEFAULT_DAYS: () => DELOAD_DEFAULT_DAYS,
|
|
65
67
|
DELOAD_DEFAULT_LOAD_REDUCTION: () => DELOAD_DEFAULT_LOAD_REDUCTION,
|
|
@@ -98,6 +100,10 @@ __export(index_exports, {
|
|
|
98
100
|
MEASURABLE_GOALS_MAX: () => MEASURABLE_GOALS_MAX,
|
|
99
101
|
MEASURABLE_GOAL_DIRECTIONS: () => MEASURABLE_GOAL_DIRECTIONS,
|
|
100
102
|
MEASURABLE_GOAL_TYPES: () => MEASURABLE_GOAL_TYPES,
|
|
103
|
+
MESSAGES_PAGE_SIZE: () => MESSAGES_PAGE_SIZE,
|
|
104
|
+
MESSAGES_PER_MINUTE_MAX: () => MESSAGES_PER_MINUTE_MAX,
|
|
105
|
+
MESSAGE_BODY_MAX: () => MESSAGE_BODY_MAX,
|
|
106
|
+
MESSAGE_PERMISSIONS: () => MESSAGE_PERMISSIONS,
|
|
101
107
|
MINUTES_IN_DAY: () => MINUTES_IN_DAY,
|
|
102
108
|
MODERATION_ACTION_KINDS: () => MODERATION_ACTION_KINDS,
|
|
103
109
|
MODERATION_HISTORY_PAGE_SIZE: () => MODERATION_HISTORY_PAGE_SIZE,
|
|
@@ -105,6 +111,7 @@ __export(index_exports, {
|
|
|
105
111
|
MODERATION_QUEUE_PAGE_SIZE: () => MODERATION_QUEUE_PAGE_SIZE,
|
|
106
112
|
MOVEMENT_PATTERNS: () => MOVEMENT_PATTERNS,
|
|
107
113
|
MUSCLE_GROUPS: () => MUSCLE_GROUPS,
|
|
114
|
+
NEW_CONVERSATIONS_PER_DAY_MAX: () => NEW_CONVERSATIONS_PER_DAY_MAX,
|
|
108
115
|
NOTIFICATIONS_LIST_LIMIT: () => NOTIFICATIONS_LIST_LIMIT,
|
|
109
116
|
NOTIFICATIONS_LOOKBACK_DAYS: () => NOTIFICATIONS_LOOKBACK_DAYS,
|
|
110
117
|
NOTIFICATIONS_PAGE_SIZE: () => NOTIFICATIONS_PAGE_SIZE,
|
|
@@ -134,6 +141,12 @@ __export(index_exports, {
|
|
|
134
141
|
PROGRESS_TIMELINE_EVENT_TYPES: () => PROGRESS_TIMELINE_EVENT_TYPES,
|
|
135
142
|
PUSH_PAYLOAD_KINDS: () => PUSH_PAYLOAD_KINDS,
|
|
136
143
|
PUSH_SUBSCRIPTIONS_MAX: () => PUSH_SUBSCRIPTIONS_MAX,
|
|
144
|
+
REALTIME_HEARTBEAT_MS: () => REALTIME_HEARTBEAT_MS,
|
|
145
|
+
REALTIME_MAX_STREAMS_PER_MEMBER: () => REALTIME_MAX_STREAMS_PER_MEMBER,
|
|
146
|
+
REALTIME_MAX_STREAM_MS: () => REALTIME_MAX_STREAM_MS,
|
|
147
|
+
REALTIME_STREAM_PATH: () => REALTIME_STREAM_PATH,
|
|
148
|
+
REALTIME_TOPICS: () => REALTIME_TOPICS,
|
|
149
|
+
REALTIME_UNAVAILABLE_RETRY_SECONDS: () => REALTIME_UNAVAILABLE_RETRY_SECONDS,
|
|
137
150
|
RECENT_SEARCHES_MAX: () => RECENT_SEARCHES_MAX,
|
|
138
151
|
RECENT_SEARCH_KINDS: () => RECENT_SEARCH_KINDS,
|
|
139
152
|
RELATIONSHIP_LIST_DEFAULT_LIMIT: () => RELATIONSHIP_LIST_DEFAULT_LIMIT,
|
|
@@ -255,17 +268,22 @@ __export(index_exports, {
|
|
|
255
268
|
isDashboardSectionId: () => isDashboardSectionId,
|
|
256
269
|
isDefaultDashboardLayout: () => isDefaultDashboardLayout,
|
|
257
270
|
isGoalSuggestionKey: () => isGoalSuggestionKey,
|
|
271
|
+
isMessagePermission: () => isMessagePermission,
|
|
258
272
|
isOnboardingStepId: () => isOnboardingStepId,
|
|
273
|
+
isRealtimeTopic: () => isRealtimeTopic,
|
|
259
274
|
isSetKind: () => isSetKind,
|
|
260
275
|
isWeekStartsOn: () => isWeekStartsOn,
|
|
261
276
|
isWithinQuietHours: () => isWithinQuietHours,
|
|
262
277
|
latestBodyWeight: () => latestBodyWeight,
|
|
263
278
|
leadWorkingWeight: () => leadWorkingWeight,
|
|
264
279
|
matchesDeletionConfirmation: () => matchesDeletionConfirmation,
|
|
280
|
+
messageBodyLength: () => messageBodyLength,
|
|
265
281
|
normalizeDashboardLayout: () => normalizeDashboardLayout,
|
|
266
282
|
normalizeExerciseLinks: () => normalizeExerciseLinks,
|
|
267
283
|
normalizeExerciseName: () => normalizeExerciseName,
|
|
284
|
+
normalizeMessageBody: () => normalizeMessageBody,
|
|
268
285
|
normalizeSearchQuery: () => normalizeSearchQuery,
|
|
286
|
+
parseRealtimeEvent: () => parseRealtimeEvent,
|
|
269
287
|
primaryEquipment: () => primaryEquipment,
|
|
270
288
|
requiredToFinish: () => requiredToFinish,
|
|
271
289
|
resolveActiveTrainingBlock: () => resolveActiveTrainingBlock,
|
|
@@ -1613,6 +1631,8 @@ var API_ERROR_MESSAGES = {
|
|
|
1613
1631
|
REPORT_NOT_FOUND: "Report not found",
|
|
1614
1632
|
REPORT_SUBJECT_NOT_FOUND: "Subject not found",
|
|
1615
1633
|
REPORTED_CONTENT_GONE: "The reported content no longer exists",
|
|
1634
|
+
CONVERSATION_NOT_FOUND: "Conversation not found",
|
|
1635
|
+
MESSAGE_NOT_FOUND: "Message not found",
|
|
1616
1636
|
SHARE_LINK_NOT_FOUND: "Share link not found",
|
|
1617
1637
|
LINK_NOT_FOUND: "Link not found",
|
|
1618
1638
|
SHARED_SESSION_NOT_FOUND: "Shared session not found",
|
|
@@ -1738,6 +1758,14 @@ var API_ERROR_MESSAGES = {
|
|
|
1738
1758
|
PARTNERS_MAX: "An account can have at most {max} training partners.",
|
|
1739
1759
|
ENCOURAGEMENTS_MAX: "You can send this partner at most {max} encouragements in 24 hours.",
|
|
1740
1760
|
ENCOURAGEMENT_RETRY: "Please retry the encouragement.",
|
|
1761
|
+
// ── Direct messages (MSG-01) ───────────────────────────────────────────
|
|
1762
|
+
MESSAGE_SELF: "You cannot message yourself",
|
|
1763
|
+
MESSAGE_LENGTH: "A message must not be empty and may be at most {max} characters.",
|
|
1764
|
+
MESSAGES_PER_MINUTE: "You can send at most {max} messages a minute.",
|
|
1765
|
+
CONVERSATIONS_PER_DAY: "You can start at most {max} new conversations a day.",
|
|
1766
|
+
MESSAGE_NOT_ADMITTED: "This member is not taking messages from you.",
|
|
1767
|
+
CONVERSATION_CLOSED: "This conversation can no longer receive messages.",
|
|
1768
|
+
MESSAGING_UNAVAILABLE: "Messaging is not available for this account.",
|
|
1741
1769
|
// ── Account and settings ───────────────────────────────────────────────
|
|
1742
1770
|
ACCOUNT_CONFLICT: "Account conflict for this email",
|
|
1743
1771
|
ACCOUNT_DELETE_CONFIRMATION: "Type your username exactly as it appears to confirm.",
|
|
@@ -1787,6 +1815,56 @@ function normalizeSearchQuery(raw) {
|
|
|
1787
1815
|
}
|
|
1788
1816
|
var RECENT_SEARCHES_MAX = 10;
|
|
1789
1817
|
var RECENT_SEARCH_KINDS = ["MEMBER", "EXERCISE", "ROUTINE", "WORKOUT"];
|
|
1818
|
+
|
|
1819
|
+
// src/realtime.ts
|
|
1820
|
+
var REALTIME_STREAM_PATH = "/realtime/stream";
|
|
1821
|
+
var REALTIME_TOPICS = ["notifications", "conversations"];
|
|
1822
|
+
var REALTIME_HEARTBEAT_MS = 25e3;
|
|
1823
|
+
var REALTIME_MAX_STREAM_MS = 14 * 6e4;
|
|
1824
|
+
var REALTIME_MAX_STREAMS_PER_MEMBER = 5;
|
|
1825
|
+
var REALTIME_UNAVAILABLE_RETRY_SECONDS = 300;
|
|
1826
|
+
function isRealtimeTopic(value) {
|
|
1827
|
+
return REALTIME_TOPICS.includes(value);
|
|
1828
|
+
}
|
|
1829
|
+
function parseRealtimeEvent(data) {
|
|
1830
|
+
let value;
|
|
1831
|
+
try {
|
|
1832
|
+
value = JSON.parse(data);
|
|
1833
|
+
} catch {
|
|
1834
|
+
return null;
|
|
1835
|
+
}
|
|
1836
|
+
if (typeof value !== "object" || value === null) return null;
|
|
1837
|
+
const event = value;
|
|
1838
|
+
if (event.type === "changed" && isRealtimeTopic(event.topic)) {
|
|
1839
|
+
return { type: "changed", topic: event.topic };
|
|
1840
|
+
}
|
|
1841
|
+
if (event.type === "ready" && Array.isArray(event.topics)) {
|
|
1842
|
+
return { type: "ready", topics: event.topics.filter(isRealtimeTopic) };
|
|
1843
|
+
}
|
|
1844
|
+
return null;
|
|
1845
|
+
}
|
|
1846
|
+
|
|
1847
|
+
// src/messages.ts
|
|
1848
|
+
var MESSAGE_PERMISSIONS = ["FOLLOWED", "NOBODY"];
|
|
1849
|
+
var DEFAULT_MESSAGE_PERMISSION = "FOLLOWED";
|
|
1850
|
+
var MESSAGE_BODY_MAX = 2e3;
|
|
1851
|
+
var MESSAGES_PER_MINUTE_MAX = 30;
|
|
1852
|
+
var NEW_CONVERSATIONS_PER_DAY_MAX = 20;
|
|
1853
|
+
var CONVERSATIONS_PAGE_SIZE = 20;
|
|
1854
|
+
var MESSAGES_PAGE_SIZE = 30;
|
|
1855
|
+
function messageBodyLength(body) {
|
|
1856
|
+
return Array.from(body).length;
|
|
1857
|
+
}
|
|
1858
|
+
function normalizeMessageBody(body) {
|
|
1859
|
+
const text = body.replace(/\r\n?/g, "\n").trim();
|
|
1860
|
+
if (text.length === 0 || messageBodyLength(text) > MESSAGE_BODY_MAX) {
|
|
1861
|
+
return null;
|
|
1862
|
+
}
|
|
1863
|
+
return text;
|
|
1864
|
+
}
|
|
1865
|
+
function isMessagePermission(value) {
|
|
1866
|
+
return MESSAGE_PERMISSIONS.includes(value);
|
|
1867
|
+
}
|
|
1790
1868
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1791
1869
|
0 && (module.exports = {
|
|
1792
1870
|
ACCOUNT_EXPORT_FORMAT,
|
|
@@ -1821,6 +1899,7 @@ var RECENT_SEARCH_KINDS = ["MEMBER", "EXERCISE", "ROUTINE", "WORKOUT"];
|
|
|
1821
1899
|
COMEBACK_REQUIRED_ACTIVE_DAYS,
|
|
1822
1900
|
COMEBACK_SESSION_LOOKBACK,
|
|
1823
1901
|
COMEBACK_WINDOW_DAYS,
|
|
1902
|
+
CONVERSATIONS_PAGE_SIZE,
|
|
1824
1903
|
CUSTOM_EXERCISES_MAX,
|
|
1825
1904
|
CUSTOM_EXERCISE_NAME_MAX,
|
|
1826
1905
|
CUSTOM_EXERCISE_NOTE_MAX,
|
|
@@ -1829,6 +1908,7 @@ var RECENT_SEARCH_KINDS = ["MEMBER", "EXERCISE", "ROUTINE", "WORKOUT"];
|
|
|
1829
1908
|
DASHBOARD_SECTION_IDS,
|
|
1830
1909
|
DEFAULT_DASHBOARD_LAYOUT,
|
|
1831
1910
|
DEFAULT_LOCALE,
|
|
1911
|
+
DEFAULT_MESSAGE_PERMISSION,
|
|
1832
1912
|
DEFAULT_WEEK_STARTS_ON,
|
|
1833
1913
|
DELOAD_DEFAULT_DAYS,
|
|
1834
1914
|
DELOAD_DEFAULT_LOAD_REDUCTION,
|
|
@@ -1867,6 +1947,10 @@ var RECENT_SEARCH_KINDS = ["MEMBER", "EXERCISE", "ROUTINE", "WORKOUT"];
|
|
|
1867
1947
|
MEASURABLE_GOALS_MAX,
|
|
1868
1948
|
MEASURABLE_GOAL_DIRECTIONS,
|
|
1869
1949
|
MEASURABLE_GOAL_TYPES,
|
|
1950
|
+
MESSAGES_PAGE_SIZE,
|
|
1951
|
+
MESSAGES_PER_MINUTE_MAX,
|
|
1952
|
+
MESSAGE_BODY_MAX,
|
|
1953
|
+
MESSAGE_PERMISSIONS,
|
|
1870
1954
|
MINUTES_IN_DAY,
|
|
1871
1955
|
MODERATION_ACTION_KINDS,
|
|
1872
1956
|
MODERATION_HISTORY_PAGE_SIZE,
|
|
@@ -1874,6 +1958,7 @@ var RECENT_SEARCH_KINDS = ["MEMBER", "EXERCISE", "ROUTINE", "WORKOUT"];
|
|
|
1874
1958
|
MODERATION_QUEUE_PAGE_SIZE,
|
|
1875
1959
|
MOVEMENT_PATTERNS,
|
|
1876
1960
|
MUSCLE_GROUPS,
|
|
1961
|
+
NEW_CONVERSATIONS_PER_DAY_MAX,
|
|
1877
1962
|
NOTIFICATIONS_LIST_LIMIT,
|
|
1878
1963
|
NOTIFICATIONS_LOOKBACK_DAYS,
|
|
1879
1964
|
NOTIFICATIONS_PAGE_SIZE,
|
|
@@ -1903,6 +1988,12 @@ var RECENT_SEARCH_KINDS = ["MEMBER", "EXERCISE", "ROUTINE", "WORKOUT"];
|
|
|
1903
1988
|
PROGRESS_TIMELINE_EVENT_TYPES,
|
|
1904
1989
|
PUSH_PAYLOAD_KINDS,
|
|
1905
1990
|
PUSH_SUBSCRIPTIONS_MAX,
|
|
1991
|
+
REALTIME_HEARTBEAT_MS,
|
|
1992
|
+
REALTIME_MAX_STREAMS_PER_MEMBER,
|
|
1993
|
+
REALTIME_MAX_STREAM_MS,
|
|
1994
|
+
REALTIME_STREAM_PATH,
|
|
1995
|
+
REALTIME_TOPICS,
|
|
1996
|
+
REALTIME_UNAVAILABLE_RETRY_SECONDS,
|
|
1906
1997
|
RECENT_SEARCHES_MAX,
|
|
1907
1998
|
RECENT_SEARCH_KINDS,
|
|
1908
1999
|
RELATIONSHIP_LIST_DEFAULT_LIMIT,
|
|
@@ -2024,17 +2115,22 @@ var RECENT_SEARCH_KINDS = ["MEMBER", "EXERCISE", "ROUTINE", "WORKOUT"];
|
|
|
2024
2115
|
isDashboardSectionId,
|
|
2025
2116
|
isDefaultDashboardLayout,
|
|
2026
2117
|
isGoalSuggestionKey,
|
|
2118
|
+
isMessagePermission,
|
|
2027
2119
|
isOnboardingStepId,
|
|
2120
|
+
isRealtimeTopic,
|
|
2028
2121
|
isSetKind,
|
|
2029
2122
|
isWeekStartsOn,
|
|
2030
2123
|
isWithinQuietHours,
|
|
2031
2124
|
latestBodyWeight,
|
|
2032
2125
|
leadWorkingWeight,
|
|
2033
2126
|
matchesDeletionConfirmation,
|
|
2127
|
+
messageBodyLength,
|
|
2034
2128
|
normalizeDashboardLayout,
|
|
2035
2129
|
normalizeExerciseLinks,
|
|
2036
2130
|
normalizeExerciseName,
|
|
2131
|
+
normalizeMessageBody,
|
|
2037
2132
|
normalizeSearchQuery,
|
|
2133
|
+
parseRealtimeEvent,
|
|
2038
2134
|
primaryEquipment,
|
|
2039
2135
|
requiredToFinish,
|
|
2040
2136
|
resolveActiveTrainingBlock,
|
package/dist/index.d.cts
CHANGED
|
@@ -75,6 +75,101 @@ interface UpdateLocaleRequest {
|
|
|
75
75
|
locale: AppLocale | null;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Who may start a conversation with a member. `FOLLOWED`: members they follow.
|
|
80
|
+
* `MSG-02` adds `EVERYONE` (as requests).
|
|
81
|
+
*/
|
|
82
|
+
declare const MESSAGE_PERMISSIONS: readonly ["FOLLOWED", "NOBODY"];
|
|
83
|
+
type MessagePermission = (typeof MESSAGE_PERMISSIONS)[number];
|
|
84
|
+
declare const DEFAULT_MESSAGE_PERMISSION: MessagePermission;
|
|
85
|
+
/** Characters in one message, counted as code points. */
|
|
86
|
+
declare const MESSAGE_BODY_MAX = 2000;
|
|
87
|
+
/** Messages one member may send in a rolling minute. */
|
|
88
|
+
declare const MESSAGES_PER_MINUTE_MAX = 30;
|
|
89
|
+
/** Conversations one member may start in a rolling day. */
|
|
90
|
+
declare const NEW_CONVERSATIONS_PER_DAY_MAX = 20;
|
|
91
|
+
declare const CONVERSATIONS_PAGE_SIZE = 20;
|
|
92
|
+
declare const MESSAGES_PAGE_SIZE = 30;
|
|
93
|
+
/** Length as a reader counts it: an emoji is one character, not two. */
|
|
94
|
+
declare function messageBodyLength(body: string): number;
|
|
95
|
+
/**
|
|
96
|
+
* The stored form of a typed message: line endings made `\n` and the ends
|
|
97
|
+
* trimmed, the lines in between kept as written. Null when it is empty or too
|
|
98
|
+
* long -- it is refused rather than cut, because a message clipped mid-sentence
|
|
99
|
+
* would misrepresent its author.
|
|
100
|
+
*/
|
|
101
|
+
declare function normalizeMessageBody(body: string): string | null;
|
|
102
|
+
/** The other participant, or null once their account was deleted. */
|
|
103
|
+
interface ConversationMember {
|
|
104
|
+
id: string;
|
|
105
|
+
username: string;
|
|
106
|
+
name: string;
|
|
107
|
+
avatarUrl: string | null;
|
|
108
|
+
}
|
|
109
|
+
interface ConversationMessage {
|
|
110
|
+
id: string;
|
|
111
|
+
sentByMe: boolean;
|
|
112
|
+
/** Null once its author deleted it; the place stays as "Message deleted". */
|
|
113
|
+
body: string | null;
|
|
114
|
+
deleted: boolean;
|
|
115
|
+
createdAt: IsoDateString;
|
|
116
|
+
}
|
|
117
|
+
interface ConversationSummary {
|
|
118
|
+
id: string;
|
|
119
|
+
/** Null when the other member deleted their account ("Deleted member"). */
|
|
120
|
+
counterpart: ConversationMember | null;
|
|
121
|
+
/** The newest message the viewer can see, or null when there is none. */
|
|
122
|
+
lastMessage: ConversationMessage | null;
|
|
123
|
+
lastMessageAt: IsoDateString | null;
|
|
124
|
+
/**
|
|
125
|
+
* Whether the viewer may write in it now. False when the other member's
|
|
126
|
+
* account is gone, or the viewer's own messaging is unavailable.
|
|
127
|
+
*/
|
|
128
|
+
canSend: boolean;
|
|
129
|
+
}
|
|
130
|
+
/** GET /conversations, newest activity first. */
|
|
131
|
+
interface ConversationsResponse {
|
|
132
|
+
conversations: ConversationSummary[];
|
|
133
|
+
nextCursor: string | null;
|
|
134
|
+
}
|
|
135
|
+
/** GET /conversations/:id/messages, newest first; `cursor` pages older. */
|
|
136
|
+
interface ConversationMessagesResponse {
|
|
137
|
+
conversation: ConversationSummary;
|
|
138
|
+
messages: ConversationMessage[];
|
|
139
|
+
nextCursor: string | null;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* POST /conversations. Starts a conversation with its first message, so an
|
|
143
|
+
* empty conversation never exists; when one with this member already exists
|
|
144
|
+
* the message is sent there instead. `recipient` is a username or an id.
|
|
145
|
+
*/
|
|
146
|
+
interface StartConversationRequest {
|
|
147
|
+
recipient: string;
|
|
148
|
+
body: string;
|
|
149
|
+
}
|
|
150
|
+
/** POST /conversations/:id/messages. */
|
|
151
|
+
interface SendMessageRequest {
|
|
152
|
+
body: string;
|
|
153
|
+
}
|
|
154
|
+
interface SendMessageResponse {
|
|
155
|
+
conversation: ConversationSummary;
|
|
156
|
+
message: ConversationMessage;
|
|
157
|
+
}
|
|
158
|
+
/** PUT /users/preferences/messages. */
|
|
159
|
+
interface UpdateMessagePermissionRequest {
|
|
160
|
+
messagePermission: MessagePermission;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* On the authenticated member profile only: whether the viewer may start a
|
|
164
|
+
* conversation, and the one they already have. The server decides; a viewer
|
|
165
|
+
* who may not is told nothing more.
|
|
166
|
+
*/
|
|
167
|
+
interface MemberMessagingState {
|
|
168
|
+
canStart: boolean;
|
|
169
|
+
conversationId: string | null;
|
|
170
|
+
}
|
|
171
|
+
declare function isMessagePermission(value: unknown): value is MessagePermission;
|
|
172
|
+
|
|
78
173
|
/** A step id as the registry names it: lowercase words joined by hyphens. */
|
|
79
174
|
declare const ONBOARDING_STEP_ID_PATTERN_SOURCE = "^[a-z][a-z0-9-]{0,39}$";
|
|
80
175
|
declare const ONBOARDING_STEPS_MAX = 30;
|
|
@@ -2034,6 +2129,8 @@ interface UserProfile {
|
|
|
2034
2129
|
weekStartsOn?: WeekStartsOn;
|
|
2035
2130
|
/** ONBOARD-01: how far the account has come through onboarding. */
|
|
2036
2131
|
onboarding?: OnboardingState;
|
|
2132
|
+
/** MSG-01: who may start a conversation with this member. */
|
|
2133
|
+
messagePermission?: MessagePermission;
|
|
2037
2134
|
/** PREF-04: how lengths are shown; a missing one is centimetres. */
|
|
2038
2135
|
lengthUnit?: LengthUnit;
|
|
2039
2136
|
followerCount: number;
|
|
@@ -2072,6 +2169,11 @@ interface PublicUserProfile {
|
|
|
2072
2169
|
* allows it; null while their analytics are not ready.
|
|
2073
2170
|
*/
|
|
2074
2171
|
rank?: RenaissanceRankDefinition | null;
|
|
2172
|
+
/**
|
|
2173
|
+
* MSG-01: on the authenticated read only, whether the viewer may start a
|
|
2174
|
+
* conversation with this member and the one they already share.
|
|
2175
|
+
*/
|
|
2176
|
+
messaging?: MemberMessagingState;
|
|
2075
2177
|
}
|
|
2076
2178
|
interface UpdateProfileRequest {
|
|
2077
2179
|
username?: string;
|
|
@@ -4080,6 +4182,17 @@ interface AccountExportV1 {
|
|
|
4080
4182
|
reaction: string;
|
|
4081
4183
|
createdAt: IsoDateString;
|
|
4082
4184
|
}>;
|
|
4185
|
+
/**
|
|
4186
|
+
* MSG-01: the messages the member wrote and has not deleted, each with
|
|
4187
|
+
* the member it was sent to (null once that account was deleted). Messages
|
|
4188
|
+
* written to them belong to their authors and are not included.
|
|
4189
|
+
*/
|
|
4190
|
+
messagesSent?: Array<{
|
|
4191
|
+
to: AccountExportMember | null;
|
|
4192
|
+
conversationId: string;
|
|
4193
|
+
body: string;
|
|
4194
|
+
createdAt: IsoDateString;
|
|
4195
|
+
}>;
|
|
4083
4196
|
reportsFiled: Array<{
|
|
4084
4197
|
subjectKind: string;
|
|
4085
4198
|
reason: string;
|
|
@@ -4131,6 +4244,8 @@ declare const API_ERROR_MESSAGES: {
|
|
|
4131
4244
|
readonly REPORT_NOT_FOUND: "Report not found";
|
|
4132
4245
|
readonly REPORT_SUBJECT_NOT_FOUND: "Subject not found";
|
|
4133
4246
|
readonly REPORTED_CONTENT_GONE: "The reported content no longer exists";
|
|
4247
|
+
readonly CONVERSATION_NOT_FOUND: "Conversation not found";
|
|
4248
|
+
readonly MESSAGE_NOT_FOUND: "Message not found";
|
|
4134
4249
|
readonly SHARE_LINK_NOT_FOUND: "Share link not found";
|
|
4135
4250
|
readonly LINK_NOT_FOUND: "Link not found";
|
|
4136
4251
|
readonly SHARED_SESSION_NOT_FOUND: "Shared session not found";
|
|
@@ -4244,6 +4359,13 @@ declare const API_ERROR_MESSAGES: {
|
|
|
4244
4359
|
readonly PARTNERS_MAX: "An account can have at most {max} training partners.";
|
|
4245
4360
|
readonly ENCOURAGEMENTS_MAX: "You can send this partner at most {max} encouragements in 24 hours.";
|
|
4246
4361
|
readonly ENCOURAGEMENT_RETRY: "Please retry the encouragement.";
|
|
4362
|
+
readonly MESSAGE_SELF: "You cannot message yourself";
|
|
4363
|
+
readonly MESSAGE_LENGTH: "A message must not be empty and may be at most {max} characters.";
|
|
4364
|
+
readonly MESSAGES_PER_MINUTE: "You can send at most {max} messages a minute.";
|
|
4365
|
+
readonly CONVERSATIONS_PER_DAY: "You can start at most {max} new conversations a day.";
|
|
4366
|
+
readonly MESSAGE_NOT_ADMITTED: "This member is not taking messages from you.";
|
|
4367
|
+
readonly CONVERSATION_CLOSED: "This conversation can no longer receive messages.";
|
|
4368
|
+
readonly MESSAGING_UNAVAILABLE: "Messaging is not available for this account.";
|
|
4247
4369
|
readonly ACCOUNT_CONFLICT: "Account conflict for this email";
|
|
4248
4370
|
readonly ACCOUNT_DELETE_CONFIRMATION: "Type your username exactly as it appears to confirm.";
|
|
4249
4371
|
readonly ACCOUNT_DELETE_MODERATOR: "A moderator account cannot be deleted while it holds moderator access.";
|
|
@@ -4387,4 +4509,42 @@ interface RecentSearchesResponse {
|
|
|
4387
4509
|
items: RecentSearchItem[];
|
|
4388
4510
|
}
|
|
4389
4511
|
|
|
4390
|
-
export { ACCOUNT_EXPORT_FORMAT, ACCOUNT_EXPORT_VERSION, ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, ACTIVITY_CAPS, ACTIVITY_COMMENTS_PAGE_SIZE, ACTIVITY_COMMENTS_PER_DAY_MAX, ACTIVITY_COMMENT_MAX_LENGTH, ACTIVITY_DEFAULT_AUDIENCE, ACTIVITY_ENTRY_ID_MAX_LENGTH, ACTIVITY_FEED_FOLLOWED_MAX, ACTIVITY_PAGE_DEFAULT_LIMIT, ACTIVITY_PAGE_MAX_LIMIT, ACTIVITY_PREVIEW_AUDIENCES, ACTIVITY_REACTIONS, ACTIVITY_TYPES, ACTIVITY_TYPE_SECTIONS, API_ERROR_CODES, API_ERROR_MESSAGES, type AccountExportBodyMeasurement, type AccountExportGoal, type AccountExportMember, type AccountExportPersonalRecord, type AccountExportRoutine, type AccountExportScheduleOverride, type AccountExportTrainingEvent, type AccountExportTrainingLocation, type AccountExportV1, type AchievementActivity, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type ActivityAudience, type ActivityCap, type ActivityComment, type ActivityCommentNotification, type ActivityCommentSummary, type ActivityCommentsQuery, type ActivityCommentsResponse, type ActivityEntry, type ActivityEntrySharing, type ActivityFeedResponse, type ActivityLink, type ActivityPage, type ActivityPageQuery, type ActivityPreviewAudience, type ActivityPreviewQuery, type ActivityReaction, type ActivityReactionSummary, type ActivitySection, type ActivitySharingSettings, type ActivityType, type ApiErrorBody, type ApiErrorCode, type ApiErrorParams, type AppLocale, type AppNotification, BAR_CHOICES_KG, BAR_WARM_UP_STEPS, BLOCKED_MEMBERS_MAX, BODY_MEASUREMENT_FIELDS, BODY_MEASUREMENT_FIELD_KEYS, BODY_PROGRESS_RANGES, type BlockComparisonLift, type BlockComparisonLiftBest, type BlockComparisonPeriod, type BlockComparisonPeriodKind, type BlockedMember, type BlockedMembersResponse, type BodyFieldSummary, type BodyMeasurement, type BodyMeasurementField, type BodyMeasurementProblem, type BodyMeasurementValues, type BodyProgressRange, type BodyProgressResponse, type Brand, CLONE_ROUTINE_REFUSALS, CM_PER_INCH, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, CUSTOM_EXERCISES_MAX, CUSTOM_EXERCISE_NAME_MAX, CUSTOM_EXERCISE_NOTE_MAX, CUSTOM_EXERCISE_PROBLEM_MESSAGES, CUSTOM_EXERCISE_REFUSALS, type CalendarDate, type CloneRoutineRefusal, type CloneRoutineRequest, type ComebackActivity, type ComebackRecognition, type ComebackRecognitionSummary, type CorrectSessionRequest, type CorrectSessionResponse, type CorrectSessionSetRequest, type CreateActivityCommentRequest, type CreateActivityCommentResponse, type CreateDeloadRequest, type CreateReportRequest, type CreateReportResponse, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateRoutineVersionRequest, type CreateSessionShareRequest, type CustomExerciseInput, type CustomExerciseProblem, type CustomExerciseRefusal, DASHBOARD_SECTION_IDS, DEFAULT_DASHBOARD_LAYOUT, DEFAULT_LOCALE, DEFAULT_WEEK_STARTS_ON, DELOAD_DEFAULT_DAYS, DELOAD_DEFAULT_LOAD_REDUCTION, DELOAD_DEFAULT_SET_MODE, DELOAD_LOAD_REDUCTIONS, DELOAD_MAX_DAYS, DELOAD_NOT_LIGHTER, DELOAD_SET_MODES, DELOAD_SUGGESTION_COOLDOWN_DAYS, DELOAD_SUGGESTION_EARLIER_DAYS, DELOAD_SUGGESTION_MIN_MARKED_TODAY, DELOAD_SUGGESTION_ROUTINE_DAYS, DELOAD_SUGGESTION_SIGNALS, type DashboardLayout, type DashboardLayoutEntry, type DashboardSectionId, type DeclineSignal, type DecliningLift, type DecliningLiftSession, type DeleteAccountRequest, type DeleteAccountResponse, type DeleteActivityCommentResponse, type DeletePushSubscriptionRequest, type DeloadLoadReduction, type DeloadOptions, type DeloadSetMode, type DeloadSuggestion, type DeloadSuggestionEvidence, type DeloadSuggestionResponse, type DeloadSuggestionSignal, type DeloadSuggestionUnavailableReason, type DiscoverableRoutine, type DismissGoalSuggestionRequest, EXERCISE_EQUIPMENT, EXERCISE_GROUP_KIND_LABELS, EXERCISE_GROUP_MAX, EXERCISE_MECHANICS, type EarnedAchievement, type EarnedPersonalRecord, type EffortPeriod, type EffortSignal, type Exercise, type ExerciseEquipment, type ExerciseGroup, type ExerciseGroupKind, type ExerciseGroupPosition, type ExerciseId, type ExerciseMechanic, type ExercisePerformanceHistoryQuery, type ExercisePerformanceHistoryResponse, type ExercisePerformancePrescription, type ExercisePerformancePrescriptionSet, type ExercisePerformanceSession, type ExercisePerformanceSet, type ExercisePerformanceSummary, type ExercisePlateau, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FEATURED_PROFILE_ITEMS_MAX, FEATURED_PROFILE_ITEM_KINDS, FEATURED_PROFILE_REFERENCE_MAX_LENGTH, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FeaturedProfileAchievementItem, type FeaturedProfileItem, type FeaturedProfileItemKind, type FeaturedProfileRankItem, type FeaturedProfileRecordItem, type FeaturedProfileRoutineItem, type FeaturedProfileSelection, type FeaturedProfileSelectionInput, type FeaturedProfileSelectionsResponse, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, GOAL_SUGGESTIONS_MAX, GOAL_SUGGESTION_DISMISSALS_MAX, GOAL_SUGGESTION_LIFT_MIN_SESSIONS, GOAL_SUGGESTION_LIFT_WINDOW_DAYS, GOAL_SUGGESTION_MIN_ACTIVE_WEEKS, GOAL_SUGGESTION_STRENGTH_STEP, GOAL_SUGGESTION_TYPES, GOAL_SUGGESTION_VOLUME_WEEKS, type GoalSuggestion, type GoalSuggestionBasis, type GoalSuggestionType, type GoalSuggestionsResponse, INCHES_PER_FOOT, type IsoDateString, LENGTH_UNITS, LIMITED_SHORTFALL_KG, type LengthUnit, type ListSessionsParams, MAX_SETS_PER_EXERCISE, MEASURABLE_GOALS_MAX, MEASURABLE_GOAL_DIRECTIONS, MEASURABLE_GOAL_TYPES, MINUTES_IN_DAY, MODERATION_ACTION_KINDS, MODERATION_HISTORY_PAGE_SIZE, MODERATION_NOTE_MAX_LENGTH, MODERATION_QUEUE_PAGE_SIZE, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MarkNotificationsReadRequest, type MarkNotificationsReadResponse, type MeasurableGoal, type MeasurableGoalDirection, type MeasurableGoalExercise, type MeasurableGoalInput, type MeasurableGoalType, type MemberActivityResponse, type MemberModerationState, type MemberRoutinesResponse, type MemberSearchPage, type ModerationActionKind, type ModerationActionRecord, type ModerationHistoryQuery, type ModerationHistoryResponse, type ModerationQueueQuery, type ModerationQueueResponse, type ModerationReport, type ModeratorState, type MoveOccurrenceRequest, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, NOTIFICATIONS_LIST_LIMIT, NOTIFICATIONS_LOOKBACK_DAYS, NOTIFICATIONS_PAGE_SIZE, NOTIFICATIONS_PAGE_SIZE_MAX, NOTIFICATIONS_RETENTION_DAYS, NOTIFICATION_CATEGORIES, NOTIFICATION_KINDS, type NewFollowerNotification, type NotificationCategory, type NotificationKind, type NotificationPreferences, type NotificationPreferencesResponse, type NotificationsQuery, type NotificationsResponse, ONBOARDING_STEPS_MAX, ONBOARDING_STEP_ID_PATTERN_SOURCE, ONBOARDING_VERSION_MAX, OTHER_WARM_UP_STEPS, type OnboardingState, type OwnActivityEntry, type OwnActivityResponse, PLATEAU_MIN_DAYS_SINCE_BEST, PLATEAU_MIN_SESSIONS, PLATEAU_MIN_SESSIONS_MAX, PLATEAU_MIN_SESSIONS_MIN, PLATEAU_RECENT_DAYS, PLATEAU_WINDOW_DAYS, PLATE_SETS, PREFERRED_TRAINING_STYLE_VALUES, PROFILE_BIO_MAX_LENGTH, PROFILE_FAVORITE_EXERCISES_MAX, PROFILE_LOCATION_MAX_LENGTH, PROFILE_TRAINING_DISCIPLINES_MAX, PROFILE_TRAINING_GOALS_MAX, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, PROGRESS_TIMELINE_EVENT_TYPES, PUSH_PAYLOAD_KINDS, PUSH_SUBSCRIPTIONS_MAX, type PaginatedResponse, type PersonalGoalProgress, type PersonalGoalsResponse, type PersonalRecordActivity, type PersonalRecordEntry, type PersonalRecordKind, type PlannedReminder, type PlateLoadingItem, type PlateLoadingResult, type PlatePairInventory, type PlateSetChoice, type PlateauPreferences, type PlateauSet, type PlateausResponse, type PreferredTrainingStyle, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfileDiscoverySettings, type ProfileFavoriteExercise, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressTimelineEventType, type ProgressTimelineItem, type ProgressTimelinePersonalRecordItem, type ProgressTimelineProgressionItem, type ProgressTimelineQuery, type ProgressTimelineRecordPerformance, type ProgressTimelineRecordReason, type ProgressTimelineResponse, type ProgressTimelineSessionContext, type ProgressionActivity, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicProfileAchievements, type PublicTrainingSummary, type PublicUserProfile, type PushPayload, type PushPayloadKind, type PushSubscriptionKeys, type PushSubscriptionSummary, type PushSubscriptionsResponse, type QuietHours, RECENT_SEARCHES_MAX, RECENT_SEARCH_KINDS, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, RENAISSANCE_RANK_DEFINITIONS, REPORTS_PER_DAY_MAX, REPORT_DETAILS_MAX_LENGTH, REPORT_REASONS, REPORT_STATUSES, REPORT_SUBJECT_KINDS, REP_TYPES, RESERVED_USERNAMES, REST_ALERT_MAX_LEAD_SECONDS, REST_ALERT_MIN_LEAD_SECONDS, REST_ALERT_REFUSALS, ROUTINE_DAYS_MAX, ROUTINE_DAY_NAME_MAX, ROUTINE_DISCOVERY_DEFAULT_LIMIT, ROUTINE_DISCOVERY_MAX_LIMIT, ROUTINE_DISCOVERY_SCAN_LIMIT, ROUTINE_DURATION_BANDS, ROUTINE_DURATION_BAND_MAX_MINUTES, ROUTINE_SCHEDULE_MODES, ROUTINE_SHARE_MAX_ACTIVE_LINKS, ROUTINE_TRAINING_BLOCKS_MAX, ROUTINE_TRAINING_BLOCK_NAME_MAX, ROUTINE_TRAINING_BLOCK_REVISIONS_MAX, ROUTINE_TRAINING_BLOCK_SOURCE_KINDS, ROUTINE_TRAINING_BLOCK_STATES, ROUTINE_VERSIONS_MAX, ROUTINE_VERSION_KINDS, ROUTINE_VERSION_NAME_MAX, ROUTINE_VISIBILITY_VALUES, type RecentActivityEntry, type RecentExercise, type RecentRoutine, type RecentSearchItem, type RecentSearchKind, type RecentSearchesResponse, type RecordRecentSearchRequest, type RegisterPushSubscriptionRequest, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RenaissanceRankDefinition, type RenaissanceRankProgress, type RepTargetPeriod, type RepTargetSignal, type RepType, type ReplaceFeaturedProfileItemsRequest, type ReplaceMeasurableGoalsRequest, type ReplaceTrainingLocationsRequest, type ReportReason, type ReportStatus, type ReportSubjectKind, type ReportSubjectPreview, type ResolvedRoutinePlan, type RestAlertPushPayload, type RestAlertRefusal, type RestoreRoutineVersionResponse, type ReviewReportRequest, type ReviewReportResponse, type Routine, type RoutineClassification, type RoutineDay, type RoutineDayId, type RoutineDiscoveryQuery, type RoutineDiscoveryResponse, type RoutineDurationBand, type RoutineExercise, type RoutineFacets, type RoutineId, type RoutineLineage, type RoutinePlanSource, type RoutineScheduleMode, type RoutineSearchPage, type RoutineSet, type RoutineShare, type RoutineShareListResponse, type RoutineSharedActivity, type RoutineTemporaryOverride, type RoutineTemporaryOverridePlan, type RoutineTemporaryOverridesResponse, type RoutineTrainingBlock, type RoutineTrainingBlockPlan, type RoutineTrainingBlockRevision, type RoutineTrainingBlockRevisionsResponse, type RoutineTrainingBlockSource, type RoutineTrainingBlockSourceKind, type RoutineTrainingBlockState, type RoutineTrainingBlocksResponse, type RoutineVersion, type RoutineVersionDay, type RoutineVersionExercise, type RoutineVersionKind, type RoutineVersionSetup, type RoutineVersionsResponse, type RoutineVisibility, SCHEDULE_MOVE_MAX_DAYS, SCHEDULE_OVERRIDES_MAX_RANGE_DAYS, SCHEDULE_OVERRIDE_KINDS, SCHEDULE_SKIP_PAST_DAYS, SEARCH_PAGE_SIZE, SEARCH_PAGE_SIZE_MAX, SEARCH_PREVIEW_LIMIT, SEARCH_QUERY_MAX_LENGTH, SEARCH_QUERY_MIN_LENGTH, SEARCH_SERVER_CATEGORIES, SESSION_CORRECTIONS_MAX, SESSION_CORRECTION_LIMITS, SESSION_CORRECTION_WINDOW_HOURS, SESSION_EXERCISE_NOTE_MAX_LENGTH, SESSION_NOTE_MAX_LENGTH, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SET_KINDS, SET_KIND_LABELS, SEXES, SHARED_ROUTINE_SOURCES, STARRED_EXERCISES_MAX, STREAK_MAX_GAP_DAYS, SUPPORTED_LOCALES, type ScheduleOverride, type ScheduleOverrideKind, type ScheduleOverridesQuery, type ScheduleOverridesResponse, type ScheduleRestAlertRequest, type ScheduleRestAlertResponse, type SearchPage, type SearchPageQuery, type SearchPreviewQuery, type SearchPreviewResponse, type SearchServerCategory, type SendTrainingPartnerEncouragementRequest, type SendTrainingPartnerEncouragementResponse, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionCompletedActivity, type SessionCorrection, type SessionCorrectionClosedReason, type SessionCorrectionWindow, type SessionCorrectionsResponse, type SessionExerciseNote, type SessionExerciseSubstitution, type SessionProgressNotification, type SessionRecapExerciseNote, type SessionRecapRecord, type SessionSetCorrection, type SessionShare, type SessionShareField, type SessionShareListResponse, type SessionTemporaryOverride, type SessionTrainingBlock, type SetAccountTimeZoneRequest, type SetActivityEntryAudienceRequest, type SetActivityEntryAudienceResponse, type SetActivityReactionRequest, type SetActivityReactionResponse, type SetKind, type SetLog, type SetLogValues, type Sex, type SharedRoutine, type SharedRoutineOwner, type SharedRoutineSearchResult, type SharedRoutineSource, type SharedRoutineSummary, type SharedSessionOwner, type SharedSessionRecap, type SkipOccurrenceRequest, type StarredExercise, type StarredExercisesResponse, type StartWorkoutRequest, type StartWorkoutResponse, type StreakAtRiskPushPayload, type StreakMilestoneActivity, type StreakMilestoneEventPayload, type SubstituteSessionExerciseRequest, type SubstituteSessionExerciseResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TEMPORARY_OVERRIDE_KINDS, TEMPORARY_OVERRIDE_SOURCE_KINDS, TRAINING_BLOCK_COMPARISON_MAX_DAYS, TRAINING_DISCIPLINE_VALUES, TRAINING_EVENT_TYPES, TRAINING_EXPERIENCE_LEVEL_VALUES, TRAINING_GOAL_VALUES, TRAINING_PARTNERSHIP_STATUSES, TRAINING_PARTNERS_MAX, TRAINING_PARTNER_ENCOURAGEMENTS_PER_24_HOURS_MAX, TRAINING_PARTNER_ENCOURAGEMENT_KINDS, TRAINING_PARTNER_PERMISSION_KEYS, TRAINING_PARTNER_REQUESTS_PER_DAY_MAX, TRAINING_SIGNAL_DECLINES_MAX, TRAINING_SIGNAL_DECLINE_SESSIONS, TRAINING_SIGNAL_MIN_DECLINE, TRAINING_SIGNAL_MIN_RPE_SETS, TRAINING_SIGNAL_MIN_SHORT_SETS, TRAINING_SIGNAL_MIN_TARGET_SETS, TRAINING_SIGNAL_PERIOD_DAYS, TRAINING_SIGNAL_RPE_RISE, TRAINING_SIGNAL_SHORT_LIFTS_MAX, TRAINING_SIGNAL_SHORT_POINTS_RISE, TRAINING_SIGNAL_WORKOUT_DROP, type TemporaryOverrideKind, type TemporaryOverrideSource, type TemporaryOverrideSourceKind, type TrainingBlockComparisonResponse, type TrainingDiscipline, type TrainingEventType, type TrainingExperienceLevel, type TrainingGoal, type TrainingIdentity, type TrainingLocationPreference, type TrainingLocationPreferenceInput, type TrainingPartnerAchievementNotification, type TrainingPartnerAchievementPushPayload, type TrainingPartnerEncouragementKind, type TrainingPartnerEncouragementNotification, type TrainingPartnerPermissions, type TrainingPartnerScheduleDay, type TrainingPartnerScheduleResponse, type TrainingPartnerSessionNotification, type TrainingPartnerSessionPushPayload, type TrainingPartnership, type TrainingPartnershipStatus, type TrainingPartnershipsResponse, type TrainingReminderPreference, type TrainingReminderPushPayload, type TrainingSignalPeriod, type TrainingSignalsResponse, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateActivitySharingRequest, type UpdateCustomExerciseRequest, type UpdateDashboardLayoutRequest, type UpdateLocaleRequest, type UpdateNotificationPreferencesRequest, type UpdateOnboardingRequest, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpdateRoutineVisibilityRequest, type UpdateSessionNotesRequest, type UpdateSessionNotesResponse, type UpdateTrainingPartnerPermissionsRequest, type UpdateWeekStartRequest, type UpsertBodyMeasurementRequest, type UpsertRoutineTrainingBlockRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, type VolumeTrendPoint, type VolumeTrendQuery, type VolumeTrendResponse, type VolumeTrendSeries, WEEK_STARTS, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WarmUpEquipment, type WarmUpLoad, type WarmUpRamp, type WarmUpSet, type WarmUpStep, type WeekStartsOn, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutPeriod, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSearchPage, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionRecap, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutSignal, type WorkoutStatsQuery, type WorkoutStatsResponse, accountExportFileName, apiError, apiErrorMessage, applyDeload, bodyMeasurementProblems, bodyProgressRangeStart, buildWarmUpRamp, calculatePlateLoading, canLinkToNext, cmToFeetInches, cmToInches, countsAsWork, countsForProgression, customExerciseProblem, defaultWarmUpEquipment, deloadLengthDays, exerciseGroupLabel, exerciseGroupPosition, exerciseGroups, exerciseNameKey, feetInchesToCm, followWorkingLoad, goalSuggestionKey, hasOversizedGroup, inchesToCm, isApiErrorCode, isAppLocale, isBarLoaded, isBodyMeasurementDate, isDashboardSectionId, isDefaultDashboardLayout, isGoalSuggestionKey, isOnboardingStepId, isSetKind, isWeekStartsOn, isWithinQuietHours, latestBodyWeight, leadWorkingWeight, matchesDeletionConfirmation, normalizeDashboardLayout, normalizeExerciseLinks, normalizeExerciseName, normalizeSearchQuery, primaryEquipment, requiredToFinish, resolveActiveTrainingBlock, resolveRoutinePlan, routineDayLabel, sessionCorrectionWindow, setKindOf, setLogValuesDiffer, summarizeBodyProgress, trainingBlockCovers, warmUpLoad, weekStartOf };
|
|
4512
|
+
/** GET, with the usual bearer token. */
|
|
4513
|
+
declare const REALTIME_STREAM_PATH = "/realtime/stream";
|
|
4514
|
+
/**
|
|
4515
|
+
* What a signal can say is out of date. `conversations` (MSG-01): the
|
|
4516
|
+
* member's conversation list and the messages of each.
|
|
4517
|
+
*/
|
|
4518
|
+
declare const REALTIME_TOPICS: readonly ["notifications", "conversations"];
|
|
4519
|
+
type RealtimeTopic = (typeof REALTIME_TOPICS)[number];
|
|
4520
|
+
type RealtimeEvent =
|
|
4521
|
+
/** Sent first on every stream: re-read these topics once. */
|
|
4522
|
+
{
|
|
4523
|
+
type: "ready";
|
|
4524
|
+
topics: RealtimeTopic[];
|
|
4525
|
+
}
|
|
4526
|
+
/** Reads under this topic are out of date. */
|
|
4527
|
+
| {
|
|
4528
|
+
type: "changed";
|
|
4529
|
+
topic: RealtimeTopic;
|
|
4530
|
+
};
|
|
4531
|
+
/** A comment line the server writes so the proxies never see an idle stream. */
|
|
4532
|
+
declare const REALTIME_HEARTBEAT_MS = 25000;
|
|
4533
|
+
/**
|
|
4534
|
+
* The server ends a stream after this long, or when its access token expires,
|
|
4535
|
+
* whichever comes first, and the client reconnects at once with a fresh
|
|
4536
|
+
* token. Railway closes a plain HTTP request after 15 minutes.
|
|
4537
|
+
*/
|
|
4538
|
+
declare const REALTIME_MAX_STREAM_MS: number;
|
|
4539
|
+
/** Open streams per member; opening another closes the oldest. */
|
|
4540
|
+
declare const REALTIME_MAX_STREAMS_PER_MEMBER = 5;
|
|
4541
|
+
/**
|
|
4542
|
+
* When the stream is switched off on the server it answers 503 with this
|
|
4543
|
+
* `Retry-After`, in seconds, and the client polls in the meantime.
|
|
4544
|
+
*/
|
|
4545
|
+
declare const REALTIME_UNAVAILABLE_RETRY_SECONDS = 300;
|
|
4546
|
+
declare function isRealtimeTopic(value: unknown): value is RealtimeTopic;
|
|
4547
|
+
/** The event in one `data:` payload, or null for anything else. */
|
|
4548
|
+
declare function parseRealtimeEvent(data: string): RealtimeEvent | null;
|
|
4549
|
+
|
|
4550
|
+
export { ACCOUNT_EXPORT_FORMAT, ACCOUNT_EXPORT_VERSION, ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, ACTIVITY_CAPS, ACTIVITY_COMMENTS_PAGE_SIZE, ACTIVITY_COMMENTS_PER_DAY_MAX, ACTIVITY_COMMENT_MAX_LENGTH, ACTIVITY_DEFAULT_AUDIENCE, ACTIVITY_ENTRY_ID_MAX_LENGTH, ACTIVITY_FEED_FOLLOWED_MAX, ACTIVITY_PAGE_DEFAULT_LIMIT, ACTIVITY_PAGE_MAX_LIMIT, ACTIVITY_PREVIEW_AUDIENCES, ACTIVITY_REACTIONS, ACTIVITY_TYPES, ACTIVITY_TYPE_SECTIONS, API_ERROR_CODES, API_ERROR_MESSAGES, type AccountExportBodyMeasurement, type AccountExportGoal, type AccountExportMember, type AccountExportPersonalRecord, type AccountExportRoutine, type AccountExportScheduleOverride, type AccountExportTrainingEvent, type AccountExportTrainingLocation, type AccountExportV1, type AchievementActivity, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type ActivityAudience, type ActivityCap, type ActivityComment, type ActivityCommentNotification, type ActivityCommentSummary, type ActivityCommentsQuery, type ActivityCommentsResponse, type ActivityEntry, type ActivityEntrySharing, type ActivityFeedResponse, type ActivityLink, type ActivityPage, type ActivityPageQuery, type ActivityPreviewAudience, type ActivityPreviewQuery, type ActivityReaction, type ActivityReactionSummary, type ActivitySection, type ActivitySharingSettings, type ActivityType, type ApiErrorBody, type ApiErrorCode, type ApiErrorParams, type AppLocale, type AppNotification, BAR_CHOICES_KG, BAR_WARM_UP_STEPS, BLOCKED_MEMBERS_MAX, BODY_MEASUREMENT_FIELDS, BODY_MEASUREMENT_FIELD_KEYS, BODY_PROGRESS_RANGES, type BlockComparisonLift, type BlockComparisonLiftBest, type BlockComparisonPeriod, type BlockComparisonPeriodKind, type BlockedMember, type BlockedMembersResponse, type BodyFieldSummary, type BodyMeasurement, type BodyMeasurementField, type BodyMeasurementProblem, type BodyMeasurementValues, type BodyProgressRange, type BodyProgressResponse, type Brand, CLONE_ROUTINE_REFUSALS, CM_PER_INCH, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, CONVERSATIONS_PAGE_SIZE, CUSTOM_EXERCISES_MAX, CUSTOM_EXERCISE_NAME_MAX, CUSTOM_EXERCISE_NOTE_MAX, CUSTOM_EXERCISE_PROBLEM_MESSAGES, CUSTOM_EXERCISE_REFUSALS, type CalendarDate, type CloneRoutineRefusal, type CloneRoutineRequest, type ComebackActivity, type ComebackRecognition, type ComebackRecognitionSummary, type ConversationMember, type ConversationMessage, type ConversationMessagesResponse, type ConversationSummary, type ConversationsResponse, type CorrectSessionRequest, type CorrectSessionResponse, type CorrectSessionSetRequest, type CreateActivityCommentRequest, type CreateActivityCommentResponse, type CreateDeloadRequest, type CreateReportRequest, type CreateReportResponse, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateRoutineVersionRequest, type CreateSessionShareRequest, type CustomExerciseInput, type CustomExerciseProblem, type CustomExerciseRefusal, DASHBOARD_SECTION_IDS, DEFAULT_DASHBOARD_LAYOUT, DEFAULT_LOCALE, DEFAULT_MESSAGE_PERMISSION, DEFAULT_WEEK_STARTS_ON, DELOAD_DEFAULT_DAYS, DELOAD_DEFAULT_LOAD_REDUCTION, DELOAD_DEFAULT_SET_MODE, DELOAD_LOAD_REDUCTIONS, DELOAD_MAX_DAYS, DELOAD_NOT_LIGHTER, DELOAD_SET_MODES, DELOAD_SUGGESTION_COOLDOWN_DAYS, DELOAD_SUGGESTION_EARLIER_DAYS, DELOAD_SUGGESTION_MIN_MARKED_TODAY, DELOAD_SUGGESTION_ROUTINE_DAYS, DELOAD_SUGGESTION_SIGNALS, type DashboardLayout, type DashboardLayoutEntry, type DashboardSectionId, type DeclineSignal, type DecliningLift, type DecliningLiftSession, type DeleteAccountRequest, type DeleteAccountResponse, type DeleteActivityCommentResponse, type DeletePushSubscriptionRequest, type DeloadLoadReduction, type DeloadOptions, type DeloadSetMode, type DeloadSuggestion, type DeloadSuggestionEvidence, type DeloadSuggestionResponse, type DeloadSuggestionSignal, type DeloadSuggestionUnavailableReason, type DiscoverableRoutine, type DismissGoalSuggestionRequest, EXERCISE_EQUIPMENT, EXERCISE_GROUP_KIND_LABELS, EXERCISE_GROUP_MAX, EXERCISE_MECHANICS, type EarnedAchievement, type EarnedPersonalRecord, type EffortPeriod, type EffortSignal, type Exercise, type ExerciseEquipment, type ExerciseGroup, type ExerciseGroupKind, type ExerciseGroupPosition, type ExerciseId, type ExerciseMechanic, type ExercisePerformanceHistoryQuery, type ExercisePerformanceHistoryResponse, type ExercisePerformancePrescription, type ExercisePerformancePrescriptionSet, type ExercisePerformanceSession, type ExercisePerformanceSet, type ExercisePerformanceSummary, type ExercisePlateau, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FEATURED_PROFILE_ITEMS_MAX, FEATURED_PROFILE_ITEM_KINDS, FEATURED_PROFILE_REFERENCE_MAX_LENGTH, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FeaturedProfileAchievementItem, type FeaturedProfileItem, type FeaturedProfileItemKind, type FeaturedProfileRankItem, type FeaturedProfileRecordItem, type FeaturedProfileRoutineItem, type FeaturedProfileSelection, type FeaturedProfileSelectionInput, type FeaturedProfileSelectionsResponse, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, GOAL_SUGGESTIONS_MAX, GOAL_SUGGESTION_DISMISSALS_MAX, GOAL_SUGGESTION_LIFT_MIN_SESSIONS, GOAL_SUGGESTION_LIFT_WINDOW_DAYS, GOAL_SUGGESTION_MIN_ACTIVE_WEEKS, GOAL_SUGGESTION_STRENGTH_STEP, GOAL_SUGGESTION_TYPES, GOAL_SUGGESTION_VOLUME_WEEKS, type GoalSuggestion, type GoalSuggestionBasis, type GoalSuggestionType, type GoalSuggestionsResponse, INCHES_PER_FOOT, type IsoDateString, LENGTH_UNITS, LIMITED_SHORTFALL_KG, type LengthUnit, type ListSessionsParams, MAX_SETS_PER_EXERCISE, MEASURABLE_GOALS_MAX, MEASURABLE_GOAL_DIRECTIONS, MEASURABLE_GOAL_TYPES, MESSAGES_PAGE_SIZE, MESSAGES_PER_MINUTE_MAX, MESSAGE_BODY_MAX, MESSAGE_PERMISSIONS, MINUTES_IN_DAY, MODERATION_ACTION_KINDS, MODERATION_HISTORY_PAGE_SIZE, MODERATION_NOTE_MAX_LENGTH, MODERATION_QUEUE_PAGE_SIZE, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MarkNotificationsReadRequest, type MarkNotificationsReadResponse, type MeasurableGoal, type MeasurableGoalDirection, type MeasurableGoalExercise, type MeasurableGoalInput, type MeasurableGoalType, type MemberActivityResponse, type MemberMessagingState, type MemberModerationState, type MemberRoutinesResponse, type MemberSearchPage, type MessagePermission, type ModerationActionKind, type ModerationActionRecord, type ModerationHistoryQuery, type ModerationHistoryResponse, type ModerationQueueQuery, type ModerationQueueResponse, type ModerationReport, type ModeratorState, type MoveOccurrenceRequest, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, NEW_CONVERSATIONS_PER_DAY_MAX, NOTIFICATIONS_LIST_LIMIT, NOTIFICATIONS_LOOKBACK_DAYS, NOTIFICATIONS_PAGE_SIZE, NOTIFICATIONS_PAGE_SIZE_MAX, NOTIFICATIONS_RETENTION_DAYS, NOTIFICATION_CATEGORIES, NOTIFICATION_KINDS, type NewFollowerNotification, type NotificationCategory, type NotificationKind, type NotificationPreferences, type NotificationPreferencesResponse, type NotificationsQuery, type NotificationsResponse, ONBOARDING_STEPS_MAX, ONBOARDING_STEP_ID_PATTERN_SOURCE, ONBOARDING_VERSION_MAX, OTHER_WARM_UP_STEPS, type OnboardingState, type OwnActivityEntry, type OwnActivityResponse, PLATEAU_MIN_DAYS_SINCE_BEST, PLATEAU_MIN_SESSIONS, PLATEAU_MIN_SESSIONS_MAX, PLATEAU_MIN_SESSIONS_MIN, PLATEAU_RECENT_DAYS, PLATEAU_WINDOW_DAYS, PLATE_SETS, PREFERRED_TRAINING_STYLE_VALUES, PROFILE_BIO_MAX_LENGTH, PROFILE_FAVORITE_EXERCISES_MAX, PROFILE_LOCATION_MAX_LENGTH, PROFILE_TRAINING_DISCIPLINES_MAX, PROFILE_TRAINING_GOALS_MAX, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, PROGRESS_TIMELINE_EVENT_TYPES, PUSH_PAYLOAD_KINDS, PUSH_SUBSCRIPTIONS_MAX, type PaginatedResponse, type PersonalGoalProgress, type PersonalGoalsResponse, type PersonalRecordActivity, type PersonalRecordEntry, type PersonalRecordKind, type PlannedReminder, type PlateLoadingItem, type PlateLoadingResult, type PlatePairInventory, type PlateSetChoice, type PlateauPreferences, type PlateauSet, type PlateausResponse, type PreferredTrainingStyle, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfileDiscoverySettings, type ProfileFavoriteExercise, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressTimelineEventType, type ProgressTimelineItem, type ProgressTimelinePersonalRecordItem, type ProgressTimelineProgressionItem, type ProgressTimelineQuery, type ProgressTimelineRecordPerformance, type ProgressTimelineRecordReason, type ProgressTimelineResponse, type ProgressTimelineSessionContext, type ProgressionActivity, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicProfileAchievements, type PublicTrainingSummary, type PublicUserProfile, type PushPayload, type PushPayloadKind, type PushSubscriptionKeys, type PushSubscriptionSummary, type PushSubscriptionsResponse, type QuietHours, REALTIME_HEARTBEAT_MS, REALTIME_MAX_STREAMS_PER_MEMBER, REALTIME_MAX_STREAM_MS, REALTIME_STREAM_PATH, REALTIME_TOPICS, REALTIME_UNAVAILABLE_RETRY_SECONDS, RECENT_SEARCHES_MAX, RECENT_SEARCH_KINDS, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, RENAISSANCE_RANK_DEFINITIONS, REPORTS_PER_DAY_MAX, REPORT_DETAILS_MAX_LENGTH, REPORT_REASONS, REPORT_STATUSES, REPORT_SUBJECT_KINDS, REP_TYPES, RESERVED_USERNAMES, REST_ALERT_MAX_LEAD_SECONDS, REST_ALERT_MIN_LEAD_SECONDS, REST_ALERT_REFUSALS, ROUTINE_DAYS_MAX, ROUTINE_DAY_NAME_MAX, ROUTINE_DISCOVERY_DEFAULT_LIMIT, ROUTINE_DISCOVERY_MAX_LIMIT, ROUTINE_DISCOVERY_SCAN_LIMIT, ROUTINE_DURATION_BANDS, ROUTINE_DURATION_BAND_MAX_MINUTES, ROUTINE_SCHEDULE_MODES, ROUTINE_SHARE_MAX_ACTIVE_LINKS, ROUTINE_TRAINING_BLOCKS_MAX, ROUTINE_TRAINING_BLOCK_NAME_MAX, ROUTINE_TRAINING_BLOCK_REVISIONS_MAX, ROUTINE_TRAINING_BLOCK_SOURCE_KINDS, ROUTINE_TRAINING_BLOCK_STATES, ROUTINE_VERSIONS_MAX, ROUTINE_VERSION_KINDS, ROUTINE_VERSION_NAME_MAX, ROUTINE_VISIBILITY_VALUES, type RealtimeEvent, type RealtimeTopic, type RecentActivityEntry, type RecentExercise, type RecentRoutine, type RecentSearchItem, type RecentSearchKind, type RecentSearchesResponse, type RecordRecentSearchRequest, type RegisterPushSubscriptionRequest, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RenaissanceRankDefinition, type RenaissanceRankProgress, type RepTargetPeriod, type RepTargetSignal, type RepType, type ReplaceFeaturedProfileItemsRequest, type ReplaceMeasurableGoalsRequest, type ReplaceTrainingLocationsRequest, type ReportReason, type ReportStatus, type ReportSubjectKind, type ReportSubjectPreview, type ResolvedRoutinePlan, type RestAlertPushPayload, type RestAlertRefusal, type RestoreRoutineVersionResponse, type ReviewReportRequest, type ReviewReportResponse, type Routine, type RoutineClassification, type RoutineDay, type RoutineDayId, type RoutineDiscoveryQuery, type RoutineDiscoveryResponse, type RoutineDurationBand, type RoutineExercise, type RoutineFacets, type RoutineId, type RoutineLineage, type RoutinePlanSource, type RoutineScheduleMode, type RoutineSearchPage, type RoutineSet, type RoutineShare, type RoutineShareListResponse, type RoutineSharedActivity, type RoutineTemporaryOverride, type RoutineTemporaryOverridePlan, type RoutineTemporaryOverridesResponse, type RoutineTrainingBlock, type RoutineTrainingBlockPlan, type RoutineTrainingBlockRevision, type RoutineTrainingBlockRevisionsResponse, type RoutineTrainingBlockSource, type RoutineTrainingBlockSourceKind, type RoutineTrainingBlockState, type RoutineTrainingBlocksResponse, type RoutineVersion, type RoutineVersionDay, type RoutineVersionExercise, type RoutineVersionKind, type RoutineVersionSetup, type RoutineVersionsResponse, type RoutineVisibility, SCHEDULE_MOVE_MAX_DAYS, SCHEDULE_OVERRIDES_MAX_RANGE_DAYS, SCHEDULE_OVERRIDE_KINDS, SCHEDULE_SKIP_PAST_DAYS, SEARCH_PAGE_SIZE, SEARCH_PAGE_SIZE_MAX, SEARCH_PREVIEW_LIMIT, SEARCH_QUERY_MAX_LENGTH, SEARCH_QUERY_MIN_LENGTH, SEARCH_SERVER_CATEGORIES, SESSION_CORRECTIONS_MAX, SESSION_CORRECTION_LIMITS, SESSION_CORRECTION_WINDOW_HOURS, SESSION_EXERCISE_NOTE_MAX_LENGTH, SESSION_NOTE_MAX_LENGTH, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SET_KINDS, SET_KIND_LABELS, SEXES, SHARED_ROUTINE_SOURCES, STARRED_EXERCISES_MAX, STREAK_MAX_GAP_DAYS, SUPPORTED_LOCALES, type ScheduleOverride, type ScheduleOverrideKind, type ScheduleOverridesQuery, type ScheduleOverridesResponse, type ScheduleRestAlertRequest, type ScheduleRestAlertResponse, type SearchPage, type SearchPageQuery, type SearchPreviewQuery, type SearchPreviewResponse, type SearchServerCategory, type SendMessageRequest, type SendMessageResponse, type SendTrainingPartnerEncouragementRequest, type SendTrainingPartnerEncouragementResponse, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionCompletedActivity, type SessionCorrection, type SessionCorrectionClosedReason, type SessionCorrectionWindow, type SessionCorrectionsResponse, type SessionExerciseNote, type SessionExerciseSubstitution, type SessionProgressNotification, type SessionRecapExerciseNote, type SessionRecapRecord, type SessionSetCorrection, type SessionShare, type SessionShareField, type SessionShareListResponse, type SessionTemporaryOverride, type SessionTrainingBlock, type SetAccountTimeZoneRequest, type SetActivityEntryAudienceRequest, type SetActivityEntryAudienceResponse, type SetActivityReactionRequest, type SetActivityReactionResponse, type SetKind, type SetLog, type SetLogValues, type Sex, type SharedRoutine, type SharedRoutineOwner, type SharedRoutineSearchResult, type SharedRoutineSource, type SharedRoutineSummary, type SharedSessionOwner, type SharedSessionRecap, type SkipOccurrenceRequest, type StarredExercise, type StarredExercisesResponse, type StartConversationRequest, type StartWorkoutRequest, type StartWorkoutResponse, type StreakAtRiskPushPayload, type StreakMilestoneActivity, type StreakMilestoneEventPayload, type SubstituteSessionExerciseRequest, type SubstituteSessionExerciseResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TEMPORARY_OVERRIDE_KINDS, TEMPORARY_OVERRIDE_SOURCE_KINDS, TRAINING_BLOCK_COMPARISON_MAX_DAYS, TRAINING_DISCIPLINE_VALUES, TRAINING_EVENT_TYPES, TRAINING_EXPERIENCE_LEVEL_VALUES, TRAINING_GOAL_VALUES, TRAINING_PARTNERSHIP_STATUSES, TRAINING_PARTNERS_MAX, TRAINING_PARTNER_ENCOURAGEMENTS_PER_24_HOURS_MAX, TRAINING_PARTNER_ENCOURAGEMENT_KINDS, TRAINING_PARTNER_PERMISSION_KEYS, TRAINING_PARTNER_REQUESTS_PER_DAY_MAX, TRAINING_SIGNAL_DECLINES_MAX, TRAINING_SIGNAL_DECLINE_SESSIONS, TRAINING_SIGNAL_MIN_DECLINE, TRAINING_SIGNAL_MIN_RPE_SETS, TRAINING_SIGNAL_MIN_SHORT_SETS, TRAINING_SIGNAL_MIN_TARGET_SETS, TRAINING_SIGNAL_PERIOD_DAYS, TRAINING_SIGNAL_RPE_RISE, TRAINING_SIGNAL_SHORT_LIFTS_MAX, TRAINING_SIGNAL_SHORT_POINTS_RISE, TRAINING_SIGNAL_WORKOUT_DROP, type TemporaryOverrideKind, type TemporaryOverrideSource, type TemporaryOverrideSourceKind, type TrainingBlockComparisonResponse, type TrainingDiscipline, type TrainingEventType, type TrainingExperienceLevel, type TrainingGoal, type TrainingIdentity, type TrainingLocationPreference, type TrainingLocationPreferenceInput, type TrainingPartnerAchievementNotification, type TrainingPartnerAchievementPushPayload, type TrainingPartnerEncouragementKind, type TrainingPartnerEncouragementNotification, type TrainingPartnerPermissions, type TrainingPartnerScheduleDay, type TrainingPartnerScheduleResponse, type TrainingPartnerSessionNotification, type TrainingPartnerSessionPushPayload, type TrainingPartnership, type TrainingPartnershipStatus, type TrainingPartnershipsResponse, type TrainingReminderPreference, type TrainingReminderPushPayload, type TrainingSignalPeriod, type TrainingSignalsResponse, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateActivitySharingRequest, type UpdateCustomExerciseRequest, type UpdateDashboardLayoutRequest, type UpdateLocaleRequest, type UpdateMessagePermissionRequest, type UpdateNotificationPreferencesRequest, type UpdateOnboardingRequest, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpdateRoutineVisibilityRequest, type UpdateSessionNotesRequest, type UpdateSessionNotesResponse, type UpdateTrainingPartnerPermissionsRequest, type UpdateWeekStartRequest, type UpsertBodyMeasurementRequest, type UpsertRoutineTrainingBlockRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, type VolumeTrendPoint, type VolumeTrendQuery, type VolumeTrendResponse, type VolumeTrendSeries, WEEK_STARTS, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WarmUpEquipment, type WarmUpLoad, type WarmUpRamp, type WarmUpSet, type WarmUpStep, type WeekStartsOn, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutPeriod, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSearchPage, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionRecap, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutSignal, type WorkoutStatsQuery, type WorkoutStatsResponse, accountExportFileName, apiError, apiErrorMessage, applyDeload, bodyMeasurementProblems, bodyProgressRangeStart, buildWarmUpRamp, calculatePlateLoading, canLinkToNext, cmToFeetInches, cmToInches, countsAsWork, countsForProgression, customExerciseProblem, defaultWarmUpEquipment, deloadLengthDays, exerciseGroupLabel, exerciseGroupPosition, exerciseGroups, exerciseNameKey, feetInchesToCm, followWorkingLoad, goalSuggestionKey, hasOversizedGroup, inchesToCm, isApiErrorCode, isAppLocale, isBarLoaded, isBodyMeasurementDate, isDashboardSectionId, isDefaultDashboardLayout, isGoalSuggestionKey, isMessagePermission, isOnboardingStepId, isRealtimeTopic, isSetKind, isWeekStartsOn, isWithinQuietHours, latestBodyWeight, leadWorkingWeight, matchesDeletionConfirmation, messageBodyLength, normalizeDashboardLayout, normalizeExerciseLinks, normalizeExerciseName, normalizeMessageBody, normalizeSearchQuery, parseRealtimeEvent, primaryEquipment, requiredToFinish, resolveActiveTrainingBlock, resolveRoutinePlan, routineDayLabel, sessionCorrectionWindow, setKindOf, setLogValuesDiffer, summarizeBodyProgress, trainingBlockCovers, warmUpLoad, weekStartOf };
|
package/dist/index.d.ts
CHANGED
|
@@ -75,6 +75,101 @@ interface UpdateLocaleRequest {
|
|
|
75
75
|
locale: AppLocale | null;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Who may start a conversation with a member. `FOLLOWED`: members they follow.
|
|
80
|
+
* `MSG-02` adds `EVERYONE` (as requests).
|
|
81
|
+
*/
|
|
82
|
+
declare const MESSAGE_PERMISSIONS: readonly ["FOLLOWED", "NOBODY"];
|
|
83
|
+
type MessagePermission = (typeof MESSAGE_PERMISSIONS)[number];
|
|
84
|
+
declare const DEFAULT_MESSAGE_PERMISSION: MessagePermission;
|
|
85
|
+
/** Characters in one message, counted as code points. */
|
|
86
|
+
declare const MESSAGE_BODY_MAX = 2000;
|
|
87
|
+
/** Messages one member may send in a rolling minute. */
|
|
88
|
+
declare const MESSAGES_PER_MINUTE_MAX = 30;
|
|
89
|
+
/** Conversations one member may start in a rolling day. */
|
|
90
|
+
declare const NEW_CONVERSATIONS_PER_DAY_MAX = 20;
|
|
91
|
+
declare const CONVERSATIONS_PAGE_SIZE = 20;
|
|
92
|
+
declare const MESSAGES_PAGE_SIZE = 30;
|
|
93
|
+
/** Length as a reader counts it: an emoji is one character, not two. */
|
|
94
|
+
declare function messageBodyLength(body: string): number;
|
|
95
|
+
/**
|
|
96
|
+
* The stored form of a typed message: line endings made `\n` and the ends
|
|
97
|
+
* trimmed, the lines in between kept as written. Null when it is empty or too
|
|
98
|
+
* long -- it is refused rather than cut, because a message clipped mid-sentence
|
|
99
|
+
* would misrepresent its author.
|
|
100
|
+
*/
|
|
101
|
+
declare function normalizeMessageBody(body: string): string | null;
|
|
102
|
+
/** The other participant, or null once their account was deleted. */
|
|
103
|
+
interface ConversationMember {
|
|
104
|
+
id: string;
|
|
105
|
+
username: string;
|
|
106
|
+
name: string;
|
|
107
|
+
avatarUrl: string | null;
|
|
108
|
+
}
|
|
109
|
+
interface ConversationMessage {
|
|
110
|
+
id: string;
|
|
111
|
+
sentByMe: boolean;
|
|
112
|
+
/** Null once its author deleted it; the place stays as "Message deleted". */
|
|
113
|
+
body: string | null;
|
|
114
|
+
deleted: boolean;
|
|
115
|
+
createdAt: IsoDateString;
|
|
116
|
+
}
|
|
117
|
+
interface ConversationSummary {
|
|
118
|
+
id: string;
|
|
119
|
+
/** Null when the other member deleted their account ("Deleted member"). */
|
|
120
|
+
counterpart: ConversationMember | null;
|
|
121
|
+
/** The newest message the viewer can see, or null when there is none. */
|
|
122
|
+
lastMessage: ConversationMessage | null;
|
|
123
|
+
lastMessageAt: IsoDateString | null;
|
|
124
|
+
/**
|
|
125
|
+
* Whether the viewer may write in it now. False when the other member's
|
|
126
|
+
* account is gone, or the viewer's own messaging is unavailable.
|
|
127
|
+
*/
|
|
128
|
+
canSend: boolean;
|
|
129
|
+
}
|
|
130
|
+
/** GET /conversations, newest activity first. */
|
|
131
|
+
interface ConversationsResponse {
|
|
132
|
+
conversations: ConversationSummary[];
|
|
133
|
+
nextCursor: string | null;
|
|
134
|
+
}
|
|
135
|
+
/** GET /conversations/:id/messages, newest first; `cursor` pages older. */
|
|
136
|
+
interface ConversationMessagesResponse {
|
|
137
|
+
conversation: ConversationSummary;
|
|
138
|
+
messages: ConversationMessage[];
|
|
139
|
+
nextCursor: string | null;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* POST /conversations. Starts a conversation with its first message, so an
|
|
143
|
+
* empty conversation never exists; when one with this member already exists
|
|
144
|
+
* the message is sent there instead. `recipient` is a username or an id.
|
|
145
|
+
*/
|
|
146
|
+
interface StartConversationRequest {
|
|
147
|
+
recipient: string;
|
|
148
|
+
body: string;
|
|
149
|
+
}
|
|
150
|
+
/** POST /conversations/:id/messages. */
|
|
151
|
+
interface SendMessageRequest {
|
|
152
|
+
body: string;
|
|
153
|
+
}
|
|
154
|
+
interface SendMessageResponse {
|
|
155
|
+
conversation: ConversationSummary;
|
|
156
|
+
message: ConversationMessage;
|
|
157
|
+
}
|
|
158
|
+
/** PUT /users/preferences/messages. */
|
|
159
|
+
interface UpdateMessagePermissionRequest {
|
|
160
|
+
messagePermission: MessagePermission;
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* On the authenticated member profile only: whether the viewer may start a
|
|
164
|
+
* conversation, and the one they already have. The server decides; a viewer
|
|
165
|
+
* who may not is told nothing more.
|
|
166
|
+
*/
|
|
167
|
+
interface MemberMessagingState {
|
|
168
|
+
canStart: boolean;
|
|
169
|
+
conversationId: string | null;
|
|
170
|
+
}
|
|
171
|
+
declare function isMessagePermission(value: unknown): value is MessagePermission;
|
|
172
|
+
|
|
78
173
|
/** A step id as the registry names it: lowercase words joined by hyphens. */
|
|
79
174
|
declare const ONBOARDING_STEP_ID_PATTERN_SOURCE = "^[a-z][a-z0-9-]{0,39}$";
|
|
80
175
|
declare const ONBOARDING_STEPS_MAX = 30;
|
|
@@ -2034,6 +2129,8 @@ interface UserProfile {
|
|
|
2034
2129
|
weekStartsOn?: WeekStartsOn;
|
|
2035
2130
|
/** ONBOARD-01: how far the account has come through onboarding. */
|
|
2036
2131
|
onboarding?: OnboardingState;
|
|
2132
|
+
/** MSG-01: who may start a conversation with this member. */
|
|
2133
|
+
messagePermission?: MessagePermission;
|
|
2037
2134
|
/** PREF-04: how lengths are shown; a missing one is centimetres. */
|
|
2038
2135
|
lengthUnit?: LengthUnit;
|
|
2039
2136
|
followerCount: number;
|
|
@@ -2072,6 +2169,11 @@ interface PublicUserProfile {
|
|
|
2072
2169
|
* allows it; null while their analytics are not ready.
|
|
2073
2170
|
*/
|
|
2074
2171
|
rank?: RenaissanceRankDefinition | null;
|
|
2172
|
+
/**
|
|
2173
|
+
* MSG-01: on the authenticated read only, whether the viewer may start a
|
|
2174
|
+
* conversation with this member and the one they already share.
|
|
2175
|
+
*/
|
|
2176
|
+
messaging?: MemberMessagingState;
|
|
2075
2177
|
}
|
|
2076
2178
|
interface UpdateProfileRequest {
|
|
2077
2179
|
username?: string;
|
|
@@ -4080,6 +4182,17 @@ interface AccountExportV1 {
|
|
|
4080
4182
|
reaction: string;
|
|
4081
4183
|
createdAt: IsoDateString;
|
|
4082
4184
|
}>;
|
|
4185
|
+
/**
|
|
4186
|
+
* MSG-01: the messages the member wrote and has not deleted, each with
|
|
4187
|
+
* the member it was sent to (null once that account was deleted). Messages
|
|
4188
|
+
* written to them belong to their authors and are not included.
|
|
4189
|
+
*/
|
|
4190
|
+
messagesSent?: Array<{
|
|
4191
|
+
to: AccountExportMember | null;
|
|
4192
|
+
conversationId: string;
|
|
4193
|
+
body: string;
|
|
4194
|
+
createdAt: IsoDateString;
|
|
4195
|
+
}>;
|
|
4083
4196
|
reportsFiled: Array<{
|
|
4084
4197
|
subjectKind: string;
|
|
4085
4198
|
reason: string;
|
|
@@ -4131,6 +4244,8 @@ declare const API_ERROR_MESSAGES: {
|
|
|
4131
4244
|
readonly REPORT_NOT_FOUND: "Report not found";
|
|
4132
4245
|
readonly REPORT_SUBJECT_NOT_FOUND: "Subject not found";
|
|
4133
4246
|
readonly REPORTED_CONTENT_GONE: "The reported content no longer exists";
|
|
4247
|
+
readonly CONVERSATION_NOT_FOUND: "Conversation not found";
|
|
4248
|
+
readonly MESSAGE_NOT_FOUND: "Message not found";
|
|
4134
4249
|
readonly SHARE_LINK_NOT_FOUND: "Share link not found";
|
|
4135
4250
|
readonly LINK_NOT_FOUND: "Link not found";
|
|
4136
4251
|
readonly SHARED_SESSION_NOT_FOUND: "Shared session not found";
|
|
@@ -4244,6 +4359,13 @@ declare const API_ERROR_MESSAGES: {
|
|
|
4244
4359
|
readonly PARTNERS_MAX: "An account can have at most {max} training partners.";
|
|
4245
4360
|
readonly ENCOURAGEMENTS_MAX: "You can send this partner at most {max} encouragements in 24 hours.";
|
|
4246
4361
|
readonly ENCOURAGEMENT_RETRY: "Please retry the encouragement.";
|
|
4362
|
+
readonly MESSAGE_SELF: "You cannot message yourself";
|
|
4363
|
+
readonly MESSAGE_LENGTH: "A message must not be empty and may be at most {max} characters.";
|
|
4364
|
+
readonly MESSAGES_PER_MINUTE: "You can send at most {max} messages a minute.";
|
|
4365
|
+
readonly CONVERSATIONS_PER_DAY: "You can start at most {max} new conversations a day.";
|
|
4366
|
+
readonly MESSAGE_NOT_ADMITTED: "This member is not taking messages from you.";
|
|
4367
|
+
readonly CONVERSATION_CLOSED: "This conversation can no longer receive messages.";
|
|
4368
|
+
readonly MESSAGING_UNAVAILABLE: "Messaging is not available for this account.";
|
|
4247
4369
|
readonly ACCOUNT_CONFLICT: "Account conflict for this email";
|
|
4248
4370
|
readonly ACCOUNT_DELETE_CONFIRMATION: "Type your username exactly as it appears to confirm.";
|
|
4249
4371
|
readonly ACCOUNT_DELETE_MODERATOR: "A moderator account cannot be deleted while it holds moderator access.";
|
|
@@ -4387,4 +4509,42 @@ interface RecentSearchesResponse {
|
|
|
4387
4509
|
items: RecentSearchItem[];
|
|
4388
4510
|
}
|
|
4389
4511
|
|
|
4390
|
-
export { ACCOUNT_EXPORT_FORMAT, ACCOUNT_EXPORT_VERSION, ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, ACTIVITY_CAPS, ACTIVITY_COMMENTS_PAGE_SIZE, ACTIVITY_COMMENTS_PER_DAY_MAX, ACTIVITY_COMMENT_MAX_LENGTH, ACTIVITY_DEFAULT_AUDIENCE, ACTIVITY_ENTRY_ID_MAX_LENGTH, ACTIVITY_FEED_FOLLOWED_MAX, ACTIVITY_PAGE_DEFAULT_LIMIT, ACTIVITY_PAGE_MAX_LIMIT, ACTIVITY_PREVIEW_AUDIENCES, ACTIVITY_REACTIONS, ACTIVITY_TYPES, ACTIVITY_TYPE_SECTIONS, API_ERROR_CODES, API_ERROR_MESSAGES, type AccountExportBodyMeasurement, type AccountExportGoal, type AccountExportMember, type AccountExportPersonalRecord, type AccountExportRoutine, type AccountExportScheduleOverride, type AccountExportTrainingEvent, type AccountExportTrainingLocation, type AccountExportV1, type AchievementActivity, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type ActivityAudience, type ActivityCap, type ActivityComment, type ActivityCommentNotification, type ActivityCommentSummary, type ActivityCommentsQuery, type ActivityCommentsResponse, type ActivityEntry, type ActivityEntrySharing, type ActivityFeedResponse, type ActivityLink, type ActivityPage, type ActivityPageQuery, type ActivityPreviewAudience, type ActivityPreviewQuery, type ActivityReaction, type ActivityReactionSummary, type ActivitySection, type ActivitySharingSettings, type ActivityType, type ApiErrorBody, type ApiErrorCode, type ApiErrorParams, type AppLocale, type AppNotification, BAR_CHOICES_KG, BAR_WARM_UP_STEPS, BLOCKED_MEMBERS_MAX, BODY_MEASUREMENT_FIELDS, BODY_MEASUREMENT_FIELD_KEYS, BODY_PROGRESS_RANGES, type BlockComparisonLift, type BlockComparisonLiftBest, type BlockComparisonPeriod, type BlockComparisonPeriodKind, type BlockedMember, type BlockedMembersResponse, type BodyFieldSummary, type BodyMeasurement, type BodyMeasurementField, type BodyMeasurementProblem, type BodyMeasurementValues, type BodyProgressRange, type BodyProgressResponse, type Brand, CLONE_ROUTINE_REFUSALS, CM_PER_INCH, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, CUSTOM_EXERCISES_MAX, CUSTOM_EXERCISE_NAME_MAX, CUSTOM_EXERCISE_NOTE_MAX, CUSTOM_EXERCISE_PROBLEM_MESSAGES, CUSTOM_EXERCISE_REFUSALS, type CalendarDate, type CloneRoutineRefusal, type CloneRoutineRequest, type ComebackActivity, type ComebackRecognition, type ComebackRecognitionSummary, type CorrectSessionRequest, type CorrectSessionResponse, type CorrectSessionSetRequest, type CreateActivityCommentRequest, type CreateActivityCommentResponse, type CreateDeloadRequest, type CreateReportRequest, type CreateReportResponse, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateRoutineVersionRequest, type CreateSessionShareRequest, type CustomExerciseInput, type CustomExerciseProblem, type CustomExerciseRefusal, DASHBOARD_SECTION_IDS, DEFAULT_DASHBOARD_LAYOUT, DEFAULT_LOCALE, DEFAULT_WEEK_STARTS_ON, DELOAD_DEFAULT_DAYS, DELOAD_DEFAULT_LOAD_REDUCTION, DELOAD_DEFAULT_SET_MODE, DELOAD_LOAD_REDUCTIONS, DELOAD_MAX_DAYS, DELOAD_NOT_LIGHTER, DELOAD_SET_MODES, DELOAD_SUGGESTION_COOLDOWN_DAYS, DELOAD_SUGGESTION_EARLIER_DAYS, DELOAD_SUGGESTION_MIN_MARKED_TODAY, DELOAD_SUGGESTION_ROUTINE_DAYS, DELOAD_SUGGESTION_SIGNALS, type DashboardLayout, type DashboardLayoutEntry, type DashboardSectionId, type DeclineSignal, type DecliningLift, type DecliningLiftSession, type DeleteAccountRequest, type DeleteAccountResponse, type DeleteActivityCommentResponse, type DeletePushSubscriptionRequest, type DeloadLoadReduction, type DeloadOptions, type DeloadSetMode, type DeloadSuggestion, type DeloadSuggestionEvidence, type DeloadSuggestionResponse, type DeloadSuggestionSignal, type DeloadSuggestionUnavailableReason, type DiscoverableRoutine, type DismissGoalSuggestionRequest, EXERCISE_EQUIPMENT, EXERCISE_GROUP_KIND_LABELS, EXERCISE_GROUP_MAX, EXERCISE_MECHANICS, type EarnedAchievement, type EarnedPersonalRecord, type EffortPeriod, type EffortSignal, type Exercise, type ExerciseEquipment, type ExerciseGroup, type ExerciseGroupKind, type ExerciseGroupPosition, type ExerciseId, type ExerciseMechanic, type ExercisePerformanceHistoryQuery, type ExercisePerformanceHistoryResponse, type ExercisePerformancePrescription, type ExercisePerformancePrescriptionSet, type ExercisePerformanceSession, type ExercisePerformanceSet, type ExercisePerformanceSummary, type ExercisePlateau, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FEATURED_PROFILE_ITEMS_MAX, FEATURED_PROFILE_ITEM_KINDS, FEATURED_PROFILE_REFERENCE_MAX_LENGTH, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FeaturedProfileAchievementItem, type FeaturedProfileItem, type FeaturedProfileItemKind, type FeaturedProfileRankItem, type FeaturedProfileRecordItem, type FeaturedProfileRoutineItem, type FeaturedProfileSelection, type FeaturedProfileSelectionInput, type FeaturedProfileSelectionsResponse, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, GOAL_SUGGESTIONS_MAX, GOAL_SUGGESTION_DISMISSALS_MAX, GOAL_SUGGESTION_LIFT_MIN_SESSIONS, GOAL_SUGGESTION_LIFT_WINDOW_DAYS, GOAL_SUGGESTION_MIN_ACTIVE_WEEKS, GOAL_SUGGESTION_STRENGTH_STEP, GOAL_SUGGESTION_TYPES, GOAL_SUGGESTION_VOLUME_WEEKS, type GoalSuggestion, type GoalSuggestionBasis, type GoalSuggestionType, type GoalSuggestionsResponse, INCHES_PER_FOOT, type IsoDateString, LENGTH_UNITS, LIMITED_SHORTFALL_KG, type LengthUnit, type ListSessionsParams, MAX_SETS_PER_EXERCISE, MEASURABLE_GOALS_MAX, MEASURABLE_GOAL_DIRECTIONS, MEASURABLE_GOAL_TYPES, MINUTES_IN_DAY, MODERATION_ACTION_KINDS, MODERATION_HISTORY_PAGE_SIZE, MODERATION_NOTE_MAX_LENGTH, MODERATION_QUEUE_PAGE_SIZE, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MarkNotificationsReadRequest, type MarkNotificationsReadResponse, type MeasurableGoal, type MeasurableGoalDirection, type MeasurableGoalExercise, type MeasurableGoalInput, type MeasurableGoalType, type MemberActivityResponse, type MemberModerationState, type MemberRoutinesResponse, type MemberSearchPage, type ModerationActionKind, type ModerationActionRecord, type ModerationHistoryQuery, type ModerationHistoryResponse, type ModerationQueueQuery, type ModerationQueueResponse, type ModerationReport, type ModeratorState, type MoveOccurrenceRequest, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, NOTIFICATIONS_LIST_LIMIT, NOTIFICATIONS_LOOKBACK_DAYS, NOTIFICATIONS_PAGE_SIZE, NOTIFICATIONS_PAGE_SIZE_MAX, NOTIFICATIONS_RETENTION_DAYS, NOTIFICATION_CATEGORIES, NOTIFICATION_KINDS, type NewFollowerNotification, type NotificationCategory, type NotificationKind, type NotificationPreferences, type NotificationPreferencesResponse, type NotificationsQuery, type NotificationsResponse, ONBOARDING_STEPS_MAX, ONBOARDING_STEP_ID_PATTERN_SOURCE, ONBOARDING_VERSION_MAX, OTHER_WARM_UP_STEPS, type OnboardingState, type OwnActivityEntry, type OwnActivityResponse, PLATEAU_MIN_DAYS_SINCE_BEST, PLATEAU_MIN_SESSIONS, PLATEAU_MIN_SESSIONS_MAX, PLATEAU_MIN_SESSIONS_MIN, PLATEAU_RECENT_DAYS, PLATEAU_WINDOW_DAYS, PLATE_SETS, PREFERRED_TRAINING_STYLE_VALUES, PROFILE_BIO_MAX_LENGTH, PROFILE_FAVORITE_EXERCISES_MAX, PROFILE_LOCATION_MAX_LENGTH, PROFILE_TRAINING_DISCIPLINES_MAX, PROFILE_TRAINING_GOALS_MAX, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, PROGRESS_TIMELINE_EVENT_TYPES, PUSH_PAYLOAD_KINDS, PUSH_SUBSCRIPTIONS_MAX, type PaginatedResponse, type PersonalGoalProgress, type PersonalGoalsResponse, type PersonalRecordActivity, type PersonalRecordEntry, type PersonalRecordKind, type PlannedReminder, type PlateLoadingItem, type PlateLoadingResult, type PlatePairInventory, type PlateSetChoice, type PlateauPreferences, type PlateauSet, type PlateausResponse, type PreferredTrainingStyle, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfileDiscoverySettings, type ProfileFavoriteExercise, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressTimelineEventType, type ProgressTimelineItem, type ProgressTimelinePersonalRecordItem, type ProgressTimelineProgressionItem, type ProgressTimelineQuery, type ProgressTimelineRecordPerformance, type ProgressTimelineRecordReason, type ProgressTimelineResponse, type ProgressTimelineSessionContext, type ProgressionActivity, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicProfileAchievements, type PublicTrainingSummary, type PublicUserProfile, type PushPayload, type PushPayloadKind, type PushSubscriptionKeys, type PushSubscriptionSummary, type PushSubscriptionsResponse, type QuietHours, RECENT_SEARCHES_MAX, RECENT_SEARCH_KINDS, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, RENAISSANCE_RANK_DEFINITIONS, REPORTS_PER_DAY_MAX, REPORT_DETAILS_MAX_LENGTH, REPORT_REASONS, REPORT_STATUSES, REPORT_SUBJECT_KINDS, REP_TYPES, RESERVED_USERNAMES, REST_ALERT_MAX_LEAD_SECONDS, REST_ALERT_MIN_LEAD_SECONDS, REST_ALERT_REFUSALS, ROUTINE_DAYS_MAX, ROUTINE_DAY_NAME_MAX, ROUTINE_DISCOVERY_DEFAULT_LIMIT, ROUTINE_DISCOVERY_MAX_LIMIT, ROUTINE_DISCOVERY_SCAN_LIMIT, ROUTINE_DURATION_BANDS, ROUTINE_DURATION_BAND_MAX_MINUTES, ROUTINE_SCHEDULE_MODES, ROUTINE_SHARE_MAX_ACTIVE_LINKS, ROUTINE_TRAINING_BLOCKS_MAX, ROUTINE_TRAINING_BLOCK_NAME_MAX, ROUTINE_TRAINING_BLOCK_REVISIONS_MAX, ROUTINE_TRAINING_BLOCK_SOURCE_KINDS, ROUTINE_TRAINING_BLOCK_STATES, ROUTINE_VERSIONS_MAX, ROUTINE_VERSION_KINDS, ROUTINE_VERSION_NAME_MAX, ROUTINE_VISIBILITY_VALUES, type RecentActivityEntry, type RecentExercise, type RecentRoutine, type RecentSearchItem, type RecentSearchKind, type RecentSearchesResponse, type RecordRecentSearchRequest, type RegisterPushSubscriptionRequest, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RenaissanceRankDefinition, type RenaissanceRankProgress, type RepTargetPeriod, type RepTargetSignal, type RepType, type ReplaceFeaturedProfileItemsRequest, type ReplaceMeasurableGoalsRequest, type ReplaceTrainingLocationsRequest, type ReportReason, type ReportStatus, type ReportSubjectKind, type ReportSubjectPreview, type ResolvedRoutinePlan, type RestAlertPushPayload, type RestAlertRefusal, type RestoreRoutineVersionResponse, type ReviewReportRequest, type ReviewReportResponse, type Routine, type RoutineClassification, type RoutineDay, type RoutineDayId, type RoutineDiscoveryQuery, type RoutineDiscoveryResponse, type RoutineDurationBand, type RoutineExercise, type RoutineFacets, type RoutineId, type RoutineLineage, type RoutinePlanSource, type RoutineScheduleMode, type RoutineSearchPage, type RoutineSet, type RoutineShare, type RoutineShareListResponse, type RoutineSharedActivity, type RoutineTemporaryOverride, type RoutineTemporaryOverridePlan, type RoutineTemporaryOverridesResponse, type RoutineTrainingBlock, type RoutineTrainingBlockPlan, type RoutineTrainingBlockRevision, type RoutineTrainingBlockRevisionsResponse, type RoutineTrainingBlockSource, type RoutineTrainingBlockSourceKind, type RoutineTrainingBlockState, type RoutineTrainingBlocksResponse, type RoutineVersion, type RoutineVersionDay, type RoutineVersionExercise, type RoutineVersionKind, type RoutineVersionSetup, type RoutineVersionsResponse, type RoutineVisibility, SCHEDULE_MOVE_MAX_DAYS, SCHEDULE_OVERRIDES_MAX_RANGE_DAYS, SCHEDULE_OVERRIDE_KINDS, SCHEDULE_SKIP_PAST_DAYS, SEARCH_PAGE_SIZE, SEARCH_PAGE_SIZE_MAX, SEARCH_PREVIEW_LIMIT, SEARCH_QUERY_MAX_LENGTH, SEARCH_QUERY_MIN_LENGTH, SEARCH_SERVER_CATEGORIES, SESSION_CORRECTIONS_MAX, SESSION_CORRECTION_LIMITS, SESSION_CORRECTION_WINDOW_HOURS, SESSION_EXERCISE_NOTE_MAX_LENGTH, SESSION_NOTE_MAX_LENGTH, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SET_KINDS, SET_KIND_LABELS, SEXES, SHARED_ROUTINE_SOURCES, STARRED_EXERCISES_MAX, STREAK_MAX_GAP_DAYS, SUPPORTED_LOCALES, type ScheduleOverride, type ScheduleOverrideKind, type ScheduleOverridesQuery, type ScheduleOverridesResponse, type ScheduleRestAlertRequest, type ScheduleRestAlertResponse, type SearchPage, type SearchPageQuery, type SearchPreviewQuery, type SearchPreviewResponse, type SearchServerCategory, type SendTrainingPartnerEncouragementRequest, type SendTrainingPartnerEncouragementResponse, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionCompletedActivity, type SessionCorrection, type SessionCorrectionClosedReason, type SessionCorrectionWindow, type SessionCorrectionsResponse, type SessionExerciseNote, type SessionExerciseSubstitution, type SessionProgressNotification, type SessionRecapExerciseNote, type SessionRecapRecord, type SessionSetCorrection, type SessionShare, type SessionShareField, type SessionShareListResponse, type SessionTemporaryOverride, type SessionTrainingBlock, type SetAccountTimeZoneRequest, type SetActivityEntryAudienceRequest, type SetActivityEntryAudienceResponse, type SetActivityReactionRequest, type SetActivityReactionResponse, type SetKind, type SetLog, type SetLogValues, type Sex, type SharedRoutine, type SharedRoutineOwner, type SharedRoutineSearchResult, type SharedRoutineSource, type SharedRoutineSummary, type SharedSessionOwner, type SharedSessionRecap, type SkipOccurrenceRequest, type StarredExercise, type StarredExercisesResponse, type StartWorkoutRequest, type StartWorkoutResponse, type StreakAtRiskPushPayload, type StreakMilestoneActivity, type StreakMilestoneEventPayload, type SubstituteSessionExerciseRequest, type SubstituteSessionExerciseResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TEMPORARY_OVERRIDE_KINDS, TEMPORARY_OVERRIDE_SOURCE_KINDS, TRAINING_BLOCK_COMPARISON_MAX_DAYS, TRAINING_DISCIPLINE_VALUES, TRAINING_EVENT_TYPES, TRAINING_EXPERIENCE_LEVEL_VALUES, TRAINING_GOAL_VALUES, TRAINING_PARTNERSHIP_STATUSES, TRAINING_PARTNERS_MAX, TRAINING_PARTNER_ENCOURAGEMENTS_PER_24_HOURS_MAX, TRAINING_PARTNER_ENCOURAGEMENT_KINDS, TRAINING_PARTNER_PERMISSION_KEYS, TRAINING_PARTNER_REQUESTS_PER_DAY_MAX, TRAINING_SIGNAL_DECLINES_MAX, TRAINING_SIGNAL_DECLINE_SESSIONS, TRAINING_SIGNAL_MIN_DECLINE, TRAINING_SIGNAL_MIN_RPE_SETS, TRAINING_SIGNAL_MIN_SHORT_SETS, TRAINING_SIGNAL_MIN_TARGET_SETS, TRAINING_SIGNAL_PERIOD_DAYS, TRAINING_SIGNAL_RPE_RISE, TRAINING_SIGNAL_SHORT_LIFTS_MAX, TRAINING_SIGNAL_SHORT_POINTS_RISE, TRAINING_SIGNAL_WORKOUT_DROP, type TemporaryOverrideKind, type TemporaryOverrideSource, type TemporaryOverrideSourceKind, type TrainingBlockComparisonResponse, type TrainingDiscipline, type TrainingEventType, type TrainingExperienceLevel, type TrainingGoal, type TrainingIdentity, type TrainingLocationPreference, type TrainingLocationPreferenceInput, type TrainingPartnerAchievementNotification, type TrainingPartnerAchievementPushPayload, type TrainingPartnerEncouragementKind, type TrainingPartnerEncouragementNotification, type TrainingPartnerPermissions, type TrainingPartnerScheduleDay, type TrainingPartnerScheduleResponse, type TrainingPartnerSessionNotification, type TrainingPartnerSessionPushPayload, type TrainingPartnership, type TrainingPartnershipStatus, type TrainingPartnershipsResponse, type TrainingReminderPreference, type TrainingReminderPushPayload, type TrainingSignalPeriod, type TrainingSignalsResponse, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateActivitySharingRequest, type UpdateCustomExerciseRequest, type UpdateDashboardLayoutRequest, type UpdateLocaleRequest, type UpdateNotificationPreferencesRequest, type UpdateOnboardingRequest, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpdateRoutineVisibilityRequest, type UpdateSessionNotesRequest, type UpdateSessionNotesResponse, type UpdateTrainingPartnerPermissionsRequest, type UpdateWeekStartRequest, type UpsertBodyMeasurementRequest, type UpsertRoutineTrainingBlockRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, type VolumeTrendPoint, type VolumeTrendQuery, type VolumeTrendResponse, type VolumeTrendSeries, WEEK_STARTS, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WarmUpEquipment, type WarmUpLoad, type WarmUpRamp, type WarmUpSet, type WarmUpStep, type WeekStartsOn, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutPeriod, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSearchPage, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionRecap, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutSignal, type WorkoutStatsQuery, type WorkoutStatsResponse, accountExportFileName, apiError, apiErrorMessage, applyDeload, bodyMeasurementProblems, bodyProgressRangeStart, buildWarmUpRamp, calculatePlateLoading, canLinkToNext, cmToFeetInches, cmToInches, countsAsWork, countsForProgression, customExerciseProblem, defaultWarmUpEquipment, deloadLengthDays, exerciseGroupLabel, exerciseGroupPosition, exerciseGroups, exerciseNameKey, feetInchesToCm, followWorkingLoad, goalSuggestionKey, hasOversizedGroup, inchesToCm, isApiErrorCode, isAppLocale, isBarLoaded, isBodyMeasurementDate, isDashboardSectionId, isDefaultDashboardLayout, isGoalSuggestionKey, isOnboardingStepId, isSetKind, isWeekStartsOn, isWithinQuietHours, latestBodyWeight, leadWorkingWeight, matchesDeletionConfirmation, normalizeDashboardLayout, normalizeExerciseLinks, normalizeExerciseName, normalizeSearchQuery, primaryEquipment, requiredToFinish, resolveActiveTrainingBlock, resolveRoutinePlan, routineDayLabel, sessionCorrectionWindow, setKindOf, setLogValuesDiffer, summarizeBodyProgress, trainingBlockCovers, warmUpLoad, weekStartOf };
|
|
4512
|
+
/** GET, with the usual bearer token. */
|
|
4513
|
+
declare const REALTIME_STREAM_PATH = "/realtime/stream";
|
|
4514
|
+
/**
|
|
4515
|
+
* What a signal can say is out of date. `conversations` (MSG-01): the
|
|
4516
|
+
* member's conversation list and the messages of each.
|
|
4517
|
+
*/
|
|
4518
|
+
declare const REALTIME_TOPICS: readonly ["notifications", "conversations"];
|
|
4519
|
+
type RealtimeTopic = (typeof REALTIME_TOPICS)[number];
|
|
4520
|
+
type RealtimeEvent =
|
|
4521
|
+
/** Sent first on every stream: re-read these topics once. */
|
|
4522
|
+
{
|
|
4523
|
+
type: "ready";
|
|
4524
|
+
topics: RealtimeTopic[];
|
|
4525
|
+
}
|
|
4526
|
+
/** Reads under this topic are out of date. */
|
|
4527
|
+
| {
|
|
4528
|
+
type: "changed";
|
|
4529
|
+
topic: RealtimeTopic;
|
|
4530
|
+
};
|
|
4531
|
+
/** A comment line the server writes so the proxies never see an idle stream. */
|
|
4532
|
+
declare const REALTIME_HEARTBEAT_MS = 25000;
|
|
4533
|
+
/**
|
|
4534
|
+
* The server ends a stream after this long, or when its access token expires,
|
|
4535
|
+
* whichever comes first, and the client reconnects at once with a fresh
|
|
4536
|
+
* token. Railway closes a plain HTTP request after 15 minutes.
|
|
4537
|
+
*/
|
|
4538
|
+
declare const REALTIME_MAX_STREAM_MS: number;
|
|
4539
|
+
/** Open streams per member; opening another closes the oldest. */
|
|
4540
|
+
declare const REALTIME_MAX_STREAMS_PER_MEMBER = 5;
|
|
4541
|
+
/**
|
|
4542
|
+
* When the stream is switched off on the server it answers 503 with this
|
|
4543
|
+
* `Retry-After`, in seconds, and the client polls in the meantime.
|
|
4544
|
+
*/
|
|
4545
|
+
declare const REALTIME_UNAVAILABLE_RETRY_SECONDS = 300;
|
|
4546
|
+
declare function isRealtimeTopic(value: unknown): value is RealtimeTopic;
|
|
4547
|
+
/** The event in one `data:` payload, or null for anything else. */
|
|
4548
|
+
declare function parseRealtimeEvent(data: string): RealtimeEvent | null;
|
|
4549
|
+
|
|
4550
|
+
export { ACCOUNT_EXPORT_FORMAT, ACCOUNT_EXPORT_VERSION, ACHIEVEMENT_CATEGORIES, ACHIEVEMENT_DEFINITIONS, ACTIVITY_CAPS, ACTIVITY_COMMENTS_PAGE_SIZE, ACTIVITY_COMMENTS_PER_DAY_MAX, ACTIVITY_COMMENT_MAX_LENGTH, ACTIVITY_DEFAULT_AUDIENCE, ACTIVITY_ENTRY_ID_MAX_LENGTH, ACTIVITY_FEED_FOLLOWED_MAX, ACTIVITY_PAGE_DEFAULT_LIMIT, ACTIVITY_PAGE_MAX_LIMIT, ACTIVITY_PREVIEW_AUDIENCES, ACTIVITY_REACTIONS, ACTIVITY_TYPES, ACTIVITY_TYPE_SECTIONS, API_ERROR_CODES, API_ERROR_MESSAGES, type AccountExportBodyMeasurement, type AccountExportGoal, type AccountExportMember, type AccountExportPersonalRecord, type AccountExportRoutine, type AccountExportScheduleOverride, type AccountExportTrainingEvent, type AccountExportTrainingLocation, type AccountExportV1, type AchievementActivity, type AchievementCategory, type AchievementCategoryProgress, type AchievementDefinition, type AchievementNotification, type AchievementUnlockedEventPayload, type AchievementsResponse, type ActivityAudience, type ActivityCap, type ActivityComment, type ActivityCommentNotification, type ActivityCommentSummary, type ActivityCommentsQuery, type ActivityCommentsResponse, type ActivityEntry, type ActivityEntrySharing, type ActivityFeedResponse, type ActivityLink, type ActivityPage, type ActivityPageQuery, type ActivityPreviewAudience, type ActivityPreviewQuery, type ActivityReaction, type ActivityReactionSummary, type ActivitySection, type ActivitySharingSettings, type ActivityType, type ApiErrorBody, type ApiErrorCode, type ApiErrorParams, type AppLocale, type AppNotification, BAR_CHOICES_KG, BAR_WARM_UP_STEPS, BLOCKED_MEMBERS_MAX, BODY_MEASUREMENT_FIELDS, BODY_MEASUREMENT_FIELD_KEYS, BODY_PROGRESS_RANGES, type BlockComparisonLift, type BlockComparisonLiftBest, type BlockComparisonPeriod, type BlockComparisonPeriodKind, type BlockedMember, type BlockedMembersResponse, type BodyFieldSummary, type BodyMeasurement, type BodyMeasurementField, type BodyMeasurementProblem, type BodyMeasurementValues, type BodyProgressRange, type BodyProgressResponse, type Brand, CLONE_ROUTINE_REFUSALS, CM_PER_INCH, COMEBACK_MIN_INACTIVE_DAYS, COMEBACK_RECOGNITION_LIMIT, COMEBACK_REQUIRED_ACTIVE_DAYS, COMEBACK_SESSION_LOOKBACK, COMEBACK_WINDOW_DAYS, CONVERSATIONS_PAGE_SIZE, CUSTOM_EXERCISES_MAX, CUSTOM_EXERCISE_NAME_MAX, CUSTOM_EXERCISE_NOTE_MAX, CUSTOM_EXERCISE_PROBLEM_MESSAGES, CUSTOM_EXERCISE_REFUSALS, type CalendarDate, type CloneRoutineRefusal, type CloneRoutineRequest, type ComebackActivity, type ComebackRecognition, type ComebackRecognitionSummary, type ConversationMember, type ConversationMessage, type ConversationMessagesResponse, type ConversationSummary, type ConversationsResponse, type CorrectSessionRequest, type CorrectSessionResponse, type CorrectSessionSetRequest, type CreateActivityCommentRequest, type CreateActivityCommentResponse, type CreateDeloadRequest, type CreateReportRequest, type CreateReportResponse, type CreateRoutineDayInput, type CreateRoutineExerciseInput, type CreateRoutineRequest, type CreateRoutineVersionRequest, type CreateSessionShareRequest, type CustomExerciseInput, type CustomExerciseProblem, type CustomExerciseRefusal, DASHBOARD_SECTION_IDS, DEFAULT_DASHBOARD_LAYOUT, DEFAULT_LOCALE, DEFAULT_MESSAGE_PERMISSION, DEFAULT_WEEK_STARTS_ON, DELOAD_DEFAULT_DAYS, DELOAD_DEFAULT_LOAD_REDUCTION, DELOAD_DEFAULT_SET_MODE, DELOAD_LOAD_REDUCTIONS, DELOAD_MAX_DAYS, DELOAD_NOT_LIGHTER, DELOAD_SET_MODES, DELOAD_SUGGESTION_COOLDOWN_DAYS, DELOAD_SUGGESTION_EARLIER_DAYS, DELOAD_SUGGESTION_MIN_MARKED_TODAY, DELOAD_SUGGESTION_ROUTINE_DAYS, DELOAD_SUGGESTION_SIGNALS, type DashboardLayout, type DashboardLayoutEntry, type DashboardSectionId, type DeclineSignal, type DecliningLift, type DecliningLiftSession, type DeleteAccountRequest, type DeleteAccountResponse, type DeleteActivityCommentResponse, type DeletePushSubscriptionRequest, type DeloadLoadReduction, type DeloadOptions, type DeloadSetMode, type DeloadSuggestion, type DeloadSuggestionEvidence, type DeloadSuggestionResponse, type DeloadSuggestionSignal, type DeloadSuggestionUnavailableReason, type DiscoverableRoutine, type DismissGoalSuggestionRequest, EXERCISE_EQUIPMENT, EXERCISE_GROUP_KIND_LABELS, EXERCISE_GROUP_MAX, EXERCISE_MECHANICS, type EarnedAchievement, type EarnedPersonalRecord, type EffortPeriod, type EffortSignal, type Exercise, type ExerciseEquipment, type ExerciseGroup, type ExerciseGroupKind, type ExerciseGroupPosition, type ExerciseId, type ExerciseMechanic, type ExercisePerformanceHistoryQuery, type ExercisePerformanceHistoryResponse, type ExercisePerformancePrescription, type ExercisePerformancePrescriptionSet, type ExercisePerformanceSession, type ExercisePerformanceSet, type ExercisePerformanceSummary, type ExercisePlateau, type ExerciseStrengthSummary, type ExerciseStrengthTrendPoint, type ExerciseStrengthTrendQuery, type ExerciseStrengthTrendResponse, FEATURED_PROFILE_ITEMS_MAX, FEATURED_PROFILE_ITEM_KINDS, FEATURED_PROFILE_REFERENCE_MAX_LENGTH, FOLLOW_SUGGESTIONS_DEFAULT_LIMIT, FOLLOW_SUGGESTIONS_MAX_LIMIT, FOLLOW_SUGGESTION_REASONS, type FeaturedProfileAchievementItem, type FeaturedProfileItem, type FeaturedProfileItemKind, type FeaturedProfileRankItem, type FeaturedProfileRecordItem, type FeaturedProfileRoutineItem, type FeaturedProfileSelection, type FeaturedProfileSelectionInput, type FeaturedProfileSelectionsResponse, type FinishStatus, type FinishWorkoutRequest, type FinishWorkoutResponse, type FollowSuggestion, type FollowSuggestionReason, type FollowSuggestionsResponse, GOAL_SUGGESTIONS_MAX, GOAL_SUGGESTION_DISMISSALS_MAX, GOAL_SUGGESTION_LIFT_MIN_SESSIONS, GOAL_SUGGESTION_LIFT_WINDOW_DAYS, GOAL_SUGGESTION_MIN_ACTIVE_WEEKS, GOAL_SUGGESTION_STRENGTH_STEP, GOAL_SUGGESTION_TYPES, GOAL_SUGGESTION_VOLUME_WEEKS, type GoalSuggestion, type GoalSuggestionBasis, type GoalSuggestionType, type GoalSuggestionsResponse, INCHES_PER_FOOT, type IsoDateString, LENGTH_UNITS, LIMITED_SHORTFALL_KG, type LengthUnit, type ListSessionsParams, MAX_SETS_PER_EXERCISE, MEASURABLE_GOALS_MAX, MEASURABLE_GOAL_DIRECTIONS, MEASURABLE_GOAL_TYPES, MESSAGES_PAGE_SIZE, MESSAGES_PER_MINUTE_MAX, MESSAGE_BODY_MAX, MESSAGE_PERMISSIONS, MINUTES_IN_DAY, MODERATION_ACTION_KINDS, MODERATION_HISTORY_PAGE_SIZE, MODERATION_NOTE_MAX_LENGTH, MODERATION_QUEUE_PAGE_SIZE, MOVEMENT_PATTERNS, MUSCLE_GROUPS, type MarkNotificationsReadRequest, type MarkNotificationsReadResponse, type MeasurableGoal, type MeasurableGoalDirection, type MeasurableGoalExercise, type MeasurableGoalInput, type MeasurableGoalType, type MemberActivityResponse, type MemberMessagingState, type MemberModerationState, type MemberRoutinesResponse, type MemberSearchPage, type MessagePermission, type ModerationActionKind, type ModerationActionRecord, type ModerationHistoryQuery, type ModerationHistoryResponse, type ModerationQueueQuery, type ModerationQueueResponse, type ModerationReport, type ModeratorState, type MoveOccurrenceRequest, type MovementPattern, type MuscleGroup, type MuscleGroupHeatmapQuery, type MuscleGroupHeatmapResponse, type MuscleGroupHeatmapValue, type MuscleGroupHeatmapWeek, type MuscleVolumeTrendSeries, NEW_CONVERSATIONS_PER_DAY_MAX, NOTIFICATIONS_LIST_LIMIT, NOTIFICATIONS_LOOKBACK_DAYS, NOTIFICATIONS_PAGE_SIZE, NOTIFICATIONS_PAGE_SIZE_MAX, NOTIFICATIONS_RETENTION_DAYS, NOTIFICATION_CATEGORIES, NOTIFICATION_KINDS, type NewFollowerNotification, type NotificationCategory, type NotificationKind, type NotificationPreferences, type NotificationPreferencesResponse, type NotificationsQuery, type NotificationsResponse, ONBOARDING_STEPS_MAX, ONBOARDING_STEP_ID_PATTERN_SOURCE, ONBOARDING_VERSION_MAX, OTHER_WARM_UP_STEPS, type OnboardingState, type OwnActivityEntry, type OwnActivityResponse, PLATEAU_MIN_DAYS_SINCE_BEST, PLATEAU_MIN_SESSIONS, PLATEAU_MIN_SESSIONS_MAX, PLATEAU_MIN_SESSIONS_MIN, PLATEAU_RECENT_DAYS, PLATEAU_WINDOW_DAYS, PLATE_SETS, PREFERRED_TRAINING_STYLE_VALUES, PROFILE_BIO_MAX_LENGTH, PROFILE_FAVORITE_EXERCISES_MAX, PROFILE_LOCATION_MAX_LENGTH, PROFILE_TRAINING_DISCIPLINES_MAX, PROFILE_TRAINING_GOALS_MAX, PROFILE_VISIBILITY_VALUES, PROGRESSION_SCHEMES, PROGRESS_TIMELINE_EVENT_TYPES, PUSH_PAYLOAD_KINDS, PUSH_SUBSCRIPTIONS_MAX, type PaginatedResponse, type PersonalGoalProgress, type PersonalGoalsResponse, type PersonalRecordActivity, type PersonalRecordEntry, type PersonalRecordKind, type PlannedReminder, type PlateLoadingItem, type PlateLoadingResult, type PlatePairInventory, type PlateSetChoice, type PlateauPreferences, type PlateauSet, type PlateausResponse, type PreferredTrainingStyle, type PreviousPerformanceResponse, type PreviousSessionRecap, type PreviousSetPerformance, type ProfileDiscoverySettings, type ProfileFavoriteExercise, type ProfilePrivacySettings, type ProfileViewerAccess, type ProfileVisibility, type ProgressTimelineEventType, type ProgressTimelineItem, type ProgressTimelinePersonalRecordItem, type ProgressTimelineProgressionItem, type ProgressTimelineQuery, type ProgressTimelineRecordPerformance, type ProgressTimelineRecordReason, type ProgressTimelineResponse, type ProgressTimelineSessionContext, type ProgressionActivity, type ProgressionChange, type ProgressionRule, type ProgressionScheme, type ProgressionSetChange, type PublicBodyMetrics, type PublicProfileAchievements, type PublicTrainingSummary, type PublicUserProfile, type PushPayload, type PushPayloadKind, type PushSubscriptionKeys, type PushSubscriptionSummary, type PushSubscriptionsResponse, type QuietHours, REALTIME_HEARTBEAT_MS, REALTIME_MAX_STREAMS_PER_MEMBER, REALTIME_MAX_STREAM_MS, REALTIME_STREAM_PATH, REALTIME_TOPICS, REALTIME_UNAVAILABLE_RETRY_SECONDS, RECENT_SEARCHES_MAX, RECENT_SEARCH_KINDS, RELATIONSHIP_LIST_DEFAULT_LIMIT, RELATIONSHIP_LIST_KINDS, RELATIONSHIP_LIST_MAX_LIMIT, RENAISSANCE_RANK_DEFINITIONS, REPORTS_PER_DAY_MAX, REPORT_DETAILS_MAX_LENGTH, REPORT_REASONS, REPORT_STATUSES, REPORT_SUBJECT_KINDS, REP_TYPES, RESERVED_USERNAMES, REST_ALERT_MAX_LEAD_SECONDS, REST_ALERT_MIN_LEAD_SECONDS, REST_ALERT_REFUSALS, ROUTINE_DAYS_MAX, ROUTINE_DAY_NAME_MAX, ROUTINE_DISCOVERY_DEFAULT_LIMIT, ROUTINE_DISCOVERY_MAX_LIMIT, ROUTINE_DISCOVERY_SCAN_LIMIT, ROUTINE_DURATION_BANDS, ROUTINE_DURATION_BAND_MAX_MINUTES, ROUTINE_SCHEDULE_MODES, ROUTINE_SHARE_MAX_ACTIVE_LINKS, ROUTINE_TRAINING_BLOCKS_MAX, ROUTINE_TRAINING_BLOCK_NAME_MAX, ROUTINE_TRAINING_BLOCK_REVISIONS_MAX, ROUTINE_TRAINING_BLOCK_SOURCE_KINDS, ROUTINE_TRAINING_BLOCK_STATES, ROUTINE_VERSIONS_MAX, ROUTINE_VERSION_KINDS, ROUTINE_VERSION_NAME_MAX, ROUTINE_VISIBILITY_VALUES, type RealtimeEvent, type RealtimeTopic, type RecentActivityEntry, type RecentExercise, type RecentRoutine, type RecentSearchItem, type RecentSearchKind, type RecentSearchesResponse, type RecordRecentSearchRequest, type RegisterPushSubscriptionRequest, type RelationshipListKind, type RelationshipListQuery, type RelationshipListResponse, type RelationshipMember, type RenaissanceRankDefinition, type RenaissanceRankProgress, type RepTargetPeriod, type RepTargetSignal, type RepType, type ReplaceFeaturedProfileItemsRequest, type ReplaceMeasurableGoalsRequest, type ReplaceTrainingLocationsRequest, type ReportReason, type ReportStatus, type ReportSubjectKind, type ReportSubjectPreview, type ResolvedRoutinePlan, type RestAlertPushPayload, type RestAlertRefusal, type RestoreRoutineVersionResponse, type ReviewReportRequest, type ReviewReportResponse, type Routine, type RoutineClassification, type RoutineDay, type RoutineDayId, type RoutineDiscoveryQuery, type RoutineDiscoveryResponse, type RoutineDurationBand, type RoutineExercise, type RoutineFacets, type RoutineId, type RoutineLineage, type RoutinePlanSource, type RoutineScheduleMode, type RoutineSearchPage, type RoutineSet, type RoutineShare, type RoutineShareListResponse, type RoutineSharedActivity, type RoutineTemporaryOverride, type RoutineTemporaryOverridePlan, type RoutineTemporaryOverridesResponse, type RoutineTrainingBlock, type RoutineTrainingBlockPlan, type RoutineTrainingBlockRevision, type RoutineTrainingBlockRevisionsResponse, type RoutineTrainingBlockSource, type RoutineTrainingBlockSourceKind, type RoutineTrainingBlockState, type RoutineTrainingBlocksResponse, type RoutineVersion, type RoutineVersionDay, type RoutineVersionExercise, type RoutineVersionKind, type RoutineVersionSetup, type RoutineVersionsResponse, type RoutineVisibility, SCHEDULE_MOVE_MAX_DAYS, SCHEDULE_OVERRIDES_MAX_RANGE_DAYS, SCHEDULE_OVERRIDE_KINDS, SCHEDULE_SKIP_PAST_DAYS, SEARCH_PAGE_SIZE, SEARCH_PAGE_SIZE_MAX, SEARCH_PREVIEW_LIMIT, SEARCH_QUERY_MAX_LENGTH, SEARCH_QUERY_MIN_LENGTH, SEARCH_SERVER_CATEGORIES, SESSION_CORRECTIONS_MAX, SESSION_CORRECTION_LIMITS, SESSION_CORRECTION_WINDOW_HOURS, SESSION_EXERCISE_NOTE_MAX_LENGTH, SESSION_NOTE_MAX_LENGTH, SESSION_SHARE_DEFAULT_FIELDS, SESSION_SHARE_FIELDS, SESSION_SHARE_MAX_ACTIVE_LINKS, SET_KINDS, SET_KIND_LABELS, SEXES, SHARED_ROUTINE_SOURCES, STARRED_EXERCISES_MAX, STREAK_MAX_GAP_DAYS, SUPPORTED_LOCALES, type ScheduleOverride, type ScheduleOverrideKind, type ScheduleOverridesQuery, type ScheduleOverridesResponse, type ScheduleRestAlertRequest, type ScheduleRestAlertResponse, type SearchPage, type SearchPageQuery, type SearchPreviewQuery, type SearchPreviewResponse, type SearchServerCategory, type SendMessageRequest, type SendMessageResponse, type SendTrainingPartnerEncouragementRequest, type SendTrainingPartnerEncouragementResponse, type SessionComparisonExercise, type SessionComparisonQuery, type SessionComparisonResponse, type SessionComparisonRoutineDay, type SessionComparisonSession, type SessionComparisonSet, type SessionCompletedActivity, type SessionCorrection, type SessionCorrectionClosedReason, type SessionCorrectionWindow, type SessionCorrectionsResponse, type SessionExerciseNote, type SessionExerciseSubstitution, type SessionProgressNotification, type SessionRecapExerciseNote, type SessionRecapRecord, type SessionSetCorrection, type SessionShare, type SessionShareField, type SessionShareListResponse, type SessionTemporaryOverride, type SessionTrainingBlock, type SetAccountTimeZoneRequest, type SetActivityEntryAudienceRequest, type SetActivityEntryAudienceResponse, type SetActivityReactionRequest, type SetActivityReactionResponse, type SetKind, type SetLog, type SetLogValues, type Sex, type SharedRoutine, type SharedRoutineOwner, type SharedRoutineSearchResult, type SharedRoutineSource, type SharedRoutineSummary, type SharedSessionOwner, type SharedSessionRecap, type SkipOccurrenceRequest, type StarredExercise, type StarredExercisesResponse, type StartConversationRequest, type StartWorkoutRequest, type StartWorkoutResponse, type StreakAtRiskPushPayload, type StreakMilestoneActivity, type StreakMilestoneEventPayload, type SubstituteSessionExerciseRequest, type SubstituteSessionExerciseResponse, type SupabaseAuthResponse, type SupabaseAuthUser, type SupabaseMigrationResponse, TEMPORARY_OVERRIDE_KINDS, TEMPORARY_OVERRIDE_SOURCE_KINDS, TRAINING_BLOCK_COMPARISON_MAX_DAYS, TRAINING_DISCIPLINE_VALUES, TRAINING_EVENT_TYPES, TRAINING_EXPERIENCE_LEVEL_VALUES, TRAINING_GOAL_VALUES, TRAINING_PARTNERSHIP_STATUSES, TRAINING_PARTNERS_MAX, TRAINING_PARTNER_ENCOURAGEMENTS_PER_24_HOURS_MAX, TRAINING_PARTNER_ENCOURAGEMENT_KINDS, TRAINING_PARTNER_PERMISSION_KEYS, TRAINING_PARTNER_REQUESTS_PER_DAY_MAX, TRAINING_SIGNAL_DECLINES_MAX, TRAINING_SIGNAL_DECLINE_SESSIONS, TRAINING_SIGNAL_MIN_DECLINE, TRAINING_SIGNAL_MIN_RPE_SETS, TRAINING_SIGNAL_MIN_SHORT_SETS, TRAINING_SIGNAL_MIN_TARGET_SETS, TRAINING_SIGNAL_PERIOD_DAYS, TRAINING_SIGNAL_RPE_RISE, TRAINING_SIGNAL_SHORT_LIFTS_MAX, TRAINING_SIGNAL_SHORT_POINTS_RISE, TRAINING_SIGNAL_WORKOUT_DROP, type TemporaryOverrideKind, type TemporaryOverrideSource, type TemporaryOverrideSourceKind, type TrainingBlockComparisonResponse, type TrainingDiscipline, type TrainingEventType, type TrainingExperienceLevel, type TrainingGoal, type TrainingIdentity, type TrainingLocationPreference, type TrainingLocationPreferenceInput, type TrainingPartnerAchievementNotification, type TrainingPartnerAchievementPushPayload, type TrainingPartnerEncouragementKind, type TrainingPartnerEncouragementNotification, type TrainingPartnerPermissions, type TrainingPartnerScheduleDay, type TrainingPartnerScheduleResponse, type TrainingPartnerSessionNotification, type TrainingPartnerSessionPushPayload, type TrainingPartnership, type TrainingPartnershipStatus, type TrainingPartnershipsResponse, type TrainingReminderPreference, type TrainingReminderPushPayload, type TrainingSignalPeriod, type TrainingSignalsResponse, USERNAME_MAX_LENGTH, USERNAME_MIN_LENGTH, USERNAME_PATTERN_SOURCE, type UpdateActivitySharingRequest, type UpdateCustomExerciseRequest, type UpdateDashboardLayoutRequest, type UpdateLocaleRequest, type UpdateMessagePermissionRequest, type UpdateNotificationPreferencesRequest, type UpdateOnboardingRequest, type UpdateProfileDiscoveryRequest, type UpdateProfilePrivacyRequest, type UpdateProfileRequest, type UpdateRoutineRequest, type UpdateRoutineVisibilityRequest, type UpdateSessionNotesRequest, type UpdateSessionNotesResponse, type UpdateTrainingPartnerPermissionsRequest, type UpdateWeekStartRequest, type UpsertBodyMeasurementRequest, type UpsertRoutineTrainingBlockRequest, type UpsertSetLogRequest, type UpsertSetLogResponse, type UserId, type UserProfile, type UserSearchResponse, type VolumeTrendPoint, type VolumeTrendQuery, type VolumeTrendResponse, type VolumeTrendSeries, WEEK_STARTS, WEIGHT_UNITS, WORKOUT_SESSION_STATUSES, type WarmUpEquipment, type WarmUpLoad, type WarmUpRamp, type WarmUpSet, type WarmUpStep, type WeekStartsOn, type WeightUnit, type WorkoutAnalyticsStatus, type WorkoutPeriod, type WorkoutProgressQuery, type WorkoutProgressResponse, type WorkoutSearchPage, type WorkoutSession, type WorkoutSessionId, type WorkoutSessionListResponse, type WorkoutSessionRecap, type WorkoutSessionSnapshotV1, type WorkoutSessionStatus, type WorkoutSessionSummary, type WorkoutSignal, type WorkoutStatsQuery, type WorkoutStatsResponse, accountExportFileName, apiError, apiErrorMessage, applyDeload, bodyMeasurementProblems, bodyProgressRangeStart, buildWarmUpRamp, calculatePlateLoading, canLinkToNext, cmToFeetInches, cmToInches, countsAsWork, countsForProgression, customExerciseProblem, defaultWarmUpEquipment, deloadLengthDays, exerciseGroupLabel, exerciseGroupPosition, exerciseGroups, exerciseNameKey, feetInchesToCm, followWorkingLoad, goalSuggestionKey, hasOversizedGroup, inchesToCm, isApiErrorCode, isAppLocale, isBarLoaded, isBodyMeasurementDate, isDashboardSectionId, isDefaultDashboardLayout, isGoalSuggestionKey, isMessagePermission, isOnboardingStepId, isRealtimeTopic, isSetKind, isWeekStartsOn, isWithinQuietHours, latestBodyWeight, leadWorkingWeight, matchesDeletionConfirmation, messageBodyLength, normalizeDashboardLayout, normalizeExerciseLinks, normalizeExerciseName, normalizeMessageBody, normalizeSearchQuery, parseRealtimeEvent, primaryEquipment, requiredToFinish, resolveActiveTrainingBlock, resolveRoutinePlan, routineDayLabel, sessionCorrectionWindow, setKindOf, setLogValuesDiffer, summarizeBodyProgress, trainingBlockCovers, warmUpLoad, weekStartOf };
|
package/dist/index.js
CHANGED
|
@@ -1330,6 +1330,8 @@ var API_ERROR_MESSAGES = {
|
|
|
1330
1330
|
REPORT_NOT_FOUND: "Report not found",
|
|
1331
1331
|
REPORT_SUBJECT_NOT_FOUND: "Subject not found",
|
|
1332
1332
|
REPORTED_CONTENT_GONE: "The reported content no longer exists",
|
|
1333
|
+
CONVERSATION_NOT_FOUND: "Conversation not found",
|
|
1334
|
+
MESSAGE_NOT_FOUND: "Message not found",
|
|
1333
1335
|
SHARE_LINK_NOT_FOUND: "Share link not found",
|
|
1334
1336
|
LINK_NOT_FOUND: "Link not found",
|
|
1335
1337
|
SHARED_SESSION_NOT_FOUND: "Shared session not found",
|
|
@@ -1455,6 +1457,14 @@ var API_ERROR_MESSAGES = {
|
|
|
1455
1457
|
PARTNERS_MAX: "An account can have at most {max} training partners.",
|
|
1456
1458
|
ENCOURAGEMENTS_MAX: "You can send this partner at most {max} encouragements in 24 hours.",
|
|
1457
1459
|
ENCOURAGEMENT_RETRY: "Please retry the encouragement.",
|
|
1460
|
+
// ── Direct messages (MSG-01) ───────────────────────────────────────────
|
|
1461
|
+
MESSAGE_SELF: "You cannot message yourself",
|
|
1462
|
+
MESSAGE_LENGTH: "A message must not be empty and may be at most {max} characters.",
|
|
1463
|
+
MESSAGES_PER_MINUTE: "You can send at most {max} messages a minute.",
|
|
1464
|
+
CONVERSATIONS_PER_DAY: "You can start at most {max} new conversations a day.",
|
|
1465
|
+
MESSAGE_NOT_ADMITTED: "This member is not taking messages from you.",
|
|
1466
|
+
CONVERSATION_CLOSED: "This conversation can no longer receive messages.",
|
|
1467
|
+
MESSAGING_UNAVAILABLE: "Messaging is not available for this account.",
|
|
1458
1468
|
// ── Account and settings ───────────────────────────────────────────────
|
|
1459
1469
|
ACCOUNT_CONFLICT: "Account conflict for this email",
|
|
1460
1470
|
ACCOUNT_DELETE_CONFIRMATION: "Type your username exactly as it appears to confirm.",
|
|
@@ -1504,6 +1514,56 @@ function normalizeSearchQuery(raw) {
|
|
|
1504
1514
|
}
|
|
1505
1515
|
var RECENT_SEARCHES_MAX = 10;
|
|
1506
1516
|
var RECENT_SEARCH_KINDS = ["MEMBER", "EXERCISE", "ROUTINE", "WORKOUT"];
|
|
1517
|
+
|
|
1518
|
+
// src/realtime.ts
|
|
1519
|
+
var REALTIME_STREAM_PATH = "/realtime/stream";
|
|
1520
|
+
var REALTIME_TOPICS = ["notifications", "conversations"];
|
|
1521
|
+
var REALTIME_HEARTBEAT_MS = 25e3;
|
|
1522
|
+
var REALTIME_MAX_STREAM_MS = 14 * 6e4;
|
|
1523
|
+
var REALTIME_MAX_STREAMS_PER_MEMBER = 5;
|
|
1524
|
+
var REALTIME_UNAVAILABLE_RETRY_SECONDS = 300;
|
|
1525
|
+
function isRealtimeTopic(value) {
|
|
1526
|
+
return REALTIME_TOPICS.includes(value);
|
|
1527
|
+
}
|
|
1528
|
+
function parseRealtimeEvent(data) {
|
|
1529
|
+
let value;
|
|
1530
|
+
try {
|
|
1531
|
+
value = JSON.parse(data);
|
|
1532
|
+
} catch {
|
|
1533
|
+
return null;
|
|
1534
|
+
}
|
|
1535
|
+
if (typeof value !== "object" || value === null) return null;
|
|
1536
|
+
const event = value;
|
|
1537
|
+
if (event.type === "changed" && isRealtimeTopic(event.topic)) {
|
|
1538
|
+
return { type: "changed", topic: event.topic };
|
|
1539
|
+
}
|
|
1540
|
+
if (event.type === "ready" && Array.isArray(event.topics)) {
|
|
1541
|
+
return { type: "ready", topics: event.topics.filter(isRealtimeTopic) };
|
|
1542
|
+
}
|
|
1543
|
+
return null;
|
|
1544
|
+
}
|
|
1545
|
+
|
|
1546
|
+
// src/messages.ts
|
|
1547
|
+
var MESSAGE_PERMISSIONS = ["FOLLOWED", "NOBODY"];
|
|
1548
|
+
var DEFAULT_MESSAGE_PERMISSION = "FOLLOWED";
|
|
1549
|
+
var MESSAGE_BODY_MAX = 2e3;
|
|
1550
|
+
var MESSAGES_PER_MINUTE_MAX = 30;
|
|
1551
|
+
var NEW_CONVERSATIONS_PER_DAY_MAX = 20;
|
|
1552
|
+
var CONVERSATIONS_PAGE_SIZE = 20;
|
|
1553
|
+
var MESSAGES_PAGE_SIZE = 30;
|
|
1554
|
+
function messageBodyLength(body) {
|
|
1555
|
+
return Array.from(body).length;
|
|
1556
|
+
}
|
|
1557
|
+
function normalizeMessageBody(body) {
|
|
1558
|
+
const text = body.replace(/\r\n?/g, "\n").trim();
|
|
1559
|
+
if (text.length === 0 || messageBodyLength(text) > MESSAGE_BODY_MAX) {
|
|
1560
|
+
return null;
|
|
1561
|
+
}
|
|
1562
|
+
return text;
|
|
1563
|
+
}
|
|
1564
|
+
function isMessagePermission(value) {
|
|
1565
|
+
return MESSAGE_PERMISSIONS.includes(value);
|
|
1566
|
+
}
|
|
1507
1567
|
export {
|
|
1508
1568
|
ACCOUNT_EXPORT_FORMAT,
|
|
1509
1569
|
ACCOUNT_EXPORT_VERSION,
|
|
@@ -1537,6 +1597,7 @@ export {
|
|
|
1537
1597
|
COMEBACK_REQUIRED_ACTIVE_DAYS,
|
|
1538
1598
|
COMEBACK_SESSION_LOOKBACK,
|
|
1539
1599
|
COMEBACK_WINDOW_DAYS,
|
|
1600
|
+
CONVERSATIONS_PAGE_SIZE,
|
|
1540
1601
|
CUSTOM_EXERCISES_MAX,
|
|
1541
1602
|
CUSTOM_EXERCISE_NAME_MAX,
|
|
1542
1603
|
CUSTOM_EXERCISE_NOTE_MAX,
|
|
@@ -1545,6 +1606,7 @@ export {
|
|
|
1545
1606
|
DASHBOARD_SECTION_IDS,
|
|
1546
1607
|
DEFAULT_DASHBOARD_LAYOUT,
|
|
1547
1608
|
DEFAULT_LOCALE,
|
|
1609
|
+
DEFAULT_MESSAGE_PERMISSION,
|
|
1548
1610
|
DEFAULT_WEEK_STARTS_ON,
|
|
1549
1611
|
DELOAD_DEFAULT_DAYS,
|
|
1550
1612
|
DELOAD_DEFAULT_LOAD_REDUCTION,
|
|
@@ -1583,6 +1645,10 @@ export {
|
|
|
1583
1645
|
MEASURABLE_GOALS_MAX,
|
|
1584
1646
|
MEASURABLE_GOAL_DIRECTIONS,
|
|
1585
1647
|
MEASURABLE_GOAL_TYPES,
|
|
1648
|
+
MESSAGES_PAGE_SIZE,
|
|
1649
|
+
MESSAGES_PER_MINUTE_MAX,
|
|
1650
|
+
MESSAGE_BODY_MAX,
|
|
1651
|
+
MESSAGE_PERMISSIONS,
|
|
1586
1652
|
MINUTES_IN_DAY,
|
|
1587
1653
|
MODERATION_ACTION_KINDS,
|
|
1588
1654
|
MODERATION_HISTORY_PAGE_SIZE,
|
|
@@ -1590,6 +1656,7 @@ export {
|
|
|
1590
1656
|
MODERATION_QUEUE_PAGE_SIZE,
|
|
1591
1657
|
MOVEMENT_PATTERNS,
|
|
1592
1658
|
MUSCLE_GROUPS,
|
|
1659
|
+
NEW_CONVERSATIONS_PER_DAY_MAX,
|
|
1593
1660
|
NOTIFICATIONS_LIST_LIMIT,
|
|
1594
1661
|
NOTIFICATIONS_LOOKBACK_DAYS,
|
|
1595
1662
|
NOTIFICATIONS_PAGE_SIZE,
|
|
@@ -1619,6 +1686,12 @@ export {
|
|
|
1619
1686
|
PROGRESS_TIMELINE_EVENT_TYPES,
|
|
1620
1687
|
PUSH_PAYLOAD_KINDS,
|
|
1621
1688
|
PUSH_SUBSCRIPTIONS_MAX,
|
|
1689
|
+
REALTIME_HEARTBEAT_MS,
|
|
1690
|
+
REALTIME_MAX_STREAMS_PER_MEMBER,
|
|
1691
|
+
REALTIME_MAX_STREAM_MS,
|
|
1692
|
+
REALTIME_STREAM_PATH,
|
|
1693
|
+
REALTIME_TOPICS,
|
|
1694
|
+
REALTIME_UNAVAILABLE_RETRY_SECONDS,
|
|
1622
1695
|
RECENT_SEARCHES_MAX,
|
|
1623
1696
|
RECENT_SEARCH_KINDS,
|
|
1624
1697
|
RELATIONSHIP_LIST_DEFAULT_LIMIT,
|
|
@@ -1740,17 +1813,22 @@ export {
|
|
|
1740
1813
|
isDashboardSectionId,
|
|
1741
1814
|
isDefaultDashboardLayout,
|
|
1742
1815
|
isGoalSuggestionKey,
|
|
1816
|
+
isMessagePermission,
|
|
1743
1817
|
isOnboardingStepId,
|
|
1818
|
+
isRealtimeTopic,
|
|
1744
1819
|
isSetKind,
|
|
1745
1820
|
isWeekStartsOn,
|
|
1746
1821
|
isWithinQuietHours,
|
|
1747
1822
|
latestBodyWeight,
|
|
1748
1823
|
leadWorkingWeight,
|
|
1749
1824
|
matchesDeletionConfirmation,
|
|
1825
|
+
messageBodyLength,
|
|
1750
1826
|
normalizeDashboardLayout,
|
|
1751
1827
|
normalizeExerciseLinks,
|
|
1752
1828
|
normalizeExerciseName,
|
|
1829
|
+
normalizeMessageBody,
|
|
1753
1830
|
normalizeSearchQuery,
|
|
1831
|
+
parseRealtimeEvent,
|
|
1754
1832
|
primaryEquipment,
|
|
1755
1833
|
requiredToFinish,
|
|
1756
1834
|
resolveActiveTrainingBlock,
|