featurebase-node 0.11.0 → 0.13.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.
- package/CHANGELOG.md +31 -0
- package/internal/utils/log.d.mts.map +1 -1
- package/internal/utils/log.d.ts.map +1 -1
- package/internal/utils/log.js +2 -0
- package/internal/utils/log.js.map +1 -1
- package/internal/utils/log.mjs +2 -0
- package/internal/utils/log.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/feedback/comments.d.mts +340 -1
- package/resources/feedback/comments.d.mts.map +1 -1
- package/resources/feedback/comments.d.ts +340 -1
- package/resources/feedback/comments.d.ts.map +1 -1
- package/resources/feedback/comments.js +160 -0
- package/resources/feedback/comments.js.map +1 -1
- package/resources/feedback/comments.mjs +160 -0
- package/resources/feedback/comments.mjs.map +1 -1
- package/resources/feedback/feedback.d.mts +4 -4
- package/resources/feedback/feedback.d.mts.map +1 -1
- package/resources/feedback/feedback.d.ts +4 -4
- package/resources/feedback/feedback.d.ts.map +1 -1
- package/resources/feedback/feedback.js.map +1 -1
- package/resources/feedback/feedback.mjs.map +1 -1
- package/resources/feedback/index.d.mts +2 -2
- package/resources/feedback/index.d.mts.map +1 -1
- package/resources/feedback/index.d.ts +2 -2
- package/resources/feedback/index.d.ts.map +1 -1
- package/resources/feedback/index.js.map +1 -1
- package/resources/feedback/index.mjs.map +1 -1
- package/resources/feedback/posts/index.d.mts +1 -1
- package/resources/feedback/posts/index.d.mts.map +1 -1
- package/resources/feedback/posts/index.d.ts +1 -1
- package/resources/feedback/posts/index.d.ts.map +1 -1
- package/resources/feedback/posts/index.js.map +1 -1
- package/resources/feedback/posts/index.mjs.map +1 -1
- package/resources/feedback/posts/posts.d.mts +547 -1
- package/resources/feedback/posts/posts.d.mts.map +1 -1
- package/resources/feedback/posts/posts.d.ts +547 -1
- package/resources/feedback/posts/posts.d.ts.map +1 -1
- package/resources/feedback/posts/posts.js +181 -0
- package/resources/feedback/posts/posts.js.map +1 -1
- package/resources/feedback/posts/posts.mjs +181 -0
- package/resources/feedback/posts/posts.mjs.map +1 -1
- package/resources/help-center/articles.d.mts +407 -1
- package/resources/help-center/articles.d.mts.map +1 -1
- package/resources/help-center/articles.d.ts +407 -1
- package/resources/help-center/articles.d.ts.map +1 -1
- package/resources/help-center/articles.js +130 -0
- package/resources/help-center/articles.js.map +1 -1
- package/resources/help-center/articles.mjs +130 -0
- package/resources/help-center/articles.mjs.map +1 -1
- package/resources/help-center/help-center.d.mts +2 -2
- package/resources/help-center/help-center.d.mts.map +1 -1
- package/resources/help-center/help-center.d.ts +2 -2
- package/resources/help-center/help-center.d.ts.map +1 -1
- package/resources/help-center/help-center.js.map +1 -1
- package/resources/help-center/help-center.mjs.map +1 -1
- package/resources/help-center/index.d.mts +1 -1
- package/resources/help-center/index.d.mts.map +1 -1
- package/resources/help-center/index.d.ts +1 -1
- package/resources/help-center/index.d.ts.map +1 -1
- package/resources/help-center/index.js.map +1 -1
- package/resources/help-center/index.mjs.map +1 -1
- package/resources/support/conversations/conversations.d.mts +27 -19
- package/resources/support/conversations/conversations.d.mts.map +1 -1
- package/resources/support/conversations/conversations.d.ts +27 -19
- package/resources/support/conversations/conversations.d.ts.map +1 -1
- package/resources/support/conversations/conversations.js +20 -14
- package/resources/support/conversations/conversations.js.map +1 -1
- package/resources/support/conversations/conversations.mjs +20 -14
- package/resources/support/conversations/conversations.mjs.map +1 -1
- package/resources/users/companies/companies.d.mts +33 -20
- package/resources/users/companies/companies.d.mts.map +1 -1
- package/resources/users/companies/companies.d.ts +33 -20
- package/resources/users/companies/companies.d.ts.map +1 -1
- package/resources/users/companies/companies.js +28 -17
- package/resources/users/companies/companies.js.map +1 -1
- package/resources/users/companies/companies.mjs +28 -17
- package/resources/users/companies/companies.mjs.map +1 -1
- package/resources/users/contacts/contacts.d.mts +33 -21
- package/resources/users/contacts/contacts.d.mts.map +1 -1
- package/resources/users/contacts/contacts.d.ts +33 -21
- package/resources/users/contacts/contacts.d.ts.map +1 -1
- package/resources/users/contacts/contacts.js +27 -17
- package/resources/users/contacts/contacts.js.map +1 -1
- package/resources/users/contacts/contacts.mjs +27 -17
- package/resources/users/contacts/contacts.mjs.map +1 -1
- package/src/internal/utils/log.ts +2 -0
- package/src/resources/feedback/comments.ts +396 -0
- package/src/resources/feedback/feedback.ts +8 -0
- package/src/resources/feedback/index.ts +4 -0
- package/src/resources/feedback/posts/index.ts +2 -0
- package/src/resources/feedback/posts/posts.ts +671 -0
- package/src/resources/help-center/articles.ts +686 -0
- package/src/resources/help-center/help-center.ts +4 -0
- package/src/resources/help-center/index.ts +2 -0
- package/src/resources/support/conversations/conversations.ts +27 -19
- package/src/resources/users/companies/companies.ts +38 -19
- package/src/resources/users/contacts/contacts.ts +40 -20
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contacts.mjs","sourceRoot":"","sources":["../../../src/resources/users/contacts/contacts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK,mBAAmB;OACxB,EAGL,gBAAgB,GAIjB;OACM,KAAK,WAAW;OAChB,EACL,QAAQ,GAIT;OAEM,EAAE,UAAU,EAAsC;OAClD,EAAE,YAAY,EAAE;OAEhB,EAAE,IAAI,EAAE;AAEf;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IAAzC;;QACE,aAAQ,GAAyB,IAAI,WAAW,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxE,qBAAgB,GAAyC,IAAI,mBAAmB,CAAC,gBAAgB,CAC/F,IAAI,CAAC,OAAO,CACb,CAAC;
|
|
1
|
+
{"version":3,"file":"contacts.mjs","sourceRoot":"","sources":["../../../src/resources/users/contacts/contacts.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,KAAK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YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,kBAAkB,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC;wBAC1C,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE;wBAC3D,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkDG;IACH,OAAO,CACL,EAAU,EACV,SAAkD,EAAE,EACpD,OAAwB;QAExB,MAAM,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,GAAG,MAAM,IAAI,EAAE,CAAC;QACnE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAA,gBAAgB,EAAE,UAAU,EAAE;YACzD,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC;gBACpB;oBACE,GAAG,CAAC,kBAAkB,EAAE,QAAQ,EAAE,IAAI,IAAI,CAAC,CAAC;wBAC1C,EAAE,qBAAqB,EAAE,kBAAkB,EAAE,QAAQ,EAAE,EAAE;wBAC3D,CAAC,CAAC,SAAS,CAAC;iBACb;gBACD,OAAO,EAAE,OAAO;aACjB,CAAC;SACH,CAAC,CAAC;IACL,CAAC;CACF;AAsmBD,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC7B,QAAQ,CAAC,gBAAgB,GAAG,gBAAgB,CAAC"}
|
|
@@ -107,6 +107,8 @@ export const formatRequestDetails = (details: {
|
|
|
107
107
|
name,
|
|
108
108
|
(
|
|
109
109
|
name.toLowerCase() === 'authorization' ||
|
|
110
|
+
name.toLowerCase() === 'api-key' ||
|
|
111
|
+
name.toLowerCase() === 'x-api-key' ||
|
|
110
112
|
name.toLowerCase() === 'cookie' ||
|
|
111
113
|
name.toLowerCase() === 'set-cookie'
|
|
112
114
|
) ?
|
|
@@ -438,6 +438,167 @@ export class Comments extends APIResource {
|
|
|
438
438
|
]),
|
|
439
439
|
});
|
|
440
440
|
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Search comments with a structured filter AST, full-text search, sorting, and
|
|
444
|
+
* cursor pagination.
|
|
445
|
+
*
|
|
446
|
+
* ### Two modes (combinable)
|
|
447
|
+
*
|
|
448
|
+
* - **Filter mode** — pass a structured `query` AST (and/or `sort`) and the
|
|
449
|
+
* endpoint returns comments matching the filter, ordered by `sort` (default
|
|
450
|
+
* `createdAt:desc`). Same shape as `/v2/posts/search`,
|
|
451
|
+
* `/v2/conversations/search`, `/v2/companies/search`, `/v2/contacts/search`.
|
|
452
|
+
* - **Search mode** — pass a top-level `search` string and the endpoint runs a
|
|
453
|
+
* hybrid full-text + vector search over comment `content`, returning matches
|
|
454
|
+
* ranked by relevance. Optional: combine with `query` to constrain the search to
|
|
455
|
+
* a post / changelog / author / time window, and/or `sort` to override relevance
|
|
456
|
+
* ranking with chronological order.
|
|
457
|
+
*
|
|
458
|
+
* ```json
|
|
459
|
+
* {
|
|
460
|
+
* "search": "dark mode feedback",
|
|
461
|
+
* "query": {
|
|
462
|
+
* "operator": "AND",
|
|
463
|
+
* "value": [
|
|
464
|
+
* {
|
|
465
|
+
* "field": "postId",
|
|
466
|
+
* "operator": "=",
|
|
467
|
+
* "value": "507f1f77bcf86cd799439011"
|
|
468
|
+
* }
|
|
469
|
+
* ]
|
|
470
|
+
* },
|
|
471
|
+
* "limit": 20
|
|
472
|
+
* }
|
|
473
|
+
* ```
|
|
474
|
+
*
|
|
475
|
+
* `search` is server-managed: no operators, no field selection, no special syntax
|
|
476
|
+
* — same plain-text contract as `/v2/posts/search`. The string must be 1–500
|
|
477
|
+
* characters.
|
|
478
|
+
*
|
|
479
|
+
* ### Structured query AST
|
|
480
|
+
*
|
|
481
|
+
* Each clause has the shape `{ field, operator, value }`. You can pass a single
|
|
482
|
+
* clause or wrap up to 15 in a top-level `AND` group. To list every comment a
|
|
483
|
+
* contact has authored:
|
|
484
|
+
*
|
|
485
|
+
* ```json
|
|
486
|
+
* {
|
|
487
|
+
* "query": {
|
|
488
|
+
* "field": "authorId",
|
|
489
|
+
* "operator": "=",
|
|
490
|
+
* "value": "507f1f77bcf86cd799439011"
|
|
491
|
+
* },
|
|
492
|
+
* "sort": "createdAt:desc",
|
|
493
|
+
* "limit": 100
|
|
494
|
+
* }
|
|
495
|
+
* ```
|
|
496
|
+
*
|
|
497
|
+
* Top-level `OR` groups and nested groups are not supported in this version.
|
|
498
|
+
*
|
|
499
|
+
* ### Supported fields and operators
|
|
500
|
+
*
|
|
501
|
+
* Field names are camelCase, matching the rest of the v2 public API. The other v2
|
|
502
|
+
* search endpoints (posts, contacts, companies, conversations) shipped earlier
|
|
503
|
+
* with snake_case field names and continue to accept those for back-compat;
|
|
504
|
+
* comments search is greenfield and ships with camelCase only.
|
|
505
|
+
*
|
|
506
|
+
* | Field | Type | Operators |
|
|
507
|
+
* | ------------------------------------- | ----------------------- | --------------------------------------------------------------------------- |
|
|
508
|
+
* | `authorId` | string (user id) | `=`, `!=`, `IN`, `NIN` |
|
|
509
|
+
* | `postId` | id or null (submission) | `=`, `!=`, `IN`, `NIN` (use `null` for changelog-only comments) |
|
|
510
|
+
* | `changelogId` | id or null | `=`, `!=`, `IN`, `NIN` (use `null` for post-only comments) |
|
|
511
|
+
* | `parentCommentId` | id or null | `=`, `!=`, `IN`, `NIN` (use `null` for root comments, non-null for replies) |
|
|
512
|
+
* | `isPrivate` | boolean | `=`, `!=` |
|
|
513
|
+
* | `inReview` | boolean | `=`, `!=` |
|
|
514
|
+
* | `createdAt` | unix seconds | `=`, `!=`, `>`, `<`, `>=`, `<=` |
|
|
515
|
+
* | `upvotes`, `score`, `confidenceScore` | number | `=`, `!=`, `>`, `<`, `>=`, `<=` |
|
|
516
|
+
*
|
|
517
|
+
* Use the top-level `search` field for full-text search across comment `content`
|
|
518
|
+
* (see "Search mode" above). The clause-level operators `~`, `!~`, `^`, `$` are
|
|
519
|
+
* reserved for future use and currently return `400`.
|
|
520
|
+
*
|
|
521
|
+
* A filter-mode query (no `search`) consisting only of `!=` or `NIN` clauses on
|
|
522
|
+
* unbounded fields is rejected with `query_too_broad` to prevent full-org scans.
|
|
523
|
+
* Combine the negation with at least one positive clause (`=`, `IN`, `>`, `<`)
|
|
524
|
+
* instead. Boolean fields (`isPrivate`, `inReview`) are bounded so a standalone
|
|
525
|
+
* negation on them is allowed. Search mode (with `search` set) relaxes this — the
|
|
526
|
+
* FTS query itself acts as the positive constraint.
|
|
527
|
+
*
|
|
528
|
+
* ### Sort
|
|
529
|
+
*
|
|
530
|
+
* Allowed values:
|
|
531
|
+
*
|
|
532
|
+
* - `createdAt:desc` (default in filter mode), `createdAt:asc` — newest / oldest
|
|
533
|
+
* first
|
|
534
|
+
* - `confidenceScore:desc` (the dashboard's "Best" view), `confidenceScore:asc`
|
|
535
|
+
* (low-confidence first, useful for moderation)
|
|
536
|
+
* - `score:desc` — raw upvotes − downvotes ("Top")
|
|
537
|
+
*
|
|
538
|
+
* Numeric counters (`upvotes`, `score`, `confidenceScore`) remain available as
|
|
539
|
+
* filter fields with the full range of operators; only the sort axes above are
|
|
540
|
+
* surfaced to keep the cursor-pagination contract small. `score:asc` and `upvotes`
|
|
541
|
+
* (both directions) are deliberately not exposed: `upvotes:desc` is identical to
|
|
542
|
+
* `score:desc` for the vast majority of comments (no downvotes), and
|
|
543
|
+
* "most-downvoted-first" / "least-upvoted-first" have no product use case.
|
|
544
|
+
*
|
|
545
|
+
* When `search` is set, results are ranked by relevance unless `sort` is also set,
|
|
546
|
+
* in which case the matching comments are returned in the requested order. The
|
|
547
|
+
* chosen sort axis (or relevance) is encoded in the cursor; switching `sort` (or
|
|
548
|
+
* toggling `search` on/off) mid-pagination returns `400 invalid_cursor`. Restart
|
|
549
|
+
* pagination without a cursor when changing the sort or search shape.
|
|
550
|
+
*
|
|
551
|
+
* ### Pagination
|
|
552
|
+
*
|
|
553
|
+
* Cursor-based, `limit` between 1 and 100 (default 10). In filter mode,
|
|
554
|
+
* `totalCount` is approximate and capped at 5000; `totalCountCapped` is `true`
|
|
555
|
+
* when the real count may be higher. In search mode, `totalCount` reflects the
|
|
556
|
+
* matching survivor set after the AST filter and is capped at 200 (the Turbopuffer
|
|
557
|
+
* top-K).
|
|
558
|
+
*
|
|
559
|
+
* ### Server-side guards
|
|
560
|
+
*
|
|
561
|
+
* These visibility rules are always applied and CANNOT be widened via the AST:
|
|
562
|
+
*
|
|
563
|
+
* - Callers without the `view_comments_private` permission can only see public
|
|
564
|
+
* comments. Sending `{ field: "isPrivate", operator: "=", value: true }` as such
|
|
565
|
+
* a caller returns an empty result, NOT a 403 — the security floor wins.
|
|
566
|
+
* - Callers without the `moderate_comments` permission can only see in-review
|
|
567
|
+
* comments they authored themselves. `inReview` queries from such callers are
|
|
568
|
+
* intersected with the authored-by-self constraint.
|
|
569
|
+
* - Spam comments (`isSpam: true`) are NOT excluded — this matches the legacy
|
|
570
|
+
* `GET /v2/comments` behavior. If you want to exclude spam, filter on the
|
|
571
|
+
* `isSpam` field (NOT exposed today; track follow-up).
|
|
572
|
+
*
|
|
573
|
+
* ### Response
|
|
574
|
+
*
|
|
575
|
+
* Returns a standard list envelope with comment rows identical to
|
|
576
|
+
* `GET /v2/comments/{id}`.
|
|
577
|
+
*
|
|
578
|
+
* ### Version Availability
|
|
579
|
+
*
|
|
580
|
+
* This endpoint is only available in API version 2026-01-01.nova and newer.
|
|
581
|
+
*
|
|
582
|
+
* @example
|
|
583
|
+
* ```ts
|
|
584
|
+
* const response = await client.feedback.comments.search();
|
|
585
|
+
* ```
|
|
586
|
+
*/
|
|
587
|
+
search(params: CommentSearchParams, options?: RequestOptions): APIPromise<CommentSearchResponse> {
|
|
588
|
+
const { 'Featurebase-Version': featurebaseVersion, ...body } = params;
|
|
589
|
+
return this._client.post('/v2/comments/search', {
|
|
590
|
+
body,
|
|
591
|
+
...options,
|
|
592
|
+
headers: buildHeaders([
|
|
593
|
+
{
|
|
594
|
+
...(featurebaseVersion?.toString() != null ?
|
|
595
|
+
{ 'Featurebase-Version': featurebaseVersion?.toString() }
|
|
596
|
+
: undefined),
|
|
597
|
+
},
|
|
598
|
+
options?.headers,
|
|
599
|
+
]),
|
|
600
|
+
});
|
|
601
|
+
}
|
|
441
602
|
}
|
|
442
603
|
|
|
443
604
|
export type CommentsCursorPage = CursorPage<Comment>;
|
|
@@ -571,6 +732,146 @@ export interface CommentDelete1Response {
|
|
|
571
732
|
success: boolean;
|
|
572
733
|
}
|
|
573
734
|
|
|
735
|
+
export interface CommentSearchResponse {
|
|
736
|
+
/**
|
|
737
|
+
* Array of search results
|
|
738
|
+
*/
|
|
739
|
+
data: Array<CommentSearchResponse.Data>;
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Cursor for fetching the next page (null if no more results)
|
|
743
|
+
*/
|
|
744
|
+
nextCursor: string | null;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Object type identifier
|
|
748
|
+
*/
|
|
749
|
+
object: 'list';
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Total number of comments matching the query, capped at 5000 in filter mode and
|
|
753
|
+
* 200 (the Turbopuffer top-K) in search mode. When at the cap, `totalCountCapped`
|
|
754
|
+
* is true and the value is exactly the cap.
|
|
755
|
+
*/
|
|
756
|
+
totalCount?: number;
|
|
757
|
+
|
|
758
|
+
/**
|
|
759
|
+
* True when `totalCount` is exactly the cap and the real count may be higher. UI
|
|
760
|
+
* can render as e.g. "5000+".
|
|
761
|
+
*/
|
|
762
|
+
totalCountCapped?: boolean;
|
|
763
|
+
}
|
|
764
|
+
|
|
765
|
+
export namespace CommentSearchResponse {
|
|
766
|
+
export interface Data {
|
|
767
|
+
/**
|
|
768
|
+
* Unique identifier
|
|
769
|
+
*/
|
|
770
|
+
id: string;
|
|
771
|
+
|
|
772
|
+
author: Data.Author | null;
|
|
773
|
+
|
|
774
|
+
/**
|
|
775
|
+
* Changelog ID this comment belongs to
|
|
776
|
+
*/
|
|
777
|
+
changelogId: string | null;
|
|
778
|
+
|
|
779
|
+
/**
|
|
780
|
+
* Comment content in HTML format
|
|
781
|
+
*/
|
|
782
|
+
content: string;
|
|
783
|
+
|
|
784
|
+
/**
|
|
785
|
+
* ISO 8601 timestamp when created
|
|
786
|
+
*/
|
|
787
|
+
createdAt: string;
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Number of downvotes
|
|
791
|
+
*/
|
|
792
|
+
downvotes: number;
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Whether the comment is in review
|
|
796
|
+
*/
|
|
797
|
+
inReview: boolean;
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Whether the comment is deleted
|
|
801
|
+
*/
|
|
802
|
+
isDeleted: boolean;
|
|
803
|
+
|
|
804
|
+
/**
|
|
805
|
+
* Whether the comment is pinned
|
|
806
|
+
*/
|
|
807
|
+
isPinned: boolean;
|
|
808
|
+
|
|
809
|
+
/**
|
|
810
|
+
* Whether the comment is private
|
|
811
|
+
*/
|
|
812
|
+
isPrivate: boolean;
|
|
813
|
+
|
|
814
|
+
/**
|
|
815
|
+
* Whether the comment is spam
|
|
816
|
+
*/
|
|
817
|
+
isSpam: boolean;
|
|
818
|
+
|
|
819
|
+
/**
|
|
820
|
+
* Object type identifier
|
|
821
|
+
*/
|
|
822
|
+
object: 'comment';
|
|
823
|
+
|
|
824
|
+
/**
|
|
825
|
+
* Parent comment ID for replies, null for root comments
|
|
826
|
+
*/
|
|
827
|
+
parentCommentId: string | null;
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Post ID this comment belongs to
|
|
831
|
+
*/
|
|
832
|
+
postId: string | null;
|
|
833
|
+
|
|
834
|
+
/**
|
|
835
|
+
* Net score (upvotes - downvotes)
|
|
836
|
+
*/
|
|
837
|
+
score: number;
|
|
838
|
+
|
|
839
|
+
/**
|
|
840
|
+
* ISO 8601 timestamp when updated
|
|
841
|
+
*/
|
|
842
|
+
updatedAt: string;
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Number of upvotes
|
|
846
|
+
*/
|
|
847
|
+
upvotes: number;
|
|
848
|
+
}
|
|
849
|
+
|
|
850
|
+
export namespace Data {
|
|
851
|
+
export interface Author {
|
|
852
|
+
/**
|
|
853
|
+
* Author unique identifier
|
|
854
|
+
*/
|
|
855
|
+
id: string | null;
|
|
856
|
+
|
|
857
|
+
/**
|
|
858
|
+
* Author display name
|
|
859
|
+
*/
|
|
860
|
+
name: string;
|
|
861
|
+
|
|
862
|
+
/**
|
|
863
|
+
* Author profile picture URL
|
|
864
|
+
*/
|
|
865
|
+
profilePicture: string | null;
|
|
866
|
+
|
|
867
|
+
/**
|
|
868
|
+
* Type of user who authored the comment
|
|
869
|
+
*/
|
|
870
|
+
type: 'admin' | 'customer' | 'guest' | 'integration' | 'bot' | 'lead';
|
|
871
|
+
}
|
|
872
|
+
}
|
|
873
|
+
}
|
|
874
|
+
|
|
574
875
|
export interface CommentCreateParams {
|
|
575
876
|
/**
|
|
576
877
|
* Body param: Comment content in HTML format
|
|
@@ -741,11 +1042,105 @@ export interface CommentDelete1Params {
|
|
|
741
1042
|
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
742
1043
|
}
|
|
743
1044
|
|
|
1045
|
+
export interface CommentSearchParams {
|
|
1046
|
+
/**
|
|
1047
|
+
* Body param: An opaque cursor for pagination. Use the `nextCursor` value from a
|
|
1048
|
+
* previous response to fetch the next page of results.
|
|
1049
|
+
*/
|
|
1050
|
+
cursor?: string;
|
|
1051
|
+
|
|
1052
|
+
/**
|
|
1053
|
+
* Body param: A limit on the number of objects to be returned, between 1 and 100.
|
|
1054
|
+
*/
|
|
1055
|
+
limit?: number;
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Body param: Structured filter AST. Either a single filter clause or one
|
|
1059
|
+
* top-level AND group (max 15 clauses). Top-level OR groups are not yet supported.
|
|
1060
|
+
*/
|
|
1061
|
+
query?: CommentSearchParams.SearchFilter | CommentSearchParams.SearchFilterGroup;
|
|
1062
|
+
|
|
1063
|
+
/**
|
|
1064
|
+
* Body param: Plain-text full-text search across comment `content`. Server-managed
|
|
1065
|
+
* (hybrid BM25 + vector, semanticRatio 0.5) — no operators, no field selection.
|
|
1066
|
+
* When `search` is set, results are ranked by relevance unless `sort` is also set,
|
|
1067
|
+
* in which case the matching comments are returned in the requested order. Combine
|
|
1068
|
+
* with `query` to constrain the search to a post / changelog / author / time
|
|
1069
|
+
* window.
|
|
1070
|
+
*/
|
|
1071
|
+
search?: string;
|
|
1072
|
+
|
|
1073
|
+
/**
|
|
1074
|
+
* Body param: Sort field + direction. Defaults to `createdAt:desc` in filter mode
|
|
1075
|
+
* and to relevance in search mode. The chosen sort axis is encoded in the cursor;
|
|
1076
|
+
* switching `sort` (or toggling `search` on/off) mid-pagination returns
|
|
1077
|
+
* `400 invalid_cursor`.
|
|
1078
|
+
*/
|
|
1079
|
+
sort?: 'createdAt:desc' | 'createdAt:asc' | 'confidenceScore:desc' | 'confidenceScore:asc' | 'score:desc';
|
|
1080
|
+
|
|
1081
|
+
/**
|
|
1082
|
+
* Header param: API version for this request. Defaults to your organization's
|
|
1083
|
+
* configured API version if not specified.
|
|
1084
|
+
*/
|
|
1085
|
+
'Featurebase-Version'?: '2026-01-01.nova' | '2025-12-12.clover';
|
|
1086
|
+
}
|
|
1087
|
+
|
|
1088
|
+
export namespace CommentSearchParams {
|
|
1089
|
+
export interface SearchFilter {
|
|
1090
|
+
/**
|
|
1091
|
+
* Field name to filter on (e.g. `state`, `tag_ids`, `created_at`)
|
|
1092
|
+
*/
|
|
1093
|
+
field: string;
|
|
1094
|
+
|
|
1095
|
+
/**
|
|
1096
|
+
* Comparison operator
|
|
1097
|
+
*/
|
|
1098
|
+
operator: '=' | '!=' | 'IN' | 'NIN' | '>' | '<' | '>=' | '<=' | '~' | '!~' | '^' | '$';
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Value to compare against (primitive or array of primitives)
|
|
1102
|
+
*/
|
|
1103
|
+
value: string | number | boolean | Array<string | number> | null;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
export interface SearchFilterGroup {
|
|
1107
|
+
/**
|
|
1108
|
+
* Group operator: AND (all match) or OR (any match)
|
|
1109
|
+
*/
|
|
1110
|
+
operator: 'AND' | 'OR';
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* Array of filter clauses (1-15 entries)
|
|
1114
|
+
*/
|
|
1115
|
+
value: Array<SearchFilterGroup.Value>;
|
|
1116
|
+
}
|
|
1117
|
+
|
|
1118
|
+
export namespace SearchFilterGroup {
|
|
1119
|
+
export interface Value {
|
|
1120
|
+
/**
|
|
1121
|
+
* Field name to filter on (e.g. `state`, `tag_ids`, `created_at`)
|
|
1122
|
+
*/
|
|
1123
|
+
field: string;
|
|
1124
|
+
|
|
1125
|
+
/**
|
|
1126
|
+
* Comparison operator
|
|
1127
|
+
*/
|
|
1128
|
+
operator: '=' | '!=' | 'IN' | 'NIN' | '>' | '<' | '>=' | '<=' | '~' | '!~' | '^' | '$';
|
|
1129
|
+
|
|
1130
|
+
/**
|
|
1131
|
+
* Value to compare against (primitive or array of primitives)
|
|
1132
|
+
*/
|
|
1133
|
+
value: string | number | boolean | Array<string | number> | null;
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
}
|
|
1137
|
+
|
|
744
1138
|
export declare namespace Comments {
|
|
745
1139
|
export {
|
|
746
1140
|
type Comment as Comment,
|
|
747
1141
|
type CommentDelete0Response as CommentDelete0Response,
|
|
748
1142
|
type CommentDelete1Response as CommentDelete1Response,
|
|
1143
|
+
type CommentSearchResponse as CommentSearchResponse,
|
|
749
1144
|
type CommentsCursorPage as CommentsCursorPage,
|
|
750
1145
|
type CommentCreateParams as CommentCreateParams,
|
|
751
1146
|
type CommentRetrieveParams as CommentRetrieveParams,
|
|
@@ -753,5 +1148,6 @@ export declare namespace Comments {
|
|
|
753
1148
|
type CommentListParams as CommentListParams,
|
|
754
1149
|
type CommentDelete0Params as CommentDelete0Params,
|
|
755
1150
|
type CommentDelete1Params as CommentDelete1Params,
|
|
1151
|
+
type CommentSearchParams as CommentSearchParams,
|
|
756
1152
|
};
|
|
757
1153
|
}
|
|
@@ -13,6 +13,8 @@ import {
|
|
|
13
13
|
CommentDelete1Response,
|
|
14
14
|
CommentListParams,
|
|
15
15
|
CommentRetrieveParams,
|
|
16
|
+
CommentSearchParams,
|
|
17
|
+
CommentSearchResponse,
|
|
16
18
|
CommentUpdateParams,
|
|
17
19
|
Comments,
|
|
18
20
|
CommentsCursorPage,
|
|
@@ -41,6 +43,8 @@ import {
|
|
|
41
43
|
PostDeleteResponse,
|
|
42
44
|
PostListParams,
|
|
43
45
|
PostRetrieveParams,
|
|
46
|
+
PostSearchParams,
|
|
47
|
+
PostSearchResponse,
|
|
44
48
|
PostUpdateParams,
|
|
45
49
|
Posts,
|
|
46
50
|
PostsCursorPage,
|
|
@@ -73,12 +77,14 @@ export declare namespace Feedback {
|
|
|
73
77
|
Posts as Posts,
|
|
74
78
|
type Post as Post,
|
|
75
79
|
type PostDeleteResponse as PostDeleteResponse,
|
|
80
|
+
type PostSearchResponse as PostSearchResponse,
|
|
76
81
|
type PostsCursorPage as PostsCursorPage,
|
|
77
82
|
type PostCreateParams as PostCreateParams,
|
|
78
83
|
type PostRetrieveParams as PostRetrieveParams,
|
|
79
84
|
type PostUpdateParams as PostUpdateParams,
|
|
80
85
|
type PostListParams as PostListParams,
|
|
81
86
|
type PostDeleteParams as PostDeleteParams,
|
|
87
|
+
type PostSearchParams as PostSearchParams,
|
|
82
88
|
};
|
|
83
89
|
|
|
84
90
|
export {
|
|
@@ -94,6 +100,7 @@ export declare namespace Feedback {
|
|
|
94
100
|
type Comment as Comment,
|
|
95
101
|
type CommentDelete0Response as CommentDelete0Response,
|
|
96
102
|
type CommentDelete1Response as CommentDelete1Response,
|
|
103
|
+
type CommentSearchResponse as CommentSearchResponse,
|
|
97
104
|
type CommentsCursorPage as CommentsCursorPage,
|
|
98
105
|
type CommentCreateParams as CommentCreateParams,
|
|
99
106
|
type CommentRetrieveParams as CommentRetrieveParams,
|
|
@@ -101,6 +108,7 @@ export declare namespace Feedback {
|
|
|
101
108
|
type CommentListParams as CommentListParams,
|
|
102
109
|
type CommentDelete0Params as CommentDelete0Params,
|
|
103
110
|
type CommentDelete1Params as CommentDelete1Params,
|
|
111
|
+
type CommentSearchParams as CommentSearchParams,
|
|
104
112
|
};
|
|
105
113
|
|
|
106
114
|
export {
|
|
@@ -12,12 +12,14 @@ export {
|
|
|
12
12
|
type Comment,
|
|
13
13
|
type CommentDelete0Response,
|
|
14
14
|
type CommentDelete1Response,
|
|
15
|
+
type CommentSearchResponse,
|
|
15
16
|
type CommentCreateParams,
|
|
16
17
|
type CommentRetrieveParams,
|
|
17
18
|
type CommentUpdateParams,
|
|
18
19
|
type CommentListParams,
|
|
19
20
|
type CommentDelete0Params,
|
|
20
21
|
type CommentDelete1Params,
|
|
22
|
+
type CommentSearchParams,
|
|
21
23
|
type CommentsCursorPage,
|
|
22
24
|
} from './comments';
|
|
23
25
|
export {
|
|
@@ -39,10 +41,12 @@ export {
|
|
|
39
41
|
Posts,
|
|
40
42
|
type Post,
|
|
41
43
|
type PostDeleteResponse,
|
|
44
|
+
type PostSearchResponse,
|
|
42
45
|
type PostCreateParams,
|
|
43
46
|
type PostRetrieveParams,
|
|
44
47
|
type PostUpdateParams,
|
|
45
48
|
type PostListParams,
|
|
46
49
|
type PostDeleteParams,
|
|
50
|
+
type PostSearchParams,
|
|
47
51
|
type PostsCursorPage,
|
|
48
52
|
} from './posts/index';
|
|
@@ -4,11 +4,13 @@ export {
|
|
|
4
4
|
Posts,
|
|
5
5
|
type Post,
|
|
6
6
|
type PostDeleteResponse,
|
|
7
|
+
type PostSearchResponse,
|
|
7
8
|
type PostCreateParams,
|
|
8
9
|
type PostRetrieveParams,
|
|
9
10
|
type PostUpdateParams,
|
|
10
11
|
type PostListParams,
|
|
11
12
|
type PostDeleteParams,
|
|
13
|
+
type PostSearchParams,
|
|
12
14
|
type PostsCursorPage,
|
|
13
15
|
} from './posts';
|
|
14
16
|
export {
|