@kookee/sdk 0.0.40 → 0.0.41

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
@@ -125,8 +125,11 @@ const articles = await kookee.help.list({ page: 1, limit: 10 });
125
125
  // Filter by category slug
126
126
  const categoryArticles = await kookee.help.list({ category: 'getting-started' });
127
127
 
128
- // Semantic search
128
+ // Semantic search — results include a matched text snippet when available
129
129
  const results = await kookee.help.search({ query: 'how to reset password', limit: 5 });
130
+ for (const result of results) {
131
+ console.log(result.title, result.matchedChunk); // matched text snippet or null
132
+ }
130
133
 
131
134
  // Get single article
132
135
  const article = await kookee.help.getBySlug('getting-started');
@@ -392,7 +395,8 @@ interface PaginatedResponse<T> {
392
395
 
393
396
  Entry endpoints come in two flavours with **different shapes**:
394
397
 
395
- - **List responses** (`blog.list()`, `help.search()`, `entries.list()`, …) return `*ListItem` types — these do **not** include `contentHtml`. Use `excerptHtml` instead for previews.
398
+ - **List responses** (`blog.list()`, `entries.list()`, …) return `*ListItem` types — these do **not** include `contentHtml`. Use `excerptHtml` instead for previews.
399
+ - **Search responses** (`help.search()`) return `HelpSearchResult` which extends the list item with `matchedChunk: string | null` — a plain-text snippet from the best matching section of the article.
396
400
  - **Detail responses** (`blog.getBySlug()`, `help.getById()`, …) return `*Detail` types — these include `contentHtml` for full content rendering.
397
401
 
398
402
  ```typescript
package/dist/index.d.cts CHANGED
@@ -360,12 +360,13 @@ type AnyEntryDetail = TypedEntryDetail | GenericEntryDetail;
360
360
  /**
361
361
  * Help search result — returned by `GET /v1/help/search`.
362
362
  *
363
- * The server returns the exact same shape as a help article list response,
364
- * so we alias it to `HelpArticleListItem`. There is no nested `category`
365
- * object or `matchedChunk` field on this response (SDK <= 0.0.36 lied
366
- * about both).
363
+ * Extends `HelpArticleListItem` with `matchedChunk` a plain-text snippet
364
+ * from the article that best matched the search query (via embedding similarity).
365
+ * When the server falls back to text search, `matchedChunk` is `null`.
367
366
  */
368
- type HelpSearchResult = HelpArticleListItem;
367
+ interface HelpSearchResult extends HelpArticleListItem {
368
+ matchedChunk: string | null;
369
+ }
369
370
  /**
370
371
  * Translation summary returned by the translations endpoints.
371
372
  *
package/dist/index.d.ts CHANGED
@@ -360,12 +360,13 @@ type AnyEntryDetail = TypedEntryDetail | GenericEntryDetail;
360
360
  /**
361
361
  * Help search result — returned by `GET /v1/help/search`.
362
362
  *
363
- * The server returns the exact same shape as a help article list response,
364
- * so we alias it to `HelpArticleListItem`. There is no nested `category`
365
- * object or `matchedChunk` field on this response (SDK <= 0.0.36 lied
366
- * about both).
363
+ * Extends `HelpArticleListItem` with `matchedChunk` a plain-text snippet
364
+ * from the article that best matched the search query (via embedding similarity).
365
+ * When the server falls back to text search, `matchedChunk` is `null`.
367
366
  */
368
- type HelpSearchResult = HelpArticleListItem;
367
+ interface HelpSearchResult extends HelpArticleListItem {
368
+ matchedChunk: string | null;
369
+ }
369
370
  /**
370
371
  * Translation summary returned by the translations endpoints.
371
372
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kookee/sdk",
3
- "version": "0.0.40",
3
+ "version": "0.0.41",
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",