onehook-api-client 1.0.43 → 1.0.44
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/README.md +0 -147
- package/dist-cjs/events/catalog.js +141 -0
- package/dist-cjs/events/details.js +129 -0
- package/dist-cjs/events/index.js +5 -0
- package/dist-cjs/telemetry/index.js +59 -3
- package/dist-es/events/catalog.js +137 -0
- package/dist-es/events/details.js +126 -0
- package/dist-es/events/index.js +2 -0
- package/dist-es/telemetry/index.js +59 -3
- package/dist-types/events/catalog.d.ts +145 -0
- package/dist-types/events/details.d.ts +734 -0
- package/dist-types/events/index.d.ts +2 -0
- package/dist-types/graphql/types.d.ts +52 -4
- package/dist-types/models/models_0.d.ts +496 -496
- package/dist-types/telemetry/index.d.ts +30 -2
- package/manifest/ApiManifest.kt +135 -0
- package/manifest/ApiManifest.swift +137 -0
- package/manifest/api-manifest.json +816 -0
- package/openapi/OneHookService.openapi.json +19202 -0
- package/package.json +12 -2
- package/telemetry/TELEMETRY_CONTRACT.txt +35 -0
- package/telemetry/TelemetryCatalog.kt +33 -5
- package/telemetry/TelemetryCatalog.swift +61 -5
- package/telemetry/telemetry-catalog.json +505 -3
|
@@ -0,0 +1,734 @@
|
|
|
1
|
+
/** The draft-04 subset the event schemas use. */
|
|
2
|
+
export type JsonSchema = {
|
|
3
|
+
type?: 'object' | 'string' | 'integer' | 'number' | 'boolean' | 'array';
|
|
4
|
+
required?: string[];
|
|
5
|
+
properties?: Record<string, JsonSchema>;
|
|
6
|
+
items?: JsonSchema;
|
|
7
|
+
enum?: (string | number)[];
|
|
8
|
+
minLength?: number;
|
|
9
|
+
maxLength?: number;
|
|
10
|
+
minimum?: number;
|
|
11
|
+
maximum?: number;
|
|
12
|
+
minItems?: number;
|
|
13
|
+
maxItems?: number;
|
|
14
|
+
description?: string;
|
|
15
|
+
};
|
|
16
|
+
/** One event's current `detail` schema version and JSON Schema. */
|
|
17
|
+
export interface EventDetailSchema {
|
|
18
|
+
version: number;
|
|
19
|
+
detail: JsonSchema;
|
|
20
|
+
}
|
|
21
|
+
/** GDPR: erase and tombstone the account. */
|
|
22
|
+
export interface AccountDeletionEvent {
|
|
23
|
+
timestamp: number;
|
|
24
|
+
userId: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The moderation account state a member can be in. Absent/`ACTIVE` means no restriction. Owned by
|
|
28
|
+
* Identity (sign-in and token refresh enforce it directly); Matching and the admin portal consume
|
|
29
|
+
* the `AccountStateChanged` event.
|
|
30
|
+
*/
|
|
31
|
+
export type AccountState = "ACTIVE" | "RESTRICTED" | "SUSPENDED" | "BANNED";
|
|
32
|
+
/**
|
|
33
|
+
* identity `AccountStateServiceImpl` via the Identity outbox, whenever an admin changes a member's
|
|
34
|
+
* moderation account state. No PII: the userId, the new state, an optional expiry and a reason code.
|
|
35
|
+
*/
|
|
36
|
+
export interface AccountStateChangedDetail {
|
|
37
|
+
/** Set by the Identity outbox on every event. */
|
|
38
|
+
eventId?: string;
|
|
39
|
+
userId: string;
|
|
40
|
+
state: AccountState;
|
|
41
|
+
reasonCode: string;
|
|
42
|
+
/** When the change was applied, epoch milliseconds. */
|
|
43
|
+
changedAt: number;
|
|
44
|
+
/**
|
|
45
|
+
* When the RESTRICTED/SUSPENDED state expires, epoch milliseconds (the member is ACTIVE again
|
|
46
|
+
* once passed). Absent for ACTIVE and for the permanent BANNED state.
|
|
47
|
+
*/
|
|
48
|
+
until?: number;
|
|
49
|
+
}
|
|
50
|
+
/** state `OutboxEventSerializer.aiContextRequested`: ids and time only, never AI output or content. */
|
|
51
|
+
export interface AiContextRequestedDetail {
|
|
52
|
+
schemaVersion: number;
|
|
53
|
+
matchId: string;
|
|
54
|
+
/** The member the AI acted for. */
|
|
55
|
+
userId: string;
|
|
56
|
+
/** Epoch milliseconds. */
|
|
57
|
+
requestedAt: number;
|
|
58
|
+
}
|
|
59
|
+
/** chat `CallEndedPublisher`: one per call reaching ENDED. Ids and metadata only. */
|
|
60
|
+
export interface CallEndedDetail {
|
|
61
|
+
matchId: string;
|
|
62
|
+
callId: string;
|
|
63
|
+
callerId: string;
|
|
64
|
+
calleeId: string;
|
|
65
|
+
media: CallMediaKind;
|
|
66
|
+
/**
|
|
67
|
+
* HANGUP | DECLINED | CANCELLED | MISSED | BUSY | ANSWERED_ELSEWHERE | FAILED | DROPPED | UNMATCHED |
|
|
68
|
+
* MAX_DURATION.
|
|
69
|
+
*/
|
|
70
|
+
endReason: string;
|
|
71
|
+
/** Connected duration in milliseconds; 0 if the call never connected. */
|
|
72
|
+
durationMs: number;
|
|
73
|
+
/** When the call started ringing, epoch milliseconds. */
|
|
74
|
+
startedAt: number;
|
|
75
|
+
/** When the call ended, epoch milliseconds. */
|
|
76
|
+
endedAt: number;
|
|
77
|
+
}
|
|
78
|
+
export type CallMediaKind = "AUDIO" | "VIDEO";
|
|
79
|
+
/** state `OutboxEventSerializer.capacityReached`: the hook filled this member's last slot. */
|
|
80
|
+
export interface CapacityReachedDetail {
|
|
81
|
+
userId: string;
|
|
82
|
+
stateVersion: number;
|
|
83
|
+
/** The hook that filled the last slot. Absent when a downgrade or a kept selection reached capacity. */
|
|
84
|
+
matchId?: string;
|
|
85
|
+
/**
|
|
86
|
+
* When the slot filled, epoch seconds. State clears the member's pending requests created at or
|
|
87
|
+
* before this time. Absent on events from before it was recorded.
|
|
88
|
+
*/
|
|
89
|
+
reachedAt?: number;
|
|
90
|
+
}
|
|
91
|
+
/** Conversation activity in one match. */
|
|
92
|
+
export interface ChatEvent {
|
|
93
|
+
timestamp: number;
|
|
94
|
+
userId: string;
|
|
95
|
+
matchId: string;
|
|
96
|
+
type: ChatEventType;
|
|
97
|
+
latencyMs?: number;
|
|
98
|
+
}
|
|
99
|
+
export type ChatEventType = "MESSAGE_SENT" | "MESSAGE_RECEIVED" | "MATCH_CREATED" | "CHAT_OPENED" | "CHAT_CLOSED";
|
|
100
|
+
/**
|
|
101
|
+
* profile enrich-profile-event Lambda: the member's chat profile changed (moderation, analytics). Ids
|
|
102
|
+
* and moderation state only.
|
|
103
|
+
*/
|
|
104
|
+
export interface ChatProfileUpdatedDetail {
|
|
105
|
+
userId: string;
|
|
106
|
+
/** Epoch milliseconds. */
|
|
107
|
+
updatedAt: number;
|
|
108
|
+
writeToken?: string;
|
|
109
|
+
/** The display name, for moderation. Never forwarded to the intelligence platform. */
|
|
110
|
+
displayName?: string;
|
|
111
|
+
avatarKey?: string;
|
|
112
|
+
moderationStatus?: string;
|
|
113
|
+
}
|
|
114
|
+
/** A matched conversation was opened (investment / return signal) -> intelligence ChatEvent CHAT_OPENED. */
|
|
115
|
+
export interface ClientConversationOpenedDetail {
|
|
116
|
+
schemaVersion: number;
|
|
117
|
+
eventId: string;
|
|
118
|
+
/** Verified Cognito subject (the acting user). */
|
|
119
|
+
userId: string;
|
|
120
|
+
matchId: string;
|
|
121
|
+
/** Epoch milliseconds. */
|
|
122
|
+
occurredAt: number;
|
|
123
|
+
}
|
|
124
|
+
/** A candidate's/match's profile was re-opened (sustained interest) -> intelligence ProfileViewEvent. */
|
|
125
|
+
export interface ClientProfileRevisitDetail {
|
|
126
|
+
schemaVersion: number;
|
|
127
|
+
eventId: string;
|
|
128
|
+
userId: string;
|
|
129
|
+
viewedUserId: string;
|
|
130
|
+
occurredAt: number;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Impression-level profile view with dwell (a deck card the user lingered on) -> the intelligence engines (packages/intelligence)
|
|
134
|
+
* ProfileViewEvent, feeding base scoring + the dwell-velocity analyzer.
|
|
135
|
+
*/
|
|
136
|
+
export interface ClientProfileViewedDetail {
|
|
137
|
+
schemaVersion: number;
|
|
138
|
+
eventId: string;
|
|
139
|
+
userId: string;
|
|
140
|
+
viewedUserId: string;
|
|
141
|
+
/** Milliseconds the card was on screen. */
|
|
142
|
+
durationMs: number;
|
|
143
|
+
occurredAt: number;
|
|
144
|
+
}
|
|
145
|
+
/** A session lifecycle transition -> intelligence SessionEvent (prime-time + macro fatigue). */
|
|
146
|
+
export interface ClientSessionChangedDetail {
|
|
147
|
+
schemaVersion: number;
|
|
148
|
+
eventId: string;
|
|
149
|
+
userId: string;
|
|
150
|
+
phase: ClientSessionPhase;
|
|
151
|
+
occurredAt: number;
|
|
152
|
+
}
|
|
153
|
+
export type ClientSessionPhase = "START" | "END" | "FOREGROUND" | "BACKGROUND";
|
|
154
|
+
/** analytics conversation-health job: `userId` owes a reply in a conversation that went quiet. */
|
|
155
|
+
export interface ConversationCoolingDetail {
|
|
156
|
+
schemaVersion: number;
|
|
157
|
+
eventId: string;
|
|
158
|
+
matchId: string;
|
|
159
|
+
/** The recipient of the nudge (did not send the last message). */
|
|
160
|
+
userId: string;
|
|
161
|
+
partnerId: string;
|
|
162
|
+
/** When the last message was sent, epoch milliseconds. */
|
|
163
|
+
lastMessageAt: number;
|
|
164
|
+
messageCount: number;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* analytics social-graph projection, after each MessageSent: conversation features for the SENDER
|
|
168
|
+
* (`userId`) in one match, forwarded to the intelligence engines as a ChatEvent.
|
|
169
|
+
*/
|
|
170
|
+
export interface ConversationUpdatedDetail {
|
|
171
|
+
schemaVersion: number;
|
|
172
|
+
eventId: string;
|
|
173
|
+
matchId: string;
|
|
174
|
+
/** The user who just sent a message (the actor). */
|
|
175
|
+
userId: string;
|
|
176
|
+
partnerId: string;
|
|
177
|
+
/** When the message was sent, epoch milliseconds. */
|
|
178
|
+
occurredAt: number;
|
|
179
|
+
messageCount: number;
|
|
180
|
+
/** Set when this message answered the partner's previous message. */
|
|
181
|
+
replyLatencyMs?: number;
|
|
182
|
+
initiatedByUser?: boolean;
|
|
183
|
+
responded?: boolean;
|
|
184
|
+
}
|
|
185
|
+
export type Decision = "LIKE" | "PASS" | "SUPER_LIKE";
|
|
186
|
+
/** identity `OtpRequestServiceImpl`: send this OTP by email (EmailWorker). `Decoy` as above. */
|
|
187
|
+
export interface EmailOtpRequestedDetail {
|
|
188
|
+
email: string;
|
|
189
|
+
otp: string;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* state `OutboxEventSerializer.entitlementsChanged`: a member's tier was reconciled. Matching projects
|
|
193
|
+
* the tier (incognito entitlement and ranking).
|
|
194
|
+
*/
|
|
195
|
+
export interface EntitlementsChangedDetail {
|
|
196
|
+
userId: string;
|
|
197
|
+
/**
|
|
198
|
+
* The new tier's wire value (club.onehook.common#SubscriptionTier). A String on purpose: consumers
|
|
199
|
+
* resolve it with SubscriptionTier.resolve, which reports an unknown value instead of dropping it.
|
|
200
|
+
*/
|
|
201
|
+
subscriptionTier: string;
|
|
202
|
+
/** The source event's time, epoch seconds. */
|
|
203
|
+
effectiveAt: number;
|
|
204
|
+
/** The member's State item version after the change. Absent when only the tier changed. */
|
|
205
|
+
stateVersion?: number;
|
|
206
|
+
/** True when the member holds as many hooks as their new capacity. Sent with `stateVersion`. */
|
|
207
|
+
discoveryPaused?: boolean;
|
|
208
|
+
}
|
|
209
|
+
/** state `OutboxEventSerializer.hookCreated`. */
|
|
210
|
+
export interface HookCreatedDetail {
|
|
211
|
+
matchId: string;
|
|
212
|
+
userA: string;
|
|
213
|
+
userB: string;
|
|
214
|
+
/** Absent only on events from before origins were recorded. */
|
|
215
|
+
origin?: HookOrigin;
|
|
216
|
+
/** Epoch seconds. Absent on events from before it was recorded. */
|
|
217
|
+
hookedAt?: number;
|
|
218
|
+
/** Absent on events from before capacity was published. */
|
|
219
|
+
participants?: HookParticipant[];
|
|
220
|
+
}
|
|
221
|
+
/** Why a hook ended. */
|
|
222
|
+
export type HookEndReason = "UNHOOK" | "BLOCKED" | "ACCOUNT_DELETED" | "TIER_DOWNGRADE";
|
|
223
|
+
/** How a hook was formed. */
|
|
224
|
+
export type HookOrigin = "DISCOVERY" | "REQUEST";
|
|
225
|
+
/**
|
|
226
|
+
* One participant's capacity after a hook change. Consumers apply it last-writer-wins on
|
|
227
|
+
* `stateVersion`, which increments on every write that changes the member's connections or capacity.
|
|
228
|
+
*/
|
|
229
|
+
export interface HookParticipant {
|
|
230
|
+
userId: string;
|
|
231
|
+
/** True when the member now holds as many hooks as their capacity. */
|
|
232
|
+
discoveryPaused: boolean;
|
|
233
|
+
stateVersion: number;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* state `OutboxEventSerializer.hookReleased`. Every member but `matchId` is absent on events from before
|
|
237
|
+
* it was recorded; `reason` and `endedBy` are also absent when they do not apply.
|
|
238
|
+
*/
|
|
239
|
+
export interface HookReleasedDetail {
|
|
240
|
+
matchId: string;
|
|
241
|
+
/** A free-text unhook reason from the client. */
|
|
242
|
+
reason?: string;
|
|
243
|
+
userA?: string;
|
|
244
|
+
userB?: string;
|
|
245
|
+
origin?: HookOrigin;
|
|
246
|
+
/** Epoch seconds. */
|
|
247
|
+
hookedAt?: number;
|
|
248
|
+
/** Epoch seconds. */
|
|
249
|
+
releasedAt?: number;
|
|
250
|
+
endReason?: HookEndReason;
|
|
251
|
+
/** The member who ended it; absent for system releases. */
|
|
252
|
+
endedBy?: string;
|
|
253
|
+
participants?: HookParticipant[];
|
|
254
|
+
}
|
|
255
|
+
/** state `OutboxEventSerializer.hookRequested`: a username request was delivered to `toUserId`. */
|
|
256
|
+
export interface HookRequestedDetail {
|
|
257
|
+
requestId: string;
|
|
258
|
+
fromUserId: string;
|
|
259
|
+
toUserId: string;
|
|
260
|
+
createdAt: number;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* state `OutboxEventSerializer.hookSuspension`. Chat sets or clears the conversation's `suspended`
|
|
264
|
+
* flag.
|
|
265
|
+
*/
|
|
266
|
+
export interface HookSuspensionDetail {
|
|
267
|
+
matchId: string;
|
|
268
|
+
userA: string;
|
|
269
|
+
userB: string;
|
|
270
|
+
/** Members still over capacity for this hook (empty on `HookResumed`). */
|
|
271
|
+
suspendedBy: string[];
|
|
272
|
+
at: number;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* intelligence engine `ScoreRefresher` (`ScoreUpdate`, packages/intelligence/engine). Consumers apply
|
|
276
|
+
* updates out of order, last `computedAt` wins.
|
|
277
|
+
*/
|
|
278
|
+
export interface IntelligenceScoresUpdatedDetail {
|
|
279
|
+
schemaVersion: number;
|
|
280
|
+
/** Always `IntelligenceScoresUpdated`. */
|
|
281
|
+
eventType?: string;
|
|
282
|
+
eventId: string;
|
|
283
|
+
/** The target: each score says how interested a viewer is in this user. */
|
|
284
|
+
userId: string;
|
|
285
|
+
computedAt: number;
|
|
286
|
+
scores: ViewerScore[];
|
|
287
|
+
shouldShowPaywall?: boolean;
|
|
288
|
+
injectHighProbabilityMatch?: boolean;
|
|
289
|
+
sourceEventId?: string;
|
|
290
|
+
/** The triggering event's time; `computedAt - sourceEventTimestamp` is the data freshness. */
|
|
291
|
+
sourceEventTimestamp?: number;
|
|
292
|
+
sourcePublishedAt?: number;
|
|
293
|
+
experimentId?: string;
|
|
294
|
+
variantId?: string;
|
|
295
|
+
policyVersion?: string;
|
|
296
|
+
}
|
|
297
|
+
/** identity `AuthServiceImpl.buildInviteRedeemedEvent`. `userId` is the invitee. */
|
|
298
|
+
export interface InviteRedeemedDetail {
|
|
299
|
+
eventId: string;
|
|
300
|
+
/** The inviter. */
|
|
301
|
+
referrerId: string;
|
|
302
|
+
inviteCode: string;
|
|
303
|
+
/** The invitee. Always set since 2026-10 (additive); absent on earlier events. */
|
|
304
|
+
userId?: string;
|
|
305
|
+
}
|
|
306
|
+
/** state `OutboxEventSerializer.matchingDisabled`: both erasure steps confirmed. */
|
|
307
|
+
export interface MatchingDisabledDetail {
|
|
308
|
+
userId: string;
|
|
309
|
+
generation: number;
|
|
310
|
+
disabledAt: number;
|
|
311
|
+
}
|
|
312
|
+
/** profile `MatchingEventPublisher`: a matching draft was erased after 30 days without edits. */
|
|
313
|
+
export interface MatchingDraftExpiredDetail {
|
|
314
|
+
userId: string;
|
|
315
|
+
generation: number;
|
|
316
|
+
expiredAt: number;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* profile `MatchingEventPublisher`: a matching draft will be erased in 3 days unless edited (Chat sends
|
|
320
|
+
* a reminder push).
|
|
321
|
+
*/
|
|
322
|
+
export interface MatchingDraftExpiringDetail {
|
|
323
|
+
userId: string;
|
|
324
|
+
expiresAt: number;
|
|
325
|
+
}
|
|
326
|
+
/** state `OutboxEventSerializer.matchingEnabled`. */
|
|
327
|
+
export interface MatchingEnabledDetail {
|
|
328
|
+
userId: string;
|
|
329
|
+
generation: number;
|
|
330
|
+
enabledAt: number;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Profile (matching profile, media, liveness) or Matching (every row naming the member) finished
|
|
334
|
+
* erasing a member's matching data for `generation`.
|
|
335
|
+
*/
|
|
336
|
+
export interface MatchingErasedDetail {
|
|
337
|
+
userId: string;
|
|
338
|
+
generation: number;
|
|
339
|
+
}
|
|
340
|
+
/** Matching was turned off: erase the member's matching data up to `requestedAt`. A higher `generation` wins. */
|
|
341
|
+
export interface MatchingErasureEvent {
|
|
342
|
+
timestamp: number;
|
|
343
|
+
userId: string;
|
|
344
|
+
/** The matching generation being erased (State's MatchingOptOutStarted.generation). */
|
|
345
|
+
generation: number;
|
|
346
|
+
/** Epoch seconds: erase everything about the member up to this time. */
|
|
347
|
+
requestedAt: number;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* state `OutboxEventSerializer.matchingOptOutStarted`. Re-emitted once, unchanged, by the stuck-erasure
|
|
351
|
+
* sweep.
|
|
352
|
+
*/
|
|
353
|
+
export interface MatchingOptOutStartedDetail {
|
|
354
|
+
userId: string;
|
|
355
|
+
generation: number;
|
|
356
|
+
/** Epoch seconds. Derived stores delete data up to this time. */
|
|
357
|
+
requestedAt: number;
|
|
358
|
+
}
|
|
359
|
+
/**
|
|
360
|
+
* state `OutboxEventSerializer.memberReported`. Ids plus moderation metadata; the free-text report
|
|
361
|
+
* details stay in State and the portal reads them through the IAM-only admin route.
|
|
362
|
+
*/
|
|
363
|
+
export interface MemberReportedDetail {
|
|
364
|
+
/** UUID of the stored report. */
|
|
365
|
+
reportId: string;
|
|
366
|
+
reporterId: string;
|
|
367
|
+
reportedId: string;
|
|
368
|
+
category: ReportCategory;
|
|
369
|
+
severity: ReportSeverity;
|
|
370
|
+
alsoBlocked: boolean;
|
|
371
|
+
evidenceOffered: boolean;
|
|
372
|
+
/** The match or conversation the report was filed from. */
|
|
373
|
+
conversationId?: string;
|
|
374
|
+
/** Epoch milliseconds. */
|
|
375
|
+
reportedAt: number;
|
|
376
|
+
}
|
|
377
|
+
/** chat EventBridge Pipe input template (chat-stack.ts). */
|
|
378
|
+
export interface MessageSentDetail {
|
|
379
|
+
matchId: string;
|
|
380
|
+
senderId: string;
|
|
381
|
+
/** Epoch milliseconds. */
|
|
382
|
+
timestamp: number;
|
|
383
|
+
}
|
|
384
|
+
/** profile `ModerationWorkerServiceImpl`: moderation rejected some of a member's media or fields. */
|
|
385
|
+
export interface ModerationRejectedDetail {
|
|
386
|
+
userId: string;
|
|
387
|
+
/** The rejected media object keys or field names. */
|
|
388
|
+
rejectedKeys: string[];
|
|
389
|
+
/** Epoch milliseconds. */
|
|
390
|
+
timestamp: number;
|
|
391
|
+
}
|
|
392
|
+
/** matching `DefaultMatchOutboxWriter`. */
|
|
393
|
+
export interface MutualMatchDetail {
|
|
394
|
+
matchId: string;
|
|
395
|
+
userA: string;
|
|
396
|
+
userB: string;
|
|
397
|
+
}
|
|
398
|
+
/** identity `UserServiceImpl` (phone change). */
|
|
399
|
+
export interface PhoneNumberChangedDetail {
|
|
400
|
+
eventId: string;
|
|
401
|
+
userId: string;
|
|
402
|
+
phoneNumber: string;
|
|
403
|
+
/** Absent for a legacy account that has no stored Cognito username (CognitoSyncWorker skips the event). */
|
|
404
|
+
cognitoUsername?: string;
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* identity `OtpRequestServiceImpl`: send this OTP by SMS (SmsWorker). The `Decoy` type is published on a
|
|
408
|
+
* detail-type no rule routes, so an unknown number gets the same timing and nothing is delivered.
|
|
409
|
+
*/
|
|
410
|
+
export interface PhoneOtpRequestedDetail {
|
|
411
|
+
/** E.164. */
|
|
412
|
+
phoneNumber: string;
|
|
413
|
+
otp: string;
|
|
414
|
+
}
|
|
415
|
+
/** analytics canary: a synthetic probe; `sentAt` lets the lake measure end-to-end latency. */
|
|
416
|
+
export interface PipelineCanaryDetail {
|
|
417
|
+
schemaVersion: number;
|
|
418
|
+
eventId: string;
|
|
419
|
+
/** When the canary was published, epoch milliseconds. */
|
|
420
|
+
sentAt: number;
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* identity `PreservationHoldServiceImpl` via the Identity outbox, whenever an admin sets or releases a
|
|
424
|
+
* legal preservation hold. No PII. `caseRef` stays in Identity; the portal reads it through the IAM-only
|
|
425
|
+
* admin route.
|
|
426
|
+
*/
|
|
427
|
+
export interface PreservationHoldChangedDetail {
|
|
428
|
+
/** Set by the Identity outbox on every event. */
|
|
429
|
+
eventId?: string;
|
|
430
|
+
userId: string;
|
|
431
|
+
active: boolean;
|
|
432
|
+
reasonCode: string;
|
|
433
|
+
/** When the change was applied, epoch milliseconds. */
|
|
434
|
+
changedAt: number;
|
|
435
|
+
/** When the hold expires, epoch milliseconds. Absent when the hold is released. */
|
|
436
|
+
until?: number;
|
|
437
|
+
}
|
|
438
|
+
export type ProfileItemKind = "CHAT" | "MATCHING";
|
|
439
|
+
/** matching `ProfileLikedPublisher`. */
|
|
440
|
+
export interface ProfileLikedDetail {
|
|
441
|
+
/** The recipient. */
|
|
442
|
+
userId: string;
|
|
443
|
+
/** The liker (never disclosed to the recipient). */
|
|
444
|
+
actorId: string;
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* profile enrich-profile-event Lambda: a member write left moderation pending; Profile's moderation worker
|
|
448
|
+
* moderates that item.
|
|
449
|
+
*/
|
|
450
|
+
export interface ProfileModerationRequestedDetail {
|
|
451
|
+
userId: string;
|
|
452
|
+
/** Which profile item to moderate. */
|
|
453
|
+
item: ProfileItemKind;
|
|
454
|
+
/** The write the moderation applies to; a newer write supersedes it. */
|
|
455
|
+
writeToken: string;
|
|
456
|
+
}
|
|
457
|
+
export interface ProfilePrompt {
|
|
458
|
+
questionId?: string;
|
|
459
|
+
questionText?: string;
|
|
460
|
+
answerText?: string;
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* profile enrich-profile-event Lambda: the member's ACTIVE matching profile changed. Published only
|
|
464
|
+
* while the matching profile is ACTIVE (Matching never sees a draft).
|
|
465
|
+
*/
|
|
466
|
+
export interface ProfileUpdatedDetail {
|
|
467
|
+
schemaVersion: number;
|
|
468
|
+
eventId: string;
|
|
469
|
+
/** Epoch milliseconds. */
|
|
470
|
+
updatedAt: number;
|
|
471
|
+
writeToken?: string;
|
|
472
|
+
profile: PublishedMatchingProfile;
|
|
473
|
+
/** Profile sections that changed since the previous image (Matching clears passes on them). */
|
|
474
|
+
changedSections?: string[];
|
|
475
|
+
}
|
|
476
|
+
/** The member's matching profile text changed. */
|
|
477
|
+
export interface ProfileUpdateEvent {
|
|
478
|
+
timestamp: number;
|
|
479
|
+
userId: string;
|
|
480
|
+
bio?: string;
|
|
481
|
+
interests?: string[];
|
|
482
|
+
prompts?: ProfilePrompt[];
|
|
483
|
+
}
|
|
484
|
+
/** A profile (or deck card) was viewed. */
|
|
485
|
+
export interface ProfileViewEvent {
|
|
486
|
+
timestamp: number;
|
|
487
|
+
viewerId: string;
|
|
488
|
+
targetId: string;
|
|
489
|
+
durationMs?: number;
|
|
490
|
+
photosViewed?: number;
|
|
491
|
+
totalPhotos?: number;
|
|
492
|
+
photoDurationsMs?: Record<string, number>;
|
|
493
|
+
bioExpanded?: boolean;
|
|
494
|
+
promptsRead?: number;
|
|
495
|
+
scrollDepthPercent?: number;
|
|
496
|
+
}
|
|
497
|
+
export interface PublishedBirthDetails {
|
|
498
|
+
/** Local birth date, `yyyy-MM-dd`. */
|
|
499
|
+
date: string;
|
|
500
|
+
/** True when `date` is a placeholder for a profile created before the birth date was compulsory. */
|
|
501
|
+
provisional?: boolean;
|
|
502
|
+
/** Local birth time, `HH:mm`. */
|
|
503
|
+
time?: string;
|
|
504
|
+
/** IANA time zone of the birthplace. */
|
|
505
|
+
timeZone?: string;
|
|
506
|
+
latitude?: number;
|
|
507
|
+
longitude?: number;
|
|
508
|
+
placeName?: string;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* The member's stored MATCHING profile item (without its internal attributes), merged with
|
|
512
|
+
* `displayName` from their chat profile and one `birthDetails`.
|
|
513
|
+
*/
|
|
514
|
+
export interface PublishedMatchingProfile {
|
|
515
|
+
userId: string;
|
|
516
|
+
/** From the chat profile. */
|
|
517
|
+
displayName?: string;
|
|
518
|
+
bio?: string;
|
|
519
|
+
interests?: string[];
|
|
520
|
+
prompts?: PublishedProfilePrompt[];
|
|
521
|
+
/** Always ACTIVE on published events. */
|
|
522
|
+
status?: PublishedProfileStatus;
|
|
523
|
+
/** The matching generation; Matching ignores events for an older generation. */
|
|
524
|
+
generation?: number;
|
|
525
|
+
/** The chat profile's birth date plus the matching profile's optional birth time and place. */
|
|
526
|
+
birthDetails?: PublishedBirthDetails;
|
|
527
|
+
/** Further stored attributes, passed through by the producer. */
|
|
528
|
+
[k: string]: unknown;
|
|
529
|
+
}
|
|
530
|
+
export interface PublishedProfilePrompt {
|
|
531
|
+
promptId?: string;
|
|
532
|
+
answer?: string;
|
|
533
|
+
imageKey?: string;
|
|
534
|
+
}
|
|
535
|
+
export type PublishedProfileStatus = "ACTIVE";
|
|
536
|
+
/** What a report is about. */
|
|
537
|
+
export type ReportCategory = "HARASSMENT" | "THREATS_VIOLENCE" | "SEXUAL_CONTENT_NONCONSENT" | "MINOR_SAFETY" | "SCAM_FRAUD" | "FAKE_IMPERSONATION" | "SPAM_PROMOTION" | "HATE" | "SELF_HARM_CONCERN" | "OFF_PLATFORM_HARM" | "OTHER";
|
|
538
|
+
export type ReportSeverity = "critical" | "high" | "standard";
|
|
539
|
+
/** A session lifecycle transition. */
|
|
540
|
+
export interface SessionEvent {
|
|
541
|
+
timestamp: number;
|
|
542
|
+
userId: string;
|
|
543
|
+
type: SessionType;
|
|
544
|
+
}
|
|
545
|
+
export type SessionType = "START" | "END" | "BACKGROUND" | "FOREGROUND";
|
|
546
|
+
/**
|
|
547
|
+
* identity `AuthServiceImpl`: Cognito was unlinked from a social provider but the DynamoDB write failed;
|
|
548
|
+
* an operator reconciles.
|
|
549
|
+
*/
|
|
550
|
+
export interface SocialUnlinkFailedDetail {
|
|
551
|
+
userId: string;
|
|
552
|
+
/** The social provider, e.g. GOOGLE or APPLE. */
|
|
553
|
+
provider: string;
|
|
554
|
+
cognitoUsername?: string;
|
|
555
|
+
}
|
|
556
|
+
/** Payments -> State (`EventDispatcher.handleSubscriptionChanged`). Produced outside this repository. */
|
|
557
|
+
export interface SubscriptionChangedDetail {
|
|
558
|
+
userId: string;
|
|
559
|
+
/**
|
|
560
|
+
* The tier's wire value (club.onehook.common#SubscriptionTier). A String on purpose: Payments is an
|
|
561
|
+
* outside producer, and State resolves the value with SubscriptionTier.resolve, which reports an
|
|
562
|
+
* unknown value instead of dropping it.
|
|
563
|
+
*/
|
|
564
|
+
subscriptionTier: string;
|
|
565
|
+
/** Legacy alias of `subscriptionTier`; State reads it only when `subscriptionTier` is absent. */
|
|
566
|
+
tier?: string;
|
|
567
|
+
/** Epoch seconds. */
|
|
568
|
+
effectiveAt?: number;
|
|
569
|
+
}
|
|
570
|
+
export type SwipeDirection = "RIGHT" | "LEFT" | "SUPER";
|
|
571
|
+
/** A swipe decision. */
|
|
572
|
+
export interface SwipeEvent {
|
|
573
|
+
timestamp: number;
|
|
574
|
+
viewerId: string;
|
|
575
|
+
targetId: string;
|
|
576
|
+
decision: Decision;
|
|
577
|
+
decisionLatencyMs?: number;
|
|
578
|
+
}
|
|
579
|
+
/** matching `EventBridgeSignalEventPublisher` (CDC of the `signals` table). */
|
|
580
|
+
export interface SwipeRecordedDetail {
|
|
581
|
+
schemaVersion: number;
|
|
582
|
+
eventId: string;
|
|
583
|
+
swiperId: string;
|
|
584
|
+
targetId: string;
|
|
585
|
+
direction: SwipeDirection;
|
|
586
|
+
mutual: boolean;
|
|
587
|
+
/** Epoch milliseconds. */
|
|
588
|
+
occurredAt: number;
|
|
589
|
+
}
|
|
590
|
+
/**
|
|
591
|
+
* state `OutboxEventSerializer.userBlocked`. Ids only; the reason and the display-name snapshot stay in
|
|
592
|
+
* State.
|
|
593
|
+
*/
|
|
594
|
+
export interface UserBlockedDetail {
|
|
595
|
+
blockerId: string;
|
|
596
|
+
blockedId: string;
|
|
597
|
+
/** Epoch milliseconds. */
|
|
598
|
+
blockedAt: number;
|
|
599
|
+
/** Absent only on events from before State owned blocks. */
|
|
600
|
+
version?: number;
|
|
601
|
+
}
|
|
602
|
+
/** profile `UserDeletedPublisher`. */
|
|
603
|
+
export interface UserDeletedDetail {
|
|
604
|
+
userId: string;
|
|
605
|
+
/** Epoch milliseconds. */
|
|
606
|
+
timestamp: number;
|
|
607
|
+
}
|
|
608
|
+
/** identity `AuthServiceImpl.buildUsernameChangedEvent` and `UserServiceImpl`. */
|
|
609
|
+
export interface UsernameChangedDetail {
|
|
610
|
+
eventId: string;
|
|
611
|
+
userId: string;
|
|
612
|
+
username: string;
|
|
613
|
+
/** Absent for a legacy account that has no stored Cognito username (CognitoSyncWorker skips the event). */
|
|
614
|
+
cognitoUsername?: string;
|
|
615
|
+
}
|
|
616
|
+
/** identity `AuthServiceImpl.buildUserRegisteredEvent`. */
|
|
617
|
+
export interface UserRegisteredDetail {
|
|
618
|
+
eventId: string;
|
|
619
|
+
userId: string;
|
|
620
|
+
/** Email or phone (legacy field name). */
|
|
621
|
+
email?: string;
|
|
622
|
+
}
|
|
623
|
+
/** state `OutboxEventSerializer.userUnblocked`. */
|
|
624
|
+
export interface UserUnblockedDetail {
|
|
625
|
+
blockerId: string;
|
|
626
|
+
blockedId: string;
|
|
627
|
+
/** Epoch milliseconds. */
|
|
628
|
+
unblockedAt: number;
|
|
629
|
+
version: number;
|
|
630
|
+
}
|
|
631
|
+
/** How interested one viewer is in the event's user. */
|
|
632
|
+
export interface ViewerScore {
|
|
633
|
+
viewerId: string;
|
|
634
|
+
score: number;
|
|
635
|
+
}
|
|
636
|
+
/** Server-authoritative domain events (catalog.ts `EventTypes`): detail-type -> detail. */
|
|
637
|
+
export interface EventDetailMap {
|
|
638
|
+
AccountStateChanged: AccountStateChangedDetail;
|
|
639
|
+
AiContextRequested: AiContextRequestedDetail;
|
|
640
|
+
CallEnded: CallEndedDetail;
|
|
641
|
+
CapacityReached: CapacityReachedDetail;
|
|
642
|
+
ChatProfileUpdated: ChatProfileUpdatedDetail;
|
|
643
|
+
ConversationCooling: ConversationCoolingDetail;
|
|
644
|
+
ConversationUpdated: ConversationUpdatedDetail;
|
|
645
|
+
EntitlementsChanged: EntitlementsChangedDetail;
|
|
646
|
+
HookCreated: HookCreatedDetail;
|
|
647
|
+
HookReleased: HookReleasedDetail;
|
|
648
|
+
HookRequested: HookRequestedDetail;
|
|
649
|
+
HookResumed: HookSuspensionDetail;
|
|
650
|
+
HookSuspended: HookSuspensionDetail;
|
|
651
|
+
IntelligenceScoresUpdated: IntelligenceScoresUpdatedDetail;
|
|
652
|
+
InviteRedeemed: InviteRedeemedDetail;
|
|
653
|
+
MatchingDataErased: MatchingErasedDetail;
|
|
654
|
+
MatchingDisabled: MatchingDisabledDetail;
|
|
655
|
+
MatchingDraftExpired: MatchingDraftExpiredDetail;
|
|
656
|
+
MatchingDraftExpiring: MatchingDraftExpiringDetail;
|
|
657
|
+
MatchingEnabled: MatchingEnabledDetail;
|
|
658
|
+
MatchingOptOutStarted: MatchingOptOutStartedDetail;
|
|
659
|
+
MatchingProfileErased: MatchingErasedDetail;
|
|
660
|
+
MemberReported: MemberReportedDetail;
|
|
661
|
+
MessageSent: MessageSentDetail;
|
|
662
|
+
MutualMatch: MutualMatchDetail;
|
|
663
|
+
PhoneNumberChanged: PhoneNumberChangedDetail;
|
|
664
|
+
PipelineCanary: PipelineCanaryDetail;
|
|
665
|
+
PreservationHoldChanged: PreservationHoldChangedDetail;
|
|
666
|
+
ProfileLiked: ProfileLikedDetail;
|
|
667
|
+
ProfileUpdated: ProfileUpdatedDetail;
|
|
668
|
+
SubscriptionChanged: SubscriptionChangedDetail;
|
|
669
|
+
SwipeRecorded: SwipeRecordedDetail;
|
|
670
|
+
UserBlocked: UserBlockedDetail;
|
|
671
|
+
UserDeleted: UserDeletedDetail;
|
|
672
|
+
UsernameChanged: UsernameChangedDetail;
|
|
673
|
+
UserRegistered: UserRegisteredDetail;
|
|
674
|
+
UserUnblocked: UserUnblockedDetail;
|
|
675
|
+
}
|
|
676
|
+
/** The Smithy structure of each EventDetailMap detail (also the Java class club.onehook.events.model.<name>). */
|
|
677
|
+
export declare const EVENT_DETAIL_SHAPES: {
|
|
678
|
+
readonly [T in keyof EventDetailMap]: string;
|
|
679
|
+
};
|
|
680
|
+
/** The current version and draft-04 JSON Schema of each EventDetailMap detail. */
|
|
681
|
+
export declare const EVENT_DETAIL_SCHEMAS: {
|
|
682
|
+
readonly [T in keyof EventDetailMap]: EventDetailSchema;
|
|
683
|
+
};
|
|
684
|
+
/** Service-internal events (not in the catalog, the registry or the lake): detail-type -> detail. */
|
|
685
|
+
export interface InternalEventDetailMap {
|
|
686
|
+
EmailVerificationRequested: EmailOtpRequestedDetail;
|
|
687
|
+
EmailVerificationRequestedDecoy: EmailOtpRequestedDetail;
|
|
688
|
+
ModerationRejected: ModerationRejectedDetail;
|
|
689
|
+
PhoneRegistrationRequested: PhoneOtpRequestedDetail;
|
|
690
|
+
PhoneRegistrationRequestedDecoy: PhoneOtpRequestedDetail;
|
|
691
|
+
ProfileModerationRequested: ProfileModerationRequestedDetail;
|
|
692
|
+
SocialUnlinkFailed: SocialUnlinkFailedDetail;
|
|
693
|
+
}
|
|
694
|
+
/** The Smithy structure of each InternalEventDetailMap detail (also the Java class club.onehook.events.model.<name>). */
|
|
695
|
+
export declare const INTERNAL_EVENT_DETAIL_SHAPES: {
|
|
696
|
+
readonly [T in keyof InternalEventDetailMap]: string;
|
|
697
|
+
};
|
|
698
|
+
/** The current version and draft-04 JSON Schema of each InternalEventDetailMap detail. */
|
|
699
|
+
export declare const INTERNAL_EVENT_DETAIL_SCHEMAS: {
|
|
700
|
+
readonly [T in keyof InternalEventDetailMap]: EventDetailSchema;
|
|
701
|
+
};
|
|
702
|
+
/** The intelligence engines' telemetry (EventEnvelope.eventType -> its `data`), published by the forwarder. */
|
|
703
|
+
export interface EngineEventMap {
|
|
704
|
+
AccountDeletionEvent: AccountDeletionEvent;
|
|
705
|
+
ChatEvent: ChatEvent;
|
|
706
|
+
MatchingErasureEvent: MatchingErasureEvent;
|
|
707
|
+
ProfileUpdateEvent: ProfileUpdateEvent;
|
|
708
|
+
ProfileViewEvent: ProfileViewEvent;
|
|
709
|
+
SessionEvent: SessionEvent;
|
|
710
|
+
SwipeEvent: SwipeEvent;
|
|
711
|
+
}
|
|
712
|
+
/** The Smithy structure of each EngineEventMap detail (also the Java class club.onehook.events.model.<name>). */
|
|
713
|
+
export declare const ENGINE_EVENT_SHAPES: {
|
|
714
|
+
readonly [T in keyof EngineEventMap]: string;
|
|
715
|
+
};
|
|
716
|
+
/** The current version and draft-04 JSON Schema of each EngineEventMap detail. */
|
|
717
|
+
export declare const ENGINE_EVENT_SCHEMAS: {
|
|
718
|
+
readonly [T in keyof EngineEventMap]: EventDetailSchema;
|
|
719
|
+
};
|
|
720
|
+
/** Client-telemetry events (client-telemetry.ts `ClientTelemetryTypes`): detail-type -> detail. */
|
|
721
|
+
export interface ClientTelemetryDetailMap {
|
|
722
|
+
ClientConversationOpened: ClientConversationOpenedDetail;
|
|
723
|
+
ClientProfileRevisit: ClientProfileRevisitDetail;
|
|
724
|
+
ClientProfileViewed: ClientProfileViewedDetail;
|
|
725
|
+
ClientSessionChanged: ClientSessionChangedDetail;
|
|
726
|
+
}
|
|
727
|
+
/** The Smithy structure of each ClientTelemetryDetailMap detail (also the Java class club.onehook.events.model.<name>). */
|
|
728
|
+
export declare const CLIENT_TELEMETRY_DETAIL_SHAPES: {
|
|
729
|
+
readonly [T in keyof ClientTelemetryDetailMap]: string;
|
|
730
|
+
};
|
|
731
|
+
/** The current version and draft-04 JSON Schema of each ClientTelemetryDetailMap detail. */
|
|
732
|
+
export declare const CLIENT_TELEMETRY_DETAIL_SCHEMAS: {
|
|
733
|
+
readonly [T in keyof ClientTelemetryDetailMap]: EventDetailSchema;
|
|
734
|
+
};
|