onehook-api-client 1.0.29 → 1.0.30
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 +7 -14
- package/dist-cjs/OneHook.js +2 -4
- package/dist-cjs/commands/{DiscoverByIntentCommand.js → RecordSuggestionCommand.js} +7 -7
- package/dist-cjs/commands/index.js +1 -2
- package/dist-cjs/models/models_0.js +7 -1
- package/dist-cjs/protocols/Aws_restJson1.js +41 -71
- package/dist-cjs/telemetry/index.js +43 -5
- package/dist-es/OneHook.js +2 -4
- package/dist-es/commands/{DiscoverByIntentCommand.js → RecordSuggestionCommand.js} +6 -6
- package/dist-es/commands/index.js +1 -2
- package/dist-es/models/models_0.js +6 -0
- package/dist-es/protocols/Aws_restJson1.js +36 -64
- package/dist-es/telemetry/index.js +42 -4
- package/dist-types/OneHook.d.ts +7 -14
- package/dist-types/OneHookClient.d.ts +3 -4
- package/dist-types/commands/DiscoverCommand.d.ts +14 -2
- package/dist-types/commands/RecordSuggestionCommand.d.ts +83 -0
- package/dist-types/commands/index.d.ts +1 -2
- package/dist-types/models/models_0.d.ts +76 -15
- package/dist-types/protocols/Aws_restJson1.d.ts +9 -18
- package/dist-types/telemetry/index.d.ts +44 -2
- package/package.json +1 -1
- package/telemetry/TelemetryCatalog.kt +61 -7
- package/telemetry/TelemetryCatalog.swift +50 -6
- package/telemetry/telemetry-catalog.json +580 -246
- package/dist-cjs/commands/DiscoverSuggestedCommand.js +0 -21
- package/dist-es/commands/DiscoverSuggestedCommand.js +0 -17
- package/dist-types/commands/DiscoverByIntentCommand.d.ts +0 -97
- package/dist-types/commands/DiscoverSuggestedCommand.d.ts +0 -92
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// GENERATED FILE - DO NOT EDIT.
|
|
2
|
-
// telemetry-integrity: sha256
|
|
2
|
+
// telemetry-integrity: sha256 fe621b683c87030c3da995991deaf051eecdf7c1bebc9f0436d49281addafe6b
|
|
3
3
|
// Source of truth: OneHookBackend/packages/telemetry/src/catalog.ts
|
|
4
4
|
// Regenerate: (OneHookBackend) npm run telemetry:generate && npm run telemetry:sync
|
|
5
|
-
// Catalog version 1.
|
|
5
|
+
// Catalog version 1.7.0, hash 4a3328962531236a.
|
|
6
6
|
//
|
|
7
7
|
// HARD RULE: every user interaction MUST emit ui_interaction with an id from THIS file, and
|
|
8
8
|
// ids are controlled by the backend. Read TELEMETRY_CONTRACT.txt (printed by every build).
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
package club.onehook.telemetry
|
|
13
13
|
|
|
14
14
|
object TelemetryCatalog {
|
|
15
|
-
const val VERSION = "1.
|
|
16
|
-
const val HASH = "
|
|
15
|
+
const val VERSION = "1.7.0"
|
|
16
|
+
const val HASH = "4a3328962531236a"
|
|
17
17
|
/** The only allowed `telemetry-exempt: <category>: <reason>` categories (see the catalog). */
|
|
18
18
|
val EXEMPT_CATEGORIES: List<String> = listOf("duplicate", "backdrop", "gesture", "continuous", "disabled")
|
|
19
19
|
}
|
|
@@ -37,7 +37,8 @@ enum class TelemetrySignalType(val wire: String) {
|
|
|
37
37
|
PROFILE_REVISIT("profile_revisit"),
|
|
38
38
|
HOOKED_STATE_VIEW("hooked_state_view"),
|
|
39
39
|
LIKES_YOU_VIEW("likes_you_view"),
|
|
40
|
-
SAFETY_UI_OPEN("safety_ui_open")
|
|
40
|
+
SAFETY_UI_OPEN("safety_ui_open"),
|
|
41
|
+
REPORT_FLOW("report_flow");
|
|
41
42
|
|
|
42
43
|
companion object {
|
|
43
44
|
fun fromWire(wire: String): TelemetrySignalType? = entries.firstOrNull { it.wire == wire }
|
|
@@ -226,6 +227,57 @@ enum class TelemetryHookedStateAction(val wire: String) {
|
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
229
|
|
|
230
|
+
/** Member-report reason category the user chose. Mirrors the backend ReportCategory taxonomy (packages/matching ReportCategory / MODERATION.md section 1) so telemetry segments by the same codes the report API records. Carries no free text. */
|
|
231
|
+
enum class TelemetryReportCategory(val wire: String) {
|
|
232
|
+
HARASSMENT("HARASSMENT"),
|
|
233
|
+
THREATS_VIOLENCE("THREATS_VIOLENCE"),
|
|
234
|
+
SEXUAL_CONTENT_NONCONSENT("SEXUAL_CONTENT_NONCONSENT"),
|
|
235
|
+
MINOR_SAFETY("MINOR_SAFETY"),
|
|
236
|
+
SCAM_FRAUD("SCAM_FRAUD"),
|
|
237
|
+
FAKE_IMPERSONATION("FAKE_IMPERSONATION"),
|
|
238
|
+
SPAM_PROMOTION("SPAM_PROMOTION"),
|
|
239
|
+
HATE("HATE"),
|
|
240
|
+
SELF_HARM_CONCERN("SELF_HARM_CONCERN"),
|
|
241
|
+
OFF_PLATFORM_HARM("OFF_PLATFORM_HARM"),
|
|
242
|
+
OTHER("OTHER");
|
|
243
|
+
|
|
244
|
+
companion object {
|
|
245
|
+
fun fromWire(wire: String): TelemetryReportCategory? = entries.firstOrNull { it.wire == wire }
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/** Where in the app the member started the report flow from (not the reported content). */
|
|
250
|
+
enum class TelemetryReportSource(val wire: String) {
|
|
251
|
+
CHAT("chat"),
|
|
252
|
+
PROFILE("profile");
|
|
253
|
+
|
|
254
|
+
companion object {
|
|
255
|
+
fun fromWire(wire: String): TelemetryReportSource? = entries.firstOrNull { it.wire == wire }
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Step in the member-report flow a report_flow signal records. The flow mixes presses, "shown" impressions and upload outcomes, so it is a signal (not a ui_interaction). Carries only the ReportCategory / ReportSource / evidence dimensions — never message text, user ids or report free text. */
|
|
260
|
+
enum class TelemetryReportEvent(val wire: String) {
|
|
261
|
+
REPORT_OPEN("report.open"),
|
|
262
|
+
REPORT_CATEGORY_SELECTED("report.category_selected"),
|
|
263
|
+
REPORT_NOT_REPORTABLE_SHOWN("report.not_reportable_shown"),
|
|
264
|
+
REPORT_NOT_REPORTABLE_BLOCK("report.not_reportable_block"),
|
|
265
|
+
REPORT_SELF_HARM_RESOURCES_SHOWN("report.self_harm_resources_shown"),
|
|
266
|
+
REPORT_EVIDENCE_TOGGLE("report.evidence_toggle"),
|
|
267
|
+
REPORT_ATTACHMENTS_TOGGLE("report.attachments_toggle"),
|
|
268
|
+
REPORT_EVIDENCE_PREVIEW("report.evidence_preview"),
|
|
269
|
+
REPORT_NUDGE_SHOWN("report.nudge_shown"),
|
|
270
|
+
REPORT_SUBMIT_WITH_EVIDENCE("report.submit_with_evidence"),
|
|
271
|
+
REPORT_SUBMIT_WITHOUT_EVIDENCE("report.submit_without_evidence"),
|
|
272
|
+
REPORT_SUBMIT_FAILED("report.submit_failed"),
|
|
273
|
+
REPORT_EVIDENCE_UPLOAD_SUCCEEDED("report.evidence_upload_succeeded"),
|
|
274
|
+
REPORT_EVIDENCE_UPLOAD_FAILED("report.evidence_upload_failed");
|
|
275
|
+
|
|
276
|
+
companion object {
|
|
277
|
+
fun fromWire(wire: String): TelemetryReportEvent? = entries.firstOrNull { it.wire == wire }
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
229
281
|
/** Registered UI element ids (`<screen>.<subject>`). Track with `OneHookAnalytics.trackUi(...)`. */
|
|
230
282
|
enum class UiElement(
|
|
231
283
|
val id: String,
|
|
@@ -342,8 +394,10 @@ enum class UiElement(
|
|
|
342
394
|
CHAT_PROFILE_OPEN("chat.profile_open", TelemetryScreen.CHAT, UiElementKind.BUTTON, listOf(UiAction.TAP, UiAction.DISMISS), null, listOf(TelemetryPlatform.WEB, TelemetryPlatform.IOS, TelemetryPlatform.ANDROID)),
|
|
343
395
|
CHAT_SAFETY_MENU_OPEN("chat.safety_menu_open", TelemetryScreen.CHAT, UiElementKind.BUTTON, listOf(UiAction.TAP, UiAction.DISMISS), null, listOf(TelemetryPlatform.WEB, TelemetryPlatform.IOS, TelemetryPlatform.ANDROID)),
|
|
344
396
|
CHAT_UNMATCH("chat.unmatch", TelemetryScreen.CHAT, UiElementKind.MENU_ITEM, listOf(UiAction.TAP), null, listOf(TelemetryPlatform.IOS, TelemetryPlatform.ANDROID)),
|
|
345
|
-
|
|
346
|
-
|
|
397
|
+
CHAT_REPORT_OPEN("chat.report_open", TelemetryScreen.CHAT, UiElementKind.MENU_ITEM, listOf(UiAction.TAP), null, listOf(TelemetryPlatform.WEB, TelemetryPlatform.IOS, TelemetryPlatform.ANDROID)),
|
|
398
|
+
CHAT_BLOCK_OPEN("chat.block_open", TelemetryScreen.CHAT, UiElementKind.MENU_ITEM, listOf(UiAction.TAP), null, listOf(TelemetryPlatform.WEB, TelemetryPlatform.IOS, TelemetryPlatform.ANDROID)),
|
|
399
|
+
CHAT_REPORT_SPAM("chat.report_spam", TelemetryScreen.CHAT, UiElementKind.MENU_ITEM, listOf(UiAction.TAP), null, listOf()),
|
|
400
|
+
CHAT_REPORT_BLOCK("chat.report_block", TelemetryScreen.CHAT, UiElementKind.MENU_ITEM, listOf(UiAction.TAP), null, listOf()),
|
|
347
401
|
CHAT_BLOCK_CONFIRM("chat.block_confirm", TelemetryScreen.CHAT, UiElementKind.DIALOG_BUTTON, listOf(UiAction.TAP, UiAction.DISMISS), null, listOf(TelemetryPlatform.WEB, TelemetryPlatform.IOS, TelemetryPlatform.ANDROID)),
|
|
348
402
|
CHAT_SETTINGS_OPEN("chat.settings_open", TelemetryScreen.CHAT, UiElementKind.BUTTON, listOf(UiAction.TAP, UiAction.DISMISS), null, listOf(TelemetryPlatform.WEB, TelemetryPlatform.IOS)),
|
|
349
403
|
CHAT_WALLPAPER_OPEN("chat.wallpaper_open", TelemetryScreen.CHAT, UiElementKind.MENU_ITEM, listOf(UiAction.TAP, UiAction.DISMISS), null, listOf(TelemetryPlatform.WEB)),
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// GENERATED FILE - DO NOT EDIT.
|
|
2
|
-
// telemetry-integrity: sha256
|
|
2
|
+
// telemetry-integrity: sha256 538edb7a38421501aed60248034c2f0b322a7974de5f7be9162d2605f9d67a1e
|
|
3
3
|
// Source of truth: OneHookBackend/packages/telemetry/src/catalog.ts
|
|
4
4
|
// Regenerate: (OneHookBackend) npm run telemetry:generate && npm run telemetry:sync
|
|
5
|
-
// Catalog version 1.
|
|
5
|
+
// Catalog version 1.7.0, hash 4a3328962531236a.
|
|
6
6
|
//
|
|
7
7
|
// HARD RULE: every user interaction MUST emit ui_interaction with an id from THIS file, and
|
|
8
8
|
// ids are controlled by the backend. Read TELEMETRY_CONTRACT.txt (printed by every build).
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
import Foundation
|
|
11
11
|
|
|
12
12
|
public enum TelemetryCatalog {
|
|
13
|
-
public static let version = "1.
|
|
14
|
-
public static let hash = "
|
|
13
|
+
public static let version = "1.7.0"
|
|
14
|
+
public static let hash = "4a3328962531236a"
|
|
15
15
|
/// The only allowed `telemetry-exempt: <category>: <reason>` categories (see the catalog).
|
|
16
16
|
public static let exemptCategories: [String] = ["duplicate", "backdrop", "gesture", "continuous", "disabled"]
|
|
17
17
|
}
|
|
@@ -36,6 +36,7 @@ public enum TelemetrySignalType: String, CaseIterable, Codable, Sendable {
|
|
|
36
36
|
case hookedStateView = "hooked_state_view"
|
|
37
37
|
case likesYouView = "likes_you_view"
|
|
38
38
|
case safetyUiOpen = "safety_ui_open"
|
|
39
|
+
case reportFlow = "report_flow"
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/// Client platform (from the X-OneHook-Platform header).
|
|
@@ -174,6 +175,45 @@ public enum TelemetryHookedStateAction: String, CaseIterable, Codable, Sendable
|
|
|
174
175
|
case dismiss = "dismiss"
|
|
175
176
|
}
|
|
176
177
|
|
|
178
|
+
/// Member-report reason category the user chose. Mirrors the backend ReportCategory taxonomy (packages/matching ReportCategory / MODERATION.md section 1) so telemetry segments by the same codes the report API records. Carries no free text.
|
|
179
|
+
public enum TelemetryReportCategory: String, CaseIterable, Codable, Sendable {
|
|
180
|
+
case harassment = "HARASSMENT"
|
|
181
|
+
case threatsViolence = "THREATS_VIOLENCE"
|
|
182
|
+
case sexualContentNonconsent = "SEXUAL_CONTENT_NONCONSENT"
|
|
183
|
+
case minorSafety = "MINOR_SAFETY"
|
|
184
|
+
case scamFraud = "SCAM_FRAUD"
|
|
185
|
+
case fakeImpersonation = "FAKE_IMPERSONATION"
|
|
186
|
+
case spamPromotion = "SPAM_PROMOTION"
|
|
187
|
+
case hate = "HATE"
|
|
188
|
+
case selfHarmConcern = "SELF_HARM_CONCERN"
|
|
189
|
+
case offPlatformHarm = "OFF_PLATFORM_HARM"
|
|
190
|
+
case other = "OTHER"
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/// Where in the app the member started the report flow from (not the reported content).
|
|
194
|
+
public enum TelemetryReportSource: String, CaseIterable, Codable, Sendable {
|
|
195
|
+
case chat = "chat"
|
|
196
|
+
case profile = "profile"
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/// Step in the member-report flow a report_flow signal records. The flow mixes presses, "shown" impressions and upload outcomes, so it is a signal (not a ui_interaction). Carries only the ReportCategory / ReportSource / evidence dimensions — never message text, user ids or report free text.
|
|
200
|
+
public enum TelemetryReportEvent: String, CaseIterable, Codable, Sendable {
|
|
201
|
+
case reportOpen = "report.open"
|
|
202
|
+
case reportCategorySelected = "report.category_selected"
|
|
203
|
+
case reportNotReportableShown = "report.not_reportable_shown"
|
|
204
|
+
case reportNotReportableBlock = "report.not_reportable_block"
|
|
205
|
+
case reportSelfHarmResourcesShown = "report.self_harm_resources_shown"
|
|
206
|
+
case reportEvidenceToggle = "report.evidence_toggle"
|
|
207
|
+
case reportAttachmentsToggle = "report.attachments_toggle"
|
|
208
|
+
case reportEvidencePreview = "report.evidence_preview"
|
|
209
|
+
case reportNudgeShown = "report.nudge_shown"
|
|
210
|
+
case reportSubmitWithEvidence = "report.submit_with_evidence"
|
|
211
|
+
case reportSubmitWithoutEvidence = "report.submit_without_evidence"
|
|
212
|
+
case reportSubmitFailed = "report.submit_failed"
|
|
213
|
+
case reportEvidenceUploadSucceeded = "report.evidence_upload_succeeded"
|
|
214
|
+
case reportEvidenceUploadFailed = "report.evidence_upload_failed"
|
|
215
|
+
}
|
|
216
|
+
|
|
177
217
|
/// Static metadata of a registered UI element.
|
|
178
218
|
public struct UiElementSpec: Sendable, Equatable {
|
|
179
219
|
public let screen: TelemetryScreen
|
|
@@ -292,6 +332,8 @@ public enum UiElement: String, CaseIterable, Codable, Sendable {
|
|
|
292
332
|
case chatProfileOpen = "chat.profile_open"
|
|
293
333
|
case chatSafetyMenuOpen = "chat.safety_menu_open"
|
|
294
334
|
case chatUnmatch = "chat.unmatch"
|
|
335
|
+
case chatReportOpen = "chat.report_open"
|
|
336
|
+
case chatBlockOpen = "chat.block_open"
|
|
295
337
|
case chatReportSpam = "chat.report_spam"
|
|
296
338
|
case chatReportBlock = "chat.report_block"
|
|
297
339
|
case chatBlockConfirm = "chat.block_confirm"
|
|
@@ -534,8 +576,10 @@ public enum UiElement: String, CaseIterable, Codable, Sendable {
|
|
|
534
576
|
case .chatProfileOpen: return UiElementSpec(screen: .chat, kind: .button, actions: [.tap, .dismiss], allowedValues: nil, platforms: [.web, .ios, .android])
|
|
535
577
|
case .chatSafetyMenuOpen: return UiElementSpec(screen: .chat, kind: .button, actions: [.tap, .dismiss], allowedValues: nil, platforms: [.web, .ios, .android])
|
|
536
578
|
case .chatUnmatch: return UiElementSpec(screen: .chat, kind: .menuItem, actions: [.tap], allowedValues: nil, platforms: [.ios, .android])
|
|
537
|
-
case .
|
|
538
|
-
case .
|
|
579
|
+
case .chatReportOpen: return UiElementSpec(screen: .chat, kind: .menuItem, actions: [.tap], allowedValues: nil, platforms: [.web, .ios, .android])
|
|
580
|
+
case .chatBlockOpen: return UiElementSpec(screen: .chat, kind: .menuItem, actions: [.tap], allowedValues: nil, platforms: [.web, .ios, .android])
|
|
581
|
+
case .chatReportSpam: return UiElementSpec(screen: .chat, kind: .menuItem, actions: [.tap], allowedValues: nil, platforms: [])
|
|
582
|
+
case .chatReportBlock: return UiElementSpec(screen: .chat, kind: .menuItem, actions: [.tap], allowedValues: nil, platforms: [])
|
|
539
583
|
case .chatBlockConfirm: return UiElementSpec(screen: .chat, kind: .dialogButton, actions: [.tap, .dismiss], allowedValues: nil, platforms: [.web, .ios, .android])
|
|
540
584
|
case .chatSettingsOpen: return UiElementSpec(screen: .chat, kind: .button, actions: [.tap, .dismiss], allowedValues: nil, platforms: [.web, .ios])
|
|
541
585
|
case .chatWallpaperOpen: return UiElementSpec(screen: .chat, kind: .menuItem, actions: [.tap, .dismiss], allowedValues: nil, platforms: [.web])
|