@webiny/api-opensearch 0.0.0-unstable.7be00a75a9 → 0.0.0-unstable.9609e4e0c9

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 (218) hide show
  1. package/client.js +1 -24
  2. package/client.js.map +1 -1
  3. package/exports/api/opensearch.d.ts +6 -1
  4. package/exports/api/opensearch.js +6 -1
  5. package/features/OpenSearchClient/abstraction.d.ts +3 -3
  6. package/features/OpenSearchClient/abstraction.js.map +1 -1
  7. package/features/OpenSearchClient/feature.d.ts +2 -1
  8. package/features/OpenSearchClient/feature.js +5 -3
  9. package/features/OpenSearchClient/feature.js.map +1 -1
  10. package/features/OpenSearchField/OpenSearchField.d.ts +18 -0
  11. package/{plugins/definition/OpenSearchFieldPlugin.js → features/OpenSearchField/OpenSearchField.js} +10 -13
  12. package/features/OpenSearchField/OpenSearchField.js.map +1 -0
  13. package/features/OpenSearchField/OpenSearchFieldFactory.d.ts +9 -0
  14. package/features/OpenSearchField/OpenSearchFieldFactory.js +14 -0
  15. package/features/OpenSearchField/OpenSearchFieldFactory.js.map +1 -0
  16. package/features/OpenSearchField/abstractions/OpenSearchField.d.ts +35 -0
  17. package/features/OpenSearchField/abstractions/OpenSearchField.js +6 -0
  18. package/features/OpenSearchField/abstractions/OpenSearchField.js.map +1 -0
  19. package/features/OpenSearchField/abstractions/OpenSearchFieldFactory.d.ts +8 -0
  20. package/features/OpenSearchField/abstractions/OpenSearchFieldFactory.js +5 -0
  21. package/features/OpenSearchField/abstractions/OpenSearchFieldFactory.js.map +1 -0
  22. package/features/OpenSearchField/feature.d.ts +4 -0
  23. package/features/OpenSearchField/feature.js +11 -0
  24. package/features/OpenSearchField/feature.js.map +1 -0
  25. package/features/OpenSearchIndex/OpenSearchIndexRegistry.d.ts +12 -0
  26. package/features/OpenSearchIndex/OpenSearchIndexRegistry.js +30 -0
  27. package/features/OpenSearchIndex/OpenSearchIndexRegistry.js.map +1 -0
  28. package/features/OpenSearchIndex/abstractions/OpenSearchIndex.d.ts +9 -0
  29. package/features/OpenSearchIndex/abstractions/OpenSearchIndex.js +5 -0
  30. package/features/OpenSearchIndex/abstractions/OpenSearchIndex.js.map +1 -0
  31. package/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.d.ts +9 -0
  32. package/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js +5 -0
  33. package/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js.map +1 -0
  34. package/features/OpenSearchIndex/feature.d.ts +4 -0
  35. package/features/OpenSearchIndex/feature.js +11 -0
  36. package/features/OpenSearchIndex/feature.js.map +1 -0
  37. package/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.d.ts +12 -0
  38. package/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.js +28 -0
  39. package/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.js.map +1 -0
  40. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.d.ts +11 -0
  41. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js +5 -0
  42. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js.map +1 -0
  43. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.d.ts +10 -0
  44. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.js +5 -0
  45. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.js.map +1 -0
  46. package/features/OpenSearchQueryBuilderOperator/feature.d.ts +4 -0
  47. package/features/OpenSearchQueryBuilderOperator/feature.js +41 -0
  48. package/features/OpenSearchQueryBuilderOperator/feature.js.map +1 -0
  49. package/features/OpenSearchQueryBuilderOperator/operators/AndIn.d.ts +9 -0
  50. package/{plugins/operator/andIn.js → features/OpenSearchQueryBuilderOperator/operators/AndIn.js} +8 -7
  51. package/features/OpenSearchQueryBuilderOperator/operators/AndIn.js.map +1 -0
  52. package/features/OpenSearchQueryBuilderOperator/operators/Between.d.ts +9 -0
  53. package/features/OpenSearchQueryBuilderOperator/operators/Between.js +27 -0
  54. package/features/OpenSearchQueryBuilderOperator/operators/Between.js.map +1 -0
  55. package/features/OpenSearchQueryBuilderOperator/operators/Contains.d.ts +9 -0
  56. package/features/OpenSearchQueryBuilderOperator/operators/Contains.js +27 -0
  57. package/features/OpenSearchQueryBuilderOperator/operators/Contains.js.map +1 -0
  58. package/features/OpenSearchQueryBuilderOperator/operators/Equal.d.ts +9 -0
  59. package/{plugins/operator/equal.js → features/OpenSearchQueryBuilderOperator/operators/Equal.js} +8 -7
  60. package/features/OpenSearchQueryBuilderOperator/operators/Equal.js.map +1 -0
  61. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThan.d.ts +9 -0
  62. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThan.js +23 -0
  63. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThan.js.map +1 -0
  64. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThanOrEqual.d.ts +9 -0
  65. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThanOrEqual.js +23 -0
  66. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThanOrEqual.js.map +1 -0
  67. package/features/OpenSearchQueryBuilderOperator/operators/In.d.ts +9 -0
  68. package/{plugins/operator/in.js → features/OpenSearchQueryBuilderOperator/operators/In.js} +8 -7
  69. package/features/OpenSearchQueryBuilderOperator/operators/In.js.map +1 -0
  70. package/features/OpenSearchQueryBuilderOperator/operators/LesserThan.d.ts +9 -0
  71. package/features/OpenSearchQueryBuilderOperator/operators/LesserThan.js +23 -0
  72. package/features/OpenSearchQueryBuilderOperator/operators/LesserThan.js.map +1 -0
  73. package/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.d.ts +9 -0
  74. package/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.js +23 -0
  75. package/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.js.map +1 -0
  76. package/features/OpenSearchQueryBuilderOperator/operators/Not.d.ts +9 -0
  77. package/{plugins/operator/not.js → features/OpenSearchQueryBuilderOperator/operators/Not.js} +8 -7
  78. package/features/OpenSearchQueryBuilderOperator/operators/Not.js.map +1 -0
  79. package/features/OpenSearchQueryBuilderOperator/operators/NotBetween.d.ts +9 -0
  80. package/features/OpenSearchQueryBuilderOperator/operators/NotBetween.js +27 -0
  81. package/features/OpenSearchQueryBuilderOperator/operators/NotBetween.js.map +1 -0
  82. package/features/OpenSearchQueryBuilderOperator/operators/NotContains.d.ts +9 -0
  83. package/features/OpenSearchQueryBuilderOperator/operators/NotContains.js +27 -0
  84. package/features/OpenSearchQueryBuilderOperator/operators/NotContains.js.map +1 -0
  85. package/features/OpenSearchQueryBuilderOperator/operators/NotIn.d.ts +9 -0
  86. package/{plugins/operator/notIn.js → features/OpenSearchQueryBuilderOperator/operators/NotIn.js} +8 -7
  87. package/features/OpenSearchQueryBuilderOperator/operators/NotIn.js.map +1 -0
  88. package/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.d.ts +9 -0
  89. package/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.js +22 -0
  90. package/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.js.map +1 -0
  91. package/features/OpenSearchQueryBuilderOperator/operators/StartsWith.d.ts +9 -0
  92. package/features/OpenSearchQueryBuilderOperator/operators/StartsWith.js +22 -0
  93. package/features/OpenSearchQueryBuilderOperator/operators/StartsWith.js.map +1 -0
  94. package/index.d.ts +2 -10
  95. package/index.js +3 -28
  96. package/indices.d.ts +2 -8
  97. package/indices.js +1 -12
  98. package/package.json +9 -12
  99. package/registerOpenSearchCore.d.ts +3 -0
  100. package/registerOpenSearchCore.js +20 -0
  101. package/registerOpenSearchCore.js.map +1 -0
  102. package/sort.d.ts +2 -2
  103. package/sort.js +2 -2
  104. package/sort.js.map +1 -1
  105. package/testing/createBlankQuery.d.ts +2 -0
  106. package/testing/createBlankQuery.js +9 -0
  107. package/testing/createBlankQuery.js.map +1 -0
  108. package/testing/createTestOpenSearchClient.d.ts +11 -0
  109. package/testing/createTestOpenSearchClient.js +162 -0
  110. package/testing/createTestOpenSearchClient.js.map +1 -0
  111. package/testing/index.d.ts +4 -0
  112. package/testing/index.js +4 -0
  113. package/testing/registerOpenSearchCoreForTests.d.ts +1 -0
  114. package/testing/registerOpenSearchCoreForTests.js +9 -0
  115. package/testing/registerOpenSearchCoreForTests.js.map +1 -0
  116. package/testing/setupTestIndexManager.d.ts +13 -0
  117. package/testing/setupTestIndexManager.js +26 -0
  118. package/testing/setupTestIndexManager.js.map +1 -0
  119. package/types.d.ts +0 -8
  120. package/types.js.map +1 -1
  121. package/utils/createIndex.d.ts +2 -2
  122. package/utils/createIndex.js +2 -8
  123. package/utils/createIndex.js.map +1 -1
  124. package/utils/waitUntilHealthy/WaitUntilHealthy.js +1 -2
  125. package/utils/waitUntilHealthy/WaitUntilHealthy.js.map +1 -1
  126. package/where.d.ts +4 -4
  127. package/where.js +5 -5
  128. package/where.js.map +1 -1
  129. package/db/entity.d.ts +0 -7
  130. package/db/entity.js +0 -18
  131. package/db/entity.js.map +0 -1
  132. package/db/index.d.ts +0 -3
  133. package/db/index.js +0 -3
  134. package/db/table.d.ts +0 -7
  135. package/db/table.js +0 -13
  136. package/db/table.js.map +0 -1
  137. package/db/types.d.ts +0 -6
  138. package/db/types.js +0 -0
  139. package/features/OpenSearchClient/OpenSearchClient.d.ts +0 -12
  140. package/features/OpenSearchClient/OpenSearchClient.js +0 -19
  141. package/features/OpenSearchClient/OpenSearchClient.js.map +0 -1
  142. package/features/OpenSearchContext/OpenSearchContext.d.ts +0 -8
  143. package/features/OpenSearchContext/OpenSearchContext.js +0 -14
  144. package/features/OpenSearchContext/OpenSearchContext.js.map +0 -1
  145. package/features/OpenSearchContext/abstraction.d.ts +0 -14
  146. package/features/OpenSearchContext/abstraction.js +0 -5
  147. package/features/OpenSearchContext/abstraction.js.map +0 -1
  148. package/features/OpenSearchContext/feature.d.ts +0 -5
  149. package/features/OpenSearchContext/feature.js +0 -12
  150. package/features/OpenSearchContext/feature.js.map +0 -1
  151. package/index.js.map +0 -1
  152. package/indices.js.map +0 -1
  153. package/operators.d.ts +0 -6
  154. package/operators.js +0 -22
  155. package/operators.js.map +0 -1
  156. package/plugins/definition/OpenSearchBodyModifierPlugin.d.ts +0 -13
  157. package/plugins/definition/OpenSearchBodyModifierPlugin.js +0 -17
  158. package/plugins/definition/OpenSearchBodyModifierPlugin.js.map +0 -1
  159. package/plugins/definition/OpenSearchFieldPlugin.d.ts +0 -81
  160. package/plugins/definition/OpenSearchFieldPlugin.js.map +0 -1
  161. package/plugins/definition/OpenSearchIndexPlugin.d.ts +0 -10
  162. package/plugins/definition/OpenSearchIndexPlugin.js +0 -16
  163. package/plugins/definition/OpenSearchIndexPlugin.js.map +0 -1
  164. package/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.d.ts +0 -10
  165. package/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js +0 -9
  166. package/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js.map +0 -1
  167. package/plugins/definition/OpenSearchQueryModifierPlugin.d.ts +0 -14
  168. package/plugins/definition/OpenSearchQueryModifierPlugin.js +0 -17
  169. package/plugins/definition/OpenSearchQueryModifierPlugin.js.map +0 -1
  170. package/plugins/definition/OpenSearchSortModifierPlugin.d.ts +0 -13
  171. package/plugins/definition/OpenSearchSortModifierPlugin.js +0 -17
  172. package/plugins/definition/OpenSearchSortModifierPlugin.js.map +0 -1
  173. package/plugins/definition/index.d.ts +0 -6
  174. package/plugins/definition/index.js +0 -6
  175. package/plugins/index.d.ts +0 -2
  176. package/plugins/index.js +0 -2
  177. package/plugins/operator/andIn.d.ts +0 -7
  178. package/plugins/operator/andIn.js.map +0 -1
  179. package/plugins/operator/between.d.ts +0 -7
  180. package/plugins/operator/between.js +0 -26
  181. package/plugins/operator/between.js.map +0 -1
  182. package/plugins/operator/contains.d.ts +0 -7
  183. package/plugins/operator/contains.js +0 -26
  184. package/plugins/operator/contains.js.map +0 -1
  185. package/plugins/operator/equal.d.ts +0 -7
  186. package/plugins/operator/equal.js.map +0 -1
  187. package/plugins/operator/gt.d.ts +0 -7
  188. package/plugins/operator/gt.js +0 -22
  189. package/plugins/operator/gt.js.map +0 -1
  190. package/plugins/operator/gte.d.ts +0 -7
  191. package/plugins/operator/gte.js +0 -22
  192. package/plugins/operator/gte.js.map +0 -1
  193. package/plugins/operator/in.d.ts +0 -7
  194. package/plugins/operator/in.js.map +0 -1
  195. package/plugins/operator/index.d.ts +0 -15
  196. package/plugins/operator/index.js +0 -15
  197. package/plugins/operator/lt.d.ts +0 -7
  198. package/plugins/operator/lt.js +0 -22
  199. package/plugins/operator/lt.js.map +0 -1
  200. package/plugins/operator/lte.d.ts +0 -7
  201. package/plugins/operator/lte.js +0 -22
  202. package/plugins/operator/lte.js.map +0 -1
  203. package/plugins/operator/not.d.ts +0 -7
  204. package/plugins/operator/not.js.map +0 -1
  205. package/plugins/operator/notBetween.d.ts +0 -7
  206. package/plugins/operator/notBetween.js +0 -26
  207. package/plugins/operator/notBetween.js.map +0 -1
  208. package/plugins/operator/notContains.d.ts +0 -7
  209. package/plugins/operator/notContains.js +0 -26
  210. package/plugins/operator/notContains.js.map +0 -1
  211. package/plugins/operator/notIn.d.ts +0 -7
  212. package/plugins/operator/notIn.js.map +0 -1
  213. package/plugins/operator/notStartsWith.d.ts +0 -7
  214. package/plugins/operator/notStartsWith.js +0 -21
  215. package/plugins/operator/notStartsWith.js.map +0 -1
  216. package/plugins/operator/startsWith.d.ts +0 -7
  217. package/plugins/operator/startsWith.js +0 -21
  218. package/plugins/operator/startsWith.js.map +0 -1
