@rubixstudios/payload-typesense 1.4.0 → 1.4.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.
- package/README.md +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +14 -14
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -48,7 +48,7 @@ export default buildConfig({
|
|
|
48
48
|
facetFields: ['category', 'status'],
|
|
49
49
|
displayName: 'Blog Posts',
|
|
50
50
|
icon: '📝',
|
|
51
|
-
syncLimit: 500, // Overrides the default
|
|
51
|
+
syncLimit: 500, // Overrides the default sync limit of 1000
|
|
52
52
|
},
|
|
53
53
|
},
|
|
54
54
|
// This feature is experimental
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Config } from 'payload';
|
|
2
2
|
import { type TypesenseConfig } from './types.js';
|
|
3
3
|
export * from './components/index.js';
|
|
4
|
-
export type
|
|
5
|
-
export declare const typesenseSearch: (
|
|
4
|
+
export { type TypesenseConfig } from './types.js';
|
|
5
|
+
export declare const typesenseSearch: (pluginConfig: TypesenseConfig) => (incomingConfig: Config) => Config;
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAMrC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,cAAc,uBAAuB,CAAA;AACrC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,SAAS,CAAA;AAMrC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,cAAc,uBAAuB,CAAA;AACrC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,eAAe,GACzB,cAAc,eAAe,MAC7B,gBAAgB,MAAM,KAAG,MA8CzB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -3,18 +3,18 @@ import { createClient } from './lib/client.js';
|
|
|
3
3
|
import { deleteDocumentFromTypesense, syncDocumentToTypesense } from './lib/hooks.js';
|
|
4
4
|
import { initializeTypesense } from './lib/initialization.js';
|
|
5
5
|
export * from './components/index.js';
|
|
6
|
-
export const typesenseSearch = (
|
|
7
|
-
if (
|
|
8
|
-
const client = createClient(
|
|
9
|
-
|
|
10
|
-
...
|
|
11
|
-
...createSearchEndpoints(client,
|
|
6
|
+
export const typesenseSearch = (pluginConfig)=>(incomingConfig)=>{
|
|
7
|
+
if (pluginConfig.disabled) return incomingConfig;
|
|
8
|
+
const client = createClient(pluginConfig.typesense);
|
|
9
|
+
incomingConfig.endpoints = [
|
|
10
|
+
...incomingConfig.endpoints || [],
|
|
11
|
+
...createSearchEndpoints(client, pluginConfig, Date.now())
|
|
12
12
|
];
|
|
13
|
-
const shouldAutoSync =
|
|
14
|
-
const hasCollections = !!
|
|
13
|
+
const shouldAutoSync = pluginConfig.settings?.autoSync !== false;
|
|
14
|
+
const hasCollections = !!pluginConfig.collections;
|
|
15
15
|
if (shouldAutoSync && hasCollections) {
|
|
16
|
-
|
|
17
|
-
const colConfig =
|
|
16
|
+
incomingConfig.collections = (incomingConfig.collections || []).map((collection)=>{
|
|
17
|
+
const colConfig = pluginConfig.collections?.[collection.slug];
|
|
18
18
|
if (!colConfig?.enabled) return collection;
|
|
19
19
|
return {
|
|
20
20
|
...collection,
|
|
@@ -32,12 +32,12 @@ export const typesenseSearch = (pluginOptions)=>(config)=>{
|
|
|
32
32
|
};
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
|
-
const existingOnInit =
|
|
36
|
-
|
|
35
|
+
const existingOnInit = incomingConfig.onInit;
|
|
36
|
+
incomingConfig.onInit = async (payload)=>{
|
|
37
37
|
if (existingOnInit) {
|
|
38
38
|
await existingOnInit(payload);
|
|
39
39
|
}
|
|
40
|
-
await initializeTypesense(payload, client,
|
|
40
|
+
await initializeTypesense(payload, client, pluginConfig);
|
|
41
41
|
};
|
|
42
|
-
return
|
|
42
|
+
return incomingConfig;
|
|
43
43
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rubixstudios/payload-typesense",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.2",
|
|
4
4
|
"description": "A production-ready search plugin that integrates Typesense with Payload CMS, offering fast, typo-tolerant search with real-time synchronization. This fork by Rubix Studios reduces bloat and introduces targeted changes for improved performance, maintainability, and flexibility.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Rubix Studios <hello@rubixstudios.com.au> (https://rubixstudios.com.au)",
|
|
@@ -54,14 +54,14 @@
|
|
|
54
54
|
"release": "semantic-release"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
|
-
"@biomejs/biome": "2.3.
|
|
57
|
+
"@biomejs/biome": "2.3.13",
|
|
58
58
|
"@payloadcms/eslint-config": "^3.28.0",
|
|
59
59
|
"@semantic-release/changelog": "^6.0.3",
|
|
60
60
|
"@semantic-release/git": "^10.0.1",
|
|
61
61
|
"@swc/cli": "^0.7.10",
|
|
62
|
-
"@swc/core": "^1.15.
|
|
63
|
-
"@types/react": "19.2.
|
|
64
|
-
"payload": "^3.
|
|
62
|
+
"@swc/core": "^1.15.11",
|
|
63
|
+
"@types/react": "19.2.10",
|
|
64
|
+
"payload": "^3.74.0",
|
|
65
65
|
"rimraf": "^6.1.2",
|
|
66
66
|
"semantic-release": "^25.0.2",
|
|
67
67
|
"typescript": "^5.9.3"
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"typesense": "^2.1.0",
|
|
91
91
|
"zod": "^4.3.6"
|
|
92
92
|
},
|
|
93
|
-
"packageManager": "pnpm@10.28.
|
|
93
|
+
"packageManager": "pnpm@10.28.2"
|
|
94
94
|
}
|