@kookee/sdk 0.0.37 → 0.0.39

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 CHANGED
@@ -4,7 +4,7 @@ Official TypeScript SDK for [Kookee](https://kookee.dev) - the headless CMS for
4
4
 
5
5
  ## Features
6
6
 
7
- - **Lightweight** - Only ~6.41 KB KB minified (ESM), no bloat
7
+ - **Lightweight** - Small minified footprint (ESM), no bloat
8
8
  - **Zero dependencies** - Uses native `fetch`, nothing else
9
9
  - **TypeScript-first** - Full type definitions out of the box
10
10
  - **Tree-shakeable** - Import only what you need
@@ -408,7 +408,27 @@ const post = await kookee.blog.getBySlug('hello-world');
408
408
  renderFull(post.contentHtml); // ✅ available on detail
409
409
  ```
410
410
 
411
- Entries also expose `categoryId: string | null` — there is **no nested `category` object** on any entry response. If you need category metadata (name, slug, icon), fetch it separately via `kookee.help.categories()` (or the equivalent list) and join by `categoryId` on the client.
411
+ ## Categories on entries
412
+
413
+ Every entry response (list *and* detail) includes both `categoryId: string | null` **and** a resolved `category: EntryCategoryRef | null`. No client-side join required:
414
+
415
+ ```typescript
416
+ const results = await kookee.help.search({ query: 'how to reset password' });
417
+ for (const result of results) {
418
+ // result.category is already populated by the server
419
+ console.log(result.title, '→', result.category?.name);
420
+ }
421
+
422
+ type EntryCategoryRef = {
423
+ id: string;
424
+ slug: string;
425
+ name: string;
426
+ icon: string | null;
427
+ description: string | null;
428
+ };
429
+ ```
430
+
431
+ When an entry has no category assigned, `category` is `null` and `categoryId` is `null` — guard accordingly.
412
432
 
413
433
  ## Error Handling
414
434
 
@@ -460,6 +480,7 @@ import type {
460
480
  EntryTag,
461
481
  EntryTagWithCount,
462
482
  EntryCategory,
483
+ EntryCategoryRef,
463
484
  EntryComment,
464
485
  EntryTranslationSummary,
465
486
  EntryTranslationsMap,
@@ -538,6 +559,7 @@ import type {
538
559
  ReactResponse,
539
560
 
540
561
  // Common
562
+ ApiError,
541
563
  PublicConfig,
542
564
  PaginatedResponse,
543
565
  PaginationParams,
@@ -545,19 +567,41 @@ import type {
545
567
  OrderDirection,
546
568
  KookeeConfig,
547
569
  HealthCheckResponse,
570
+
571
+ // Module request parameter shapes
572
+ EntriesListParams,
573
+ EntriesGetByIdParams,
574
+ EntriesGetBySlugParams,
575
+ EntriesGetCommentsParams,
576
+ EntriesGetCategoriesParams,
577
+ BlogListParams,
578
+ BlogGetBySlugParams,
579
+ BlogGetByIdParams,
580
+ BlogGetCommentsParams,
581
+ HelpCategoriesParams,
582
+ HelpListParams,
583
+ HelpSearchParams,
584
+ HelpGetBySlugParams,
585
+ HelpGetByIdParams,
586
+ HelpGetCommentsParams,
587
+ ChangelogListParams,
588
+ ChangelogGetBySlugParams,
589
+ ChangelogGetByIdParams,
590
+ ChangelogGetCommentsParams,
591
+ PagesListParams,
592
+ PagesGetBySlugParams,
593
+ PagesGetByIdParams,
594
+ PagesGetCommentsParams,
595
+ AnnouncementListParams,
596
+ AnnouncementGetByIdParams,
597
+ AnnouncementGetCommentsParams,
598
+ ConfigListParams,
599
+ FeedbackListParams,
600
+ FeedbackVoteParams,
601
+ FeedbackTopContributorsParams,
548
602
  } from '@kookee/sdk';
549
603
  ```
550
604
 
551
- ### Breaking type changes from 0.0.36
552
-
553
- Version 0.0.37 aligns the SDK types with the real server response shapes. The old types lied about three things and crashed at runtime. If you're upgrading, note:
554
-
555
- - **`BlogEntry`, `HelpArticleEntry`, `ChangelogEntry`, `PageEntry`, `AnnouncementEntry`, `GenericEntry`, `TypedEntry`, `AnyEntry` are gone.** Each one was split into a `*ListItem` (for list/search responses) and a `*Detail` (for single-entry responses). The compiler will now stop you from accessing `contentHtml` on a list item — it was never returned by the server there, and reading it crashed.
556
- - **`BaseEntry.category` is gone.** The server never returned a nested `{ name, slug }` object; only `categoryId: string | null`. Join against `kookee.help.categories()` (or the equivalent) on the client if you need the full category.
557
- - **`HelpSearchResult` is now an alias of `HelpArticleListItem`.** The fictional `matchedChunk` field is gone (the server never returned it). Same category rule as above.
558
- - **`PaginatedResponse<T>.offset` is gone.** Entry list endpoints never returned it; use `page` instead.
559
- - **Translation endpoints now return `EntryTranslationsMap`** (`{ id, slug, locale, title }` keyed by locale), not a full entry map. Fetch the full body with `getBySlug` / `getById` when needed.
560
-
561
605
  ## License
562
606
 
563
607
  MIT
package/dist/index.d.cts CHANGED
@@ -28,7 +28,6 @@ interface PublicConfig {
28
28
  }
29
29
  interface HealthCheckResponse {
30
30
  status: 'ok';
31
- projectId: string;
32
31
  timestamp: string;
33
32
  }
34
33
  type ReactionType = 'fire' | 'heart' | 'rocket' | 'eyes' | 'mindblown';
@@ -63,7 +62,7 @@ interface HelpChatSource {
63
62
  slug: string | null;
64
63
  title: string;
65
64
  visibility: string | null;
66
- metadata: Record<string, NonNullable<unknown>> | null;
65
+ metadata: Record<string, unknown> | null;
67
66
  category: HelpChatSourceCategory | null;
68
67
  }
69
68
  type HelpChatStreamChunk = {
@@ -205,12 +204,15 @@ type AnnouncementType = 'info' | 'warning' | 'critical' | 'promotion' | 'mainten
205
204
  /**
206
205
  * Author shape returned on public entry responses.
207
206
  *
208
- * NOTE: `name` and `image` can be `null` on the server side.
207
+ * NOTE: `name` and `image` can be `null` on the server side. `isTeamMember`
208
+ * is only populated on comment responses (where the server can tell whether
209
+ * the commenter is a project member) — it is not set on entry author fields.
209
210
  */
210
211
  interface EntryAuthor {
211
212
  id: string;
212
213
  name: string | null;
213
214
  image: string | null;
215
+ isTeamMember?: boolean;
214
216
  }
215
217
  interface EntryTag {
216
218
  id: string;
@@ -236,6 +238,19 @@ interface EntryComment {
236
238
  updatedAt: string;
237
239
  author: EntryAuthor;
238
240
  }
241
+ /**
242
+ * Resolved category attached to a public entry response.
243
+ *
244
+ * This is the server's `EntryCategory` row projected down to the fields
245
+ * that are safe/useful to expose publicly.
246
+ */
247
+ interface EntryCategoryRef {
248
+ id: string;
249
+ slug: string;
250
+ name: string;
251
+ icon: string | null;
252
+ description: string | null;
253
+ }
239
254
  /**
240
255
  * Fields that appear on BOTH list and detail entry responses.
241
256
  */
@@ -249,12 +264,13 @@ interface BaseEntry {
249
264
  locale: string;
250
265
  translationGroupId: string;
251
266
  categoryId: string | null;
267
+ category: EntryCategoryRef | null;
252
268
  coverImageUrl: string | null;
253
269
  position: number;
254
270
  views: number;
255
271
  metaTitle: string | null;
256
272
  metaDescription: string | null;
257
- metadata: Record<string, NonNullable<unknown>> | null;
273
+ metadata: Record<string, unknown> | null;
258
274
  reactions: Record<string, number>;
259
275
  createdAt: string;
260
276
  updatedAt: string;
@@ -585,4 +601,4 @@ declare class Kookee {
585
601
  health(): Promise<HealthCheckResponse>;
586
602
  }
587
603
 
588
- export { type AnnouncementDetail, type AnnouncementGetByIdParams, type AnnouncementGetCommentsParams, type AnnouncementListItem, type AnnouncementListParams, AnnouncementModule, type AnnouncementType, type AnnouncementTypeSpecific, type AnyEntryDetail, type AnyEntryListItem, type ApiError, type BaseEntry, type BlogEntryDetail, type BlogEntryListItem, type BlogGetByIdParams, type BlogGetBySlugParams, type BlogGetCommentsParams, type BlogListParams, BlogModule, type BlogTypeSpecific, type ChangelogEntryDetail, type ChangelogEntryListItem, 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 EntryDetailFields, type EntryStatus, type EntryTag, type EntryTagWithCount, type EntryTranslationSummary, type EntryTranslationsMap, type EntryType, type ExternalUser, type FeedbackAssignee, type FeedbackAuthor, type FeedbackColumnType, type FeedbackComment, type FeedbackKanbanColumn, type FeedbackListParams, FeedbackModule, type FeedbackPost, type FeedbackPostCategory, type FeedbackPostListItem, type FeedbackSortOption, type FeedbackTopContributor, type FeedbackTopContributorsParams, type FeedbackVoteParams, type FeedbackVoteResponse, type GenericEntryDetail, type GenericEntryListItem, type HealthCheckResponse, type HelpArticleDetail, type HelpArticleListItem, 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 PageEntryDetail, type PageEntryListItem, 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 TypedEntryDetail, type TypedEntryListItem };
604
+ export { type AnnouncementDetail, type AnnouncementGetByIdParams, type AnnouncementGetCommentsParams, type AnnouncementListItem, type AnnouncementListParams, AnnouncementModule, type AnnouncementType, type AnnouncementTypeSpecific, type AnyEntryDetail, type AnyEntryListItem, type ApiError, type BaseEntry, type BlogEntryDetail, type BlogEntryListItem, type BlogGetByIdParams, type BlogGetBySlugParams, type BlogGetCommentsParams, type BlogListParams, BlogModule, type BlogTypeSpecific, type ChangelogEntryDetail, type ChangelogEntryListItem, 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 EntryCategoryRef, type EntryComment, type EntryDetailFields, type EntryStatus, type EntryTag, type EntryTagWithCount, type EntryTranslationSummary, type EntryTranslationsMap, type EntryType, type ExternalUser, type FeedbackAssignee, type FeedbackAuthor, type FeedbackColumnType, type FeedbackComment, type FeedbackKanbanColumn, type FeedbackListParams, FeedbackModule, type FeedbackPost, type FeedbackPostCategory, type FeedbackPostListItem, type FeedbackSortOption, type FeedbackTopContributor, type FeedbackTopContributorsParams, type FeedbackVoteParams, type FeedbackVoteResponse, type GenericEntryDetail, type GenericEntryListItem, type HealthCheckResponse, type HelpArticleDetail, type HelpArticleListItem, 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 PageEntryDetail, type PageEntryListItem, 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 TypedEntryDetail, type TypedEntryListItem };
package/dist/index.d.ts CHANGED
@@ -28,7 +28,6 @@ interface PublicConfig {
28
28
  }
29
29
  interface HealthCheckResponse {
30
30
  status: 'ok';
31
- projectId: string;
32
31
  timestamp: string;
33
32
  }
34
33
  type ReactionType = 'fire' | 'heart' | 'rocket' | 'eyes' | 'mindblown';
@@ -63,7 +62,7 @@ interface HelpChatSource {
63
62
  slug: string | null;
64
63
  title: string;
65
64
  visibility: string | null;
66
- metadata: Record<string, NonNullable<unknown>> | null;
65
+ metadata: Record<string, unknown> | null;
67
66
  category: HelpChatSourceCategory | null;
68
67
  }
69
68
  type HelpChatStreamChunk = {
@@ -205,12 +204,15 @@ type AnnouncementType = 'info' | 'warning' | 'critical' | 'promotion' | 'mainten
205
204
  /**
206
205
  * Author shape returned on public entry responses.
207
206
  *
208
- * NOTE: `name` and `image` can be `null` on the server side.
207
+ * NOTE: `name` and `image` can be `null` on the server side. `isTeamMember`
208
+ * is only populated on comment responses (where the server can tell whether
209
+ * the commenter is a project member) — it is not set on entry author fields.
209
210
  */
210
211
  interface EntryAuthor {
211
212
  id: string;
212
213
  name: string | null;
213
214
  image: string | null;
215
+ isTeamMember?: boolean;
214
216
  }
215
217
  interface EntryTag {
216
218
  id: string;
@@ -236,6 +238,19 @@ interface EntryComment {
236
238
  updatedAt: string;
237
239
  author: EntryAuthor;
238
240
  }
241
+ /**
242
+ * Resolved category attached to a public entry response.
243
+ *
244
+ * This is the server's `EntryCategory` row projected down to the fields
245
+ * that are safe/useful to expose publicly.
246
+ */
247
+ interface EntryCategoryRef {
248
+ id: string;
249
+ slug: string;
250
+ name: string;
251
+ icon: string | null;
252
+ description: string | null;
253
+ }
239
254
  /**
240
255
  * Fields that appear on BOTH list and detail entry responses.
241
256
  */
@@ -249,12 +264,13 @@ interface BaseEntry {
249
264
  locale: string;
250
265
  translationGroupId: string;
251
266
  categoryId: string | null;
267
+ category: EntryCategoryRef | null;
252
268
  coverImageUrl: string | null;
253
269
  position: number;
254
270
  views: number;
255
271
  metaTitle: string | null;
256
272
  metaDescription: string | null;
257
- metadata: Record<string, NonNullable<unknown>> | null;
273
+ metadata: Record<string, unknown> | null;
258
274
  reactions: Record<string, number>;
259
275
  createdAt: string;
260
276
  updatedAt: string;
@@ -585,4 +601,4 @@ declare class Kookee {
585
601
  health(): Promise<HealthCheckResponse>;
586
602
  }
587
603
 
588
- export { type AnnouncementDetail, type AnnouncementGetByIdParams, type AnnouncementGetCommentsParams, type AnnouncementListItem, type AnnouncementListParams, AnnouncementModule, type AnnouncementType, type AnnouncementTypeSpecific, type AnyEntryDetail, type AnyEntryListItem, type ApiError, type BaseEntry, type BlogEntryDetail, type BlogEntryListItem, type BlogGetByIdParams, type BlogGetBySlugParams, type BlogGetCommentsParams, type BlogListParams, BlogModule, type BlogTypeSpecific, type ChangelogEntryDetail, type ChangelogEntryListItem, 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 EntryDetailFields, type EntryStatus, type EntryTag, type EntryTagWithCount, type EntryTranslationSummary, type EntryTranslationsMap, type EntryType, type ExternalUser, type FeedbackAssignee, type FeedbackAuthor, type FeedbackColumnType, type FeedbackComment, type FeedbackKanbanColumn, type FeedbackListParams, FeedbackModule, type FeedbackPost, type FeedbackPostCategory, type FeedbackPostListItem, type FeedbackSortOption, type FeedbackTopContributor, type FeedbackTopContributorsParams, type FeedbackVoteParams, type FeedbackVoteResponse, type GenericEntryDetail, type GenericEntryListItem, type HealthCheckResponse, type HelpArticleDetail, type HelpArticleListItem, 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 PageEntryDetail, type PageEntryListItem, 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 TypedEntryDetail, type TypedEntryListItem };
604
+ export { type AnnouncementDetail, type AnnouncementGetByIdParams, type AnnouncementGetCommentsParams, type AnnouncementListItem, type AnnouncementListParams, AnnouncementModule, type AnnouncementType, type AnnouncementTypeSpecific, type AnyEntryDetail, type AnyEntryListItem, type ApiError, type BaseEntry, type BlogEntryDetail, type BlogEntryListItem, type BlogGetByIdParams, type BlogGetBySlugParams, type BlogGetCommentsParams, type BlogListParams, BlogModule, type BlogTypeSpecific, type ChangelogEntryDetail, type ChangelogEntryListItem, 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 EntryCategoryRef, type EntryComment, type EntryDetailFields, type EntryStatus, type EntryTag, type EntryTagWithCount, type EntryTranslationSummary, type EntryTranslationsMap, type EntryType, type ExternalUser, type FeedbackAssignee, type FeedbackAuthor, type FeedbackColumnType, type FeedbackComment, type FeedbackKanbanColumn, type FeedbackListParams, FeedbackModule, type FeedbackPost, type FeedbackPostCategory, type FeedbackPostListItem, type FeedbackSortOption, type FeedbackTopContributor, type FeedbackTopContributorsParams, type FeedbackVoteParams, type FeedbackVoteResponse, type GenericEntryDetail, type GenericEntryListItem, type HealthCheckResponse, type HelpArticleDetail, type HelpArticleListItem, 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 PageEntryDetail, type PageEntryListItem, 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 TypedEntryDetail, type TypedEntryListItem };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kookee/sdk",
3
- "version": "0.0.37",
3
+ "version": "0.0.39",
4
4
  "description": "Official Kookee SDK - Access your blog, changelog, help center, and more",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",