@kookee/sdk 0.0.37 → 0.0.38

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
@@ -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,
@@ -548,16 +569,6 @@ import type {
548
569
  } from '@kookee/sdk';
549
570
  ```
550
571
 
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
572
  ## License
562
573
 
563
574
  MIT
package/dist/index.d.cts CHANGED
@@ -236,6 +236,19 @@ interface EntryComment {
236
236
  updatedAt: string;
237
237
  author: EntryAuthor;
238
238
  }
239
+ /**
240
+ * Resolved category attached to a public entry response.
241
+ *
242
+ * This is the server's `EntryCategory` row projected down to the fields
243
+ * that are safe/useful to expose publicly.
244
+ */
245
+ interface EntryCategoryRef {
246
+ id: string;
247
+ slug: string;
248
+ name: string;
249
+ icon: string | null;
250
+ description: string | null;
251
+ }
239
252
  /**
240
253
  * Fields that appear on BOTH list and detail entry responses.
241
254
  */
@@ -249,6 +262,7 @@ interface BaseEntry {
249
262
  locale: string;
250
263
  translationGroupId: string;
251
264
  categoryId: string | null;
265
+ category: EntryCategoryRef | null;
252
266
  coverImageUrl: string | null;
253
267
  position: number;
254
268
  views: number;
@@ -585,4 +599,4 @@ declare class Kookee {
585
599
  health(): Promise<HealthCheckResponse>;
586
600
  }
587
601
 
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 };
602
+ 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
@@ -236,6 +236,19 @@ interface EntryComment {
236
236
  updatedAt: string;
237
237
  author: EntryAuthor;
238
238
  }
239
+ /**
240
+ * Resolved category attached to a public entry response.
241
+ *
242
+ * This is the server's `EntryCategory` row projected down to the fields
243
+ * that are safe/useful to expose publicly.
244
+ */
245
+ interface EntryCategoryRef {
246
+ id: string;
247
+ slug: string;
248
+ name: string;
249
+ icon: string | null;
250
+ description: string | null;
251
+ }
239
252
  /**
240
253
  * Fields that appear on BOTH list and detail entry responses.
241
254
  */
@@ -249,6 +262,7 @@ interface BaseEntry {
249
262
  locale: string;
250
263
  translationGroupId: string;
251
264
  categoryId: string | null;
265
+ category: EntryCategoryRef | null;
252
266
  coverImageUrl: string | null;
253
267
  position: number;
254
268
  views: number;
@@ -585,4 +599,4 @@ declare class Kookee {
585
599
  health(): Promise<HealthCheckResponse>;
586
600
  }
587
601
 
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 };
602
+ 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.38",
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",