@webiny/api-opensearch 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.eb81deee7e

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 (282) hide show
  1. package/client.js +30 -63
  2. package/client.js.map +1 -1
  3. package/cursors.js +20 -32
  4. package/cursors.js.map +1 -1
  5. package/exports/api/opensearch.d.ts +6 -1
  6. package/exports/api/opensearch.js +6 -3
  7. package/features/OpenSearchClient/abstraction.d.ts +3 -3
  8. package/features/OpenSearchClient/abstraction.js +2 -1
  9. package/features/OpenSearchClient/abstraction.js.map +1 -1
  10. package/features/OpenSearchClient/feature.d.ts +2 -1
  11. package/features/OpenSearchClient/feature.js +9 -6
  12. package/features/OpenSearchClient/feature.js.map +1 -1
  13. package/features/OpenSearchClientFactory/OpenSearchClientFactory.js +8 -9
  14. package/features/OpenSearchClientFactory/OpenSearchClientFactory.js.map +1 -1
  15. package/features/OpenSearchClientFactory/abstraction.js +2 -1
  16. package/features/OpenSearchClientFactory/abstraction.js.map +1 -1
  17. package/features/OpenSearchClientFactory/feature.js +6 -5
  18. package/features/OpenSearchClientFactory/feature.js.map +1 -1
  19. package/features/OpenSearchField/OpenSearchField.d.ts +18 -0
  20. package/features/OpenSearchField/OpenSearchField.js +49 -0
  21. package/features/OpenSearchField/OpenSearchField.js.map +1 -0
  22. package/features/OpenSearchField/OpenSearchFieldFactory.d.ts +9 -0
  23. package/features/OpenSearchField/OpenSearchFieldFactory.js +14 -0
  24. package/features/OpenSearchField/OpenSearchFieldFactory.js.map +1 -0
  25. package/features/OpenSearchField/abstractions/OpenSearchField.d.ts +35 -0
  26. package/features/OpenSearchField/abstractions/OpenSearchField.js +6 -0
  27. package/features/OpenSearchField/abstractions/OpenSearchField.js.map +1 -0
  28. package/features/OpenSearchField/abstractions/OpenSearchFieldFactory.d.ts +8 -0
  29. package/features/OpenSearchField/abstractions/OpenSearchFieldFactory.js +5 -0
  30. package/features/OpenSearchField/abstractions/OpenSearchFieldFactory.js.map +1 -0
  31. package/features/OpenSearchField/feature.d.ts +4 -0
  32. package/features/OpenSearchField/feature.js +11 -0
  33. package/features/OpenSearchField/feature.js.map +1 -0
  34. package/features/OpenSearchIndex/OpenSearchIndexRegistry.d.ts +12 -0
  35. package/features/OpenSearchIndex/OpenSearchIndexRegistry.js +30 -0
  36. package/features/OpenSearchIndex/OpenSearchIndexRegistry.js.map +1 -0
  37. package/features/OpenSearchIndex/abstractions/OpenSearchIndex.d.ts +9 -0
  38. package/features/OpenSearchIndex/abstractions/OpenSearchIndex.js +5 -0
  39. package/features/OpenSearchIndex/abstractions/OpenSearchIndex.js.map +1 -0
  40. package/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.d.ts +9 -0
  41. package/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js +5 -0
  42. package/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js.map +1 -0
  43. package/features/OpenSearchIndex/feature.d.ts +4 -0
  44. package/features/OpenSearchIndex/feature.js +11 -0
  45. package/features/OpenSearchIndex/feature.js.map +1 -0
  46. package/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.d.ts +12 -0
  47. package/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.js +28 -0
  48. package/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.js.map +1 -0
  49. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.d.ts +11 -0
  50. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js +5 -0
  51. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js.map +1 -0
  52. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.d.ts +10 -0
  53. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.js +5 -0
  54. package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.js.map +1 -0
  55. package/features/OpenSearchQueryBuilderOperator/feature.d.ts +4 -0
  56. package/features/OpenSearchQueryBuilderOperator/feature.js +41 -0
  57. package/features/OpenSearchQueryBuilderOperator/feature.js.map +1 -0
  58. package/features/OpenSearchQueryBuilderOperator/operators/AndIn.d.ts +9 -0
  59. package/features/OpenSearchQueryBuilderOperator/operators/AndIn.js +28 -0
  60. package/features/OpenSearchQueryBuilderOperator/operators/AndIn.js.map +1 -0
  61. package/features/OpenSearchQueryBuilderOperator/operators/Between.d.ts +9 -0
  62. package/features/OpenSearchQueryBuilderOperator/operators/Between.js +27 -0
  63. package/features/OpenSearchQueryBuilderOperator/operators/Between.js.map +1 -0
  64. package/features/OpenSearchQueryBuilderOperator/operators/Contains.d.ts +9 -0
  65. package/features/OpenSearchQueryBuilderOperator/operators/Contains.js +27 -0
  66. package/features/OpenSearchQueryBuilderOperator/operators/Contains.js.map +1 -0
  67. package/features/OpenSearchQueryBuilderOperator/operators/Equal.d.ts +9 -0
  68. package/features/OpenSearchQueryBuilderOperator/operators/Equal.js +34 -0
  69. package/features/OpenSearchQueryBuilderOperator/operators/Equal.js.map +1 -0
  70. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThan.d.ts +9 -0
  71. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThan.js +23 -0
  72. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThan.js.map +1 -0
  73. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThanOrEqual.d.ts +9 -0
  74. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThanOrEqual.js +23 -0
  75. package/features/OpenSearchQueryBuilderOperator/operators/GreaterThanOrEqual.js.map +1 -0
  76. package/features/OpenSearchQueryBuilderOperator/operators/In.d.ts +9 -0
  77. package/features/OpenSearchQueryBuilderOperator/operators/In.js +24 -0
  78. package/features/OpenSearchQueryBuilderOperator/operators/In.js.map +1 -0
  79. package/features/OpenSearchQueryBuilderOperator/operators/LesserThan.d.ts +9 -0
  80. package/features/OpenSearchQueryBuilderOperator/operators/LesserThan.js +23 -0
  81. package/features/OpenSearchQueryBuilderOperator/operators/LesserThan.js.map +1 -0
  82. package/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.d.ts +9 -0
  83. package/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.js +23 -0
  84. package/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.js.map +1 -0
  85. package/features/OpenSearchQueryBuilderOperator/operators/Not.d.ts +9 -0
  86. package/features/OpenSearchQueryBuilderOperator/operators/Not.js +38 -0
  87. package/features/OpenSearchQueryBuilderOperator/operators/Not.js.map +1 -0
  88. package/features/OpenSearchQueryBuilderOperator/operators/NotBetween.d.ts +9 -0
  89. package/features/OpenSearchQueryBuilderOperator/operators/NotBetween.js +27 -0
  90. package/features/OpenSearchQueryBuilderOperator/operators/NotBetween.js.map +1 -0
  91. package/features/OpenSearchQueryBuilderOperator/operators/NotContains.d.ts +9 -0
  92. package/features/OpenSearchQueryBuilderOperator/operators/NotContains.js +27 -0
  93. package/features/OpenSearchQueryBuilderOperator/operators/NotContains.js.map +1 -0
  94. package/features/OpenSearchQueryBuilderOperator/operators/NotIn.d.ts +9 -0
  95. package/features/OpenSearchQueryBuilderOperator/operators/NotIn.js +24 -0
  96. package/features/OpenSearchQueryBuilderOperator/operators/NotIn.js.map +1 -0
  97. package/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.d.ts +9 -0
  98. package/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.js +22 -0
  99. package/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.js.map +1 -0
  100. package/features/OpenSearchQueryBuilderOperator/operators/StartsWith.d.ts +9 -0
  101. package/features/OpenSearchQueryBuilderOperator/operators/StartsWith.js +22 -0
  102. package/features/OpenSearchQueryBuilderOperator/operators/StartsWith.js.map +1 -0
  103. package/index.d.ts +2 -10
  104. package/index.js +3 -30
  105. package/indexConfiguration/base.js +25 -26
  106. package/indexConfiguration/base.js.map +1 -1
  107. package/indexConfiguration/common.js +39 -41
  108. package/indexConfiguration/common.js.map +1 -1
  109. package/indexConfiguration/index.js +0 -2
  110. package/indexPrefix.js +2 -3
  111. package/indexPrefix.js.map +1 -1
  112. package/indices.d.ts +2 -8
  113. package/indices.js +1 -20
  114. package/limit.js +5 -27
  115. package/limit.js.map +1 -1
  116. package/normalize.js +50 -49
  117. package/normalize.js.map +1 -1
  118. package/operations/OpenSearchCatHealth.js +24 -25
  119. package/operations/OpenSearchCatHealth.js.map +1 -1
  120. package/operations/OpenSearchCatNodes.js +22 -23
  121. package/operations/OpenSearchCatNodes.js.map +1 -1
  122. package/operations/index.js +0 -2
  123. package/operations/stripConnectionFromException.js +11 -14
  124. package/operations/stripConnectionFromException.js.map +1 -1
  125. package/operations/types.js +6 -5
  126. package/operations/types.js.map +1 -1
  127. package/package.json +12 -14
  128. package/registerOpenSearchCore.d.ts +3 -0
  129. package/registerOpenSearchCore.js +20 -0
  130. package/registerOpenSearchCore.js.map +1 -0
  131. package/sharedIndex.js +2 -3
  132. package/sharedIndex.js.map +1 -1
  133. package/sort.d.ts +2 -2
  134. package/sort.js +30 -59
  135. package/sort.js.map +1 -1
  136. package/testing/createBlankQuery.d.ts +2 -0
  137. package/testing/createBlankQuery.js +9 -0
  138. package/testing/createBlankQuery.js.map +1 -0
  139. package/testing/createTestOpenSearchClient.d.ts +11 -0
  140. package/testing/createTestOpenSearchClient.js +162 -0
  141. package/testing/createTestOpenSearchClient.js.map +1 -0
  142. package/testing/index.d.ts +4 -0
  143. package/testing/index.js +4 -0
  144. package/testing/registerOpenSearchCoreForTests.d.ts +1 -0
  145. package/testing/registerOpenSearchCoreForTests.js +9 -0
  146. package/testing/registerOpenSearchCoreForTests.js.map +1 -0
  147. package/testing/setupTestIndexManager.d.ts +13 -0
  148. package/testing/setupTestIndexManager.js +26 -0
  149. package/testing/setupTestIndexManager.js.map +1 -0
  150. package/types.d.ts +0 -8
  151. package/types.js +5 -65
  152. package/types.js.map +1 -1
  153. package/utils/createIndex.d.ts +2 -2
  154. package/utils/createIndex.js +52 -80
  155. package/utils/createIndex.js.map +1 -1
  156. package/utils/index.js +0 -2
  157. package/utils/waitUntilHealthy/UnhealthyClusterError.js +8 -7
  158. package/utils/waitUntilHealthy/UnhealthyClusterError.js.map +1 -1
  159. package/utils/waitUntilHealthy/WaitUntilHealthy.js +111 -141
  160. package/utils/waitUntilHealthy/WaitUntilHealthy.js.map +1 -1
  161. package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js +8 -7
  162. package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js.map +1 -1
  163. package/utils/waitUntilHealthy/index.js +0 -2
  164. package/utils/waitUntilHealthy/reason/ClusterHealthReason.js +9 -10
  165. package/utils/waitUntilHealthy/reason/ClusterHealthReason.js.map +1 -1
  166. package/utils/waitUntilHealthy/reason/IReason.js +0 -3
  167. package/utils/waitUntilHealthy/reason/MemoryReason.js +9 -10
  168. package/utils/waitUntilHealthy/reason/MemoryReason.js.map +1 -1
  169. package/utils/waitUntilHealthy/reason/ProcessorReason.js +9 -10
  170. package/utils/waitUntilHealthy/reason/ProcessorReason.js.map +1 -1
  171. package/utils/waitUntilHealthy/reason/index.js +0 -2
  172. package/where.d.ts +4 -4
  173. package/where.js +43 -76
  174. package/where.js.map +1 -1
  175. package/db/entity.d.ts +0 -7
  176. package/db/entity.js +0 -20
  177. package/db/entity.js.map +0 -1
  178. package/db/index.d.ts +0 -3
  179. package/db/index.js +0 -5
  180. package/db/index.js.map +0 -1
  181. package/db/table.d.ts +0 -7
  182. package/db/table.js +0 -17
  183. package/db/table.js.map +0 -1
  184. package/db/types.d.ts +0 -6
  185. package/db/types.js +0 -3
  186. package/db/types.js.map +0 -1
  187. package/exports/api/opensearch.js.map +0 -1
  188. package/features/OpenSearchClient/OpenSearchClient.d.ts +0 -12
  189. package/features/OpenSearchClient/OpenSearchClient.js +0 -16
  190. package/features/OpenSearchClient/OpenSearchClient.js.map +0 -1
  191. package/features/OpenSearchContext/OpenSearchContext.d.ts +0 -8
  192. package/features/OpenSearchContext/OpenSearchContext.js +0 -13
  193. package/features/OpenSearchContext/OpenSearchContext.js.map +0 -1
  194. package/features/OpenSearchContext/abstraction.d.ts +0 -14
  195. package/features/OpenSearchContext/abstraction.js +0 -4
  196. package/features/OpenSearchContext/abstraction.js.map +0 -1
  197. package/features/OpenSearchContext/feature.d.ts +0 -5
  198. package/features/OpenSearchContext/feature.js +0 -13
  199. package/features/OpenSearchContext/feature.js.map +0 -1
  200. package/index.js.map +0 -1
  201. package/indexConfiguration/index.js.map +0 -1
  202. package/indices.js.map +0 -1
  203. package/operations/index.js.map +0 -1
  204. package/operators.d.ts +0 -6
  205. package/operators.js +0 -9
  206. package/operators.js.map +0 -1
  207. package/plugins/definition/OpenSearchBodyModifierPlugin.d.ts +0 -13
  208. package/plugins/definition/OpenSearchBodyModifierPlugin.js +0 -18
  209. package/plugins/definition/OpenSearchBodyModifierPlugin.js.map +0 -1
  210. package/plugins/definition/OpenSearchFieldPlugin.d.ts +0 -81
  211. package/plugins/definition/OpenSearchFieldPlugin.js +0 -69
  212. package/plugins/definition/OpenSearchFieldPlugin.js.map +0 -1
  213. package/plugins/definition/OpenSearchIndexPlugin.d.ts +0 -10
  214. package/plugins/definition/OpenSearchIndexPlugin.js +0 -17
  215. package/plugins/definition/OpenSearchIndexPlugin.js.map +0 -1
  216. package/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.d.ts +0 -10
  217. package/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js +0 -9
  218. package/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js.map +0 -1
  219. package/plugins/definition/OpenSearchQueryModifierPlugin.d.ts +0 -14
  220. package/plugins/definition/OpenSearchQueryModifierPlugin.js +0 -18
  221. package/plugins/definition/OpenSearchQueryModifierPlugin.js.map +0 -1
  222. package/plugins/definition/OpenSearchSortModifierPlugin.d.ts +0 -13
  223. package/plugins/definition/OpenSearchSortModifierPlugin.js +0 -18
  224. package/plugins/definition/OpenSearchSortModifierPlugin.js.map +0 -1
  225. package/plugins/definition/index.d.ts +0 -6
  226. package/plugins/definition/index.js +0 -8
  227. package/plugins/definition/index.js.map +0 -1
  228. package/plugins/index.d.ts +0 -2
  229. package/plugins/index.js +0 -4
  230. package/plugins/index.js.map +0 -1
  231. package/plugins/operator/andIn.d.ts +0 -7
  232. package/plugins/operator/andIn.js +0 -35
  233. package/plugins/operator/andIn.js.map +0 -1
  234. package/plugins/operator/between.d.ts +0 -7
  235. package/plugins/operator/between.js +0 -32
  236. package/plugins/operator/between.js.map +0 -1
  237. package/plugins/operator/contains.d.ts +0 -7
  238. package/plugins/operator/contains.js +0 -24
  239. package/plugins/operator/contains.js.map +0 -1
  240. package/plugins/operator/equal.d.ts +0 -7
  241. package/plugins/operator/equal.js +0 -50
  242. package/plugins/operator/equal.js.map +0 -1
  243. package/plugins/operator/gt.d.ts +0 -7
  244. package/plugins/operator/gt.js +0 -22
  245. package/plugins/operator/gt.js.map +0 -1
  246. package/plugins/operator/gte.d.ts +0 -7
  247. package/plugins/operator/gte.js +0 -22
  248. package/plugins/operator/gte.js.map +0 -1
  249. package/plugins/operator/in.d.ts +0 -7
  250. package/plugins/operator/in.js +0 -29
  251. package/plugins/operator/in.js.map +0 -1
  252. package/plugins/operator/index.d.ts +0 -15
  253. package/plugins/operator/index.js +0 -17
  254. package/plugins/operator/index.js.map +0 -1
  255. package/plugins/operator/lt.d.ts +0 -7
  256. package/plugins/operator/lt.js +0 -22
  257. package/plugins/operator/lt.js.map +0 -1
  258. package/plugins/operator/lte.d.ts +0 -7
  259. package/plugins/operator/lte.js +0 -22
  260. package/plugins/operator/lte.js.map +0 -1
  261. package/plugins/operator/not.d.ts +0 -7
  262. package/plugins/operator/not.js +0 -44
  263. package/plugins/operator/not.js.map +0 -1
  264. package/plugins/operator/notBetween.d.ts +0 -7
  265. package/plugins/operator/notBetween.js +0 -32
  266. package/plugins/operator/notBetween.js.map +0 -1
  267. package/plugins/operator/notContains.d.ts +0 -7
  268. package/plugins/operator/notContains.js +0 -24
  269. package/plugins/operator/notContains.js.map +0 -1
  270. package/plugins/operator/notIn.d.ts +0 -7
  271. package/plugins/operator/notIn.js +0 -27
  272. package/plugins/operator/notIn.js.map +0 -1
  273. package/plugins/operator/notStartsWith.d.ts +0 -7
  274. package/plugins/operator/notStartsWith.js +0 -23
  275. package/plugins/operator/notStartsWith.js.map +0 -1
  276. package/plugins/operator/startsWith.d.ts +0 -7
  277. package/plugins/operator/startsWith.js +0 -23
  278. package/plugins/operator/startsWith.js.map +0 -1
  279. package/utils/index.js.map +0 -1
  280. package/utils/waitUntilHealthy/index.js.map +0 -1
  281. package/utils/waitUntilHealthy/reason/IReason.js.map +0 -1
  282. package/utils/waitUntilHealthy/reason/index.js.map +0 -1
