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

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 (177) hide show
  1. package/client.d.ts +1 -0
  2. package/client.js +78 -43
  3. package/client.js.map +1 -1
  4. package/compression.d.ts +1 -1
  5. package/compression.js +13 -49
  6. package/compression.js.map +1 -1
  7. package/cursors.d.ts +2 -2
  8. package/cursors.js +6 -16
  9. package/cursors.js.map +1 -1
  10. package/index.d.ts +6 -3
  11. package/index.js +51 -42
  12. package/index.js.map +1 -1
  13. package/indexConfiguration/base.d.ts +1 -1
  14. package/indexConfiguration/base.js +2 -5
  15. package/indexConfiguration/base.js.map +1 -1
  16. package/indexConfiguration/common.d.ts +1 -1
  17. package/indexConfiguration/common.js +13 -4
  18. package/indexConfiguration/common.js.map +1 -1
  19. package/indexConfiguration/index.js +3 -7
  20. package/indexConfiguration/index.js.map +1 -1
  21. package/indexConfiguration/japanese.d.ts +1 -1
  22. package/indexConfiguration/japanese.js +2 -5
  23. package/indexConfiguration/japanese.js.map +1 -1
  24. package/indexPrefix.d.ts +1 -0
  25. package/indexPrefix.js +12 -0
  26. package/indexPrefix.js.map +1 -0
  27. package/indices.d.ts +2 -2
  28. package/indices.js +2 -7
  29. package/indices.js.map +1 -1
  30. package/limit.js +2 -8
  31. package/limit.js.map +1 -1
  32. package/normalize.d.ts +1 -0
  33. package/normalize.js +41 -9
  34. package/normalize.js.map +1 -1
  35. package/operations/ElasticsearchCatHealth.d.ts +7 -0
  36. package/operations/ElasticsearchCatHealth.js +38 -0
  37. package/operations/ElasticsearchCatHealth.js.map +1 -0
  38. package/operations/ElasticsearchCatNodes.d.ts +7 -0
  39. package/operations/ElasticsearchCatNodes.js +36 -0
  40. package/operations/ElasticsearchCatNodes.js.map +1 -0
  41. package/operations/index.d.ts +3 -0
  42. package/operations/index.js +40 -0
  43. package/operations/index.js.map +1 -0
  44. package/operations/stripConnectionFromException.d.ts +1 -0
  45. package/operations/stripConnectionFromException.js +24 -0
  46. package/operations/stripConnectionFromException.js.map +1 -0
  47. package/operations/types.d.ts +35 -0
  48. package/operations/types.js +14 -0
  49. package/operations/types.js.map +1 -0
  50. package/operators.d.ts +1 -1
  51. package/operators.js +2 -11
  52. package/operators.js.map +1 -1
  53. package/package.json +11 -24
  54. package/plugins/definition/ElasticsearchBodyModifierPlugin.d.ts +1 -1
  55. package/plugins/definition/ElasticsearchBodyModifierPlugin.js +2 -11
  56. package/plugins/definition/ElasticsearchBodyModifierPlugin.js.map +1 -1
  57. package/plugins/definition/ElasticsearchFieldPlugin.d.ts +3 -3
  58. package/plugins/definition/ElasticsearchFieldPlugin.js +7 -36
  59. package/plugins/definition/ElasticsearchFieldPlugin.js.map +1 -1
  60. package/plugins/definition/ElasticsearchIndexPlugin.d.ts +1 -1
  61. package/plugins/definition/ElasticsearchIndexPlugin.js +5 -15
  62. package/plugins/definition/ElasticsearchIndexPlugin.js.map +1 -1
  63. package/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin.d.ts +1 -1
  64. package/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin.js +4 -9
  65. package/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin.js.map +1 -1
  66. package/plugins/definition/ElasticsearchQueryModifierPlugin.d.ts +1 -1
  67. package/plugins/definition/ElasticsearchQueryModifierPlugin.js +2 -11
  68. package/plugins/definition/ElasticsearchQueryModifierPlugin.js.map +1 -1
  69. package/plugins/definition/ElasticsearchSortModifierPlugin.d.ts +1 -1
  70. package/plugins/definition/ElasticsearchSortModifierPlugin.js +2 -11
  71. package/plugins/definition/ElasticsearchSortModifierPlugin.js.map +1 -1
  72. package/plugins/definition/index.d.ts +0 -1
  73. package/plugins/definition/index.js +3 -26
  74. package/plugins/definition/index.js.map +1 -1
  75. package/plugins/index.js +3 -5
  76. package/plugins/index.js.map +1 -1
  77. package/plugins/operator/andIn.d.ts +1 -1
  78. package/plugins/operator/andIn.js +5 -19
  79. package/plugins/operator/andIn.js.map +1 -1
  80. package/plugins/operator/between.d.ts +1 -1
  81. package/plugins/operator/between.js +5 -18
  82. package/plugins/operator/between.js.map +1 -1
  83. package/plugins/operator/contains.d.ts +1 -1
  84. package/plugins/operator/contains.js +4 -16
  85. package/plugins/operator/contains.js.map +1 -1
  86. package/plugins/operator/equal.d.ts +1 -1
  87. package/plugins/operator/equal.js +4 -21
  88. package/plugins/operator/equal.js.map +1 -1
  89. package/plugins/operator/gt.d.ts +1 -1
  90. package/plugins/operator/gt.js +3 -14
  91. package/plugins/operator/gt.js.map +1 -1
  92. package/plugins/operator/gte.d.ts +1 -1
  93. package/plugins/operator/gte.js +3 -14
  94. package/plugins/operator/gte.js.map +1 -1
  95. package/plugins/operator/in.d.ts +1 -1
  96. package/plugins/operator/in.js +5 -17
  97. package/plugins/operator/in.js.map +1 -1
  98. package/plugins/operator/index.js +3 -33
  99. package/plugins/operator/index.js.map +1 -1
  100. package/plugins/operator/japanese/contains.d.ts +1 -1
  101. package/plugins/operator/japanese/contains.js +6 -20
  102. package/plugins/operator/japanese/contains.js.map +1 -1
  103. package/plugins/operator/lt.d.ts +1 -1
  104. package/plugins/operator/lt.js +3 -14
  105. package/plugins/operator/lt.js.map +1 -1
  106. package/plugins/operator/lte.d.ts +1 -1
  107. package/plugins/operator/lte.js +3 -14
  108. package/plugins/operator/lte.js.map +1 -1
  109. package/plugins/operator/not.d.ts +1 -1
  110. package/plugins/operator/not.js +10 -21
  111. package/plugins/operator/not.js.map +1 -1
  112. package/plugins/operator/notBetween.d.ts +1 -1
  113. package/plugins/operator/notBetween.js +5 -18
  114. package/plugins/operator/notBetween.js.map +1 -1
  115. package/plugins/operator/notContains.d.ts +1 -1
  116. package/plugins/operator/notContains.js +4 -16
  117. package/plugins/operator/notContains.js.map +1 -1
  118. package/plugins/operator/notIn.d.ts +1 -1
  119. package/plugins/operator/notIn.js +3 -16
  120. package/plugins/operator/notIn.js.map +1 -1
  121. package/plugins/operator/notStartsWith.d.ts +1 -1
  122. package/plugins/operator/notStartsWith.js +6 -14
  123. package/plugins/operator/notStartsWith.js.map +1 -1
  124. package/plugins/operator/startsWith.d.ts +1 -1
  125. package/plugins/operator/startsWith.js +6 -14
  126. package/plugins/operator/startsWith.js.map +1 -1
  127. package/sharedIndex.d.ts +1 -0
  128. package/sharedIndex.js +12 -0
  129. package/sharedIndex.js.map +1 -0
  130. package/sort.d.ts +1 -1
  131. package/sort.js +12 -17
  132. package/sort.js.map +1 -1
  133. package/types.d.ts +32 -19
  134. package/types.js +3 -4
  135. package/types.js.map +1 -1
  136. package/utils/createIndex.d.ts +20 -0
  137. package/utils/createIndex.js +100 -0
  138. package/utils/createIndex.js.map +1 -0
  139. package/utils/index.d.ts +3 -0
  140. package/utils/index.js +29 -0
  141. package/utils/index.js.map +1 -0
  142. package/utils/waitUntilHealthy/UnhealthyClusterError.d.ts +4 -0
  143. package/utils/waitUntilHealthy/UnhealthyClusterError.js +18 -0
  144. package/utils/waitUntilHealthy/UnhealthyClusterError.js.map +1 -0
  145. package/utils/waitUntilHealthy/WaitUntilHealthy.d.ts +71 -0
  146. package/utils/waitUntilHealthy/WaitUntilHealthy.js +157 -0
  147. package/utils/waitUntilHealthy/WaitUntilHealthy.js.map +1 -0
  148. package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.d.ts +4 -0
  149. package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js +18 -0
  150. package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js.map +1 -0
  151. package/utils/waitUntilHealthy/index.d.ts +6 -0
  152. package/utils/waitUntilHealthy/index.js +51 -0
  153. package/utils/waitUntilHealthy/index.js.map +1 -0
  154. package/utils/waitUntilHealthy/reason/ClusterHealthReason.d.ts +15 -0
  155. package/utils/waitUntilHealthy/reason/ClusterHealthReason.js +21 -0
  156. package/utils/waitUntilHealthy/reason/ClusterHealthReason.js.map +1 -0
  157. package/utils/waitUntilHealthy/reason/IReason.d.ts +4 -0
  158. package/utils/waitUntilHealthy/reason/IReason.js +7 -0
  159. package/utils/waitUntilHealthy/reason/IReason.js.map +1 -0
  160. package/utils/waitUntilHealthy/reason/MemoryReason.d.ts +14 -0
  161. package/utils/waitUntilHealthy/reason/MemoryReason.js +21 -0
  162. package/utils/waitUntilHealthy/reason/MemoryReason.js.map +1 -0
  163. package/utils/waitUntilHealthy/reason/ProcessorReason.d.ts +14 -0
  164. package/utils/waitUntilHealthy/reason/ProcessorReason.js +21 -0
  165. package/utils/waitUntilHealthy/reason/ProcessorReason.js.map +1 -0
  166. package/utils/waitUntilHealthy/reason/index.d.ts +3 -0
  167. package/utils/waitUntilHealthy/reason/index.js +40 -0
  168. package/utils/waitUntilHealthy/reason/index.js.map +1 -0
  169. package/where.d.ts +3 -3
  170. package/where.js +8 -24
  171. package/where.js.map +1 -1
  172. package/plugins/GzipCompression.d.ts +0 -24
  173. package/plugins/GzipCompression.js +0 -86
  174. package/plugins/GzipCompression.js.map +0 -1
  175. package/plugins/definition/CompressionPlugin.d.ts +0 -20
  176. package/plugins/definition/CompressionPlugin.js +0 -17
  177. package/plugins/definition/CompressionPlugin.js.map +0 -1
