convex-feedback 0.1.1 → 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 +71 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/client/api.d.ts +21 -17
- package/dist/client/api.d.ts.map +1 -1
- package/dist/client/index.d.ts +146 -174
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +71 -10
- package/dist/client/index.js.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 +29 -29
- package/dist/component/entries.d.ts.map +1 -1
- package/dist/component/entries.js +18 -25
- package/dist/component/entries.js.map +1 -1
- package/dist/react/index.d.ts +16 -10
- package/dist/react/index.d.ts.map +1 -1
- package/dist/react/index.js +3 -0
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/src/client/api.ts +21 -16
- package/src/client/index.ts +407 -14
- package/src/component/comments.ts +43 -61
- package/src/component/entries.ts +18 -22
- package/src/react/index.ts +11 -3
package/dist/react/index.d.ts
CHANGED
|
@@ -142,8 +142,11 @@ export interface SimilarEntriesArgs {
|
|
|
142
142
|
*
|
|
143
143
|
* Create this once in the consuming application and reuse the returned hook
|
|
144
144
|
* collection.
|
|
145
|
+
*
|
|
146
|
+
* @typeParam RateLimitResult The validated non-throwing rate-limit rejection
|
|
147
|
+
* type returned by mutation hooks. It is inferred from the supplied API.
|
|
145
148
|
*/
|
|
146
|
-
export declare function createFeedbackHooks(api: FeedbackPublicApi, options?: FeedbackHooksOptions): {
|
|
149
|
+
export declare function createFeedbackHooks<RateLimitResult = never>(api: FeedbackPublicApi<string | undefined, RateLimitResult>, options?: FeedbackHooksOptions): {
|
|
147
150
|
/**
|
|
148
151
|
* Resolved client-side page sizes used by the generated hooks and useful
|
|
149
152
|
* when calling their `loadMore` functions.
|
|
@@ -259,27 +262,30 @@ export declare function createFeedbackHooks(api: FeedbackPublicApi, options?: Fe
|
|
|
259
262
|
viewerHasLiked: boolean;
|
|
260
263
|
}>, string | undefined>>;
|
|
261
264
|
/** Returns the bound create-entry mutation. */
|
|
262
|
-
useCreateEntry(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").CreateEntryArgs, string, string | undefined>>;
|
|
265
|
+
useCreateEntry(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").CreateEntryArgs, string | RateLimitResult, string | undefined>>;
|
|
263
266
|
/** Returns the bound update-entry mutation. */
|
|
264
|
-
useUpdateEntry(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").UpdateEntryArgs, null, string | undefined>>;
|
|
267
|
+
useUpdateEntry(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").UpdateEntryArgs, RateLimitResult | null, string | undefined>>;
|
|
265
268
|
/** Returns the bound status mutation. */
|
|
266
|
-
useSetEntryStatus(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetEntryStatusArgs, null, string | undefined>>;
|
|
269
|
+
useSetEntryStatus(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetEntryStatusArgs, RateLimitResult | null, string | undefined>>;
|
|
267
270
|
/** Returns the idempotent entry-upvote state mutation. */
|
|
268
|
-
useSetEntryUpvote(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetEntryUpvoteArgs, import("../client/api.js").SetEntryUpvoteResult, string | undefined>>;
|
|
271
|
+
useSetEntryUpvote(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetEntryUpvoteArgs, import("../client/api.js").SetEntryUpvoteResult | RateLimitResult, string | undefined>>;
|
|
269
272
|
/** Returns the create-comment/reply mutation. */
|
|
270
|
-
useCreateComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").CreateCommentArgs, string, string | undefined>>;
|
|
273
|
+
useCreateComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").CreateCommentArgs, string | RateLimitResult, string | undefined>>;
|
|
271
274
|
/** Returns the update-comment mutation. */
|
|
272
|
-
useUpdateComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").UpdateCommentArgs, null, string | undefined>>;
|
|
275
|
+
useUpdateComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").UpdateCommentArgs, RateLimitResult | null, string | undefined>>;
|
|
273
276
|
/** Returns the soft-delete-comment mutation. */
|
|
274
|
-
useDeleteComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").DeleteCommentArgs, null, string | undefined>>;
|
|
277
|
+
useDeleteComment(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").DeleteCommentArgs, RateLimitResult | null, string | undefined>>;
|
|
275
278
|
/** Returns the idempotent comment-like state mutation. */
|
|
276
|
-
useSetCommentLike(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetCommentLikeArgs, import("../client/api.js").SetCommentLikeResult, string | undefined>>;
|
|
279
|
+
useSetCommentLike(): import("convex/react").ReactMutation<import("convex/server").FunctionReference<"mutation", "public", import("../client/api.js").SetCommentLikeArgs, import("../client/api.js").SetCommentLikeResult | RateLimitResult, string | undefined>>;
|
|
277
280
|
};
|
|
278
281
|
/**
|
|
279
282
|
* Hook collection returned by `createFeedbackHooks`.
|
|
280
283
|
*
|
|
281
284
|
* This type is intended to be passed to `FeedbackScreen` and other
|
|
282
285
|
* `convex-feedback-ui` integrations.
|
|
286
|
+
*
|
|
287
|
+
* @typeParam RateLimitResult The validated non-throwing rate-limit rejection
|
|
288
|
+
* type returned by mutation hooks.
|
|
283
289
|
*/
|
|
284
|
-
export type FeedbackHooks = ReturnType<typeof createFeedbackHooks
|
|
290
|
+
export type FeedbackHooks<RateLimitResult = never> = ReturnType<typeof createFeedbackHooks<RateLimitResult>>;
|
|
285
291
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,KAAK,EACV,WAAW,EACX,SAAS,EACT,SAAS,EACT,WAAW,EAEZ,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;OAKG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B;;;;;;;OAOG;IACH,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAE7B,uCAAuC;IACvC,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,IAAI,CAAC,EAAE,SAAS,CAAC;CAClB;AAED;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;;;;;OASG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,IAAI,CAAC,EAAE,WAAW,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IAE7B,uCAAuC;IACvC,MAAM,CAAC,EAAE,WAAW,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* Create this once in the consuming application and reuse the returned hook
|
|
17
17
|
* collection.
|
|
18
|
+
*
|
|
19
|
+
* @typeParam RateLimitResult The validated non-throwing rate-limit rejection
|
|
20
|
+
* type returned by mutation hooks. It is inferred from the supplied API.
|
|
18
21
|
*/
|
|
19
22
|
export function createFeedbackHooks(api, options = {}) {
|
|
20
23
|
const entryPageSize = positivePageSize(options.entryPageSize, 20);
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAqKrD,MAAM,yBAAyB,GAAyB;IACtD,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,SAAS,gBAAgB,CAAC,KAAyB,EAAE,QAAgB;IACnE,OAAO,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC;QAChE,CAAC,CAAC,KAAK;QACP,CAAC,CAAC,QAAQ,CAAC;AACf,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/react/index.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAqKrD,MAAM,yBAAyB,GAAyB;IACtD,KAAK,EAAE,EAAE;IACT,OAAO,EAAE,EAAE;CACZ,CAAC;AAEF,SAAS,gBAAgB,CAAC,KAAyB,EAAE,QAAgB;IACnE,OAAO,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAA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AAC;QACxC,CAAC;QAED,2CAA2C;QAC3C,gBAAgB;YACd,OAAO,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;QAED,gDAAgD;QAChD,gBAAgB;YACd,OAAO,WAAW,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QACxC,CAAC;QAED,0DAA0D;QAC1D,iBAAiB;YACf,OAAO,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACzC,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
package/src/client/api.ts
CHANGED
|
@@ -288,9 +288,14 @@ export type SetCommentLikeResult = {
|
|
|
288
288
|
*
|
|
289
289
|
* The host application exposes these wrappers from its own Convex deployment
|
|
290
290
|
* after resolving authentication and configuration.
|
|
291
|
+
*
|
|
292
|
+
* @typeParam RateLimitResult A validated rejection value returned by mutations
|
|
293
|
+
* when non-throwing rate limiting is configured. The default `never` preserves
|
|
294
|
+
* the original success-only mutation results.
|
|
291
295
|
*/
|
|
292
296
|
export interface FeedbackPublicApi<
|
|
293
297
|
Name extends string | undefined = string | undefined,
|
|
298
|
+
RateLimitResult = never,
|
|
294
299
|
> {
|
|
295
300
|
/** Returns a cursor-paginated entry list. */
|
|
296
301
|
listEntries: FunctionReference<
|
|
@@ -328,39 +333,39 @@ export interface FeedbackPublicApi<
|
|
|
328
333
|
Name
|
|
329
334
|
>;
|
|
330
335
|
|
|
331
|
-
/** Creates an entry
|
|
336
|
+
/** Creates an entry, returning its identifier or a rate-limit rejection. */
|
|
332
337
|
createEntry: FunctionReference<
|
|
333
338
|
"mutation",
|
|
334
339
|
"public",
|
|
335
340
|
CreateEntryArgs,
|
|
336
|
-
string,
|
|
341
|
+
string | RateLimitResult,
|
|
337
342
|
Name
|
|
338
343
|
>;
|
|
339
344
|
|
|
340
|
-
/** Replaces
|
|
345
|
+
/** Replaces entry content, or returns a configured rate-limit rejection. */
|
|
341
346
|
updateEntry: FunctionReference<
|
|
342
347
|
"mutation",
|
|
343
348
|
"public",
|
|
344
349
|
UpdateEntryArgs,
|
|
345
|
-
null,
|
|
350
|
+
null | RateLimitResult,
|
|
346
351
|
Name
|
|
347
352
|
>;
|
|
348
353
|
|
|
349
|
-
/** Changes
|
|
354
|
+
/** Changes entry status, or returns a configured rate-limit rejection. */
|
|
350
355
|
setEntryStatus: FunctionReference<
|
|
351
356
|
"mutation",
|
|
352
357
|
"public",
|
|
353
358
|
SetEntryStatusArgs,
|
|
354
|
-
null,
|
|
359
|
+
null | RateLimitResult,
|
|
355
360
|
Name
|
|
356
361
|
>;
|
|
357
362
|
|
|
358
|
-
/** Sets
|
|
363
|
+
/** Sets entry-upvote state, or returns a configured rate-limit rejection. */
|
|
359
364
|
setEntryUpvote: FunctionReference<
|
|
360
365
|
"mutation",
|
|
361
366
|
"public",
|
|
362
367
|
SetEntryUpvoteArgs,
|
|
363
|
-
SetEntryUpvoteResult,
|
|
368
|
+
SetEntryUpvoteResult | RateLimitResult,
|
|
364
369
|
Name
|
|
365
370
|
>;
|
|
366
371
|
|
|
@@ -373,39 +378,39 @@ export interface FeedbackPublicApi<
|
|
|
373
378
|
Name
|
|
374
379
|
>;
|
|
375
380
|
|
|
376
|
-
/** Creates a comment
|
|
381
|
+
/** Creates a comment/reply, returning its ID or a rate-limit rejection. */
|
|
377
382
|
createComment: FunctionReference<
|
|
378
383
|
"mutation",
|
|
379
384
|
"public",
|
|
380
385
|
CreateCommentArgs,
|
|
381
|
-
string,
|
|
386
|
+
string | RateLimitResult,
|
|
382
387
|
Name
|
|
383
388
|
>;
|
|
384
389
|
|
|
385
|
-
/** Replaces a
|
|
390
|
+
/** Replaces comment content, or returns a configured rate-limit rejection. */
|
|
386
391
|
updateComment: FunctionReference<
|
|
387
392
|
"mutation",
|
|
388
393
|
"public",
|
|
389
394
|
UpdateCommentArgs,
|
|
390
|
-
null,
|
|
395
|
+
null | RateLimitResult,
|
|
391
396
|
Name
|
|
392
397
|
>;
|
|
393
398
|
|
|
394
|
-
/** Soft-deletes a comment
|
|
399
|
+
/** Soft-deletes a comment, or returns a configured rate-limit rejection. */
|
|
395
400
|
deleteComment: FunctionReference<
|
|
396
401
|
"mutation",
|
|
397
402
|
"public",
|
|
398
403
|
DeleteCommentArgs,
|
|
399
|
-
null,
|
|
404
|
+
null | RateLimitResult,
|
|
400
405
|
Name
|
|
401
406
|
>;
|
|
402
407
|
|
|
403
|
-
/** Sets
|
|
408
|
+
/** Sets comment-like state, or returns a configured rate-limit rejection. */
|
|
404
409
|
setCommentLike: FunctionReference<
|
|
405
410
|
"mutation",
|
|
406
411
|
"public",
|
|
407
412
|
SetCommentLikeArgs,
|
|
408
|
-
SetCommentLikeResult,
|
|
413
|
+
SetCommentLikeResult | RateLimitResult,
|
|
409
414
|
Name
|
|
410
415
|
>;
|
|
411
416
|
}
|