@@ -0,0 +1,23 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ class LesserThanImpl {
3
+ getOperator() {
4
+ return "lt";
5
+ }
6
+ apply(query, params) {
7
+ const { value, basePath } = params;
8
+ query.filter.push({
9
+ range: {
10
+ [basePath]: {
11
+ lt: value
12
+ }
13
+ }
14
+ });
15
+ }
16
+ }
17
+ const LesserThan = OpenSearchQueryBuilderOperator.createImplementation({
18
+ implementation: LesserThanImpl,
19
+ dependencies: []
20
+ });
21
+ export { LesserThan };
22
+
23
+ //# sourceMappingURL=LesserThan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/LesserThan.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/LesserThan.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass LesserThanImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"lt\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, basePath } = params;\n query.filter.push({\n range: {\n [basePath]: {\n lt: value\n }\n }\n });\n }\n}\n\nexport const LesserThan = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: LesserThanImpl,\n dependencies: []\n});\n"],"names":["LesserThanImpl","query","params","value","basePath","LesserThan","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5BD,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,OAAO;gBACH,CAACG,SAAS,EAAE;oBACR,IAAID;gBACR;YACJ;QACJ;IACJ;AACJ;AAEO,MAAME,aAAaC,+BAA+B,oBAAoB,CAAC;IAC1E,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,9 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ declare class LesserThanOrEqualImpl implements OpenSearchQueryBuilderOperator.Interface {
3
+ getOperator(): string;
4
+ apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
5
+ }
6
+ export declare const LesserThanOrEqual: typeof LesserThanOrEqualImpl & {
7
+ __abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
8
+ };
9
+ export {};
@@ -0,0 +1,23 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ class LesserThanOrEqualImpl {
3
+ getOperator() {
4
+ return "lte";
5
+ }
6
+ apply(query, params) {
7
+ const { value, basePath } = params;
8
+ query.filter.push({
9
+ range: {
10
+ [basePath]: {
11
+ lte: value
12
+ }
13
+ }
14
+ });
15
+ }
16
+ }
17
+ const LesserThanOrEqual = OpenSearchQueryBuilderOperator.createImplementation({
18
+ implementation: LesserThanOrEqualImpl,
19
+ dependencies: []
20
+ });
21
+ export { LesserThanOrEqual };
22
+
23
+ //# sourceMappingURL=LesserThanOrEqual.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass LesserThanOrEqualImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"lte\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, basePath } = params;\n query.filter.push({\n range: {\n [basePath]: {\n lte: value\n }\n }\n });\n }\n}\n\nexport const LesserThanOrEqual = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: LesserThanOrEqualImpl,\n dependencies: []\n});\n"],"names":["LesserThanOrEqualImpl","query","params","value","basePath","LesserThanOrEqual","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5BD,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,OAAO;gBACH,CAACG,SAAS,EAAE;oBACR,KAAKD;gBACT;YACJ;QACJ;IACJ;AACJ;AAEO,MAAME,oBAAoBC,+BAA+B,oBAAoB,CAAC;IACjF,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,9 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ declare class NotImpl implements OpenSearchQueryBuilderOperator.Interface {
3
+ getOperator(): string;
4
+ apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
5
+ }
6
+ export declare const Not: typeof NotImpl & {
7
+ __abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
8
+ };
9
+ export {};
@@ -0,0 +1,38 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ class NotImpl {
3
+ getOperator() {
4
+ return "not";
5
+ }
6
+ apply(query, params) {
7
+ const { value, path, basePath } = params;
8
+ if (null == value) return void query.filter.push({
9
+ exists: {
10
+ field: path
11
+ }
12
+ });
13
+ const typeOf = typeof value;
14
+ if ("boolean" === typeOf) return void query.filter.push({
15
+ bool: {
16
+ must_not: {
17
+ term: {
18
+ [path]: value
19
+ }
20
+ }
21
+ }
22
+ });
23
+ const useBasePath = "string" !== typeOf;
24
+ const valuePath = useBasePath ? basePath : path;
25
+ query.must_not.push({
26
+ term: {
27
+ [valuePath]: value
28
+ }
29
+ });
30
+ }
31
+ }
32
+ const Not = OpenSearchQueryBuilderOperator.createImplementation({
33
+ implementation: NotImpl,
34
+ dependencies: []
35
+ });
36
+ export { Not };
37
+
38
+ //# sourceMappingURL=Not.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/Not.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/Not.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, path, basePath } = params;\n\n if (value === null || value === undefined) {\n query.filter.push({\n exists: {\n field: path\n }\n });\n return;\n }\n\n const typeOf = typeof value;\n\n if (typeOf === \"boolean\") {\n query.filter.push({\n bool: {\n must_not: {\n term: {\n [path]: value\n }\n }\n }\n });\n return;\n }\n\n const useBasePath = typeOf !== \"string\";\n const valuePath = useBasePath ? basePath : path;\n query.must_not.push({\n term: {\n [valuePath]: value\n }\n });\n }\n}\n\nexport const Not = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotImpl,\n dependencies: []\n});\n"],"names":["NotImpl","query","params","value","path","basePath","typeOf","useBasePath","valuePath","Not","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGH;QAElC,IAAIC,QAAAA,OAAuC,YACvCF,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,QAAQ;gBACJ,OAAOG;YACX;QACJ;QAIJ,MAAME,SAAS,OAAOH;QAEtB,IAAIG,AAAW,cAAXA,QAAsB,YACtBL,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,MAAM;gBACF,UAAU;oBACN,MAAM;wBACF,CAACG,KAAK,EAAED;oBACZ;gBACJ;YACJ;QACJ;QAIJ,MAAMI,cAAcD,AAAW,aAAXA;QACpB,MAAME,YAAYD,cAAcF,WAAWD;QAC3CH,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,MAAM;gBACF,CAACO,UAAU,EAAEL;YACjB;QACJ;IACJ;AACJ;AAEO,MAAMM,MAAMC,+BAA+B,oBAAoB,CAAC;IACnE,gBAAgBV;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,9 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ declare class NotBetweenImpl implements OpenSearchQueryBuilderOperator.Interface {
3
+ getOperator(): string;
4
+ apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
5
+ }
6
+ export declare const NotBetween: typeof NotBetweenImpl & {
7
+ __abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
8
+ };
9
+ export {};
@@ -0,0 +1,27 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ class NotBetweenImpl {
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
+ }
21
+ const NotBetween = OpenSearchQueryBuilderOperator.createImplementation({
22
+ implementation: NotBetweenImpl,
23
+ dependencies: []
24
+ });
25
+ export { NotBetween };
26
+
27
+ //# sourceMappingURL=NotBetween.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/NotBetween.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/NotBetween.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotBetweenImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not_between\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): 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 const [gte, lte] = value;\n query.must_not.push({\n range: {\n [basePath]: {\n lte,\n gte\n }\n }\n });\n }\n}\n\nexport const NotBetween = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotBetweenImpl,\n dependencies: []\n});\n"],"names":["NotBetweenImpl","query","params","value","basePath","name","Array","Error","gte","lte","NotBetween","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,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;QAGjF,MAAM,CAACG,KAAKC,IAAI,GAAGN;QACnBF,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,OAAO;gBACH,CAACG,SAAS,EAAE;oBACRK;oBACAD;gBACJ;YACJ;QACJ;IACJ;AACJ;AAEO,MAAME,aAAaC,+BAA+B,oBAAoB,CAAC;IAC1E,gBAAgBX;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,9 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ declare class NotContainsImpl implements OpenSearchQueryBuilderOperator.Interface {
3
+ getOperator(): string;
4
+ apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
5
+ }
6
+ export declare const NotContains: typeof NotContainsImpl & {
7
+ __abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
8
+ };
9
+ export {};
@@ -0,0 +1,27 @@
1
+ import { normalizeValueWithAsterisk } from "../../../normalize.js";
2
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
3
+ class NotContainsImpl {
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
+ }
21
+ const NotContains = OpenSearchQueryBuilderOperator.createImplementation({
22
+ implementation: NotContainsImpl,
23
+ dependencies: []
24
+ });
25
+ export { NotContains };
26
+
27
+ //# sourceMappingURL=NotContains.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/NotContains.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/NotContains.ts"],"sourcesContent":["import { normalizeValueWithAsterisk } from \"~/normalize.js\";\nimport { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotContainsImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not_contains\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): 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\nexport const NotContains = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotContainsImpl,\n dependencies: []\n});\n"],"names":["NotContainsImpl","query","params","value","basePath","normalizeValueWithAsterisk","NotContains","OpenSearchQueryBuilderOperator"],"mappings":";;AAGA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,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;AACJ;AAEO,MAAMG,cAAcC,+BAA+B,oBAAoB,CAAC;IAC3E,gBAAgBP;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,9 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ declare class NotInImpl implements OpenSearchQueryBuilderOperator.Interface {
3
+ getOperator(): string;
4
+ apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
5
+ }
6
+ export declare const NotIn: typeof NotInImpl & {
7
+ __abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
8
+ };
9
+ export {};
@@ -0,0 +1,24 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ class NotInImpl {
3
+ getOperator() {
4
+ return "not_in";
5
+ }
6
+ apply(query, params) {
7
+ const { value: values, path, basePath, name } = params;
8
+ const isArray = Array.isArray(values);
9
+ if (false === isArray || 0 === values.length) throw new Error(`You cannot filter field "${name}" with "not_in" operator and not send an array of values.`);
10
+ const useBasePath = values.some((value)=>"string" != typeof value);
11
+ query.must_not.push({
12
+ terms: {
13
+ [useBasePath ? basePath : path]: values
14
+ }
15
+ });
16
+ }
17
+ }
18
+ const NotIn = OpenSearchQueryBuilderOperator.createImplementation({
19
+ implementation: NotInImpl,
20
+ dependencies: []
21
+ });
22
+ export { NotIn };
23
+
24
+ //# sourceMappingURL=NotIn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/NotIn.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/NotIn.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotInImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not_in\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): 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\nexport const NotIn = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotInImpl,\n dependencies: []\n});\n"],"names":["NotInImpl","query","params","values","path","basePath","name","isArray","Array","Error","useBasePath","value","NotIn","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,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;AACJ;AAEO,MAAMS,QAAQC,+BAA+B,oBAAoB,CAAC;IACrE,gBAAgBb;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,9 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ declare class NotStartsWithImpl implements OpenSearchQueryBuilderOperator.Interface {
3
+ getOperator(): string;
4
+ apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
5
+ }
6
+ export declare const NotStartsWith: typeof NotStartsWithImpl & {
7
+ __abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
8
+ };
9
+ export {};
@@ -0,0 +1,22 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ class NotStartsWithImpl {
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
+ }
16
+ const NotStartsWith = OpenSearchQueryBuilderOperator.createImplementation({
17
+ implementation: NotStartsWithImpl,
18
+ dependencies: []
19
+ });
20
+ export { NotStartsWith };
21
+
22
+ //# sourceMappingURL=NotStartsWith.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotStartsWithImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not_startsWith\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): 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\nexport const NotStartsWith = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotStartsWithImpl,\n dependencies: []\n});\n"],"names":["NotStartsWithImpl","query","params","value","basePath","NotStartsWith","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,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;AACJ;AAEO,MAAME,gBAAgBC,+BAA+B,oBAAoB,CAAC;IAC7E,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
@@ -0,0 +1,9 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ declare class StartsWithImpl implements OpenSearchQueryBuilderOperator.Interface {
3
+ getOperator(): string;
4
+ apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
5
+ }
6
+ export declare const StartsWith: typeof StartsWithImpl & {
7
+ __abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
8
+ };
9
+ export {};
@@ -0,0 +1,22 @@
1
+ import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
2
+ class StartsWithImpl {
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
+ }
16
+ const StartsWith = OpenSearchQueryBuilderOperator.createImplementation({
17
+ implementation: StartsWithImpl,
18
+ dependencies: []
19
+ });
20
+ export { StartsWith };
21
+
22
+ //# sourceMappingURL=StartsWith.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/StartsWith.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/StartsWith.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass StartsWithImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"startsWith\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): 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\nexport const StartsWith = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: StartsWithImpl,\n dependencies: []\n});\n"],"names":["StartsWithImpl","query","params","value","basePath","StartsWith","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,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;AACJ;AAEO,MAAME,aAAaC,+BAA+B,oBAAoB,CAAC;IAC1E,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
package/index.d.ts CHANGED
@@ -1,21 +1,13 @@
1
- import type { OpenSearchContext } from "./types.js";
2
- import { ContextPlugin } from "@webiny/api";
3
- import type { OpenSearchClientOptions } from "./client.js";
4
- import { Client } from "./client.js";
5
- export * from "./indexConfiguration/index.js";
6
- export * from "./plugins/index.js";
1
+ export { registerOpenSearchCore } from "./registerOpenSearchCore.js";
2
+ export { getCommonMappings, getBaseConfiguration } from "./indexConfiguration/index.js";
7
3
  export * from "./sort.js";
