@webiny/api-elasticsearch 0.0.0-unstable.eb196ccd2f → 0.0.0-unstable.f6dc066313

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 (174) hide show
  1. package/README.md +10 -0
  2. package/client.d.ts +2 -2
  3. package/client.js +11 -30
  4. package/client.js.map +1 -1
  5. package/compression.js +7 -14
  6. package/compression.js.map +1 -1
  7. package/cursors.d.ts +1 -1
  8. package/cursors.js +2 -10
  9. package/cursors.js.map +1 -1
  10. package/db/entity.d.ts +7 -0
  11. package/db/entity.js +20 -0
  12. package/db/entity.js.map +1 -0
  13. package/db/index.d.ts +3 -0
  14. package/db/index.js +5 -0
  15. package/db/index.js.map +1 -0
  16. package/db/table.d.ts +7 -0
  17. package/db/table.js +17 -0
  18. package/db/table.js.map +1 -0
  19. package/db/types.d.ts +6 -0
  20. package/db/types.js +3 -0
  21. package/db/types.js.map +1 -0
  22. package/index.d.ts +18 -17
  23. package/index.js +27 -197
  24. package/index.js.map +1 -1
  25. package/indexConfiguration/base.d.ts +1 -1
  26. package/indexConfiguration/base.js +3 -10
  27. package/indexConfiguration/base.js.map +1 -1
  28. package/indexConfiguration/common.d.ts +1 -1
  29. package/indexConfiguration/common.js +1 -8
  30. package/indexConfiguration/common.js.map +1 -1
  31. package/indexConfiguration/index.d.ts +2 -3
  32. package/indexConfiguration/index.js +2 -38
  33. package/indexConfiguration/index.js.map +1 -1
  34. package/indexPrefix.js +2 -9
  35. package/indexPrefix.js.map +1 -1
  36. package/indices.d.ts +1 -2
  37. package/indices.js +6 -16
  38. package/indices.js.map +1 -1
  39. package/limit.js +1 -8
  40. package/limit.js.map +1 -1
  41. package/normalize.js +3 -11
  42. package/normalize.js.map +1 -1
  43. package/operations/ElasticsearchCatHealth.d.ts +2 -2
  44. package/operations/ElasticsearchCatHealth.js +6 -13
  45. package/operations/ElasticsearchCatHealth.js.map +1 -1
  46. package/operations/ElasticsearchCatNodes.d.ts +2 -2
  47. package/operations/ElasticsearchCatNodes.js +6 -13
  48. package/operations/ElasticsearchCatNodes.js.map +1 -1
  49. package/operations/index.d.ts +3 -3
  50. package/operations/index.js +3 -38
  51. package/operations/index.js.map +1 -1
  52. package/operations/stripConnectionFromException.js +1 -8
  53. package/operations/stripConnectionFromException.js.map +1 -1
  54. package/operations/types.js +1 -7
  55. package/operations/types.js.map +1 -1
  56. package/operators.d.ts +2 -5
  57. package/operators.js +3 -41
  58. package/operators.js.map +1 -1
  59. package/package.json +13 -12
  60. package/plugins/definition/ElasticsearchBodyModifierPlugin.js +4 -12
  61. package/plugins/definition/ElasticsearchBodyModifierPlugin.js.map +1 -1
  62. package/plugins/definition/ElasticsearchFieldPlugin.js +2 -9
  63. package/plugins/definition/ElasticsearchFieldPlugin.js.map +1 -1
  64. package/plugins/definition/ElasticsearchIndexPlugin.d.ts +2 -10
  65. package/plugins/definition/ElasticsearchIndexPlugin.js +4 -23
  66. package/plugins/definition/ElasticsearchIndexPlugin.js.map +1 -1
  67. package/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin.d.ts +1 -5
  68. package/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin.js +2 -17
  69. package/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin.js.map +1 -1
  70. package/plugins/definition/ElasticsearchQueryModifierPlugin.d.ts +1 -1
  71. package/plugins/definition/ElasticsearchQueryModifierPlugin.js +4 -12
  72. package/plugins/definition/ElasticsearchQueryModifierPlugin.js.map +1 -1
  73. package/plugins/definition/ElasticsearchSortModifierPlugin.js +4 -12
  74. package/plugins/definition/ElasticsearchSortModifierPlugin.js.map +1 -1
  75. package/plugins/definition/index.d.ts +6 -6
  76. package/plugins/definition/index.js +6 -71
  77. package/plugins/definition/index.js.map +1 -1
  78. package/plugins/index.d.ts +2 -2
  79. package/plugins/index.js +2 -27
  80. package/plugins/index.js.map +1 -1
  81. package/plugins/operator/andIn.d.ts +2 -2
  82. package/plugins/operator/andIn.js +2 -9
  83. package/plugins/operator/andIn.js.map +1 -1
  84. package/plugins/operator/between.d.ts +2 -2
  85. package/plugins/operator/between.js +2 -9
  86. package/plugins/operator/between.js.map +1 -1
  87. package/plugins/operator/contains.d.ts +2 -2
  88. package/plugins/operator/contains.js +4 -11
  89. package/plugins/operator/contains.js.map +1 -1
  90. package/plugins/operator/equal.d.ts +2 -2
  91. package/plugins/operator/equal.js +2 -9
  92. package/plugins/operator/equal.js.map +1 -1
  93. package/plugins/operator/gt.d.ts +2 -2
  94. package/plugins/operator/gt.js +2 -9
  95. package/plugins/operator/gt.js.map +1 -1
  96. package/plugins/operator/gte.d.ts +2 -2
  97. package/plugins/operator/gte.js +2 -9
  98. package/plugins/operator/gte.js.map +1 -1
  99. package/plugins/operator/in.d.ts +2 -2
  100. package/plugins/operator/in.js +2 -9
  101. package/plugins/operator/in.js.map +1 -1
  102. package/plugins/operator/index.d.ts +15 -16
  103. package/plugins/operator/index.js +15 -181
  104. package/plugins/operator/index.js.map +1 -1
  105. package/plugins/operator/lt.d.ts +2 -2
  106. package/plugins/operator/lt.js +2 -9
  107. package/plugins/operator/lt.js.map +1 -1
  108. package/plugins/operator/lte.d.ts +2 -2
  109. package/plugins/operator/lte.js +2 -9
  110. package/plugins/operator/lte.js.map +1 -1
  111. package/plugins/operator/not.d.ts +2 -2
  112. package/plugins/operator/not.js +2 -9
  113. package/plugins/operator/not.js.map +1 -1
  114. package/plugins/operator/notBetween.d.ts +2 -2
  115. package/plugins/operator/notBetween.js +2 -9
  116. package/plugins/operator/notBetween.js.map +1 -1
  117. package/plugins/operator/notContains.d.ts +2 -2
  118. package/plugins/operator/notContains.js +4 -11
  119. package/plugins/operator/notContains.js.map +1 -1
  120. package/plugins/operator/notIn.d.ts +2 -2
  121. package/plugins/operator/notIn.js +2 -9
  122. package/plugins/operator/notIn.js.map +1 -1
  123. package/plugins/operator/notStartsWith.d.ts +2 -2
  124. package/plugins/operator/notStartsWith.js +2 -9
  125. package/plugins/operator/notStartsWith.js.map +1 -1
  126. package/plugins/operator/startsWith.d.ts +2 -2
  127. package/plugins/operator/startsWith.js +2 -9
  128. package/plugins/operator/startsWith.js.map +1 -1
  129. package/sharedIndex.js +2 -9
  130. package/sharedIndex.js.map +1 -1
  131. package/sort.d.ts +2 -2
  132. package/sort.js +8 -16
  133. package/sort.js.map +1 -1
  134. package/types.d.ts +3 -3
  135. package/types.js +28 -26
  136. package/types.js.map +1 -1
  137. package/utils/createIndex.d.ts +0 -1
  138. package/utils/createIndex.js +7 -19
  139. package/utils/createIndex.js.map +1 -1
  140. package/utils/index.d.ts +3 -3
  141. package/utils/index.js +3 -27
  142. package/utils/index.js.map +1 -1
  143. package/utils/waitUntilHealthy/UnhealthyClusterError.js +2 -9
  144. package/utils/waitUntilHealthy/UnhealthyClusterError.js.map +1 -1
  145. package/utils/waitUntilHealthy/WaitUntilHealthy.d.ts +3 -3
  146. package/utils/waitUntilHealthy/WaitUntilHealthy.js +22 -29
  147. package/utils/waitUntilHealthy/WaitUntilHealthy.js.map +1 -1
  148. package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js +2 -9
  149. package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js.map +1 -1
  150. package/utils/waitUntilHealthy/index.d.ts +6 -6
  151. package/utils/waitUntilHealthy/index.js +6 -49
  152. package/utils/waitUntilHealthy/index.js.map +1 -1
  153. package/utils/waitUntilHealthy/reason/ClusterHealthReason.d.ts +2 -2
  154. package/utils/waitUntilHealthy/reason/ClusterHealthReason.js +2 -10
  155. package/utils/waitUntilHealthy/reason/ClusterHealthReason.js.map +1 -1
  156. package/utils/waitUntilHealthy/reason/IReason.js +1 -5
  157. package/utils/waitUntilHealthy/reason/MemoryReason.d.ts +1 -1
  158. package/utils/waitUntilHealthy/reason/MemoryReason.js +2 -10
  159. package/utils/waitUntilHealthy/reason/MemoryReason.js.map +1 -1
  160. package/utils/waitUntilHealthy/reason/ProcessorReason.d.ts +1 -1
  161. package/utils/waitUntilHealthy/reason/ProcessorReason.js +2 -10
  162. package/utils/waitUntilHealthy/reason/ProcessorReason.js.map +1 -1
  163. package/utils/waitUntilHealthy/reason/index.d.ts +3 -3
  164. package/utils/waitUntilHealthy/reason/index.js +3 -38
  165. package/utils/waitUntilHealthy/reason/index.js.map +1 -1
  166. package/where.d.ts +3 -3
  167. package/where.js +7 -16
  168. package/where.js.map +1 -1
  169. package/indexConfiguration/japanese.d.ts +0 -6
  170. package/indexConfiguration/japanese.js +0 -121
  171. package/indexConfiguration/japanese.js.map +0 -1
  172. package/plugins/operator/japanese/contains.d.ts +0 -8
  173. package/plugins/operator/japanese/contains.js +0 -44
  174. package/plugins/operator/japanese/contains.js.map +0 -1
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","_api","_client","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get","_operators","_elasticsearch","_indexConfiguration","_plugins","_sort","_indices","_where","_limit","_normalize","_compression","_cursors","_utils","_operations","_sharedIndex","_indexPrefix","_default","params","ContextPlugin","context","elasticsearch","WebinyError","Client","createElasticsearchClient","plugins","register","getElasticsearchOperators","default"],"sources":["index.ts"],"sourcesContent":["/**\n * TODO File should contain only exports from other files.\n */\nimport WebinyError from \"@webiny/error\";\nimport type { ElasticsearchContext } from \"~/types\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport type { ElasticsearchClientOptions } from \"~/client\";\nimport { createElasticsearchClient } from \"~/client\";\nimport { getElasticsearchOperators } from \"~/operators\";\nimport { Client } from \"@elastic/elasticsearch\";\n\nexport * from \"./indexConfiguration\";\nexport * from \"./plugins\";\nexport * from \"./sort\";\nexport * from \"./indices\";\nexport * from \"./where\";\nexport * from \"./limit\";\nexport * from \"./normalize\";\nexport * from \"./compression\";\nexport * from \"./operators\";\nexport * from \"./cursors\";\nexport * from \"./client\";\nexport * from \"./utils\";\nexport * from \"./operations\";\nexport * from \"./sharedIndex\";\nexport * from \"./indexPrefix\";\n\n/**\n * We must accept either Elasticsearch client or options that create the client.\n */\nexport default (\n params: ElasticsearchClientOptions | Client\n): ContextPlugin<ElasticsearchContext> => {\n return new ContextPlugin<ElasticsearchContext>(context => {\n if (context.elasticsearch) {\n throw new WebinyError(\n \"Elasticsearch client is already initialized, no need to define it again. Check your code for duplicate initializations.\",\n \"ELASTICSEARCH_ALREADY_INITIALIZED\"\n );\n }\n /**\n * Initialize the Elasticsearch client.\n */\n context.elasticsearch =\n params instanceof Client ? params : createElasticsearchClient(params);\n\n context.plugins.register(getElasticsearchOperators());\n });\n};\n"],"mappings":";;;;;;;;AAGA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,IAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AAcAG,MAAA,CAAAC,IAAA,CAAAF,OAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,OAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,OAAA,CAAAI,GAAA;IAAA;EAAA;AAAA;AAbA,IAAAS,UAAA,GAAAf,OAAA;AAWAG,MAAA,CAAAC,IAAA,CAAAW,UAAA,EAAAV,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAS,UAAA,CAAAT,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAA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AIA,OAAO,CAACC,aAAa,EAAE;MACvB,MAAM,IAAIC,cAAW,CACjB,yHAAyH,EACzH,mCACJ,CAAC;IACL;IACA;AACR;AACA;IACQF,OAAO,CAACC,aAAa,GACjBH,MAAM,YAAYK,qBAAM,GAAGL,MAAM,GAAG,IAAAM,iCAAyB,EAACN,MAAM,CAAC;IAEzEE,OAAO,CAACK,OAAO,CAACC,QAAQ,CAAC,IAAAC,oCAAyB,EAAC,CAAC,CAAC;EACzD,CAAC,CAAC;AACN,CAAC;AAAA7B,OAAA,CAAA8B,OAAA,GAAAX,QAAA","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","ContextPlugin","createElasticsearchClient","getElasticsearchOperators","Client","params","context","elasticsearch","plugins","register"],"sources":["index.ts"],"sourcesContent":["/**\n * TODO File should contain only exports from other files.\n */\nimport WebinyError from \"@webiny/error\";\nimport type { ElasticsearchContext } from \"~/types.js\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport type { ElasticsearchClientOptions } from \"~/client.js\";\nimport { createElasticsearchClient } from \"~/client.js\";\nimport { getElasticsearchOperators } from \"~/operators.js\";\nimport { Client } from \"@elastic/elasticsearch\";\n\nexport * from \"./indexConfiguration/index.js\";\nexport * from \"./plugins/index.js\";\nexport * from \"./sort.js\";\nexport * from \"./indices.js\";\nexport * from \"./where.js\";\nexport * from \"./limit.js\";\nexport * from \"./normalize.js\";\nexport * from \"./compression.js\";\nexport * from \"./operators.js\";\nexport * from \"./cursors.js\";\nexport * from \"./client.js\";\nexport * from \"./utils/index.js\";\nexport * from \"./operations/index.js\";\nexport * from \"./sharedIndex.js\";\nexport * from \"./indexPrefix.js\";\nexport * from \"./db/index.js\";\n\n/**\n * We must accept either Elasticsearch client or options that create the client.\n */\nexport default (\n params: ElasticsearchClientOptions | Client\n): ContextPlugin<ElasticsearchContext> => {\n return new ContextPlugin<ElasticsearchContext>(context => {\n if (context.elasticsearch) {\n throw new WebinyError(\n \"Elasticsearch client is already initialized, no need to define it again. Check your code for duplicate initializations.\",\n \"OPENSEARCH_ALREADY_INITIALIZED\"\n );\n }\n /**\n * Initialize the Elasticsearch client.\n */\n context.elasticsearch =\n params instanceof Client ? params : createElasticsearchClient(params);\n\n context.plugins.register(getElasticsearchOperators());\n });\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAW,MAAM,eAAe;AAEvC,SAASC,aAAa,QAAQ,aAAa;AAE3C,SAASC,yBAAyB;AAClC,SAASC,yBAAyB;AAClC,SAASC,MAAM,QAAQ,wBAAwB;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,eACIC,MAA2C,IACL;EACtC,OAAO,IAAIJ,aAAa,CAAuBK,OAAO,IAAI;IACtD,IAAIA,OAAO,CAACC,aAAa,EAAE;MACvB,MAAM,IAAIP,WAAW,CACjB,yHAAyH,EACzH,gCACJ,CAAC;IACL;IACA;AACR;AACA;IACQM,OAAO,CAACC,aAAa,GACjBF,MAAM,YAAYD,MAAM,GAAGC,MAAM,GAAGH,yBAAyB,CAACG,MAAM,CAAC;IAEzEC,OAAO,CAACE,OAAO,CAACC,QAAQ,CAACN,yBAAyB,CAAC,CAAC,CAAC;EACzD,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { ElasticsearchIndexRequestBody } from "../types";
1
+ import type { ElasticsearchIndexRequestBody } from "../types.js";
2
2
  interface Modifier {
3
3
  (config: ElasticsearchIndexRequestBody): ElasticsearchIndexRequestBody;
4
4
  }
@@ -1,13 +1,7 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getBaseConfiguration = void 0;
7
- var _common = require("./common");
1
+ import { getCommonMappings } from "./common.js";
8
2
  const config = {
9
3
  mappings: {
10
- dynamic_templates: (0, _common.getCommonMappings)(mappings => {
4
+ dynamic_templates: getCommonMappings(mappings => {
11
5
  return mappings.concat([{
12
6
  strings: {
13
7
  match_mapping_type: "string",
@@ -31,12 +25,11 @@ const config = {
31
25
  }
32
26
  }
33
27
  };
34
- const getBaseConfiguration = modifier => {
28
+ export const getBaseConfiguration = modifier => {
35
29
  if (!modifier) {
36
30
  return config;
37
31
  }
38
32
  return modifier(config);
39
33
  };
40
- exports.getBaseConfiguration = getBaseConfiguration;
41
34
 
42
35
  //# sourceMappingURL=base.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","config","mappings","dynamic_templates","getCommonMappings","concat","strings","match_mapping_type","mapping","type","fields","keyword","ignore_above","properties","rawValues","enabled","getBaseConfiguration","modifier","exports"],"sources":["base.ts"],"sourcesContent":["import type { ElasticsearchIndexRequestBody } from \"~/types\";\nimport { getCommonMappings } from \"./common\";\n\nconst config: ElasticsearchIndexRequestBody = {\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: ElasticsearchIndexRequestBody): ElasticsearchIndexRequestBody;\n}\nexport const getBaseConfiguration = (modifier?: Modifier) => {\n if (!modifier) {\n return config;\n }\n return modifier(config);\n};\n"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAEA,MAAMC,MAAqC,GAAG;EAC1CC,QAAQ,EAAE;IACNC,iBAAiB,EAAE,IAAAC,yBAAiB,EAACF,QAAQ,IAAI;MAC7C,OAAOA,QAAQ,CAACG,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;AAKM,MAAMC,oBAAoB,GAAIC,QAAmB,IAAK;EACzD,IAAI,CAACA,QAAQ,EAAE;IACX,OAAOhB,MAAM;EACjB;EACA,OAAOgB,QAAQ,CAAChB,MAAM,CAAC;AAC3B,CAAC;AAACiB,OAAA,CAAAF,oBAAA,GAAAA,oBAAA","ignoreList":[]}
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 { ElasticsearchIndexRequestBody } from \"~/types.js\";\nimport { getCommonMappings } from \"./common.js\";\n\nconst config: ElasticsearchIndexRequestBody = {\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: ElasticsearchIndexRequestBody): ElasticsearchIndexRequestBody;\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,MAAqC,GAAG;EAC1CC,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,4 +1,4 @@
1
- import type { ElasticsearchIndexRequestBodyMappingsDynamicTemplate } from "../types";
1
+ import type { ElasticsearchIndexRequestBodyMappingsDynamicTemplate } from "../types.js";
2
2
  interface Modifier {
3
3
  (mappings: ElasticsearchIndexRequestBodyMappingsDynamicTemplate[]): ElasticsearchIndexRequestBodyMappingsDynamicTemplate[];
4
4
  }
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getCommonMappings = void 0;
7
1
  const getDefaultMappings = () => {
8
2
  return [{
9
3
  ids: {
@@ -43,12 +37,11 @@ const getDefaultMappings = () => {
43
37
  /**
44
38
  * @internal
45
39
  */
46
- const getCommonMappings = cb => {
40
+ export const getCommonMappings = cb => {
47
41
  if (!cb) {
48
42
  return getDefaultMappings();
49
43
  }
50
44
  return cb(getDefaultMappings());
51
45
  };
52
- exports.getCommonMappings = getCommonMappings;
53
46
 
54
47
  //# sourceMappingURL=common.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getDefaultMappings","ids","match","mapping","type","keyword","dates","numbers","scaling_factor","booleans","getCommonMappings","cb","exports"],"sources":["common.ts"],"sourcesContent":["import type { ElasticsearchIndexRequestBodyMappingsDynamicTemplate } from \"~/types\";\n\nconst getDefaultMappings = (): ElasticsearchIndexRequestBodyMappingsDynamicTemplate[] => {\n return [\n {\n ids: {\n match: \"^id|entryId$\",\n mapping: {\n type: \"string\",\n keyword: true\n }\n }\n },\n {\n /**\n * Update with the correct date fields.\n */\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: ElasticsearchIndexRequestBodyMappingsDynamicTemplate[]\n ): ElasticsearchIndexRequestBodyMappingsDynamicTemplate[];\n}\n/**\n * @internal\n */\nexport const getCommonMappings = (\n cb?: Modifier\n): ElasticsearchIndexRequestBodyMappingsDynamicTemplate[] => {\n if (!cb) {\n return getDefaultMappings();\n }\n\n return cb(getDefaultMappings());\n};\n"],"mappings":";;;;;;AAEA,MAAMA,kBAAkB,GAAGA,CAAA,KAA8D;EACrF,OAAO,CACH;IACIC,GAAG,EAAE;MACDC,KAAK,EAAE,cAAc;MACrBC,OAAO,EAAE;QACLC,IAAI,EAAE,QAAQ;QACdC,OAAO,EAAE;MACb;IACJ;EACJ,CAAC,EACD;IACI;AACZ;AACA;IACYC,KAAK,EAAE;MACHJ,KAAK,EAAE,iCAAiC;MACxCC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,EACD;IACIG,OAAO,EAAE;MACLL,KAAK,EAAE,UAAU;MACjBC,OAAO,EAAE;QACLC,IAAI,EAAE,cAAc;QACpBI,cAAc,EAAE;MACpB;IACJ;EACJ,CAAC,EACD;IACIC,QAAQ,EAAE;MACNP,KAAK,EAAE,WAAW;MAClBC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CACJ;AACL,CAAC;AAOD;AACA;AACA;AACO,MAAMM,iBAAiB,GAC1BC,EAAa,IAC4C;EACzD,IAAI,CAACA,EAAE,EAAE;IACL,OAAOX,kBAAkB,CAAC,CAAC;EAC/B;EAEA,OAAOW,EAAE,CAACX,kBAAkB,CAAC,CAAC,CAAC;AACnC,CAAC;AAACY,OAAA,CAAAF,iBAAA,GAAAA,iBAAA","ignoreList":[]}
1
+ {"version":3,"names":["getDefaultMappings","ids","match","mapping","type","keyword","dates","numbers","scaling_factor","booleans","getCommonMappings","cb"],"sources":["common.ts"],"sourcesContent":["import type { ElasticsearchIndexRequestBodyMappingsDynamicTemplate } from \"~/types.js\";\n\nconst getDefaultMappings = (): ElasticsearchIndexRequestBodyMappingsDynamicTemplate[] => {\n return [\n {\n ids: {\n match: \"^id|entryId$\",\n mapping: {\n type: \"string\",\n keyword: true\n }\n }\n },\n {\n /**\n * Update with the correct date fields.\n */\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: ElasticsearchIndexRequestBodyMappingsDynamicTemplate[]\n ): ElasticsearchIndexRequestBodyMappingsDynamicTemplate[];\n}\n/**\n * @internal\n */\nexport const getCommonMappings = (\n cb?: Modifier\n): ElasticsearchIndexRequestBodyMappingsDynamicTemplate[] => {\n if (!cb) {\n return getDefaultMappings();\n }\n\n return cb(getDefaultMappings());\n};\n"],"mappings":"AAEA,MAAMA,kBAAkB,GAAGA,CAAA,KAA8D;EACrF,OAAO,CACH;IACIC,GAAG,EAAE;MACDC,KAAK,EAAE,cAAc;MACrBC,OAAO,EAAE;QACLC,IAAI,EAAE,QAAQ;QACdC,OAAO,EAAE;MACb;IACJ;EACJ,CAAC,EACD;IACI;AACZ;AACA;IACYC,KAAK,EAAE;MACHJ,KAAK,EAAE,iCAAiC;MACxCC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,EACD;IACIG,OAAO,EAAE;MACLL,KAAK,EAAE,UAAU;MACjBC,OAAO,EAAE;QACLC,IAAI,EAAE,cAAc;QACpBI,cAAc,EAAE;MACpB;IACJ;EACJ,CAAC,EACD;IACIC,QAAQ,EAAE;MACNP,KAAK,EAAE,WAAW;MAClBC,OAAO,EAAE;QACLC,IAAI,EAAE;MACV;IACJ;EACJ,CAAC,CACJ;AACL,CAAC;AAOD;AACA;AACA;AACA,OAAO,MAAMM,iBAAiB,GAC1BC,EAAa,IAC4C;EACzD,IAAI,CAACA,EAAE,EAAE;IACL,OAAOX,kBAAkB,CAAC,CAAC;EAC/B;EAEA,OAAOW,EAAE,CAACX,kBAAkB,CAAC,CAAC,CAAC;AACnC,CAAC","ignoreList":[]}
@@ -1,3 +1,2 @@
1
- export * from "./base";
2
- export * from "./common";
3
- export * from "./japanese";
1
+ export * from "./base.js";
2
+ export * from "./common.js";
@@ -1,40 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _base = require("./base");
7
- Object.keys(_base).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _base[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _base[key];
14
- }
15
- });
16
- });
17
- var _common = require("./common");
18
- Object.keys(_common).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _common[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _common[key];
25
- }
26
- });
27
- });
28
- var _japanese = require("./japanese");
29
- Object.keys(_japanese).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _japanese[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _japanese[key];
36
- }
37
- });
38
- });
1
+ export * from "./base.js";
2
+ export * from "./common.js";
39
3
 
40
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_base","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_common","_japanese"],"sources":["index.ts"],"sourcesContent":["export * from \"./base\";\nexport * from \"./common\";\nexport * from \"./japanese\";\n"],"mappings":";;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,KAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,KAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,KAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,OAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,OAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,OAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,OAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,SAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,SAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,SAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,SAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./base.js\";\nexport * from \"./common.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
package/indexPrefix.js CHANGED
@@ -1,12 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getElasticsearchIndexPrefix = void 0;
7
- const getElasticsearchIndexPrefix = () => {
8
- return process.env.ELASTIC_SEARCH_INDEX_PREFIX || process.env.WEBINY_ELASTIC_SEARCH_INDEX_PREFIX || "";
1
+ export const getElasticsearchIndexPrefix = () => {
2
+ return process.env.OPENSEARCH_INDEX_PREFIX || process.env.WEBINY_OPENSEARCH_INDEX_PREFIX || "";
9
3
  };
10
- exports.getElasticsearchIndexPrefix = getElasticsearchIndexPrefix;
11
4
 
12
5
  //# sourceMappingURL=indexPrefix.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getElasticsearchIndexPrefix","process","env","ELASTIC_SEARCH_INDEX_PREFIX","WEBINY_ELASTIC_SEARCH_INDEX_PREFIX","exports"],"sources":["indexPrefix.ts"],"sourcesContent":["export const getElasticsearchIndexPrefix = (): string => {\n return (\n process.env.ELASTIC_SEARCH_INDEX_PREFIX ||\n process.env.WEBINY_ELASTIC_SEARCH_INDEX_PREFIX ||\n \"\"\n );\n};\n"],"mappings":";;;;;;AAAO,MAAMA,2BAA2B,GAAGA,CAAA,KAAc;EACrD,OACIC,OAAO,CAACC,GAAG,CAACC,2BAA2B,IACvCF,OAAO,CAACC,GAAG,CAACE,kCAAkC,IAC9C,EAAE;AAEV,CAAC;AAACC,OAAA,CAAAL,2BAAA,GAAAA,2BAAA","ignoreList":[]}
1
+ {"version":3,"names":["getElasticsearchIndexPrefix","process","env","OPENSEARCH_INDEX_PREFIX","WEBINY_OPENSEARCH_INDEX_PREFIX"],"sources":["indexPrefix.ts"],"sourcesContent":["export const getElasticsearchIndexPrefix = (): string => {\n return process.env.OPENSEARCH_INDEX_PREFIX || process.env.WEBINY_OPENSEARCH_INDEX_PREFIX || \"\";\n};\n"],"mappings":"AAAA,OAAO,MAAMA,2BAA2B,GAAGA,CAAA,KAAc;EACrD,OAAOC,OAAO,CAACC,GAAG,CAACC,uBAAuB,IAAIF,OAAO,CAACC,GAAG,CAACE,8BAA8B,IAAI,EAAE;AAClG,CAAC","ignoreList":[]}
package/indices.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import type { ElasticsearchIndexPlugin } from "./plugins/definition/ElasticsearchIndexPlugin";
1
+ import type { ElasticsearchIndexPlugin } from "./plugins/definition/ElasticsearchIndexPlugin.js";
2
2
  import type { PluginsContainer } from "@webiny/plugins";
3
3
  interface IndicesPluginsParams {
4
4
  container: PluginsContainer;
5
5
  type: string;
6
- locale: string;
7
6
  }
8
7
  export declare const getLastAddedIndexPlugin: <T extends ElasticsearchIndexPlugin>(params: IndicesPluginsParams) => T;
9
8
  export {};
package/indices.js CHANGED
@@ -1,30 +1,20 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.getLastAddedIndexPlugin = void 0;
8
- var _error = _interopRequireDefault(require("@webiny/error"));
1
+ import WebinyError from "@webiny/error";
9
2
  const listIndicesPlugins = ({
10
3
  container,
11
- type,
12
- locale
4
+ type
13
5
  }) => {
14
6
  return container.byType(type).filter(plugin => {
15
- return plugin.canUse(locale);
7
+ return plugin.canUse();
16
8
  });
17
9
  };
18
- const getLastAddedIndexPlugin = params => {
10
+ export const getLastAddedIndexPlugin = params => {
19
11
  const plugins = listIndicesPlugins(params);
20
12
  if (plugins.length === 0) {
21
- throw new _error.default(`Could not find a single ElasticsearchIndexPlugin of type "${params.type}".`, "ELASTICSEARCH_INDEX_TEMPLATE_ERROR", {
22
- type: params.type,
23
- locale: params.locale
13
+ throw new WebinyError(`Could not find a single ElasticsearchIndexPlugin of type "${params.type}".`, "OPENSEARCH_INDEX_TEMPLATE_ERROR", {
14
+ type: params.type
24
15
  });
25
16
  }
26
17
  return plugins.pop();
27
18
  };
28
- exports.getLastAddedIndexPlugin = getLastAddedIndexPlugin;
29
19
 
30
20
  //# sourceMappingURL=indices.js.map
package/indices.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_error","_interopRequireDefault","require","listIndicesPlugins","container","type","locale","byType","filter","plugin","canUse","getLastAddedIndexPlugin","params","plugins","length","WebinyError","pop","exports"],"sources":["indices.ts"],"sourcesContent":["import type { ElasticsearchIndexPlugin } from \"~/plugins/definition/ElasticsearchIndexPlugin\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport WebinyError from \"@webiny/error\";\n\ninterface IndicesPluginsParams {\n container: PluginsContainer;\n type: string;\n locale: string;\n}\nconst listIndicesPlugins = <T extends ElasticsearchIndexPlugin>({\n container,\n type,\n locale\n}: IndicesPluginsParams): T[] => {\n return container.byType<T>(type).filter(plugin => {\n return plugin.canUse(locale);\n });\n};\n\nexport const getLastAddedIndexPlugin = <T extends ElasticsearchIndexPlugin>(\n params: IndicesPluginsParams\n): T => {\n const plugins = listIndicesPlugins<T>(params);\n if (plugins.length === 0) {\n throw new WebinyError(\n `Could not find a single ElasticsearchIndexPlugin of type \"${params.type}\".`,\n \"ELASTICSEARCH_INDEX_TEMPLATE_ERROR\",\n {\n type: params.type,\n locale: params.locale\n }\n );\n }\n\n return plugins.pop() as T;\n};\n"],"mappings":";;;;;;;AAEA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAOA,MAAMC,kBAAkB,GAAGA,CAAqC;EAC5DC,SAAS;EACTC,IAAI;EACJC;AACkB,CAAC,KAAU;EAC7B,OAAOF,SAAS,CAACG,MAAM,CAAIF,IAAI,CAAC,CAACG,MAAM,CAACC,MAAM,IAAI;IAC9C,OAAOA,MAAM,CAACC,MAAM,CAACJ,MAAM,CAAC;EAChC,CAAC,CAAC;AACN,CAAC;AAEM,MAAMK,uBAAuB,GAChCC,MAA4B,IACxB;EACJ,MAAMC,OAAO,GAAGV,kBAAkB,CAAIS,MAAM,CAAC;EAC7C,IAAIC,OAAO,CAACC,MAAM,KAAK,CAAC,EAAE;IACtB,MAAM,IAAIC,cAAW,CACjB,6DAA6DH,MAAM,CAACP,IAAI,IAAI,EAC5E,oCAAoC,EACpC;MACIA,IAAI,EAAEO,MAAM,CAACP,IAAI;MACjBC,MAAM,EAAEM,MAAM,CAACN;IACnB,CACJ,CAAC;EACL;EAEA,OAAOO,OAAO,CAACG,GAAG,CAAC,CAAC;AACxB,CAAC;AAACC,OAAA,CAAAN,uBAAA,GAAAA,uBAAA","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","listIndicesPlugins","container","type","byType","filter","plugin","canUse","getLastAddedIndexPlugin","params","plugins","length","pop"],"sources":["indices.ts"],"sourcesContent":["import type { ElasticsearchIndexPlugin } from \"~/plugins/definition/ElasticsearchIndexPlugin.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport WebinyError from \"@webiny/error\";\n\ninterface IndicesPluginsParams {\n container: PluginsContainer;\n type: string;\n}\nconst listIndicesPlugins = <T extends ElasticsearchIndexPlugin>({\n container,\n type\n}: IndicesPluginsParams): T[] => {\n return container.byType<T>(type).filter(plugin => {\n return plugin.canUse();\n });\n};\n\nexport const getLastAddedIndexPlugin = <T extends ElasticsearchIndexPlugin>(\n params: IndicesPluginsParams\n): T => {\n const plugins = listIndicesPlugins<T>(params);\n if (plugins.length === 0) {\n throw new WebinyError(\n `Could not find a single ElasticsearchIndexPlugin of type \"${params.type}\".`,\n \"OPENSEARCH_INDEX_TEMPLATE_ERROR\",\n {\n type: params.type\n }\n );\n }\n\n return plugins.pop() as T;\n};\n"],"mappings":"AAEA,OAAOA,WAAW,MAAM,eAAe;AAMvC,MAAMC,kBAAkB,GAAGA,CAAqC;EAC5DC,SAAS;EACTC;AACkB,CAAC,KAAU;EAC7B,OAAOD,SAAS,CAACE,MAAM,CAAID,IAAI,CAAC,CAACE,MAAM,CAACC,MAAM,IAAI;IAC9C,OAAOA,MAAM,CAACC,MAAM,CAAC,CAAC;EAC1B,CAAC,CAAC;AACN,CAAC;AAED,OAAO,MAAMC,uBAAuB,GAChCC,MAA4B,IACxB;EACJ,MAAMC,OAAO,GAAGT,kBAAkB,CAAIQ,MAAM,CAAC;EAC7C,IAAIC,OAAO,CAACC,MAAM,KAAK,CAAC,EAAE;IACtB,MAAM,IAAIX,WAAW,CACjB,6DAA6DS,MAAM,CAACN,IAAI,IAAI,EAC5E,iCAAiC,EACjC;MACIA,IAAI,EAAEM,MAAM,CAACN;IACjB,CACJ,CAAC;EACL;EAEA,OAAOO,OAAO,CAACE,GAAG,CAAC,CAAC;AACxB,CAAC","ignoreList":[]}
package/limit.js CHANGED
@@ -1,9 +1,3 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createLimit = void 0;
7
1
  /**
8
2
  * This is the max limit of the Elasticsearch.
9
3
  * Change here if it changes (and if it is necessary).
@@ -13,7 +7,7 @@ const ES_LIMIT_MAX = 10000;
13
7
  * Our system default limit.
14
8
  */
15
9
  const ES_LIMIT_DEFAULT = 50;
16
- const createLimit = (limit, defaultValue = ES_LIMIT_DEFAULT) => {
10
+ export const createLimit = (limit, defaultValue = ES_LIMIT_DEFAULT) => {
17
11
  /**
18
12
  * Limit can possibly be null/undefined or less than 1.
19
13
  * In that case return the defaults.
@@ -34,6 +28,5 @@ const createLimit = (limit, defaultValue = ES_LIMIT_DEFAULT) => {
34
28
  */
35
29
  return ES_LIMIT_MAX - 1;
36
30
  };
37
- exports.createLimit = createLimit;
38
31
 
39
32
  //# sourceMappingURL=limit.js.map
package/limit.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ES_LIMIT_MAX","ES_LIMIT_DEFAULT","createLimit","limit","defaultValue","exports"],"sources":["limit.ts"],"sourcesContent":["/**\n * This is the max limit of the Elasticsearch.\n * Change here if it changes (and if it is necessary).\n */\nconst ES_LIMIT_MAX = 10000;\n/**\n * Our system default limit.\n */\nconst ES_LIMIT_DEFAULT = 50;\n\nexport const createLimit = (limit?: number, defaultValue = ES_LIMIT_DEFAULT): number => {\n /**\n * Limit can possibly be null/undefined or less than 1.\n * In that case return the defaults.\n */\n if (!limit || limit < 1) {\n return defaultValue;\n }\n /**\n * Users input limit cannot be greater than the Elasticsearch one.\n * Elasticsearch query breaks because of that.\n */\n if (limit < ES_LIMIT_MAX) {\n return limit;\n }\n /**\n * Always reduce by 1 because we check if there are more items by adding 1 to the limit\n * and then remove that last one loaded.\n */\n return ES_LIMIT_MAX - 1;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,KAAK;AAC1B;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG,EAAE;AAEpB,MAAMC,WAAW,GAAGA,CAACC,KAAc,EAAEC,YAAY,GAAGH,gBAAgB,KAAa;EACpF;AACJ;AACA;AACA;EACI,IAAI,CAACE,KAAK,IAAIA,KAAK,GAAG,CAAC,EAAE;IACrB,OAAOC,YAAY;EACvB;EACA;AACJ;AACA;AACA;EACI,IAAID,KAAK,GAAGH,YAAY,EAAE;IACtB,OAAOG,KAAK;EAChB;EACA;AACJ;AACA;AACA;EACI,OAAOH,YAAY,GAAG,CAAC;AAC3B,CAAC;AAACK,OAAA,CAAAH,WAAA,GAAAA,WAAA","ignoreList":[]}
1
+ {"version":3,"names":["ES_LIMIT_MAX","ES_LIMIT_DEFAULT","createLimit","limit","defaultValue"],"sources":["limit.ts"],"sourcesContent":["/**\n * This is the max limit of the Elasticsearch.\n * Change here if it changes (and if it is necessary).\n */\nconst ES_LIMIT_MAX = 10000;\n/**\n * Our system default limit.\n */\nconst ES_LIMIT_DEFAULT = 50;\n\nexport const createLimit = (limit?: number, defaultValue = ES_LIMIT_DEFAULT): number => {\n /**\n * Limit can possibly be null/undefined or less than 1.\n * In that case return the defaults.\n */\n if (!limit || limit < 1) {\n return defaultValue;\n }\n /**\n * Users input limit cannot be greater than the Elasticsearch one.\n * Elasticsearch query breaks because of that.\n */\n if (limit < ES_LIMIT_MAX) {\n return limit;\n }\n /**\n * Always reduce by 1 because we check if there are more items by adding 1 to the limit\n * and then remove that last one loaded.\n */\n return ES_LIMIT_MAX - 1;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,KAAK;AAC1B;AACA;AACA;AACA,MAAMC,gBAAgB,GAAG,EAAE;AAE3B,OAAO,MAAMC,WAAW,GAAGA,CAACC,KAAc,EAAEC,YAAY,GAAGH,gBAAgB,KAAa;EACpF;AACJ;AACA;AACA;EACI,IAAI,CAACE,KAAK,IAAIA,KAAK,GAAG,CAAC,EAAE;IACrB,OAAOC,YAAY;EACvB;EACA;AACJ;AACA;AACA;EACI,IAAID,KAAK,GAAGH,YAAY,EAAE;IACtB,OAAOG,KAAK;EAChB;EACA;AACJ;AACA;AACA;EACI,OAAOH,YAAY,GAAG,CAAC;AAC3B,CAAC","ignoreList":[]}
package/normalize.js CHANGED
@@ -1,20 +1,14 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.normalizeValueWithAsterisk = exports.normalizeValue = void 0;
7
1
  /**
8
2
  * Before performing the query, we need to escape all special characters.
9
3
  * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_reserved_characters
10
4
  */
11
5
 
12
6
  const specialCharactersToRemove = [`\\?`];
13
- const specialCharacterToSpace = ["-"];
7
+ const specialCharacterToSpace = ["-", "\\\\"];
14
8
  const specialCharacters = ["\\\\", "\\+",
15
9
  // "\\-",
16
10
  "\\=", `\&`, `\\|`, ">", "<", `\!`, "\\(", "\\)", "\\{", "\\}", "\\[", "\\]", "\\^", '\\"', "\\~", "\\*", `\:`, `\/`, "\\#"];
17
- const normalizeValue = value => {
11
+ export const normalizeValue = value => {
18
12
  let result = value || "";
19
13
  if (!result) {
20
14
  return result;
@@ -30,14 +24,13 @@ const normalizeValue = value => {
30
24
  }
31
25
  return result || "";
32
26
  };
33
- exports.normalizeValue = normalizeValue;
34
27
  const hasSpecialChar = value => {
35
28
  if (!value) {
36
29
  return null;
37
30
  }
38
31
  return value.match(/^([0-9a-zA-Z]+)$/i) === null;
39
32
  };
40
- const normalizeValueWithAsterisk = initial => {
33
+ export const normalizeValueWithAsterisk = initial => {
41
34
  const value = normalizeValue(initial);
42
35
  const results = value.split(" ");
43
36
  let result = value;
@@ -57,6 +50,5 @@ const normalizeValueWithAsterisk = initial => {
57
50
  }
58
51
  return result;
59
52
  };
60
- exports.normalizeValueWithAsterisk = normalizeValueWithAsterisk;
61
53
 
62
54
  //# sourceMappingURL=normalize.js.map
package/normalize.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["specialCharactersToRemove","specialCharacterToSpace","specialCharacters","normalizeValue","value","result","character","replace","RegExp","exports","hasSpecialChar","match","normalizeValueWithAsterisk","initial","results","split","firstWord","lastWord","length"],"sources":["normalize.ts"],"sourcesContent":["/**\n * Before performing the query, we need to escape all special characters.\n * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_reserved_characters\n */\n\nconst specialCharactersToRemove = [`\\\\?`];\n\nconst specialCharacterToSpace = [\"-\"];\n\nconst specialCharacters = [\n \"\\\\\\\\\",\n \"\\\\+\",\n // \"\\\\-\",\n \"\\\\=\",\n `\\&`,\n `\\\\|`,\n \">\",\n \"<\",\n `\\!`,\n \"\\\\(\",\n \"\\\\)\",\n \"\\\\{\",\n \"\\\\}\",\n \"\\\\[\",\n \"\\\\]\",\n \"\\\\^\",\n '\\\\\"',\n \"\\\\~\",\n \"\\\\*\",\n `\\:`,\n `\\/`,\n \"\\\\#\"\n];\n\nexport const normalizeValue = (value: string) => {\n let result = value || \"\";\n if (!result) {\n return result;\n }\n for (const character of specialCharactersToRemove) {\n result = result.replace(new RegExp(character, \"g\"), \"\");\n }\n for (const character of specialCharacterToSpace) {\n result = result.replace(new RegExp(character, \"g\"), \" \");\n }\n\n for (const character of specialCharacters) {\n result = result.replace(new RegExp(character, \"g\"), `\\\\${character}`);\n }\n\n return result || \"\";\n};\n\nconst hasSpecialChar = (value: string): boolean | null => {\n if (!value) {\n return null;\n }\n return value.match(/^([0-9a-zA-Z]+)$/i) === null;\n};\n\nexport const normalizeValueWithAsterisk = (initial: string) => {\n const value = normalizeValue(initial);\n const results = value.split(\" \");\n\n let result = value;\n /**\n * If there is a / in the first word, do not put asterisk in front of it.\n */\n const firstWord = results[0];\n if (hasSpecialChar(firstWord) === false) {\n result = `*${result}`;\n }\n /**\n * If there is a / in the last word, do not put asterisk at the end of it.\n */\n const lastWord = results[results.length - 1];\n if (hasSpecialChar(lastWord) === false) {\n result = `${result}*`;\n }\n\n return result;\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAEA,MAAMA,yBAAyB,GAAG,CAAC,KAAK,CAAC;AAEzC,MAAMC,uBAAuB,GAAG,CAAC,GAAG,CAAC;AAErC,MAAMC,iBAAiB,GAAG,CACtB,MAAM,EACN,KAAK;AACL;AACA,KAAK,EACL,IAAI,EACJ,KAAK,EACL,GAAG,EACH,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,CACR;AAEM,MAAMC,cAAc,GAAIC,KAAa,IAAK;EAC7C,IAAIC,MAAM,GAAGD,KAAK,IAAI,EAAE;EACxB,IAAI,CAACC,MAAM,EAAE;IACT,OAAOA,MAAM;EACjB;EACA,KAAK,MAAMC,SAAS,IAAIN,yBAAyB,EAAE;IAC/CK,MAAM,GAAGA,MAAM,CAACE,OAAO,CAAC,IAAIC,M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AA,CAAAG,0BAAA,GAAAA,0BAAA","ignoreList":[]}
1
+ {"version":3,"names":["specialCharactersToRemove","specialCharacterToSpace","specialCharacters","normalizeValue","value","result","character","replace","RegExp","hasSpecialChar","match","normalizeValueWithAsterisk","initial","results","split","firstWord","lastWord","length"],"sources":["normalize.ts"],"sourcesContent":["/**\n * Before performing the query, we need to escape all special characters.\n * @see https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#_reserved_characters\n */\n\nconst specialCharactersToRemove = [`\\\\?`];\n\nconst specialCharacterToSpace = [\"-\", \"\\\\\\\\\"];\n\nconst specialCharacters = [\n \"\\\\\\\\\",\n \"\\\\+\",\n // \"\\\\-\",\n \"\\\\=\",\n `\\&`,\n `\\\\|`,\n \">\",\n \"<\",\n `\\!`,\n \"\\\\(\",\n \"\\\\)\",\n \"\\\\{\",\n \"\\\\}\",\n \"\\\\[\",\n \"\\\\]\",\n \"\\\\^\",\n '\\\\\"',\n \"\\\\~\",\n \"\\\\*\",\n `\\:`,\n `\\/`,\n \"\\\\#\"\n];\n\nexport const normalizeValue = (value: string) => {\n let result = value || \"\";\n if (!result) {\n return result;\n }\n for (const character of specialCharactersToRemove) {\n result = result.replace(new RegExp(character, \"g\"), \"\");\n }\n for (const character of specialCharacterToSpace) {\n result = result.replace(new RegExp(character, \"g\"), \" \");\n }\n\n for (const character of specialCharacters) {\n result = result.replace(new RegExp(character, \"g\"), `\\\\${character}`);\n }\n\n return result || \"\";\n};\n\nconst hasSpecialChar = (value: string): boolean | null => {\n if (!value) {\n return null;\n }\n return value.match(/^([0-9a-zA-Z]+)$/i) === null;\n};\n\nexport const normalizeValueWithAsterisk = (initial: string) => {\n const value = normalizeValue(initial);\n const results = value.split(\" \");\n\n let result = value;\n /**\n * If there is a / in the first word, do not put asterisk in front of it.\n */\n const firstWord = results[0];\n if (hasSpecialChar(firstWord) === false) {\n result = `*${result}`;\n }\n /**\n * If there is a / in the last word, do not put asterisk at the end of it.\n */\n const lastWord = results[results.length - 1];\n if (hasSpecialChar(lastWord) === false) {\n result = `${result}*`;\n }\n\n return result;\n};\n"],"mappings":"AAAA;AACA;AACA;AACA;;AAEA,MAAMA,yBAAyB,GAAG,CAAC,KAAK,CAAC;AAEzC,MAAMC,uBAAuB,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC;AAE7C,MAAMC,iBAAiB,GAAG,CACtB,MAAM,EACN,KAAK;AACL;AACA,KAAK,EACL,IAAI,EACJ,KAAK,EACL,GAAG,EACH,GAAG,EACH,IAAI,EACJ,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,KAAK,EACL,IAAI,EACJ,IAAI,EACJ,KAAK,CACR;AAED,OAAO,MAAMC,cAAc,GAAIC,KAAa,IAAK;EAC7C,IAAIC,MAAM,GAAGD,KAAK,IAAI,EAAE;EACxB,IAAI,CAACC,MAAM,EAAE;IACT,OAAOA,MAAM;EACjB;EACA,KAAK,MAAMC,SAAS,IAAIN,yBAAyB,EAAE;IAC/CK,MAAM,GAAGA,MAAM,CAACE,OAAO,CAAC,IAAIC,MAAM,CAACF,SAAS,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC;EAC3D;EACA,KAAK,MAAMA,SAAS,IAAIL,uBAAuB,EAAE;IAC7CI,MAAM,GAAGA,MAAM,CAACE,OAAO,CAAC,IAAIC,MAAM,CAACF,SAAS,EAAE,GAAG,CAAC,EAAE,GAAG,CAAC;EAC5D;EAEA,KAAK,MAAMA,SAAS,IAAIJ,iBAAiB,EAAE;IACvCG,MAAM,GAAGA,MAAM,CAACE,OAAO,CAAC,IAAIC,MAAM,CAACF,SAAS,EAAE,GAAG,CAAC,EAAE,KAAKA,SAAS,EAAE,CAAC;EACzE;EAEA,OAAOD,MAAM,IAAI,EAAE;AACvB,CAAC;AAED,MAAMI,cAAc,GAAIL,KAAa,IAAqB;EACtD,IAAI,CAACA,KAAK,EAAE;IACR,OAAO,IAAI;EACf;EACA,OAAOA,KAAK,CAACM,KAAK,CAAC,mBAAmB,CAAC,KAAK,IAAI;AACpD,CAAC;AAED,OAAO,MAAMC,0BAA0B,GAAIC,OAAe,IAAK;EAC3D,MAAMR,KAAK,GAAGD,cAAc,CAACS,OAAO,CAAC;EACrC,MAAMC,OAAO,GAAGT,KAAK,CAACU,KAAK,CAAC,GAAG,CAAC;EAEhC,IAAIT,MAAM,GAAGD,KAAK;EAClB;AACJ;AACA;EACI,MAAMW,SAAS,GAAGF,OAAO,CAAC,CAAC,CAAC;EAC5B,IAAIJ,cAAc,CAACM,SAAS,CAAC,KAAK,KAAK,EAAE;IACrCV,MAAM,GAAG,IAAIA,MAAM,EAAE;EACzB;EACA;AACJ;AACA;EACI,MAAMW,QAAQ,GAAGH,OAAO,CAACA,OAAO,CAACI,MAAM,GAAG,CAAC,CAAC;EAC5C,IAAIR,cAAc,CAACO,QAAQ,CAAC,KAAK,KAAK,EAAE;IACpCX,MAAM,GAAG,GAAGA,MAAM,GAAG;EACzB;EAEA,OAAOA,MAAM;AACjB,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import type { Client } from "../client";
2
- import type { IElasticsearchCatHealthResponse } from "./types";
1
+ import type { Client } from "../client.js";
2
+ import type { IElasticsearchCatHealthResponse } from "./types.js";
3
3
  export declare class ElasticsearchCatHealth {
4
4
  private readonly client;
5
5
  constructor(client: Client);
@@ -1,12 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ElasticsearchCatHealth = void 0;
7
- var _error = require("@webiny/error");
8
- var _stripConnectionFromException = require("./stripConnectionFromException");
9
- class ElasticsearchCatHealth {
1
+ import { WebinyError } from "@webiny/error";
2
+ import { stripConnectionFromException } from "./stripConnectionFromException.js";
3
+ export class ElasticsearchCatHealth {
10
4
  constructor(client) {
11
5
  this.client = client;
12
6
  }
@@ -16,9 +10,9 @@ class ElasticsearchCatHealth {
16
10
  format: "json"
17
11
  });
18
12
  if (!Array.isArray(response.body) || response.body.length === 0) {
19
- throw new _error.WebinyError({
13
+ throw new WebinyError({
20
14
  message: `There is no valid response from cat.health operation.`,
21
- code: "ELASTICSEARCH_HEALTH_INVALID_RESPONSE",
15
+ code: "OPENSEARCH_HEALTH_INVALID_RESPONSE",
22
16
  data: response.body
23
17
  });
24
18
  }
@@ -27,12 +21,11 @@ class ElasticsearchCatHealth {
27
21
  };
28
22
  } catch (ex) {
29
23
  console.error(`Could not fetch cluster health information: ${ex.message}`);
30
- const error = (0, _stripConnectionFromException.stripConnectionFromException)(ex);
24
+ const error = stripConnectionFromException(ex);
31
25
  console.log(JSON.stringify(error));
32
26
  throw error;
33
27
  }
34
28
  }
35
29
  }
36
- exports.ElasticsearchCatHealth = ElasticsearchCatHealth;
37
30
 
38
31
  //# sourceMappingURL=ElasticsearchCatHealth.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_error","require","_stripConnectionFromException","ElasticsearchCatHealth","constructor","client","getHealth","response","cat","health","format","Array","isArray","body","length","WebinyError","message","code","data","ex","console","error","stripConnectionFromException","log","JSON","stringify","exports"],"sources":["ElasticsearchCatHealth.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport type { Client } from \"~/client\";\nimport type { IElasticsearchCatHealthResponse } from \"./types\";\nimport { stripConnectionFromException } from \"~/operations/stripConnectionFromException\";\n\nexport class ElasticsearchCatHealth {\n private readonly client: Client;\n\n public constructor(client: Client) {\n this.client = client;\n }\n\n public async getHealth(): Promise<IElasticsearchCatHealthResponse> {\n try {\n const response = await this.client.cat.health<\n unknown | [IElasticsearchCatHealthResponse]\n >({\n format: \"json\"\n });\n\n if (!Array.isArray(response.body) || response.body.length === 0) {\n throw new WebinyError({\n message: `There is no valid response from cat.health operation.`,\n code: \"ELASTICSEARCH_HEALTH_INVALID_RESPONSE\",\n data: response.body\n });\n }\n\n return {\n ...response.body[0]\n };\n } catch (ex) {\n console.error(`Could not fetch cluster health information: ${ex.message}`);\n const error = stripConnectionFromException(ex);\n console.log(JSON.stringify(error));\n throw error;\n }\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAGA,IAAAC,6BAAA,GAAAD,OAAA;AAEO,MAAME,sBAAsB,CAAC;EAGzBC,WAAWA,CAACC,MAAc,EAAE;IAC/B,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAaC,SAASA,CAAA,EAA6C;IAC/D,IAAI;MACA,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACF,MAAM,CAACG,GAAG,CAACC,MAAM,CAE3C;QACEC,MAAM,EAAE;MACZ,CAAC,CAAC;MAEF,IAAI,CAACC,KAAK,CAACC,OAAO,CAACL,QAAQ,CAACM,IAAI,CAAC,IAAIN,QAAQ,CAACM,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;QAC7D,MAAM,IAAIC,kBAAW,CAAC;UAClBC,OAAO,EAAE,uDAAuD;UAChEC,IAAI,EAAE,uCAAuC;UAC7CC,IAAI,EAAEX,QAAQ,CAACM;QACnB,CAAC,CAAC;MACN;MAEA,OAAO;QACH,GAAGN,QAAQ,CAACM,IAAI,CAAC,CAAC;MACtB,CAAC;IACL,CAAC,CAAC,OAAOM,EAAE,EAAE;MACTC,OAAO,CAACC,KAAK,CAAC,+CAA+CF,EAAE,CAACH,OAAO,EAAE,CAAC;MAC1E,MAAMK,KAAK,GAAG,IAAAC,0DAA4B,EAACH,EAAE,CAAC;MAC9CC,OAAO,CAACG,GAAG,CAACC,IAAI,CAACC,SAAS,CAACJ,KAAK,CAAC,CAAC;MAClC,MAAMA,KAAK;IACf;EACJ;AACJ;AAACK,OAAA,CAAAvB,sBAAA,GAAAA,sBAAA","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","stripConnectionFromException","ElasticsearchCatHealth","constructor","client","getHealth","response","cat","health","format","Array","isArray","body","length","message","code","data","ex","console","error","log","JSON","stringify"],"sources":["ElasticsearchCatHealth.ts"],"sourcesContent":["import { WebinyError } from \"@webiny/error\";\nimport type { Client } from \"~/client.js\";\nimport type { IElasticsearchCatHealthResponse } from \"./types.js\";\nimport { stripConnectionFromException } from \"~/operations/stripConnectionFromException.js\";\n\nexport class ElasticsearchCatHealth {\n private readonly client: Client;\n\n public constructor(client: Client) {\n this.client = client;\n }\n\n public async getHealth(): Promise<IElasticsearchCatHealthResponse> {\n try {\n const response = await this.client.cat.health<\n unknown | [IElasticsearchCatHealthResponse]\n >({\n format: \"json\"\n });\n\n if (!Array.isArray(response.body) || response.body.length === 0) {\n throw new WebinyError({\n message: `There is no valid response from cat.health operation.`,\n code: \"OPENSEARCH_HEALTH_INVALID_RESPONSE\",\n data: response.body\n });\n }\n\n return {\n ...response.body[0]\n };\n } catch (ex) {\n console.error(`Could not fetch cluster health information: ${ex.message}`);\n const error = stripConnectionFromException(ex);\n console.log(JSON.stringify(error));\n throw error;\n }\n }\n}\n"],"mappings":"AAAA,SAASA,WAAW,QAAQ,eAAe;AAG3C,SAASC,4BAA4B;AAErC,OAAO,MAAMC,sBAAsB,CAAC;EAGzBC,WAAWA,CAACC,MAAc,EAAE;IAC/B,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAaC,SAASA,CAAA,EAA6C;IAC/D,IAAI;MACA,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACF,MAAM,CAACG,GAAG,CAACC,MAAM,CAE3C;QACEC,MAAM,EAAE;MACZ,CAAC,CAAC;MAEF,IAAI,CAACC,KAAK,CAACC,OAAO,CAACL,QAAQ,CAACM,IAAI,CAAC,IAAIN,QAAQ,CAACM,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;QAC7D,MAAM,IAAIb,WAAW,CAAC;UAClBc,OAAO,EAAE,uDAAuD;UAChEC,IAAI,EAAE,oCAAoC;UAC1CC,IAAI,EAAEV,QAAQ,CAACM;QACnB,CAAC,CAAC;MACN;MAEA,OAAO;QACH,GAAGN,QAAQ,CAACM,IAAI,CAAC,CAAC;MACtB,CAAC;IACL,CAAC,CAAC,OAAOK,EAAE,EAAE;MACTC,OAAO,CAACC,KAAK,CAAC,+CAA+CF,EAAE,CAACH,OAAO,EAAE,CAAC;MAC1E,MAAMK,KAAK,GAAGlB,4BAA4B,CAACgB,EAAE,CAAC;MAC9CC,OAAO,CAACE,GAAG,CAACC,IAAI,CAACC,SAAS,CAACH,KAAK,CAAC,CAAC;MAClC,MAAMA,KAAK;IACf;EACJ;AACJ","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import type { IElasticsearchCatNodesResponse } from "./types";
2
- import type { Client } from "../client";
1
+ import type { IElasticsearchCatNodesResponse } from "./types.js";
2
+ import type { Client } from "../client.js";
3
3
  export declare class ElasticsearchCatNodes {
4
4
  private readonly client;
5
5
  constructor(client: Client);
@@ -1,12 +1,6 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ElasticsearchCatNodes = void 0;
7
- var _error = require("@webiny/error");
8
- var _stripConnectionFromException = require("./stripConnectionFromException");
9
- class ElasticsearchCatNodes {
1
+ import { WebinyError } from "@webiny/error";
2
+ import { stripConnectionFromException } from "./stripConnectionFromException.js";
3
+ export class ElasticsearchCatNodes {
10
4
  constructor(client) {
11
5
  this.client = client;
12
6
  }
@@ -16,21 +10,20 @@ class ElasticsearchCatNodes {
16
10
  format: "json"
17
11
  });
18
12
  if (!Array.isArray(response.body) || response.body.length === 0) {
19
- throw new _error.WebinyError({
13
+ throw new WebinyError({
20
14
  message: `There is no valid response from cat.nodes operation.`,
21
- code: "ELASTICSEARCH_NODES_INVALID_RESPONSE",
15
+ code: "OPENSEARCH_NODES_INVALID_RESPONSE",
22
16
  data: response.body
23
17
  });
24
18
  }
25
19
  return response.body;
26
20
  } catch (ex) {
27
21
  console.error(`Could not fetch cluster nodes information: ${ex.message}`);
28
- const error = (0, _stripConnectionFromException.stripConnectionFromException)(ex);
22
+ const error = stripConnectionFromException(ex);
29
23
  console.log(JSON.stringify(error));
30
24
  throw error;
31
25
  }
32
26
  }
33
27
  }
34
- exports.ElasticsearchCatNodes = ElasticsearchCatNodes;
35
28
 
36
29
  //# sourceMappingURL=ElasticsearchCatNodes.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_error","require","_stripConnectionFromException","ElasticsearchCatNodes","constructor","client","getNodes","response","cat","nodes","format","Array","isArray","body","length","WebinyError","message","code","data","ex","console","error","stripConnectionFromException","log","JSON","stringify","exports"],"sources":["ElasticsearchCatNodes.ts"],"sourcesContent":["import type { IElasticsearchCatNodesResponse } from \"./types\";\nimport type { Client } from \"~/client\";\nimport { WebinyError } from \"@webiny/error\";\nimport { stripConnectionFromException } from \"~/operations/stripConnectionFromException\";\n\nexport class ElasticsearchCatNodes {\n private readonly client: Client;\n\n public constructor(client: Client) {\n this.client = client;\n }\n\n public async getNodes(): Promise<IElasticsearchCatNodesResponse> {\n try {\n const response = await this.client.cat.nodes<IElasticsearchCatNodesResponse>({\n format: \"json\"\n });\n if (!Array.isArray(response.body) || response.body.length === 0) {\n throw new WebinyError({\n message: `There is no valid response from cat.nodes operation.`,\n code: \"ELASTICSEARCH_NODES_INVALID_RESPONSE\",\n data: response.body\n });\n }\n return response.body;\n } catch (ex) {\n console.error(`Could not fetch cluster nodes information: ${ex.message}`);\n const error = stripConnectionFromException(ex);\n console.log(JSON.stringify(error));\n throw error;\n }\n }\n}\n"],"mappings":";;;;;;AAEA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,6BAAA,GAAAD,OAAA;AAEO,MAAME,qBAAqB,CAAC;EAGxBC,WAAWA,CAACC,MAAc,EAAE;IAC/B,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAaC,QAAQA,CAAA,EAA4C;IAC7D,IAAI;MACA,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACF,MAAM,CAACG,GAAG,CAACC,KAAK,CAAiC;QACzEC,MAAM,EAAE;MACZ,CAAC,CAAC;MACF,IAAI,CAACC,KAAK,CAACC,OAAO,CAACL,QAAQ,CAACM,IAAI,CAAC,IAAIN,QAAQ,CAACM,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;QAC7D,MAAM,IAAIC,kBAAW,CAAC;UAClBC,OAAO,EAAE,sDAAsD;UAC/DC,IAAI,EAAE,sCAAsC;UAC5CC,IAAI,EAAEX,QAAQ,CAACM;QACnB,CAAC,CAAC;MACN;MACA,OAAON,QAAQ,CAACM,IAAI;IACxB,CAAC,CAAC,OAAOM,EAAE,EAAE;MACTC,OAAO,CAACC,KAAK,CAAC,8CAA8CF,EAAE,CAACH,OAAO,EAAE,CAAC;MACzE,MAAMK,KAAK,GAAG,IAAAC,0DAA4B,EAACH,EAAE,CAAC;MAC9CC,OAAO,CAACG,GAAG,CAACC,IAAI,CAACC,SAAS,CAACJ,KAAK,CAAC,CAAC;MAClC,MAAMA,KAAK;IACf;EACJ;AACJ;AAACK,OAAA,CAAAvB,qBAAA,GAAAA,qBAAA","ignoreList":[]}
1
+ {"version":3,"names":["WebinyError","stripConnectionFromException","ElasticsearchCatNodes","constructor","client","getNodes","response","cat","nodes","format","Array","isArray","body","length","message","code","data","ex","console","error","log","JSON","stringify"],"sources":["ElasticsearchCatNodes.ts"],"sourcesContent":["import type { IElasticsearchCatNodesResponse } from \"./types.js\";\nimport type { Client } from \"~/client.js\";\nimport { WebinyError } from \"@webiny/error\";\nimport { stripConnectionFromException } from \"~/operations/stripConnectionFromException.js\";\n\nexport class ElasticsearchCatNodes {\n private readonly client: Client;\n\n public constructor(client: Client) {\n this.client = client;\n }\n\n public async getNodes(): Promise<IElasticsearchCatNodesResponse> {\n try {\n const response = await this.client.cat.nodes<IElasticsearchCatNodesResponse>({\n format: \"json\"\n });\n if (!Array.isArray(response.body) || response.body.length === 0) {\n throw new WebinyError({\n message: `There is no valid response from cat.nodes operation.`,\n code: \"OPENSEARCH_NODES_INVALID_RESPONSE\",\n data: response.body\n });\n }\n return response.body;\n } catch (ex) {\n console.error(`Could not fetch cluster nodes information: ${ex.message}`);\n const error = stripConnectionFromException(ex);\n console.log(JSON.stringify(error));\n throw error;\n }\n }\n}\n"],"mappings":"AAEA,SAASA,WAAW,QAAQ,eAAe;AAC3C,SAASC,4BAA4B;AAErC,OAAO,MAAMC,qBAAqB,CAAC;EAGxBC,WAAWA,CAACC,MAAc,EAAE;IAC/B,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEA,MAAaC,QAAQA,CAAA,EAA4C;IAC7D,IAAI;MACA,MAAMC,QAAQ,GAAG,MAAM,IAAI,CAACF,MAAM,CAACG,GAAG,CAACC,KAAK,CAAiC;QACzEC,MAAM,EAAE;MACZ,CAAC,CAAC;MACF,IAAI,CAACC,KAAK,CAACC,OAAO,CAACL,QAAQ,CAACM,IAAI,CAAC,IAAIN,QAAQ,CAACM,IAAI,CAACC,MAAM,KAAK,CAAC,EAAE;QAC7D,MAAM,IAAIb,WAAW,CAAC;UAClBc,OAAO,EAAE,sDAAsD;UAC/DC,IAAI,EAAE,mCAAmC;UACzCC,IAAI,EAAEV,QAAQ,CAACM;QACnB,CAAC,CAAC;MACN;MACA,OAAON,QAAQ,CAACM,IAAI;IACxB,CAAC,CAAC,OAAOK,EAAE,EAAE;MACTC,OAAO,CAACC,KAAK,CAAC,8CAA8CF,EAAE,CAACH,OAAO,EAAE,CAAC;MACzE,MAAMK,KAAK,GAAGlB,4BAA4B,CAACgB,EAAE,CAAC;MAC9CC,OAAO,CAACE,GAAG,CAACC,IAAI,CAACC,SAAS,CAACH,KAAK,CAAC,CAAC;MAClC,MAAMA,KAAK;IACf;EACJ;AACJ","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- export * from "./ElasticsearchCatHealth";
2
- export * from "./ElasticsearchCatNodes";
3
- export * from "./types";
1
+ export * from "./ElasticsearchCatHealth.js";
2
+ export * from "./ElasticsearchCatNodes.js";
3
+ export * from "./types.js";
@@ -1,40 +1,5 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _ElasticsearchCatHealth = require("./ElasticsearchCatHealth");
7
- Object.keys(_ElasticsearchCatHealth).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _ElasticsearchCatHealth[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function () {
13
- return _ElasticsearchCatHealth[key];
14
- }
15
- });
16
- });
17
- var _ElasticsearchCatNodes = require("./ElasticsearchCatNodes");
18
- Object.keys(_ElasticsearchCatNodes).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _ElasticsearchCatNodes[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function () {
24
- return _ElasticsearchCatNodes[key];
25
- }
26
- });
27
- });
28
- var _types = require("./types");
29
- Object.keys(_types).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _types[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function () {
35
- return _types[key];
36
- }
37
- });
38
- });
1
+ export * from "./ElasticsearchCatHealth.js";
2
+ export * from "./ElasticsearchCatNodes.js";
3
+ export * from "./types.js";
39
4
 
40
5
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_ElasticsearchCatHealth","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_ElasticsearchCatNodes","_types"],"sources":["index.ts"],"sourcesContent":["export * from \"./ElasticsearchCatHealth\";\nexport * from \"./ElasticsearchCatNodes\";\nexport * from \"./types\";\n"],"mappings":";;;;;AAAA,IAAAA,uBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,uBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,uBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,uBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,sBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,sBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,sBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,sBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,MAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,MAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,MAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,MAAA,CAAAN,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./ElasticsearchCatHealth.js\";\nexport * from \"./ElasticsearchCatNodes.js\";\nexport * from \"./types.js\";\n"],"mappings":"AAAA;AACA;AACA","ignoreList":[]}
@@ -1,10 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.stripConnectionFromException = void 0;
7
- const stripConnectionFromException = ex => {
1
+ export const stripConnectionFromException = ex => {
8
2
  if (typeof ex !== "object") {
9
3
  return ex;
10
4
  }
@@ -19,6 +13,5 @@ const stripConnectionFromException = ex => {
19
13
  }
20
14
  };
21
15
  };
22
- exports.stripConnectionFromException = stripConnectionFromException;
23
16
 
24
17
  //# sourceMappingURL=stripConnectionFromException.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["stripConnectionFromException","ex","meta","connection","exports"],"sources":["stripConnectionFromException.ts"],"sourcesContent":["export const stripConnectionFromException = (ex: any): any => {\n if (typeof ex !== \"object\") {\n return ex;\n }\n if (!ex?.meta?.meta?.connection) {\n return ex;\n }\n return {\n ...ex.meta,\n meta: {\n ...ex.meta.meta,\n connection: null\n }\n };\n};\n"],"mappings":";;;;;;AAAO,MAAMA,4BAA4B,GAAIC,EAAO,IAAU;EAC1D,IAAI,OAAOA,EAAE,KAAK,QAAQ,EAAE;IACxB,OAAOA,EAAE;EACb;EACA,IAAI,CAACA,EAAE,EAAEC,IAAI,EAAEA,IAAI,EAAEC,UAAU,EAAE;IAC7B,OAAOF,EAAE;EACb;EACA,OAAO;IACH,GAAGA,EAAE,CAACC,IAAI;IACVA,IAAI,EAAE;MACF,GAAGD,EAAE,CAACC,IAAI,CAACA,IAAI;MACfC,UAAU,EAAE;IAChB;EACJ,CAAC;AACL,CAAC;AAACC,OAAA,CAAAJ,4BAAA,GAAAA,4BAAA","ignoreList":[]}
1
+ {"version":3,"names":["stripConnectionFromException","ex","meta","connection"],"sources":["stripConnectionFromException.ts"],"sourcesContent":["export const stripConnectionFromException = (ex: any): any => {\n if (typeof ex !== \"object\") {\n return ex;\n }\n if (!ex?.meta?.meta?.connection) {\n return ex;\n }\n return {\n ...ex.meta,\n meta: {\n ...ex.meta.meta,\n connection: null\n }\n };\n};\n"],"mappings":"AAAA,OAAO,MAAMA,4BAA4B,GAAIC,EAAO,IAAU;EAC1D,IAAI,OAAOA,EAAE,KAAK,QAAQ,EAAE;IACxB,OAAOA,EAAE;EACb;EACA,IAAI,CAACA,EAAE,EAAEC,IAAI,EAAEA,IAAI,EAAEC,UAAU,EAAE;IAC7B,OAAOF,EAAE;EACb;EACA,OAAO;IACH,GAAGA,EAAE,CAACC,IAAI;IACVA,IAAI,EAAE;MACF,GAAGD,EAAE,CAACC,IAAI,CAACA,IAAI;MACfC,UAAU,EAAE;IAChB;EACJ,CAAC;AACL,CAAC","ignoreList":[]}
@@ -1,10 +1,4 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.ElasticsearchCatClusterHealthStatus = void 0;
7
- let ElasticsearchCatClusterHealthStatus = exports.ElasticsearchCatClusterHealthStatus = /*#__PURE__*/function (ElasticsearchCatClusterHealthStatus) {
1
+ export let ElasticsearchCatClusterHealthStatus = /*#__PURE__*/function (ElasticsearchCatClusterHealthStatus) {
8
2
  ElasticsearchCatClusterHealthStatus["Green"] = "green";
9
3
  ElasticsearchCatClusterHealthStatus["Yellow"] = "yellow";
10
4
  ElasticsearchCatClusterHealthStatus["Red"] = "red";