package/client.d.ts CHANGED
@@ -2,4 +2,5 @@ import { Client, ClientOptions } from "@elastic/elasticsearch";
2
2
  export interface ElasticsearchClientOptions extends ClientOptions {
3
3
  endpoint?: string;
4
4
  }
5
+ export { Client, ClientOptions };
5
6
  export declare const createElasticsearchClient: (options: ElasticsearchClientOptions) => Client;
package/client.js CHANGED
@@ -1,55 +1,90 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
7
+ Object.defineProperty(exports, "Client", {
8
+ enumerable: true,
9
+ get: function () {
10
+ return _elasticsearch.Client;
11
+ }
12
+ });
13
+ Object.defineProperty(exports, "ClientOptions", {
14
+ enumerable: true,
15
+ get: function () {
16
+ return _elasticsearch.ClientOptions;
17
+ }
18
+ });
8
19
  exports.createElasticsearchClient = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
13
-
14
- var _elasticsearch = require("@elastic/elasticsearch");
15
-
16
- var _awsSdk = _interopRequireDefault(require("aws-sdk"));
17
-
18
- var _error = _interopRequireDefault(require("@webiny/error"));
19
-
20
20
  var _awsElasticsearchConnector = _interopRequireDefault(require("aws-elasticsearch-connector"));