8
- export * from "./indices.js";
9
4
  export * from "./where.js";
10
5
  export * from "./limit.js";
11
6
  export * from "./normalize.js";
12
- export * from "./operators.js";
13
7
  export * from "./cursors.js";
14
8
  export { createOpenSearchClient, type Client, type ClientOptions, type OpenSearchClientOptions } from "./client.js";
15
9
  export * from "./utils/index.js";
16
10
  export * from "./operations/index.js";
17
11
  export * from "./sharedIndex.js";
18
12
  export * from "./indexPrefix.js";
19
- export * from "./db/index.js";
20
13
  export * from "./types.js";
21
- export declare const createOpenSearchContext: (params: OpenSearchClientOptions | Client) => ContextPlugin<OpenSearchContext>;
package/index.js CHANGED
@@ -1,40 +1,13 @@
1
- import { ContextPlugin } from "@webiny/api";
2
- import { Client, createOpenSearchClient } from "./client.js";
3
- import { getOpenSearchOperators } from "./operators.js";
4
- import { OpenSearchClientFactoryFeature } from "./features/OpenSearchClientFactory/feature.js";
5
- import { OpenSearchClientFeature } from "./features/OpenSearchClient/feature.js";
6
- import { OpenSearchContextFeature } from "./features/OpenSearchContext/feature.js";
7
- export * from "./indexConfiguration/index.js";
8
- export * from "./plugins/index.js";
9
1
  export * from "./sort.js";
