@rubixstudios/payload-typesense 1.1.1 → 1.1.2

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.
Files changed (102) hide show
  1. package/README.md +1 -17
  2. package/dist/components/HeadlessSearchInput.d.ts +2 -92
  3. package/dist/components/HeadlessSearchInput.d.ts.map +1 -1
  4. package/dist/components/HeadlessSearchInput.js +23 -140
  5. package/dist/components/ThemeProvider.d.ts +3 -2
  6. package/dist/components/ThemeProvider.d.ts.map +1 -1
  7. package/dist/components/ThemeProvider.js +1 -1
  8. package/dist/components/index.d.ts +5 -5
  9. package/dist/components/index.d.ts.map +1 -1
  10. package/dist/components/index.js +3 -3
  11. package/dist/components/themes/hooks.d.ts +5 -5
  12. package/dist/components/themes/hooks.d.ts.map +1 -1
  13. package/dist/components/themes/hooks.js +16 -16
  14. package/dist/components/themes/index.d.ts +4 -4
  15. package/dist/components/themes/index.js +4 -4
  16. package/dist/components/themes/themes.d.ts +1 -1
  17. package/dist/components/themes/themes.d.ts.map +1 -1
  18. package/dist/components/themes/themes.js +109 -109
  19. package/dist/components/themes/types.d.ts.map +1 -1
  20. package/dist/components/themes/utils.d.ts +1 -1
  21. package/dist/components/themes/utils.d.ts.map +1 -1
  22. package/dist/components/themes/utils.js +140 -140
  23. package/dist/endpoints/handler/createAdvancedSearch.d.ts +5 -0
  24. package/dist/endpoints/handler/createAdvancedSearch.d.ts.map +1 -0
  25. package/dist/endpoints/handler/createAdvancedSearch.js +40 -0
  26. package/dist/endpoints/handler/createCollections.d.ts +4 -0
  27. package/dist/endpoints/handler/createCollections.d.ts.map +1 -0
  28. package/dist/endpoints/handler/createCollections.js +23 -0
  29. package/dist/endpoints/handler/createSearch.d.ts +5 -0
  30. package/dist/endpoints/handler/createSearch.d.ts.map +1 -0
  31. package/dist/endpoints/handler/createSearch.js +119 -0
  32. package/dist/endpoints/handler/createSuggest.d.ts +5 -0
  33. package/dist/endpoints/handler/createSuggest.d.ts.map +1 -0
  34. package/dist/endpoints/handler/createSuggest.js +50 -0
  35. package/dist/endpoints/health.d.ts +4 -10
  36. package/dist/endpoints/health.d.ts.map +1 -1
  37. package/dist/endpoints/health.js +45 -103
  38. package/dist/endpoints/search.d.ts +4 -5
  39. package/dist/endpoints/search.d.ts.map +1 -1
  40. package/dist/endpoints/search.js +26 -355
  41. package/dist/index.d.ts +3 -3
  42. package/dist/index.d.ts.map +1 -1
  43. package/dist/index.js +6 -101
  44. package/dist/lib/cache.d.ts +6 -27
  45. package/dist/lib/cache.d.ts.map +1 -1
  46. package/dist/lib/cache.js +11 -29
  47. package/dist/lib/client.d.ts +4 -0
  48. package/dist/lib/client.d.ts.map +1 -0
  49. package/dist/lib/{typesense-client.js → client.js} +10 -18
  50. package/dist/lib/headlessSearch.d.ts +89 -0
  51. package/dist/lib/headlessSearch.d.ts.map +1 -0
  52. package/dist/lib/headlessSearch.js +2 -0
  53. package/dist/lib/hooks.d.ts +12 -3
  54. package/dist/lib/hooks.d.ts.map +1 -1
  55. package/dist/lib/hooks.js +37 -37
  56. package/dist/lib/initialization.d.ts +3 -3
  57. package/dist/lib/initialization.d.ts.map +1 -1
  58. package/dist/lib/initialization.js +36 -49
  59. package/dist/lib/schema-mapper.d.ts +17 -7
  60. package/dist/lib/schema-mapper.d.ts.map +1 -1
  61. package/dist/lib/schema-mapper.js +53 -89
  62. package/dist/lib/{config-validation.d.ts → validation.d.ts} +18 -22
  63. package/dist/lib/validation.d.ts.map +1 -0
  64. package/dist/lib/{config-validation.js → validation.js} +32 -49
  65. package/dist/{lib/types.d.ts → types.d.ts} +22 -5
  66. package/dist/types.d.ts.map +1 -0
  67. package/dist/utils/buildError.d.ts +2 -0
  68. package/dist/utils/buildError.d.ts.map +1 -0
  69. package/dist/utils/buildError.js +10 -0
  70. package/dist/utils/ensureCollection.d.ts +3 -0
  71. package/dist/utils/ensureCollection.d.ts.map +1 -0
  72. package/dist/utils/ensureCollection.js +13 -0
  73. package/dist/utils/extractText.d.ts +2 -0
  74. package/dist/utils/extractText.d.ts.map +1 -0
  75. package/dist/utils/extractText.js +20 -0
  76. package/dist/utils/getAllCollections.d.ts +9 -0
  77. package/dist/utils/getAllCollections.d.ts.map +1 -0
  78. package/dist/utils/getAllCollections.js +84 -0
  79. package/dist/utils/getCacheStats.d.ts +6 -0
  80. package/dist/utils/getCacheStats.d.ts.map +1 -0
  81. package/dist/utils/getCacheStats.js +9 -0
  82. package/dist/utils/getCollectionInfo.d.ts +3 -0
  83. package/dist/utils/getCollectionInfo.d.ts.map +1 -0
  84. package/dist/utils/getCollectionInfo.js +8 -0
  85. package/dist/utils/keyboard.d.ts +8 -0
  86. package/dist/utils/keyboard.d.ts.map +1 -0
  87. package/dist/utils/keyboard.js +41 -0
  88. package/dist/utils/testConnection.d.ts +3 -0
  89. package/dist/utils/testConnection.d.ts.map +1 -0
  90. package/dist/utils/testConnection.js +8 -0
  91. package/dist/utils/useDebounce.d.ts +2 -0
  92. package/dist/utils/useDebounce.d.ts.map +1 -0
  93. package/dist/utils/useDebounce.js +15 -0
  94. package/dist/utils/useSearch.d.ts +17 -0
  95. package/dist/utils/useSearch.d.ts.map +1 -0
  96. package/dist/utils/useSearch.js +78 -0
  97. package/package.json +12 -9
  98. package/dist/lib/config-validation.d.ts.map +0 -1
  99. package/dist/lib/types.d.ts.map +0 -1
  100. package/dist/lib/typesense-client.d.ts +0 -5
  101. package/dist/lib/typesense-client.d.ts.map +0 -1
  102. /package/dist/{lib/types.js → types.js} +0 -0