21
-
22
- const _excluded = ["endpoint", "node"];
23
-
21
+ var _crypto = _interopRequireDefault(require("crypto"));
22
+ var _error = _interopRequireDefault(require("@webiny/error"));
23
+ var _elasticsearch = require("@elastic/elasticsearch");
24
+ const clients = new Map();
25
+ const createClientKey = options => {
26
+ const key = JSON.stringify(options);
27
+ const hash = _crypto.default.createHash("sha1");
28
+ hash.update(key);
29
+ return hash.digest("hex");
30
+ };
24
31
  const createElasticsearchClient = options => {
25
- const {
26
- endpoint,
27
- node
28
- } = options,
29
- rest = (0, _objectWithoutProperties2.default)(options, _excluded);
30
- const clientOptions = (0, _objectSpread2.default)({
31
- node: endpoint || node
32
- }, rest);
33
-
34
- if (!clientOptions.auth) {
35
- /**
36
- * If no `auth` configuration is present, we setup AWS connector.
37
- */
38
- Object.assign(clientOptions, (0, _awsElasticsearchConnector.default)(_awsSdk.default.config));
39
- }
40
-
41
- try {
42
- return new _elasticsearch.Client(clientOptions);
43
- } catch (ex) {
44
- const data = (0, _objectSpread2.default)((0, _objectSpread2.default)({
45
- error: ex,
46
- node: endpoint || node
47
- }, rest), {}, {
48
- auth: undefined
49
- });
50
- console.log((0, _objectSpread2.default)({}, data));
51
- throw new _error.default("Could not connect to Elasticsearch.", "ELASTICSEARCH_CLIENT_ERROR", data);
32
+ const key = createClientKey(options);
33
+ const existing = clients.get(key);
34
+ if (existing) {
35
+ return existing;
52
36
  }
37
+ const cached = () => {
38
+ const {
39
+ endpoint,
40
+ node,
41
+ ...rest
42
+ } = options;
43
+ let clientOptions = {
44
+ node: endpoint || node,
45
+ ...rest
46
+ };
47
+ if (!clientOptions.auth) {
48
+ const region = String(process.env.AWS_REGION);
49
+ const credentials = {
50
+ accessKeyId: process.env.AWS_ACCESS_KEY_ID,
51
+ secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
52
+ sessionToken: process.env.AWS_SESSION_TOKEN
53
+ };
54
+ const errors = Object.keys(credentials).filter(key => {
55
+ const value = credentials[key];
56
+ return !value;
57
+ });
58
+ if (errors.length > 0) {
59
+ throw new _error.default(`Missing keys values: ${errors.join(", ")}`, "MISSING_AWS_CREDENTIALS");
60
+ }
61
+ clientOptions = {
62
+ ...clientOptions,
63
+ ...(0, _awsElasticsearchConnector.default)({
64
+ region,
65
+ credentials
66
+ })
67
+ };
68
+ }
69
+ try {
70
+ return new _elasticsearch.Client(clientOptions);
71
+ } catch (ex) {
72
+ const data = {
73
+ error: ex,
74
+ node: endpoint || node,
75
+ ...rest,
76
+ auth: undefined
77
+ };
78
+ console.error({
79
+ ...data
80
+ });
81
+ throw new _error.default("Could not connect to Elasticsearch.", "ELASTICSEARCH_CLIENT_ERROR", data);
82
+ }
83
+ };
84
+ const client = cached();
85
+ clients.set(key, client);
86
+ return client;
53
87
  };
88
+ exports.createElasticsearchClient = createElasticsearchClient;
54
89
 
55
- exports.createElasticsearchClient = createElasticsearchClient;
90
+ //# sourceMappingURL=client.js.map
package/client.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["createElasticsearchClient","options","endpoint","node","rest","clientOptions","auth","Object","assign","createAwsElasticsearchConnector","AWS","config","Client","ex","data","error","undefined","console","log","WebinyError"],"sources":["client.ts"],"sourcesContent":["import { Client, ClientOptions } from \"@elastic/elasticsearch\";\nimport AWS from \"aws-sdk\";\nimport WebinyError from \"@webiny/error\";\n/**\n * Package aws-elasticsearch-connector does not have types.\n */\n// @ts-ignore\nimport createAwsElasticsearchConnector from \"aws-elasticsearch-connector\";\n\nexport interface ElasticsearchClientOptions extends ClientOptions {\n endpoint?: string;\n}\n\nexport const createElasticsearchClient = (options: ElasticsearchClientOptions) => {\n const { endpoint, node, ...rest } = options;\n\n const clientOptions: ClientOptions = {\n node: endpoint || node,\n ...rest\n };\n\n if (!clientOptions.auth) {\n /**\n * If no `auth` configuration is present, we setup AWS connector.\n */\n Object.assign(clientOptions, createAwsElasticsearchConnector(AWS.config));\n }\n\n try {\n return new Client(clientOptions);\n } catch (ex) {\n const data = {\n error: ex,\n node: endpoint || node,\n ...rest,\n auth: undefined\n };\n console.log({\n ...data\n });\n throw new WebinyError(\n \"Could not connect to Elasticsearch.\",\n \"ELASTICSEARCH_CLIENT_ERROR\",\n data\n );\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAAA;;AACA;;AACA;;AAKA;;;;AAMO,MAAMA,yBAAyB,GAAIC,OAAD,IAAyC;EAC9E,MAAM;IAAEC,QAAF;IAAYC;EAAZ,IAA8BF,OAApC;EAAA,MAA2BG,IAA3B,0CAAoCH,OAApC;EAEA,MAAMI,aAA4B;IAC9BF,IAAI,EAAED,QAAQ,IAAIC;EADY,GAE3BC,IAF2B,CAAlC;;EAKA,IAAI,CAACC,aAAa,CAACC,IAAnB,EAAyB;IACrB;AACR;AACA;IACQC,MAAM,CAACC,MAAP,CAAcH,aAAd,EAA6B,IAAAI,kCAAA,EAAgCC,eAAA,CAAIC,MAApC,CAA7B;EACH;;EAED,IAAI;IACA,OAAO,IAAIC,qBAAJ,CAAWP,aAAX,CAAP;EACH,CAFD,CAEE,OAAOQ,EAAP,EAAW;IACT,MAAMC,IAAI;MACNC,KAAK,EAAEF,EADD;MAENV,IAAI,EAAED,QAAQ,IAAIC;IAFZ,GAGHC,IAHG;MAINE,IAAI,EAAEU;IAJA,EAAV;IAMAC,OAAO,CAACC,GAAR,iCACOJ,IADP;IAGA,MAAM,IAAIK,cAAJ,CACF,qCADE,EAEF,4BAFE,EAGFL,IAHE,CAAN;EAKH;AACJ,CAjCM"}
1
+ {"version":3,"names":["_awsElasticsearchConnector","_interopRequireDefault","require","_crypto","_error","_elasticsearch","clients","Map","createClientKey","options","key","JSON","stringify","hash","crypto","createHash","update","digest","createElasticsearchClient","existing","get","cached","endpoint","node","rest","clientOptions","auth","region","String","process","env","AWS_REGION","credentials","accessKeyId","AWS_ACCESS_KEY_ID","secretAccessKey","AWS_SECRET_ACCESS_KEY","sessionToken","AWS_SESSION_TOKEN","errors","Object","keys","filter","value","length","WebinyError","join","createAwsElasticsearchConnector","Client","ex","data","error","undefined","console","client","set","exports"],"sources":["client.ts"],"sourcesContent":["import createAwsElasticsearchConnector from \"aws-elasticsearch-connector\";\nimport crypto from \"crypto\";\nimport WebinyError from \"@webiny/error\";\nimport { Client, ClientOptions } from \"@elastic/elasticsearch\";\n\nexport interface ElasticsearchClientOptions extends ClientOptions {\n endpoint?: string;\n}\n\nconst clients = new Map<string, Client>();\n\nconst createClientKey = (options: ElasticsearchClientOptions) => {\n const key = JSON.stringify(options);\n const hash = crypto.createHash(\"sha1\");\n hash.update(key);\n return hash.digest(\"hex\");\n};\n\nexport { Client, ClientOptions };\n\nexport const createElasticsearchClient = (options: ElasticsearchClientOptions): Client => {\n const key = createClientKey(options);\n const existing = clients.get(key);\n if (existing) {\n return existing;\n }\n\n const cached = (): Client => {\n const { endpoint, node, ...rest } = options;\n\n let clientOptions: ClientOptions = {\n node: endpoint || node,\n ...rest\n };\n\n if (!clientOptions.auth) {\n const region = String(process.env.AWS_REGION);\n\n const credentials = {\n accessKeyId: process.env.AWS_ACCESS_KEY_ID,\n secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,\n sessionToken: process.env.AWS_SESSION_TOKEN\n };\n\n const errors = Object.keys(credentials).filter(key => {\n const value = credentials[key as keyof typeof credentials];\n return !value;\n });\n if (errors.length > 0) {\n throw new WebinyError(\n `Missing keys values: ${errors.join(\", \")}`,\n \"MISSING_AWS_CREDENTIALS\"\n );\n }\n\n clientOptions = {\n ...clientOptions,\n ...createAwsElasticsearchConnector({\n region,\n credentials\n })\n };\n }\n\n try {\n return new Client(clientOptions);\n } catch (ex) {\n const data = {\n error: ex,\n node: endpoint || node,\n ...rest,\n auth: undefined\n };\n console.error({\n ...data\n });\n throw new WebinyError(\n \"Could not connect to Elasticsearch.\",\n \"ELASTICSEARCH_CLIENT_ERROR\",\n data\n );\n }\n };\n\n const client = cached();\n\n clients.set(key, client);\n return client;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAAA,0BAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,cAAA,GAAAH,OAAA;AAMA,MAAMI,OAAO,GAAG,IAAIC,GAAG,CAAiB,CAAC;AAEzC,MAAMC,eAAe,GAAIC,OAAmC,IAAK;EAC7D,MAAMC,GAAG,GAAGC,IAAI,CAACC,SAAS,CAACH,OAAO,CAAC;EACnC,MAAMI,IAAI,GAAGC,eAAM,CAACC,UAAU,CAAC,MAAM,CAAC;EACtCF,IAAI,CAACG,MAAM,CAACN,GAAG,CAAC;EAChB,OAAOG,IAAI,CAACI,MAAM,CAAC,KAAK,CAAC;AAC7B,CAAC;AAIM,MAAMC,yBAAyB,GAAIT,OAAmC,IAAa;EACtF,MAAMC,GAAG,GAAGF,eAAe,CAACC,OAAO,CAAC;EACpC,MAAMU,QAAQ,GAAGb,OAAO,CAACc,GAAG,CAACV,GAAG,CAAC;EACjC,IAAIS,QAAQ,EAAE;IACV,OAAOA,QAAQ;EACnB;EAEA,MAAME,MAAM,GAAGA,CAAA,KAAc;IACzB,MAAM;MAAEC,QAAQ;MAAEC,IAAI;MAAE,GAAGC;IAAK,CAAC,GAAGf,OAAO;IAE3C,IAAIgB,aAA4B,GAAG;MAC/BF,IAAI,EAAED,QAAQ,IAAIC,IA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AAC;EAEvBf,OAAO,CAACiD,GAAG,CAAC7C,GAAG,EAAE4C,MAAM,CAAC;EACxB,OAAOA,MAAM;AACjB,CAAC;AAACE,OAAA,CAAAtC,yBAAA,GAAAA,yBAAA","ignoreList":[]}
package/compression.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { PluginsContainer } from "@webiny/plugins";
1
+ import type { PluginsContainer } from "@webiny/plugins";
2
2
  /**
3
3
  * Method to compress the elasticsearch data that is going to be stored into the DynamoDB table that is meant for elasticsearch.
4
4
  */
package/compression.js CHANGED
@@ -4,65 +4,29 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.decompress = exports.compress = void 0;
7
-
8
- var _CompressionPlugin = require("./plugins/definition/CompressionPlugin");
9
-
10
- /**
11
- * Get the compression plugins, in reverse order, because we want to use the last one added - first.
12
- */
13
- const getCompressionPlugins = plugins => {
14
- return plugins.byType(_CompressionPlugin.CompressionPlugin.type).reverse();
15
- };
7
+ var _api = require("@webiny/api");
16
8
  /**
17
9
  * Method to compress the elasticsearch data that is going to be stored into the DynamoDB table that is meant for elasticsearch.
18
10
  */
19
-
20
-
21
11
  const compress = async (pluginsContainer, data) => {
22
- const plugins = getCompressionPlugins(pluginsContainer);
23
-
24
- if (plugins.length === 0) {
25
- console.log("No compression plugins");
12
+ let plugin;
13
+ try {
14
+ plugin = pluginsContainer.oneByType(_api.CompressorPlugin.type);
15
+ } catch (ex) {
26
16
  return data;
27
17
  }
28
-
29
- for (const plugin of plugins) {
30
- if (plugin.canCompress(data) === false) {
31
- continue;
32
- }
33
-
34
- return await plugin.compress(data);
35
- }
36
- /**
37
- * Possibly no plugins that can compress, just return the data.
38
- */
39
-
40
-
41
- return data;
18
+ return plugin.getCompressor().compress(data);
42
19
  };
43
-
44
20
  exports.compress = compress;
45
-
46
21
  const decompress = async (pluginsContainer, data) => {
47
- const plugins = getCompressionPlugins(pluginsContainer);
48
-
49
- if (plugins.length === 0) {
22
+ let plugin;
23
+ try {
24
+ plugin = pluginsContainer.oneByType(_api.CompressorPlugin.type);
25
+ } catch (ex) {
50
26
  return data;
51
27
  }
52
-
53
- for (const plugin of plugins) {
54
- if (plugin.canDecompress(data) === false) {
55
- continue;
56
- }
57
-
58
- return await plugin.decompress(data);
59
- }
60
- /**
61
- * Possibly no plugins that can decompress, just return the data.
62
- */
63
-
64
-
65
- return data;
28
+ return plugin.getCompressor().decompress(data);
66
29
  };
30
+ exports.decompress = decompress;
67
31
 
68
- exports.decompress = decompress;
32
+ //# sourceMappingURL=compression.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["getCompressionPlugins","plugins","byType","CompressionPlugin","type","reverse","compress","pluginsContainer","data","length","console","log","plugin","canCompress","decompress","canDecompress"],"sources":["compression.ts"],"sourcesContent":["import { CompressionPlugin } from \"~/plugins/definition/CompressionPlugin\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\n/**\n * Get the compression plugins, in reverse order, because we want to use the last one added - first.\n */\nconst getCompressionPlugins = (plugins: PluginsContainer): CompressionPlugin[] => {\n return plugins.byType<CompressionPlugin>(CompressionPlugin.type).reverse();\n};\n/**\n * Method to compress the elasticsearch data that is going to be stored into the DynamoDB table that is meant for elasticsearch.\n */\nexport const compress = async (\n pluginsContainer: PluginsContainer,\n data: Record<string, any>\n): Promise<Record<string, any>> => {\n const plugins = getCompressionPlugins(pluginsContainer);\n if (plugins.length === 0) {\n console.log(\"No compression plugins\");\n return data;\n }\n for (const plugin of plugins) {\n if (plugin.canCompress(data) === false) {\n continue;\n }\n return await plugin.compress(data);\n }\n /**\n * Possibly no plugins that can compress, just return the data.\n */\n return data;\n};\n\nexport const decompress = async (\n pluginsContainer: PluginsContainer,\n data: Record<string, any>\n): Promise<Record<string, any>> => {\n const plugins = getCompressionPlugins(pluginsContainer);\n if (plugins.length === 0) {\n return data;\n }\n for (const plugin of plugins) {\n if (plugin.canDecompress(data) === false) {\n continue;\n }\n return await plugin.decompress(data);\n }\n /**\n * Possibly no plugins that can decompress, just return the data.\n */\n return data;\n};\n"],"mappings":";;;;;;;AAAA;;AAGA;AACA;AACA;AACA,MAAMA,qBAAqB,GAAIC,OAAD,IAAoD;EAC9E,OAAOA,OAAO,CAACC,MAAR,CAAkCC,oCAAA,CAAkBC,IAApD,EAA0DC,OAA1D,EAAP;AACH,CAFD;AAGA;AACA;AACA;;;AACO,MAAMC,QAAQ,GAAG,OACpBC,gBADoB,EAEpBC,IAFoB,KAGW;EAC/B,MAAMP,OAAO,GAAGD,qBAAqB,CAACO,gBAAD,CAArC;;EACA,IAAIN,OAAO,CAACQ,MAAR,KAAmB,CAAvB,EAA0B;IACtBC,OAAO,CAACC,GAAR,CAAY,wBAAZ;IACA,OAAOH,IAAP;EACH;;EACD,KAAK,MAAMI,MAAX,IAAqBX,OAArB,EAA8B;IAC1B,IAAIW,MAAM,CAACC,WAAP,CAAmBL,IAAnB,MAA6B,KAAjC,EAAwC;MACpC;IACH;;IACD,OAAO,MAAMI,MAAM,CAACN,QAAP,CAAgBE,IAAhB,CAAb;EACH;EACD;AACJ;AACA;;;EACI,OAAOA,IAAP;AACH,CAnBM;;;;AAqBA,MAAMM,UAAU,GAAG,OACtBP,gBADsB,EAEtBC,IAFsB,KAGS;EAC/B,MAAMP,OAAO,GAAGD,qBAAqB,CAACO,gBAAD,CAArC;;EACA,IAAIN,OAAO,CAACQ,MAAR,KAAmB,CAAvB,EAA0B;IACtB,OAAOD,IAAP;EACH;;EACD,KAAK,MAAMI,MAAX,IAAqBX,OAArB,EAA8B;IAC1B,IAAIW,MAAM,CAACG,aAAP,CAAqBP,IAArB,MAA+B,KAAnC,EAA0C;MACtC;IACH;;IACD,OAAO,MAAMI,MAAM,CAACE,UAAP,CAAkBN,IAAlB,CAAb;EACH;EACD;AACJ;AACA;;;EACI,OAAOA,IAAP;AACH,CAlBM"}
1
+ {"version":3,"names":["_api","require","compress","pluginsContainer","data","plugin","oneByType","CompressorPlugin","type","ex","getCompressor","exports","decompress"],"sources":["compression.ts"],"sourcesContent":["import type { PluginsContainer } from \"@webiny/plugins\";\nimport { CompressorPlugin } from \"@webiny/api\";\n\n/**\n * Method to compress the elasticsearch data that is going to be stored into the DynamoDB table that is meant for elasticsearch.\n */\nexport const compress = async (\n pluginsContainer: PluginsContainer,\n data: Record<string, any>\n): Promise<Record<string, any>> => {\n let plugin: CompressorPlugin;\n try {\n plugin = pluginsContainer.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch (ex) {\n return data;\n }\n return plugin.getCompressor().compress(data);\n};\n\nexport const decompress = async (\n pluginsContainer: PluginsContainer,\n data: Record<string, any>\n): Promise<Record<string, any>> => {\n let plugin: CompressorPlugin;\n try {\n plugin = pluginsContainer.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch (ex) {\n return data;\n }\n return plugin.getCompressor().decompress(data);\n};\n"],"mappings":";;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AAEA;AACA;AACA;AACO,MAAMC,QAAQ,GAAG,MAAAA,CACpBC,gBAAkC,EAClCC,IAAyB,KACM;EAC/B,IAAIC,MAAwB;EAC5B,IAAI;IACAA,MAAM,GAAGF,gBAAgB,CAACG,SAAS,CAAmBC,qBAAgB,CAACC,IAAI,CAAC;EAChF,CAAC,CAAC,OAAOC,EAAE,EAAE;IACT,OAAOL,IAAI;EACf;EACA,OAAOC,MAAM,CAACK,aAAa,CAAC,CAAC,CAACR,QAAQ,CAACE,IAAI,CAAC;AAChD,CAAC;AAACO,OAAA,CAAAT,QAAA,GAAAA,QAAA;AAEK,MAAMU,UAAU,GAAG,MAAAA,CACtBT,gBAAkC,EAClCC,IAAyB,KACM;EAC/B,IAAIC,MAAwB;EAC5B,IAAI;IACAA,MAAM,GAAGF,gBAAgB,CAACG,SAAS,CAAmBC,qBAAgB,CAACC,IAAI,CAAC;EAChF,CAAC,CAAC,OAAOC,EAAE,EAAE;IACT,OAAOL,IAAI;EACf;EACA,OAAOC,MAAM,CAACK,aAAa,CAAC,CAAC,CAACE,UAAU,CAACR,IAAI,CAAC;AAClD,CAAC;AAACO,OAAA,CAAAC,UAAA,GAAAA,UAAA","ignoreList":[]}
package/cursors.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { PrimitiveValue } from "./types";
1
+ import type { PrimitiveValue } from "./types";
2
2
  /**
3
3
  * Encode a received cursor value into something that can be passed on to the user.
4
4
  */
5
- export declare const encodeCursor: (cursor?: string | string[] | null) => string | undefined;
5
+ export declare const encodeCursor: (input?: PrimitiveValue[]) => string | undefined;
6
6
  /**
7
7
  * Decode a received value into a Elasticsearch cursor.
8
8
  * If no value is received or is not decodable, return undefined.
package/cursors.js CHANGED
@@ -4,52 +4,42 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.encodeCursor = exports.decodeCursor = void 0;
7
-
8
7
  /**
9
8
  * Encode a received cursor value into something that can be passed on to the user.
10
9
  */
11
- const encodeCursor = cursor => {
12
- if (!cursor) {
10
+ const encodeCursor = input => {
11
+ if (!input) {
13
12
  return undefined;
14
13
  }
15
-
16
- cursor = Array.isArray(cursor) ? cursor.map(encodeURIComponent) : encodeURIComponent(cursor);
17
-
14
+ const cursor = Array.isArray(input) ? input.filter(item => item !== null).map(item => encodeURIComponent(item)) : encodeURIComponent(input);
18
15
  try {
19
16
  return Buffer.from(JSON.stringify(cursor)).toString("base64");
20
17
  } catch (ex) {
21
18
  console.error(ex.message);
22
19
  }
23
-
24
20
  return undefined;
25
21
  };
26
22
  /**
27
23
  * Decode a received value into a Elasticsearch cursor.
28
24
  * If no value is received or is not decodable, return undefined.
29
25
  */
30
-
31
-
32
26
  exports.encodeCursor = encodeCursor;
33
-
34
27
  const decodeCursor = cursor => {
35
28
  if (!cursor) {
36
29
  return undefined;
37
30
  }
38
-
39
31
  try {
40
32
  const value = JSON.parse(Buffer.from(cursor, "base64").toString("ascii"));
41
-
42
33
  if (Array.isArray(value)) {
43
- return value.map(decodeURIComponent);
34
+ return value.filter(item => item !== null).map(decodeURIComponent);
44
35
  }
45
-
46
36
  const decoded = decodeURIComponent(value);
47
37
  return decoded ? [decoded] : undefined;
48
38
  } catch (ex) {
49
39
  console.error(ex.message);
50
40
  }
51
-
52
41
  return undefined;
53
42
  };
43
+ exports.decodeCursor = decodeCursor;
54
44
 
55
- exports.decodeCursor = decodeCursor;
45
+ //# sourceMappingURL=cursors.js.map
package/cursors.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["encodeCursor","cursor","undefined","Array","isArray","map","encodeURIComponent","Buffer","from","JSON","stringify","toString","ex","console","error","message","decodeCursor","value","parse","decodeURIComponent","decoded"],"sources":["cursors.ts"],"sourcesContent":["import { PrimitiveValue } from \"~/types\";\n\n/**\n * Encode a received cursor value into something that can be passed on to the user.\n */\nexport const encodeCursor = (cursor?: string | string[] | null): string | undefined => {\n if (!cursor) {\n return undefined;\n }\n\n cursor = Array.isArray(cursor) ? cursor.map(encodeURIComponent) : encodeURIComponent(cursor);\n\n try {\n return Buffer.from(JSON.stringify(cursor)).toString(\"base64\");\n } catch (ex) {\n console.error(ex.message);\n }\n return undefined;\n};\n/**\n * Decode a received value into a Elasticsearch cursor.\n * If no value is received or is not decodable, return undefined.\n */\nexport const decodeCursor = (cursor?: string | null): PrimitiveValue[] | undefined => {\n if (!cursor) {\n return undefined;\n }\n try {\n const value = JSON.parse(Buffer.from(cursor, \"base64\").toString(\"ascii\"));\n if (Array.isArray(value)) {\n return value.map(decodeURIComponent);\n }\n const decoded = decodeURIComponent(value);\n return decoded ? [decoded] : undefined;\n } catch (ex) {\n console.error(ex.message);\n }\n return undefined;\n};\n"],"mappings":";;;;;;;AAEA;AACA;AACA;AACO,MAAMA,YAAY,GAAIC,MAAD,IAA2D;EACnF,IAAI,CAACA,MAAL,EAAa;IACT,OAAOC,SAAP;EACH;;EAEDD,MAAM,GAAGE,KAAK,CAACC,OAAN,CAAcH,MAAd,IAAwBA,MAAM,CAACI,GAAP,CAAWC,kBAAX,CAAxB,GAAyDA,kBAAkB,CAACL,MAAD,CAApF;;EAEA,IAAI;IACA,OAAOM,MAAM,CAACC,IAAP,CAAYC,IAAI,CAACC,SAAL,CAAeT,MAAf,CAAZ,EAAoCU,QAApC,CAA6C,QAA7C,CAAP;EACH,CAFD,CAEE,OAAOC,EAAP,EAAW;IACTC,OAAO,CAACC,KAAR,CAAcF,EAAE,CAACG,OAAjB;EACH;;EACD,OAAOb,SAAP;AACH,CAbM;AAcP;AACA;AACA;AACA;;;;;AACO,MAAMc,YAAY,GAAIf,MAAD,IAA0D;EAClF,IAAI,CAACA,MAAL,EAAa;IACT,OAAOC,SAAP;EACH;;EACD,IAAI;IACA,MAAMe,KAAK,GAAGR,IAAI,CAACS,KAAL,CAAWX,MAAM,CAACC,IAAP,CAAYP,MAAZ,EAAoB,QAApB,EAA8BU,QAA9B,CAAuC,OAAvC,CAAX,CAAd;;IACA,IAAIR,KAAK,CAACC,OAAN,CAAca,KAAd,CAAJ,EAA0B;MACtB,OAAOA,KAAK,CAACZ,GAAN,CAAUc,kBAAV,CAAP;IACH;;IACD,MAAMC,OAAO,GAAGD,kBAAkB,CAACF,KAAD,CAAlC;IACA,OAAOG,OAAO,GAAG,CAACA,OAAD,CAAH,GAAelB,SAA7B;EACH,CAPD,CAOE,OAAOU,EAAP,EAAW;IACTC,OAAO,CAACC,KAAR,CAAcF,EAAE,CAACG,OAAjB;EACH;;EACD,OAAOb,SAAP;AACH,CAfM"}
1
+ {"version":3,"names":["encodeCursor","input","undefined","cursor","Array","isArray","filter","item","map","encodeURIComponent","Buffer","from","JSON","stringify","toString","ex","console","error","message","exports","decodeCursor","value","parse","decodeURIComponent","decoded"],"sources":["cursors.ts"],"sourcesContent":["import type { PrimitiveValue } from \"~/types\";\n\n/**\n * Encode a received cursor value into something that can be passed on to the user.\n */\nexport const encodeCursor = (input?: PrimitiveValue[]): string | undefined => {\n if (!input) {\n return undefined;\n }\n\n const cursor = Array.isArray(input)\n ? input\n .filter((item: PrimitiveValue): item is string | number | boolean => item !== null)\n .map(item => encodeURIComponent(item))\n : encodeURIComponent(input);\n\n try {\n return Buffer.from(JSON.stringify(cursor)).toString(\"base64\");\n } catch (ex) {\n console.error(ex.message);\n }\n return undefined;\n};\n/**\n * Decode a received value into a Elasticsearch cursor.\n * If no value is received or is not decodable, return undefined.\n */\nexport const decodeCursor = (cursor?: string | null): PrimitiveValue[] | undefined => {\n if (!cursor) {\n return undefined;\n }\n try {\n const value = JSON.parse(Buffer.from(cursor, \"base64\").toString(\"ascii\"));\n if (Array.isArray(value)) {\n return value.filter(item => item !== null).map(decodeURIComponent);\n }\n const decoded = decodeURIComponent(value);\n return decoded ? [decoded] : undefined;\n } catch (ex) {\n console.error(ex.message);\n }\n return undefined;\n};\n"],"mappings":";;;;;;AAEA;AACA;AACA;AACO,MAAMA,YAAY,GAAIC,KAAwB,IAAyB;EAC1E,IAAI,CAACA,KAAK,EAAE;IACR,OAAOC,SAAS;EACpB;EAEA,MAAMC,MAAM,GAAGC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,GAC7BA,KAAK,CACAK,MAAM,CAAEC,IAAoB,IAAwCA,IAAI,KAAK,IAAI,CAAC,CAClFC,GAAG,CAACD,IAAI,IAAIE,kBAAkB,CAACF,IAAI,CAAC,CAAC,GAC1CE,kBAAkB,CAACR,KAAK,CAAC;EAE/B,IAAI;IACA,OAAOS,MAAM,CAACC,IAAI,CAACC,IAAI,CAACC,SAAS,CAACV,MAAM,CAAC,CAAC,CAACW,QAAQ,CAAC,QAAQ,CAAC;EACjE,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTC,OAAO,CAACC,KAAK,CAACF,EAAE,CAACG,OAAO,CAAC;EAC7B;EACA,OAAOhB,SAAS;AACpB,CAAC;AACD;AACA;AACA;AACA;AAHAiB,OAAA,CAAAnB,YAAA,GAAAA,YAAA;AAIO,MAAMoB,YAAY,GAAIjB,MAAsB,IAAmC;EAClF,IAAI,CAACA,MAAM,EAAE;IACT,OAAOD,SAAS;EACpB;EACA,IAAI;IACA,MAAMmB,KAAK,GAAGT,IAAI,CAACU,KAAK,CAACZ,MAAM,CAACC,IAAI,CAACR,MAAM,EAAE,QAAQ,CAAC,CAACW,QAAQ,CAAC,OAAO,CAAC,CAAC;IACzE,IAAIV,KAAK,CAACC,OAAO,CAACgB,KAAK,CAAC,EAAE;MACtB,OAAOA,KAAK,CAACf,MAAM,CAACC,IAAI,IAAIA,IAAI,KAAK,IAAI,CAAC,CAACC,GAAG,CAACe,kBAAkB,CAAC;IACtE;IACA,MAAMC,OAAO,GAAGD,kBAAkB,CAACF,KAAK,CAAC;IACzC,OAAOG,OAAO,GAAG,CAACA,OAAO,CAAC,GAAGtB,SAAS;EAC1C,CAAC,CAAC,OAAOa,EAAE,EAAE;IACTC,OAAO,CAACC,KAAK,CAACF,EAAE,CAACG,OAAO,CAAC;EAC7B;EACA,OAAOhB,SAAS;AACpB,CAAC;AAACiB,OAAA,CAAAC,YAAA,GAAAA,YAAA","ignoreList":[]}
package/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ElasticsearchContext } from "./types";
1
+ import type { ElasticsearchContext } from "./types";
2
2
  import { ContextPlugin } from "@webiny/api";
3
- import { ElasticsearchClientOptions } from "./client";
3
+ import type { ElasticsearchClientOptions } from "./client";
4
4
  import { Client } from "@elastic/elasticsearch";
5
5
  export * from "./indexConfiguration";
6
6
  export * from "./plugins";
@@ -13,7 +13,10 @@ export * from "./compression";
13
13
  export * from "./operators";
14
14
  export * from "./cursors";
15
15
  export * from "./client";
16
- export { createGzipCompression } from "./plugins/GzipCompression";
16
+ export * from "./utils";
17
+ export * from "./operations";
18
+ export * from "./sharedIndex";
19
+ export * from "./indexPrefix";
17
20
  /**
18
21
  * We must accept either Elasticsearch client or options that create the client.
19
22
  */
package/index.js CHANGED
@@ -1,27 +1,14 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- var _exportNames = {
9
- createGzipCompression: true
10
- };
11
- Object.defineProperty(exports, "createGzipCompression", {
12
- enumerable: true,
13
- get: function () {
14
- return _GzipCompression.createGzipCompression;
15
- }
16
- });
7
+ var _exportNames = {};
17
8
  exports.default = void 0;
18
-
19
9
  var _error = _interopRequireDefault(require("@webiny/error"));
20
-
21
10
  var _api = require("@webiny/api");
22
-
23
11
  var _client = require("./client");
24
-
25
12
  Object.keys(_client).forEach(function (key) {
26
13
  if (key === "default" || key === "__esModule") return;
27
14
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -33,9 +20,7 @@ Object.keys(_client).forEach(function (key) {
33
20
  }
34
21
  });
35
22
  });
36
-
37
23
  var _operators = require("./operators");
38
-
39
24
  Object.keys(_operators).forEach(function (key) {
40
25
  if (key === "default" || key === "__esModule") return;
41
26
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -47,11 +32,8 @@ Object.keys(_operators).forEach(function (key) {
47
32
  }
48
33
  });
49
34
  });
50
-
51
35
  var _elasticsearch = require("@elastic/elasticsearch");
52
-
53
36
  var _indexConfiguration = require("./indexConfiguration");
54
-
55
37
  Object.keys(_indexConfiguration).forEach(function (key) {
56
38
  if (key === "default" || key === "__esModule") return;
57
39
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -63,9 +45,7 @@ Object.keys(_indexConfiguration).forEach(function (key) {
63
45
  }
64
46
  });
65
47
  });
66
-
67
48
  var _plugins = require("./plugins");
68
-
69
49
  Object.keys(_plugins).forEach(function (key) {
70
50
  if (key === "default" || key === "__esModule") return;
71
51
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -77,9 +57,7 @@ Object.keys(_plugins).forEach(function (key) {
77
57
  }
78
58
  });
79
59
  });
