convex-feedback 0.1.0 → 0.1.2
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 +351 -92
- package/dist/.tsbuildinfo +1 -1
- package/dist/client/api.d.ts +267 -68
- package/dist/client/api.d.ts.map +1 -1
- package/dist/client/config.d.ts +168 -29
- package/dist/client/config.d.ts.map +1 -1
- package/dist/client/config.js.map +1 -1
- package/dist/client/index.d.ts +167 -172
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +75 -14
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/component.d.ts +2 -2
- package/dist/component/_generated/component.d.ts.map +1 -1
- package/dist/component/comments.d.ts +12 -12
- package/dist/component/comments.d.ts.map +1 -1
- package/dist/component/comments.js +43 -60
- package/dist/component/comments.js.map +1 -1
- package/dist/component/entries.d.ts +30 -30
- package/dist/component/entries.d.ts.map +1 -1
- package/dist/component/entries.js +216 -97
- package/dist/component/entries.js.map +1 -1
- package/dist/component/model.d.ts +151 -0
- package/dist/component/model.d.ts.map +1 -1
- package/dist/react/index.d.ts +178 -56
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +70 -4
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client/api.ts +326 -36
- package/src/client/config.ts +191 -29
- package/src/client/index.ts +437 -16
- package/src/component/_generated/component.ts +2 -2
- package/src/component/comments.ts +43 -61
- package/src/component/entries.ts +300 -123
- package/src/component/model.ts +158 -0
- package/src/react/index.ts +217 -9
package/dist/client/api.d.ts
CHANGED
|
@@ -1,72 +1,271 @@
|
|
|
1
1
|
import type { FunctionReference, PaginationOptions, PaginationResult } from "convex/server";
|
|
2
2
|
import type { CommentSort, EntryKind, EntrySort, EntryStatus, FeedbackComment, FeedbackEntry, SimilarEntriesResult } from "../component/model.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Arguments for cursor-paginated entry listing.
|
|
5
|
+
*/
|
|
6
|
+
export type ListEntriesArgs = {
|
|
7
|
+
/**
|
|
8
|
+
* Convex cursor-pagination options.
|
|
9
|
+
*
|
|
10
|
+
* React consumers normally do not construct this directly; `useEntries`
|
|
11
|
+
* manages it through `usePaginatedQuery`.
|
|
12
|
+
*/
|
|
13
|
+
paginationOpts: PaginationOptions;
|
|
14
|
+
/**
|
|
15
|
+
* Entry kinds to include.
|
|
16
|
+
*
|
|
17
|
+
* Filtering is performed by Convex before pagination. Omit this field to
|
|
18
|
+
* include every kind.
|
|
19
|
+
*
|
|
20
|
+
* Must contain at least one kind when provided.
|
|
21
|
+
*/
|
|
22
|
+
kinds?: EntryKind[];
|
|
23
|
+
/** Restricts entries to this workflow status. */
|
|
24
|
+
status?: EntryStatus;
|
|
25
|
+
/**
|
|
26
|
+
* Server-side ordering strategy.
|
|
27
|
+
*
|
|
28
|
+
* When omitted, `config.entries.defaultSort` is used.
|
|
29
|
+
*/
|
|
30
|
+
sort?: EntrySort;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Arguments for retrieving one entry.
|
|
34
|
+
*/
|
|
35
|
+
export type GetEntryArgs = {
|
|
36
|
+
/** Identifier returned by the component for the requested entry. */
|
|
37
|
+
entryId: string;
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Arguments for full-text entry search.
|
|
41
|
+
*/
|
|
42
|
+
export type SearchEntriesArgs = {
|
|
43
|
+
/** Full-text query matched against the entry's indexed search text. */
|
|
44
|
+
searchQuery: string;
|
|
45
|
+
/**
|
|
46
|
+
* Entry kinds to include.
|
|
47
|
+
*
|
|
48
|
+
* Filtering occurs inside the Convex query rather than after results reach
|
|
49
|
+
* the client.
|
|
50
|
+
*/
|
|
51
|
+
kinds?: EntryKind[];
|
|
52
|
+
/** Optional workflow-status restriction. */
|
|
53
|
+
status?: EntryStatus;
|
|
54
|
+
/**
|
|
55
|
+
* Maximum number of results to return.
|
|
56
|
+
*
|
|
57
|
+
* When omitted, `config.search.defaultLimit` is used. The server clamps the
|
|
58
|
+
* value to `config.search.maxLimit`.
|
|
59
|
+
*/
|
|
60
|
+
limit?: number;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Arguments for exact/similar duplicate detection.
|
|
64
|
+
*/
|
|
65
|
+
export type FindSimilarEntriesArgs = {
|
|
66
|
+
/**
|
|
67
|
+
* Proposed entry title.
|
|
68
|
+
*
|
|
69
|
+
* Its normalized form is used for exact duplicate detection.
|
|
70
|
+
*/
|
|
71
|
+
title: string;
|
|
72
|
+
/**
|
|
73
|
+
* Proposed entry body.
|
|
74
|
+
*
|
|
75
|
+
* Combined with the title for the full-text similarity search.
|
|
76
|
+
*/
|
|
77
|
+
body: string;
|
|
78
|
+
/**
|
|
79
|
+
* Restricts duplicate detection to one entry kind.
|
|
80
|
+
*
|
|
81
|
+
* Omit to search every kind.
|
|
82
|
+
*/
|
|
83
|
+
kind?: EntryKind;
|
|
84
|
+
/**
|
|
85
|
+
* Maximum combined number of suggestions returned.
|
|
86
|
+
*
|
|
87
|
+
* Exact normalized-title matches consume this limit first. Only remaining
|
|
88
|
+
* slots are available to full-text matches.
|
|
89
|
+
*
|
|
90
|
+
* Therefore:
|
|
91
|
+
*
|
|
92
|
+
* `result.exact.length + result.similar.length <= limit`
|
|
93
|
+
*
|
|
94
|
+
* When omitted, `config.search.duplicateSuggestionLimit` is used.
|
|
95
|
+
*/
|
|
96
|
+
limit?: number;
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* Arguments for creating an entry.
|
|
100
|
+
*/
|
|
101
|
+
export type CreateEntryArgs = {
|
|
102
|
+
/** Category of entry to create. */
|
|
103
|
+
kind: EntryKind;
|
|
104
|
+
/** Entry title. */
|
|
105
|
+
title: string;
|
|
106
|
+
/** Entry description/body. */
|
|
107
|
+
body: string;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Arguments for editing an existing entry.
|
|
111
|
+
*/
|
|
112
|
+
export type UpdateEntryArgs = {
|
|
113
|
+
/** Entry to update. */
|
|
114
|
+
entryId: string;
|
|
115
|
+
/** Complete replacement title. */
|
|
116
|
+
title: string;
|
|
117
|
+
/** Complete replacement body. */
|
|
118
|
+
body: string;
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* Arguments for changing an entry workflow status.
|
|
122
|
+
*/
|
|
123
|
+
export type SetEntryStatusArgs = {
|
|
124
|
+
/** Entry whose status should change. */
|
|
125
|
+
entryId: string;
|
|
126
|
+
/** Desired workflow status. */
|
|
127
|
+
status: EntryStatus;
|
|
128
|
+
};
|
|
129
|
+
/**
|
|
130
|
+
* Arguments for setting the current actor's entry-upvote state.
|
|
131
|
+
*/
|
|
132
|
+
export type SetEntryUpvoteArgs = {
|
|
133
|
+
/** Entry whose upvote state should change. */
|
|
134
|
+
entryId: string;
|
|
135
|
+
/**
|
|
136
|
+
* Desired final state.
|
|
137
|
+
*
|
|
138
|
+
* `true` ensures the current actor has an upvote.
|
|
139
|
+
* `false` ensures the current actor does not have an upvote.
|
|
140
|
+
*
|
|
141
|
+
* This is intentionally state-setting rather than toggle semantics, making
|
|
142
|
+
* the mutation idempotent and safe to retry.
|
|
143
|
+
*/
|
|
144
|
+
desiredState: boolean;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* Authoritative entry-upvote state returned after a mutation.
|
|
148
|
+
*/
|
|
149
|
+
export type SetEntryUpvoteResult = {
|
|
150
|
+
/** Final upvote state for the current actor. */
|
|
151
|
+
active: boolean;
|
|
152
|
+
/** Updated total number of entry upvotes. */
|
|
153
|
+
upvoteCount: number;
|
|
154
|
+
};
|
|
155
|
+
/**
|
|
156
|
+
* Arguments for cursor-paginated comment/reply listing.
|
|
157
|
+
*/
|
|
158
|
+
export type ListCommentsArgs = {
|
|
159
|
+
/** Convex cursor-pagination options. */
|
|
160
|
+
paginationOpts: PaginationOptions;
|
|
161
|
+
/** Entry whose conversation should be queried. */
|
|
162
|
+
entryId: string;
|
|
163
|
+
/**
|
|
164
|
+
* Direct parent comment.
|
|
165
|
+
*
|
|
166
|
+
* Omit to query top-level comments. When supplied, only direct children of
|
|
167
|
+
* this comment are returned; deeper descendants are not loaded.
|
|
168
|
+
*/
|
|
169
|
+
parentCommentId?: string;
|
|
170
|
+
/**
|
|
171
|
+
* Server-side comment ordering strategy.
|
|
172
|
+
*
|
|
173
|
+
* When omitted, `config.comments.defaultSort` is used.
|
|
174
|
+
*/
|
|
175
|
+
sort?: CommentSort;
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Arguments for creating a top-level comment or reply.
|
|
179
|
+
*/
|
|
180
|
+
export type CreateCommentArgs = {
|
|
181
|
+
/** Entry the comment belongs to. */
|
|
182
|
+
entryId: string;
|
|
183
|
+
/**
|
|
184
|
+
* Direct parent comment.
|
|
185
|
+
*
|
|
186
|
+
* Omit to create a top-level comment.
|
|
187
|
+
*/
|
|
188
|
+
parentCommentId?: string;
|
|
189
|
+
/** Comment/reply text. */
|
|
190
|
+
body: string;
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Arguments for editing a comment.
|
|
194
|
+
*/
|
|
195
|
+
export type UpdateCommentArgs = {
|
|
196
|
+
/** Comment to edit. */
|
|
197
|
+
commentId: string;
|
|
198
|
+
/** Complete replacement body. */
|
|
199
|
+
body: string;
|
|
200
|
+
};
|
|
201
|
+
/**
|
|
202
|
+
* Arguments for soft-deleting a comment.
|
|
203
|
+
*/
|
|
204
|
+
export type DeleteCommentArgs = {
|
|
205
|
+
/** Comment to soft-delete. */
|
|
206
|
+
commentId: string;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Arguments for setting the current actor's comment-like state.
|
|
210
|
+
*/
|
|
211
|
+
export type SetCommentLikeArgs = {
|
|
212
|
+
/** Comment whose like state should change. */
|
|
213
|
+
commentId: string;
|
|
214
|
+
/**
|
|
215
|
+
* Desired final state.
|
|
216
|
+
*
|
|
217
|
+
* `true` ensures the actor likes the comment.
|
|
218
|
+
* `false` ensures the actor does not like the comment.
|
|
219
|
+
*
|
|
220
|
+
* This is idempotent rather than toggle-based.
|
|
221
|
+
*/
|
|
222
|
+
desiredState: boolean;
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* Authoritative comment-like state returned after a mutation.
|
|
226
|
+
*/
|
|
227
|
+
export type SetCommentLikeResult = {
|
|
228
|
+
/** Final like state for the current actor. */
|
|
229
|
+
active: boolean;
|
|
230
|
+
/** Updated total number of comment likes. */
|
|
231
|
+
likeCount: number;
|
|
232
|
+
};
|
|
233
|
+
/**
|
|
234
|
+
* Public Convex API exposed by `exposeFeedbackApi`.
|
|
235
|
+
*
|
|
236
|
+
* The host application exposes these wrappers from its own Convex deployment
|
|
237
|
+
* after resolving authentication and configuration.
|
|
238
|
+
*
|
|
239
|
+
* @typeParam RateLimitResult A validated rejection value returned by mutations
|
|
240
|
+
* when non-throwing rate limiting is configured. The default `never` preserves
|
|
241
|
+
* the original success-only mutation results.
|
|
242
|
+
*/
|
|
243
|
+
export interface FeedbackPublicApi<Name extends string | undefined = string | undefined, RateLimitResult = never> {
|
|
244
|
+
/** Returns a cursor-paginated entry list. */
|
|
245
|
+
listEntries: FunctionReference<"query", "public", ListEntriesArgs, PaginationResult<FeedbackEntry>, Name>;
|
|
246
|
+
/** Returns one entry or `null` when it does not exist. */
|
|
247
|
+
getEntry: FunctionReference<"query", "public", GetEntryArgs, FeedbackEntry | null, Name>;
|
|
248
|
+
/** Performs full-text entry search. */
|
|
249
|
+
searchEntries: FunctionReference<"query", "public", SearchEntriesArgs, FeedbackEntry[], Name>;
|
|
250
|
+
/** Finds exact and likely duplicate entries. */
|
|
251
|
+
findSimilarEntries: FunctionReference<"query", "public", FindSimilarEntriesArgs, SimilarEntriesResult, Name>;
|
|
252
|
+
/** Creates an entry, returning its identifier or a rate-limit rejection. */
|
|
253
|
+
createEntry: FunctionReference<"mutation", "public", CreateEntryArgs, string | RateLimitResult, Name>;
|
|
254
|
+
/** Replaces entry content, or returns a configured rate-limit rejection. */
|
|
255
|
+
updateEntry: FunctionReference<"mutation", "public", UpdateEntryArgs, null | RateLimitResult, Name>;
|
|
256
|
+
/** Changes entry status, or returns a configured rate-limit rejection. */
|
|
257
|
+
setEntryStatus: FunctionReference<"mutation", "public", SetEntryStatusArgs, null | RateLimitResult, Name>;
|
|
258
|
+
/** Sets entry-upvote state, or returns a configured rate-limit rejection. */
|
|
259
|
+
setEntryUpvote: FunctionReference<"mutation", "public", SetEntryUpvoteArgs, SetEntryUpvoteResult | RateLimitResult, Name>;
|
|
260
|
+
/** Returns one paginated level of comments or replies. */
|
|
261
|
+
listComments: FunctionReference<"query", "public", ListCommentsArgs, PaginationResult<FeedbackComment>, Name>;
|
|
262
|
+
/** Creates a comment/reply, returning its ID or a rate-limit rejection. */
|
|
263
|
+
createComment: FunctionReference<"mutation", "public", CreateCommentArgs, string | RateLimitResult, Name>;
|
|
264
|
+
/** Replaces comment content, or returns a configured rate-limit rejection. */
|
|
265
|
+
updateComment: FunctionReference<"mutation", "public", UpdateCommentArgs, null | RateLimitResult, Name>;
|
|
266
|
+
/** Soft-deletes a comment, or returns a configured rate-limit rejection. */
|
|
267
|
+
deleteComment: FunctionReference<"mutation", "public", DeleteCommentArgs, null | RateLimitResult, Name>;
|
|
268
|
+
/** Sets comment-like state, or returns a configured rate-limit rejection. */
|
|
269
|
+
setCommentLike: FunctionReference<"mutation", "public", SetCommentLikeArgs, SetCommentLikeResult | RateLimitResult, Name>;
|
|
71
270
|
}
|
|
72
271
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/client/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/client/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,eAAe,EACf,aAAa,EACb,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAE/B,MAAM,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/client/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,eAAe,CAAC;AAEvB,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACX,eAAe,EACf,aAAa,EACb,oBAAoB,EACrB,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;OAKG;IACH,cAAc,EAA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,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,GAAG,eAAe,EACtC,IAAI,CACL,CAAC;IAEF,0DAA0D;IAC1D,YAAY,EAAE,iBAAiB,CAC7B,OAAO,EACP,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,CAAC,eAAe,CAAC,EACjC,IAAI,CACL,CAAC;IAEF,2EAA2E;IAC3E,aAAa,EAAE,iBAAiB,CAC9B,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,MAAM,GAAG,eAAe,EACxB,IAAI,CACL,CAAC;IAEF,8EAA8E;IAC9E,aAAa,EAAE,iBAAiB,CAC9B,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,IAAI,GAAG,eAAe,EACtB,IAAI,CACL,CAAC;IAEF,4EAA4E;IAC5E,aAAa,EAAE,iBAAiB,CAC9B,UAAU,EACV,QAAQ,EACR,iBAAiB,EACjB,IAAI,GAAG,eAAe,EACtB,IAAI,CACL,CAAC;IAEF,6EAA6E;IAC7E,cAAc,EAAE,iBAAiB,CAC/B,UAAU,EACV,QAAQ,EACR,kBAAkB,EAClB,oBAAoB,GAAG,eAAe,EACtC,IAAI,CACL,CAAC;CACH"}
|
package/dist/client/config.d.ts
CHANGED
|
@@ -1,36 +1,175 @@
|
|
|
1
1
|
import type { CommentSort, EntryKind, EntrySort, EntryStatus } from "../component/model.js";
|
|
2
|
+
/**
|
|
3
|
+
* Entry-related component configuration.
|
|
4
|
+
*/
|
|
5
|
+
export interface FeedbackEntriesConfig {
|
|
6
|
+
/**
|
|
7
|
+
* Entry kinds that may be created through this component instance.
|
|
8
|
+
*
|
|
9
|
+
* @default ["feedback", "feature_request", "bug_report"]
|
|
10
|
+
*/
|
|
11
|
+
enabledKinds: readonly EntryKind[];
|
|
12
|
+
/**
|
|
13
|
+
* Status assigned to newly created entries.
|
|
14
|
+
*
|
|
15
|
+
* @default "open"
|
|
16
|
+
*/
|
|
17
|
+
defaultStatus: EntryStatus;
|
|
18
|
+
/**
|
|
19
|
+
* Default server-side entry ordering when callers do not specify `sort`.
|
|
20
|
+
*
|
|
21
|
+
* @default "top"
|
|
22
|
+
*/
|
|
23
|
+
defaultSort: EntrySort;
|
|
24
|
+
/**
|
|
25
|
+
* Maximum number of entries a caller may request in one pagination batch.
|
|
26
|
+
*
|
|
27
|
+
* Larger requested page sizes are clamped to this value.
|
|
28
|
+
*
|
|
29
|
+
* @default 50
|
|
30
|
+
*/
|
|
31
|
+
maxPageSize: number;
|
|
32
|
+
/**
|
|
33
|
+
* Whether entry authors may edit their own title and body.
|
|
34
|
+
*
|
|
35
|
+
* Moderators are governed separately by the resolved actor permissions.
|
|
36
|
+
*
|
|
37
|
+
* @default true
|
|
38
|
+
*/
|
|
39
|
+
editableByAuthor: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Comment and reply configuration.
|
|
43
|
+
*/
|
|
44
|
+
export interface FeedbackCommentsConfig {
|
|
45
|
+
/**
|
|
46
|
+
* Maximum allowed nesting depth.
|
|
47
|
+
*
|
|
48
|
+
* Top-level comments have depth `0`. Attempts to create replies deeper than
|
|
49
|
+
* this limit are rejected by the component.
|
|
50
|
+
*
|
|
51
|
+
* @default 5
|
|
52
|
+
*/
|
|
53
|
+
maxDepth: number;
|
|
54
|
+
/**
|
|
55
|
+
* Maximum number of comments or replies that may be requested in one
|
|
56
|
+
* pagination batch.
|
|
57
|
+
*
|
|
58
|
+
* @default 50
|
|
59
|
+
*/
|
|
60
|
+
maxPageSize: number;
|
|
61
|
+
/**
|
|
62
|
+
* Default server-side comment ordering.
|
|
63
|
+
*
|
|
64
|
+
* @default "top"
|
|
65
|
+
*/
|
|
66
|
+
defaultSort: CommentSort;
|
|
67
|
+
/**
|
|
68
|
+
* Whether comment authors may edit their own comments.
|
|
69
|
+
*
|
|
70
|
+
* @default true
|
|
71
|
+
*/
|
|
72
|
+
editableByAuthor: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Whether comment authors may soft-delete their own comments.
|
|
75
|
+
*
|
|
76
|
+
* Deletion preserves the document so nested replies retain their structure.
|
|
77
|
+
*
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
deletableByAuthor: boolean;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Full-text search and duplicate-detection configuration.
|
|
84
|
+
*/
|
|
85
|
+
export interface FeedbackSearchConfig {
|
|
86
|
+
/**
|
|
87
|
+
* Whether similar/duplicate suggestions are enabled.
|
|
88
|
+
*
|
|
89
|
+
* When disabled, duplicate-search queries return empty `exact` and
|
|
90
|
+
* `similar` arrays.
|
|
91
|
+
*
|
|
92
|
+
* @default true
|
|
93
|
+
*/
|
|
94
|
+
duplicateSuggestions: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* Default combined result limit for duplicate suggestions when the caller
|
|
97
|
+
* does not provide `limit`.
|
|
98
|
+
*
|
|
99
|
+
* Exact matches consume this limit before similar matches.
|
|
100
|
+
*
|
|
101
|
+
* @default 5
|
|
102
|
+
*/
|
|
103
|
+
duplicateSuggestionLimit: number;
|
|
104
|
+
/**
|
|
105
|
+
* Default result limit for normal full-text entry search.
|
|
106
|
+
*
|
|
107
|
+
* @default 20
|
|
108
|
+
*/
|
|
109
|
+
defaultLimit: number;
|
|
110
|
+
/**
|
|
111
|
+
* Maximum allowed result limit for search and duplicate queries.
|
|
112
|
+
*
|
|
113
|
+
* Larger requested limits are clamped to this value.
|
|
114
|
+
*
|
|
115
|
+
* @default 50
|
|
116
|
+
*/
|
|
117
|
+
maxLimit: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Maximum lengths accepted for user-generated content.
|
|
121
|
+
*/
|
|
122
|
+
export interface FeedbackContentLimits {
|
|
123
|
+
/**
|
|
124
|
+
* Maximum entry-title length.
|
|
125
|
+
*
|
|
126
|
+
* @default 160
|
|
127
|
+
*/
|
|
128
|
+
titleLength: number;
|
|
129
|
+
/**
|
|
130
|
+
* Maximum entry-body length.
|
|
131
|
+
*
|
|
132
|
+
* @default 10000
|
|
133
|
+
*/
|
|
134
|
+
bodyLength: number;
|
|
135
|
+
/**
|
|
136
|
+
* Maximum comment/reply length.
|
|
137
|
+
*
|
|
138
|
+
* @default 5000
|
|
139
|
+
*/
|
|
140
|
+
commentLength: number;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Complete server-side configuration for a feedback component instance.
|
|
144
|
+
*
|
|
145
|
+
* Configuration is supplied by the host application and is not persisted in
|
|
146
|
+
* an additional component table.
|
|
147
|
+
*/
|
|
2
148
|
export interface FeedbackConfig {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
maxDepth: number;
|
|
12
|
-
maxPageSize: number;
|
|
13
|
-
defaultSort: CommentSort;
|
|
14
|
-
editableByAuthor: boolean;
|
|
15
|
-
deletableByAuthor: boolean;
|
|
16
|
-
};
|
|
17
|
-
search: {
|
|
18
|
-
duplicateSuggestions: boolean;
|
|
19
|
-
duplicateSuggestionLimit: number;
|
|
20
|
-
defaultLimit: number;
|
|
21
|
-
maxLimit: number;
|
|
22
|
-
};
|
|
23
|
-
limits: {
|
|
24
|
-
titleLength: number;
|
|
25
|
-
bodyLength: number;
|
|
26
|
-
commentLength: number;
|
|
27
|
-
};
|
|
149
|
+
/** Entry creation, ordering, pagination, and editing rules. */
|
|
150
|
+
entries: FeedbackEntriesConfig;
|
|
151
|
+
/** Comment nesting, ordering, pagination, and editing rules. */
|
|
152
|
+
comments: FeedbackCommentsConfig;
|
|
153
|
+
/** Search and duplicate-detection behavior. */
|
|
154
|
+
search: FeedbackSearchConfig;
|
|
155
|
+
/** User-generated content limits. */
|
|
156
|
+
limits: FeedbackContentLimits;
|
|
28
157
|
}
|
|
158
|
+
/**
|
|
159
|
+
* Partial configuration accepted by `createFeedbackConfig` and
|
|
160
|
+
* `exposeFeedbackApi`.
|
|
161
|
+
*
|
|
162
|
+
* Missing values fall back to `defaultFeedbackConfig`.
|
|
163
|
+
*/
|
|
29
164
|
export interface FeedbackConfigOverrides {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
165
|
+
/** Overrides for entry configuration. */
|
|
166
|
+
entries?: Partial<FeedbackEntriesConfig>;
|
|
167
|
+
/** Overrides for comment configuration. */
|
|
168
|
+
comments?: Partial<FeedbackCommentsConfig>;
|
|
169
|
+
/** Overrides for search configuration. */
|
|
170
|
+
search?: Partial<FeedbackSearchConfig>;
|
|
171
|
+
/** Overrides for content limits. */
|
|
172
|
+
limits?: Partial<FeedbackContentLimits>;
|
|
34
173
|
}
|
|
35
174
|
export declare const defaultFeedbackConfig: FeedbackConfig;
|
|
36
175
|
export declare function createFeedbackConfig(overrides?: FeedbackConfigOverrides): FeedbackConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/client/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAE/B,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/client/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EACZ,MAAM,uBAAuB,CAAC;AAE/B;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,YAAY,EAAE,SAAS,SAAS,EAAE,CAAC;IAEnC;;;;OAIG;IACH,aAAa,EAAE,WAAW,CAAC;IAE3B;;;;OAIG;IACH,WAAW,EAAE,SAAS,CAAC;IAEvB;;;;;;OAMG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;;;OAMG;IACH,gBAAgB,EAAE,OAAO,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG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,eAAO,MAAM,qBAAqB,EAAE,cA0BnC,CAAC;AAEF,wBAAgB,oBAAoB,CAClC,SAAS,GAAE,uBAA4B,GACtC,cAAc,CAOhB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/client/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/client/config.ts"],"names":[],"mappings":"AA4MA,MAAM,CAAC,MAAM,qBAAqB,GAAmB;IACnD,OAAO,EAAE;QACP,YAAY,EAAE,CAAC,UAAU,EAAE,iBAAiB,EAAE,YAAY,CAAC;QAC3D,aAAa,EAAE,MAAM;QACrB,WAAW,EAAE,KAAK;QAClB,WAAW,EAAE,EAAE;QACf,gBAAgB,EAAE,IAAI;KACvB;IACD,QAAQ,EAAE;QACR,QAAQ,EAAE,CAAC;QACX,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,KAAK;QAClB,gBAAgB,EAAE,IAAI;QACtB,iBAAiB,EAAE,IAAI;KACxB;IACD,MAAM,EAAE;QACN,oBAAoB,EAAE,IAAI;QAC1B,wBAAwB,EAAE,CAAC;QAC3B,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,EAAE;KACb;IACD,MAAM,EAAE;QACN,WAAW,EAAE,GAAG;QAChB,UAAU,EAAE,MAAM;QAClB,aAAa,EAAE,KAAK;KACrB;CACF,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAClC,YAAqC,EAAE;IAEvC,OAAO;QACL,OAAO,EAAE,EAAE,GAAG,qBAAqB,CAAC,OAAO,EAAE,GAAG,SAAS,CAAC,OAAO,EAAE;QACnE,QAAQ,EAAE,EAAE,GAAG,qBAAqB,CAAC,QAAQ,EAAE,GAAG,SAAS,CAAC,QAAQ,EAAE;QACtE,MAAM,EAAE,EAAE,GAAG,qBAAqB,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE;QAChE,MAAM,EAAE,EAAE,GAAG,qBAAqB,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,MAAM,EAAE;KACjE,CAAC;AACJ,CAAC"}
|