10
- export * from "./indices.js";
11
2
  export * from "./where.js";
12
3
  export * from "./limit.js";
13
4
  export * from "./normalize.js";
14
- export * from "./operators.js";
15
5
  export * from "./cursors.js";
16
- export { createOpenSearchClient } from "./client.js";
17
6
  export * from "./utils/index.js";
18
7
  export * from "./operations/index.js";
19
8
  export * from "./sharedIndex.js";
20
9
  export * from "./indexPrefix.js";
21
- export * from "./db/index.js";
22
10
  export * from "./types.js";
23
- export const createOpenSearchContext = params => {
24
- const plugin = new ContextPlugin(context => {
25
- if (context.opensearch) {
26
- throw new Error("OpenSearch context must not be loaded more than once!");
27
- }
28
- const client = params instanceof Client ? params : createOpenSearchClient(params);
29
- context.opensearch = client;
30
- context.elasticsearch = client;
31
- context.plugins.register(getOpenSearchOperators());
32
- OpenSearchContextFeature.register(context.container, context);
33
- OpenSearchClientFeature.register(context.container);
34
- OpenSearchClientFactoryFeature.register(context.container);
35
- });
36
- plugin.name = "context.opensearch";
37
- return plugin;
38
- };
39
-
40
- //# sourceMappingURL=index.js.map
11
+ export { registerOpenSearchCore } from "./registerOpenSearchCore.js";
12
+ export { getBaseConfiguration, getCommonMappings } from "./indexConfiguration/index.js";
13
+ export { createOpenSearchClient } from "./client.js";
@@ -1,35 +1,34 @@
1
1
  import { getCommonMappings } from "./common.js";