80
-
81
60
  var _sort = require("./sort");
82
-
83
61
  Object.keys(_sort).forEach(function (key) {
84
62
  if (key === "default" || key === "__esModule") return;
85
63
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -91,9 +69,7 @@ Object.keys(_sort).forEach(function (key) {
91
69
  }
92
70
  });
93
71
  });
94
-
95
72
  var _indices = require("./indices");
96
-
97
73
  Object.keys(_indices).forEach(function (key) {
98
74
  if (key === "default" || key === "__esModule") return;
99
75
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -105,9 +81,7 @@ Object.keys(_indices).forEach(function (key) {
105
81
  }
106
82
  });
107
83
  });
108
-
109
84
  var _where = require("./where");
110
-
111
85
  Object.keys(_where).forEach(function (key) {
112
86
  if (key === "default" || key === "__esModule") return;
113
87
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -119,9 +93,7 @@ Object.keys(_where).forEach(function (key) {
119
93
  }
120
94
  });
121
95
  });
122
-
123
96
  var _limit = require("./limit");
124
-
125
97
  Object.keys(_limit).forEach(function (key) {
126
98
  if (key === "default" || key === "__esModule") return;
127
99
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -133,9 +105,7 @@ Object.keys(_limit).forEach(function (key) {
133
105
  }
134
106
  });
135
107
  });