@@ -0,0 +1,119 @@
1
+ import { searchCache } from '../../lib/cache.js';
2
+ import { getValidationErrors, validateSearchParams } from '../../lib/validation.js';
3
+ import { getAllCollections } from '../../utils/getAllCollections.js';
4
+ export const createSearch = (typesenseClient, pluginOptions)=>{
5
+ return async (request)=>{
6
+ try {
7
+ if (!request.url) {
8
+ return Response.json({
9
+ error: 'Request URL missing'
10
+ }, {
11
+ status: 400
12
+ });
13
+ }
14
+ const url = new URL(request.url);
15
+ const parts = url.pathname.split('/');
16
+ const searchIndex = parts.indexOf('search');
17
+ const collectionName = searchIndex >= 0 ? parts[searchIndex + 1] : '';
18
+ const collection = String(collectionName || '');
19
+ const q = url.searchParams.get('q') || '';
20
+ const page = Number(url.searchParams.get('page') || 1);
21
+ const per_page = Number(url.searchParams.get('per_page') || 10);
22
+ const sort_by = url.searchParams.get('sort_by') || undefined;
23
+ if (isNaN(page) || page < 1) {
24
+ return Response.json({
25
+ error: 'Invalid page parameter'
26
+ }, {
27
+ status: 400
28
+ });
29
+ }
30
+ if (isNaN(per_page) || per_page < 1 || per_page > 250) {
31
+ return Response.json({
32
+ error: 'Invalid per_page parameter'
33
+ }, {
34
+ status: 400
35
+ });
36
+ }
37
+ const validation = validateSearchParams({
38
+ page,
39
+ per_page,
40
+ q,
41
+ sort_by
42
+ });
43
+ if (!validation.success) {
44
+ return Response.json({
45
+ details: getValidationErrors(validation.errors || []),
46
+ error: 'Invalid search parameters'
47
+ }, {
48
+ status: 400
49
+ });
50
+ }
51
+ if (!collection) {
52
+ if (!q.trim()) {
53
+ return Response.json({
54
+ details: 'Use /api/search?q=keyword',
55
+ error: 'Query parameter "q" is required'
56
+ }, {
57
+ status: 400
58
+ });
59
+ }
60
+ return getAllCollections(typesenseClient, pluginOptions, q, {
61
+ filters: {},
62
+ page,
63
+ per_page,
64
+ sort_by
65
+ });
66
+ }
67
+ if (!pluginOptions.collections?.[collection]?.enabled) {
68
+ return Response.json({
69
+ error: 'Collection not enabled for search'
70
+ }, {
71
+ status: 400
72
+ });
73
+ }
74
+ if (!q.trim()) {
75
+ return Response.json({
76
+ error: 'Query parameter "q" is required'
77
+ }, {
78
+ status: 400
79
+ });
80
+ }
81
+ const fields = pluginOptions.collections?.[collection]?.searchFields?.join(',') || 'title,content';
82
+ const searchParams = {
83
+ highlight_full_fields: fields,
84
+ num_typos: 0,
85
+ page,
86
+ per_page,
87
+ q,
88
+ query_by: fields,
89
+ snippet_threshold: 30,
90
+ typo_tokens_threshold: 1,
91
+ ...sort_by ? {
92
+ sort_by
93
+ } : {}
94
+ };
95
+ const cached = searchCache.get(q, collection, {
96
+ page,
97
+ per_page,
98
+ sort_by
99
+ });
100
+ if (cached) {
101
+ return Response.json(cached);
102
+ }
103
+ const results = await typesenseClient.collections(collection).documents().search(searchParams);
104
+ searchCache.set(q, results, collection, {
105
+ page,
106
+ per_page,
107
+ sort_by
108
+ });
109
+ return Response.json(results);
110
+ } catch (error) {
111
+ return Response.json({
112
+ details: error instanceof Error ? error.message : 'Unknown error',
113
+ error: 'Search handler failed'
114
+ }, {
115
+ status: 500
116
+ });
117
+ }
118
+ };
119
+ };
@@ -0,0 +1,5 @@
1
+ import type Typesense from 'typesense';
2
+ import { type PayloadHandler } from 'payload';
3
+ import { type TypesenseSearchConfig } from '../../index.js';
4
+ export declare const createSuggest: (typesenseClient: Typesense.Client, pluginOptions: TypesenseSearchConfig) => PayloadHandler;
5
+ //# sourceMappingURL=createSuggest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSuggest.d.ts","sourceRoot":"","sources":["../../../src/endpoints/handler/createSuggest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAA;AAEtC,OAAO,EAAE,KAAK,cAAc,EAAuB,MAAM,SAAS,CAAA;AAElE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AAE3D,eAAO,MAAM,aAAa,GACxB,iBAAiB,SAAS,CAAC,MAAM,EACjC,eAAe,qBAAqB,KACnC,cA0CF,CAAA"}
@@ -0,0 +1,50 @@
1
+ export const createSuggest = (typesenseClient, pluginOptions)=>{
2
+ return async (request)=>{
3
+ if (!request.url) {
4
+ return Response.json({
5
+ error: 'Request URL missing'
6
+ }, {
7
+ status: 400
8
+ });
9
+ }
10
+ const url = new URL(request.url);
11
+ const parts = url.pathname.split('/');
12
+ const searchIndex = parts.indexOf('search');
13
+ const collectionName = searchIndex >= 0 ? parts[searchIndex + 1] : '';
14
+ const collection = String(collectionName || '');
15
+ if (!collection || !pluginOptions.collections?.[collection]?.enabled) {
16
+ return Response.json({
17
+ error: 'Collection not enabled for search'
18
+ }, {
19
+ status: 400
20
+ });
21
+ }
22
+ const q = url.searchParams.get('q');
23
+ const limitStr = url.searchParams.get('limit');
24
+ const limit = Number(limitStr ?? 5);
25
+ if (!q) {
26
+ return Response.json({
27
+ error: 'Query parameter "q" is required'
28
+ }, {
29
+ status: 400
30
+ });
31
+ }
32
+ const fields = pluginOptions.collections?.[collection]?.searchFields?.join(',') || 'title,content';
33
+ try {
34
+ const suggestResults = await typesenseClient.collections(collection).documents().search({
35
+ highlight_full_fields: fields,
36
+ per_page: limit,
37
+ q,
38
+ query_by: fields,
39
+ snippet_threshold: 30
40
+ });
41
+ return Response.json(suggestResults);
42
+ } catch {
43
+ return Response.json({
44
+ error: 'Suggest failed'
45
+ }, {
46
+ status: 500
47
+ });
48
+ }
49
+ };
50
+ };
@@ -1,12 +1,6 @@
1
- import type { PayloadHandler } from 'payload';
2
1
  import type Typesense from 'typesense';
