@usergist/feedback-react-native 0.1.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.
Files changed (242) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +21 -0
  3. package/README.md +231 -0
  4. package/UserGistFeedback.podspec +31 -0
  5. package/UserGistFeedbackExtension.podspec +23 -0
  6. package/android/build.gradle +92 -0
  7. package/android/consumer-rules.pro +5 -0
  8. package/android/src/main/AndroidManifest.xml +31 -0
  9. package/android/src/main/java/studio/usergist/feedback/UserGistFirebaseMessagingService.kt +153 -0
  10. package/android/src/main/java/studio/usergist/feedback/UserGistPushModule.kt +344 -0
  11. package/android/src/main/java/studio/usergist/feedback/UserGistPushPackage.kt +18 -0
  12. package/dist/NativeUserGistPush.d.ts +35 -0
  13. package/dist/NativeUserGistPush.d.ts.map +1 -0
  14. package/dist/NativeUserGistPush.js +13 -0
  15. package/dist/NativeUserGistPush.js.map +1 -0
  16. package/dist/Provider.d.ts +7 -0
  17. package/dist/Provider.d.ts.map +1 -0
  18. package/dist/Provider.js +300 -0
  19. package/dist/Provider.js.map +1 -0
  20. package/dist/Push.d.ts +103 -0
  21. package/dist/Push.d.ts.map +1 -0
  22. package/dist/Push.js +225 -0
  23. package/dist/Push.js.map +1 -0
  24. package/dist/UserGist.d.ts +210 -0
  25. package/dist/UserGist.d.ts.map +1 -0
  26. package/dist/UserGist.js +1246 -0
  27. package/dist/UserGist.js.map +1 -0
  28. package/dist/index.d.ts +11 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +4 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/internal/consent.d.ts +17 -0
  33. package/dist/internal/consent.d.ts.map +1 -0
  34. package/dist/internal/consent.js +98 -0
  35. package/dist/internal/consent.js.map +1 -0
  36. package/dist/internal/context.d.ts +12 -0
  37. package/dist/internal/context.d.ts.map +1 -0
  38. package/dist/internal/context.js +70 -0
  39. package/dist/internal/context.js.map +1 -0
  40. package/dist/internal/debug.d.ts +14 -0
  41. package/dist/internal/debug.d.ts.map +1 -0
  42. package/dist/internal/debug.js +73 -0
  43. package/dist/internal/debug.js.map +1 -0
  44. package/dist/internal/engine.d.ts +93 -0
  45. package/dist/internal/engine.d.ts.map +1 -0
  46. package/dist/internal/engine.js +904 -0
  47. package/dist/internal/engine.js.map +1 -0
  48. package/dist/internal/events.d.ts +49 -0
  49. package/dist/internal/events.d.ts.map +1 -0
  50. package/dist/internal/events.js +71 -0
  51. package/dist/internal/events.js.map +1 -0
  52. package/dist/internal/frequency-cap.d.ts +15 -0
  53. package/dist/internal/frequency-cap.d.ts.map +1 -0
  54. package/dist/internal/frequency-cap.js +84 -0
  55. package/dist/internal/frequency-cap.js.map +1 -0
  56. package/dist/internal/identity.d.ts +14 -0
  57. package/dist/internal/identity.d.ts.map +1 -0
  58. package/dist/internal/identity.js +113 -0
  59. package/dist/internal/identity.js.map +1 -0
  60. package/dist/internal/inapp-matcher.d.ts +13 -0
  61. package/dist/internal/inapp-matcher.d.ts.map +1 -0
  62. package/dist/internal/inapp-matcher.js +65 -0
  63. package/dist/internal/inapp-matcher.js.map +1 -0
  64. package/dist/internal/inapp-rules-cache.d.ts +16 -0
  65. package/dist/internal/inapp-rules-cache.d.ts.map +1 -0
  66. package/dist/internal/inapp-rules-cache.js +88 -0
  67. package/dist/internal/inapp-rules-cache.js.map +1 -0
  68. package/dist/internal/instruction-dedupe.d.ts +16 -0
  69. package/dist/internal/instruction-dedupe.d.ts.map +1 -0
  70. package/dist/internal/instruction-dedupe.js +52 -0
  71. package/dist/internal/instruction-dedupe.js.map +1 -0
  72. package/dist/internal/lifecycle.d.ts +12 -0
  73. package/dist/internal/lifecycle.d.ts.map +1 -0
  74. package/dist/internal/lifecycle.js +97 -0
  75. package/dist/internal/lifecycle.js.map +1 -0
  76. package/dist/internal/modal-coordinator.d.ts +4 -0
  77. package/dist/internal/modal-coordinator.d.ts.map +1 -0
  78. package/dist/internal/modal-coordinator.js +43 -0
  79. package/dist/internal/modal-coordinator.js.map +1 -0
  80. package/dist/internal/modal-queue.d.ts +9 -0
  81. package/dist/internal/modal-queue.d.ts.map +1 -0
  82. package/dist/internal/modal-queue.js +32 -0
  83. package/dist/internal/modal-queue.js.map +1 -0
  84. package/dist/internal/mutation-queue.d.ts +23 -0
  85. package/dist/internal/mutation-queue.d.ts.map +1 -0
  86. package/dist/internal/mutation-queue.js +66 -0
  87. package/dist/internal/mutation-queue.js.map +1 -0
  88. package/dist/internal/prompt-answers.d.ts +6 -0
  89. package/dist/internal/prompt-answers.d.ts.map +1 -0
  90. package/dist/internal/prompt-answers.js +10 -0
  91. package/dist/internal/prompt-answers.js.map +1 -0
  92. package/dist/internal/prompt-flow.d.ts +8 -0
  93. package/dist/internal/prompt-flow.d.ts.map +1 -0
  94. package/dist/internal/prompt-flow.js +26 -0
  95. package/dist/internal/prompt-flow.js.map +1 -0
  96. package/dist/internal/queue.d.ts +17 -0
  97. package/dist/internal/queue.d.ts.map +1 -0
  98. package/dist/internal/queue.js +172 -0
  99. package/dist/internal/queue.js.map +1 -0
  100. package/dist/internal/requests.d.ts +22 -0
  101. package/dist/internal/requests.d.ts.map +1 -0
  102. package/dist/internal/requests.js +146 -0
  103. package/dist/internal/requests.js.map +1 -0
  104. package/dist/internal/rules-cache.d.ts +16 -0
  105. package/dist/internal/rules-cache.d.ts.map +1 -0
  106. package/dist/internal/rules-cache.js +86 -0
  107. package/dist/internal/rules-cache.js.map +1 -0
  108. package/dist/internal/storage.d.ts +36 -0
  109. package/dist/internal/storage.d.ts.map +1 -0
  110. package/dist/internal/storage.js +213 -0
  111. package/dist/internal/storage.js.map +1 -0
  112. package/dist/internal/survey-completion.d.ts +10 -0
  113. package/dist/internal/survey-completion.d.ts.map +1 -0
  114. package/dist/internal/survey-completion.js +11 -0
  115. package/dist/internal/survey-completion.js.map +1 -0
  116. package/dist/internal/survey-matcher.d.ts +21 -0
  117. package/dist/internal/survey-matcher.d.ts.map +1 -0
  118. package/dist/internal/survey-matcher.js +139 -0
  119. package/dist/internal/survey-matcher.js.map +1 -0
  120. package/dist/internal/survey-rules-cache.d.ts +17 -0
  121. package/dist/internal/survey-rules-cache.d.ts.map +1 -0
  122. package/dist/internal/survey-rules-cache.js +91 -0
  123. package/dist/internal/survey-rules-cache.js.map +1 -0
  124. package/dist/internal/survey-store.d.ts +19 -0
  125. package/dist/internal/survey-store.d.ts.map +1 -0
  126. package/dist/internal/survey-store.js +59 -0
  127. package/dist/internal/survey-store.js.map +1 -0
  128. package/dist/internal/transport.d.ts +210 -0
  129. package/dist/internal/transport.d.ts.map +1 -0
  130. package/dist/internal/transport.js +498 -0
  131. package/dist/internal/transport.js.map +1 -0
  132. package/dist/internal/trigger-matcher.d.ts +21 -0
  133. package/dist/internal/trigger-matcher.d.ts.map +1 -0
  134. package/dist/internal/trigger-matcher.js +114 -0
  135. package/dist/internal/trigger-matcher.js.map +1 -0
  136. package/dist/internal/types.d.ts +89 -0
  137. package/dist/internal/types.d.ts.map +1 -0
  138. package/dist/internal/types.js +2 -0
  139. package/dist/internal/types.js.map +1 -0
  140. package/dist/internal/user-state.d.ts +11 -0
  141. package/dist/internal/user-state.d.ts.map +1 -0
  142. package/dist/internal/user-state.js +118 -0
  143. package/dist/internal/user-state.js.map +1 -0
  144. package/dist/native/events.d.ts +27 -0
  145. package/dist/native/events.d.ts.map +1 -0
  146. package/dist/native/events.js +12 -0
  147. package/dist/native/events.js.map +1 -0
  148. package/dist/native/push-bridge.d.ts +20 -0
  149. package/dist/native/push-bridge.d.ts.map +1 -0
  150. package/dist/native/push-bridge.js +92 -0
  151. package/dist/native/push-bridge.js.map +1 -0
  152. package/dist/preview/PromptShell.d.ts +9 -0
  153. package/dist/preview/PromptShell.d.ts.map +1 -0
  154. package/dist/preview/PromptShell.js +128 -0
  155. package/dist/preview/PromptShell.js.map +1 -0
  156. package/dist/preview/SurveyShell.d.ts +15 -0
  157. package/dist/preview/SurveyShell.d.ts.map +1 -0
  158. package/dist/preview/SurveyShell.js +197 -0
  159. package/dist/preview/SurveyShell.js.map +1 -0
  160. package/dist/preview/index.d.ts +4 -0
  161. package/dist/preview/index.d.ts.map +1 -0
  162. package/dist/preview/index.js +16 -0
  163. package/dist/preview/index.js.map +1 -0
  164. package/dist/ui/InAppMessageView.d.ts +12 -0
  165. package/dist/ui/InAppMessageView.d.ts.map +1 -0
  166. package/dist/ui/InAppMessageView.js +260 -0
  167. package/dist/ui/InAppMessageView.js.map +1 -0
  168. package/dist/ui/PromptSheet.d.ts +12 -0
  169. package/dist/ui/PromptSheet.d.ts.map +1 -0
  170. package/dist/ui/PromptSheet.js +285 -0
  171. package/dist/ui/PromptSheet.js.map +1 -0
  172. package/dist/ui/QuestionImageHeader.d.ts +12 -0
  173. package/dist/ui/QuestionImageHeader.d.ts.map +1 -0
  174. package/dist/ui/QuestionImageHeader.js +22 -0
  175. package/dist/ui/QuestionImageHeader.js.map +1 -0
  176. package/dist/ui/SurveyView.d.ts +25 -0
  177. package/dist/ui/SurveyView.d.ts.map +1 -0
  178. package/dist/ui/SurveyView.js +478 -0
  179. package/dist/ui/SurveyView.js.map +1 -0
  180. package/dist/ui/animations.d.ts +4 -0
  181. package/dist/ui/animations.d.ts.map +1 -0
  182. package/dist/ui/animations.js +24 -0
  183. package/dist/ui/animations.js.map +1 -0
  184. package/dist/ui/questions/MultipleChoiceQuestion.d.ts +12 -0
  185. package/dist/ui/questions/MultipleChoiceQuestion.d.ts.map +1 -0
  186. package/dist/ui/questions/MultipleChoiceQuestion.js +41 -0
  187. package/dist/ui/questions/MultipleChoiceQuestion.js.map +1 -0
  188. package/dist/ui/questions/NpsQuestion.d.ts +14 -0
  189. package/dist/ui/questions/NpsQuestion.d.ts.map +1 -0
  190. package/dist/ui/questions/NpsQuestion.js +73 -0
  191. package/dist/ui/questions/NpsQuestion.js.map +1 -0
  192. package/dist/ui/questions/RatingQuestion.d.ts +21 -0
  193. package/dist/ui/questions/RatingQuestion.d.ts.map +1 -0
  194. package/dist/ui/questions/RatingQuestion.js +91 -0
  195. package/dist/ui/questions/RatingQuestion.js.map +1 -0
  196. package/dist/ui/questions/ShortTextQuestion.d.ts +12 -0
  197. package/dist/ui/questions/ShortTextQuestion.d.ts.map +1 -0
  198. package/dist/ui/questions/ShortTextQuestion.js +25 -0
  199. package/dist/ui/questions/ShortTextQuestion.js.map +1 -0
  200. package/dist/ui/requests/BoardView.d.ts +9 -0
  201. package/dist/ui/requests/BoardView.d.ts.map +1 -0
  202. package/dist/ui/requests/BoardView.js +270 -0
  203. package/dist/ui/requests/BoardView.js.map +1 -0
  204. package/dist/ui/requests/CommentsSection.d.ts +7 -0
  205. package/dist/ui/requests/CommentsSection.d.ts.map +1 -0
  206. package/dist/ui/requests/CommentsSection.js +254 -0
  207. package/dist/ui/requests/CommentsSection.js.map +1 -0
  208. package/dist/ui/requests/DetailView.d.ts +8 -0
  209. package/dist/ui/requests/DetailView.d.ts.map +1 -0
  210. package/dist/ui/requests/DetailView.js +206 -0
  211. package/dist/ui/requests/DetailView.js.map +1 -0
  212. package/dist/ui/requests/RequestsHost.d.ts +12 -0
  213. package/dist/ui/requests/RequestsHost.d.ts.map +1 -0
  214. package/dist/ui/requests/RequestsHost.js +58 -0
  215. package/dist/ui/requests/RequestsHost.js.map +1 -0
  216. package/dist/ui/requests/StatusPill.d.ts +6 -0
  217. package/dist/ui/requests/StatusPill.d.ts.map +1 -0
  218. package/dist/ui/requests/StatusPill.js +25 -0
  219. package/dist/ui/requests/StatusPill.js.map +1 -0
  220. package/dist/ui/requests/SubmitView.d.ts +8 -0
  221. package/dist/ui/requests/SubmitView.d.ts.map +1 -0
  222. package/dist/ui/requests/SubmitView.js +94 -0
  223. package/dist/ui/requests/SubmitView.js.map +1 -0
  224. package/dist/ui/requests/shared.d.ts +21 -0
  225. package/dist/ui/requests/shared.d.ts.map +1 -0
  226. package/dist/ui/requests/shared.js +74 -0
  227. package/dist/ui/requests/shared.js.map +1 -0
  228. package/dist/ui/survey-questions.d.ts +20 -0
  229. package/dist/ui/survey-questions.d.ts.map +1 -0
  230. package/dist/ui/survey-questions.js +211 -0
  231. package/dist/ui/survey-questions.js.map +1 -0
  232. package/dist/ui/theme.d.ts +15 -0
  233. package/dist/ui/theme.d.ts.map +1 -0
  234. package/dist/ui/theme.js +31 -0
  235. package/dist/ui/theme.js.map +1 -0
  236. package/ios/Extension/UserGistNotificationService.swift +292 -0
  237. package/ios/UserGistPush.h +16 -0
  238. package/ios/UserGistPush.mm +158 -0
  239. package/ios/UserGistPushImpl.swift +399 -0
  240. package/ios/UserGistPushSwizzle.m +168 -0
  241. package/package.json +89 -0
  242. package/react-native.config.js +16 -0