@@ -1,26 +0,0 @@
1
- import { OpenSearchQueryBuilderOperatorPlugin } from "../definition/OpenSearchQueryBuilderOperatorPlugin.js";
2
- class OpenSearchQueryBuilderOperatorNotBetweenPlugin extends OpenSearchQueryBuilderOperatorPlugin {
3
- getOperator() {
4
- return "not_between";
5
- }
6
- apply(query, params) {
7
- const { value, basePath, name } = params;
8
- if (false === Array.isArray(value)) throw new Error(`You cannot filter field path "${name}" with "not_between" query and not send an array of values.`);
9
- if (2 !== value.length) throw new Error(`You must pass 2 values in the array for field path "${name}" filtering.`);
10
- const [gte, lte] = value;
11
- query.must_not.push({
12
- range: {
13
- [basePath]: {
14
- lte,
15
- gte
16
- }
17
- }
18
- });
19
- }
20
- constructor(...args){
21
- super(...args), this.name = "opensearch.queryBuilder.operator.notBetween.default";
22
- }
23
- }
24
- export { OpenSearchQueryBuilderOperatorNotBetweenPlugin };
25
-
26
- //# sourceMappingURL=notBetween.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/operator/notBetween.js","sources":["../../../src/plugins/operator/notBetween.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperatorPlugin } from \"~/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js\";\nimport type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from \"~/types.js\";\n\nexport class OpenSearchQueryBuilderOperatorNotBetweenPlugin extends OpenSearchQueryBuilderOperatorPlugin {\n public override name = \"opensearch.queryBuilder.operator.notBetween.default\";\n\n public getOperator(): string {\n return \"not_between\";\n }\n\n public apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void {\n const { value, basePath, name } = params;\n if (Array.isArray(value) === false) {\n throw new Error(\n `You cannot filter field path \"${name}\" with \"not_between\" query and not send an array of values.`\n );\n } else if (value.length !== 2) {\n throw new Error(\n `You must pass 2 values in the array for field path \"${name}\" filtering.`\n );\n }\n // we take gte first because it should be a lesser value than lte, eg [5, 10]\n // 6 >= gte && 6 <= lte === true which in this case it means that record will not match\n const [gte, lte] = value;\n query.must_not.push({\n range: {\n [basePath]: {\n lte,\n gte\n }\n }\n });\n }\n}\n"],"names":["OpenSearchQueryBuilderOperatorNotBetweenPlugin","OpenSearchQueryBuilderOperatorPlugin","query","params","value","basePath","name","Array","Error","gte","lte"],"mappings":";AAGO,MAAMA,uDAAuDC;IAGzD,cAAsB;QACzB,OAAO;IACX;IAEO,MAAMC,KAAgC,EAAEC,MAAwC,EAAQ;QAC3F,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGH;QAClC,IAAII,AAAyB,UAAzBA,MAAM,OAAO,CAACH,QACd,MAAM,IAAII,MACN,CAAC,8BAA8B,EAAEF,KAAK,2DAA2D,CAAC;QAEnG,IAAIF,AAAiB,MAAjBA,MAAM,MAAM,EACnB,MAAM,IAAII,MACN,CAAC,oDAAoD,EAAEF,KAAK,YAAY,CAAC;QAKjF,MAAM,CAACG,KAAKC,IAAI,GAAGN;QACnBF,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,OAAO;gBACH,CAACG,SAAS,EAAE;oBACRK;oBACAD;gBACJ;YACJ;QACJ;IACJ;;QA7BG,qBACa,IAAI,GAAG;;AA6B3B"}
@@ -1,7 +0,0 @@
1
- import { OpenSearchQueryBuilderOperatorPlugin } from "../../plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js";
2
- import type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from "../../types.js";
3
- export declare class OpenSearchQueryBuilderOperatorNotContainsPlugin extends OpenSearchQueryBuilderOperatorPlugin {
4
- name: string;
5
- getOperator(): string;
6
- apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void;
7
- }
@@ -1,26 +0,0 @@
1
- import { OpenSearchQueryBuilderOperatorPlugin } from "../definition/OpenSearchQueryBuilderOperatorPlugin.js";
2
- import { normalizeValueWithAsterisk } from "../../normalize.js";
3
- class OpenSearchQueryBuilderOperatorNotContainsPlugin extends OpenSearchQueryBuilderOperatorPlugin {
4
- getOperator() {
5
- return "not_contains";
6
- }
7
- apply(query, params) {
8
- const { value, basePath } = params;
9
- query.must_not.push({
10
- query_string: {
11
- allow_leading_wildcard: true,
12
- fields: [
13
- basePath
14
- ],
15
- query: normalizeValueWithAsterisk(value),
16
- default_operator: "and"
17
- }
18
- });
19
- }
20
- constructor(...args){
21
- super(...args), this.name = "opensearch.queryBuilder.operator.notContains.default";
22
- }
23
- }
24
- export { OpenSearchQueryBuilderOperatorNotContainsPlugin };
25
-
26
- //# sourceMappingURL=notContains.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/operator/notContains.js","sources":["../../../src/plugins/operator/notContains.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperatorPlugin } from \"~/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js\";\nimport { normalizeValueWithAsterisk } from \"~/normalize.js\";\nimport type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from \"~/types.js\";\n\nexport class OpenSearchQueryBuilderOperatorNotContainsPlugin extends OpenSearchQueryBuilderOperatorPlugin {\n public override name = \"opensearch.queryBuilder.operator.notContains.default\";\n\n public getOperator(): string {\n return \"not_contains\";\n }\n\n public apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void {\n const { value, basePath } = params;\n query.must_not.push({\n query_string: {\n allow_leading_wildcard: true,\n fields: [basePath],\n query: normalizeValueWithAsterisk(value),\n default_operator: \"and\"\n }\n });\n }\n}\n"],"names":["OpenSearchQueryBuilderOperatorNotContainsPlugin","OpenSearchQueryBuilderOperatorPlugin","query","params","value","basePath","normalizeValueWithAsterisk"],"mappings":";;AAIO,MAAMA,wDAAwDC;IAG1D,cAAsB;QACzB,OAAO;IACX;IAEO,MAAMC,KAAgC,EAAEC,MAAwC,EAAQ;QAC3F,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5BD,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,cAAc;gBACV,wBAAwB;gBACxB,QAAQ;oBAACG;iBAAS;gBAClB,OAAOC,2BAA2BF;gBAClC,kBAAkB;YACtB;QACJ;IACJ;;QAjBG,qBACa,IAAI,GAAG;;AAiB3B"}
@@ -1,7 +0,0 @@
1
- import { OpenSearchQueryBuilderOperatorPlugin } from "../../plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js";
2
- import type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from "../../types.js";
3
- export declare class OpenSearchQueryBuilderOperatorNotInPlugin extends OpenSearchQueryBuilderOperatorPlugin {
4
- name: string;
5
- getOperator(): string;
6
- apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void;
7
- }
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/operator/notIn.js","sources":["../../../src/plugins/operator/notIn.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperatorPlugin } from \"~/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js\";\nimport type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from \"~/types.js\";\n\nexport class OpenSearchQueryBuilderOperatorNotInPlugin extends OpenSearchQueryBuilderOperatorPlugin {\n public override name = \"opensearch.queryBuilder.operator.notIn.default\";\n\n public getOperator(): string {\n return \"not_in\";\n }\n\n public apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void {\n const { value: values, path, basePath, name } = params;\n const isArray = Array.isArray(values);\n if (isArray === false || values.length === 0) {\n throw new Error(\n `You cannot filter field \"${name}\" with \"not_in\" operator and not send an array of values.`\n );\n }\n\n const useBasePath = values.some(\n (value: string | number | boolean | null | undefined) => typeof value !== \"string\"\n );\n\n query.must_not.push({\n terms: {\n [useBasePath ? basePath : path]: values\n }\n });\n }\n}\n"],"names":["OpenSearchQueryBuilderOperatorNotInPlugin","OpenSearchQueryBuilderOperatorPlugin","query","params","values","path","basePath","name","isArray","Array","Error","useBasePath","value"],"mappings":";AAGO,MAAMA,kDAAkDC;IAGpD,cAAsB;QACzB,OAAO;IACX;IAEO,MAAMC,KAAgC,EAAEC,MAAwC,EAAQ;QAC3F,MAAM,EAAE,OAAOC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGJ;QAChD,MAAMK,UAAUC,MAAM,OAAO,CAACL;QAC9B,IAAII,AAAY,UAAZA,WAAqBJ,AAAkB,MAAlBA,OAAO,MAAM,EAClC,MAAM,IAAIM,MACN,CAAC,yBAAyB,EAAEH,KAAK,yDAAyD,CAAC;QAInG,MAAMI,cAAcP,OAAO,IAAI,CAC3B,CAACQ,QAAwD,AAAiB,YAAjB,OAAOA;QAGpEV,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,OAAO;gBACH,CAACS,cAAcL,WAAWD,KAAK,EAAED;YACrC;QACJ;IACJ;;QAzBG,qBACa,IAAI,GAAG;;AAyB3B"}
@@ -1,7 +0,0 @@
1
- import { OpenSearchQueryBuilderOperatorPlugin } from "../../plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js";
2
- import type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from "../../types.js";
3
- export declare class OpenSearchQueryBuilderOperatorNotStartsWithPlugin extends OpenSearchQueryBuilderOperatorPlugin {
4
- name: string;
5
- getOperator(): string;
6
- apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void;
7
- }
@@ -1,21 +0,0 @@
1
- import { OpenSearchQueryBuilderOperatorPlugin } from "../definition/OpenSearchQueryBuilderOperatorPlugin.js";
2
- class OpenSearchQueryBuilderOperatorNotStartsWithPlugin extends OpenSearchQueryBuilderOperatorPlugin {
3
- getOperator() {
4
- return "not_startsWith";
5
- }
6
- apply(query, params) {
7
- const { value, basePath } = params;
8
- if ("" === value || null == value) return;
9
- query.must_not.push({
10
- match_phrase_prefix: {
11
- [basePath]: value
12
- }
13
- });
14
- }
15
- constructor(...args){
16
- super(...args), this.name = "opensearch.queryBuilder.operator.notStartsWith.default";
17
- }
18
- }
19
- export { OpenSearchQueryBuilderOperatorNotStartsWithPlugin };
20
-
21
- //# sourceMappingURL=notStartsWith.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/operator/notStartsWith.js","sources":["../../../src/plugins/operator/notStartsWith.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperatorPlugin } from \"~/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js\";\nimport type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from \"~/types.js\";\n\nexport class OpenSearchQueryBuilderOperatorNotStartsWithPlugin extends OpenSearchQueryBuilderOperatorPlugin {\n public override name = \"opensearch.queryBuilder.operator.notStartsWith.default\";\n\n public getOperator(): string {\n return \"not_startsWith\";\n }\n\n public apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void {\n const { value, basePath } = params;\n if (value === \"\" || value === null || value === undefined) {\n return;\n }\n query.must_not.push({\n match_phrase_prefix: {\n [basePath]: value\n }\n });\n }\n}\n"],"names":["OpenSearchQueryBuilderOperatorNotStartsWithPlugin","OpenSearchQueryBuilderOperatorPlugin","query","params","value","basePath"],"mappings":";AAGO,MAAMA,0DAA0DC;IAG5D,cAAsB;QACzB,OAAO;IACX;IAEO,MAAMC,KAAgC,EAAEC,MAAwC,EAAQ;QAC3F,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5B,IAAIC,AAAU,OAAVA,SAAkCA,QAAlBA,OAChB;QAEJF,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,qBAAqB;gBACjB,CAACG,SAAS,EAAED;YAChB;QACJ;IACJ;;QAjBG,qBACa,IAAI,GAAG;;AAiB3B"}
@@ -1,7 +0,0 @@
1
- import { OpenSearchQueryBuilderOperatorPlugin } from "../../plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js";
2
- import type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from "../../types.js";
3
- export declare class OpenSearchQueryBuilderOperatorStartsWithPlugin extends OpenSearchQueryBuilderOperatorPlugin {
4
- name: string;
5
- getOperator(): string;
6
- apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void;
7
- }
@@ -1,21 +0,0 @@
1
- import { OpenSearchQueryBuilderOperatorPlugin } from "../definition/OpenSearchQueryBuilderOperatorPlugin.js";
2
- class OpenSearchQueryBuilderOperatorStartsWithPlugin extends OpenSearchQueryBuilderOperatorPlugin {
3
- getOperator() {
4
- return "startsWith";
5
- }
6
- apply(query, params) {
7
- const { value, basePath } = params;
8
- if ("" === value || null == value) return;
9
- query.filter.push({
10
- match_phrase_prefix: {
11
- [basePath]: value
12
- }
13
- });
14
- }
15
- constructor(...args){
16
- super(...args), this.name = "opensearch.queryBuilder.operator.startsWith.default";
17
- }
18
- }
19
- export { OpenSearchQueryBuilderOperatorStartsWithPlugin };
20
-
21
- //# sourceMappingURL=startsWith.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugins/operator/startsWith.js","sources":["../../../src/plugins/operator/startsWith.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperatorPlugin } from \"~/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js\";\nimport type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from \"~/types.js\";\n\nexport class OpenSearchQueryBuilderOperatorStartsWithPlugin extends OpenSearchQueryBuilderOperatorPlugin {\n public override name = \"opensearch.queryBuilder.operator.startsWith.default\";\n\n public getOperator(): string {\n return \"startsWith\";\n }\n\n public apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void {\n const { value, basePath } = params;\n if (value === \"\" || value === null || value === undefined) {\n return;\n }\n query.filter.push({\n match_phrase_prefix: {\n [basePath]: value\n }\n });\n }\n}\n"],"names":["OpenSearchQueryBuilderOperatorStartsWithPlugin","OpenSearchQueryBuilderOperatorPlugin","query","params","value","basePath"],"mappings":";AAGO,MAAMA,uDAAuDC;IAGzD,cAAsB;QACzB,OAAO;IACX;IAEO,MAAMC,KAAgC,EAAEC,MAAwC,EAAQ;QAC3F,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5B,IAAIC,AAAU,OAAVA,SAAkCA,QAAlBA,OAChB;QAEJF,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,qBAAqB;gBACjB,CAACG,SAAS,EAAED;YAChB;QACJ;IACJ;;QAjBG,qBACa,IAAI,GAAG;;AAiB3B"}