@kookee/sdk 0.0.31 → 0.0.33
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 +57 -28
- package/dist/index.cjs +2 -2
- package/dist/index.d.cts +235 -222
- package/dist/index.d.ts +235 -222
- package/dist/index.global.js +2 -2
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
declare class KookeeApiError extends Error {
|
|
2
|
-
readonly code: string;
|
|
3
|
-
readonly status: number;
|
|
4
|
-
constructor(code: string, message: string, status: number);
|
|
5
|
-
}
|
|
6
|
-
declare class HttpClient {
|
|
7
|
-
private readonly baseUrl;
|
|
8
|
-
private readonly apiKey?;
|
|
9
|
-
private readonly projectId?;
|
|
10
|
-
constructor(options: {
|
|
11
|
-
apiKey?: string;
|
|
12
|
-
projectId?: string;
|
|
13
|
-
baseUrl?: string;
|
|
14
|
-
});
|
|
15
|
-
private getHeaders;
|
|
16
|
-
get<T>(path: string, params?: object): Promise<T>;
|
|
17
|
-
post<T>(path: string, body?: unknown): Promise<T>;
|
|
18
|
-
delete<T>(path: string, body?: unknown): Promise<T>;
|
|
19
|
-
streamPost<T>(path: string, body?: unknown): AsyncIterable<T>;
|
|
20
|
-
private handleResponse;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
1
|
interface KookeeConfig {
|
|
24
2
|
apiKey?: string;
|
|
25
3
|
projectId?: string;
|
|
@@ -41,156 +19,10 @@ interface PaginatedResponse<T> {
|
|
|
41
19
|
page: number;
|
|
42
20
|
totalPages: number;
|
|
43
21
|
}
|
|
44
|
-
interface BlogTag {
|
|
45
|
-
name: string;
|
|
46
|
-
slug: string;
|
|
47
|
-
}
|
|
48
|
-
interface BlogTagWithCount extends BlogTag {
|
|
49
|
-
count: number;
|
|
50
|
-
}
|
|
51
|
-
interface BlogPostAuthor {
|
|
52
|
-
name: string;
|
|
53
|
-
}
|
|
54
|
-
type BlogPostStatus = 'draft' | 'published' | 'archived';
|
|
55
|
-
interface BlogPostListItem {
|
|
56
|
-
id: string;
|
|
57
|
-
slug: string;
|
|
58
|
-
title: string;
|
|
59
|
-
excerptHtml: string | null;
|
|
60
|
-
coverImageUrl: string | null;
|
|
61
|
-
status: BlogPostStatus;
|
|
62
|
-
publishedAt: string | null;
|
|
63
|
-
metadata: Record<string, NonNullable<unknown>> | null;
|
|
64
|
-
createdAt: string;
|
|
65
|
-
views: number;
|
|
66
|
-
author: BlogPostAuthor;
|
|
67
|
-
tags: BlogTag[];
|
|
68
|
-
locale: string;
|
|
69
|
-
translationGroupId: string;
|
|
70
|
-
reactions: Record<string, number>;
|
|
71
|
-
}
|
|
72
|
-
interface BlogPost extends BlogPostListItem {
|
|
73
|
-
contentHtml: string;
|
|
74
|
-
metaTitle: string | null;
|
|
75
|
-
metaDescription: string | null;
|
|
76
|
-
updatedAt: string;
|
|
77
|
-
}
|
|
78
22
|
interface ApiError {
|
|
79
23
|
code: string;
|
|
80
24
|
message: string;
|
|
81
25
|
}
|
|
82
|
-
interface PageListItem {
|
|
83
|
-
id: string;
|
|
84
|
-
slug: string;
|
|
85
|
-
title: string;
|
|
86
|
-
views: number;
|
|
87
|
-
createdAt: string;
|
|
88
|
-
updatedAt: string;
|
|
89
|
-
locale: string;
|
|
90
|
-
translationGroupId: string;
|
|
91
|
-
}
|
|
92
|
-
interface Page extends PageListItem {
|
|
93
|
-
contentHtml: string;
|
|
94
|
-
metaTitle: string | null;
|
|
95
|
-
metaDescription: string | null;
|
|
96
|
-
}
|
|
97
|
-
interface HelpCategory {
|
|
98
|
-
slug: string;
|
|
99
|
-
name: string;
|
|
100
|
-
description: string | null;
|
|
101
|
-
icon: string | null;
|
|
102
|
-
articleCount: number;
|
|
103
|
-
}
|
|
104
|
-
interface HelpArticleAuthor {
|
|
105
|
-
name: string;
|
|
106
|
-
}
|
|
107
|
-
interface HelpArticleListItem {
|
|
108
|
-
id: string;
|
|
109
|
-
slug: string;
|
|
110
|
-
title: string;
|
|
111
|
-
excerptHtml: string | null;
|
|
112
|
-
status: string;
|
|
113
|
-
position: number;
|
|
114
|
-
metadata: Record<string, NonNullable<unknown>>;
|
|
115
|
-
category: {
|
|
116
|
-
name: string;
|
|
117
|
-
slug: string;
|
|
118
|
-
};
|
|
119
|
-
author: HelpArticleAuthor;
|
|
120
|
-
createdAt: string;
|
|
121
|
-
views: number;
|
|
122
|
-
locale: string;
|
|
123
|
-
translationGroupId: string;
|
|
124
|
-
usefulYesCount: number;
|
|
125
|
-
usefulNoCount: number;
|
|
126
|
-
}
|
|
127
|
-
interface HelpArticle extends HelpArticleListItem {
|
|
128
|
-
contentHtml: string;
|
|
129
|
-
metaTitle: string | null;
|
|
130
|
-
metaDescription: string | null;
|
|
131
|
-
updatedAt: string;
|
|
132
|
-
}
|
|
133
|
-
interface HelpSearchResult {
|
|
134
|
-
id: string;
|
|
135
|
-
slug: string;
|
|
136
|
-
title: string;
|
|
137
|
-
excerptHtml: string | null;
|
|
138
|
-
category: {
|
|
139
|
-
name: string;
|
|
140
|
-
slug: string;
|
|
141
|
-
};
|
|
142
|
-
locale: string;
|
|
143
|
-
matchedChunk?: string;
|
|
144
|
-
usefulYesCount: number;
|
|
145
|
-
usefulNoCount: number;
|
|
146
|
-
}
|
|
147
|
-
type ChangelogType = 'feature' | 'fix' | 'improvement' | 'breaking' | 'security' | 'deprecated' | 'other';
|
|
148
|
-
type ChangelogOrderBy = 'createdAt' | 'publishedAt' | 'version';
|
|
149
|
-
type OrderDirection = 'asc' | 'desc';
|
|
150
|
-
interface ChangelogAuthor {
|
|
151
|
-
name: string;
|
|
152
|
-
}
|
|
153
|
-
interface ChangelogEntryListItem {
|
|
154
|
-
id: string;
|
|
155
|
-
slug: string;
|
|
156
|
-
title: string;
|
|
157
|
-
contentHtml: string;
|
|
158
|
-
type: ChangelogType;
|
|
159
|
-
version: string | null;
|
|
160
|
-
publishedAt: string | null;
|
|
161
|
-
createdAt: string;
|
|
162
|
-
locale: string;
|
|
163
|
-
translationGroupId: string;
|
|
164
|
-
metadata: Record<string, NonNullable<unknown>> | null;
|
|
165
|
-
author: ChangelogAuthor;
|
|
166
|
-
reactions: Record<string, number>;
|
|
167
|
-
}
|
|
168
|
-
interface ChangelogEntry extends ChangelogEntryListItem {
|
|
169
|
-
contentHtml: string;
|
|
170
|
-
link: string | null;
|
|
171
|
-
updatedAt: string;
|
|
172
|
-
}
|
|
173
|
-
type AnnouncementType = 'info' | 'warning' | 'critical' | 'promotion' | 'maintenance' | 'newFeature';
|
|
174
|
-
type AnnouncementOrderBy = 'createdAt' | 'publishedAt';
|
|
175
|
-
interface AnnouncementAuthor {
|
|
176
|
-
name: string;
|
|
177
|
-
}
|
|
178
|
-
interface AnnouncementListItem {
|
|
179
|
-
id: string;
|
|
180
|
-
title: string;
|
|
181
|
-
contentHtml: string;
|
|
182
|
-
type: AnnouncementType;
|
|
183
|
-
publishedAt: string | null;
|
|
184
|
-
unpublishAt: string | null;
|
|
185
|
-
createdAt: string;
|
|
186
|
-
locale: string;
|
|
187
|
-
translationGroupId: string;
|
|
188
|
-
metadata: Record<string, NonNullable<unknown>> | null;
|
|
189
|
-
author: AnnouncementAuthor;
|
|
190
|
-
}
|
|
191
|
-
interface Announcement extends AnnouncementListItem {
|
|
192
|
-
updatedAt: string;
|
|
193
|
-
}
|
|
194
26
|
interface PublicConfig {
|
|
195
27
|
key: string;
|
|
196
28
|
value: unknown;
|
|
@@ -200,18 +32,15 @@ interface HealthCheckResponse {
|
|
|
200
32
|
projectId: string;
|
|
201
33
|
timestamp: string;
|
|
202
34
|
}
|
|
203
|
-
interface VoteUsefulnessResponse {
|
|
204
|
-
usefulYesCount: number;
|
|
205
|
-
usefulNoCount: number;
|
|
206
|
-
}
|
|
207
35
|
type ReactionType = 'fire' | 'heart' | 'rocket' | 'eyes' | 'mindblown';
|
|
208
36
|
interface ReactParams {
|
|
209
|
-
reactionType:
|
|
37
|
+
reactionType: string;
|
|
210
38
|
action: 'add' | 'remove';
|
|
211
39
|
}
|
|
212
40
|
interface ReactResponse {
|
|
213
41
|
reactions: Record<string, number>;
|
|
214
42
|
}
|
|
43
|
+
type OrderDirection = 'asc' | 'desc';
|
|
215
44
|
interface HelpChatMessage {
|
|
216
45
|
role: 'user' | 'assistant';
|
|
217
46
|
content: string;
|
|
@@ -250,6 +79,18 @@ type HelpChatStreamChunk = {
|
|
|
250
79
|
type: 'error';
|
|
251
80
|
message: string;
|
|
252
81
|
};
|
|
82
|
+
interface HelpSearchResult {
|
|
83
|
+
id: string;
|
|
84
|
+
slug: string;
|
|
85
|
+
title: string;
|
|
86
|
+
excerptHtml: string | null;
|
|
87
|
+
category: {
|
|
88
|
+
name: string;
|
|
89
|
+
slug: string;
|
|
90
|
+
};
|
|
91
|
+
locale: string;
|
|
92
|
+
matchedChunk?: string;
|
|
93
|
+
}
|
|
253
94
|
type FeedbackPostStatus = 'open' | 'under_review' | 'planned' | 'in_progress' | 'completed' | 'declined';
|
|
254
95
|
type FeedbackPostCategory = 'feature' | 'improvement' | 'bug' | 'other';
|
|
255
96
|
type FeedbackSortOption = 'newest' | 'top' | 'trending';
|
|
@@ -298,21 +139,23 @@ interface FeedbackTopContributor {
|
|
|
298
139
|
interface FeedbackVoteResponse {
|
|
299
140
|
voteCount: number;
|
|
300
141
|
}
|
|
301
|
-
interface
|
|
142
|
+
interface KookeeUser {
|
|
302
143
|
externalId: string;
|
|
303
144
|
name: string;
|
|
304
145
|
email?: string;
|
|
305
146
|
avatarUrl?: string;
|
|
147
|
+
[key: string]: unknown;
|
|
306
148
|
}
|
|
149
|
+
type ExternalUser = KookeeUser;
|
|
307
150
|
interface CreateFeedbackPostParams {
|
|
308
151
|
title: string;
|
|
309
152
|
description?: string;
|
|
310
153
|
category?: FeedbackPostCategory;
|
|
311
|
-
externalUser
|
|
154
|
+
externalUser?: ExternalUser;
|
|
312
155
|
}
|
|
313
156
|
interface CreateFeedbackCommentParams {
|
|
314
157
|
content: string;
|
|
315
|
-
externalUser
|
|
158
|
+
externalUser?: ExternalUser;
|
|
316
159
|
}
|
|
317
160
|
interface CreatedFeedbackPost {
|
|
318
161
|
id: string;
|
|
@@ -335,7 +178,7 @@ interface CreatedFeedbackComment {
|
|
|
335
178
|
updatedAt: string;
|
|
336
179
|
}
|
|
337
180
|
interface ListMyFeedbackPostsParams {
|
|
338
|
-
externalId
|
|
181
|
+
externalId?: string;
|
|
339
182
|
page?: number;
|
|
340
183
|
limit?: number;
|
|
341
184
|
status?: FeedbackPostStatus;
|
|
@@ -344,32 +187,186 @@ interface ListMyFeedbackPostsParams {
|
|
|
344
187
|
sort?: FeedbackSortOption;
|
|
345
188
|
}
|
|
346
189
|
interface DeleteFeedbackPostParams {
|
|
347
|
-
externalId
|
|
190
|
+
externalId?: string;
|
|
348
191
|
}
|
|
349
192
|
interface DeleteFeedbackPostResponse {
|
|
350
193
|
success: boolean;
|
|
351
194
|
}
|
|
352
195
|
interface DeleteFeedbackCommentParams {
|
|
353
|
-
externalId
|
|
196
|
+
externalId?: string;
|
|
354
197
|
}
|
|
355
198
|
interface DeleteFeedbackCommentResponse {
|
|
356
199
|
success: boolean;
|
|
357
200
|
}
|
|
201
|
+
type EntryType = 'blog' | 'page' | 'help_article' | 'changelog' | 'announcement';
|
|
202
|
+
type EntryStatus = 'draft' | 'published' | 'archived';
|
|
203
|
+
type ChangelogType = 'feature' | 'fix' | 'improvement' | 'breaking' | 'security' | 'deprecated' | 'other';
|
|
204
|
+
type AnnouncementType = 'info' | 'warning' | 'critical' | 'promotion' | 'maintenance' | 'newFeature';
|
|
205
|
+
interface EntryAuthor {
|
|
206
|
+
name: string;
|
|
207
|
+
}
|
|
208
|
+
interface EntryTag {
|
|
209
|
+
name: string;
|
|
210
|
+
slug: string;
|
|
211
|
+
}
|
|
212
|
+
interface EntryTagWithCount extends EntryTag {
|
|
213
|
+
count: number;
|
|
214
|
+
}
|
|
215
|
+
interface EntryCategory {
|
|
216
|
+
id: string;
|
|
217
|
+
slug: string;
|
|
218
|
+
name: string;
|
|
219
|
+
description: string | null;
|
|
220
|
+
icon: string | null;
|
|
221
|
+
articleCount: number;
|
|
222
|
+
}
|
|
223
|
+
interface EntryComment {
|
|
224
|
+
id: string;
|
|
225
|
+
content: string;
|
|
226
|
+
createdAt: string;
|
|
227
|
+
updatedAt: string;
|
|
228
|
+
author: EntryAuthor;
|
|
229
|
+
}
|
|
230
|
+
interface BaseEntry {
|
|
231
|
+
id: string;
|
|
232
|
+
type: string;
|
|
233
|
+
slug: string | null;
|
|
234
|
+
title: string;
|
|
235
|
+
excerptHtml: string | null;
|
|
236
|
+
contentHtml: string;
|
|
237
|
+
status: EntryStatus;
|
|
238
|
+
publishedAt: string | null;
|
|
239
|
+
locale: string;
|
|
240
|
+
translationGroupId: string;
|
|
241
|
+
categoryId: string | null;
|
|
242
|
+
coverImageUrl: string | null;
|
|
243
|
+
position: number;
|
|
244
|
+
views: number;
|
|
245
|
+
metaTitle: string | null;
|
|
246
|
+
metaDescription: string | null;
|
|
247
|
+
metadata: Record<string, NonNullable<unknown>> | null;
|
|
248
|
+
createdAt: string;
|
|
249
|
+
updatedAt: string;
|
|
250
|
+
author: EntryAuthor;
|
|
251
|
+
tags: EntryTag[];
|
|
252
|
+
reactions: Record<string, number>;
|
|
253
|
+
category: {
|
|
254
|
+
name: string;
|
|
255
|
+
slug: string;
|
|
256
|
+
} | null;
|
|
257
|
+
}
|
|
258
|
+
interface BlogTypeSpecific {
|
|
259
|
+
_type: 'blog';
|
|
260
|
+
}
|
|
261
|
+
interface PageTypeSpecific {
|
|
262
|
+
_type: 'page';
|
|
263
|
+
}
|
|
264
|
+
interface HelpArticleTypeSpecific {
|
|
265
|
+
_type: 'help_article';
|
|
266
|
+
visibility: HelpArticleVisibility;
|
|
267
|
+
}
|
|
268
|
+
interface ChangelogTypeSpecific {
|
|
269
|
+
_type: 'changelog';
|
|
270
|
+
changelogType: ChangelogType;
|
|
271
|
+
version: string | null;
|
|
272
|
+
link: string | null;
|
|
273
|
+
}
|
|
274
|
+
interface AnnouncementTypeSpecific {
|
|
275
|
+
_type: 'announcement';
|
|
276
|
+
announcementType: AnnouncementType;
|
|
277
|
+
unpublishAt: string | null;
|
|
278
|
+
}
|
|
279
|
+
type TypeSpecific = BlogTypeSpecific | PageTypeSpecific | HelpArticleTypeSpecific | ChangelogTypeSpecific | AnnouncementTypeSpecific;
|
|
280
|
+
interface GenericEntry extends BaseEntry {
|
|
281
|
+
typeSpecific: unknown;
|
|
282
|
+
}
|
|
283
|
+
interface BlogEntry extends BaseEntry {
|
|
284
|
+
type: 'blog';
|
|
285
|
+
typeSpecific: BlogTypeSpecific;
|
|
286
|
+
}
|
|
287
|
+
interface PageEntry extends BaseEntry {
|
|
288
|
+
type: 'page';
|
|
289
|
+
typeSpecific: PageTypeSpecific;
|
|
290
|
+
}
|
|
291
|
+
interface HelpArticleEntry extends BaseEntry {
|
|
292
|
+
type: 'help_article';
|
|
293
|
+
typeSpecific: HelpArticleTypeSpecific;
|
|
294
|
+
}
|
|
295
|
+
interface ChangelogEntry extends BaseEntry {
|
|
296
|
+
type: 'changelog';
|
|
297
|
+
typeSpecific: ChangelogTypeSpecific;
|
|
298
|
+
}
|
|
299
|
+
interface AnnouncementEntry extends BaseEntry {
|
|
300
|
+
type: 'announcement';
|
|
301
|
+
typeSpecific: AnnouncementTypeSpecific;
|
|
302
|
+
}
|
|
303
|
+
type TypedEntry = BlogEntry | PageEntry | HelpArticleEntry | ChangelogEntry | AnnouncementEntry;
|
|
304
|
+
type AnyEntry = TypedEntry | GenericEntry;
|
|
305
|
+
|
|
306
|
+
declare class KookeeApiError extends Error {
|
|
307
|
+
readonly code: string;
|
|
308
|
+
readonly status: number;
|
|
309
|
+
constructor(code: string, message: string, status: number);
|
|
310
|
+
}
|
|
311
|
+
declare class HttpClient {
|
|
312
|
+
private readonly baseUrl;
|
|
313
|
+
private readonly apiKey?;
|
|
314
|
+
private readonly projectId?;
|
|
315
|
+
constructor(options: {
|
|
316
|
+
apiKey?: string;
|
|
317
|
+
projectId?: string;
|
|
318
|
+
baseUrl?: string;
|
|
319
|
+
});
|
|
320
|
+
private getHeaders;
|
|
321
|
+
get<T>(path: string, params?: object): Promise<T>;
|
|
322
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
323
|
+
delete<T>(path: string, body?: unknown): Promise<T>;
|
|
324
|
+
streamPost<T>(path: string, body?: unknown): AsyncIterable<T>;
|
|
325
|
+
private handleResponse;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
interface EntriesListParams extends PaginationParams, LocaleOptions {
|
|
329
|
+
type: string;
|
|
330
|
+
tags?: string[];
|
|
331
|
+
category?: string;
|
|
332
|
+
search?: string;
|
|
333
|
+
}
|
|
334
|
+
interface EntriesGetByIdParams extends LocaleOptions {
|
|
335
|
+
}
|
|
336
|
+
interface EntriesGetBySlugParams extends LocaleOptions {
|
|
337
|
+
type: string;
|
|
338
|
+
}
|
|
339
|
+
interface EntriesGetCommentsParams extends PaginationParams {
|
|
340
|
+
}
|
|
341
|
+
interface EntriesGetCategoriesParams extends LocaleOptions {
|
|
342
|
+
}
|
|
343
|
+
declare class EntriesModule {
|
|
344
|
+
private readonly http;
|
|
345
|
+
constructor(http: HttpClient);
|
|
346
|
+
list(params: EntriesListParams): Promise<PaginatedResponse<GenericEntry>>;
|
|
347
|
+
getById(id: string, params?: EntriesGetByIdParams): Promise<GenericEntry>;
|
|
348
|
+
getBySlug(slug: string, params: EntriesGetBySlugParams): Promise<GenericEntry>;
|
|
349
|
+
getTranslationsById(id: string): Promise<Record<string, GenericEntry>>;
|
|
350
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, GenericEntry>>;
|
|
351
|
+
getComments(entryId: string, params?: EntriesGetCommentsParams): Promise<PaginatedResponse<EntryComment>>;
|
|
352
|
+
react(entryId: string, params: ReactParams): Promise<ReactResponse>;
|
|
353
|
+
getTags(type: string): Promise<EntryTagWithCount[]>;
|
|
354
|
+
getCategories(type: string, params?: EntriesGetCategoriesParams): Promise<EntryCategory[]>;
|
|
355
|
+
}
|
|
358
356
|
|
|
359
357
|
interface AnnouncementListParams extends PaginationParams, LocaleOptions {
|
|
360
|
-
type?: AnnouncementType;
|
|
361
|
-
excludeIds?: string[];
|
|
362
|
-
orderBy?: AnnouncementOrderBy;
|
|
363
|
-
order?: OrderDirection;
|
|
364
358
|
}
|
|
365
359
|
interface AnnouncementGetByIdParams extends LocaleOptions {
|
|
366
360
|
}
|
|
361
|
+
interface AnnouncementGetCommentsParams extends PaginationParams {
|
|
362
|
+
}
|
|
367
363
|
declare class AnnouncementModule {
|
|
368
|
-
private readonly
|
|
369
|
-
constructor(
|
|
370
|
-
list(params?: AnnouncementListParams): Promise<PaginatedResponse<
|
|
371
|
-
getById(id: string, params?: AnnouncementGetByIdParams): Promise<
|
|
372
|
-
getTranslationsById(id: string): Promise<Record<string,
|
|
364
|
+
private readonly entries;
|
|
365
|
+
constructor(entries: EntriesModule);
|
|
366
|
+
list(params?: AnnouncementListParams): Promise<PaginatedResponse<AnnouncementEntry>>;
|
|
367
|
+
getById(id: string, params?: AnnouncementGetByIdParams): Promise<AnnouncementEntry>;
|
|
368
|
+
getTranslationsById(id: string): Promise<Record<string, AnnouncementEntry>>;
|
|
369
|
+
getComments(entryId: string, params?: AnnouncementGetCommentsParams): Promise<PaginatedResponse<EntryComment>>;
|
|
373
370
|
}
|
|
374
371
|
|
|
375
372
|
interface BlogListParams extends PaginationParams, LocaleOptions {
|
|
@@ -380,36 +377,39 @@ interface BlogGetBySlugParams extends LocaleOptions {
|
|
|
380
377
|
}
|
|
381
378
|
interface BlogGetByIdParams extends LocaleOptions {
|
|
382
379
|
}
|
|
380
|
+
interface BlogGetCommentsParams extends PaginationParams {
|
|
381
|
+
}
|
|
383
382
|
declare class BlogModule {
|
|
384
|
-
private readonly
|
|
385
|
-
constructor(
|
|
386
|
-
list(params?: BlogListParams): Promise<PaginatedResponse<
|
|
387
|
-
getBySlug(slug: string, params?: BlogGetBySlugParams): Promise<
|
|
388
|
-
getById(id: string, params?: BlogGetByIdParams): Promise<
|
|
389
|
-
getTags(): Promise<
|
|
390
|
-
getTranslationsById(postId: string): Promise<Record<string,
|
|
391
|
-
getTranslationsBySlug(slug: string): Promise<Record<string,
|
|
383
|
+
private readonly entries;
|
|
384
|
+
constructor(entries: EntriesModule);
|
|
385
|
+
list(params?: BlogListParams): Promise<PaginatedResponse<BlogEntry>>;
|
|
386
|
+
getBySlug(slug: string, params?: BlogGetBySlugParams): Promise<BlogEntry>;
|
|
387
|
+
getById(id: string, params?: BlogGetByIdParams): Promise<BlogEntry>;
|
|
388
|
+
getTags(): Promise<EntryTagWithCount[]>;
|
|
389
|
+
getTranslationsById(postId: string): Promise<Record<string, BlogEntry>>;
|
|
390
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, BlogEntry>>;
|
|
391
|
+
getComments(entryId: string, params?: BlogGetCommentsParams): Promise<PaginatedResponse<EntryComment>>;
|
|
392
392
|
react(postId: string, params: ReactParams): Promise<ReactResponse>;
|
|
393
393
|
}
|
|
394
394
|
|
|
395
395
|
interface ChangelogListParams extends PaginationParams, LocaleOptions {
|
|
396
|
-
type?: string;
|
|
397
396
|
search?: string;
|
|
398
|
-
orderBy?: ChangelogOrderBy;
|
|
399
|
-
order?: OrderDirection;
|
|
400
397
|
}
|
|
401
398
|
interface ChangelogGetBySlugParams extends LocaleOptions {
|
|
402
399
|
}
|
|
403
400
|
interface ChangelogGetByIdParams extends LocaleOptions {
|
|
404
401
|
}
|
|
402
|
+
interface ChangelogGetCommentsParams extends PaginationParams {
|
|
403
|
+
}
|
|
405
404
|
declare class ChangelogModule {
|
|
406
|
-
private readonly
|
|
407
|
-
constructor(
|
|
408
|
-
list(params?: ChangelogListParams): Promise<PaginatedResponse<
|
|
405
|
+
private readonly entries;
|
|
406
|
+
constructor(entries: EntriesModule);
|
|
407
|
+
list(params?: ChangelogListParams): Promise<PaginatedResponse<ChangelogEntry>>;
|
|
409
408
|
getBySlug(slug: string, params?: ChangelogGetBySlugParams): Promise<ChangelogEntry>;
|
|
410
409
|
getById(id: string, params?: ChangelogGetByIdParams): Promise<ChangelogEntry>;
|
|
411
410
|
getTranslationsById(id: string): Promise<Record<string, ChangelogEntry>>;
|
|
412
411
|
getTranslationsBySlug(slug: string): Promise<Record<string, ChangelogEntry>>;
|
|
412
|
+
getComments(entryId: string, params?: ChangelogGetCommentsParams): Promise<PaginatedResponse<EntryComment>>;
|
|
413
413
|
react(changelogId: string, params: ReactParams): Promise<ReactResponse>;
|
|
414
414
|
}
|
|
415
415
|
|
|
@@ -437,16 +437,17 @@ interface FeedbackTopContributorsParams {
|
|
|
437
437
|
}
|
|
438
438
|
declare class FeedbackModule {
|
|
439
439
|
private readonly http;
|
|
440
|
-
|
|
440
|
+
private readonly getUserContext;
|
|
441
|
+
constructor(http: HttpClient, getUserContext: () => KookeeUser | null);
|
|
441
442
|
list(params?: FeedbackListParams): Promise<PaginatedResponse<FeedbackPostListItem>>;
|
|
442
443
|
getById(id: string): Promise<FeedbackPost>;
|
|
443
444
|
vote(postId: string, params: FeedbackVoteParams): Promise<FeedbackVoteResponse>;
|
|
444
445
|
getTopContributors(params?: FeedbackTopContributorsParams): Promise<FeedbackTopContributor[]>;
|
|
445
446
|
createPost(params: CreateFeedbackPostParams): Promise<CreatedFeedbackPost>;
|
|
446
447
|
createComment(postId: string, params: CreateFeedbackCommentParams): Promise<CreatedFeedbackComment>;
|
|
447
|
-
listMyPosts(params
|
|
448
|
-
deletePost(postId: string, params
|
|
449
|
-
deleteComment(commentId: string, params
|
|
448
|
+
listMyPosts(params?: ListMyFeedbackPostsParams): Promise<PaginatedResponse<FeedbackPostListItem>>;
|
|
449
|
+
deletePost(postId: string, params?: DeleteFeedbackPostParams): Promise<DeleteFeedbackPostResponse>;
|
|
450
|
+
deleteComment(commentId: string, params?: DeleteFeedbackCommentParams): Promise<DeleteFeedbackCommentResponse>;
|
|
450
451
|
}
|
|
451
452
|
|
|
452
453
|
interface HelpCategoriesParams extends LocaleOptions {
|
|
@@ -463,19 +464,23 @@ interface HelpGetBySlugParams extends LocaleOptions {
|
|
|
463
464
|
}
|
|
464
465
|
interface HelpGetByIdParams extends LocaleOptions {
|
|
465
466
|
}
|
|
467
|
+
interface HelpGetCommentsParams extends PaginationParams {
|
|
468
|
+
}
|
|
466
469
|
declare class HelpModule {
|
|
467
470
|
private readonly http;
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
471
|
+
private readonly entries;
|
|
472
|
+
constructor(http: HttpClient, entries: EntriesModule);
|
|
473
|
+
categories(params?: HelpCategoriesParams): Promise<EntryCategory[]>;
|
|
474
|
+
list(params?: HelpListParams): Promise<PaginatedResponse<HelpArticleEntry>>;
|
|
475
|
+
getBySlug(slug: string, params?: HelpGetBySlugParams): Promise<HelpArticleEntry>;
|
|
476
|
+
getById(id: string, params?: HelpGetByIdParams): Promise<HelpArticleEntry>;
|
|
473
477
|
search(params: HelpSearchParams): Promise<HelpSearchResult[]>;
|
|
474
|
-
getTranslationsById(articleId: string): Promise<Record<string,
|
|
475
|
-
getTranslationsBySlug(slug: string): Promise<Record<string,
|
|
478
|
+
getTranslationsById(articleId: string): Promise<Record<string, HelpArticleEntry>>;
|
|
479
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, HelpArticleEntry>>;
|
|
480
|
+
getComments(entryId: string, params?: HelpGetCommentsParams): Promise<PaginatedResponse<EntryComment>>;
|
|
481
|
+
react(articleId: string, params: ReactParams): Promise<ReactResponse>;
|
|
476
482
|
chat(params: HelpChatParams): Promise<HelpChatResponse>;
|
|
477
483
|
chatStream(params: HelpChatParams): AsyncIterable<HelpChatStreamChunk>;
|
|
478
|
-
voteUsefulness(articleId: string, vote: 'yes' | 'no' | null, previousVote?: 'yes' | 'no' | null): Promise<VoteUsefulnessResponse>;
|
|
479
484
|
}
|
|
480
485
|
|
|
481
486
|
interface PagesListParams extends PaginationParams, LocaleOptions {
|
|
@@ -485,18 +490,23 @@ interface PagesGetBySlugParams extends LocaleOptions {
|
|
|
485
490
|
}
|
|
486
491
|
interface PagesGetByIdParams extends LocaleOptions {
|
|
487
492
|
}
|
|
493
|
+
interface PagesGetCommentsParams extends PaginationParams {
|
|
494
|
+
}
|
|
488
495
|
declare class PagesModule {
|
|
489
|
-
private readonly
|
|
490
|
-
constructor(
|
|
491
|
-
list(params?: PagesListParams): Promise<PaginatedResponse<
|
|
492
|
-
getBySlug(slug: string, params?: PagesGetBySlugParams): Promise<
|
|
493
|
-
getById(id: string, params?: PagesGetByIdParams): Promise<
|
|
494
|
-
getTranslationsById(pageId: string): Promise<Record<string,
|
|
495
|
-
getTranslationsBySlug(slug: string): Promise<Record<string,
|
|
496
|
+
private readonly entries;
|
|
497
|
+
constructor(entries: EntriesModule);
|
|
498
|
+
list(params?: PagesListParams): Promise<PaginatedResponse<PageEntry>>;
|
|
499
|
+
getBySlug(slug: string, params?: PagesGetBySlugParams): Promise<PageEntry>;
|
|
500
|
+
getById(id: string, params?: PagesGetByIdParams): Promise<PageEntry>;
|
|
501
|
+
getTranslationsById(pageId: string): Promise<Record<string, PageEntry>>;
|
|
502
|
+
getTranslationsBySlug(slug: string): Promise<Record<string, PageEntry>>;
|
|
503
|
+
getComments(entryId: string, params?: PagesGetCommentsParams): Promise<PaginatedResponse<EntryComment>>;
|
|
496
504
|
}
|
|
497
505
|
|
|
498
506
|
declare class Kookee {
|
|
499
507
|
private readonly http;
|
|
508
|
+
private user;
|
|
509
|
+
readonly entries: EntriesModule;
|
|
500
510
|
readonly announcements: AnnouncementModule;
|
|
501
511
|
readonly blog: BlogModule;
|
|
502
512
|
readonly changelog: ChangelogModule;
|
|
@@ -505,7 +515,10 @@ declare class Kookee {
|
|
|
505
515
|
readonly help: HelpModule;
|
|
506
516
|
readonly pages: PagesModule;
|
|
507
517
|
constructor(config: KookeeConfig);
|
|
518
|
+
identify(user: KookeeUser): void;
|
|
519
|
+
reset(): void;
|
|
520
|
+
getUser(): KookeeUser | null;
|
|
508
521
|
health(): Promise<HealthCheckResponse>;
|
|
509
522
|
}
|
|
510
523
|
|
|
511
|
-
export { type
|
|
524
|
+
export { type AnnouncementEntry, type AnnouncementGetByIdParams, type AnnouncementGetCommentsParams, type AnnouncementListParams, AnnouncementModule, type AnnouncementType, type AnnouncementTypeSpecific, type AnyEntry, type ApiError, type BaseEntry, type BlogEntry, type BlogGetByIdParams, type BlogGetBySlugParams, type BlogGetCommentsParams, type BlogListParams, BlogModule, type BlogTypeSpecific, type ChangelogEntry, type ChangelogGetByIdParams, type ChangelogGetBySlugParams, type ChangelogGetCommentsParams, type ChangelogListParams, ChangelogModule, type ChangelogType, type ChangelogTypeSpecific, type ConfigListParams, ConfigModule, type CreateFeedbackCommentParams, type CreateFeedbackPostParams, type CreatedFeedbackComment, type CreatedFeedbackPost, type DeleteFeedbackCommentParams, type DeleteFeedbackCommentResponse, type DeleteFeedbackPostParams, type DeleteFeedbackPostResponse, type EntriesGetByIdParams, type EntriesGetBySlugParams, type EntriesGetCategoriesParams, type EntriesGetCommentsParams, type EntriesListParams, EntriesModule, type EntryAuthor, type EntryCategory, type EntryComment, type EntryStatus, type EntryTag, type EntryTagWithCount, type EntryType, type ExternalUser, type FeedbackAssignee, type FeedbackAuthor, type FeedbackComment, type FeedbackListParams, FeedbackModule, type FeedbackPost, type FeedbackPostCategory, type FeedbackPostListItem, type FeedbackPostStatus, type FeedbackSortOption, type FeedbackTopContributor, type FeedbackTopContributorsParams, type FeedbackVoteParams, type FeedbackVoteResponse, type GenericEntry, type HealthCheckResponse, type HelpArticleEntry, type HelpArticleTypeSpecific, type HelpArticleVisibility, type HelpCategoriesParams, type HelpChatMessage, type HelpChatParams, type HelpChatResponse, type HelpChatSource, type HelpChatSourceCategory, type HelpChatStreamChunk, type HelpGetByIdParams, type HelpGetBySlugParams, type HelpGetCommentsParams, type HelpListParams, HelpModule, type HelpSearchParams, type HelpSearchResult, Kookee, KookeeApiError, type KookeeConfig, type KookeeUser, type ListMyFeedbackPostsParams, type LocaleOptions, type OrderDirection, type PageEntry, type PageTypeSpecific, type PagesGetByIdParams, type PagesGetBySlugParams, type PagesGetCommentsParams, type PagesListParams, PagesModule, type PaginatedResponse, type PaginationParams, type PublicConfig, type ReactParams, type ReactResponse, type ReactionType, type TypeSpecific, type TypedEntry };
|