featurebase-node 0.3.0 → 0.4.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 +9 -0
- package/README.md +31 -0
- package/client.d.mts +12 -6
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -6
- package/client.d.ts.map +1 -1
- package/client.js +10 -0
- package/client.js.map +1 -1
- package/client.mjs +10 -0
- package/client.mjs.map +1 -1
- package/core/pagination.d.mts +54 -0
- package/core/pagination.d.mts.map +1 -0
- package/core/pagination.d.ts +54 -0
- package/core/pagination.d.ts.map +1 -0
- package/core/pagination.js +101 -0
- package/core/pagination.js.map +1 -0
- package/core/pagination.mjs +95 -0
- package/core/pagination.mjs.map +1 -0
- package/index.d.mts +1 -0
- package/index.d.mts.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/index.mjs +1 -0
- package/index.mjs.map +1 -1
- package/package.json +11 -1
- package/pagination.d.mts +2 -0
- package/pagination.d.mts.map +1 -0
- package/pagination.d.ts +2 -0
- package/pagination.d.ts.map +1 -0
- package/pagination.js +6 -0
- package/pagination.js.map +1 -0
- package/pagination.mjs +2 -0
- package/pagination.mjs.map +1 -0
- package/resources/changelogs/changelogs.d.mts +9 -53
- package/resources/changelogs/changelogs.d.mts.map +1 -1
- package/resources/changelogs/changelogs.d.ts +9 -53
- package/resources/changelogs/changelogs.d.ts.map +1 -1
- package/resources/changelogs/changelogs.js +6 -2
- package/resources/changelogs/changelogs.js.map +1 -1
- package/resources/changelogs/changelogs.mjs +6 -2
- package/resources/changelogs/changelogs.mjs.map +1 -1
- package/resources/changelogs/index.d.mts +1 -1
- package/resources/changelogs/index.d.mts.map +1 -1
- package/resources/changelogs/index.d.ts +1 -1
- package/resources/changelogs/index.d.ts.map +1 -1
- package/resources/feedback/comments.d.mts +9 -53
- package/resources/feedback/comments.d.mts.map +1 -1
- package/resources/feedback/comments.d.ts +9 -53
- package/resources/feedback/comments.d.ts.map +1 -1
- package/resources/feedback/comments.js +6 -2
- package/resources/feedback/comments.js.map +1 -1
- package/resources/feedback/comments.mjs +6 -2
- 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.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/posts/index.d.mts +2 -2
- package/resources/feedback/posts/index.d.mts.map +1 -1
- package/resources/feedback/posts/index.d.ts +2 -2
- 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 +11 -56
- package/resources/feedback/posts/posts.d.mts.map +1 -1
- package/resources/feedback/posts/posts.d.ts +11 -56
- package/resources/feedback/posts/posts.d.ts.map +1 -1
- package/resources/feedback/posts/posts.js +6 -2
- package/resources/feedback/posts/posts.js.map +1 -1
- package/resources/feedback/posts/posts.mjs +6 -2
- package/resources/feedback/posts/posts.mjs.map +1 -1
- package/resources/feedback/posts/voters.d.mts +79 -124
- package/resources/feedback/posts/voters.d.mts.map +1 -1
- package/resources/feedback/posts/voters.d.ts +79 -124
- package/resources/feedback/posts/voters.d.ts.map +1 -1
- package/resources/feedback/posts/voters.js +7 -3
- package/resources/feedback/posts/voters.js.map +1 -1
- package/resources/feedback/posts/voters.mjs +7 -3
- package/resources/feedback/posts/voters.mjs.map +1 -1
- package/resources/help-center/articles.d.mts +9 -27
- package/resources/help-center/articles.d.mts.map +1 -1
- package/resources/help-center/articles.d.ts +9 -27
- package/resources/help-center/articles.d.ts.map +1 -1
- package/resources/help-center/articles.js +6 -2
- package/resources/help-center/articles.js.map +1 -1
- package/resources/help-center/articles.mjs +6 -2
- package/resources/help-center/articles.mjs.map +1 -1
- package/resources/help-center/collections.d.mts +9 -28
- package/resources/help-center/collections.d.mts.map +1 -1
- package/resources/help-center/collections.d.ts +9 -28
- package/resources/help-center/collections.d.ts.map +1 -1
- package/resources/help-center/collections.js +6 -3
- package/resources/help-center/collections.js.map +1 -1
- package/resources/help-center/collections.mjs +6 -3
- package/resources/help-center/collections.mjs.map +1 -1
- package/resources/help-center/help-center.d.mts +8 -8
- package/resources/help-center/help-center.d.mts.map +1 -1
- package/resources/help-center/help-center.d.ts +8 -8
- package/resources/help-center/help-center.d.ts.map +1 -1
- package/resources/help-center/help-center.mjs.map +1 -1
- package/resources/help-center/help-centers.d.mts +9 -28
- package/resources/help-center/help-centers.d.mts.map +1 -1
- package/resources/help-center/help-centers.d.ts +9 -28
- package/resources/help-center/help-centers.d.ts.map +1 -1
- package/resources/help-center/help-centers.js +6 -3
- package/resources/help-center/help-centers.js.map +1 -1
- package/resources/help-center/help-centers.mjs +6 -3
- package/resources/help-center/help-centers.mjs.map +1 -1
- package/resources/help-center/index.d.mts +4 -4
- package/resources/help-center/index.d.mts.map +1 -1
- package/resources/help-center/index.d.ts +4 -4
- package/resources/help-center/index.d.ts.map +1 -1
- package/resources/help-center/redirect-rules.d.mts +9 -28
- package/resources/help-center/redirect-rules.d.mts.map +1 -1
- package/resources/help-center/redirect-rules.d.ts +9 -28
- package/resources/help-center/redirect-rules.d.ts.map +1 -1
- package/resources/help-center/redirect-rules.js +6 -3
- package/resources/help-center/redirect-rules.js.map +1 -1
- package/resources/help-center/redirect-rules.mjs +6 -3
- package/resources/help-center/redirect-rules.mjs.map +1 -1
- package/resources/index.d.mts +3 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +3 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/organization/brands.d.mts +5 -26
- package/resources/organization/brands.d.mts.map +1 -1
- package/resources/organization/brands.d.ts +5 -26
- package/resources/organization/brands.d.ts.map +1 -1
- package/resources/organization/brands.js +2 -1
- package/resources/organization/brands.js.map +1 -1
- package/resources/organization/brands.mjs +2 -1
- package/resources/organization/brands.mjs.map +1 -1
- package/resources/organization/index.d.mts +1 -1
- package/resources/organization/index.d.mts.map +1 -1
- package/resources/organization/index.d.ts +1 -1
- package/resources/organization/index.d.ts.map +1 -1
- package/resources/organization/organization.d.mts +2 -2
- package/resources/organization/organization.d.mts.map +1 -1
- package/resources/organization/organization.d.ts +2 -2
- package/resources/organization/organization.d.ts.map +1 -1
- package/resources/organization/organization.js.map +1 -1
- package/resources/organization/organization.mjs.map +1 -1
- package/resources/support/conversations/conversations.d.mts +9 -28
- package/resources/support/conversations/conversations.d.mts.map +1 -1
- package/resources/support/conversations/conversations.d.ts +9 -28
- package/resources/support/conversations/conversations.d.ts.map +1 -1
- package/resources/support/conversations/conversations.js +6 -3
- package/resources/support/conversations/conversations.js.map +1 -1
- package/resources/support/conversations/conversations.mjs +6 -3
- package/resources/support/conversations/conversations.mjs.map +1 -1
- package/resources/support/conversations/index.d.mts +1 -1
- package/resources/support/conversations/index.d.mts.map +1 -1
- package/resources/support/conversations/index.d.ts +1 -1
- package/resources/support/conversations/index.d.ts.map +1 -1
- package/resources/support/index.d.mts +2 -2
- package/resources/support/index.d.mts.map +1 -1
- package/resources/support/index.d.ts +2 -2
- package/resources/support/index.d.ts.map +1 -1
- package/resources/support/support.d.mts +4 -4
- package/resources/support/support.d.mts.map +1 -1
- package/resources/support/support.d.ts +4 -4
- package/resources/support/support.d.ts.map +1 -1
- package/resources/support/support.mjs.map +1 -1
- package/resources/support/tickets/index.d.mts +1 -1
- package/resources/support/tickets/index.d.mts.map +1 -1
- package/resources/support/tickets/index.d.ts +1 -1
- package/resources/support/tickets/index.d.ts.map +1 -1
- package/resources/support/tickets/tickets.d.mts +9 -27
- package/resources/support/tickets/tickets.d.mts.map +1 -1
- package/resources/support/tickets/tickets.d.ts +9 -27
- package/resources/support/tickets/tickets.d.ts.map +1 -1
- package/resources/support/tickets/tickets.js +6 -2
- package/resources/support/tickets/tickets.js.map +1 -1
- package/resources/support/tickets/tickets.mjs +6 -2
- package/resources/support/tickets/tickets.mjs.map +1 -1
- package/resources/surveys.d.mts +34 -79
- package/resources/surveys.d.mts.map +1 -1
- package/resources/surveys.d.ts +34 -79
- package/resources/surveys.d.ts.map +1 -1
- package/resources/surveys.js +4 -3
- package/resources/surveys.js.map +1 -1
- package/resources/surveys.mjs +4 -3
- package/resources/surveys.mjs.map +1 -1
- package/resources/users/companies/companies.d.mts +9 -28
- package/resources/users/companies/companies.d.mts.map +1 -1
- package/resources/users/companies/companies.d.ts +9 -28
- package/resources/users/companies/companies.d.ts.map +1 -1
- package/resources/users/companies/companies.js +6 -2
- package/resources/users/companies/companies.js.map +1 -1
- package/resources/users/companies/companies.mjs +6 -2
- package/resources/users/companies/companies.mjs.map +1 -1
- package/resources/users/companies/contacts.d.mts +11 -16
- package/resources/users/companies/contacts.d.mts.map +1 -1
- package/resources/users/companies/contacts.d.ts +11 -16
- package/resources/users/companies/contacts.d.ts.map +1 -1
- package/resources/users/companies/contacts.js +8 -5
- package/resources/users/companies/contacts.js.map +1 -1
- package/resources/users/companies/contacts.mjs +8 -5
- package/resources/users/companies/contacts.mjs.map +1 -1
- package/resources/users/companies/index.d.mts +1 -1
- package/resources/users/companies/index.d.mts.map +1 -1
- package/resources/users/companies/index.d.ts +1 -1
- package/resources/users/companies/index.d.ts.map +1 -1
- package/resources/users/contacts/contacts.d.mts +9 -13
- package/resources/users/contacts/contacts.d.mts.map +1 -1
- package/resources/users/contacts/contacts.d.ts +9 -13
- package/resources/users/contacts/contacts.d.ts.map +1 -1
- package/resources/users/contacts/contacts.js +6 -2
- package/resources/users/contacts/contacts.js.map +1 -1
- package/resources/users/contacts/contacts.mjs +6 -2
- package/resources/users/contacts/contacts.mjs.map +1 -1
- package/resources/users/contacts/index.d.mts +1 -1
- package/resources/users/contacts/index.d.mts.map +1 -1
- package/resources/users/contacts/index.d.ts +1 -1
- package/resources/users/contacts/index.d.ts.map +1 -1
- package/resources/users/contacts/index.js.map +1 -1
- package/resources/users/contacts/index.mjs.map +1 -1
- package/resources/users/index.d.mts +2 -2
- package/resources/users/index.d.mts.map +1 -1
- package/resources/users/index.d.ts +2 -2
- package/resources/users/index.d.ts.map +1 -1
- package/resources/users/index.js.map +1 -1
- package/resources/users/index.mjs.map +1 -1
- package/resources/users/users.d.mts +4 -4
- package/resources/users/users.d.mts.map +1 -1
- package/resources/users/users.d.ts +4 -4
- package/resources/users/users.d.ts.map +1 -1
- package/resources/users/users.js.map +1 -1
- package/resources/users/users.mjs.map +1 -1
- package/resources/webhooks.d.mts +9 -27
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +9 -27
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +6 -2
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +6 -2
- package/resources/webhooks.mjs.map +1 -1
- package/src/client.ts +41 -10
- package/src/core/pagination.ts +157 -0
- package/src/index.ts +1 -0
- package/src/pagination.ts +2 -0
- package/src/resources/changelogs/changelogs.ts +11 -64
- package/src/resources/changelogs/index.ts +1 -1
- package/src/resources/feedback/comments.ts +11 -64
- package/src/resources/feedback/feedback.ts +4 -4
- package/src/resources/feedback/index.ts +2 -2
- package/src/resources/feedback/posts/index.ts +2 -1
- package/src/resources/feedback/posts/posts.ts +13 -65
- package/src/resources/feedback/posts/voters.ts +87 -140
- package/src/resources/help-center/articles.ts +11 -33
- package/src/resources/help-center/collections.ts +11 -34
- package/src/resources/help-center/help-center.ts +8 -8
- package/src/resources/help-center/help-centers.ts +11 -34
- package/src/resources/help-center/index.ts +4 -4
- package/src/resources/help-center/redirect-rules.ts +11 -34
- package/src/resources/index.ts +6 -5
- package/src/resources/organization/brands.ts +7 -32
- package/src/resources/organization/index.ts +1 -1
- package/src/resources/organization/organization.ts +2 -2
- package/src/resources/support/conversations/conversations.ts +11 -34
- package/src/resources/support/conversations/index.ts +1 -1
- package/src/resources/support/index.ts +2 -2
- package/src/resources/support/support.ts +4 -4
- package/src/resources/support/tickets/index.ts +1 -1
- package/src/resources/support/tickets/tickets.ts +11 -33
- package/src/resources/surveys.ts +54 -102
- package/src/resources/users/companies/companies.ts +11 -34
- package/src/resources/users/companies/contacts.ts +24 -26
- package/src/resources/users/companies/index.ts +1 -1
- package/src/resources/users/contacts/contacts.ts +14 -15
- package/src/resources/users/contacts/index.ts +1 -0
- package/src/resources/users/index.ts +2 -1
- package/src/resources/users/users.ts +4 -2
- package/src/resources/webhooks.ts +11 -33
- 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
|
@@ -8,12 +8,14 @@ import {
|
|
|
8
8
|
VoterAddResponse,
|
|
9
9
|
VoterListParams,
|
|
10
10
|
VoterListResponse,
|
|
11
|
+
VoterListResponsesCursorPage,
|
|
11
12
|
VoterRemoveParams,
|
|
12
13
|
VoterRemoveResponse,
|
|
13
14
|
Voters,
|
|
14
15
|
} from './voters';
|
|
15
16
|
import * as TicketsAPI from '../../support/tickets/tickets';
|
|
16
17
|
import { APIPromise } from '../../../core/api-promise';
|
|
18
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination';
|
|
17
19
|
import { buildHeaders } from '../../../internal/headers';
|
|
18
20
|
import { RequestOptions } from '../../../internal/request-options';
|
|
19
21
|
import { path } from '../../../internal/utils/path';
|
|
@@ -225,15 +227,18 @@ export class Posts extends APIResource {
|
|
|
225
227
|
*
|
|
226
228
|
* @example
|
|
227
229
|
* ```ts
|
|
228
|
-
*
|
|
230
|
+
* // Automatically fetches more pages as needed.
|
|
231
|
+
* for await (const post of client.feedback.posts.list()) {
|
|
232
|
+
* // ...
|
|
233
|
+
* }
|
|
229
234
|
* ```
|
|
230
235
|
*/
|
|
231
236
|
list(
|
|
232
237
|
params: PostListParams | null | undefined = {},
|
|
233
238
|
options?: RequestOptions,
|
|
234
|
-
):
|
|
239
|
+
): PagePromise<PostsCursorPage, Post> {
|
|
235
240
|
const { 'Featurebase-Version': featurebaseVersion, ...query } = params ?? {};
|
|
236
|
-
return this._client.
|
|
241
|
+
return this._client.getAPIList('/v2/posts', CursorPage<Post>, {
|
|
237
242
|
query,
|
|
238
243
|
...options,
|
|
239
244
|
headers: buildHeaders([
|
|
@@ -290,6 +295,8 @@ export class Posts extends APIResource {
|
|
|
290
295
|
}
|
|
291
296
|
}
|
|
292
297
|
|
|
298
|
+
export type PostsCursorPage = CursorPage<Post>;
|
|
299
|
+
|
|
293
300
|
export interface Post {
|
|
294
301
|
/**
|
|
295
302
|
* Unique identifier
|
|
@@ -629,55 +636,6 @@ export namespace Post {
|
|
|
629
636
|
}
|
|
630
637
|
}
|
|
631
638
|
|
|
632
|
-
export interface PostListResponse {
|
|
633
|
-
/**
|
|
634
|
-
* Array of posts
|
|
635
|
-
*/
|
|
636
|
-
data: Array<Post>;
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* Cursor for fetching the next page (cursor-based pagination)
|
|
640
|
-
*/
|
|
641
|
-
nextCursor: string | null;
|
|
642
|
-
|
|
643
|
-
/**
|
|
644
|
-
* Object type identifier
|
|
645
|
-
*/
|
|
646
|
-
object: 'list';
|
|
647
|
-
|
|
648
|
-
/**
|
|
649
|
-
* Pagination metadata for page-based requests
|
|
650
|
-
*/
|
|
651
|
-
pagination?: PostListResponse.Pagination;
|
|
652
|
-
}
|
|
653
|
-
|
|
654
|
-
export namespace PostListResponse {
|
|
655
|
-
/**
|
|
656
|
-
* Pagination metadata for page-based requests
|
|
657
|
-
*/
|
|
658
|
-
export interface Pagination {
|
|
659
|
-
/**
|
|
660
|
-
* Items per page
|
|
661
|
-
*/
|
|
662
|
-
limit: number;
|
|
663
|
-
|
|
664
|
-
/**
|
|
665
|
-
* Current page number
|
|
666
|
-
*/
|
|
667
|
-
page: number;
|
|
668
|
-
|
|
669
|
-
/**
|
|
670
|
-
* Total number of items
|
|
671
|
-
*/
|
|
672
|
-
total: number;
|
|
673
|
-
|
|
674
|
-
/**
|
|
675
|
-
* Total number of pages
|
|
676
|
-
*/
|
|
677
|
-
totalPages: number;
|
|
678
|
-
}
|
|
679
|
-
}
|
|
680
|
-
|
|
681
639
|
export interface PostDeleteResponse {
|
|
682
640
|
/**
|
|
683
641
|
* Unique identifier of the deleted post
|
|
@@ -931,28 +889,17 @@ export interface PostUpdateParams {
|
|
|
931
889
|
'Featurebase-Version'?: string;
|
|
932
890
|
}
|
|
933
891
|
|
|
934
|
-
export interface PostListParams {
|
|
892
|
+
export interface PostListParams extends CursorPageParams {
|
|
935
893
|
/**
|
|
936
894
|
* Query param: Filter by board (category) ID(s)
|
|
937
895
|
*/
|
|
938
896
|
boardId?: string | Array<string>;
|
|
939
897
|
|
|
940
|
-
/**
|
|
941
|
-
* Query param: An opaque cursor for pagination. Use the nextCursor value from a
|
|
942
|
-
* previous response to fetch the next page of results.
|
|
943
|
-
*/
|
|
944
|
-
cursor?: string;
|
|
945
|
-
|
|
946
898
|
/**
|
|
947
899
|
* Query param: Include posts that are in review
|
|
948
900
|
*/
|
|
949
901
|
inReview?: boolean | null;
|
|
950
902
|
|
|
951
|
-
/**
|
|
952
|
-
* Query param: A limit on the number of posts to be returned, between 1 and 100.
|
|
953
|
-
*/
|
|
954
|
-
limit?: number;
|
|
955
|
-
|
|
956
903
|
/**
|
|
957
904
|
* Query param: Search query to filter posts by title/content
|
|
958
905
|
*/
|
|
@@ -998,8 +945,8 @@ Posts.Voters = Voters;
|
|
|
998
945
|
export declare namespace Posts {
|
|
999
946
|
export {
|
|
1000
947
|
type Post as Post,
|
|
1001
|
-
type PostListResponse as PostListResponse,
|
|
1002
948
|
type PostDeleteResponse as PostDeleteResponse,
|
|
949
|
+
type PostsCursorPage as PostsCursorPage,
|
|
1003
950
|
type PostCreateParams as PostCreateParams,
|
|
1004
951
|
type PostRetrieveParams as PostRetrieveParams,
|
|
1005
952
|
type PostUpdateParams as PostUpdateParams,
|
|
@@ -1012,6 +959,7 @@ export declare namespace Posts {
|
|
|
1012
959
|
type VoterListResponse as VoterListResponse,
|
|
1013
960
|
type VoterAddResponse as VoterAddResponse,
|
|
1014
961
|
type VoterRemoveResponse as VoterRemoveResponse,
|
|
962
|
+
type VoterListResponsesCursorPage as VoterListResponsesCursorPage,
|
|
1015
963
|
type VoterListParams as VoterListParams,
|
|
1016
964
|
type VoterAddParams as VoterAddParams,
|
|
1017
965
|
type VoterRemoveParams as VoterRemoveParams,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
4
|
import * as CompaniesAPI from '../../users/companies/companies';
|
|
5
5
|
import { APIPromise } from '../../../core/api-promise';
|
|
6
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../../../core/pagination';
|
|
6
7
|
import { buildHeaders } from '../../../internal/headers';
|
|
7
8
|
import { RequestOptions } from '../../../internal/request-options';
|
|
8
9
|
import { path } from '../../../internal/utils/path';
|
|
@@ -50,18 +51,21 @@ export class Voters extends APIResource {
|
|
|
50
51
|
*
|
|
51
52
|
* @example
|
|
52
53
|
* ```ts
|
|
53
|
-
*
|
|
54
|
+
* // Automatically fetches more pages as needed.
|
|
55
|
+
* for await (const voterListResponse of client.feedback.posts.voters.list(
|
|
54
56
|
* '507f1f77bcf86cd799439011',
|
|
55
|
-
* )
|
|
57
|
+
* )) {
|
|
58
|
+
* // ...
|
|
59
|
+
* }
|
|
56
60
|
* ```
|
|
57
61
|
*/
|
|
58
62
|
list(
|
|
59
63
|
id: string,
|
|
60
64
|
params: VoterListParams | null | undefined = {},
|
|
61
65
|
options?: RequestOptions,
|
|
62
|
-
):
|
|
66
|
+
): PagePromise<VoterListResponsesCursorPage, VoterListResponse> {
|
|
63
67
|
const { 'Featurebase-Version': featurebaseVersion, ...query } = params ?? {};
|
|
64
|
-
return this._client.
|
|
68
|
+
return this._client.getAPIList(path`/v2/posts/${id}/voters`, CursorPage<VoterListResponse>, {
|
|
65
69
|
query,
|
|
66
70
|
...options,
|
|
67
71
|
headers: buildHeaders([
|
|
@@ -176,150 +180,103 @@ export class Voters extends APIResource {
|
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
182
|
|
|
183
|
+
export type VoterListResponsesCursorPage = CursorPage<VoterListResponse>;
|
|
184
|
+
|
|
179
185
|
export interface VoterListResponse {
|
|
180
186
|
/**
|
|
181
|
-
*
|
|
187
|
+
* Unique identifier
|
|
182
188
|
*/
|
|
183
|
-
|
|
189
|
+
id: string;
|
|
184
190
|
|
|
185
191
|
/**
|
|
186
|
-
*
|
|
192
|
+
* User display name
|
|
187
193
|
*/
|
|
188
|
-
|
|
194
|
+
name: string;
|
|
189
195
|
|
|
190
196
|
/**
|
|
191
197
|
* Object type identifier
|
|
192
198
|
*/
|
|
193
|
-
object: '
|
|
199
|
+
object: 'contact';
|
|
194
200
|
|
|
195
201
|
/**
|
|
196
|
-
*
|
|
202
|
+
* Type of user
|
|
197
203
|
*/
|
|
198
|
-
|
|
199
|
-
}
|
|
204
|
+
type: 'admin' | 'customer' | 'guest' | 'integration' | 'bot' | 'lead';
|
|
200
205
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
*/
|
|
206
|
-
id: string;
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* User display name
|
|
210
|
-
*/
|
|
211
|
-
name: string;
|
|
212
|
-
|
|
213
|
-
/**
|
|
214
|
-
* Object type identifier
|
|
215
|
-
*/
|
|
216
|
-
object: 'contact';
|
|
217
|
-
|
|
218
|
-
/**
|
|
219
|
-
* Type of user
|
|
220
|
-
*/
|
|
221
|
-
type: 'admin' | 'customer' | 'guest' | 'integration' | 'bot' | 'lead';
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Number of comments created
|
|
225
|
-
*/
|
|
226
|
-
commentsCreated?: number;
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* Companies the user belongs to
|
|
230
|
-
*/
|
|
231
|
-
companies?: Array<CompaniesAPI.Company>;
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Custom field values on the user
|
|
235
|
-
*/
|
|
236
|
-
customFields?: { [key: string]: unknown };
|
|
237
|
-
|
|
238
|
-
/**
|
|
239
|
-
* User description/bio
|
|
240
|
-
*/
|
|
241
|
-
description?: string;
|
|
242
|
-
|
|
243
|
-
/**
|
|
244
|
-
* User email
|
|
245
|
-
*/
|
|
246
|
-
email?: string | null;
|
|
247
|
-
|
|
248
|
-
/**
|
|
249
|
-
* Last activity ISO timestamp
|
|
250
|
-
*/
|
|
251
|
-
lastActivity?: string;
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* User locale
|
|
255
|
-
*/
|
|
256
|
-
locale?: string;
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Whether manually opted out from changelog
|
|
260
|
-
*/
|
|
261
|
-
manuallyOptedOutFromChangelog?: boolean;
|
|
262
|
-
|
|
263
|
-
/**
|
|
264
|
-
* Organization ID the user belongs to
|
|
265
|
-
*/
|
|
266
|
-
organizationId?: string;
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Number of posts created
|
|
270
|
-
*/
|
|
271
|
-
postsCreated?: number;
|
|
272
|
-
|
|
273
|
-
/**
|
|
274
|
-
* Profile picture URL
|
|
275
|
-
*/
|
|
276
|
-
profilePicture?: string | null;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* User roles
|
|
280
|
-
*/
|
|
281
|
-
roles?: Array<string>;
|
|
282
|
-
|
|
283
|
-
/**
|
|
284
|
-
* Whether subscribed to changelog
|
|
285
|
-
*/
|
|
286
|
-
subscribedToChangelog?: boolean;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* External user ID from SSO
|
|
290
|
-
*/
|
|
291
|
-
userId?: string;
|
|
292
|
-
|
|
293
|
-
/**
|
|
294
|
-
* Whether email is verified
|
|
295
|
-
*/
|
|
296
|
-
verified?: boolean;
|
|
297
|
-
}
|
|
206
|
+
/**
|
|
207
|
+
* Number of comments created
|
|
208
|
+
*/
|
|
209
|
+
commentsCreated?: number;
|
|
298
210
|
|
|
299
211
|
/**
|
|
300
|
-
*
|
|
212
|
+
* Companies the user belongs to
|
|
301
213
|
*/
|
|
302
|
-
|
|
303
|
-
/**
|
|
304
|
-
* Items per page
|
|
305
|
-
*/
|
|
306
|
-
limit: number;
|
|
214
|
+
companies?: Array<CompaniesAPI.Company>;
|
|
307
215
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
216
|
+
/**
|
|
217
|
+
* Custom field values on the user
|
|
218
|
+
*/
|
|
219
|
+
customFields?: { [key: string]: unknown };
|
|
312
220
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
221
|
+
/**
|
|
222
|
+
* User description/bio
|
|
223
|
+
*/
|
|
224
|
+
description?: string;
|
|
317
225
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
226
|
+
/**
|
|
227
|
+
* User email
|
|
228
|
+
*/
|
|
229
|
+
email?: string | null;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Last activity ISO timestamp
|
|
233
|
+
*/
|
|
234
|
+
lastActivity?: string;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* User locale
|
|
238
|
+
*/
|
|
239
|
+
locale?: string;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Whether manually opted out from changelog
|
|
243
|
+
*/
|
|
244
|
+
manuallyOptedOutFromChangelog?: boolean;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* Organization ID the user belongs to
|
|
248
|
+
*/
|
|
249
|
+
organizationId?: string;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Number of posts created
|
|
253
|
+
*/
|
|
254
|
+
postsCreated?: number;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Profile picture URL
|
|
258
|
+
*/
|
|
259
|
+
profilePicture?: string | null;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* User roles
|
|
263
|
+
*/
|
|
264
|
+
roles?: Array<string>;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* Whether subscribed to changelog
|
|
268
|
+
*/
|
|
269
|
+
subscribedToChangelog?: boolean;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* External user ID from SSO
|
|
273
|
+
*/
|
|
274
|
+
userId?: string;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Whether email is verified
|
|
278
|
+
*/
|
|
279
|
+
verified?: boolean;
|
|
323
280
|
}
|
|
324
281
|
|
|
325
282
|
export interface VoterAddResponse {
|
|
@@ -366,18 +323,7 @@ export interface VoterRemoveResponse {
|
|
|
366
323
|
removed: true;
|
|
367
324
|
}
|
|
368
325
|
|
|
369
|
-
export interface VoterListParams {
|
|
370
|
-
/**
|
|
371
|
-
* Query param: An opaque cursor for pagination. Use the nextCursor value from a
|
|
372
|
-
* previous response to fetch the next page of results.
|
|
373
|
-
*/
|
|
374
|
-
cursor?: string;
|
|
375
|
-
|
|
376
|
-
/**
|
|
377
|
-
* Query param: A limit on the number of voters to be returned, between 1 and 100.
|
|
378
|
-
*/
|
|
379
|
-
limit?: number;
|
|
380
|
-
|
|
326
|
+
export interface VoterListParams extends CursorPageParams {
|
|
381
327
|
/**
|
|
382
328
|
* Header param: API version for this request. Defaults to your organization's
|
|
383
329
|
* configured API version if not specified.
|
|
@@ -446,6 +392,7 @@ export declare namespace Voters {
|
|
|
446
392
|
type VoterListResponse as VoterListResponse,
|
|
447
393
|
type VoterAddResponse as VoterAddResponse,
|
|
448
394
|
type VoterRemoveResponse as VoterRemoveResponse,
|
|
395
|
+
type VoterListResponsesCursorPage as VoterListResponsesCursorPage,
|
|
449
396
|
type VoterListParams as VoterListParams,
|
|
450
397
|
type VoterAddParams as VoterAddParams,
|
|
451
398
|
type VoterRemoveParams as VoterRemoveParams,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as ArticlesAPI from './articles';
|
|
5
5
|
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagination';
|
|
6
7
|
import { buildHeaders } from '../../internal/headers';
|
|
7
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
9
|
import { path } from '../../internal/utils/path';
|
|
@@ -250,15 +251,18 @@ export class Articles extends APIResource {
|
|
|
250
251
|
*
|
|
251
252
|
* @example
|
|
252
253
|
* ```ts
|
|
253
|
-
*
|
|
254
|
+
* // Automatically fetches more pages as needed.
|
|
255
|
+
* for await (const article of client.helpCenter.articles.list()) {
|
|
256
|
+
* // ...
|
|
257
|
+
* }
|
|
254
258
|
* ```
|
|
255
259
|
*/
|
|
256
260
|
list(
|
|
257
261
|
params: ArticleListParams | null | undefined = {},
|
|
258
262
|
options?: RequestOptions,
|
|
259
|
-
):
|
|
263
|
+
): PagePromise<ArticlesCursorPage, Article> {
|
|
260
264
|
const { 'Featurebase-Version': featurebaseVersion, ...query } = params ?? {};
|
|
261
|
-
return this._client.
|
|
265
|
+
return this._client.getAPIList('/v2/help_center/articles', CursorPage<Article>, {
|
|
262
266
|
query,
|
|
263
267
|
...options,
|
|
264
268
|
headers: buildHeaders([
|
|
@@ -310,6 +314,8 @@ export class Articles extends APIResource {
|
|
|
310
314
|
}
|
|
311
315
|
}
|
|
312
316
|
|
|
317
|
+
export type ArticlesCursorPage = CursorPage<Article>;
|
|
318
|
+
|
|
313
319
|
export interface Article {
|
|
314
320
|
/**
|
|
315
321
|
* Article unique identifier
|
|
@@ -837,23 +843,6 @@ export interface ArticleTranslationInputNova {
|
|
|
837
843
|
title?: string;
|
|
838
844
|
}
|
|
839
845
|
|
|
840
|
-
export interface ArticleListResponse {
|
|
841
|
-
/**
|
|
842
|
-
* Array of article objects
|
|
843
|
-
*/
|
|
844
|
-
data: Array<Article>;
|
|
845
|
-
|
|
846
|
-
/**
|
|
847
|
-
* Cursor for fetching the next page (cursor-based pagination)
|
|
848
|
-
*/
|
|
849
|
-
nextCursor: string | null;
|
|
850
|
-
|
|
851
|
-
/**
|
|
852
|
-
* Object type identifier
|
|
853
|
-
*/
|
|
854
|
-
object: 'list';
|
|
855
|
-
}
|
|
856
|
-
|
|
857
846
|
export interface ArticleDeleteResponse {
|
|
858
847
|
/**
|
|
859
848
|
* Unique identifier of the deleted article
|
|
@@ -1169,24 +1158,13 @@ export namespace ArticleUpdateParams {
|
|
|
1169
1158
|
}
|
|
1170
1159
|
}
|
|
1171
1160
|
|
|
1172
|
-
export interface ArticleListParams {
|
|
1173
|
-
/**
|
|
1174
|
-
* Query param: An opaque cursor for pagination. Use the nextCursor value from a
|
|
1175
|
-
* previous response to fetch the next page of results.
|
|
1176
|
-
*/
|
|
1177
|
-
cursor?: string;
|
|
1178
|
-
|
|
1161
|
+
export interface ArticleListParams extends CursorPageParams {
|
|
1179
1162
|
/**
|
|
1180
1163
|
* Query param: Filter articles by help center ID. If omitted, returns articles
|
|
1181
1164
|
* across all help centers.
|
|
1182
1165
|
*/
|
|
1183
1166
|
helpCenterId?: string;
|
|
1184
1167
|
|
|
1185
|
-
/**
|
|
1186
|
-
* Query param: A limit on the number of objects to be returned, between 1 and 100.
|
|
1187
|
-
*/
|
|
1188
|
-
limit?: number;
|
|
1189
|
-
|
|
1190
1168
|
/**
|
|
1191
1169
|
* Query param: Filter articles by parent collection ID
|
|
1192
1170
|
*/
|
|
@@ -1220,8 +1198,8 @@ export declare namespace Articles {
|
|
|
1220
1198
|
type ArticleIconInputNova as ArticleIconInputNova,
|
|
1221
1199
|
type ArticleTranslation as ArticleTranslation,
|
|
1222
1200
|
type ArticleTranslationInputNova as ArticleTranslationInputNova,
|
|
1223
|
-
type ArticleListResponse as ArticleListResponse,
|
|
1224
1201
|
type ArticleDeleteResponse as ArticleDeleteResponse,
|
|
1202
|
+
type ArticlesCursorPage as ArticlesCursorPage,
|
|
1225
1203
|
type ArticleCreateParams as ArticleCreateParams,
|
|
1226
1204
|
type ArticleRetrieveParams as ArticleRetrieveParams,
|
|
1227
1205
|
type ArticleUpdateParams as ArticleUpdateParams,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
4
|
import * as CollectionsAPI from './collections';
|
|
5
5
|
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../../core/pagination';
|
|
6
7
|
import { buildHeaders } from '../../internal/headers';
|
|
7
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
9
|
import { path } from '../../internal/utils/path';
|
|
@@ -232,16 +233,18 @@ export class Collections extends APIResource {
|
|
|
232
233
|
*
|
|
233
234
|
* @example
|
|
234
235
|
* ```ts
|
|
235
|
-
*
|
|
236
|
-
*
|
|
236
|
+
* // Automatically fetches more pages as needed.
|
|
237
|
+
* for await (const collection of client.helpCenter.collections.list()) {
|
|
238
|
+
* // ...
|
|
239
|
+
* }
|
|
237
240
|
* ```
|
|
238
241
|
*/
|
|
239
242
|
list(
|
|
240
243
|
params: CollectionListParams | null | undefined = {},
|
|
241
244
|
options?: RequestOptions,
|
|
242
|
-
):
|
|
245
|
+
): PagePromise<CollectionsCursorPage, Collection> {
|
|
243
246
|
const { 'Featurebase-Version': featurebaseVersion, ...query } = params ?? {};
|
|
244
|
-
return this._client.
|
|
247
|
+
return this._client.getAPIList('/v2/help_center/collections', CursorPage<Collection>, {
|
|
245
248
|
query,
|
|
246
249
|
...options,
|
|
247
250
|
headers: buildHeaders([
|
|
@@ -292,6 +295,8 @@ export class Collections extends APIResource {
|
|
|
292
295
|
}
|
|
293
296
|
}
|
|
294
297
|
|
|
298
|
+
export type CollectionsCursorPage = CursorPage<Collection>;
|
|
299
|
+
|
|
295
300
|
export interface Collection {
|
|
296
301
|
/**
|
|
297
302
|
* Collection unique identifier
|
|
@@ -725,23 +730,6 @@ export interface CollectionTranslationInputNova {
|
|
|
725
730
|
name?: string;
|
|
726
731
|
}
|
|
727
732
|
|
|
728
|
-
export interface CollectionListResponse {
|
|
729
|
-
/**
|
|
730
|
-
* Array of collections
|
|
731
|
-
*/
|
|
732
|
-
data: Array<Collection>;
|
|
733
|
-
|
|
734
|
-
/**
|
|
735
|
-
* Cursor for fetching the next page (cursor-based pagination)
|
|
736
|
-
*/
|
|
737
|
-
nextCursor: string | null;
|
|
738
|
-
|
|
739
|
-
/**
|
|
740
|
-
* Object type identifier
|
|
741
|
-
*/
|
|
742
|
-
object: 'list';
|
|
743
|
-
}
|
|
744
|
-
|
|
745
733
|
export interface CollectionDeleteResponse {
|
|
746
734
|
/**
|
|
747
735
|
* Unique identifier of the deleted collection
|
|
@@ -1015,24 +1003,13 @@ export namespace CollectionUpdateParams {
|
|
|
1015
1003
|
}
|
|
1016
1004
|
}
|
|
1017
1005
|
|
|
1018
|
-
export interface CollectionListParams {
|
|
1019
|
-
/**
|
|
1020
|
-
* Query param: An opaque cursor for pagination. Use the nextCursor value from a
|
|
1021
|
-
* previous response to fetch the next page.
|
|
1022
|
-
*/
|
|
1023
|
-
cursor?: string;
|
|
1024
|
-
|
|
1006
|
+
export interface CollectionListParams extends CursorPageParams {
|
|
1025
1007
|
/**
|
|
1026
1008
|
* Query param: Filter collections by help center ID. If omitted, returns
|
|
1027
1009
|
* collections across all help centers.
|
|
1028
1010
|
*/
|
|
1029
1011
|
helpCenterId?: string;
|
|
1030
1012
|
|
|
1031
|
-
/**
|
|
1032
|
-
* Query param: A limit on the number of objects to be returned, between 1 and 100.
|
|
1033
|
-
*/
|
|
1034
|
-
limit?: number;
|
|
1035
|
-
|
|
1036
1013
|
/**
|
|
1037
1014
|
* Header param: API version for this request. Defaults to your organization's
|
|
1038
1015
|
* configured API version if not specified.
|
|
@@ -1054,8 +1031,8 @@ export declare namespace Collections {
|
|
|
1054
1031
|
type CollectionIconNova as CollectionIconNova,
|
|
1055
1032
|
type CollectionTranslation as CollectionTranslation,
|
|
1056
1033
|
type CollectionTranslationInputNova as CollectionTranslationInputNova,
|
|
1057
|
-
type CollectionListResponse as CollectionListResponse,
|
|
1058
1034
|
type CollectionDeleteResponse as CollectionDeleteResponse,
|
|
1035
|
+
type CollectionsCursorPage as CollectionsCursorPage,
|
|
1059
1036
|
type CollectionCreateParams as CollectionCreateParams,
|
|
1060
1037
|
type CollectionRetrieveParams as CollectionRetrieveParams,
|
|
1061
1038
|
type CollectionUpdateParams as CollectionUpdateParams,
|