3
- import type { TypesenseSearchConfig } from '../index.js';
4
- /**
5
- * Create health check handler
6
- */
7
- export declare const createHealthCheckHandler: (typesenseClient: Typesense.Client, pluginOptions: TypesenseSearchConfig, lastSyncTime?: number) => PayloadHandler;
8
- /**
9
- * Create detailed health check handler with more information
10
- */
11
- export declare const createDetailedHealthCheckHandler: (typesenseClient: Typesense.Client, pluginOptions: TypesenseSearchConfig, lastSyncTime?: number) => PayloadHandler;
2
+ import { type PayloadHandler } from 'payload';
3
+ import { type TypesenseSearchConfig } from '../index.js';
4
+ export declare const createHealthCheck: (typesenseClient: Typesense.Client, _pluginOptions: TypesenseSearchConfig, lastSyncTime?: number) => PayloadHandler;
5
+ export declare const createDetailedHealthCheck: (typesenseClient: Typesense.Client, pluginOptions: TypesenseSearchConfig, lastSyncTime?: number) => PayloadHandler;
12
6
  //# sourceMappingURL=health.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/endpoints/health.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,SAAS,MAAM,WAAW,CAAA;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AA4CxD;;GAEG;AACH,eAAO,MAAM,wBAAwB,GACnC,iBAAiB,SAAS,CAAC,MAAM,EACjC,eAAe,qBAAqB,EACpC,eAAe,MAAM,KACpB,cA2DF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,gCAAgC,GAC3C,iBAAiB,SAAS,CAAC,MAAM,EACjC,eAAe,qBAAqB,EACpC,eAAe,MAAM,KACpB,cAuFF,CAAA"}
