@appgram/react 0.1.1 → 0.1.4
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/{useVote-CLhkwtLT.d.mts → StatusBoard-DZWI3zGJ.d.mts} +126 -1
- package/dist/{useVote-CLhkwtLT.d.ts → StatusBoard-DZWI3zGJ.d.ts} +126 -1
- package/dist/{chunk-N6PJDQCU.mjs → chunk-NABMGLTY.mjs} +210 -6
- package/dist/chunk-NABMGLTY.mjs.map +1 -0
- package/dist/chunk-NSV6Q6QQ.js +202 -0
- package/dist/chunk-NSV6Q6QQ.js.map +1 -0
- package/dist/chunk-ONZ7RQBM.mjs +199 -0
- package/dist/chunk-ONZ7RQBM.mjs.map +1 -0
- package/dist/{chunk-75P634IK.js → chunk-UPTP7QX5.js} +213 -5
- package/dist/chunk-UPTP7QX5.js.map +1 -0
- package/dist/{chunk-AIDLOCVJ.mjs → chunk-UWIJR4ZY.mjs} +760 -15
- package/dist/chunk-UWIJR4ZY.mjs.map +1 -0
- package/dist/{chunk-3UBJGXCO.js → chunk-WZIN7KEM.js} +820 -74
- package/dist/chunk-WZIN7KEM.js.map +1 -0
- package/dist/components/index.d.mts +68 -106
- package/dist/components/index.d.ts +68 -106
- package/dist/components/index.js +29 -21
- package/dist/components/index.mjs +2 -2
- package/dist/hooks/index.d.mts +3 -572
- package/dist/hooks/index.d.ts +3 -572
- package/dist/hooks/index.js +33 -13
- package/dist/hooks/index.mjs +2 -2
- package/dist/index-C_IqzaBU.d.mts +917 -0
- package/dist/index-h4Nbq4LC.d.ts +917 -0
- package/dist/index.d.mts +32 -5
- package/dist/index.d.ts +32 -5
- package/dist/index.js +124 -76
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +61 -41
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-3UBJGXCO.js.map +0 -1
- package/dist/chunk-75P634IK.js.map +0 -1
- package/dist/chunk-AIDLOCVJ.mjs.map +0 -1
- package/dist/chunk-KPIKYXAN.mjs +0 -47
- package/dist/chunk-KPIKYXAN.mjs.map +0 -1
- package/dist/chunk-N6PJDQCU.mjs.map +0 -1
- package/dist/chunk-ZJZ3A2S3.js +0 -49
- package/dist/chunk-ZJZ3A2S3.js.map +0 -1
|
@@ -0,0 +1,917 @@
|
|
|
1
|
+
import { W as WishFilters, b as Wish, c as Comment, k as CommentCreateInput, r as Roadmap, s as RoadmapColumn, d as Release, g as HelpArticle, H as HelpCollection, f as HelpFlow, h as SupportRequest, S as SupportRequestInput, y as StatusData } from './StatusBoard-DZWI3zGJ.mjs';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Survey Types
|
|
5
|
+
*
|
|
6
|
+
* Decision tree surveys for gathering user feedback.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Survey Question Types
|
|
10
|
+
*/
|
|
11
|
+
type SurveyQuestionType = 'yes_no' | 'short_answer' | 'paragraph' | 'multiple_choice' | 'checkboxes' | 'rating';
|
|
12
|
+
/**
|
|
13
|
+
* Survey Node Option
|
|
14
|
+
*/
|
|
15
|
+
interface SurveyNodeOption {
|
|
16
|
+
value: string;
|
|
17
|
+
label: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Survey Node Branch
|
|
21
|
+
*
|
|
22
|
+
* Conditional branching configuration for decision tree logic.
|
|
23
|
+
*/
|
|
24
|
+
interface SurveyNodeBranch {
|
|
25
|
+
condition: {
|
|
26
|
+
type: 'equals' | 'contains' | 'gt' | 'lt' | 'gte' | 'lte';
|
|
27
|
+
value: string | number | boolean;
|
|
28
|
+
};
|
|
29
|
+
next_node_id: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Survey Node
|
|
33
|
+
*
|
|
34
|
+
* Individual questions or result nodes in a survey decision tree.
|
|
35
|
+
*/
|
|
36
|
+
interface SurveyNode {
|
|
37
|
+
id: string;
|
|
38
|
+
survey_id: string;
|
|
39
|
+
parent_id: string | null;
|
|
40
|
+
question: string;
|
|
41
|
+
question_type: SurveyQuestionType;
|
|
42
|
+
options?: SurveyNodeOption[];
|
|
43
|
+
min_rating?: number;
|
|
44
|
+
max_rating?: number;
|
|
45
|
+
is_required?: boolean;
|
|
46
|
+
answer_yes_node_id: string | null;
|
|
47
|
+
answer_no_node_id: string | null;
|
|
48
|
+
branches?: SurveyNodeBranch[];
|
|
49
|
+
next_node_id?: string | null;
|
|
50
|
+
result_message: string | null;
|
|
51
|
+
sort_order: number;
|
|
52
|
+
created_at: string;
|
|
53
|
+
updated_at: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Survey
|
|
57
|
+
*/
|
|
58
|
+
interface Survey {
|
|
59
|
+
id: string;
|
|
60
|
+
project_id: string;
|
|
61
|
+
name: string;
|
|
62
|
+
slug: string;
|
|
63
|
+
description: string;
|
|
64
|
+
is_active: boolean;
|
|
65
|
+
created_at: string;
|
|
66
|
+
updated_at: string;
|
|
67
|
+
number_of_questions?: number;
|
|
68
|
+
number_of_responses?: number;
|
|
69
|
+
nodes?: SurveyNode[];
|
|
70
|
+
responses?: SurveyResponse[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Survey Response
|
|
74
|
+
*/
|
|
75
|
+
interface SurveyResponse {
|
|
76
|
+
id: string;
|
|
77
|
+
survey_id: string;
|
|
78
|
+
external_user_id: string | null;
|
|
79
|
+
fingerprint: string;
|
|
80
|
+
metadata: Record<string, unknown>;
|
|
81
|
+
created_at: string;
|
|
82
|
+
answers?: SurveyAnswer[];
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Survey Answer
|
|
86
|
+
*/
|
|
87
|
+
interface SurveyAnswer {
|
|
88
|
+
id: string;
|
|
89
|
+
response_id: string;
|
|
90
|
+
node_id: string;
|
|
91
|
+
answer?: boolean;
|
|
92
|
+
answer_text?: string;
|
|
93
|
+
answer_options?: string[];
|
|
94
|
+
answer_rating?: number;
|
|
95
|
+
created_at: string;
|
|
96
|
+
node?: {
|
|
97
|
+
id: string;
|
|
98
|
+
question: string;
|
|
99
|
+
question_type?: SurveyQuestionType;
|
|
100
|
+
result_message: string | null;
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Input for submitting a survey response
|
|
105
|
+
*/
|
|
106
|
+
interface SurveySubmitInput {
|
|
107
|
+
fingerprint: string;
|
|
108
|
+
external_user_id?: string;
|
|
109
|
+
metadata?: Record<string, unknown>;
|
|
110
|
+
answers: Array<{
|
|
111
|
+
node_id: string;
|
|
112
|
+
answer?: boolean;
|
|
113
|
+
answer_text?: string;
|
|
114
|
+
answer_options?: string[];
|
|
115
|
+
answer_rating?: number;
|
|
116
|
+
}>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Contact Form Types
|
|
121
|
+
*
|
|
122
|
+
* Configurable contact forms for collecting user submissions.
|
|
123
|
+
*/
|
|
124
|
+
type ContactFormFieldType = 'text' | 'email' | 'textarea' | 'select' | 'radio' | 'checkbox';
|
|
125
|
+
interface ContactFormFieldValidation {
|
|
126
|
+
minLength?: number;
|
|
127
|
+
maxLength?: number;
|
|
128
|
+
pattern?: string;
|
|
129
|
+
}
|
|
130
|
+
interface ContactFormField {
|
|
131
|
+
id: string;
|
|
132
|
+
type: ContactFormFieldType;
|
|
133
|
+
label: string;
|
|
134
|
+
placeholder?: string;
|
|
135
|
+
required: boolean;
|
|
136
|
+
options?: string[];
|
|
137
|
+
validation?: ContactFormFieldValidation;
|
|
138
|
+
}
|
|
139
|
+
interface ContactForm {
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
description?: string;
|
|
143
|
+
fields: ContactFormField[];
|
|
144
|
+
submitButtonText: string;
|
|
145
|
+
successMessage: string;
|
|
146
|
+
emailRecipient: string;
|
|
147
|
+
emailSubject: string;
|
|
148
|
+
enabled: boolean;
|
|
149
|
+
createdAt?: string;
|
|
150
|
+
updatedAt?: string;
|
|
151
|
+
}
|
|
152
|
+
interface ContactFormSubmission {
|
|
153
|
+
id: string;
|
|
154
|
+
form_id: string;
|
|
155
|
+
project_id: string;
|
|
156
|
+
data: Record<string, string | boolean>;
|
|
157
|
+
submitted_at: string;
|
|
158
|
+
}
|
|
159
|
+
interface ContactFormSubmitInput {
|
|
160
|
+
data: Record<string, string | boolean>;
|
|
161
|
+
metadata?: Record<string, unknown>;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Status Page Types
|
|
166
|
+
*
|
|
167
|
+
* Types for status page API responses.
|
|
168
|
+
*/
|
|
169
|
+
type StatusType = 'operational' | 'maintenance' | 'degraded_performance' | 'partial_outage' | 'major_outage' | 'incident';
|
|
170
|
+
type StatusState = 'active' | 'resolved';
|
|
171
|
+
interface StatusPage {
|
|
172
|
+
id: string;
|
|
173
|
+
project_id: string;
|
|
174
|
+
name: string;
|
|
175
|
+
slug: string;
|
|
176
|
+
description: string | null;
|
|
177
|
+
is_active: boolean;
|
|
178
|
+
created_at: string;
|
|
179
|
+
updated_at: string;
|
|
180
|
+
}
|
|
181
|
+
interface StatusUpdate {
|
|
182
|
+
id: string;
|
|
183
|
+
status_page_id: string;
|
|
184
|
+
title: string;
|
|
185
|
+
description: string;
|
|
186
|
+
status_type: StatusType;
|
|
187
|
+
state: StatusState;
|
|
188
|
+
is_public: boolean;
|
|
189
|
+
affected_services: string[];
|
|
190
|
+
created_at: string;
|
|
191
|
+
updated_at: string;
|
|
192
|
+
resolved_at: string | null;
|
|
193
|
+
}
|
|
194
|
+
interface StatusPageService {
|
|
195
|
+
id: string;
|
|
196
|
+
status_page_id: string;
|
|
197
|
+
name: string;
|
|
198
|
+
description: string | null;
|
|
199
|
+
group_name: string | null;
|
|
200
|
+
color: string | null;
|
|
201
|
+
sort_order: number;
|
|
202
|
+
is_active: boolean;
|
|
203
|
+
created_at: string;
|
|
204
|
+
updated_at: string;
|
|
205
|
+
}
|
|
206
|
+
interface StatusPageOverview {
|
|
207
|
+
status_page: StatusPage;
|
|
208
|
+
current_status: StatusType;
|
|
209
|
+
active_updates: StatusUpdate[];
|
|
210
|
+
recent_updates: StatusUpdate[];
|
|
211
|
+
status_breakdown: Record<string, number>;
|
|
212
|
+
services_status: Record<string, StatusType>;
|
|
213
|
+
services: StatusPageService[];
|
|
214
|
+
total_updates: number;
|
|
215
|
+
active_count: number;
|
|
216
|
+
resolved_count: number;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* useWishes Hook
|
|
221
|
+
*
|
|
222
|
+
* Fetches and manages a list of wishes with filtering and pagination.
|
|
223
|
+
* Provides headless access to the wishes API for custom UI implementations.
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* ```tsx
|
|
227
|
+
* import { useWishes } from '@appgram/react'
|
|
228
|
+
*
|
|
229
|
+
* function WishList() {
|
|
230
|
+
* const { wishes, isLoading, error, setFilters, refetch } = useWishes({
|
|
231
|
+
* filters: { sort_by: 'votes', status: 'pending' },
|
|
232
|
+
* refreshInterval: 30000,
|
|
233
|
+
* })
|
|
234
|
+
*
|
|
235
|
+
* if (isLoading) return <Spinner />
|
|
236
|
+
* if (error) return <Error message={error} onRetry={refetch} />
|
|
237
|
+
*
|
|
238
|
+
* return (
|
|
239
|
+
* <ul>
|
|
240
|
+
* {wishes.map(wish => (
|
|
241
|
+
* <li key={wish.id}>{wish.title}</li>
|
|
242
|
+
* ))}
|
|
243
|
+
* </ul>
|
|
244
|
+
* )
|
|
245
|
+
* }
|
|
246
|
+
* ```
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* ```tsx
|
|
250
|
+
* // With search and pagination
|
|
251
|
+
* function SearchableWishes() {
|
|
252
|
+
* const { wishes, isLoading, setFilters, page, totalPages, setPage } = useWishes()
|
|
253
|
+
*
|
|
254
|
+
* const handleSearch = (query: string) => {
|
|
255
|
+
* setFilters({ search: query, page: 1 })
|
|
256
|
+
* }
|
|
257
|
+
*
|
|
258
|
+
* return (
|
|
259
|
+
* <>
|
|
260
|
+
* <Search onSearch={handleSearch} />
|
|
261
|
+
* <WishGrid wishes={wishes} loading={isLoading} />
|
|
262
|
+
* <Pagination
|
|
263
|
+
* current={page}
|
|
264
|
+
* total={totalPages}
|
|
265
|
+
* onChange={setPage}
|
|
266
|
+
* />
|
|
267
|
+
* </>
|
|
268
|
+
* )
|
|
269
|
+
* }
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
|
|
273
|
+
interface UseWishesOptions {
|
|
274
|
+
/**
|
|
275
|
+
* Initial filters
|
|
276
|
+
*/
|
|
277
|
+
filters?: WishFilters;
|
|
278
|
+
/**
|
|
279
|
+
* Auto-refresh interval in milliseconds (0 to disable)
|
|
280
|
+
* @default 0
|
|
281
|
+
*/
|
|
282
|
+
refreshInterval?: number;
|
|
283
|
+
/**
|
|
284
|
+
* Skip initial fetch
|
|
285
|
+
* @default false
|
|
286
|
+
*/
|
|
287
|
+
skip?: boolean;
|
|
288
|
+
}
|
|
289
|
+
interface UseWishesResult {
|
|
290
|
+
/**
|
|
291
|
+
* List of wishes
|
|
292
|
+
*/
|
|
293
|
+
wishes: Wish[];
|
|
294
|
+
/**
|
|
295
|
+
* Loading state
|
|
296
|
+
*/
|
|
297
|
+
isLoading: boolean;
|
|
298
|
+
/**
|
|
299
|
+
* Error message if any
|
|
300
|
+
*/
|
|
301
|
+
error: string | null;
|
|
302
|
+
/**
|
|
303
|
+
* Total number of wishes
|
|
304
|
+
*/
|
|
305
|
+
total: number;
|
|
306
|
+
/**
|
|
307
|
+
* Current page
|
|
308
|
+
*/
|
|
309
|
+
page: number;
|
|
310
|
+
/**
|
|
311
|
+
* Total pages
|
|
312
|
+
*/
|
|
313
|
+
totalPages: number;
|
|
314
|
+
/**
|
|
315
|
+
* Update filters
|
|
316
|
+
*/
|
|
317
|
+
setFilters: (filters: WishFilters) => void;
|
|
318
|
+
/**
|
|
319
|
+
* Go to a specific page
|
|
320
|
+
*/
|
|
321
|
+
setPage: (page: number) => void;
|
|
322
|
+
/**
|
|
323
|
+
* Manually refetch data
|
|
324
|
+
*/
|
|
325
|
+
refetch: () => Promise<void>;
|
|
326
|
+
}
|
|
327
|
+
declare function useWishes(options?: UseWishesOptions): UseWishesResult;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* useWish Hook
|
|
331
|
+
*
|
|
332
|
+
* Fetches and manages a single wish.
|
|
333
|
+
*/
|
|
334
|
+
|
|
335
|
+
interface UseWishOptions {
|
|
336
|
+
/**
|
|
337
|
+
* The wish ID to fetch
|
|
338
|
+
*/
|
|
339
|
+
wishId: string;
|
|
340
|
+
/**
|
|
341
|
+
* Skip initial fetch
|
|
342
|
+
* @default false
|
|
343
|
+
*/
|
|
344
|
+
skip?: boolean;
|
|
345
|
+
}
|
|
346
|
+
interface UseWishResult {
|
|
347
|
+
/**
|
|
348
|
+
* The wish data
|
|
349
|
+
*/
|
|
350
|
+
wish: Wish | null;
|
|
351
|
+
/**
|
|
352
|
+
* Loading state
|
|
353
|
+
*/
|
|
354
|
+
isLoading: boolean;
|
|
355
|
+
/**
|
|
356
|
+
* Error message if any
|
|
357
|
+
*/
|
|
358
|
+
error: string | null;
|
|
359
|
+
/**
|
|
360
|
+
* Manually refetch data
|
|
361
|
+
*/
|
|
362
|
+
refetch: () => Promise<void>;
|
|
363
|
+
}
|
|
364
|
+
declare function useWish(options: UseWishOptions): UseWishResult;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* useComments Hook
|
|
368
|
+
*
|
|
369
|
+
* Fetches and manages comments for a wish.
|
|
370
|
+
*/
|
|
371
|
+
|
|
372
|
+
interface UseCommentsOptions {
|
|
373
|
+
/**
|
|
374
|
+
* The wish ID to fetch comments for
|
|
375
|
+
*/
|
|
376
|
+
wishId: string;
|
|
377
|
+
/**
|
|
378
|
+
* Number of comments per page
|
|
379
|
+
* @default 20
|
|
380
|
+
*/
|
|
381
|
+
perPage?: number;
|
|
382
|
+
/**
|
|
383
|
+
* Skip initial fetch
|
|
384
|
+
* @default false
|
|
385
|
+
*/
|
|
386
|
+
skip?: boolean;
|
|
387
|
+
}
|
|
388
|
+
interface UseCommentsResult {
|
|
389
|
+
/**
|
|
390
|
+
* List of comments
|
|
391
|
+
*/
|
|
392
|
+
comments: Comment[];
|
|
393
|
+
/**
|
|
394
|
+
* Loading state
|
|
395
|
+
*/
|
|
396
|
+
isLoading: boolean;
|
|
397
|
+
/**
|
|
398
|
+
* Loading state for creating a comment
|
|
399
|
+
*/
|
|
400
|
+
isCreating: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* Error message if any
|
|
403
|
+
*/
|
|
404
|
+
error: string | null;
|
|
405
|
+
/**
|
|
406
|
+
* Total number of comments
|
|
407
|
+
*/
|
|
408
|
+
total: number;
|
|
409
|
+
/**
|
|
410
|
+
* Current page
|
|
411
|
+
*/
|
|
412
|
+
page: number;
|
|
413
|
+
/**
|
|
414
|
+
* Total pages
|
|
415
|
+
*/
|
|
416
|
+
totalPages: number;
|
|
417
|
+
/**
|
|
418
|
+
* Go to next page
|
|
419
|
+
*/
|
|
420
|
+
nextPage: () => void;
|
|
421
|
+
/**
|
|
422
|
+
* Go to previous page
|
|
423
|
+
*/
|
|
424
|
+
prevPage: () => void;
|
|
425
|
+
/**
|
|
426
|
+
* Go to specific page
|
|
427
|
+
*/
|
|
428
|
+
setPage: (page: number) => void;
|
|
429
|
+
/**
|
|
430
|
+
* Create a new comment
|
|
431
|
+
*/
|
|
432
|
+
createComment: (data: Omit<CommentCreateInput, 'wish_id'>) => Promise<Comment | null>;
|
|
433
|
+
/**
|
|
434
|
+
* Manually refetch data
|
|
435
|
+
*/
|
|
436
|
+
refetch: () => Promise<void>;
|
|
437
|
+
}
|
|
438
|
+
declare function useComments(options: UseCommentsOptions): UseCommentsResult;
|
|
439
|
+
|
|
440
|
+
/**
|
|
441
|
+
* useRoadmap Hook
|
|
442
|
+
*
|
|
443
|
+
* Fetches and manages roadmap data for custom UI implementations.
|
|
444
|
+
*
|
|
445
|
+
* @example
|
|
446
|
+
* ```tsx
|
|
447
|
+
* import { useRoadmap } from '@appgram/react'
|
|
448
|
+
*
|
|
449
|
+
* function CustomRoadmap() {
|
|
450
|
+
* const { roadmap, isLoading, error, refetch } = useRoadmap({
|
|
451
|
+
* refreshInterval: 60000,
|
|
452
|
+
* })
|
|
453
|
+
*
|
|
454
|
+
* if (isLoading) return <Skeleton />
|
|
455
|
+
* if (error) return <Error message={error} />
|
|
456
|
+
*
|
|
457
|
+
* return (
|
|
458
|
+
* <div className="roadmap-columns">
|
|
459
|
+
* {roadmap?.columns.map(col => (
|
|
460
|
+
* <Column key={col.id} title={col.title} items={col.items} />
|
|
461
|
+
* ))}
|
|
462
|
+
* </div>
|
|
463
|
+
* )
|
|
464
|
+
* }
|
|
465
|
+
* ```
|
|
466
|
+
*/
|
|
467
|
+
|
|
468
|
+
interface UseRoadmapOptions {
|
|
469
|
+
/**
|
|
470
|
+
* Auto-refresh interval in milliseconds (0 to disable)
|
|
471
|
+
* @default 0
|
|
472
|
+
*/
|
|
473
|
+
refreshInterval?: number;
|
|
474
|
+
/**
|
|
475
|
+
* Skip initial fetch
|
|
476
|
+
* @default false
|
|
477
|
+
*/
|
|
478
|
+
skip?: boolean;
|
|
479
|
+
}
|
|
480
|
+
interface UseRoadmapResult {
|
|
481
|
+
/**
|
|
482
|
+
* Roadmap data
|
|
483
|
+
*/
|
|
484
|
+
roadmap: Roadmap | null;
|
|
485
|
+
/**
|
|
486
|
+
* Roadmap columns with items
|
|
487
|
+
*/
|
|
488
|
+
columns: RoadmapColumn[];
|
|
489
|
+
/**
|
|
490
|
+
* Total number of items
|
|
491
|
+
*/
|
|
492
|
+
totalItems: number;
|
|
493
|
+
/**
|
|
494
|
+
* Loading state
|
|
495
|
+
*/
|
|
496
|
+
isLoading: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Error message if any
|
|
499
|
+
*/
|
|
500
|
+
error: string | null;
|
|
501
|
+
/**
|
|
502
|
+
* Manually refetch data
|
|
503
|
+
*/
|
|
504
|
+
refetch: () => Promise<void>;
|
|
505
|
+
}
|
|
506
|
+
declare function useRoadmap(options?: UseRoadmapOptions): UseRoadmapResult;
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* useReleases Hook
|
|
510
|
+
*
|
|
511
|
+
* Fetches and manages releases/changelog data for custom UI implementations.
|
|
512
|
+
*
|
|
513
|
+
* @example
|
|
514
|
+
* ```tsx
|
|
515
|
+
* import { useReleases } from '@appgram/react'
|
|
516
|
+
*
|
|
517
|
+
* function ChangelogList() {
|
|
518
|
+
* const { releases, isLoading, error, refetch } = useReleases({ limit: 10 })
|
|
519
|
+
*
|
|
520
|
+
* if (isLoading) return <Spinner />
|
|
521
|
+
* if (error) return <Alert>{error}</Alert>
|
|
522
|
+
*
|
|
523
|
+
* return (
|
|
524
|
+
* <ul className="changelog">
|
|
525
|
+
* {releases.map(release => (
|
|
526
|
+
* <li key={release.id}>
|
|
527
|
+
* <h3>{release.title}</h3>
|
|
528
|
+
* <time>{formatDate(release.published_at)}</time>
|
|
529
|
+
* <div dangerouslySetInnerHTML={{ __html: release.content }} />
|
|
530
|
+
* </li>
|
|
531
|
+
* ))}
|
|
532
|
+
* </ul>
|
|
533
|
+
* )
|
|
534
|
+
* }
|
|
535
|
+
* ```
|
|
536
|
+
*/
|
|
537
|
+
|
|
538
|
+
interface UseReleasesOptions {
|
|
539
|
+
/**
|
|
540
|
+
* Maximum number of releases to fetch
|
|
541
|
+
* @default 50
|
|
542
|
+
*/
|
|
543
|
+
limit?: number;
|
|
544
|
+
/**
|
|
545
|
+
* Skip initial fetch
|
|
546
|
+
* @default false
|
|
547
|
+
*/
|
|
548
|
+
skip?: boolean;
|
|
549
|
+
}
|
|
550
|
+
interface UseReleasesResult {
|
|
551
|
+
/**
|
|
552
|
+
* List of releases
|
|
553
|
+
*/
|
|
554
|
+
releases: Release[];
|
|
555
|
+
/**
|
|
556
|
+
* Loading state
|
|
557
|
+
*/
|
|
558
|
+
isLoading: boolean;
|
|
559
|
+
/**
|
|
560
|
+
* Error message if any
|
|
561
|
+
*/
|
|
562
|
+
error: string | null;
|
|
563
|
+
/**
|
|
564
|
+
* Manually refetch data
|
|
565
|
+
*/
|
|
566
|
+
refetch: () => Promise<void>;
|
|
567
|
+
}
|
|
568
|
+
declare function useReleases(options?: UseReleasesOptions): UseReleasesResult;
|
|
569
|
+
/**
|
|
570
|
+
* useRelease Hook
|
|
571
|
+
*
|
|
572
|
+
* Fetches a single release by slug.
|
|
573
|
+
*/
|
|
574
|
+
interface UseReleaseOptions {
|
|
575
|
+
/**
|
|
576
|
+
* The release slug to fetch
|
|
577
|
+
*/
|
|
578
|
+
releaseSlug: string;
|
|
579
|
+
/**
|
|
580
|
+
* Skip initial fetch
|
|
581
|
+
* @default false
|
|
582
|
+
*/
|
|
583
|
+
skip?: boolean;
|
|
584
|
+
}
|
|
585
|
+
interface UseReleaseResult {
|
|
586
|
+
/**
|
|
587
|
+
* The release data
|
|
588
|
+
*/
|
|
589
|
+
release: Release | null;
|
|
590
|
+
/**
|
|
591
|
+
* Loading state
|
|
592
|
+
*/
|
|
593
|
+
isLoading: boolean;
|
|
594
|
+
/**
|
|
595
|
+
* Error message if any
|
|
596
|
+
*/
|
|
597
|
+
error: string | null;
|
|
598
|
+
/**
|
|
599
|
+
* Manually refetch data
|
|
600
|
+
*/
|
|
601
|
+
refetch: () => Promise<void>;
|
|
602
|
+
}
|
|
603
|
+
declare function useRelease(options: UseReleaseOptions): UseReleaseResult;
|
|
604
|
+
|
|
605
|
+
/**
|
|
606
|
+
* useHelpCenter Hook
|
|
607
|
+
*
|
|
608
|
+
* Fetches and manages help center data.
|
|
609
|
+
*/
|
|
610
|
+
|
|
611
|
+
interface UseHelpCenterOptions {
|
|
612
|
+
/**
|
|
613
|
+
* Skip initial fetch
|
|
614
|
+
* @default false
|
|
615
|
+
*/
|
|
616
|
+
skip?: boolean;
|
|
617
|
+
}
|
|
618
|
+
interface UseHelpCenterResult {
|
|
619
|
+
/**
|
|
620
|
+
* Help collection
|
|
621
|
+
*/
|
|
622
|
+
collection: HelpCollection | null;
|
|
623
|
+
/**
|
|
624
|
+
* Help flows
|
|
625
|
+
*/
|
|
626
|
+
flows: HelpFlow[];
|
|
627
|
+
/**
|
|
628
|
+
* Loading state
|
|
629
|
+
*/
|
|
630
|
+
isLoading: boolean;
|
|
631
|
+
/**
|
|
632
|
+
* Error message if any
|
|
633
|
+
*/
|
|
634
|
+
error: string | null;
|
|
635
|
+
/**
|
|
636
|
+
* Manually refetch data
|
|
637
|
+
*/
|
|
638
|
+
refetch: () => Promise<void>;
|
|
639
|
+
}
|
|
640
|
+
declare function useHelpCenter(options?: UseHelpCenterOptions): UseHelpCenterResult;
|
|
641
|
+
/**
|
|
642
|
+
* useHelpFlow Hook
|
|
643
|
+
*
|
|
644
|
+
* Fetches a single help flow by slug.
|
|
645
|
+
*/
|
|
646
|
+
interface UseHelpFlowOptions {
|
|
647
|
+
/**
|
|
648
|
+
* The flow slug to fetch
|
|
649
|
+
*/
|
|
650
|
+
flowSlug: string;
|
|
651
|
+
/**
|
|
652
|
+
* Skip initial fetch
|
|
653
|
+
* @default false
|
|
654
|
+
*/
|
|
655
|
+
skip?: boolean;
|
|
656
|
+
}
|
|
657
|
+
interface UseHelpFlowResult {
|
|
658
|
+
/**
|
|
659
|
+
* The flow data
|
|
660
|
+
*/
|
|
661
|
+
flow: HelpFlow | null;
|
|
662
|
+
/**
|
|
663
|
+
* Loading state
|
|
664
|
+
*/
|
|
665
|
+
isLoading: boolean;
|
|
666
|
+
/**
|
|
667
|
+
* Error message if any
|
|
668
|
+
*/
|
|
669
|
+
error: string | null;
|
|
670
|
+
/**
|
|
671
|
+
* Manually refetch data
|
|
672
|
+
*/
|
|
673
|
+
refetch: () => Promise<void>;
|
|
674
|
+
}
|
|
675
|
+
declare function useHelpFlow(options: UseHelpFlowOptions): UseHelpFlowResult;
|
|
676
|
+
/**
|
|
677
|
+
* useHelpArticle Hook
|
|
678
|
+
*
|
|
679
|
+
* Fetches a single help article by slug.
|
|
680
|
+
*/
|
|
681
|
+
interface UseHelpArticleOptions {
|
|
682
|
+
/**
|
|
683
|
+
* The article slug to fetch
|
|
684
|
+
*/
|
|
685
|
+
articleSlug: string;
|
|
686
|
+
/**
|
|
687
|
+
* The flow ID the article belongs to
|
|
688
|
+
*/
|
|
689
|
+
flowId: string;
|
|
690
|
+
/**
|
|
691
|
+
* Skip initial fetch
|
|
692
|
+
* @default false
|
|
693
|
+
*/
|
|
694
|
+
skip?: boolean;
|
|
695
|
+
}
|
|
696
|
+
interface UseHelpArticleResult {
|
|
697
|
+
/**
|
|
698
|
+
* The article data
|
|
699
|
+
*/
|
|
700
|
+
article: HelpArticle | null;
|
|
701
|
+
/**
|
|
702
|
+
* Loading state
|
|
703
|
+
*/
|
|
704
|
+
isLoading: boolean;
|
|
705
|
+
/**
|
|
706
|
+
* Error message if any
|
|
707
|
+
*/
|
|
708
|
+
error: string | null;
|
|
709
|
+
/**
|
|
710
|
+
* Manually refetch data
|
|
711
|
+
*/
|
|
712
|
+
refetch: () => Promise<void>;
|
|
713
|
+
}
|
|
714
|
+
declare function useHelpArticle(options: UseHelpArticleOptions): UseHelpArticleResult;
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* useSupport Hook
|
|
718
|
+
*
|
|
719
|
+
* Manages support ticket submissions and access.
|
|
720
|
+
*/
|
|
721
|
+
|
|
722
|
+
interface UseSupportOptions {
|
|
723
|
+
/**
|
|
724
|
+
* Callback when a ticket is successfully submitted
|
|
725
|
+
*/
|
|
726
|
+
onSubmitSuccess?: (ticket: SupportRequest) => void;
|
|
727
|
+
/**
|
|
728
|
+
* Callback when a submission fails
|
|
729
|
+
*/
|
|
730
|
+
onSubmitError?: (error: string) => void;
|
|
731
|
+
}
|
|
732
|
+
interface UseSupportResult {
|
|
733
|
+
/**
|
|
734
|
+
* Loading state for ticket submission
|
|
735
|
+
*/
|
|
736
|
+
isSubmitting: boolean;
|
|
737
|
+
/**
|
|
738
|
+
* Loading state for magic link request
|
|
739
|
+
*/
|
|
740
|
+
isSendingMagicLink: boolean;
|
|
741
|
+
/**
|
|
742
|
+
* Loading state for token verification
|
|
743
|
+
*/
|
|
744
|
+
isVerifying: boolean;
|
|
745
|
+
/**
|
|
746
|
+
* Error message if any
|
|
747
|
+
*/
|
|
748
|
+
error: string | null;
|
|
749
|
+
/**
|
|
750
|
+
* Success message after submitting
|
|
751
|
+
*/
|
|
752
|
+
successMessage: string | null;
|
|
753
|
+
/**
|
|
754
|
+
* Submit a new support ticket
|
|
755
|
+
*/
|
|
756
|
+
submitTicket: (data: SupportRequestInput) => Promise<SupportRequest | null>;
|
|
757
|
+
/**
|
|
758
|
+
* Request a magic link to access tickets
|
|
759
|
+
*/
|
|
760
|
+
requestMagicLink: (email: string) => Promise<boolean>;
|
|
761
|
+
/**
|
|
762
|
+
* Verify a magic link token
|
|
763
|
+
*/
|
|
764
|
+
verifyToken: (token: string) => Promise<{
|
|
765
|
+
tickets: SupportRequest[];
|
|
766
|
+
userEmail: string;
|
|
767
|
+
} | null>;
|
|
768
|
+
/**
|
|
769
|
+
* Get a specific ticket by ID with token
|
|
770
|
+
*/
|
|
771
|
+
getTicket: (ticketId: string, token: string) => Promise<SupportRequest | null>;
|
|
772
|
+
/**
|
|
773
|
+
* Add a message to a ticket
|
|
774
|
+
*/
|
|
775
|
+
addMessage: (ticketId: string, token: string, content: string) => Promise<{
|
|
776
|
+
id: string;
|
|
777
|
+
content: string;
|
|
778
|
+
created_at: string;
|
|
779
|
+
} | null>;
|
|
780
|
+
/**
|
|
781
|
+
* Clear any error or success messages
|
|
782
|
+
*/
|
|
783
|
+
clearMessages: () => void;
|
|
784
|
+
}
|
|
785
|
+
declare function useSupport(options?: UseSupportOptions): UseSupportResult;
|
|
786
|
+
|
|
787
|
+
/**
|
|
788
|
+
* useStatus Hook
|
|
789
|
+
*
|
|
790
|
+
* Fetches status page data and transforms it for the StatusBoard component.
|
|
791
|
+
* Supports auto-refresh polling.
|
|
792
|
+
*/
|
|
793
|
+
|
|
794
|
+
interface UseStatusOptions {
|
|
795
|
+
/**
|
|
796
|
+
* Status page slug
|
|
797
|
+
* @default 'status'
|
|
798
|
+
*/
|
|
799
|
+
slug?: string;
|
|
800
|
+
/**
|
|
801
|
+
* Whether to fetch immediately
|
|
802
|
+
* @default true
|
|
803
|
+
*/
|
|
804
|
+
enabled?: boolean;
|
|
805
|
+
/**
|
|
806
|
+
* Auto-refresh interval in milliseconds (0 to disable)
|
|
807
|
+
* @default 30000
|
|
808
|
+
*/
|
|
809
|
+
refreshInterval?: number;
|
|
810
|
+
}
|
|
811
|
+
interface UseStatusResult {
|
|
812
|
+
/**
|
|
813
|
+
* Transformed status data ready for StatusBoard
|
|
814
|
+
*/
|
|
815
|
+
status: StatusData | null;
|
|
816
|
+
/**
|
|
817
|
+
* Raw API overview response
|
|
818
|
+
*/
|
|
819
|
+
overview: StatusPageOverview | null;
|
|
820
|
+
/**
|
|
821
|
+
* Loading state
|
|
822
|
+
*/
|
|
823
|
+
isLoading: boolean;
|
|
824
|
+
/**
|
|
825
|
+
* Error message
|
|
826
|
+
*/
|
|
827
|
+
error: string | null;
|
|
828
|
+
/**
|
|
829
|
+
* Manually refresh
|
|
830
|
+
*/
|
|
831
|
+
refetch: () => Promise<void>;
|
|
832
|
+
}
|
|
833
|
+
declare function useStatus(options?: UseStatusOptions): UseStatusResult;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* useSurvey Hook
|
|
837
|
+
*
|
|
838
|
+
* Fetches and manages survey data and response submission.
|
|
839
|
+
*/
|
|
840
|
+
|
|
841
|
+
interface UseSurveyOptions {
|
|
842
|
+
/**
|
|
843
|
+
* Whether to fetch the survey immediately
|
|
844
|
+
* @default true
|
|
845
|
+
*/
|
|
846
|
+
enabled?: boolean;
|
|
847
|
+
}
|
|
848
|
+
interface UseSurveyResult {
|
|
849
|
+
survey: Survey | null;
|
|
850
|
+
nodes: SurveyNode[];
|
|
851
|
+
isLoading: boolean;
|
|
852
|
+
error: string | null;
|
|
853
|
+
refetch: () => Promise<void>;
|
|
854
|
+
}
|
|
855
|
+
declare function useSurvey(slug: string, options?: UseSurveyOptions): UseSurveyResult;
|
|
856
|
+
interface UseSurveySubmitOptions {
|
|
857
|
+
onSuccess?: (response: SurveyResponse) => void;
|
|
858
|
+
onError?: (error: string) => void;
|
|
859
|
+
}
|
|
860
|
+
interface UseSurveySubmitResult {
|
|
861
|
+
isSubmitting: boolean;
|
|
862
|
+
error: string | null;
|
|
863
|
+
successMessage: string | null;
|
|
864
|
+
submitResponse: (surveyId: string, data: SurveySubmitInput) => Promise<SurveyResponse | null>;
|
|
865
|
+
clearMessages: () => void;
|
|
866
|
+
}
|
|
867
|
+
declare function useSurveySubmit(options?: UseSurveySubmitOptions): UseSurveySubmitResult;
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* useContactForm Hook
|
|
871
|
+
*
|
|
872
|
+
* Fetches contact form config and manages form submission.
|
|
873
|
+
*/
|
|
874
|
+
|
|
875
|
+
interface UseContactFormOptions {
|
|
876
|
+
/**
|
|
877
|
+
* Whether to fetch the form immediately
|
|
878
|
+
* @default true
|
|
879
|
+
*/
|
|
880
|
+
enabled?: boolean;
|
|
881
|
+
}
|
|
882
|
+
interface UseContactFormResult {
|
|
883
|
+
form: ContactForm | null;
|
|
884
|
+
isLoading: boolean;
|
|
885
|
+
error: string | null;
|
|
886
|
+
refetch: () => Promise<void>;
|
|
887
|
+
}
|
|
888
|
+
declare function useContactForm(formId: string, options?: UseContactFormOptions): UseContactFormResult;
|
|
889
|
+
interface UseContactFormSubmitOptions {
|
|
890
|
+
/**
|
|
891
|
+
* Rate limit cooldown in milliseconds
|
|
892
|
+
* @default 5000
|
|
893
|
+
*/
|
|
894
|
+
rateLimitMs?: number;
|
|
895
|
+
onSuccess?: (submission: ContactFormSubmission) => void;
|
|
896
|
+
onError?: (error: string) => void;
|
|
897
|
+
}
|
|
898
|
+
interface UseContactFormSubmitResult {
|
|
899
|
+
isSubmitting: boolean;
|
|
900
|
+
error: string | null;
|
|
901
|
+
successMessage: string | null;
|
|
902
|
+
isRateLimited: boolean;
|
|
903
|
+
submitForm: (projectId: string, formId: string, data: ContactFormSubmitInput) => Promise<ContactFormSubmission | null>;
|
|
904
|
+
validateField: (value: string, field: {
|
|
905
|
+
type: string;
|
|
906
|
+
required: boolean;
|
|
907
|
+
validation?: {
|
|
908
|
+
minLength?: number;
|
|
909
|
+
maxLength?: number;
|
|
910
|
+
pattern?: string;
|
|
911
|
+
};
|
|
912
|
+
}) => string | null;
|
|
913
|
+
clearMessages: () => void;
|
|
914
|
+
}
|
|
915
|
+
declare function useContactFormSubmit(options?: UseContactFormSubmitOptions): UseContactFormSubmitResult;
|
|
916
|
+
|
|
917
|
+
export { useHelpArticle as $, type UseHelpCenterResult as A, type UseHelpFlowOptions as B, type ContactForm as C, type UseHelpFlowResult as D, type UseReleaseOptions as E, type UseReleaseResult as F, type UseReleasesOptions as G, type UseReleasesResult as H, type UseRoadmapOptions as I, type UseRoadmapResult as J, type UseStatusOptions as K, type UseStatusResult as L, type UseSupportOptions as M, type UseSupportResult as N, type UseSurveyOptions as O, type UseSurveyResult as P, type UseSurveySubmitOptions as Q, type UseSurveySubmitResult as R, type StatusPageOverview as S, type UseWishOptions as T, type UseCommentsOptions as U, type UseWishResult as V, type UseWishesOptions as W, type UseWishesResult as X, useComments as Y, useContactForm as Z, useContactFormSubmit as _, type Survey as a, useHelpCenter as a0, useHelpFlow as a1, useRelease as a2, useReleases as a3, useRoadmap as a4, useStatus as a5, useSupport as a6, useSurvey as a7, useSurveySubmit as a8, useWish as a9, useWishes as aa, type SurveyNode as b, type SurveySubmitInput as c, type SurveyResponse as d, type ContactFormSubmitInput as e, type ContactFormSubmission as f, type ContactFormField as g, type ContactFormFieldType as h, type ContactFormFieldValidation as i, type StatusPage as j, type StatusPageService as k, type StatusState as l, type StatusType as m, type StatusUpdate as n, type SurveyAnswer as o, type SurveyNodeBranch as p, type SurveyNodeOption as q, type SurveyQuestionType as r, type UseCommentsResult as s, type UseContactFormOptions as t, type UseContactFormResult as u, type UseContactFormSubmitOptions as v, type UseContactFormSubmitResult as w, type UseHelpArticleOptions as x, type UseHelpArticleResult as y, type UseHelpCenterOptions as z };
|