@webiny/api-elasticsearch 6.0.0-beta.0 → 6.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/client.d.ts +2 -2
- package/client.js +11 -31
- package/client.js.map +1 -1
- package/compression.d.ts +1 -1
- package/compression.js +13 -40
- package/compression.js.map +1 -1
- package/cursors.d.ts +2 -2
- package/cursors.js +5 -13
- package/cursors.js.map +1 -1
- package/db/entity.d.ts +7 -0
- package/db/entity.js +20 -0
- package/db/entity.js.map +1 -0
- package/db/index.d.ts +3 -0
- package/db/index.js +5 -0
- package/db/index.js.map +1 -0
- package/db/table.d.ts +7 -0
- package/db/table.js +17 -0
- package/db/table.js.map +1 -0
- package/db/types.d.ts +6 -0
- package/db/types.js +3 -0
- package/db/types.js.map +1 -0
- package/index.d.ts +18 -16
- package/index.js +27 -182
- package/index.js.map +1 -1
- package/indexConfiguration/base.d.ts +1 -1
- package/indexConfiguration/base.js +3 -10
- package/indexConfiguration/base.js.map +1 -1
- package/indexConfiguration/common.d.ts +1 -1
- package/indexConfiguration/common.js +12 -8
- package/indexConfiguration/common.js.map +1 -1
- package/indexConfiguration/index.d.ts +2 -3
- package/indexConfiguration/index.js +2 -38
- package/indexConfiguration/index.js.map +1 -1
- package/indexPrefix.d.ts +1 -0
- package/indexPrefix.js +5 -0
- package/indexPrefix.js.map +1 -0
- package/indices.d.ts +2 -3
- package/indices.js +6 -16
- package/indices.js.map +1 -1
- package/limit.js +1 -8
- package/limit.js.map +1 -1
- package/normalize.js +3 -11
- package/normalize.js.map +1 -1
- package/operations/ElasticsearchCatHealth.d.ts +2 -2
- package/operations/ElasticsearchCatHealth.js +6 -13
- package/operations/ElasticsearchCatHealth.js.map +1 -1
- package/operations/ElasticsearchCatNodes.d.ts +2 -2
- package/operations/ElasticsearchCatNodes.js +6 -13
- package/operations/ElasticsearchCatNodes.js.map +1 -1
- package/operations/index.d.ts +3 -3
- package/operations/index.js +3 -38
- package/operations/index.js.map +1 -1
- package/operations/stripConnectionFromException.js +1 -8
- package/operations/stripConnectionFromException.js.map +1 -1
- package/operations/types.d.ts +1 -1
- package/operations/types.js +1 -7
- package/operations/types.js.map +1 -1
- package/operators.d.ts +2 -5
- package/operators.js +3 -41
- package/operators.js.map +1 -1
- package/package.json +14 -18
- package/plugins/definition/ElasticsearchBodyModifierPlugin.d.ts +1 -1
- package/plugins/definition/ElasticsearchBodyModifierPlugin.js +4 -12
- package/plugins/definition/ElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/definition/ElasticsearchFieldPlugin.d.ts +2 -2
- package/plugins/definition/ElasticsearchFieldPlugin.js +2 -9
- package/plugins/definition/ElasticsearchFieldPlugin.js.map +1 -1
- package/plugins/definition/ElasticsearchIndexPlugin.d.ts +2 -10
- package/plugins/definition/ElasticsearchIndexPlugin.js +4 -23
- package/plugins/definition/ElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin.d.ts +1 -5
- package/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin.js +2 -17
- package/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin.js.map +1 -1
- package/plugins/definition/ElasticsearchQueryModifierPlugin.d.ts +1 -1
- package/plugins/definition/ElasticsearchQueryModifierPlugin.js +4 -12
- package/plugins/definition/ElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/definition/ElasticsearchSortModifierPlugin.d.ts +1 -1
- package/plugins/definition/ElasticsearchSortModifierPlugin.js +4 -12
- package/plugins/definition/ElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/definition/index.d.ts +6 -7
- package/plugins/definition/index.js +6 -82
- package/plugins/definition/index.js.map +1 -1
- package/plugins/index.d.ts +2 -2
- package/plugins/index.js +2 -27
- package/plugins/index.js.map +1 -1
- package/plugins/operator/andIn.d.ts +2 -2
- package/plugins/operator/andIn.js +2 -9
- package/plugins/operator/andIn.js.map +1 -1
- package/plugins/operator/between.d.ts +2 -2
- package/plugins/operator/between.js +2 -9
- package/plugins/operator/between.js.map +1 -1
- package/plugins/operator/contains.d.ts +2 -2
- package/plugins/operator/contains.js +4 -11
- package/plugins/operator/contains.js.map +1 -1
- package/plugins/operator/equal.d.ts +2 -2
- package/plugins/operator/equal.js +3 -10
- package/plugins/operator/equal.js.map +1 -1
- package/plugins/operator/gt.d.ts +2 -2
- package/plugins/operator/gt.js +2 -9
- package/plugins/operator/gt.js.map +1 -1
- package/plugins/operator/gte.d.ts +2 -2
- package/plugins/operator/gte.js +2 -9
- package/plugins/operator/gte.js.map +1 -1
- package/plugins/operator/in.d.ts +2 -2
- package/plugins/operator/in.js +2 -9
- package/plugins/operator/in.js.map +1 -1
- package/plugins/operator/index.d.ts +15 -16
- package/plugins/operator/index.js +15 -181
- package/plugins/operator/index.js.map +1 -1
- package/plugins/operator/lt.d.ts +2 -2
- package/plugins/operator/lt.js +2 -9
- package/plugins/operator/lt.js.map +1 -1
- package/plugins/operator/lte.d.ts +2 -2
- package/plugins/operator/lte.js +2 -9
- package/plugins/operator/lte.js.map +1 -1
- package/plugins/operator/not.d.ts +2 -2
- package/plugins/operator/not.js +3 -10
- package/plugins/operator/not.js.map +1 -1
- package/plugins/operator/notBetween.d.ts +2 -2
- package/plugins/operator/notBetween.js +2 -9
- package/plugins/operator/notBetween.js.map +1 -1
- package/plugins/operator/notContains.d.ts +2 -2
- package/plugins/operator/notContains.js +4 -11
- package/plugins/operator/notContains.js.map +1 -1
- package/plugins/operator/notIn.d.ts +2 -2
- package/plugins/operator/notIn.js +2 -9
- package/plugins/operator/notIn.js.map +1 -1
- package/plugins/operator/notStartsWith.d.ts +2 -2
- package/plugins/operator/notStartsWith.js +2 -9
- package/plugins/operator/notStartsWith.js.map +1 -1
- package/plugins/operator/startsWith.d.ts +2 -2
- package/plugins/operator/startsWith.js +2 -9
- package/plugins/operator/startsWith.js.map +1 -1
- package/sharedIndex.d.ts +1 -0
- package/sharedIndex.js +5 -0
- package/sharedIndex.js.map +1 -0
- package/sort.d.ts +2 -2
- package/sort.js +18 -17
- package/sort.js.map +1 -1
- package/types.d.ts +32 -20
- package/types.js +28 -26
- package/types.js.map +1 -1
- package/utils/createIndex.d.ts +2 -3
- package/utils/createIndex.js +7 -19
- package/utils/createIndex.js.map +1 -1
- package/utils/index.d.ts +3 -3
- package/utils/index.js +3 -27
- package/utils/index.js.map +1 -1
- package/utils/waitUntilHealthy/UnhealthyClusterError.js +2 -9
- package/utils/waitUntilHealthy/UnhealthyClusterError.js.map +1 -1
- package/utils/waitUntilHealthy/WaitUntilHealthy.d.ts +4 -4
- package/utils/waitUntilHealthy/WaitUntilHealthy.js +22 -29
- package/utils/waitUntilHealthy/WaitUntilHealthy.js.map +1 -1
- package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js +2 -9
- package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js.map +1 -1
- package/utils/waitUntilHealthy/index.d.ts +6 -6
- package/utils/waitUntilHealthy/index.js +6 -49
- package/utils/waitUntilHealthy/index.js.map +1 -1
- package/utils/waitUntilHealthy/reason/ClusterHealthReason.d.ts +2 -2
- package/utils/waitUntilHealthy/reason/ClusterHealthReason.js +2 -10
- package/utils/waitUntilHealthy/reason/ClusterHealthReason.js.map +1 -1
- package/utils/waitUntilHealthy/reason/IReason.js +1 -5
- package/utils/waitUntilHealthy/reason/MemoryReason.d.ts +1 -1
- package/utils/waitUntilHealthy/reason/MemoryReason.js +2 -10
- package/utils/waitUntilHealthy/reason/MemoryReason.js.map +1 -1
- package/utils/waitUntilHealthy/reason/ProcessorReason.d.ts +1 -1
- package/utils/waitUntilHealthy/reason/ProcessorReason.js +2 -10
- package/utils/waitUntilHealthy/reason/ProcessorReason.js.map +1 -1
- package/utils/waitUntilHealthy/reason/index.d.ts +3 -3
- package/utils/waitUntilHealthy/reason/index.js +3 -38
- package/utils/waitUntilHealthy/reason/index.js.map +1 -1
- package/where.d.ts +4 -4
- package/where.js +7 -16
- package/where.js.map +1 -1
- package/indexConfiguration/japanese.d.ts +0 -6
- package/indexConfiguration/japanese.js +0 -121
- package/indexConfiguration/japanese.js.map +0 -1
- package/plugins/GzipCompression.d.ts +0 -24
- package/plugins/GzipCompression.js +0 -70
- package/plugins/GzipCompression.js.map +0 -1
- package/plugins/definition/CompressionPlugin.d.ts +0 -20
- package/plugins/definition/CompressionPlugin.js +0 -28
- package/plugins/definition/CompressionPlugin.js.map +0 -1
- package/plugins/operator/japanese/contains.d.ts +0 -8
- package/plugins/operator/japanese/contains.js +0 -44
- package/plugins/operator/japanese/contains.js.map +0 -1
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getJapaneseConfiguration = void 0;
|
|
7
|
-
var _common = require("./common");
|
|
8
|
-
const config = {
|
|
9
|
-
settings: {
|
|
10
|
-
index: {
|
|
11
|
-
analysis: {
|
|
12
|
-
char_filter: {
|
|
13
|
-
normalize: {
|
|
14
|
-
type: "icu_normalizer",
|
|
15
|
-
name: "nfkc",
|
|
16
|
-
mode: "compose"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
tokenizer: {
|
|
20
|
-
ja_kuromoji_tokenizer: {
|
|
21
|
-
mode: "search",
|
|
22
|
-
type: "kuromoji_tokenizer",
|
|
23
|
-
discard_compound_token: "true",
|
|
24
|
-
user_dictionary_rules: ["東京スカイツリー,東京 スカイツリー,トウキョウ スカイツリー,カスタム名詞"]
|
|
25
|
-
},
|
|
26
|
-
ja_ngram_tokenizer: {
|
|
27
|
-
type: "ngram",
|
|
28
|
-
min_gram: "2",
|
|
29
|
-
max_gram: "2",
|
|
30
|
-
token_chars: ["letter", "digit"]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
filter: {
|
|
34
|
-
ja_index_synonym: {
|
|
35
|
-
type: "synonym",
|
|
36
|
-
lenient: "false",
|
|
37
|
-
synonyms: []
|
|
38
|
-
},
|
|
39
|
-
ja_search_synonym: {
|
|
40
|
-
type: "synonym_graph",
|
|
41
|
-
lenient: "false",
|
|
42
|
-
synonyms: ["米国, アメリカ", "東京大学, 東大"]
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
analyzer: {
|
|
46
|
-
ja_kuromoji_index_analyzer: {
|
|
47
|
-
type: "custom",
|
|
48
|
-
char_filter: ["normalize"],
|
|
49
|
-
tokenizer: "ja_kuromoji_tokenizer",
|
|
50
|
-
filter: ["kuromoji_baseform", "kuromoji_part_of_speech", "ja_index_synonym", "cjk_width", "ja_stop", "kuromoji_stemmer", "lowercase"]
|
|
51
|
-
},
|
|
52
|
-
ja_kuromoji_search_analyzer: {
|
|
53
|
-
type: "custom",
|
|
54
|
-
char_filter: ["normalize"],
|
|
55
|
-
tokenizer: "ja_kuromoji_tokenizer",
|
|
56
|
-
filter: ["kuromoji_baseform", "kuromoji_part_of_speech", "ja_search_synonym", "cjk_width", "ja_stop", "kuromoji_stemmer", "lowercase"]
|
|
57
|
-
},
|
|
58
|
-
ja_ngram_index_analyzer: {
|
|
59
|
-
type: "custom",
|
|
60
|
-
char_filter: ["normalize"],
|
|
61
|
-
tokenizer: "ja_ngram_tokenizer",
|
|
62
|
-
filter: ["lowercase"]
|
|
63
|
-
},
|
|
64
|
-
ja_ngram_search_analyzer: {
|
|
65
|
-
type: "custom",
|
|
66
|
-
char_filter: ["normalize"],
|
|
67
|
-
tokenizer: "ja_ngram_tokenizer",
|
|
68
|
-
filter: ["ja_search_synonym", "lowercase"]
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
default: {
|
|
72
|
-
type: "ja_kuromoji_index_analyzer"
|
|
73
|
-
},
|
|
74
|
-
default_search: {
|
|
75
|
-
type: "ja_kuromoji_search_analyzer"
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
mappings: {
|
|
81
|
-
numeric_detection: true,
|
|
82
|
-
dynamic_templates: (0, _common.getCommonMappings)(mappings => {
|
|
83
|
-
return mappings.concat([{
|
|
84
|
-
strings: {
|
|
85
|
-
match_mapping_type: "string",
|
|
86
|
-
mapping: {
|
|
87
|
-
type: "text",
|
|
88
|
-
search_analyzer: "ja_kuromoji_search_analyzer",
|
|
89
|
-
analyzer: "ja_kuromoji_index_analyzer",
|
|
90
|
-
fields: {
|
|
91
|
-
ngram: {
|
|
92
|
-
type: "text",
|
|
93
|
-
search_analyzer: "ja_ngram_search_analyzer",
|
|
94
|
-
analyzer: "ja_ngram_index_analyzer"
|
|
95
|
-
},
|
|
96
|
-
keyword: {
|
|
97
|
-
ignore_above: 256,
|
|
98
|
-
type: "keyword"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
}]);
|
|
104
|
-
}),
|
|
105
|
-
properties: {
|
|
106
|
-
rawValues: {
|
|
107
|
-
type: "object",
|
|
108
|
-
enabled: false
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
const getJapaneseConfiguration = modifier => {
|
|
114
|
-
if (!modifier) {
|
|
115
|
-
return config;
|
|
116
|
-
}
|
|
117
|
-
return modifier(config);
|
|
118
|
-
};
|
|
119
|
-
exports.getJapaneseConfiguration = getJapaneseConfiguration;
|
|
120
|
-
|
|
121
|
-
//# sourceMappingURL=japanese.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_common","require","config","settings","index","analysis","char_filter","normalize","type","name","mode","tokenizer","ja_kuromoji_tokenizer","discard_compound_token","user_dictionary_rules","ja_ngram_tokenizer","min_gram","max_gram","token_chars","filter","ja_index_synonym","lenient","synonyms","ja_search_synonym","analyzer","ja_kuromoji_index_analyzer","ja_kuromoji_search_analyzer","ja_ngram_index_analyzer","ja_ngram_search_analyzer","default","default_search","mappings","numeric_detection","dynamic_templates","getCommonMappings","concat","strings","match_mapping_type","mapping","search_analyzer","fields","ngram","keyword","ignore_above","properties","rawValues","enabled","getJapaneseConfiguration","modifier","exports"],"sources":["japanese.ts"],"sourcesContent":["import { ElasticsearchIndexRequestBody } from \"~/types\";\nimport { getCommonMappings } from \"./common\";\n\nconst config: ElasticsearchIndexRequestBody = {\n settings: {\n index: {\n analysis: {\n char_filter: {\n normalize: {\n type: \"icu_normalizer\",\n name: \"nfkc\",\n mode: \"compose\"\n }\n },\n tokenizer: {\n ja_kuromoji_tokenizer: {\n mode: \"search\",\n type: \"kuromoji_tokenizer\",\n discard_compound_token: \"true\",\n user_dictionary_rules: [\n \"東京スカイツリー,東京 スカイツリー,トウキョウ スカイツリー,カスタム名詞\"\n ]\n },\n ja_ngram_tokenizer: {\n type: \"ngram\",\n min_gram: \"2\",\n max_gram: \"2\",\n token_chars: [\"letter\", \"digit\"]\n }\n },\n filter: {\n ja_index_synonym: {\n type: \"synonym\",\n lenient: \"false\",\n synonyms: []\n },\n ja_search_synonym: {\n type: \"synonym_graph\",\n lenient: \"false\",\n synonyms: [\"米国, アメリカ\", \"東京大学, 東大\"]\n }\n },\n analyzer: {\n ja_kuromoji_index_analyzer: {\n type: \"custom\",\n char_filter: [\"normalize\"],\n tokenizer: \"ja_kuromoji_tokenizer\",\n filter: [\n \"kuromoji_baseform\",\n \"kuromoji_part_of_speech\",\n \"ja_index_synonym\",\n \"cjk_width\",\n \"ja_stop\",\n \"kuromoji_stemmer\",\n \"lowercase\"\n ]\n },\n ja_kuromoji_search_analyzer: {\n type: \"custom\",\n char_filter: [\"normalize\"],\n tokenizer: \"ja_kuromoji_tokenizer\",\n filter: [\n \"kuromoji_baseform\",\n \"kuromoji_part_of_speech\",\n \"ja_search_synonym\",\n \"cjk_width\",\n \"ja_stop\",\n \"kuromoji_stemmer\",\n \"lowercase\"\n ]\n },\n ja_ngram_index_analyzer: {\n type: \"custom\",\n char_filter: [\"normalize\"],\n tokenizer: \"ja_ngram_tokenizer\",\n filter: [\"lowercase\"]\n },\n ja_ngram_search_analyzer: {\n type: \"custom\",\n char_filter: [\"normalize\"],\n tokenizer: \"ja_ngram_tokenizer\",\n filter: [\"ja_search_synonym\", \"lowercase\"]\n }\n },\n default: {\n type: \"ja_kuromoji_index_analyzer\"\n },\n default_search: {\n type: \"ja_kuromoji_search_analyzer\"\n }\n }\n }\n },\n mappings: {\n numeric_detection: true,\n dynamic_templates: getCommonMappings(mappings => {\n return mappings.concat([\n {\n strings: {\n match_mapping_type: \"string\",\n mapping: {\n type: \"text\",\n search_analyzer: \"ja_kuromoji_search_analyzer\",\n analyzer: \"ja_kuromoji_index_analyzer\",\n fields: {\n ngram: {\n type: \"text\",\n search_analyzer: \"ja_ngram_search_analyzer\",\n analyzer: \"ja_ngram_index_analyzer\"\n },\n keyword: {\n ignore_above: 256,\n type: \"keyword\"\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 getJapaneseConfiguration = (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,KAAK,EAAE;MACHC,QAAQ,EAAE;QACNC,WAAW,EAAE;UACTC,SAAS,EAAE;YACPC,IAAI,EAAE,gBAAgB;YACtBC,IAAI,EAAE,MAAM;YACZC,IAAI,EAAE;UACV;QACJ,CAAC;QACDC,SAAS,EAAE;UACPC,qBAAqB,EAAE;YACnBF,IAAI,EAAE,QAAQ;YACdF,IAAI,EAAE,oBAAoB;YAC1BK,sBAAsB,EAAE,MAAM;YAC9BC,qBAAqB,EAAE,CACnB,wCAAwC;UAEhD,CAAC;UACDC,kBAAkB,EAAE;YAChBP,IAAI,EAAE,OAAO;YACbQ,QAAQ,EAAE,GAAG;Y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,EAAE;UACZtB,IAAI,EAAE;QACV;MACJ;IACJ;EACJ,CAAC;EACDuB,QAAQ,EAAE;IACNC,iBAAiB,EAAE,IAAI;IACvBC,iBAAiB,EAAE,IAAAC,yBAAiB,EAACH,QAAQ,IAAI;MAC7C,OAAOA,QAAQ,CAACI,MAAM,CAAC,CACnB;QACIC,OAAO,EAAE;UACLC,kBAAkB,EAAE,QAAQ;UAC5BC,OAAO,EAAE;YACL9B,IAAI,EAAE,MAAM;YACZ+B,eAAe,EAAE,6BAA6B;YAC9Cf,QAAQ,EAAE,4BAA4B;YACtCgB,MAAM,EAAE;cACJC,KAAK,EAAE;gBACHjC,IAAI,EAAE,MAAM;gBACZ+B,eAAe,EAAE,0BAA0B;gBAC3Cf,QAAQ,EAAE;cACd,CAAC;cACDkB,OAAO,EAAE;gBACLC,YAAY,EAAE,GAAG;gBACjBnC,IAAI,EAAE;cACV;YACJ;UACJ;QACJ;MACJ,CAAC,CACJ,CAAC;IACN,CAAC,CAAC;IACFoC,UAAU,EAAE;MACRC,SAAS,EAAE;QACPrC,IAAI,EAAE,QAAQ;QACdsC,OAAO,EAAE;MACb;IACJ;EACJ;AACJ,CAAC;AAKM,MAAMC,wBAAwB,GAAIC,QAAmB,IAAK;EAC7D,IAAI,CAACA,QAAQ,EAAE;IACX,OAAO9C,MAAM;EACjB;EACA,OAAO8C,QAAQ,CAAC9C,MAAM,CAAC;AAC3B,CAAC;AAAC+C,OAAA,CAAAF,wBAAA,GAAAA,wBAAA","ignoreList":[]}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CompressionPlugin } from "./definition/CompressionPlugin";
|
|
2
|
-
export interface CompressedData {
|
|
3
|
-
compression: string;
|
|
4
|
-
value: string;
|
|
5
|
-
}
|
|
6
|
-
export interface OriginalData {
|
|
7
|
-
[key: string]: any;
|
|
8
|
-
}
|
|
9
|
-
declare class GzipCompression extends CompressionPlugin {
|
|
10
|
-
canCompress(data: any): boolean;
|
|
11
|
-
compress(data: any): Promise<{
|
|
12
|
-
compression: string;
|
|
13
|
-
value: string;
|
|
14
|
-
}>;
|
|
15
|
-
canDecompress(data: CompressedData | Record<string, any>): boolean;
|
|
16
|
-
decompress(data: CompressedData): Promise<OriginalData | null>;
|
|
17
|
-
}
|
|
18
|
-
export declare const createGzipCompression: () => GzipCompression;
|
|
19
|
-
/**
|
|
20
|
-
* Left due to backward compatibility with older systems.
|
|
21
|
-
* Remove when upgraded the system to run from @webiny/api-serverless-cms-aws
|
|
22
|
-
*/
|
|
23
|
-
declare const _default: () => GzipCompression;
|
|
24
|
-
export default _default;
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = exports.createGzipCompression = void 0;
|
|
7
|
-
var _CompressionPlugin = require("./definition/CompressionPlugin");
|
|
8
|
-
var _gzip = require("@webiny/utils/compression/gzip");
|
|
9
|
-
const GZIP = "gzip";
|
|
10
|
-
const TO_STORAGE_ENCODING = "base64";
|
|
11
|
-
const FROM_STORAGE_ENCODING = "utf8";
|
|
12
|
-
const convertToBuffer = value => {
|
|
13
|
-
if (typeof value === "string") {
|
|
14
|
-
return Buffer.from(value, TO_STORAGE_ENCODING);
|
|
15
|
-
}
|
|
16
|
-
return value;
|
|
17
|
-
};
|
|
18
|
-
class GzipCompression extends _CompressionPlugin.CompressionPlugin {
|
|
19
|
-
canCompress(data) {
|
|
20
|
-
/**
|
|
21
|
-
* If already compressed, skip this.
|
|
22
|
-
*/
|
|
23
|
-
if (data.compression) {
|
|
24
|
-
if (data.compression !== "GZIP") {
|
|
25
|
-
console.log(`Data is already compressed with "${data.compression}".`);
|
|
26
|
-
}
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
return true;
|
|
30
|
-
}
|
|
31
|
-
async compress(data) {
|
|
32
|
-
const value = await (0, _gzip.compress)(JSON.stringify(data));
|
|
33
|
-
return {
|
|
34
|
-
compression: GZIP,
|
|
35
|
-
value: value.toString(TO_STORAGE_ENCODING)
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
canDecompress(data) {
|
|
39
|
-
if (!data || !data.compression) {
|
|
40
|
-
return false;
|
|
41
|
-
} else if (data.compression !== GZIP) {
|
|
42
|
-
console.log(`Could not decompress given data since its compression is not "${GZIP}". It is "${data.compression}".`);
|
|
43
|
-
return false;
|
|
44
|
-
}
|
|
45
|
-
return true;
|
|
46
|
-
}
|
|
47
|
-
async decompress(data) {
|
|
48
|
-
try {
|
|
49
|
-
const buf = await (0, _gzip.decompress)(convertToBuffer(data.value));
|
|
50
|
-
const value = buf.toString(FROM_STORAGE_ENCODING);
|
|
51
|
-
return JSON.parse(value);
|
|
52
|
-
} catch (ex) {
|
|
53
|
-
return null;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const createGzipCompression = () => {
|
|
58
|
-
return new GzipCompression();
|
|
59
|
-
};
|
|
60
|
-
/**
|
|
61
|
-
* Left due to backward compatibility with older systems.
|
|
62
|
-
* Remove when upgraded the system to run from @webiny/api-serverless-cms-aws
|
|
63
|
-
*/
|
|
64
|
-
exports.createGzipCompression = createGzipCompression;
|
|
65
|
-
var _default = () => {
|
|
66
|
-
return createGzipCompression();
|
|
67
|
-
};
|
|
68
|
-
exports.default = _default;
|
|
69
|
-
|
|
70
|
-
//# sourceMappingURL=GzipCompression.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_CompressionPlugin","require","_gzip","GZIP","TO_STORAGE_ENCODING","FROM_STORAGE_ENCODING","convertToBuffer","value","Buffer","from","GzipCompression","CompressionPlugin","canCompress","data","compression","console","log","compress","gzip","JSON","stringify","toString","canDecompress","decompress","buf","ungzip","parse","ex","createGzipCompression","exports","_default","default"],"sources":["GzipCompression.ts"],"sourcesContent":["import { CompressionPlugin } from \"~/plugins/definition/CompressionPlugin\";\nimport { compress as gzip, decompress as ungzip } from \"@webiny/utils/compression/gzip\";\n\nconst GZIP = \"gzip\";\nconst TO_STORAGE_ENCODING = \"base64\";\nconst FROM_STORAGE_ENCODING = \"utf8\";\n\nconst convertToBuffer = (value: string | Buffer) => {\n if (typeof value === \"string\") {\n return Buffer.from(value, TO_STORAGE_ENCODING);\n }\n return value;\n};\n\nexport interface CompressedData {\n compression: string;\n value: string;\n}\n\nexport interface OriginalData {\n [key: string]: any;\n}\n\nclass GzipCompression extends CompressionPlugin {\n public canCompress(data: any): boolean {\n /**\n * If already compressed, skip this.\n */\n if (data.compression) {\n if (data.compression !== \"GZIP\") {\n console.log(`Data is already compressed with \"${data.compression}\".`);\n }\n return false;\n }\n return true;\n }\n public async compress(data: any) {\n const value = await gzip(JSON.stringify(data));\n\n return {\n compression: GZIP,\n value: value.toString(TO_STORAGE_ENCODING)\n };\n }\n\n public canDecompress(data: CompressedData | Record<string, any>): boolean {\n if (!data || !data.compression) {\n return false;\n } else if (data.compression !== GZIP) {\n console.log(\n `Could not decompress given data since its compression is not \"${GZIP}\". It is \"${data.compression}\".`\n );\n return false;\n }\n return true;\n }\n\n public async decompress(data: CompressedData): Promise<OriginalData | null> {\n try {\n const buf = await ungzip(convertToBuffer(data.value));\n const value = buf.toString(FROM_STORAGE_ENCODING);\n return JSON.parse(value);\n } catch (ex) {\n return null;\n }\n }\n}\n\nexport const createGzipCompression = () => {\n return new GzipCompression();\n};\n/**\n * Left due to backward compatibility with older systems.\n * Remove when upgraded the system to run from @webiny/api-serverless-cms-aws\n */\nexport default () => {\n return createGzipCompression();\n};\n"],"mappings":";;;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAEA,MAAME,IAAI,GAAG,MAAM;AACnB,MAAMC,mBAAmB,GAAG,QAAQ;AACpC,MAAMC,qBAAqB,GAAG,MAAM;AAEpC,MAAMC,eAAe,GAAIC,KAAsB,IAAK;EAChD,IAAI,OAAOA,KAAK,KA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5B,CAAC,CAAC,OAAOoB,EAAE,EAAE;MACT,OAAO,IAAI;IACf;EACJ;AACJ;AAEO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACvC,OAAO,IAAIlB,eAAe,CAAC,CAAC;AAChC,CAAC;AACD;AACA;AACA;AACA;AAHAmB,OAAA,CAAAD,qBAAA,GAAAA,qBAAA;AAAA,IAAAE,QAAA,GAIeA,CAAA,KAAM;EACjB,OAAOF,qBAAqB,CAAC,CAAC;AAClC,CAAC;AAAAC,OAAA,CAAAE,OAAA,GAAAD,QAAA","ignoreList":[]}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
export declare abstract class CompressionPlugin extends Plugin {
|
|
3
|
-
static readonly type: string;
|
|
4
|
-
/**
|
|
5
|
-
* Check if data can be compressed.
|
|
6
|
-
*/
|
|
7
|
-
abstract canCompress(data: any): boolean;
|
|
8
|
-
/**
|
|
9
|
-
* Pass the data to get the compressed one back.
|
|
10
|
-
*/
|
|
11
|
-
abstract compress(data: any): Promise<any>;
|
|
12
|
-
/**
|
|
13
|
-
* Check if data can be decompressed.
|
|
14
|
-
*/
|
|
15
|
-
abstract canDecompress(data: any): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Passed the compressed data to get the original data back.
|
|
18
|
-
*/
|
|
19
|
-
abstract decompress(data: any): Promise<any>;
|
|
20
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.CompressionPlugin = void 0;
|
|
7
|
-
var _plugins = require("@webiny/plugins");
|
|
8
|
-
class CompressionPlugin extends _plugins.Plugin {
|
|
9
|
-
static type = "elasticsearch.compression";
|
|
10
|
-
/**
|
|
11
|
-
* Check if data can be compressed.
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Pass the data to get the compressed one back.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Check if data can be decompressed.
|
|
20
|
-
*/
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Passed the compressed data to get the original data back.
|
|
24
|
-
*/
|
|
25
|
-
}
|
|
26
|
-
exports.CompressionPlugin = CompressionPlugin;
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=CompressionPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","CompressionPlugin","Plugin","type","exports"],"sources":["CompressionPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\n\nexport abstract class CompressionPlugin extends Plugin {\n public static override readonly type: string = \"elasticsearch.compression\";\n /**\n * Check if data can be compressed.\n */\n public abstract canCompress(data: any): boolean;\n /**\n * Pass the data to get the compressed one back.\n */\n public abstract compress(data: any): Promise<any>;\n /**\n * Check if data can be decompressed.\n */\n public abstract canDecompress(data: any): boolean;\n /**\n * Passed the compressed data to get the original data back.\n */\n public abstract decompress(data: any): Promise<any>;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEO,MAAeC,iBAAiB,SAASC,eAAM,CAAC;EACnD,OAAgCC,IAAI,GAAW,2BAA2B;EAC1E;AACJ;AACA;;EAEI;AACJ;AACA;;EAEI;AACJ;AACA;;EAEI;AACJ;AACA;AAEA;AAACC,OAAA,CAAAH,iBAAA,GAAAA,iBAAA","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ElasticsearchQueryBuilderOperatorPlugin } from "../../definition/ElasticsearchQueryBuilderOperatorPlugin";
|
|
2
|
-
import { ElasticsearchBoolQueryConfig, ElasticsearchQueryBuilderArgsPlugin } from "../../../types";
|
|
3
|
-
export declare class ElasticsearchQueryBuilderJapaneseOperatorContainsPlugin extends ElasticsearchQueryBuilderOperatorPlugin {
|
|
4
|
-
name: string;
|
|
5
|
-
isLocaleSupported(code: string): boolean;
|
|
6
|
-
getOperator(): string;
|
|
7
|
-
apply(query: ElasticsearchBoolQueryConfig, params: ElasticsearchQueryBuilderArgsPlugin): void;
|
|
8
|
-
}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ElasticsearchQueryBuilderJapaneseOperatorContainsPlugin = void 0;
|
|
7
|
-
var _ElasticsearchQueryBuilderOperatorPlugin = require("../../definition/ElasticsearchQueryBuilderOperatorPlugin");
|
|
8
|
-
var _normalize = require("../../../normalize");
|
|
9
|
-
class ElasticsearchQueryBuilderJapaneseOperatorContainsPlugin extends _ElasticsearchQueryBuilderOperatorPlugin.ElasticsearchQueryBuilderOperatorPlugin {
|
|
10
|
-
name = "elasticsearch.queryBuilder.operator.contains.japanese";
|
|
11
|
-
isLocaleSupported(code) {
|
|
12
|
-
if (!code) {
|
|
13
|
-
return false;
|
|
14
|
-
}
|
|
15
|
-
return ["ja", "ja-jp"].includes(code.toLowerCase());
|
|
16
|
-
}
|
|
17
|
-
getOperator() {
|
|
18
|
-
return "contains";
|
|
19
|
-
}
|
|
20
|
-
apply(query, params) {
|
|
21
|
-
const {
|
|
22
|
-
value: initialValue,
|
|
23
|
-
basePath
|
|
24
|
-
} = params;
|
|
25
|
-
const value = (0, _normalize.normalizeValueWithAsterisk)(initialValue);
|
|
26
|
-
query.must.push({
|
|
27
|
-
multi_match: {
|
|
28
|
-
query: value,
|
|
29
|
-
type: "phrase",
|
|
30
|
-
fields: [`${basePath}.ngram`]
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
query.should.push({
|
|
34
|
-
multi_match: {
|
|
35
|
-
query: value,
|
|
36
|
-
type: "phrase",
|
|
37
|
-
fields: [`${basePath}`]
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
exports.ElasticsearchQueryBuilderJapaneseOperatorContainsPlugin = ElasticsearchQueryBuilderJapaneseOperatorContainsPlugin;
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=contains.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["_ElasticsearchQueryBuilderOperatorPlugin","require","_normalize","ElasticsearchQueryBuilderJapaneseOperatorContainsPlugin","ElasticsearchQueryBuilderOperatorPlugin","name","isLocaleSupported","code","includes","toLowerCase","getOperator","apply","query","params","value","initialValue","basePath","normalizeValueWithAsterisk","must","push","multi_match","type","fields","should","exports"],"sources":["contains.ts"],"sourcesContent":["import { ElasticsearchQueryBuilderOperatorPlugin } from \"~/plugins/definition/ElasticsearchQueryBuilderOperatorPlugin\";\nimport { normalizeValueWithAsterisk } from \"~/normalize\";\nimport { ElasticsearchBoolQueryConfig, ElasticsearchQueryBuilderArgsPlugin } from \"~/types\";\n\nexport class ElasticsearchQueryBuilderJapaneseOperatorContainsPlugin extends ElasticsearchQueryBuilderOperatorPlugin {\n public override name = \"elasticsearch.queryBuilder.operator.contains.japanese\";\n\n public override isLocaleSupported(code: string): boolean {\n if (!code) {\n return false;\n }\n return [\"ja\", \"ja-jp\"].includes(code.toLowerCase());\n }\n\n public getOperator(): string {\n return \"contains\";\n }\n\n public apply(\n query: ElasticsearchBoolQueryConfig,\n params: ElasticsearchQueryBuilderArgsPlugin\n ): void {\n const { value: initialValue, basePath } = params;\n\n const value = normalizeValueWithAsterisk(initialValue);\n query.must.push({\n multi_match: {\n query: value,\n type: \"phrase\",\n fields: [`${basePath}.ngram`]\n }\n });\n query.should.push({\n multi_match: {\n query: value,\n type: \"phrase\",\n fields: [`${basePath}`]\n }\n });\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,wCAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAGO,MAAME,uDAAuD,SAASC,gFAAuC,CAAC;EACjGC,IAAI,GAAG,uDAAuD;EAE9DC,iBAAiBA,CAACC,IAAY,EAAW;IACrD,IAAI,CAACA,IAAI,EAAE;MACP,OAAO,KAAK;IAChB;IACA,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAACC,QAAQ,CAACD,IAAI,CAACE,WAAW,CAAC,CAAC,CAAC;EACvD;EAEOC,WAAWA,CAAA,EAAW;IACzB,OAAO,UAAU;EACrB;EAEOC,KAAKA,CACRC,KAAmC,EACnCC,MAA2C,EACvC;IACJ,MAAM;MAAEC,KAAK,EAAEC,YAAY;MAAEC;IAAS,CAAC,GAAGH,MAAM;IAEhD,MAAMC,KAAK,GAAG,IAAAG,qCAA0B,EAACF,YAAY,CAAC;IACtDH,KAAK,CAACM,IAAI,CAACC,IAAI,CAAC;MACZC,WAAW,EAAE;QACTR,KAAK,EAAEE,KAAK;QACZO,IAAI,EAAE,QAAQ;QACdC,MAAM,EAAE,CAAE,GAAEN,QAAS,QAAO;MAChC;IACJ,CAAC,CAAC;IACFJ,KAAK,CAACW,MAAM,CAACJ,IAAI,CAAC;MACdC,WAAW,EAAE;QACTR,KAAK,EAAEE,KAAK;QACZO,IAAI,EAAE,QAAQ;QACdC,MAAM,EAAE,CAAE,GAAEN,QAAS,EAAC;MAC1B;IACJ,CAAC,CAAC;EACN;AACJ;AAACQ,OAAA,CAAArB,uDAAA,GAAAA,uDAAA","ignoreList":[]}
|