@se-studio/search 0.0.0-next16-20260822103555
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 +1352 -0
- package/README.md +255 -0
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +2 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/route-handler.d.ts +71 -0
- package/dist/api/route-handler.d.ts.map +1 -0
- package/dist/api/route-handler.js +160 -0
- package/dist/api/route-handler.js.map +1 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +2 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/search-client.d.ts +12 -0
- package/dist/client/search-client.d.ts.map +1 -0
- package/dist/client/search-client.js +72 -0
- package/dist/client/search-client.js.map +1 -0
- package/dist/debug.d.ts +2 -0
- package/dist/debug.d.ts.map +1 -0
- package/dist/debug.js +12 -0
- package/dist/debug.js.map +1 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +2 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/useSearch.d.ts +26 -0
- package/dist/hooks/useSearch.d.ts.map +1 -0
- package/dist/hooks/useSearch.js +73 -0
- package/dist/hooks/useSearch.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/indexable-content.d.ts +24 -0
- package/dist/indexable-content.d.ts.map +1 -0
- package/dist/indexable-content.js +2 -0
- package/dist/indexable-content.js.map +1 -0
- package/dist/indexing/article-indexable.d.ts +48 -0
- package/dist/indexing/article-indexable.d.ts.map +1 -0
- package/dist/indexing/article-indexable.js +93 -0
- package/dist/indexing/article-indexable.js.map +1 -0
- package/dist/indexing/content-extractor.d.ts +20 -0
- package/dist/indexing/content-extractor.d.ts.map +1 -0
- package/dist/indexing/content-extractor.js +55 -0
- package/dist/indexing/content-extractor.js.map +1 -0
- package/dist/indexing/document-builder.d.ts +33 -0
- package/dist/indexing/document-builder.d.ts.map +1 -0
- package/dist/indexing/document-builder.js +118 -0
- package/dist/indexing/document-builder.js.map +1 -0
- package/dist/indexing/index.d.ts +7 -0
- package/dist/indexing/index.d.ts.map +1 -0
- package/dist/indexing/index.js +6 -0
- package/dist/indexing/index.js.map +1 -0
- package/dist/indexing/readability.d.ts +14 -0
- package/dist/indexing/readability.d.ts.map +1 -0
- package/dist/indexing/readability.js +45 -0
- package/dist/indexing/readability.js.map +1 -0
- package/dist/indexing/rebuild.d.ts +21 -0
- package/dist/indexing/rebuild.d.ts.map +1 -0
- package/dist/indexing/rebuild.js +141 -0
- package/dist/indexing/rebuild.js.map +1 -0
- package/dist/rate-limit/check.d.ts +19 -0
- package/dist/rate-limit/check.d.ts.map +1 -0
- package/dist/rate-limit/check.js +88 -0
- package/dist/rate-limit/check.js.map +1 -0
- package/dist/rate-limit/index.d.ts +5 -0
- package/dist/rate-limit/index.d.ts.map +1 -0
- package/dist/rate-limit/index.js +4 -0
- package/dist/rate-limit/index.js.map +1 -0
- package/dist/rate-limit/ip.d.ts +5 -0
- package/dist/rate-limit/ip.d.ts.map +1 -0
- package/dist/rate-limit/ip.js +19 -0
- package/dist/rate-limit/ip.js.map +1 -0
- package/dist/rate-limit/memory-store.d.ts +18 -0
- package/dist/rate-limit/memory-store.d.ts.map +1 -0
- package/dist/rate-limit/memory-store.js +35 -0
- package/dist/rate-limit/memory-store.js.map +1 -0
- package/dist/rate-limit/types.d.ts +43 -0
- package/dist/rate-limit/types.d.ts.map +1 -0
- package/dist/rate-limit/types.js +2 -0
- package/dist/rate-limit/types.js.map +1 -0
- package/dist/types.d.ts +122 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/webhook/handler.d.ts +33 -0
- package/dist/webhook/handler.d.ts.map +1 -0
- package/dist/webhook/handler.js +141 -0
- package/dist/webhook/handler.js.map +1 -0
- package/dist/webhook/index.d.ts +2 -0
- package/dist/webhook/index.d.ts.map +1 -0
- package/dist/webhook/index.js +2 -0
- package/dist/webhook/index.js.map +1 -0
- package/docs/llms.md +136 -0
- package/package.json +75 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAC;AAE1E;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,YAAY,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,mDAAmD;AACnD,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,SAAS,GAAG,QAAQ,GAAG,aAAa,GAAG,YAAY,CAAC;AAEjG;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,OAAO,CAAC;CAC7B;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,iBAAiB,CAAC;IAC/B,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,iFAAiF;IACjF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,2DAA2D;IAC3D,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;OAOG;IACH,mBAAmB,CAAC,EAAE,CAAC,GAAG,EAAE,cAAc,EAAE,WAAW,EAAE,WAAW,KAAK,cAAc,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;IACd,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { BaseConverterContext, ContentfulConfig, FetchOptions, UrlCalculators } from '@se-studio/contentful-rest-api';
|
|
2
|
+
import type { MarkdownItemConverter, SiteConfig } from '@se-studio/markdown-renderer/converter';
|
|
3
|
+
import type { SearchIndexingConfig } from '../types';
|
|
4
|
+
export interface SearchWebhookConfig {
|
|
5
|
+
indexingConfig: SearchIndexingConfig;
|
|
6
|
+
converterContext: BaseConverterContext;
|
|
7
|
+
contentfulConfig: ContentfulConfig;
|
|
8
|
+
urlCalculators: UrlCalculators;
|
|
9
|
+
siteConfig: SiteConfig;
|
|
10
|
+
fetchOptions: FetchOptions;
|
|
11
|
+
/** Optional custom converters for markdown generation (e.g. for custom data types like 'plan'). */
|
|
12
|
+
customConverters?: Record<string, MarkdownItemConverter>;
|
|
13
|
+
}
|
|
14
|
+
export interface SearchWebhookHandler {
|
|
15
|
+
/**
|
|
16
|
+
* Called when an entry is published or updated in Contentful.
|
|
17
|
+
* Fetches the full entry, converts it to a search document, and upserts
|
|
18
|
+
* into both published and preview indexes.
|
|
19
|
+
*/
|
|
20
|
+
onPublish(contentType: string, entryId: string, slug?: string): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Called when an entry is deleted or unpublished in Contentful.
|
|
23
|
+
* Removes the entry from both indexes by ID.
|
|
24
|
+
*/
|
|
25
|
+
onDelete(contentType: string, entryId: string): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Creates a webhook handler for incremental search index updates.
|
|
29
|
+
* Call `onPublish` after cache revalidation completes for published entries,
|
|
30
|
+
* and `onDelete` for deleted/unpublished entries.
|
|
31
|
+
*/
|
|
32
|
+
export declare function createSearchWebhookHandler(config: SearchWebhookConfig): SearchWebhookHandler;
|
|
33
|
+
//# sourceMappingURL=handler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../src/webhook/handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACf,MAAM,gCAAgC,CAAC;AAGxC,OAAO,KAAK,EAEV,qBAAqB,EACrB,UAAU,EACX,MAAM,wCAAwC,CAAC;AAIhD,OAAO,KAAK,EAAkB,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAErE,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,oBAAoB,CAAC;IACrC,gBAAgB,EAAE,oBAAoB,CAAC;IACvC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,cAAc,EAAE,cAAc,CAAC;IAC/B,UAAU,EAAE,UAAU,CAAC;IACvB,YAAY,EAAE,YAAY,CAAC;IAC3B,mGAAmG;IACnG,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;CAC1D;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9E;;;OAGG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/D;AAgBD;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,mBAAmB,GAAG,oBAAoB,CAsJ5F"}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { MarkdownExporter } from '@se-studio/markdown-renderer';
|
|
2
|
+
import { createSearchClient } from '../client/search-client';
|
|
3
|
+
import { debugLog } from '../debug';
|
|
4
|
+
import { allChunkIds, buildSearchDocuments, shouldIndex } from '../indexing/document-builder';
|
|
5
|
+
/** Safety ceiling for chunk cleanup — delete up to this many chunk IDs per entry. */
|
|
6
|
+
const MAX_CHUNKS_CLEANUP = 20;
|
|
7
|
+
function mapContentfulTypeToExporterType(contentType) {
|
|
8
|
+
if (contentType === 'page' || contentType === 'pageVariant')
|
|
9
|
+
return 'page';
|
|
10
|
+
if (contentType === 'article')
|
|
11
|
+
return 'article';
|
|
12
|
+
if (contentType === 'articleType')
|
|
13
|
+
return 'articleType';
|
|
14
|
+
if (contentType === 'person')
|
|
15
|
+
return 'person';
|
|
16
|
+
if (contentType === 'customType')
|
|
17
|
+
return 'customType';
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates a webhook handler for incremental search index updates.
|
|
22
|
+
* Call `onPublish` after cache revalidation completes for published entries,
|
|
23
|
+
* and `onDelete` for deleted/unpublished entries.
|
|
24
|
+
*/
|
|
25
|
+
export function createSearchWebhookHandler(config) {
|
|
26
|
+
const { indexingConfig, converterContext, contentfulConfig, urlCalculators, siteConfig, fetchOptions, } = config;
|
|
27
|
+
const { connection, publishedIndexName, previewIndexName } = indexingConfig.searchIndex;
|
|
28
|
+
const client = createSearchClient(connection);
|
|
29
|
+
// Minimal content context for indexing — page-specific fields (article, person, etc.)
|
|
30
|
+
// are not needed since the MarkdownExporter fetches each entry independently.
|
|
31
|
+
const indexingContentContext = {
|
|
32
|
+
pageContext: {},
|
|
33
|
+
current: { type: 'Component', id: '' },
|
|
34
|
+
};
|
|
35
|
+
const converterCtx = {
|
|
36
|
+
contentContext: indexingContentContext,
|
|
37
|
+
config: contentfulConfig,
|
|
38
|
+
siteConfig,
|
|
39
|
+
urlCalculators,
|
|
40
|
+
primaryTagSelector: converterContext?.primaryTagSelector,
|
|
41
|
+
customConverters: config.customConverters,
|
|
42
|
+
};
|
|
43
|
+
function isEnabled(contentType) {
|
|
44
|
+
const mapped = mapContentfulTypeToExporterType(contentType);
|
|
45
|
+
if (!mapped)
|
|
46
|
+
return false;
|
|
47
|
+
return indexingConfig.contentTypes.some((ct) => ct.type === mapped && ct.enabled);
|
|
48
|
+
}
|
|
49
|
+
function getConfig(contentType) {
|
|
50
|
+
const mapped = mapContentfulTypeToExporterType(contentType);
|
|
51
|
+
if (!mapped)
|
|
52
|
+
return undefined;
|
|
53
|
+
return indexingConfig.contentTypes.find((ct) => ct.type === mapped && ct.enabled);
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
async onPublish(contentType, entryId, slug) {
|
|
57
|
+
debugLog('webhook', `onPublish called`, { contentType, entryId, slug });
|
|
58
|
+
if (!isEnabled(contentType) || !slug) {
|
|
59
|
+
debugLog('webhook', `onPublish: skipped (enabled=${isEnabled(contentType)}, slug="${slug}")`);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const ctConfig = getConfig(contentType);
|
|
63
|
+
if (!ctConfig) {
|
|
64
|
+
debugLog('webhook', `onPublish: no config for "${contentType}"`);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
const exporterType = mapContentfulTypeToExporterType(contentType);
|
|
68
|
+
if (!exporterType) {
|
|
69
|
+
debugLog('webhook', `onPublish: unsupported type "${contentType}"`);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
try {
|
|
73
|
+
debugLog('webhook', `onPublish: fetching content for ${exporterType}/${slug}`);
|
|
74
|
+
const exporter = new MarkdownExporter(contentfulConfig, converterContext, fetchOptions);
|
|
75
|
+
const contentData = await exporter.fetchContent(exporterType, slug);
|
|
76
|
+
if (!contentData) {
|
|
77
|
+
debugLog('webhook', `onPublish: no content data for ${exporterType}/${slug}`);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
const data = contentData.data;
|
|
81
|
+
const respectIndexed = indexingConfig.respectIndexedFlag ?? true;
|
|
82
|
+
const respectHidden = indexingConfig.respectHiddenFlag ?? true;
|
|
83
|
+
if (!shouldIndex(data, respectIndexed, respectHidden)) {
|
|
84
|
+
debugLog('webhook', `onPublish: entry not indexable, deleting from indexes`, {
|
|
85
|
+
indexed: data.indexed,
|
|
86
|
+
hidden: data.hidden,
|
|
87
|
+
});
|
|
88
|
+
const cleanupIds = allChunkIds(entryId, MAX_CHUNKS_CLEANUP);
|
|
89
|
+
await client.delete(publishedIndexName, cleanupIds);
|
|
90
|
+
await client.delete(previewIndexName, cleanupIds);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const includeComponents = ctConfig.includeComponents ?? indexingConfig.indexComponents ?? true;
|
|
94
|
+
const docs = buildSearchDocuments(contentData, ctConfig.type, converterCtx, includeComponents);
|
|
95
|
+
const { documentTransformer } = indexingConfig;
|
|
96
|
+
const transformedDocs = documentTransformer
|
|
97
|
+
? docs
|
|
98
|
+
.map((doc) => documentTransformer(doc, contentData))
|
|
99
|
+
.filter((doc) => doc !== null)
|
|
100
|
+
: docs;
|
|
101
|
+
// Clean up any stale chunks from a previous version that may have had more chunks
|
|
102
|
+
const cleanupIds = allChunkIds(entryId, MAX_CHUNKS_CLEANUP);
|
|
103
|
+
debugLog('webhook', `onPublish: cleaning up old chunks (up to ${MAX_CHUNKS_CLEANUP})`);
|
|
104
|
+
await client.delete(publishedIndexName, cleanupIds);
|
|
105
|
+
await client.delete(previewIndexName, cleanupIds);
|
|
106
|
+
debugLog('webhook', `onPublish: upserting ${transformedDocs.length} chunk(s)`, {
|
|
107
|
+
indexes: [publishedIndexName, previewIndexName],
|
|
108
|
+
title: transformedDocs[0]?.content.title,
|
|
109
|
+
});
|
|
110
|
+
await client.upsert(publishedIndexName, transformedDocs);
|
|
111
|
+
await client.upsert(previewIndexName, transformedDocs);
|
|
112
|
+
debugLog('webhook', `onPublish: done for ${contentType}/${slug}`);
|
|
113
|
+
}
|
|
114
|
+
catch (err) {
|
|
115
|
+
debugLog('webhook', `onPublish: ERROR for ${contentType}/${slug}`, { error: String(err) });
|
|
116
|
+
console.error(`[search] Failed to index ${contentType}/${slug}:`, err);
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
async onDelete(contentType, entryId) {
|
|
120
|
+
debugLog('webhook', `onDelete called`, { contentType, entryId });
|
|
121
|
+
if (!mapContentfulTypeToExporterType(contentType)) {
|
|
122
|
+
debugLog('webhook', `onDelete: unsupported type "${contentType}", skipping`);
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
try {
|
|
126
|
+
const cleanupIds = allChunkIds(entryId, MAX_CHUNKS_CLEANUP);
|
|
127
|
+
debugLog('webhook', `onDelete: deleting ${entryId} + chunk IDs from indexes (${cleanupIds.length} ids)`);
|
|
128
|
+
await client.delete(publishedIndexName, cleanupIds);
|
|
129
|
+
await client.delete(previewIndexName, cleanupIds);
|
|
130
|
+
debugLog('webhook', `onDelete: done for ${contentType}/${entryId}`);
|
|
131
|
+
}
|
|
132
|
+
catch (err) {
|
|
133
|
+
debugLog('webhook', `onDelete: ERROR for ${contentType}/${entryId}`, {
|
|
134
|
+
error: String(err),
|
|
135
|
+
});
|
|
136
|
+
console.error(`[search] Failed to delete ${contentType}/${entryId}:`, err);
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/webhook/handler.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,gBAAgB,EA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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/webhook/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,EAC1B,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,GAC1B,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/webhook/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,0BAA0B,GAG3B,MAAM,WAAW,CAAC"}
|
package/docs/llms.md
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# @se-studio/search — LLM Reference
|
|
2
|
+
|
|
3
|
+
AI-powered site search using Upstash Search (vector + keyword hybrid). Indexes Contentful pages, articles, persons, and custom types. Provides Next.js API route handlers for search queries and index rebuilds.
|
|
4
|
+
|
|
5
|
+
## Required Environment Variables
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
UPSTASH_SEARCH_REST_URL=https://...
|
|
9
|
+
UPSTASH_SEARCH_REST_TOKEN=...
|
|
10
|
+
|
|
11
|
+
# Optional: rate-limit billable queries (default 10 per 60s per IP; 0 = disable)
|
|
12
|
+
# SEARCH_RATE_LIMIT_MAX=10
|
|
13
|
+
# SEARCH_RATE_LIMIT_WINDOW_MS=60000
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Multi-tenant (shared SE database)
|
|
17
|
+
|
|
18
|
+
Prefer **one** Upstash Search DB (`upstash-search-shared`) for SE marketing sites. Isolate with **index names** only: `{site}-published` / `{site}-preview` (e.g. `hsd-published`, `pedestal-preview`). Never bare `published`/`preview` on the shared DB. Full registry: `docs/UPSTASH_SEARCH_SHARED.md`.
|
|
19
|
+
|
|
20
|
+
## Rate limiting (public API + MCP)
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
import { checkSearchRateLimit, searchRateLimitHeaders } from '@se-studio/search/rate-limit';
|
|
24
|
+
|
|
25
|
+
// createSearchApiHandler enables this by default (namespace "api").
|
|
26
|
+
// Empty q does not consume budget. Denied → HTTP 429 + Retry-After.
|
|
27
|
+
|
|
28
|
+
// For MCP inject (site-mcp tools.search.checkRateLimit):
|
|
29
|
+
checkRateLimit: (request) => checkSearchRateLimit({ request, namespace: 'mcp' }),
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Namespaces `api` vs `mcp` have separate counters per IP. Memory store is per-isolate (Vercel).
|
|
33
|
+
|
|
34
|
+
## Key Types
|
|
35
|
+
|
|
36
|
+
```ts
|
|
37
|
+
import type {
|
|
38
|
+
SearchConfig, // { url, token } — Upstash connection
|
|
39
|
+
SearchIndexConfig, // { connection, publishedIndexName, previewIndexName }
|
|
40
|
+
SearchIndexingConfig, // full config passed to rebuildSearchIndex / webhook handler
|
|
41
|
+
SearchableContentType, // 'page' | 'article' | 'person' | 'articleType' | 'customType'
|
|
42
|
+
ContentTypeIndexConfig, // { type, enabled, includeComponents? }
|
|
43
|
+
SearchDocument, // { id, content: { title, description, body }, metadata }
|
|
44
|
+
SearchDocumentMetadata, // { type, slug, href, tags?, date?, imageUrl?, entryId, ... }
|
|
45
|
+
SearchResult, // SearchDocument + score
|
|
46
|
+
SearchResponse, // { results, query, totalCount }
|
|
47
|
+
SearchOptions, // { query, limit?, filter?, semanticWeight? }
|
|
48
|
+
RebuildResult, // { indexed, skipped, errors }
|
|
49
|
+
} from '@se-studio/search';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Full Index Rebuild
|
|
53
|
+
|
|
54
|
+
Rebuilds the entire published (or preview) search index from Contentful:
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
import { rebuildSearchIndex } from '@se-studio/search';
|
|
58
|
+
|
|
59
|
+
const result = await rebuildSearchIndex({
|
|
60
|
+
contentfulConfig, // ContentfulConfig from @se-studio/contentful-rest-api
|
|
61
|
+
indexingConfig, // SearchIndexingConfig
|
|
62
|
+
preview: false, // true to rebuild the preview index
|
|
63
|
+
});
|
|
64
|
+
// result: { indexed: number, skipped: number, errors: string[] }
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Incremental Updates via Webhook
|
|
68
|
+
|
|
69
|
+
Creates a handler for Contentful webhooks to update the index on content changes:
|
|
70
|
+
|
|
71
|
+
```ts
|
|
72
|
+
import { createSearchWebhookHandler } from '@se-studio/search';
|
|
73
|
+
|
|
74
|
+
const handler = createSearchWebhookHandler({
|
|
75
|
+
contentfulConfig,
|
|
76
|
+
indexingConfig,
|
|
77
|
+
secret: process.env.WEBHOOK_SECRET!,
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
// In a Next.js API route:
|
|
81
|
+
export const POST = handler.handle;
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
## Search API Route Handlers
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import { createSearchApiHandler, createRebuildApiHandler } from '@se-studio/search';
|
|
88
|
+
|
|
89
|
+
// Search endpoint (GET /api/search?q=...)
|
|
90
|
+
export const GET = createSearchApiHandler({
|
|
91
|
+
searchConfig: { url: process.env.UPSTASH_SEARCH_REST_URL!, token: process.env.UPSTASH_SEARCH_REST_TOKEN! },
|
|
92
|
+
publishedIndexName: 'published',
|
|
93
|
+
previewIndexName: 'preview',
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
// Rebuild endpoint (POST /api/search/rebuild)
|
|
97
|
+
export const POST = createRebuildApiHandler({
|
|
98
|
+
contentfulConfig,
|
|
99
|
+
indexingConfig,
|
|
100
|
+
secret: process.env.REBUILD_SECRET!,
|
|
101
|
+
});
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## SearchIndexingConfig Shape
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
const indexingConfig: SearchIndexingConfig = {
|
|
108
|
+
searchIndex: {
|
|
109
|
+
connection: { url: '...', token: '...' },
|
|
110
|
+
publishedIndexName: 'my-site-published',
|
|
111
|
+
previewIndexName: 'my-site-preview',
|
|
112
|
+
},
|
|
113
|
+
contentTypes: [
|
|
114
|
+
{ type: 'page', enabled: true },
|
|
115
|
+
{ type: 'article', enabled: true },
|
|
116
|
+
{ type: 'person', enabled: false },
|
|
117
|
+
],
|
|
118
|
+
indexComponents: true, // extract text from nested components (default: true)
|
|
119
|
+
respectIndexedFlag: true, // skip entries with indexed === false (default: true)
|
|
120
|
+
respectHiddenFlag: true, // skip entries with hidden === true (default: true)
|
|
121
|
+
documentTransformer: (doc, contentData) => {
|
|
122
|
+
// optionally patch doc.metadata before upsert, or return null to drop
|
|
123
|
+
return doc;
|
|
124
|
+
},
|
|
125
|
+
};
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Deduplication
|
|
129
|
+
|
|
130
|
+
Search results can contain multiple chunks from the same entry. Use `deduplicateChunks` to collapse them:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
import { deduplicateChunks } from '@se-studio/search';
|
|
134
|
+
|
|
135
|
+
const deduped = deduplicateChunks(results); // keeps highest-score chunk per entry
|
|
136
|
+
```
|
package/package.json
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@se-studio/search",
|
|
3
|
+
"version": "0.0.0-next16-20260822103555",
|
|
4
|
+
"description": "AI-powered site search with Upstash Search for Next.js marketing sites",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/Something-Else-Studio/se-core-product",
|
|
8
|
+
"directory": "packages/search"
|
|
9
|
+
},
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"type": "module",
|
|
12
|
+
"main": "./dist/index.js",
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./client": {
|
|
20
|
+
"types": "./dist/client/index.d.ts",
|
|
21
|
+
"import": "./dist/client/index.js"
|
|
22
|
+
},
|
|
23
|
+
"./indexing": {
|
|
24
|
+
"types": "./dist/indexing/index.d.ts",
|
|
25
|
+
"import": "./dist/indexing/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./webhook": {
|
|
28
|
+
"types": "./dist/webhook/index.d.ts",
|
|
29
|
+
"import": "./dist/webhook/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./api": {
|
|
32
|
+
"types": "./dist/api/index.d.ts",
|
|
33
|
+
"import": "./dist/api/index.js"
|
|
34
|
+
},
|
|
35
|
+
"./rate-limit": {
|
|
36
|
+
"types": "./dist/rate-limit/index.d.ts",
|
|
37
|
+
"import": "./dist/rate-limit/index.js"
|
|
38
|
+
},
|
|
39
|
+
"./hooks": {
|
|
40
|
+
"types": "./dist/hooks/index.d.ts",
|
|
41
|
+
"import": "./dist/hooks/index.js"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"files": [
|
|
45
|
+
"dist",
|
|
46
|
+
"*.md",
|
|
47
|
+
"docs"
|
|
48
|
+
],
|
|
49
|
+
"dependencies": {
|
|
50
|
+
"@upstash/search": "^0.1.7",
|
|
51
|
+
"@se-studio/contentful-rest-api": "0.0.0-next16-20260822103555",
|
|
52
|
+
"@se-studio/core-data-types": "1.12.0",
|
|
53
|
+
"@se-studio/markdown-renderer": "0.0.0-next16-20260822103555"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"next": ">=15.5.0 <17",
|
|
57
|
+
"react": "^19.0.0"
|
|
58
|
+
},
|
|
59
|
+
"devDependencies": {
|
|
60
|
+
"@biomejs/biome": "^2.5.5",
|
|
61
|
+
"@types/node": "^24.13.3",
|
|
62
|
+
"@types/react": "^19.2.17",
|
|
63
|
+
"next": "^16.3.1",
|
|
64
|
+
"typescript": "^6.0.3",
|
|
65
|
+
"vitest": "^4.1.10"
|
|
66
|
+
},
|
|
67
|
+
"scripts": {
|
|
68
|
+
"build": "tsc --project tsconfig.build.json",
|
|
69
|
+
"dev": "tsc --project tsconfig.build.json --watch",
|
|
70
|
+
"type-check": "tsc --noEmit",
|
|
71
|
+
"lint": "biome lint .",
|
|
72
|
+
"test": "vitest run",
|
|
73
|
+
"clean": "rm -rf dist .turbo *.tsbuildinfo"
|
|
74
|
+
}
|
|
75
|
+
}
|