2
2
  const config = {
3
- mappings: {
4
- dynamic_templates: getCommonMappings(mappings => {
5
- return mappings.concat([{
6
- strings: {
7
- match_mapping_type: "string",
8
- mapping: {
9
- type: "text",
10
- fields: {
11
- keyword: {
12
- type: "keyword",
13
- ignore_above: 256
14
- }
3
+ mappings: {
4
+ dynamic_templates: getCommonMappings((mappings)=>mappings.concat([
5
+ {
6
+ strings: {
7
+ match_mapping_type: "string",
8
+ mapping: {
9
+ type: "text",
10
+ fields: {
11
+ keyword: {
12
+ type: "keyword",
13
+ ignore_above: 256
14
+ }
15
+ }
16
+ }
17
+ }
18
+ }
19
+ ])),
20
+ properties: {
21
+ rawValues: {
22
+ type: "object",
23
+ enabled: false
15
24
  }
16
- }
17
25
  }
18
- }]);
19
- }),
20
- properties: {
21
- rawValues: {
22
- type: "object",
23
- enabled: false
24
- }
25
26
  }
26
- }
27
27
  };
28
- export const getBaseConfiguration = modifier => {
29
- if (!modifier) {
30
- return config;
31
- }
32
- return modifier(config);
28
+ const getBaseConfiguration = (modifier)=>{
29
+ if (!modifier) return config;
30
+ return modifier(config);
33
31
  };
32
+ export { getBaseConfiguration };
34
33
 
35
34
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getCommonMappings","config","mappings","dynamic_templates","concat","strings","match_mapping_type","mapping","type","fields","keyword","ignore_above","properties","rawValues","enabled","getBaseConfiguration","modifier"],"sources":["base.ts"],"sourcesContent":["import type { OpenSearchIndexRequestBody } from \"~/types.js\";\nimport { getCommonMappings } from \"./common.js\";\n\nconst config: OpenSearchIndexRequestBody = {\n mappings: {\n dynamic_templates: getCommonMappings(mappings => {\n return mappings.concat([\n {\n strings: {\n match_mapping_type: \"string\",\n mapping: {\n type: \"text\",\n fields: {\n keyword: {\n type: \"keyword\",\n ignore_above: 256\n }\n }\n }\n }\n }\n ]);\n }),\n properties: {\n rawValues: {\n type: \"object\",\n enabled: false\n }\n }\n }\n};\n\ninterface Modifier {\n (config: OpenSearchIndexRequestBody): OpenSearchIndexRequestBody;\n}\nexport const getBaseConfiguration = (modifier?: Modifier) => {\n if (!modifier) {\n return config;\n }\n return modifier(config);\n};\n"],"mappings":"AACA,SAASA,iBAAiB;AAE1B,MAAMC,MAAkC,GAAG;EACvCC,QAAQ,EAAE;IACNC,iBAAiB,EAAEH,iBAAiB,CAACE,QAAQ,IAAI;MAC7C,OAAOA,QAAQ,CAACE,MAAM,CAAC,CACnB;QACIC,OAAO,EAAE;UACLC,kBAAkB,EAAE,QAAQ;UAC5BC,OAAO,EAAE;YACLC,IAAI,EAAE,MAAM;YACZC,MAAM,EAAE;cACJC,OAAO,EAAE;gBACLF,IAAI,EAAE,SAAS;gBACfG,YAAY,EAAE;cAClB;YACJ;UACJ;QACJ;MACJ,CAAC,CACJ,CAAC;IACN,CAAC,CAAC;IACFC,UAAU,EAAE;MACRC,SAAS,EAAE;QACPL,IAAI,EAAE,QAAQ;QACdM,OAAO,EAAE;MACb;IACJ;EACJ;AACJ,CAAC;AAKD,OAAO,MAAMC,oBAAoB,GAAIC,QAAmB,IAAK;EACzD,IAAI,CAACA,QAAQ,EAAE;IACX,OAAOf,MAAM;EACjB;EACA,OAAOe,QAAQ,CAACf,MAAM,CAAC;AAC3B,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"indexConfiguration/base.js","sources":["../../src/indexConfiguration/base.ts"],"sourcesContent":["import type { OpenSearchIndexRequestBody } from \"~/types.js\";\nimport { getCommonMappings } from \"./common.js\";\n\nconst config: OpenSearchIndexRequestBody = {\n mappings: {\n dynamic_templates: getCommonMappings(mappings => {\n return mappings.concat([\n {\n strings: {\n match_mapping_type: \"string\",\n mapping: {\n type: \"text\",\n fields: {\n keyword: {\n type: \"keyword\",\n ignore_above: 256\n }\n }\n }\n }\n }\n ]);\n }),\n properties: {\n rawValues: {\n type: \"object\",\n enabled: false\n }\n }\n }\n};\n\ninterface Modifier {\n (config: OpenSearchIndexRequestBody): OpenSearchIndexRequestBody;\n}\nexport const getBaseConfiguration = (modifier?: Modifier) => {\n if (!modifier) {\n return config;\n }\n return modifier(config);\n};\n"],"names":["config","getCommonMappings","mappings","getBaseConfiguration","modifier"],"mappings":";AAGA,MAAMA,SAAqC;IACvC,UAAU;QACN,mBAAmBC,kBAAkBC,CAAAA,WAC1BA,SAAS,MAAM,CAAC;gBACnB;oBACI,SAAS;wBACL,oBAAoB;wBACpB,SAAS;4BACL,MAAM;4BACN,QAAQ;gCACJ,SAAS;oCACL,MAAM;oCACN,cAAc;gCAClB;4BACJ;wBACJ;oBACJ;gBACJ;aACH;QAEL,YAAY;YACR,WAAW;gBACP,MAAM;gBACN,SAAS;YACb;QACJ;IACJ;AACJ;AAKO,MAAMC,uBAAuB,CAACC;IACjC,IAAI,CAACA,UACD,OAAOJ;IAEX,OAAOI,SAASJ;AACpB"}
@@ -1,44 +1,42 @@
1
- const getDefaultMappings = () => {
2
- return [{
3
- ids: {
4
- match: "^id|entryId$",
5
- mapping: {
6
- type: "keyword"
7
- }
8
- }
9
- }, {
10
- /* Update with the correct date fields. */
11
- dates: {
12
- match: "^createdOn|savedOn|publishedOn$",
13
- mapping: {
14
- type: "date"
15
- }
16
- }
17
- }, {
18
- numbers: {
19
- match: "number@*",
20
- mapping: {
21
- type: "scaled_float",
22
- scaling_factor: 10000
23
- }
24
- }
25
- }, {
26
- booleans: {
27
- match: "boolean@*",
28
- mapping: {
29
- type: "boolean"
30
- }
31
- }
32
- }];
33
- };
34
- /**
35
- * @internal
36
- */
37
- export const getCommonMappings = cb => {
38
- if (!cb) {
39
- return getDefaultMappings();
40
- }
41
- return cb(getDefaultMappings());
1
+ const getDefaultMappings = ()=>[
2
+ {
3
+ ids: {
4
+ match: "^id|entryId$",
5
+ mapping: {
6
+ type: "keyword"
7
+ }
8
+ }
9
+ },
10
+ {
11
+ dates: {
12
+ match: "^createdOn|savedOn|publishedOn$",
13
+ mapping: {
14
+ type: "date"
15
+ }
16
+ }
17
+ },
18
+ {
19
+ numbers: {
20
+ match: "number@*",
21
+ mapping: {
22
+ type: "scaled_float",
23
+ scaling_factor: 10000
24
+ }
25
+ }
26
+ },
27
+ {
28
+ booleans: {
29
+ match: "boolean@*",
30
+ mapping: {
31
+ type: "boolean"
32
+ }
33
+ }
34
+ }
35
+ ];
36
+ const getCommonMappings = (cb)=>{
37
+ if (!cb) return getDefaultMappings();
38
+ return cb(getDefaultMappings());
42
39
  };
40
+ export { getCommonMappings };
43
41
 
44
42
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getDefaultMappings","ids","match","mapping","type","dates","numbers","scaling_factor","booleans","getCommonMappings","cb"],"sources":["common.ts"],"sourcesContent":["import type { OpenSearchIndexRequestBodyMappingsDynamicTemplate } from \"~/types.js\";\n\nconst getDefaultMappings = (): OpenSearchIndexRequestBodyMappingsDynamicTemplate[] => {\n return [\n {\n ids: {\n match: \"^id|entryId$\",\n mapping: {\n type: \"keyword\"\n }\n }\n },\n {\n /* Update with the correct date fields. */\n dates: {\n match: \"^createdOn|savedOn|publishedOn$\",\n mapping: {\n type: \"date\"\n }\n }\n },\n {\n numbers: {\n match: \"number@*\",\n mapping: {\n type: \"scaled_float\",\n scaling_factor: 10000\n }\n }\n },\n {\n booleans: {\n match: \"boolean@*\",\n mapping: {\n type: \"boolean\"\n }\n }\n }\n ];\n};\n\ninterface Modifier {\n (\n mappings: OpenSearchIndexRequestBodyMappingsDynamicTemplate[]\n ): OpenSearchIndexRequestBodyMappingsDynamicTemplate[];\n}\n/**\n * @internal\n */\nexport const getCommonMappings = (\n cb?: Modifier\n): OpenSearchIndexRequestBodyMappingsDynamicTemplate[] => {\n if (!cb) {\n return getDefaultMappings();\n }\n\n return cb(getDefaultMappings());\n};\n"],"mappings":"AAEA,MAAMA,kBAAkB,GAAGA,CAAA,KAA2D;EAClF,OAAO,CACH;IACIC,GAAG,EAAE;MACDC,KAAK,EAAE,cAAc;MACrBC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,EACD;IACI;IACAC,KAAK,EAAE;MACHH,KAAK,EAAE,iCAAiC;MACxCC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,EACD;IACIE,OAAO,EAAE;MACLJ,KAAK,EAAE,UAAU;MACjBC,OAAO,EAAE;QACLC,IAAI,EAAE,cAAc;QACpBG,cAAc,EAAE;MACpB;IACJ;EACJ,CAAC,EACD;IACIC,QAAQ,EAAE;MACNN,KAAK,EAAE,WAAW;MAClBC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CACJ;AACL,CAAC;AAOD;AACA;AACA;AACA,OAAO,MAAMK,iBAAiB,GAC1BC,EAAa,IACyC;EACtD,IAAI,CAACA,EAAE,EAAE;IACL,OAAOV,kBAAkB,CAAC,CAAC;EAC/B;EAEA,OAAOU,EAAE,CAACV,kBAAkB,CAAC,CAAC,CAAC;AACnC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"indexConfiguration/common.js","sources":["../../src/indexConfiguration/common.ts"],"sourcesContent":["import type { OpenSearchIndexRequestBodyMappingsDynamicTemplate } from \"~/types.js\";\n\nconst getDefaultMappings = (): OpenSearchIndexRequestBodyMappingsDynamicTemplate[] => {\n return [\n {\n ids: {\n match: \"^id|entryId$\",\n mapping: {\n type: \"keyword\"\n }\n }\n },\n {\n /* Update with the correct date fields. */\n dates: {\n match: \"^createdOn|savedOn|publishedOn$\",\n mapping: {\n type: \"date\"\n }\n }\n },\n {\n numbers: {\n match: \"number@*\",\n mapping: {\n type: \"scaled_float\",\n scaling_factor: 10000\n }\n }\n },\n {\n booleans: {\n match: \"boolean@*\",\n mapping: {\n type: \"boolean\"\n }\n }\n }\n ];\n};\n\ninterface Modifier {\n (\n mappings: OpenSearchIndexRequestBodyMappingsDynamicTemplate[]\n ): OpenSearchIndexRequestBodyMappingsDynamicTemplate[];\n}\n/**\n * @internal\n */\nexport const getCommonMappings = (\n cb?: Modifier\n): OpenSearchIndexRequestBodyMappingsDynamicTemplate[] => {\n if (!cb) {\n return getDefaultMappings();\n }\n\n return cb(getDefaultMappings());\n};\n"],"names":["getDefaultMappings","getCommonMappings","cb"],"mappings":"AAEA,MAAMA,qBAAqB,IAChB;QACH;YACI,KAAK;gBACD,OAAO;gBACP,SAAS;oBACL,MAAM;gBACV;YACJ;QACJ;QACA;YAEI,OAAO;gBACH,OAAO;gBACP,SAAS;oBACL,MAAM;gBACV;YACJ;QACJ;QACA;YACI,SAAS;gBACL,OAAO;gBACP,SAAS;oBACL,MAAM;oBACN,gBAAgB;gBACpB;YACJ;QACJ;QACA;YACI,UAAU;gBACN,OAAO;gBACP,SAAS;oBACL,MAAM;gBACV;YACJ;QACJ;KACH;AAWE,MAAMC,oBAAoB,CAC7BC;IAEA,IAAI,CAACA,IACD,OAAOF;IAGX,OAAOE,GAAGF;AACd"}
@@ -1,4 +1,2 @@
1
1
  export * from "./base.js";