1
+ {"version":3,"file":"health.d.ts","sourceRoot":"","sources":["../../src/endpoints/health.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAA;AAEtC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,SAAS,CAAA;AAG7C,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAOxD,eAAO,MAAM,iBAAiB,GAC5B,iBAAiB,SAAS,CAAC,MAAM,EACjC,gBAAgB,qBAAqB,EACrC,eAAe,MAAM,KACpB,cAsCF,CAAA;AAED,eAAO,MAAM,yBAAyB,GACpC,iBAAiB,SAAS,CAAC,MAAM,EACjC,eAAe,qBAAqB,EACpC,eAAe,MAAM,KACpB,cAsFF,CAAA"}
@@ -1,88 +1,43 @@
1
1
  import pkg from '../../package.json';
2
- import { searchCache } from '../lib/cache.js';
3
- /**
4
- * Test Typesense connection
5
- */ const testTypesenseConnection = async (typesenseClient)=>{
6
- try {
7
- const health = await typesenseClient.health.retrieve();
8
- return health.ok === true;
9
- } catch (_error) {
10
- // Handle health check error
11
- return false;
12
- }
13
- };
14
- /**
15
- * Get collection information
16
- */ const getCollectionInfo = async (typesenseClient)=>{
17
- try {
18
- const collections = await typesenseClient.collections().retrieve();
19
- return collections.map((col)=>col.name);
20
- } catch (_error) {
21
- // Handle collections retrieval error
22
- return [];
23
- }
24
- };
25
- /**
26
- * Get cache statistics
27
- */ const getCacheStats = ()=>{
28
- const stats = searchCache.getStats();
29
- return {
30
- hitRate: stats.hitRate || 0,
31
- maxSize: stats.maxSize,
32
- size: stats.size
33
- };
34
- };
35
- /**
36
- * Create health check handler
37
- */ export const createHealthCheckHandler = (typesenseClient, pluginOptions, lastSyncTime)=>{
2
+ import { buildError } from '../utils/buildError.js';
3
+ import { getCacheStats } from '../utils/getCacheStats.js';
4
+ import { getCollectionInfo } from '../utils/getCollectionInfo.js';
5
+ import { testConnection } from '../utils/testConnection.js';
6
+ export const createHealthCheck = (typesenseClient, _pluginOptions, lastSyncTime)=>{
38
7
  return async ()=>{
8
+ const start = Date.now();
39
9
  try {
40
- const startTime = Date.now();
41
- // Test Typesense connection
42
- const isTypesenseHealthy = await testTypesenseConnection(typesenseClient);
43
- const typesenseInfo = isTypesenseHealthy ? {
44
- ok: true,
45
- version: 'unknown'
46
- } : {
47
- ok: false
48
- };
49
- // Get collection information
10
+ const isTypesenseHealthy = await testConnection(typesenseClient);
50
11
  const collections = isTypesenseHealthy ? await getCollectionInfo(typesenseClient) : [];
51
- // Get cache statistics
52
12
  const cacheStats = getCacheStats();
53
- // Determine overall health status
54
13
  const isHealthy = isTypesenseHealthy && collections.length > 0;
55
- const response = {
14
+ const base = {
56
15
  cache: cacheStats,
57
16
  collections,
17
+ status: isHealthy ? 'healthy' : 'unhealthy',
18
+ typesense: {
19
+ ok: isTypesenseHealthy,
20
+ version: 'unknown'
21
+ },
58
22
  ...lastSyncTime !== undefined && {
59
23
  lastSync: lastSyncTime
60
- },
61
- status: isHealthy ? 'healthy' : 'unhealthy',
62
- typesense: typesenseInfo
63
- };
64
- // Add error details if unhealthy
65
- if (!isHealthy) {
66
- const errors = [];
67
- if (!isTypesenseHealthy) {
68
- errors.push('Typesense connection failed');
69
- }
70
- if (collections.length === 0) {
71
- errors.push('No collections available');
72
24
  }
73
- response.error = errors.join(', ');
74
- }
75
- const responseTime = Date.now() - startTime;
25
+ };
26
+ const error = buildError(isTypesenseHealthy, collections.length > 0);
27
+ const responseTime = Date.now() - start;
76
28
  return Response.json({
77
- ...response,
29
+ ...base,
30
+ ...error && {
31
+ error
32
+ },
78
33
  responseTime,
79
34
  timestamp: new Date().toISOString(),
80
35
  version: pkg.version
81
36
  });
82
- } catch (_error) {
37
+ } catch (err) {
83
38
  const errorResponse = {
84
39
  cache: getCacheStats(),
85
- error: _error instanceof Error ? _error.message : 'Unknown error',
40
+ error: err instanceof Error ? err.message : 'Unknown error',
86
41
  status: 'unhealthy'
87
42
  };
88
43
  return Response.json(errorResponse, {
@@ -91,32 +46,27 @@ import { searchCache } from '../lib/cache.js';
91
46
  }
92
47
  };
93
48
  };
94
- /**
95
- * Create detailed health check handler with more information
96
- */ export const createDetailedHealthCheckHandler = (typesenseClient, pluginOptions, lastSyncTime)=>{
49
+ export const createDetailedHealthCheck = (typesenseClient, pluginOptions, lastSyncTime)=>{
97
50
  return async ()=>{
51
+ const start = Date.now();
98
52
  try {
99
- const startTime = Date.now();
100
- // Test Typesense connection
101
- const isTypesenseHealthy = await testTypesenseConnection(typesenseClient);
102
- // Get detailed collection information
103
- let collections = [];
53
+ const isTypesenseHealthy = await testConnection(typesenseClient);
54
+ let collectionDetails = [];
104
55
  if (isTypesenseHealthy) {
105
56
  try {
106
57
  const collectionsData = await typesenseClient.collections().retrieve();
107
- collections = collectionsData.map((col)=>({
58
+ collectionDetails = collectionsData.map((col)=>({
108
59
  name: col.name,
109
60
  createdAt: col.created_at,
110
61
  fields: col.fields?.length || 0,
111
62
  numDocuments: col.num_documents
112
63
  }));
113
- } catch (_error) {
114
- // Handle detailed collection info error
64
+ } catch {
65
+ // ignore detailed retrieval error
115
66
  }
116
67
  }
117
- // Get cache statistics
68
+ const collections = collectionDetails.map((c)=>c.name);
118
69
  const cacheStats = getCacheStats();
119
- // Get plugin configuration info
120
70
  const configInfo = {
121
71
  enabledCollections: Object.entries(pluginOptions.collections || {}).filter(([_, config])=>config?.enabled).map(([name, config])=>({
122
72
  name,
@@ -127,45 +77,37 @@ import { searchCache } from '../lib/cache.js';
127
77
  settings: pluginOptions.settings,
128
78
  totalCollections: Object.keys(pluginOptions.collections || {}).length
129
79
  };
130
- // Determine overall health status
131
- const isHealthy = isTypesenseHealthy && collections.length > 0;
80
+ const isHealthy = isTypesenseHealthy && collectionDetails.length > 0;
132
81
  const response = {
133
82
  cache: cacheStats,
134
- collectionDetails: collections,
135
- collections: collections.map((col)=>col.name),
83
+ collectionDetails,
84
+ collections,
136
85
  config: configInfo,
137
86
  lastSync: lastSyncTime,
138
- responseTime: Date.now() - startTime,
87
+ responseTime: Date.now() - start,
139
88
  status: isHealthy ? 'healthy' : 'unhealthy',
140
89
  timestamp: new Date().toISOString(),
141
90
  typesense: {
142
91
  ok: isTypesenseHealthy,
143
92
  version: 'unknown'
144
93
  },
145
- version: pkg.version
146
- };
147
- // Add error details if unhealthy
148
- if (!isHealthy) {
149
- const errors = [];
150
- if (!isTypesenseHealthy) {
151
- errors.push('Typesense connection failed');
94
+ version: pkg.version,
95
+ ...isHealthy ? {} : {
96
+ error: [
97
+ !isTypesenseHealthy && 'Typesense connection failed',
98
+ collectionDetails.length === 0 && 'No collections available'
99
+ ].filter(Boolean).join(', ')
152
100
  }
153
- if (collections.length === 0) {
154
- errors.push('No collections available');
155
- }
156
- response.error = errors.join(', ');
157
- }
101
+ };
158
102
  return Response.json(response);
159
- } catch (_error) {
160
- // Handle detailed health check error
161
- const errorResponse = {
103
+ } catch (error) {
104
+ return Response.json({
162
105
  cache: getCacheStats(),
163
- error: _error instanceof Error ? _error.message : 'Unknown error',
106
+ error: error instanceof Error ? error.message : 'Unknown error',
164
107
  status: 'unhealthy',
165
108
  timestamp: new Date().toISOString(),
166
109
  version: pkg.version
167
- };
168
- return Response.json(errorResponse, {
110
+ }, {
169
111
  status: 500
170
112
  });
171
113
  }
@@ -1,12 +1,11 @@
1
- import type { PayloadHandler } from "payload";
2
- import type Typesense from "typesense";
3
- import type { TypesenseSearchConfig } from "../index.js";
1
+ import type Typesense from 'typesense';
2
+ import { type TypesenseSearchConfig } from '../index.js';
4
3
  export declare const createSearchEndpoints: (typesenseClient: Typesense.Client, pluginOptions: TypesenseSearchConfig, lastSyncTime?: number) => ({
5
- handler: PayloadHandler;
4
+ handler: import("payload").PayloadHandler;
6
5
  method: "get";
7
6
  path: string;
8
7
  } | {
9
- handler: PayloadHandler;
8
+ handler: import("payload").PayloadHandler;
10
9
  method: "post";
11
10
  path: string;
12
11
  })[];
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,KAAK,SAAS,MAAM,WAAW,CAAA;AAEtC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;AA0IxD,eAAO,MAAM,qBAAqB,GACjC,iBAAiB,SAAS,CAAC,MAAM,EACjC,eAAe,qBAAqB,EACpC,eAAe,MAAM;;;;;;;;IA+CrB,CAAA"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/endpoints/search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAA;AAEtC,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAOxD,eAAO,MAAM,qBAAqB,GAChC,iBAAiB,SAAS,CAAC,MAAM,EACjC,eAAe,qBAAqB,EACpC,eAAe,MAAM;;;;;;;;IAuCtB,CAAA"}