@webiny/api-opensearch 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.eb81deee7e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client.js +30 -63
- package/client.js.map +1 -1
- package/cursors.js +20 -32
- package/cursors.js.map +1 -1
- package/exports/api/opensearch.d.ts +6 -1
- package/exports/api/opensearch.js +6 -3
- package/features/OpenSearchClient/abstraction.d.ts +3 -3
- package/features/OpenSearchClient/abstraction.js +2 -1
- package/features/OpenSearchClient/abstraction.js.map +1 -1
- package/features/OpenSearchClient/feature.d.ts +2 -1
- package/features/OpenSearchClient/feature.js +9 -6
- package/features/OpenSearchClient/feature.js.map +1 -1
- package/features/OpenSearchClientFactory/OpenSearchClientFactory.js +8 -9
- package/features/OpenSearchClientFactory/OpenSearchClientFactory.js.map +1 -1
- package/features/OpenSearchClientFactory/abstraction.js +2 -1
- package/features/OpenSearchClientFactory/abstraction.js.map +1 -1
- package/features/OpenSearchClientFactory/feature.js +6 -5
- package/features/OpenSearchClientFactory/feature.js.map +1 -1
- package/features/OpenSearchField/OpenSearchField.d.ts +18 -0
- package/features/OpenSearchField/OpenSearchField.js +49 -0
- package/features/OpenSearchField/OpenSearchField.js.map +1 -0
- package/features/OpenSearchField/OpenSearchFieldFactory.d.ts +9 -0
- package/features/OpenSearchField/OpenSearchFieldFactory.js +14 -0
- package/features/OpenSearchField/OpenSearchFieldFactory.js.map +1 -0
- package/features/OpenSearchField/abstractions/OpenSearchField.d.ts +35 -0
- package/features/OpenSearchField/abstractions/OpenSearchField.js +6 -0
- package/features/OpenSearchField/abstractions/OpenSearchField.js.map +1 -0
- package/features/OpenSearchField/abstractions/OpenSearchFieldFactory.d.ts +8 -0
- package/features/OpenSearchField/abstractions/OpenSearchFieldFactory.js +5 -0
- package/features/OpenSearchField/abstractions/OpenSearchFieldFactory.js.map +1 -0
- package/features/OpenSearchField/feature.d.ts +4 -0
- package/features/OpenSearchField/feature.js +11 -0
- package/features/OpenSearchField/feature.js.map +1 -0
- package/features/OpenSearchIndex/OpenSearchIndexRegistry.d.ts +12 -0
- package/features/OpenSearchIndex/OpenSearchIndexRegistry.js +30 -0
- package/features/OpenSearchIndex/OpenSearchIndexRegistry.js.map +1 -0
- package/features/OpenSearchIndex/abstractions/OpenSearchIndex.d.ts +9 -0
- package/features/OpenSearchIndex/abstractions/OpenSearchIndex.js +5 -0
- package/features/OpenSearchIndex/abstractions/OpenSearchIndex.js.map +1 -0
- package/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.d.ts +9 -0
- package/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js +5 -0
- package/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js.map +1 -0
- package/features/OpenSearchIndex/feature.d.ts +4 -0
- package/features/OpenSearchIndex/feature.js +11 -0
- package/features/OpenSearchIndex/feature.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.d.ts +12 -0
- package/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.js +28 -0
- package/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.d.ts +11 -0
- package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js +5 -0
- package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.d.ts +10 -0
- package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.js +5 -0
- package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/feature.d.ts +4 -0
- package/features/OpenSearchQueryBuilderOperator/feature.js +41 -0
- package/features/OpenSearchQueryBuilderOperator/feature.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/AndIn.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/AndIn.js +28 -0
- package/features/OpenSearchQueryBuilderOperator/operators/AndIn.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Between.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Between.js +27 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Between.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Contains.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Contains.js +27 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Contains.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Equal.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Equal.js +34 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Equal.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/GreaterThan.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/GreaterThan.js +23 -0
- package/features/OpenSearchQueryBuilderOperator/operators/GreaterThan.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/GreaterThanOrEqual.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/GreaterThanOrEqual.js +23 -0
- package/features/OpenSearchQueryBuilderOperator/operators/GreaterThanOrEqual.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/In.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/In.js +24 -0
- package/features/OpenSearchQueryBuilderOperator/operators/In.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/LesserThan.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/LesserThan.js +23 -0
- package/features/OpenSearchQueryBuilderOperator/operators/LesserThan.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.js +23 -0
- package/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Not.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Not.js +38 -0
- package/features/OpenSearchQueryBuilderOperator/operators/Not.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotBetween.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotBetween.js +27 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotBetween.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotContains.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotContains.js +27 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotContains.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotIn.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotIn.js +24 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotIn.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.js +22 -0
- package/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.js.map +1 -0
- package/features/OpenSearchQueryBuilderOperator/operators/StartsWith.d.ts +9 -0
- package/features/OpenSearchQueryBuilderOperator/operators/StartsWith.js +22 -0
- package/features/OpenSearchQueryBuilderOperator/operators/StartsWith.js.map +1 -0
- package/index.d.ts +2 -10
- package/index.js +3 -30
- package/indexConfiguration/base.js +25 -26
- package/indexConfiguration/base.js.map +1 -1
- package/indexConfiguration/common.js +39 -41
- package/indexConfiguration/common.js.map +1 -1
- package/indexConfiguration/index.js +0 -2
- package/indexPrefix.js +2 -3
- package/indexPrefix.js.map +1 -1
- package/indices.d.ts +2 -8
- package/indices.js +1 -20
- package/limit.js +5 -27
- package/limit.js.map +1 -1
- package/normalize.js +50 -49
- package/normalize.js.map +1 -1
- package/operations/OpenSearchCatHealth.js +24 -25
- package/operations/OpenSearchCatHealth.js.map +1 -1
- package/operations/OpenSearchCatNodes.js +22 -23
- package/operations/OpenSearchCatNodes.js.map +1 -1
- package/operations/index.js +0 -2
- package/operations/stripConnectionFromException.js +11 -14
- package/operations/stripConnectionFromException.js.map +1 -1
- package/operations/types.js +6 -5
- package/operations/types.js.map +1 -1
- package/package.json +12 -14
- package/registerOpenSearchCore.d.ts +3 -0
- package/registerOpenSearchCore.js +20 -0
- package/registerOpenSearchCore.js.map +1 -0
- package/sharedIndex.js +2 -3
- package/sharedIndex.js.map +1 -1
- package/sort.d.ts +2 -2
- package/sort.js +30 -59
- package/sort.js.map +1 -1
- package/testing/createBlankQuery.d.ts +2 -0
- package/testing/createBlankQuery.js +9 -0
- package/testing/createBlankQuery.js.map +1 -0
- package/testing/createTestOpenSearchClient.d.ts +11 -0
- package/testing/createTestOpenSearchClient.js +162 -0
- package/testing/createTestOpenSearchClient.js.map +1 -0
- package/testing/index.d.ts +4 -0
- package/testing/index.js +4 -0
- package/testing/registerOpenSearchCoreForTests.d.ts +1 -0
- package/testing/registerOpenSearchCoreForTests.js +9 -0
- package/testing/registerOpenSearchCoreForTests.js.map +1 -0
- package/testing/setupTestIndexManager.d.ts +13 -0
- package/testing/setupTestIndexManager.js +26 -0
- package/testing/setupTestIndexManager.js.map +1 -0
- package/types.d.ts +0 -8
- package/types.js +5 -65
- package/types.js.map +1 -1
- package/utils/createIndex.d.ts +2 -2
- package/utils/createIndex.js +52 -80
- package/utils/createIndex.js.map +1 -1
- package/utils/index.js +0 -2
- package/utils/waitUntilHealthy/UnhealthyClusterError.js +8 -7
- package/utils/waitUntilHealthy/UnhealthyClusterError.js.map +1 -1
- package/utils/waitUntilHealthy/WaitUntilHealthy.js +111 -141
- package/utils/waitUntilHealthy/WaitUntilHealthy.js.map +1 -1
- package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js +8 -7
- package/utils/waitUntilHealthy/WaitingHealthyClusterAbortedError.js.map +1 -1
- package/utils/waitUntilHealthy/index.js +0 -2
- package/utils/waitUntilHealthy/reason/ClusterHealthReason.js +9 -10
- package/utils/waitUntilHealthy/reason/ClusterHealthReason.js.map +1 -1
- package/utils/waitUntilHealthy/reason/IReason.js +0 -3
- package/utils/waitUntilHealthy/reason/MemoryReason.js +9 -10
- package/utils/waitUntilHealthy/reason/MemoryReason.js.map +1 -1
- package/utils/waitUntilHealthy/reason/ProcessorReason.js +9 -10
- package/utils/waitUntilHealthy/reason/ProcessorReason.js.map +1 -1
- package/utils/waitUntilHealthy/reason/index.js +0 -2
- package/where.d.ts +4 -4
- package/where.js +43 -76
- package/where.js.map +1 -1
- package/db/entity.d.ts +0 -7
- package/db/entity.js +0 -20
- package/db/entity.js.map +0 -1
- package/db/index.d.ts +0 -3
- package/db/index.js +0 -5
- package/db/index.js.map +0 -1
- package/db/table.d.ts +0 -7
- package/db/table.js +0 -17
- package/db/table.js.map +0 -1
- package/db/types.d.ts +0 -6
- package/db/types.js +0 -3
- package/db/types.js.map +0 -1
- package/exports/api/opensearch.js.map +0 -1
- package/features/OpenSearchClient/OpenSearchClient.d.ts +0 -12
- package/features/OpenSearchClient/OpenSearchClient.js +0 -16
- package/features/OpenSearchClient/OpenSearchClient.js.map +0 -1
- package/features/OpenSearchContext/OpenSearchContext.d.ts +0 -8
- package/features/OpenSearchContext/OpenSearchContext.js +0 -13
- package/features/OpenSearchContext/OpenSearchContext.js.map +0 -1
- package/features/OpenSearchContext/abstraction.d.ts +0 -14
- package/features/OpenSearchContext/abstraction.js +0 -4
- package/features/OpenSearchContext/abstraction.js.map +0 -1
- package/features/OpenSearchContext/feature.d.ts +0 -5
- package/features/OpenSearchContext/feature.js +0 -13
- package/features/OpenSearchContext/feature.js.map +0 -1
- package/index.js.map +0 -1
- package/indexConfiguration/index.js.map +0 -1
- package/indices.js.map +0 -1
- package/operations/index.js.map +0 -1
- package/operators.d.ts +0 -6
- package/operators.js +0 -9
- package/operators.js.map +0 -1
- package/plugins/definition/OpenSearchBodyModifierPlugin.d.ts +0 -13
- package/plugins/definition/OpenSearchBodyModifierPlugin.js +0 -18
- package/plugins/definition/OpenSearchBodyModifierPlugin.js.map +0 -1
- package/plugins/definition/OpenSearchFieldPlugin.d.ts +0 -81
- package/plugins/definition/OpenSearchFieldPlugin.js +0 -69
- package/plugins/definition/OpenSearchFieldPlugin.js.map +0 -1
- package/plugins/definition/OpenSearchIndexPlugin.d.ts +0 -10
- package/plugins/definition/OpenSearchIndexPlugin.js +0 -17
- package/plugins/definition/OpenSearchIndexPlugin.js.map +0 -1
- package/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.d.ts +0 -10
- package/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js +0 -9
- package/plugins/definition/OpenSearchQueryBuilderOperatorPlugin.js.map +0 -1
- package/plugins/definition/OpenSearchQueryModifierPlugin.d.ts +0 -14
- package/plugins/definition/OpenSearchQueryModifierPlugin.js +0 -18
- package/plugins/definition/OpenSearchQueryModifierPlugin.js.map +0 -1
- package/plugins/definition/OpenSearchSortModifierPlugin.d.ts +0 -13
- package/plugins/definition/OpenSearchSortModifierPlugin.js +0 -18
- package/plugins/definition/OpenSearchSortModifierPlugin.js.map +0 -1
- package/plugins/definition/index.d.ts +0 -6
- package/plugins/definition/index.js +0 -8
- package/plugins/definition/index.js.map +0 -1
- package/plugins/index.d.ts +0 -2
- package/plugins/index.js +0 -4
- package/plugins/index.js.map +0 -1
- package/plugins/operator/andIn.d.ts +0 -7
- package/plugins/operator/andIn.js +0 -35
- package/plugins/operator/andIn.js.map +0 -1
- package/plugins/operator/between.d.ts +0 -7
- package/plugins/operator/between.js +0 -32
- package/plugins/operator/between.js.map +0 -1
- package/plugins/operator/contains.d.ts +0 -7
- package/plugins/operator/contains.js +0 -24
- package/plugins/operator/contains.js.map +0 -1
- package/plugins/operator/equal.d.ts +0 -7
- package/plugins/operator/equal.js +0 -50
- package/plugins/operator/equal.js.map +0 -1
- package/plugins/operator/gt.d.ts +0 -7
- package/plugins/operator/gt.js +0 -22
- package/plugins/operator/gt.js.map +0 -1
- package/plugins/operator/gte.d.ts +0 -7
- package/plugins/operator/gte.js +0 -22
- package/plugins/operator/gte.js.map +0 -1
- package/plugins/operator/in.d.ts +0 -7
- package/plugins/operator/in.js +0 -29
- package/plugins/operator/in.js.map +0 -1
- package/plugins/operator/index.d.ts +0 -15
- package/plugins/operator/index.js +0 -17
- package/plugins/operator/index.js.map +0 -1
- package/plugins/operator/lt.d.ts +0 -7
- package/plugins/operator/lt.js +0 -22
- package/plugins/operator/lt.js.map +0 -1
- package/plugins/operator/lte.d.ts +0 -7
- package/plugins/operator/lte.js +0 -22
- package/plugins/operator/lte.js.map +0 -1
- package/plugins/operator/not.d.ts +0 -7
- package/plugins/operator/not.js +0 -44
- package/plugins/operator/not.js.map +0 -1
- package/plugins/operator/notBetween.d.ts +0 -7
- package/plugins/operator/notBetween.js +0 -32
- package/plugins/operator/notBetween.js.map +0 -1
- package/plugins/operator/notContains.d.ts +0 -7
- package/plugins/operator/notContains.js +0 -24
- package/plugins/operator/notContains.js.map +0 -1
- package/plugins/operator/notIn.d.ts +0 -7
- package/plugins/operator/notIn.js +0 -27
- package/plugins/operator/notIn.js.map +0 -1
- package/plugins/operator/notStartsWith.d.ts +0 -7
- package/plugins/operator/notStartsWith.js +0 -23
- package/plugins/operator/notStartsWith.js.map +0 -1
- package/plugins/operator/startsWith.d.ts +0 -7
- package/plugins/operator/startsWith.js +0 -23
- package/plugins/operator/startsWith.js.map +0 -1
- package/utils/index.js.map +0 -1
- package/utils/waitUntilHealthy/index.js.map +0 -1
- package/utils/waitUntilHealthy/reason/IReason.js.map +0 -1
- package/utils/waitUntilHealthy/reason/index.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
class LesserThanImpl {
|
|
3
|
+
getOperator() {
|
|
4
|
+
return "lt";
|
|
5
|
+
}
|
|
6
|
+
apply(query, params) {
|
|
7
|
+
const { value, basePath } = params;
|
|
8
|
+
query.filter.push({
|
|
9
|
+
range: {
|
|
10
|
+
[basePath]: {
|
|
11
|
+
lt: value
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const LesserThan = OpenSearchQueryBuilderOperator.createImplementation({
|
|
18
|
+
implementation: LesserThanImpl,
|
|
19
|
+
dependencies: []
|
|
20
|
+
});
|
|
21
|
+
export { LesserThan };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=LesserThan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/LesserThan.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/LesserThan.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass LesserThanImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"lt\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, basePath } = params;\n query.filter.push({\n range: {\n [basePath]: {\n lt: value\n }\n }\n });\n }\n}\n\nexport const LesserThan = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: LesserThanImpl,\n dependencies: []\n});\n"],"names":["LesserThanImpl","query","params","value","basePath","LesserThan","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5BD,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,OAAO;gBACH,CAACG,SAAS,EAAE;oBACR,IAAID;gBACR;YACJ;QACJ;IACJ;AACJ;AAEO,MAAME,aAAaC,+BAA+B,oBAAoB,CAAC;IAC1E,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
declare class LesserThanOrEqualImpl implements OpenSearchQueryBuilderOperator.Interface {
|
|
3
|
+
getOperator(): string;
|
|
4
|
+
apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const LesserThanOrEqual: typeof LesserThanOrEqualImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
class LesserThanOrEqualImpl {
|
|
3
|
+
getOperator() {
|
|
4
|
+
return "lte";
|
|
5
|
+
}
|
|
6
|
+
apply(query, params) {
|
|
7
|
+
const { value, basePath } = params;
|
|
8
|
+
query.filter.push({
|
|
9
|
+
range: {
|
|
10
|
+
[basePath]: {
|
|
11
|
+
lte: value
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const LesserThanOrEqual = OpenSearchQueryBuilderOperator.createImplementation({
|
|
18
|
+
implementation: LesserThanOrEqualImpl,
|
|
19
|
+
dependencies: []
|
|
20
|
+
});
|
|
21
|
+
export { LesserThanOrEqual };
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=LesserThanOrEqual.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/LesserThanOrEqual.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass LesserThanOrEqualImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"lte\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, basePath } = params;\n query.filter.push({\n range: {\n [basePath]: {\n lte: value\n }\n }\n });\n }\n}\n\nexport const LesserThanOrEqual = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: LesserThanOrEqualImpl,\n dependencies: []\n});\n"],"names":["LesserThanOrEqualImpl","query","params","value","basePath","LesserThanOrEqual","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5BD,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,OAAO;gBACH,CAACG,SAAS,EAAE;oBACR,KAAKD;gBACT;YACJ;QACJ;IACJ;AACJ;AAEO,MAAME,oBAAoBC,+BAA+B,oBAAoB,CAAC;IACjF,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
declare class NotImpl implements OpenSearchQueryBuilderOperator.Interface {
|
|
3
|
+
getOperator(): string;
|
|
4
|
+
apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const Not: typeof NotImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
class NotImpl {
|
|
3
|
+
getOperator() {
|
|
4
|
+
return "not";
|
|
5
|
+
}
|
|
6
|
+
apply(query, params) {
|
|
7
|
+
const { value, path, basePath } = params;
|
|
8
|
+
if (null == value) return void query.filter.push({
|
|
9
|
+
exists: {
|
|
10
|
+
field: path
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
const typeOf = typeof value;
|
|
14
|
+
if ("boolean" === typeOf) return void query.filter.push({
|
|
15
|
+
bool: {
|
|
16
|
+
must_not: {
|
|
17
|
+
term: {
|
|
18
|
+
[path]: value
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const useBasePath = "string" !== typeOf;
|
|
24
|
+
const valuePath = useBasePath ? basePath : path;
|
|
25
|
+
query.must_not.push({
|
|
26
|
+
term: {
|
|
27
|
+
[valuePath]: value
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const Not = OpenSearchQueryBuilderOperator.createImplementation({
|
|
33
|
+
implementation: NotImpl,
|
|
34
|
+
dependencies: []
|
|
35
|
+
});
|
|
36
|
+
export { Not };
|
|
37
|
+
|
|
38
|
+
//# sourceMappingURL=Not.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/Not.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/Not.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, path, basePath } = params;\n\n if (value === null || value === undefined) {\n query.filter.push({\n exists: {\n field: path\n }\n });\n return;\n }\n\n const typeOf = typeof value;\n\n if (typeOf === \"boolean\") {\n query.filter.push({\n bool: {\n must_not: {\n term: {\n [path]: value\n }\n }\n }\n });\n return;\n }\n\n const useBasePath = typeOf !== \"string\";\n const valuePath = useBasePath ? basePath : path;\n query.must_not.push({\n term: {\n [valuePath]: value\n }\n });\n }\n}\n\nexport const Not = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotImpl,\n dependencies: []\n});\n"],"names":["NotImpl","query","params","value","path","basePath","typeOf","useBasePath","valuePath","Not","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGH;QAElC,IAAIC,QAAAA,OAAuC,YACvCF,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,QAAQ;gBACJ,OAAOG;YACX;QACJ;QAIJ,MAAME,SAAS,OAAOH;QAEtB,IAAIG,AAAW,cAAXA,QAAsB,YACtBL,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,MAAM;gBACF,UAAU;oBACN,MAAM;wBACF,CAACG,KAAK,EAAED;oBACZ;gBACJ;YACJ;QACJ;QAIJ,MAAMI,cAAcD,AAAW,aAAXA;QACpB,MAAME,YAAYD,cAAcF,WAAWD;QAC3CH,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,MAAM;gBACF,CAACO,UAAU,EAAEL;YACjB;QACJ;IACJ;AACJ;AAEO,MAAMM,MAAMC,+BAA+B,oBAAoB,CAAC;IACnE,gBAAgBV;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
declare class NotBetweenImpl implements OpenSearchQueryBuilderOperator.Interface {
|
|
3
|
+
getOperator(): string;
|
|
4
|
+
apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const NotBetween: typeof NotBetweenImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
class NotBetweenImpl {
|
|
3
|
+
getOperator() {
|
|
4
|
+
return "not_between";
|
|
5
|
+
}
|
|
6
|
+
apply(query, params) {
|
|
7
|
+
const { value, basePath, name } = params;
|
|
8
|
+
if (false === Array.isArray(value)) throw new Error(`You cannot filter field path "${name}" with "not_between" query and not send an array of values.`);
|
|
9
|
+
if (2 !== value.length) throw new Error(`You must pass 2 values in the array for field path "${name}" filtering.`);
|
|
10
|
+
const [gte, lte] = value;
|
|
11
|
+
query.must_not.push({
|
|
12
|
+
range: {
|
|
13
|
+
[basePath]: {
|
|
14
|
+
lte,
|
|
15
|
+
gte
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const NotBetween = OpenSearchQueryBuilderOperator.createImplementation({
|
|
22
|
+
implementation: NotBetweenImpl,
|
|
23
|
+
dependencies: []
|
|
24
|
+
});
|
|
25
|
+
export { NotBetween };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=NotBetween.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/NotBetween.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/NotBetween.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotBetweenImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not_between\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, basePath, name } = params;\n if (Array.isArray(value) === false) {\n throw new Error(\n `You cannot filter field path \"${name}\" with \"not_between\" query and not send an array of values.`\n );\n } else if (value.length !== 2) {\n throw new Error(\n `You must pass 2 values in the array for field path \"${name}\" filtering.`\n );\n }\n const [gte, lte] = value;\n query.must_not.push({\n range: {\n [basePath]: {\n lte,\n gte\n }\n }\n });\n }\n}\n\nexport const NotBetween = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotBetweenImpl,\n dependencies: []\n});\n"],"names":["NotBetweenImpl","query","params","value","basePath","name","Array","Error","gte","lte","NotBetween","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGH;QAClC,IAAII,AAAyB,UAAzBA,MAAM,OAAO,CAACH,QACd,MAAM,IAAII,MACN,CAAC,8BAA8B,EAAEF,KAAK,2DAA2D,CAAC;QAEnG,IAAIF,AAAiB,MAAjBA,MAAM,MAAM,EACnB,MAAM,IAAII,MACN,CAAC,oDAAoD,EAAEF,KAAK,YAAY,CAAC;QAGjF,MAAM,CAACG,KAAKC,IAAI,GAAGN;QACnBF,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,OAAO;gBACH,CAACG,SAAS,EAAE;oBACRK;oBACAD;gBACJ;YACJ;QACJ;IACJ;AACJ;AAEO,MAAME,aAAaC,+BAA+B,oBAAoB,CAAC;IAC1E,gBAAgBX;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
declare class NotContainsImpl implements OpenSearchQueryBuilderOperator.Interface {
|
|
3
|
+
getOperator(): string;
|
|
4
|
+
apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const NotContains: typeof NotContainsImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { normalizeValueWithAsterisk } from "../../../normalize.js";
|
|
2
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
3
|
+
class NotContainsImpl {
|
|
4
|
+
getOperator() {
|
|
5
|
+
return "not_contains";
|
|
6
|
+
}
|
|
7
|
+
apply(query, params) {
|
|
8
|
+
const { value, basePath } = params;
|
|
9
|
+
query.must_not.push({
|
|
10
|
+
query_string: {
|
|
11
|
+
allow_leading_wildcard: true,
|
|
12
|
+
fields: [
|
|
13
|
+
basePath
|
|
14
|
+
],
|
|
15
|
+
query: normalizeValueWithAsterisk(value),
|
|
16
|
+
default_operator: "and"
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
const NotContains = OpenSearchQueryBuilderOperator.createImplementation({
|
|
22
|
+
implementation: NotContainsImpl,
|
|
23
|
+
dependencies: []
|
|
24
|
+
});
|
|
25
|
+
export { NotContains };
|
|
26
|
+
|
|
27
|
+
//# sourceMappingURL=NotContains.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/NotContains.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/NotContains.ts"],"sourcesContent":["import { normalizeValueWithAsterisk } from \"~/normalize.js\";\nimport { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotContainsImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not_contains\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, basePath } = params;\n query.must_not.push({\n query_string: {\n allow_leading_wildcard: true,\n fields: [basePath],\n query: normalizeValueWithAsterisk(value),\n default_operator: \"and\"\n }\n });\n }\n}\n\nexport const NotContains = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotContainsImpl,\n dependencies: []\n});\n"],"names":["NotContainsImpl","query","params","value","basePath","normalizeValueWithAsterisk","NotContains","OpenSearchQueryBuilderOperator"],"mappings":";;AAGA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5BD,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,cAAc;gBACV,wBAAwB;gBACxB,QAAQ;oBAACG;iBAAS;gBAClB,OAAOC,2BAA2BF;gBAClC,kBAAkB;YACtB;QACJ;IACJ;AACJ;AAEO,MAAMG,cAAcC,+BAA+B,oBAAoB,CAAC;IAC3E,gBAAgBP;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
declare class NotInImpl implements OpenSearchQueryBuilderOperator.Interface {
|
|
3
|
+
getOperator(): string;
|
|
4
|
+
apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const NotIn: typeof NotInImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
class NotInImpl {
|
|
3
|
+
getOperator() {
|
|
4
|
+
return "not_in";
|
|
5
|
+
}
|
|
6
|
+
apply(query, params) {
|
|
7
|
+
const { value: values, path, basePath, name } = params;
|
|
8
|
+
const isArray = Array.isArray(values);
|
|
9
|
+
if (false === isArray || 0 === values.length) throw new Error(`You cannot filter field "${name}" with "not_in" operator and not send an array of values.`);
|
|
10
|
+
const useBasePath = values.some((value)=>"string" != typeof value);
|
|
11
|
+
query.must_not.push({
|
|
12
|
+
terms: {
|
|
13
|
+
[useBasePath ? basePath : path]: values
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
const NotIn = OpenSearchQueryBuilderOperator.createImplementation({
|
|
19
|
+
implementation: NotInImpl,
|
|
20
|
+
dependencies: []
|
|
21
|
+
});
|
|
22
|
+
export { NotIn };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=NotIn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/NotIn.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/NotIn.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotInImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not_in\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value: values, path, basePath, name } = params;\n const isArray = Array.isArray(values);\n if (isArray === false || values.length === 0) {\n throw new Error(\n `You cannot filter field \"${name}\" with \"not_in\" operator and not send an array of values.`\n );\n }\n\n const useBasePath = values.some(\n (value: string | number | boolean | null | undefined) => typeof value !== \"string\"\n );\n\n query.must_not.push({\n terms: {\n [useBasePath ? basePath : path]: values\n }\n });\n }\n}\n\nexport const NotIn = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotInImpl,\n dependencies: []\n});\n"],"names":["NotInImpl","query","params","values","path","basePath","name","isArray","Array","Error","useBasePath","value","NotIn","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAE,OAAOC,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAEC,IAAI,EAAE,GAAGJ;QAChD,MAAMK,UAAUC,MAAM,OAAO,CAACL;QAC9B,IAAII,AAAY,UAAZA,WAAqBJ,AAAkB,MAAlBA,OAAO,MAAM,EAClC,MAAM,IAAIM,MACN,CAAC,yBAAyB,EAAEH,KAAK,yDAAyD,CAAC;QAInG,MAAMI,cAAcP,OAAO,IAAI,CAC3B,CAACQ,QAAwD,AAAiB,YAAjB,OAAOA;QAGpEV,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,OAAO;gBACH,CAACS,cAAcL,WAAWD,KAAK,EAAED;YACrC;QACJ;IACJ;AACJ;AAEO,MAAMS,QAAQC,+BAA+B,oBAAoB,CAAC;IACrE,gBAAgBb;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
declare class NotStartsWithImpl implements OpenSearchQueryBuilderOperator.Interface {
|
|
3
|
+
getOperator(): string;
|
|
4
|
+
apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const NotStartsWith: typeof NotStartsWithImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
class NotStartsWithImpl {
|
|
3
|
+
getOperator() {
|
|
4
|
+
return "not_startsWith";
|
|
5
|
+
}
|
|
6
|
+
apply(query, params) {
|
|
7
|
+
const { value, basePath } = params;
|
|
8
|
+
if ("" === value || null == value) return;
|
|
9
|
+
query.must_not.push({
|
|
10
|
+
match_phrase_prefix: {
|
|
11
|
+
[basePath]: value
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const NotStartsWith = OpenSearchQueryBuilderOperator.createImplementation({
|
|
17
|
+
implementation: NotStartsWithImpl,
|
|
18
|
+
dependencies: []
|
|
19
|
+
});
|
|
20
|
+
export { NotStartsWith };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=NotStartsWith.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/NotStartsWith.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass NotStartsWithImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"not_startsWith\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, basePath } = params;\n if (value === \"\" || value === null || value === undefined) {\n return;\n }\n query.must_not.push({\n match_phrase_prefix: {\n [basePath]: value\n }\n });\n }\n}\n\nexport const NotStartsWith = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: NotStartsWithImpl,\n dependencies: []\n});\n"],"names":["NotStartsWithImpl","query","params","value","basePath","NotStartsWith","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5B,IAAIC,AAAU,OAAVA,SAAkCA,QAAlBA,OAChB;QAEJF,MAAM,QAAQ,CAAC,IAAI,CAAC;YAChB,qBAAqB;gBACjB,CAACG,SAAS,EAAED;YAChB;QACJ;IACJ;AACJ;AAEO,MAAME,gBAAgBC,+BAA+B,oBAAoB,CAAC;IAC7E,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
declare class StartsWithImpl implements OpenSearchQueryBuilderOperator.Interface {
|
|
3
|
+
getOperator(): string;
|
|
4
|
+
apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const StartsWith: typeof StartsWithImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
class StartsWithImpl {
|
|
3
|
+
getOperator() {
|
|
4
|
+
return "startsWith";
|
|
5
|
+
}
|
|
6
|
+
apply(query, params) {
|
|
7
|
+
const { value, basePath } = params;
|
|
8
|
+
if ("" === value || null == value) return;
|
|
9
|
+
query.filter.push({
|
|
10
|
+
match_phrase_prefix: {
|
|
11
|
+
[basePath]: value
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
const StartsWith = OpenSearchQueryBuilderOperator.createImplementation({
|
|
17
|
+
implementation: StartsWithImpl,
|
|
18
|
+
dependencies: []
|
|
19
|
+
});
|
|
20
|
+
export { StartsWith };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=StartsWith.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/operators/StartsWith.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/operators/StartsWith.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"../abstractions/OpenSearchQueryBuilderOperator.js\";\n\nclass StartsWithImpl implements OpenSearchQueryBuilderOperator.Interface {\n public getOperator(): string {\n return \"startsWith\";\n }\n\n public apply(\n query: OpenSearchQueryBuilderOperator.Query,\n params: OpenSearchQueryBuilderOperator.Params\n ): void {\n const { value, basePath } = params;\n if (value === \"\" || value === null || value === undefined) {\n return;\n }\n query.filter.push({\n match_phrase_prefix: {\n [basePath]: value\n }\n });\n }\n}\n\nexport const StartsWith = OpenSearchQueryBuilderOperator.createImplementation({\n implementation: StartsWithImpl,\n dependencies: []\n});\n"],"names":["StartsWithImpl","query","params","value","basePath","StartsWith","OpenSearchQueryBuilderOperator"],"mappings":";AAEA,MAAMA;IACK,cAAsB;QACzB,OAAO;IACX;IAEO,MACHC,KAA2C,EAC3CC,MAA6C,EACzC;QACJ,MAAM,EAAEC,KAAK,EAAEC,QAAQ,EAAE,GAAGF;QAC5B,IAAIC,AAAU,OAAVA,SAAkCA,QAAlBA,OAChB;QAEJF,MAAM,MAAM,CAAC,IAAI,CAAC;YACd,qBAAqB;gBACjB,CAACG,SAAS,EAAED;YAChB;QACJ;IACJ;AACJ;AAEO,MAAME,aAAaC,+BAA+B,oBAAoB,CAAC;IAC1E,gBAAgBN;IAChB,cAAc,EAAE;AACpB"}
|
package/index.d.ts
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import type { OpenSearchClientOptions } from "./client.js";
|
|
4
|
-
import { Client } from "./client.js";
|
|
5
|
-
export * from "./indexConfiguration/index.js";
|
|
6
|
-
export * from "./plugins/index.js";
|
|
1
|
+
export { registerOpenSearchCore } from "./registerOpenSearchCore.js";
|
|
2
|
+
export { getCommonMappings, getBaseConfiguration } from "./indexConfiguration/index.js";
|
|
7
3
|
export * from "./sort.js";
|
|
8
|
-
export * from "./indices.js";
|
|
9
4
|
export * from "./where.js";
|
|
10
5
|
export * from "./limit.js";
|
|
11
6
|
export * from "./normalize.js";
|
|
12
|
-
export * from "./operators.js";
|
|
13
7
|
export * from "./cursors.js";
|
|
14
8
|
export { createOpenSearchClient, type Client, type ClientOptions, type OpenSearchClientOptions } from "./client.js";
|
|
15
9
|
export * from "./utils/index.js";
|
|
16
10
|
export * from "./operations/index.js";
|
|
17
11
|
export * from "./sharedIndex.js";
|
|
18
12
|
export * from "./indexPrefix.js";
|
|
19
|
-
export * from "./db/index.js";
|
|
20
13
|
export * from "./types.js";
|
|
21
|
-
export declare const createOpenSearchContext: (params: OpenSearchClientOptions | Client) => ContextPlugin<OpenSearchContext>;
|
package/index.js
CHANGED
|
@@ -1,40 +1,13 @@
|
|
|
1
|
-
import { ContextPlugin } from "@webiny/api";
|
|
2
|
-
import { Client, createOpenSearchClient } from "./client.js";
|
|
3
|
-
import { getOpenSearchOperators } from "./operators.js";
|
|
4
|
-
import { OpenSearchClientFactoryFeature } from "./features/OpenSearchClientFactory/feature.js";
|
|
5
|
-
import { OpenSearchClientFeature } from "./features/OpenSearchClient/feature.js";
|
|
6
|
-
import { OpenSearchContextFeature } from "./features/OpenSearchContext/feature.js";
|
|
7
|
-
export * from "./indexConfiguration/index.js";
|
|
8
|
-
export * from "./plugins/index.js";
|
|
9
1
|
export * from "./sort.js";
|
|
10
|
-
export * from "./indices.js";
|
|
11
2
|
export * from "./where.js";
|
|
12
3
|
export * from "./limit.js";
|
|
13
4
|
export * from "./normalize.js";
|
|
14
|
-
export * from "./operators.js";
|
|
15
5
|
export * from "./cursors.js";
|
|
16
|
-
export { createOpenSearchClient } from "./client.js";
|
|
17
6
|
export * from "./utils/index.js";
|
|
18
7
|
export * from "./operations/index.js";
|
|
19
8
|
export * from "./sharedIndex.js";
|
|
20
9
|
export * from "./indexPrefix.js";
|
|
21
|
-
export * from "./db/index.js";
|
|
22
10
|
export * from "./types.js";
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
throw new Error("OpenSearch context must not be loaded more than once!");
|
|
27
|
-
}
|
|
28
|
-
const client = params instanceof Client ? params : createOpenSearchClient(params);
|
|
29
|
-
context.opensearch = client;
|
|
30
|
-
context.elasticsearch = client;
|
|
31
|
-
context.plugins.register(getOpenSearchOperators());
|
|
32
|
-
OpenSearchContextFeature.register(context.container, context);
|
|
33
|
-
OpenSearchClientFeature.register(context.container);
|
|
34
|
-
OpenSearchClientFactoryFeature.register(context.container);
|
|
35
|
-
});
|
|
36
|
-
plugin.name = "context.opensearch";
|
|
37
|
-
return plugin;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
//# sourceMappingURL=index.js.map
|
|
11
|
+
export { registerOpenSearchCore } from "./registerOpenSearchCore.js";
|
|
12
|
+
export { getBaseConfiguration, getCommonMappings } from "./indexConfiguration/index.js";
|
|
13
|
+
export { createOpenSearchClient } from "./client.js";
|
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import { getCommonMappings } from "./common.js";
|
|
2
2
|
const config = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
mappings: {
|
|
4
|
+
dynamic_templates: getCommonMappings((mappings)=>mappings.concat([
|
|
5
|
+
{
|
|
6
|
+
strings: {
|
|
7
|
+
match_mapping_type: "string",
|
|
8
|
+
mapping: {
|
|
9
|
+
type: "text",
|
|
10
|
+
fields: {
|
|
11
|
+
keyword: {
|
|
12
|
+
type: "keyword",
|
|
13
|
+
ignore_above: 256
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
])),
|
|
20
|
+
properties: {
|
|
21
|
+
rawValues: {
|
|
22
|
+
type: "object",
|
|
23
|
+
enabled: false
|
|
15
24
|
}
|
|
16
|
-
}
|
|
17
25
|
}
|
|
18
|
-
}]);
|
|
19
|
-
}),
|
|
20
|
-
properties: {
|
|
21
|
-
rawValues: {
|
|
22
|
-
type: "object",
|
|
23
|
-
enabled: false
|
|
24
|
-
}
|
|
25
26
|
}
|
|
26
|
-
}
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return config;
|
|
31
|
-
}
|
|
32
|
-
return modifier(config);
|
|
28
|
+
const getBaseConfiguration = (modifier)=>{
|
|
29
|
+
if (!modifier) return config;
|
|
30
|
+
return modifier(config);
|
|
33
31
|
};
|
|
32
|
+
export { getBaseConfiguration };
|
|
34
33
|
|
|
35
34
|
//# sourceMappingURL=base.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"indexConfiguration/base.js","sources":["../../src/indexConfiguration/base.ts"],"sourcesContent":["import type { OpenSearchIndexRequestBody } from \"~/types.js\";\nimport { getCommonMappings } from \"./common.js\";\n\nconst config: OpenSearchIndexRequestBody = {\n mappings: {\n dynamic_templates: getCommonMappings(mappings => {\n return mappings.concat([\n {\n strings: {\n match_mapping_type: \"string\",\n mapping: {\n type: \"text\",\n fields: {\n keyword: {\n type: \"keyword\",\n ignore_above: 256\n }\n }\n }\n }\n }\n ]);\n }),\n properties: {\n rawValues: {\n type: \"object\",\n enabled: false\n }\n }\n }\n};\n\ninterface Modifier {\n (config: OpenSearchIndexRequestBody): OpenSearchIndexRequestBody;\n}\nexport const getBaseConfiguration = (modifier?: Modifier) => {\n if (!modifier) {\n return config;\n }\n return modifier(config);\n};\n"],"names":["config","getCommonMappings","mappings","getBaseConfiguration","modifier"],"mappings":";AAGA,MAAMA,SAAqC;IACvC,UAAU;QACN,mBAAmBC,kBAAkBC,CAAAA,WAC1BA,SAAS,MAAM,CAAC;gBACnB;oBACI,SAAS;wBACL,oBAAoB;wBACpB,SAAS;4BACL,MAAM;4BACN,QAAQ;gCACJ,SAAS;oCACL,MAAM;oCACN,cAAc;gCAClB;4BACJ;wBACJ;oBACJ;gBACJ;aACH;QAEL,YAAY;YACR,WAAW;gBACP,MAAM;gBACN,SAAS;YACb;QACJ;IACJ;AACJ;AAKO,MAAMC,uBAAuB,CAACC;IACjC,IAAI,CAACA,UACD,OAAOJ;IAEX,OAAOI,SAASJ;AACpB"}
|
|
@@ -1,44 +1,42 @@
|
|
|
1
|
-
const getDefaultMappings = ()
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
return getDefaultMappings();
|
|
40
|
-
}
|
|
41
|
-
return cb(getDefaultMappings());
|
|
1
|
+
const getDefaultMappings = ()=>[
|
|
2
|
+
{
|
|
3
|
+
ids: {
|
|
4
|
+
match: "^id|entryId$",
|
|
5
|
+
mapping: {
|
|
6
|
+
type: "keyword"
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
dates: {
|
|
12
|
+
match: "^createdOn|savedOn|publishedOn$",
|
|
13
|
+
mapping: {
|
|
14
|
+
type: "date"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
numbers: {
|
|
20
|
+
match: "number@*",
|
|
21
|
+
mapping: {
|
|
22
|
+
type: "scaled_float",
|
|
23
|
+
scaling_factor: 10000
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
booleans: {
|
|
29
|
+
match: "boolean@*",
|
|
30
|
+
mapping: {
|
|
31
|
+
type: "boolean"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
const getCommonMappings = (cb)=>{
|
|
37
|
+
if (!cb) return getDefaultMappings();
|
|
38
|
+
return cb(getDefaultMappings());
|
|
42
39
|
};
|
|
40
|
+
export { getCommonMappings };
|
|
43
41
|
|
|
44
42
|
//# sourceMappingURL=common.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"indexConfiguration/common.js","sources":["../../src/indexConfiguration/common.ts"],"sourcesContent":["import type { OpenSearchIndexRequestBodyMappingsDynamicTemplate } from \"~/types.js\";\n\nconst getDefaultMappings = (): OpenSearchIndexRequestBodyMappingsDynamicTemplate[] => {\n return [\n {\n ids: {\n match: \"^id|entryId$\",\n mapping: {\n type: \"keyword\"\n }\n }\n },\n {\n /* Update with the correct date fields. */\n dates: {\n match: \"^createdOn|savedOn|publishedOn$\",\n mapping: {\n type: \"date\"\n }\n }\n },\n {\n numbers: {\n match: \"number@*\",\n mapping: {\n type: \"scaled_float\",\n scaling_factor: 10000\n }\n }\n },\n {\n booleans: {\n match: \"boolean@*\",\n mapping: {\n type: \"boolean\"\n }\n }\n }\n ];\n};\n\ninterface Modifier {\n (\n mappings: OpenSearchIndexRequestBodyMappingsDynamicTemplate[]\n ): OpenSearchIndexRequestBodyMappingsDynamicTemplate[];\n}\n/**\n * @internal\n */\nexport const getCommonMappings = (\n cb?: Modifier\n): OpenSearchIndexRequestBodyMappingsDynamicTemplate[] => {\n if (!cb) {\n return getDefaultMappings();\n }\n\n return cb(getDefaultMappings());\n};\n"],"names":["getDefaultMappings","getCommonMappings","cb"],"mappings":"AAEA,MAAMA,qBAAqB,IAChB;QACH;YACI,KAAK;gBACD,OAAO;gBACP,SAAS;oBACL,MAAM;gBACV;YACJ;QACJ;QACA;YAEI,OAAO;gBACH,OAAO;gBACP,SAAS;oBACL,MAAM;gBACV;YACJ;QACJ;QACA;YACI,SAAS;gBACL,OAAO;gBACP,SAAS;oBACL,MAAM;oBACN,gBAAgB;gBACpB;YACJ;QACJ;QACA;YACI,UAAU;gBACN,OAAO;gBACP,SAAS;oBACL,MAAM;gBACV;YACJ;QACJ;KACH;AAWE,MAAMC,oBAAoB,CAC7BC;IAEA,IAAI,CAACA,IACD,OAAOF;IAGX,OAAOE,GAAGF;AACd"}
|
package/indexPrefix.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
};
|
|
1
|
+
const getOpenSearchIndexPrefix = ()=>process.env.OPENSEARCH_INDEX_PREFIX || process.env.ELASTICSEARCH_INDEX_PREFIX || process.env.WEBINY_OPENSEARCH_INDEX_PREFIX || process.env.WEBINY_ELASTICSEARCH_INDEX_PREFIX || "";
|
|
2
|
+
export { getOpenSearchIndexPrefix };
|
|
4
3
|
|
|
5
4
|
//# sourceMappingURL=indexPrefix.js.map
|
package/indexPrefix.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"indexPrefix.js","sources":["../src/indexPrefix.ts"],"sourcesContent":["export const getOpenSearchIndexPrefix = (): string => {\n return (\n process.env.OPENSEARCH_INDEX_PREFIX ||\n process.env.ELASTICSEARCH_INDEX_PREFIX ||\n process.env.WEBINY_OPENSEARCH_INDEX_PREFIX ||\n process.env.WEBINY_ELASTICSEARCH_INDEX_PREFIX ||\n \"\"\n );\n};\n"],"names":["getOpenSearchIndexPrefix","process"],"mappings":"AAAO,MAAMA,2BAA2B,IAEhCC,QAAQ,GAAG,CAAC,uBAAuB,IACnCA,QAAQ,GAAG,CAAC,0BAA0B,IACtCA,QAAQ,GAAG,CAAC,8BAA8B,IAC1CA,QAAQ,GAAG,CAAC,iCAAiC,IAC7C"}
|
package/indices.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
interface IndicesPluginsParams {
|
|
4
|
-
container: PluginsContainer;
|
|
5
|
-
type: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const getLastAddedIndexPlugin: <T extends OpenSearchIndexPlugin>(params: IndicesPluginsParams) => T;
|
|
8
|
-
export {};
|
|
1
|
+
import { OpenSearchIndexRegistry } from "./features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js";
|
|
2
|
+
export { OpenSearchIndexRegistry };
|