@extravirgin/payload-plugin-meilisearch 0.0.1-9 → 0.0.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/dist/indexCollections.js +101 -95
- package/dist/indexCollections.js.map +1 -1
- package/package.json +1 -1
package/dist/indexCollections.js
CHANGED
|
@@ -60,8 +60,100 @@ exports.indexCollections = void 0;
|
|
|
60
60
|
var meilisearch_1 = require("meilisearch");
|
|
61
61
|
var html_to_text_1 = require("html-to-text");
|
|
62
62
|
var richtext_lexical_1 = require("@payloadcms/richtext-lexical");
|
|
63
|
+
var getIndexName = function (config, collectionSlug) { var _a; return "".concat((_a = config === null || config === void 0 ? void 0 : config.indexPrefix) !== null && _a !== void 0 ? _a : '').concat(collectionSlug); };
|
|
64
|
+
function handleAfterChange(_a) {
|
|
65
|
+
var _b, _c, _d, _e, _f, _g;
|
|
66
|
+
var doc = _a.doc, previousDoc = _a.previousDoc, req = _a.req, collection = _a.collection, config = _a.config;
|
|
67
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
68
|
+
var baseDoc, collectionConfig, payload, client, index, documents, _h, locales, defaultLocale, fallback, _i, locales_1, locale, localizedDoc, _j, documentId, shouldIndex, transformedDoc, _k, documentId, shouldIndex, transformedDoc, _l, error_1;
|
|
69
|
+
return __generator(this, function (_m) {
|
|
70
|
+
switch (_m.label) {
|
|
71
|
+
case 0:
|
|
72
|
+
_m.trys.push([0, 19, , 20]);
|
|
73
|
+
baseDoc = doc;
|
|
74
|
+
collectionConfig = config.collections && (config === null || config === void 0 ? void 0 : config.collections.find(function (c) { return c.slug === collection.slug; }));
|
|
75
|
+
payload = req.payload;
|
|
76
|
+
client = getMeilisearchClient(config);
|
|
77
|
+
return [4 /*yield*/, upsertIndex(client, getIndexName(config, collection.slug))];
|
|
78
|
+
case 1:
|
|
79
|
+
_m.sent();
|
|
80
|
+
index = client.index(getIndexName(config, collection.slug));
|
|
81
|
+
documents = [];
|
|
82
|
+
if (!(((_b = payload.config) === null || _b === void 0 ? void 0 : _b.localization) && ((_c = payload.config.localization.locales) === null || _c === void 0 ? void 0 : _c.length) > 0)) return [3 /*break*/, 13];
|
|
83
|
+
_h = payload.config.localization, locales = _h.locales, defaultLocale = _h.defaultLocale, fallback = _h.fallback;
|
|
84
|
+
_i = 0, locales_1 = locales;
|
|
85
|
+
_m.label = 2;
|
|
86
|
+
case 2:
|
|
87
|
+
if (!(_i < locales_1.length)) return [3 /*break*/, 10];
|
|
88
|
+
locale = locales_1[_i];
|
|
89
|
+
if (!(req.locale === locale.code)) return [3 /*break*/, 3];
|
|
90
|
+
_j = doc;
|
|
91
|
+
return [3 /*break*/, 5];
|
|
92
|
+
case 3: return [4 /*yield*/, req.payload.findByID({
|
|
93
|
+
collection: collection.slug,
|
|
94
|
+
id: doc.id,
|
|
95
|
+
locale: locale,
|
|
96
|
+
fallbackLocale: locale.fallbackLocale || defaultLocale,
|
|
97
|
+
})];
|
|
98
|
+
case 4:
|
|
99
|
+
_j = _m.sent();
|
|
100
|
+
_m.label = 5;
|
|
101
|
+
case 5:
|
|
102
|
+
localizedDoc = _j;
|
|
103
|
+
documentId = doc.id + "_".concat(locale.code);
|
|
104
|
+
shouldIndex = (_e = (_d = collectionConfig === null || collectionConfig === void 0 ? void 0 : collectionConfig.shouldIndex) === null || _d === void 0 ? void 0 : _d.call(collectionConfig, localizedDoc, previousDoc, locale.code)) !== null && _e !== void 0 ? _e : 'index';
|
|
105
|
+
if (!(shouldIndex === 'index')) return [3 /*break*/, 7];
|
|
106
|
+
_k = [{}];
|
|
107
|
+
return [4 /*yield*/, transformDocumentForMeilisearch(localizedDoc, collection.fields, req)];
|
|
108
|
+
case 6:
|
|
109
|
+
transformedDoc = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([_m.sent()])), { id: documentId, documentId: doc.id, locale: locale.code }]);
|
|
110
|
+
documents.push(transformedDoc);
|
|
111
|
+
return [3 /*break*/, 9];
|
|
112
|
+
case 7:
|
|
113
|
+
if (!(shouldIndex === 'delete')) return [3 /*break*/, 9];
|
|
114
|
+
return [4 /*yield*/, index.deleteDocument(documentId)];
|
|
115
|
+
case 8:
|
|
116
|
+
_m.sent();
|
|
117
|
+
_m.label = 9;
|
|
118
|
+
case 9:
|
|
119
|
+
_i++;
|
|
120
|
+
return [3 /*break*/, 2];
|
|
121
|
+
case 10:
|
|
122
|
+
if (!(documents.length > 0)) return [3 /*break*/, 12];
|
|
123
|
+
return [4 /*yield*/, index.addDocuments(documents)];
|
|
124
|
+
case 11:
|
|
125
|
+
_m.sent();
|
|
126
|
+
_m.label = 12;
|
|
127
|
+
case 12: return [3 /*break*/, 18];
|
|
128
|
+
case 13:
|
|
129
|
+
documentId = doc.id;
|
|
130
|
+
shouldIndex = (_g = (_f = collectionConfig === null || collectionConfig === void 0 ? void 0 : collectionConfig.shouldIndex) === null || _f === void 0 ? void 0 : _f.call(collectionConfig, doc, previousDoc)) !== null && _g !== void 0 ? _g : 'index';
|
|
131
|
+
if (!(shouldIndex === 'index')) return [3 /*break*/, 16];
|
|
132
|
+
_l = [{}];
|
|
133
|
+
return [4 /*yield*/, transformDocumentForMeilisearch(doc, collection.fields, req)];
|
|
134
|
+
case 14:
|
|
135
|
+
transformedDoc = __assign.apply(void 0, [__assign.apply(void 0, _l.concat([_m.sent()])), { id: documentId, documentId: doc.id }]);
|
|
136
|
+
return [4 /*yield*/, index.addDocuments([transformedDoc])];
|
|
137
|
+
case 15:
|
|
138
|
+
_m.sent();
|
|
139
|
+
return [3 /*break*/, 18];
|
|
140
|
+
case 16:
|
|
141
|
+
if (!(shouldIndex === 'delete')) return [3 /*break*/, 18];
|
|
142
|
+
return [4 /*yield*/, index.deleteDocument(documentId)];
|
|
143
|
+
case 17:
|
|
144
|
+
_m.sent();
|
|
145
|
+
_m.label = 18;
|
|
146
|
+
case 18: return [3 /*break*/, 20];
|
|
147
|
+
case 19:
|
|
148
|
+
error_1 = _m.sent();
|
|
149
|
+
console.error('Meilisearch indexing error:', error_1);
|
|
150
|
+
return [3 /*break*/, 20];
|
|
151
|
+
case 20: return [2 /*return*/];
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
}
|
|
63
156
|
var indexCollections = function (collections, config) {
|
|
64
|
-
var getIndexName = function (collectionSlug) { var _a; return "".concat((_a = config === null || config === void 0 ? void 0 : config.indexPrefix) !== null && _a !== void 0 ? _a : '').concat(collectionSlug); };
|
|
65
157
|
return collections.map(function (collection) {
|
|
66
158
|
var _a, _b;
|
|
67
159
|
var collectionConfig = config.collections && (config === null || config === void 0 ? void 0 : config.collections.find(function (c) { return c.slug === collection.slug; }));
|
|
@@ -71,113 +163,27 @@ var indexCollections = function (collections, config) {
|
|
|
71
163
|
return __assign(__assign({}, collection), { hooks: __assign(__assign({}, (collection.hooks || {})), { afterChange: __spreadArray(__spreadArray([], (((_a = collection.hooks) === null || _a === void 0 ? void 0 : _a.afterChange) || []), true), [
|
|
72
164
|
function (_a) {
|
|
73
165
|
var doc = _a.doc, previousDoc = _a.previousDoc, req = _a.req;
|
|
74
|
-
|
|
75
|
-
var baseDoc, payload, client, index, documents, _b, locales, defaultLocale, fallback, _i, locales_1, locale, localizedDoc, _c, documentId, shouldIndex, transformedDoc, _d, documentId, shouldIndex, transformedDoc, _e, error_1;
|
|
76
|
-
var _f, _g, _h, _j, _k, _l;
|
|
77
|
-
return __generator(this, function (_m) {
|
|
78
|
-
switch (_m.label) {
|
|
79
|
-
case 0:
|
|
80
|
-
_m.trys.push([0, 19, , 20]);
|
|
81
|
-
baseDoc = doc;
|
|
82
|
-
payload = req.payload;
|
|
83
|
-
client = getMeilisearchClient(config);
|
|
84
|
-
return [4 /*yield*/, upsertIndex(client, getIndexName(collection.slug))];
|
|
85
|
-
case 1:
|
|
86
|
-
_m.sent();
|
|
87
|
-
index = client.index(getIndexName(collection.slug));
|
|
88
|
-
documents = [];
|
|
89
|
-
if (!(((_f = payload.config) === null || _f === void 0 ? void 0 : _f.localization) && ((_g = payload.config.localization.locales) === null || _g === void 0 ? void 0 : _g.length) > 1)) return [3 /*break*/, 13];
|
|
90
|
-
_b = payload.config.localization, locales = _b.locales, defaultLocale = _b.defaultLocale, fallback = _b.fallback;
|
|
91
|
-
_i = 0, locales_1 = locales;
|
|
92
|
-
_m.label = 2;
|
|
93
|
-
case 2:
|
|
94
|
-
if (!(_i < locales_1.length)) return [3 /*break*/, 10];
|
|
95
|
-
locale = locales_1[_i];
|
|
96
|
-
if (!(req.locale === locale.code)) return [3 /*break*/, 3];
|
|
97
|
-
_c = doc;
|
|
98
|
-
return [3 /*break*/, 5];
|
|
99
|
-
case 3: return [4 /*yield*/, req.payload.findByID({
|
|
100
|
-
collection: collection.slug,
|
|
101
|
-
id: doc.id,
|
|
102
|
-
locale: locale,
|
|
103
|
-
fallbackLocale: locale.fallbackLocale || defaultLocale,
|
|
104
|
-
})];
|
|
105
|
-
case 4:
|
|
106
|
-
_c = _m.sent();
|
|
107
|
-
_m.label = 5;
|
|
108
|
-
case 5:
|
|
109
|
-
localizedDoc = _c;
|
|
110
|
-
documentId = doc.id + "_".concat(locale.code);
|
|
111
|
-
shouldIndex = (_j = (_h = collectionConfig.shouldIndex) === null || _h === void 0 ? void 0 : _h.call(collectionConfig, localizedDoc, previousDoc, locale.code)) !== null && _j !== void 0 ? _j : 'index';
|
|
112
|
-
if (!(shouldIndex === 'index')) return [3 /*break*/, 7];
|
|
113
|
-
_d = [{}];
|
|
114
|
-
return [4 /*yield*/, transformDocumentForMeilisearch(localizedDoc, collection.fields, req)];
|
|
115
|
-
case 6:
|
|
116
|
-
transformedDoc = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([_m.sent()])), { id: documentId, documentId: doc.id, locale: locale.code }]);
|
|
117
|
-
documents.push(transformedDoc);
|
|
118
|
-
return [3 /*break*/, 9];
|
|
119
|
-
case 7:
|
|
120
|
-
if (!(shouldIndex === 'delete')) return [3 /*break*/, 9];
|
|
121
|
-
return [4 /*yield*/, index.deleteDocument(documentId)];
|
|
122
|
-
case 8:
|
|
123
|
-
_m.sent();
|
|
124
|
-
_m.label = 9;
|
|
125
|
-
case 9:
|
|
126
|
-
_i++;
|
|
127
|
-
return [3 /*break*/, 2];
|
|
128
|
-
case 10:
|
|
129
|
-
if (!(documents.length > 0)) return [3 /*break*/, 12];
|
|
130
|
-
return [4 /*yield*/, index.addDocuments(documents)];
|
|
131
|
-
case 11:
|
|
132
|
-
_m.sent();
|
|
133
|
-
_m.label = 12;
|
|
134
|
-
case 12: return [3 /*break*/, 18];
|
|
135
|
-
case 13:
|
|
136
|
-
documentId = doc.id;
|
|
137
|
-
shouldIndex = (_l = (_k = collectionConfig.shouldIndex) === null || _k === void 0 ? void 0 : _k.call(collectionConfig, doc, previousDoc)) !== null && _l !== void 0 ? _l : 'index';
|
|
138
|
-
if (!(shouldIndex === 'index')) return [3 /*break*/, 16];
|
|
139
|
-
_e = [{}];
|
|
140
|
-
return [4 /*yield*/, transformDocumentForMeilisearch(doc, collection.fields, req)];
|
|
141
|
-
case 14:
|
|
142
|
-
transformedDoc = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([_m.sent()])), { id: documentId, documentId: doc.id }]);
|
|
143
|
-
return [4 /*yield*/, index.addDocuments([transformedDoc])];
|
|
144
|
-
case 15:
|
|
145
|
-
_m.sent();
|
|
146
|
-
return [3 /*break*/, 18];
|
|
147
|
-
case 16:
|
|
148
|
-
if (!(shouldIndex === 'delete')) return [3 /*break*/, 18];
|
|
149
|
-
return [4 /*yield*/, index.deleteDocument(documentId)];
|
|
150
|
-
case 17:
|
|
151
|
-
_m.sent();
|
|
152
|
-
_m.label = 18;
|
|
153
|
-
case 18: return [3 /*break*/, 20];
|
|
154
|
-
case 19:
|
|
155
|
-
error_1 = _m.sent();
|
|
156
|
-
console.error('Meilisearch indexing error:', error_1);
|
|
157
|
-
return [3 /*break*/, 20];
|
|
158
|
-
case 20: return [2 /*return*/];
|
|
159
|
-
}
|
|
160
|
-
});
|
|
161
|
-
});
|
|
166
|
+
handleAfterChange({ doc: doc, previousDoc: previousDoc, req: req, collection: collection, config: config });
|
|
162
167
|
},
|
|
163
168
|
], false), afterDelete: __spreadArray(__spreadArray([], (((_b = collection.hooks) === null || _b === void 0 ? void 0 : _b.afterDelete) || []), true), [
|
|
164
169
|
function (_a) {
|
|
165
170
|
var doc = _a.doc, req = _a.req;
|
|
166
171
|
return __awaiter(void 0, void 0, void 0, function () {
|
|
167
|
-
var client, index,
|
|
172
|
+
var payload, localization, client, index, locales, _i, locales_2, locale, documentId, error_2;
|
|
168
173
|
var _b, _c;
|
|
169
174
|
return __generator(this, function (_d) {
|
|
170
175
|
switch (_d.label) {
|
|
171
176
|
case 0:
|
|
172
177
|
_d.trys.push([0, 9, , 10]);
|
|
178
|
+
payload = req.payload;
|
|
179
|
+
localization = (_b = payload.config) === null || _b === void 0 ? void 0 : _b.localization;
|
|
173
180
|
client = getMeilisearchClient(config);
|
|
174
|
-
return [4 /*yield*/, upsertIndex(client, getIndexName(collection.slug))];
|
|
181
|
+
return [4 /*yield*/, upsertIndex(client, getIndexName(config, collection.slug))];
|
|
175
182
|
case 1:
|
|
176
183
|
_d.sent();
|
|
177
|
-
index = client.index(getIndexName(collection.slug));
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
locales = payload.config.localization.locales;
|
|
184
|
+
index = client.index(getIndexName(config, collection.slug));
|
|
185
|
+
if (!(localization && ((_c = localization.locales) === null || _c === void 0 ? void 0 : _c.length) > 0)) return [3 /*break*/, 6];
|
|
186
|
+
locales = localization.locales;
|
|
181
187
|
_i = 0, locales_2 = locales;
|
|
182
188
|
_d.label = 2;
|
|
183
189
|
case 2:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"indexCollections.js","sourceRoot":"","sources":["../src/indexCollections.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2CAA0C;AAC1C,6CAAwC;AACxC,iE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