@tinacms/search 1.0.3 → 1.0.5
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/index-client.es.js +33 -6
- package/dist/index-client.js +28 -6
- package/package.json +6 -6
package/dist/index-client.es.js
CHANGED
|
@@ -31,7 +31,10 @@ const extractText = (data, acc, indexableNodeTypes) => {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
(_b = (_a = data.children) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(
|
|
34
|
+
(_b = (_a = data.children) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(
|
|
35
|
+
_a,
|
|
36
|
+
(child) => extractText(child, acc, indexableNodeTypes)
|
|
37
|
+
);
|
|
35
38
|
}
|
|
36
39
|
};
|
|
37
40
|
const relativePath = (path, collection) => {
|
|
@@ -65,16 +68,35 @@ const processDocumentForIndexing = (data, path, collection, textIndexLength, fie
|
|
|
65
68
|
if (data[f.name]) {
|
|
66
69
|
if (f.type === "object") {
|
|
67
70
|
if (isList) {
|
|
68
|
-
data[f.name] = data[f.name].map(
|
|
71
|
+
data[f.name] = data[f.name].map(
|
|
72
|
+
(obj) => processDocumentForIndexing(
|
|
73
|
+
obj,
|
|
74
|
+
path,
|
|
75
|
+
collection,
|
|
76
|
+
textIndexLength,
|
|
77
|
+
f
|
|
78
|
+
)
|
|
79
|
+
);
|
|
69
80
|
} else {
|
|
70
|
-
data[f.name] = processDocumentForIndexing(
|
|
81
|
+
data[f.name] = processDocumentForIndexing(
|
|
82
|
+
data[f.name],
|
|
83
|
+
path,
|
|
84
|
+
collection,
|
|
85
|
+
textIndexLength,
|
|
86
|
+
f
|
|
87
|
+
);
|
|
71
88
|
}
|
|
72
89
|
} else if (f.type === "string") {
|
|
73
90
|
const fieldTextIndexLength = f.maxSearchIndexFieldLength || textIndexLength;
|
|
74
91
|
if (isList) {
|
|
75
|
-
data[f.name] = data[f.name].map(
|
|
92
|
+
data[f.name] = data[f.name].map(
|
|
93
|
+
(value) => processTextFieldValue(value, fieldTextIndexLength)
|
|
94
|
+
);
|
|
76
95
|
} else {
|
|
77
|
-
data[f.name] = processTextFieldValue(
|
|
96
|
+
data[f.name] = processTextFieldValue(
|
|
97
|
+
data[f.name],
|
|
98
|
+
fieldTextIndexLength
|
|
99
|
+
);
|
|
78
100
|
}
|
|
79
101
|
} else if (f.type === "rich-text") {
|
|
80
102
|
const fieldTextIndexLength = f.maxSearchIndexFieldLength || textIndexLength;
|
|
@@ -144,4 +166,9 @@ const parseSearchIndexResponse = (data, options) => {
|
|
|
144
166
|
};
|
|
145
167
|
}
|
|
146
168
|
};
|
|
147
|
-
export {
|
|
169
|
+
export {
|
|
170
|
+
optionsToSearchIndexOptions,
|
|
171
|
+
parseSearchIndexResponse,
|
|
172
|
+
processDocumentForIndexing,
|
|
173
|
+
queryToSearchIndexQuery
|
|
174
|
+
};
|
package/dist/index-client.js
CHANGED
|
@@ -35,7 +35,10 @@
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
(_b = (_a = data.children) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(
|
|
38
|
+
(_b = (_a = data.children) == null ? void 0 : _a.forEach) == null ? void 0 : _b.call(
|
|
39
|
+
_a,
|
|
40
|
+
(child) => extractText(child, acc, indexableNodeTypes)
|
|
41
|
+
);
|
|
39
42
|
}
|
|
40
43
|
};
|
|
41
44
|
const relativePath = (path, collection) => {
|
|
@@ -69,16 +72,35 @@
|
|
|
69
72
|
if (data[f.name]) {
|
|
70
73
|
if (f.type === "object") {
|
|
71
74
|
if (isList) {
|
|
72
|
-
data[f.name] = data[f.name].map(
|
|
75
|
+
data[f.name] = data[f.name].map(
|
|
76
|
+
(obj) => processDocumentForIndexing(
|
|
77
|
+
obj,
|
|
78
|
+
path,
|
|
79
|
+
collection,
|
|
80
|
+
textIndexLength,
|
|
81
|
+
f
|
|
82
|
+
)
|
|
83
|
+
);
|
|
73
84
|
} else {
|
|
74
|
-
data[f.name] = processDocumentForIndexing(
|
|
85
|
+
data[f.name] = processDocumentForIndexing(
|
|
86
|
+
data[f.name],
|
|
87
|
+
path,
|
|
88
|
+
collection,
|
|
89
|
+
textIndexLength,
|
|
90
|
+
f
|
|
91
|
+
);
|
|
75
92
|
}
|
|
76
93
|
} else if (f.type === "string") {
|
|
77
94
|
const fieldTextIndexLength = f.maxSearchIndexFieldLength || textIndexLength;
|
|
78
95
|
if (isList) {
|
|
79
|
-
data[f.name] = data[f.name].map(
|
|
96
|
+
data[f.name] = data[f.name].map(
|
|
97
|
+
(value) => processTextFieldValue(value, fieldTextIndexLength)
|
|
98
|
+
);
|
|
80
99
|
} else {
|
|
81
|
-
data[f.name] = processTextFieldValue(
|
|
100
|
+
data[f.name] = processTextFieldValue(
|
|
101
|
+
data[f.name],
|
|
102
|
+
fieldTextIndexLength
|
|
103
|
+
);
|
|
82
104
|
}
|
|
83
105
|
} else if (f.type === "rich-text") {
|
|
84
106
|
const fieldTextIndexLength = f.maxSearchIndexFieldLength || textIndexLength;
|
|
@@ -152,5 +174,5 @@
|
|
|
152
174
|
exports2.parseSearchIndexResponse = parseSearchIndexResponse;
|
|
153
175
|
exports2.processDocumentForIndexing = processDocumentForIndexing;
|
|
154
176
|
exports2.queryToSearchIndexQuery = queryToSearchIndexQuery;
|
|
155
|
-
Object.
|
|
177
|
+
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
156
178
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tinacms/search",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index-client.es.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
]
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@tinacms/graphql": "1.4.
|
|
33
|
-
"@tinacms/schema-tools": "1.4.
|
|
32
|
+
"@tinacms/graphql": "1.4.20",
|
|
33
|
+
"@tinacms/schema-tools": "1.4.8",
|
|
34
34
|
"abstract-level": "^1.0.3",
|
|
35
35
|
"memory-level": "^1.0.0",
|
|
36
36
|
"module-error": "^1.0.2",
|
|
@@ -51,10 +51,10 @@
|
|
|
51
51
|
"@types/jest": "^26.0.4",
|
|
52
52
|
"@types/micromatch": "^4.0.2",
|
|
53
53
|
"@types/search-index": "^3.2.0",
|
|
54
|
-
"jest": "
|
|
55
|
-
"jest-diff": "
|
|
54
|
+
"jest": "^29.5.0",
|
|
55
|
+
"jest-diff": "^29.5.0",
|
|
56
56
|
"jest-file-snapshot": "^0.5.0",
|
|
57
|
-
"jest-matcher-utils": "
|
|
57
|
+
"jest-matcher-utils": "^29.5.0",
|
|
58
58
|
"typescript": "4.3.5"
|
|
59
59
|
},
|
|
60
60
|
"scripts": {
|