@@ -0,0 +1,210 @@
1
+ import type { Consent, EventPropertyValue, PromptTheme, SdkConfig, SurveyAnswerRecord, SurveyAnswerValue, SurveyAttemptSource, SurveyCampaignWithFlow, SurveySummary, JsonAction, InAppCtaAction } from '@usergist/sdk-core/mobile';
2
+ import { logTrace, getTraces, type SdkDiagnostic } from './internal/debug.js';
3
+ import type { ConsentState, IdentityState, ResolvedConfig, ResponseEmission, ShowPromptPayload } from './internal/types.js';
4
+ import type { EventBus } from './internal/events.js';
5
+ import type { FrequencyCapManager } from './internal/frequency-cap.js';
6
+ import { type ResolvedTheme } from './ui/theme.js';
7
+ import { type SurveyStore } from './internal/survey-store.js';
8
+ import type { NotificationPayload } from './native/events.js';
9
+ import { type UserGistStorageAdapter } from './internal/storage.js';
10
+ type PromptShownCb = (p: ShowPromptPayload) => void;
11
+ type ResponseCb = (r: ResponseEmission) => void;
12
+ interface SurveyHandlers {
13
+ /**
14
+ * Called when a triggered or scheduled survey becomes available for this
15
+ * user. Host app typically renders an invite (banner/toast) and calls
16
+ * `UserGist.openSurvey(surveyId)` to launch the full flow on tap.
17
+ * If no handler is registered, the survey auto-opens — convenient for
18
+ * dev/testing, but you'll likely want a banner UX in production.
19
+ */
20
+ readonly onInvite?: (invite: {
21
+ readonly surveyId: string;
22
+ readonly name: string;
23
+ readonly source: string;
24
+ }) => void;
25
+ readonly onShow?: (surveyId: string) => void;
26
+ readonly onComplete?: (surveyId: string, attemptId: string) => void;
27
+ readonly onAbandon?: (surveyId: string, attemptId: string) => void;
28
+ }
29
+ export type IdentifyResult = 'synced' | 'queued' | 'rejected';
30
+ export interface InitialIdentity {
31
+ readonly userId: string;
32
+ readonly subjectToken: string;
33
+ readonly properties?: Record<string, EventPropertyValue>;
34
+ }
35
+ export interface InAppHandlers {
36
+ readonly onShow?: (messageId: string) => void;
37
+ readonly onDismiss?: (messageId: string, reason: 'user' | 'auto') => void;
38
+ readonly onCtaClick?: (args: {
39
+ readonly messageId: string;
40
+ readonly action: InAppCtaAction;
41
+ readonly target?: string;
42
+ readonly actionJson?: JsonAction;
43
+ readonly label: string;
44
+ readonly index: number;
45
+ }) => void;
46
+ /** Executes host-defined structured actions after the CTA tap is tracked. */
47
+ readonly onJsonAction?: (action: JsonAction, context: {
48
+ readonly source: 'in_app';
49
+ readonly messageId: string;
50
+ readonly label: string;
51
+ readonly index: number;
52
+ }) => void;
53
+ }
54
+ export declare const UserGist: {
55
+ /**
56
+ * Replace AsyncStorage with a host-provided encrypted adapter. Call before
57
+ * `init()`; changing persistence while the SDK is running is rejected.
58
+ */
59
+ readonly setStorageAdapter: (adapter: UserGistStorageAdapter) => void;
60
+ readonly setDiagnosticHandler: (handler: ((diagnostic: SdkDiagnostic) => void) | null) => void;
61
+ readonly init: (config: SdkConfig) => void;
62
+ readonly initAsync: (config: SdkConfig, initialIdentity?: InitialIdentity) => Promise<IdentifyResult>;
63
+ readonly identify: (userId: string, properties?: Record<string, EventPropertyValue>, subjectToken?: string) => void;
64
+ readonly identifyAsync: (userId: string, properties?: Record<string, EventPropertyValue>, subjectToken?: string) => Promise<IdentifyResult>;
65
+ readonly track: (eventName: string, properties?: Record<string, EventPropertyValue>) => void;
66
+ readonly setConsent: (purposes: Consent) => Promise<boolean>;
67
+ readonly reset: () => Promise<void>;
68
+ readonly setThemeOverrides: (theme: PromptTheme) => void;
69
+ readonly flush: () => void;
70
+ readonly setDebug: (enabled: boolean) => void;
71
+ readonly getAnonymousId: () => string | null;
72
+ readonly getExternalId: () => string | null;
73
+ readonly onPromptShown: (cb: PromptShownCb) => () => void;
74
+ readonly onResponse: (cb: ResponseCb) => () => void;
75
+ /**
76
+ * Subscribe to push lifecycle events: `$push_received`, `$push_displayed`,
77
+ * `$push_opened`, `$push_dismissed`, `$push_action_clicked`.
78
+ *
79
+ * Each callback receives `(eventName, props)` where `props` carries
80
+ * `{ campaign_id, variant_id, delivery_id, language, action_button? }`.
81
+ *
82
+ * Use this to forward push events to a host-app analytics tool
83
+ * (Amplitude, Mixpanel, Segment, etc.). The SDK is analytics-tool
84
+ * agnostic — you plumb to whatever stack you use.
85
+ *
86
+ * Example:
87
+ * import { track as amplitudeTrack } from '@amplitude/analytics-react-native'
88
+ * UserGist.onPushEvent((name, props) => amplitudeTrack(name, props))
89
+ *
90
+ * Returns an unsubscribe fn.
91
+ */
92
+ readonly onPushEvent: (cb: (name: string, props: Readonly<Record<string, unknown>>) => void) => () => void;
93
+ /** SDK-internal: invoked by Push.ts for every $push_* event. */
94
+ readonly _notifyPushEvent: (name: string, props: Readonly<Record<string, unknown>>) => void;
95
+ readonly registerPushToken: (token: string, platform: "ios" | "android", opts?: {
96
+ environment?: "production" | "sandbox";
97
+ }) => Promise<void>;
98
+ readonly invalidatePushToken: (token: string) => Promise<void>;
99
+ /**
100
+ * Re-bind the latest registered device token to a newly-identified user.
101
+ * Called from inside `identify()` so that subsequent campaign sends to
102
+ * the now-identified user reach this device. No-op when no push token
103
+ * is registered on this device.
104
+ */
105
+ readonly rebindPushToken: (externalId: string) => Promise<void>;
106
+ /** SDK-internal: emit a delivery beacon. */
107
+ readonly pushBeacon: (kind: "delivered" | "displayed" | "dismissed", deliveryId: string) => Promise<void>;
108
+ /** Ack a silent reachability ping. */
109
+ readonly pushAckSilent: (pingId: string) => Promise<void>;
110
+ /** Forward an applicationDidBecomeActive / onResume signal to the server. */
111
+ readonly pushAppOpen: () => Promise<void>;
112
+ /** Fetch the per-app channel registry. */
113
+ readonly pushFetchChannels: () => Promise<ReadonlyArray<import("@usergist/sdk-core/mobile").PushChannelDef>>;
114
+ readonly pushSetChannelSubscription: (channelId: string, subscribed: boolean) => Promise<void>;
115
+ readonly enablePush: (opts?: {
116
+ readonly environment?: "sandbox" | "production";
117
+ readonly skipPermissionRequestIfDenied?: boolean;
118
+ readonly installDelegateProxy?: boolean;
119
+ }) => Promise<{
120
+ readonly granted: boolean;
121
+ readonly status: "authorized" | "provisional" | "denied" | "not_determined";
122
+ readonly token?: string;
123
+ readonly platform: "ios" | "android";
124
+ }>;
125
+ readonly disablePush: () => Promise<void>;
126
+ readonly getPushPermissionStatus: () => Promise<"authorized" | "provisional" | "denied" | "not_determined">;
127
+ readonly setPushBadgeCount: (count: number) => Promise<void>;
128
+ readonly getInitialPushNotification: () => Promise<NotificationPayload | null>;
129
+ readonly getAvailableSurveys: () => Promise<ReadonlyArray<SurveySummary>>;
130
+ readonly openSurvey: (surveyId: string, context?: {
131
+ readonly language?: string;
132
+ readonly source?: SurveyAttemptSource;
133
+ }) => Promise<void>;
134
+ readonly setSurveyHandlers: (handlers: SurveyHandlers) => void;
135
+ readonly setInAppHandlers: (handlers: InAppHandlers) => void;
136
+ readonly handleSurveyDeepLink: (url: string) => Promise<boolean>;
137
+ readonly __internal_state: () => {
138
+ readonly config: ResolvedConfig | null;
139
+ readonly identity: IdentityState | null;
140
+ readonly consent: ConsentState | null;
141
+ readonly queueSize: number;
142
+ readonly triggerCount: number;
143
+ readonly frequencyCaps: ReturnType<FrequencyCapManager["snapshot"]> | null;
144
+ readonly traces: ReturnType<typeof getTraces>;
145
+ };
146
+ readonly __internal_submitResponse: (response: ResponseEmission, triggerEventName: string) => Promise<void>;
147
+ readonly __internal_events: () => EventBus;
148
+ readonly __internal_theme: () => ResolvedTheme | null;
149
+ readonly __internal_logTrace: typeof logTrace;
150
+ readonly __internal_surveyStore: () => SurveyStore | null;
151
+ readonly __internal_inAppHandlers: () => InAppHandlers;
152
+ readonly __internal_surveyHandlers: () => SurveyHandlers;
153
+ readonly __internal_reportSurveyShown: (surveyId: string) => void;
154
+ readonly __internal_armedSurveyById: (surveyId: string) => SurveyCampaignWithFlow | null;
155
+ readonly __internal_fetchSurvey: (surveyId: string, language?: string) => Promise<SurveyCampaignWithFlow | null>;
156
+ readonly __internal_createAttempt: (surveyId: string, source: SurveyAttemptSource, language?: string) => Promise<{
157
+ attemptId: string;
158
+ startQuestionId: string;
159
+ currentQuestionId: string | null;
160
+ snapshot: SurveyAnswerRecord;
161
+ resumed: boolean;
162
+ } | null>;
163
+ readonly __internal_saveProgress: (attemptId: string, currentQuestionId: string | null, snapshot: SurveyAnswerRecord) => Promise<void>;
164
+ readonly __internal_submitAnswers: (attemptId: string, answers: ReadonlyArray<{
165
+ questionId: string;
166
+ value: SurveyAnswerValue;
167
+ }>) => Promise<void>;
168
+ readonly __internal_completeAttempt: (attemptId: string, finalAnswers?: ReadonlyArray<{
169
+ questionId: string;
170
+ value: SurveyAnswerValue;
171
+ }>) => Promise<void>;
172
+ readonly __internal_abandonAttempt: (attemptId: string) => Promise<void>;
173
+ readonly getRequests: (options?: import("@usergist/sdk-core/mobile").GetRequestsOptions) => Promise<import("@usergist/sdk-core/mobile").GetRequestsResult>;
174
+ readonly submitRequest: (title: string, description: string, callback?: (err: Error | null, req?: import("@usergist/sdk-core/mobile").Request) => void) => void;
175
+ readonly voteOnRequest: (requestId: string, vote: boolean) => Promise<void>;
176
+ readonly followRequest: (requestId: string, follow: boolean) => Promise<void>;
177
+ /**
178
+ * Fetch the per-app branding the dashboard configured for this pillar
179
+ * (entry label, accent color, logo URL, intro copy). Host apps use
180
+ * this to theme the requests UI so it matches the rest of the product
181
+ * without hard-coding colors. Cached for 60s at the edge.
182
+ */
183
+ readonly getRequestBranding: () => Promise<{
184
+ entryLabel: string;
185
+ accentColor: string | null;
186
+ logoUrl: string | null;
187
+ introCopy: string | null;
188
+ } | null>;
189
+ /**
190
+ * Fetch a single request by id with full detail (description, dev
191
+ * response, viewer flags). The list endpoint returns a `RequestSummary`
192
+ * that intentionally omits `devResponse` to keep payloads small —
193
+ * call this when rendering a detail view that needs the response.
194
+ */
195
+ readonly getRequest: (requestId: string) => Promise<import("@usergist/sdk-core/mobile").Request | null>;
196
+ readonly openRequestsBoard: () => void;
197
+ readonly openRequestDetail: (requestId: string) => void;
198
+ readonly setRequestsHandlers: (handlers: import("@usergist/sdk-core/mobile").RequestsHandlers) => void;
199
+ /** List comments for a request, ordered oldest-first. */
200
+ readonly getComments: (requestId: string) => Promise<ReadonlyArray<import("@usergist/sdk-core/mobile").RequestComment>>;
201
+ /** Post a comment on a request. Returns the new row, or null on failure. */
202
+ readonly postComment: (requestId: string, body: string) => Promise<import("@usergist/sdk-core/mobile").RequestComment | null>;
203
+ /** Edit one of the viewer's own comments. Server returns 404 if not theirs. */
204
+ readonly editComment: (requestId: string, commentId: string, body: string) => Promise<import("@usergist/sdk-core/mobile").RequestComment | null>;
205
+ /** Delete one of the viewer's own comments. */
206
+ readonly deleteComment: (requestId: string, commentId: string) => Promise<void>;
207
+ };
208
+ export type UserGistStatic = typeof UserGist;
209
+ export {};
210
+ //# sourceMappingURL=UserGist.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserGist.d.ts","sourceRoot":"","sources":["../src/UserGist.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EACV,OAAO,EACP,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,cAAc,EACf,MAAM,2BAA2B,CAAA;AAsBlC,OAAO,EAIL,QAAQ,EACR,SAAS,EAET,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAA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