@rubixstudios/payload-typesense 1.5.2 → 1.5.4

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.
@@ -50,7 +50,8 @@ const syncExistingDocuments = async (payload, typesenseClient, collectionSlug, c
50
50
  const mapped = batch.filter((doc)=>{
51
51
  if (typeof doc !== 'object' || doc === null) return false;
52
52
  if (!('id' in doc)) return false;
53
- return typeof doc.id === 'string';
53
+ const id = doc.id;
54
+ return typeof id === 'string' || typeof id === 'number';
54
55
  }).map((doc)=>mapToTypesense(doc, collectionSlug, config)).filter((doc)=>doc !== null);
55
56
  try {
56
57
  await typesenseClient.collections(collectionSlug).documents().import(mapped, {
@@ -1 +1 @@
1
- {"version":3,"file":"schema-mapper.d.ts","sourceRoot":"","sources":["../../src/lib/schema-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAA;AAGjG,eAAO,MAAM,wBAAwB,GACnC,gBAAgB,MAAM,EACtB,QAAQ,WAAW,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,EACvE,SAAS,WAAW,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;;;CAiDtD,CAAA;AAED,eAAO,MAAM,cAAc,GACzB,KAAK,YAAY,EACjB,iBAAiB,MAAM,EACvB,QAAQ,WAAW,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAC1D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,IA0FpC,CAAA"}
1
+ {"version":3,"file":"schema-mapper.d.ts","sourceRoot":"","sources":["../../src/lib/schema-mapper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,qBAAqB,EAAE,KAAK,eAAe,EAAE,MAAM,aAAa,CAAA;AAGjG,eAAO,MAAM,wBAAwB,GACnC,gBAAgB,MAAM,EACtB,QAAQ,WAAW,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,SAAS,EACvE,SAAS,WAAW,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC;;;CAiDtD,CAAA;AAED,eAAO,MAAM,cAAc,GACzB,KAAK,YAAY,EACjB,iBAAiB,MAAM,EACvB,QAAQ,WAAW,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC,CAAC,MAAM,CAAC,KAC1D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,IAqFpC,CAAA"}
@@ -100,7 +100,7 @@ export const mapToTypesense = (doc, _collectionSlug, config)=>{
100
100
  typesenseDoc[field] = '';
101
101
  continue;
102
102
  }
103
- if ((field === 'content' || field === 'description') && typeof value === 'object' && value !== null && 'root' in value) {
103
+ if (typeof value === 'object' && value !== null && 'root' in value) {
104
104
  typesenseDoc[field] = extractText(value) || '';
105
105
  } else if (typeof value === 'string' || typeof value === 'number') {
106
106
  typesenseDoc[field] = String(value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubixstudios/payload-typesense",
3
- "version": "1.5.2",
3
+ "version": "1.5.4",
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)",