2
2
  export * from "./common.js";
3
-
4
- //# sourceMappingURL=index.js.map
package/indexPrefix.js CHANGED
@@ -1,5 +1,4 @@
1
- export const getOpenSearchIndexPrefix = () => {
2
- return process.env.OPENSEARCH_INDEX_PREFIX || process.env.ELASTICSEARCH_INDEX_PREFIX || process.env.WEBINY_OPENSEARCH_INDEX_PREFIX || process.env.WEBINY_ELASTICSEARCH_INDEX_PREFIX || "";
3
- };
1
+ const getOpenSearchIndexPrefix = ()=>process.env.OPENSEARCH_INDEX_PREFIX || process.env.ELASTICSEARCH_INDEX_PREFIX || process.env.WEBINY_OPENSEARCH_INDEX_PREFIX || process.env.WEBINY_ELASTICSEARCH_INDEX_PREFIX || "";
2
+ export { getOpenSearchIndexPrefix };
4
3
 
5
4
  //# sourceMappingURL=indexPrefix.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getOpenSearchIndexPrefix","process","env","OPENSEARCH_INDEX_PREFIX","ELASTICSEARCH_INDEX_PREFIX","WEBINY_OPENSEARCH_INDEX_PREFIX","WEBINY_ELASTICSEARCH_INDEX_PREFIX"],"sources":["indexPrefix.ts"],"sourcesContent":["export const getOpenSearchIndexPrefix = (): string => {\n return (\n process.env.OPENSEARCH_INDEX_PREFIX ||\n process.env.ELASTICSEARCH_INDEX_PREFIX ||\n process.env.WEBINY_OPENSEARCH_INDEX_PREFIX ||\n process.env.WEBINY_ELASTICSEARCH_INDEX_PREFIX ||\n \"\"\n );\n};\n"],"mappings":"AAAA,OAAO,MAAMA,wBAAwB,GAAGA,CAAA,KAAc;EAClD,OACIC,OAAO,CAACC,GAAG,CAACC,uBAAuB,IACnCF,OAAO,CAACC,GAAG,CAACE,0BAA0B,IACtCH,OAAO,CAACC,GAAG,CAACG,8BAA8B,IAC1CJ,OAAO,CAACC,GAAG,CAACI,iCAAiC,IAC7C,EAAE;AAEV,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"indexPrefix.js","sources":["../src/indexPrefix.ts"],"sourcesContent":["export const getOpenSearchIndexPrefix = (): string => {\n return (\n process.env.OPENSEARCH_INDEX_PREFIX ||\n process.env.ELASTICSEARCH_INDEX_PREFIX ||\n process.env.WEBINY_OPENSEARCH_INDEX_PREFIX ||\n process.env.WEBINY_ELASTICSEARCH_INDEX_PREFIX ||\n \"\"\n );\n};\n"],"names":["getOpenSearchIndexPrefix","process"],"mappings":"AAAO,MAAMA,2BAA2B,IAEhCC,QAAQ,GAAG,CAAC,uBAAuB,IACnCA,QAAQ,GAAG,CAAC,0BAA0B,IACtCA,QAAQ,GAAG,CAAC,8BAA8B,IAC1CA,QAAQ,GAAG,CAAC,iCAAiC,IAC7C"}
package/indices.d.ts CHANGED
@@ -1,8 +1,2 @@
1
- import type { OpenSearchIndexPlugin } from "./plugins/definition/OpenSearchIndexPlugin.js";
2
- import type { PluginsContainer } from "@webiny/plugins";
3
- interface IndicesPluginsParams {
4
- container: PluginsContainer;
5
- type: string;
6
- }
7
- export declare const getLastAddedIndexPlugin: <T extends OpenSearchIndexPlugin>(params: IndicesPluginsParams) => T;
8
- export {};
1
+ import { OpenSearchIndexRegistry } from "./features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js";
2
+ export { OpenSearchIndexRegistry };