136
-
137
108
  var _normalize = require("./normalize");
138
-
139
109
  Object.keys(_normalize).forEach(function (key) {
140
110
  if (key === "default" || key === "__esModule") return;
141
111
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -147,9 +117,7 @@ Object.keys(_normalize).forEach(function (key) {
147
117
  }
148
118
  });
149
119
  });
150
-
151
120
  var _compression = require("./compression");
152
-
153
121
  Object.keys(_compression).forEach(function (key) {
154
122
  if (key === "default" || key === "__esModule") return;
155
123
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -161,9 +129,7 @@ Object.keys(_compression).forEach(function (key) {
161
129
  }
162
130
  });
163
131
  });
164
-
165
132
  var _cursors = require("./cursors");
166
-
167
133
  Object.keys(_cursors).forEach(function (key) {
168
134
  if (key === "default" || key === "__esModule") return;
169
135
  if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
@@ -175,13 +141,57 @@ Object.keys(_cursors).forEach(function (key) {
175
141
  }
176
142
  });
177
143
  });
178
-
179
- var _GzipCompression = require("./plugins/GzipCompression");
180
-
144
+ var _utils = require("./utils");
145
+ Object.keys(_utils).forEach(function (key) {
146
+ if (key === "default" || key === "__esModule") return;
147
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
148
+ if (key in exports && exports[key] === _utils[key]) return;
149
+ Object.defineProperty(exports, key, {
150
+ enumerable: true,
151
+ get: function () {
152
+ return _utils[key];
153
+ }
154
+ });
155
+ });
156
+ var _operations = require("./operations");
157
+ Object.keys(_operations).forEach(function (key) {
158
+ if (key === "default" || key === "__esModule") return;
159
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
160
+ if (key in exports && exports[key] === _operations[key]) return;
161
+ Object.defineProperty(exports, key, {
162
+ enumerable: true,
163
+ get: function () {
164
+ return _operations[key];
165
+ }
166
+ });
167
+ });
168
+ var _sharedIndex = require("./sharedIndex");
169
+ Object.keys(_sharedIndex).forEach(function (key) {
170
+ if (key === "default" || key === "__esModule") return;
171
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
172
+ if (key in exports && exports[key] === _sharedIndex[key]) return;
173
+ Object.defineProperty(exports, key, {
174
+ enumerable: true,
175
+ get: function () {
176
+ return _sharedIndex[key];
177
+ }
178
+ });
179
+ });
180
+ var _indexPrefix = require("./indexPrefix");
181
+ Object.keys(_indexPrefix).forEach(function (key) {
182
+ if (key === "default" || key === "__esModule") return;
183
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
184
+ if (key in exports && exports[key] === _indexPrefix[key]) return;
185
+ Object.defineProperty(exports, key, {
186
+ enumerable: true,
187
+ get: function () {
188
+ return _indexPrefix[key];
189
+ }
190
+ });
191
+ });
181
192
  /**
182
193
  * TODO File should contain only exports from other files.
183
194
  */
184
-
185
195
  /**
186
196
  * We must accept either Elasticsearch client or options that create the client.
187
197
  */
@@ -193,11 +203,10 @@ var _default = params => {
193
203
  /**
194
204
  * Initialize the Elasticsearch client.
195
205
  */
196
-
197
-
198
206
  context.elasticsearch = params instanceof _elasticsearch.Client ? params : (0, _client.createElasticsearchClient)(params);
199
207
  context.plugins.register((0, _operators.getElasticsearchOperators)());
200
208
  });
201
209
  };
210
+ exports.default = _default;
202
211
 
203
- exports.default = _default;
212
+ //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["params","ContextPlugin","context","elasticsearch","WebinyError","Client","createElasticsearchClient","plugins","register","getElasticsearchOperators"],"sources":["index.ts"],"sourcesContent":["/**\n * TODO File should contain only exports from other files.\n */\nimport WebinyError from \"@webiny/error\";\nimport { ElasticsearchContext } from \"~/types\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport { createElasticsearchClient, ElasticsearchClientOptions } 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 { createGzipCompression } from \"./plugins/GzipCompression\";\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;;AAEA;;AACA;;AAcA;EAAA;EAAA;EAAA;E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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,IAAA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";
2
2
  interface Modifier {
3
3
  (config: ElasticsearchIndexRequestBody): ElasticsearchIndexRequestBody;
4
4
  }