@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
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
class MemoryReason {
|
|
2
|
+
constructor(params){
|
|
3
|
+
this.name = "memory";
|
|
4
|
+
this.maximum = params.maximum;
|
|
5
|
+
this.current = params.current;
|
|
6
|
+
this.description = params.description;
|
|
7
|
+
}
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
9
|
+
const createMemoryReason = (params)=>new MemoryReason(params);
|
|
10
|
+
export { MemoryReason, createMemoryReason };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=MemoryReason.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/waitUntilHealthy/reason/MemoryReason.js","sources":["../../../../src/utils/waitUntilHealthy/reason/MemoryReason.ts"],"sourcesContent":["import type { IReason } from \"~/utils/waitUntilHealthy/reason/IReason.js\";\n\nexport interface IMemoryReasonParams {\n maximum: number;\n current: number;\n description?: string;\n}\n\nexport class MemoryReason implements IReason {\n public readonly name = \"memory\";\n public readonly maximum: number;\n public readonly current: number;\n public readonly description?: string;\n\n public constructor(params: IMemoryReasonParams) {\n this.maximum = params.maximum;\n this.current = params.current;\n this.description = params.description;\n }\n}\n\nexport const createMemoryReason = (params: IMemoryReasonParams): MemoryReason => {\n return new MemoryReason(params);\n};\n"],"names":["MemoryReason","params","createMemoryReason"],"mappings":"AAQO,MAAMA;IAMT,YAAmBC,MAA2B,CAAE;aALhC,IAAI,GAAG;QAMnB,IAAI,CAAC,OAAO,GAAGA,OAAO,OAAO;QAC7B,IAAI,CAAC,OAAO,GAAGA,OAAO,OAAO;QAC7B,IAAI,CAAC,WAAW,GAAGA,OAAO,WAAW;IACzC;AACJ;AAEO,MAAMC,qBAAqB,CAACD,SACxB,IAAID,aAAaC"}
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
class ProcessorReason {
|
|
2
|
+
constructor(params){
|
|
3
|
+
this.name = "processor";
|
|
4
|
+
this.maximum = params.maximum;
|
|
5
|
+
this.current = params.current;
|
|
6
|
+
this.description = params.description;
|
|
7
|
+
}
|
|
8
8
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
9
|
+
const createProcessorReason = (params)=>new ProcessorReason(params);
|
|
10
|
+
export { ProcessorReason, createProcessorReason };
|
|
12
11
|
|
|
13
12
|
//# sourceMappingURL=ProcessorReason.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"utils/waitUntilHealthy/reason/ProcessorReason.js","sources":["../../../../src/utils/waitUntilHealthy/reason/ProcessorReason.ts"],"sourcesContent":["import type { IReason } from \"~/utils/waitUntilHealthy/reason/IReason.js\";\n\nexport interface IProcessorReasonParams {\n maximum: number;\n current: number;\n description?: string;\n}\n\nexport class ProcessorReason implements IReason {\n public readonly name = \"processor\";\n public readonly maximum: number;\n public readonly current: number;\n public readonly description?: string;\n\n public constructor(params: IProcessorReasonParams) {\n this.maximum = params.maximum;\n this.current = params.current;\n this.description = params.description;\n }\n}\n\nexport const createProcessorReason = (params: IProcessorReasonParams): ProcessorReason => {\n return new ProcessorReason(params);\n};\n"],"names":["ProcessorReason","params","createProcessorReason"],"mappings":"AAQO,MAAMA;IAMT,YAAmBC,MAA8B,CAAE;aALnC,IAAI,GAAG;QAMnB,IAAI,CAAC,OAAO,GAAGA,OAAO,OAAO;QAC7B,IAAI,CAAC,OAAO,GAAGA,OAAO,OAAO;QAC7B,IAAI,CAAC,WAAW,GAAGA,OAAO,WAAW;IACzC;AACJ;AAEO,MAAMC,wBAAwB,CAACD,SAC3B,IAAID,gBAAgBC"}
|
package/where.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { OpenSearchBoolQueryConfig } from "./types.js";
|
|
2
|
-
import {
|
|
3
|
-
import type {
|
|
2
|
+
import { OpenSearchField } from "./features/OpenSearchField/abstractions/OpenSearchField.js";
|
|
3
|
+
import type { OpenSearchQueryBuilderOperator } from "./features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js";
|
|
4
4
|
type Records<T> = Record<string, T>;
|
|
5
5
|
export interface ApplyWhereParams {
|
|
6
6
|
query: OpenSearchBoolQueryConfig;
|
|
7
7
|
where: Records<any>;
|
|
8
|
-
fields: Records<
|
|
9
|
-
operators: Records<
|
|
8
|
+
fields: Records<OpenSearchField.Interface>;
|
|
9
|
+
operators: Records<OpenSearchQueryBuilderOperator.Interface>;
|
|
10
10
|
}
|
|
11
11
|
export interface ParseWhereKeyResult {
|
|
12
12
|
field: string;
|
package/where.js
CHANGED
|
@@ -1,82 +1,49 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
/**
|
|
4
|
-
* TODO remove the wbyAco prefix when we move the user fields to the values property.
|
|
5
|
-
*/
|
|
1
|
+
import { OpenSearchFieldAll } from "./features/OpenSearchField/abstractions/OpenSearchField.js";
|
|
2
|
+
import error from "@webiny/error";
|
|
6
3
|
const parseWhereKeyRegExp = new RegExp(/^((?:wbyAco_)?[a-zA-Z0-9]+)(_[a-zA-Z0-9_]+)?$/);
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
const operator = operation.match(/^_/) ? operation.slice(1) : operation;
|
|
17
|
-
return {
|
|
18
|
-
field,
|
|
19
|
-
operator
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
const ALL = OpenSearchFieldPlugin.ALL;
|
|
23
|
-
export const applyWhere = params => {
|
|
24
|
-
const {
|
|
25
|
-
query,
|
|
26
|
-
where,
|
|
27
|
-
fields,
|
|
28
|
-
operators
|
|
29
|
-
} = params;
|
|
30
|
-
for (const key in where) {
|
|
31
|
-
if (where.hasOwnProperty(key) === false) {
|
|
32
|
-
continue;
|
|
33
|
-
}
|
|
34
|
-
const initialValue = where[key];
|
|
35
|
-
/**
|
|
36
|
-
* There is a possibility that undefined is sent as a value, so just skip it.
|
|
37
|
-
*/
|
|
38
|
-
if (initialValue === undefined) {
|
|
39
|
-
continue;
|
|
40
|
-
}
|
|
41
|
-
const {
|
|
42
|
-
field,
|
|
43
|
-
operator
|
|
44
|
-
} = parseWhereKey(key);
|
|
45
|
-
const fieldPlugin = fields[field] || fields[ALL];
|
|
46
|
-
if (!fieldPlugin) {
|
|
47
|
-
throw new WebinyError(`Missing plugin for the field "${field}".`, "PLUGIN_WHERE_ERROR", {
|
|
48
|
-
field
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
const operatorPlugin = operators[operator];
|
|
52
|
-
if (!operatorPlugin) {
|
|
53
|
-
throw new WebinyError(`Missing plugin for the operator "${operator}"`, "PLUGIN_WHERE_ERROR", {
|
|
4
|
+
const parseWhereKey = (key)=>{
|
|
5
|
+
const match = key.match(parseWhereKeyRegExp);
|
|
6
|
+
if (!match) throw new Error(`It is not possible to search by key "${key}"`);
|
|
7
|
+
const [, field, operation = "eq"] = match;
|
|
8
|
+
if (!field.match(/^(?:wbyAco_)?([a-zA-Z0-9]+)$/)) throw new Error(`Cannot filter by "${field}".`);
|
|
9
|
+
const operator = operation.match(/^_/) ? operation.slice(1) : operation;
|
|
10
|
+
return {
|
|
11
|
+
field,
|
|
54
12
|
operator
|
|
55
|
-
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
const ALL = OpenSearchFieldAll;
|
|
16
|
+
const applyWhere = (params)=>{
|
|
17
|
+
const { query, where, fields, operators } = params;
|
|
18
|
+
for(const key in where){
|
|
19
|
+
if (false === where.hasOwnProperty(key)) continue;
|
|
20
|
+
const initialValue = where[key];
|
|
21
|
+
if (void 0 === initialValue) continue;
|
|
22
|
+
const { field, operator } = parseWhereKey(key);
|
|
23
|
+
const fieldPlugin = fields[field] || fields[ALL];
|
|
24
|
+
if (!fieldPlugin) throw new error(`Missing plugin for the field "${field}".`, "PLUGIN_WHERE_ERROR", {
|
|
25
|
+
field
|
|
26
|
+
});
|
|
27
|
+
const operatorInstance = operators[operator];
|
|
28
|
+
if (!operatorInstance) throw new error(`Missing plugin for the operator "${operator}"`, "PLUGIN_WHERE_ERROR", {
|
|
29
|
+
operator
|
|
30
|
+
});
|
|
31
|
+
const path = fieldPlugin.getPath(field);
|
|
32
|
+
const basePath = fieldPlugin.getBasePath(field);
|
|
33
|
+
const value = fieldPlugin.toSearchValue({
|
|
34
|
+
value: initialValue,
|
|
35
|
+
path,
|
|
36
|
+
basePath
|
|
37
|
+
});
|
|
38
|
+
operatorInstance.apply(query, {
|
|
39
|
+
name: field,
|
|
40
|
+
value,
|
|
41
|
+
path,
|
|
42
|
+
basePath,
|
|
43
|
+
keyword: fieldPlugin.keyword
|
|
44
|
+
});
|
|
56
45
|
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Get the path but in the case of * (all fields, replace * with the field.
|
|
60
|
-
* Custom path would return its own value anyways.
|
|
61
|
-
*/
|
|
62
|
-
const path = fieldPlugin.getPath(field);
|
|
63
|
-
const basePath = fieldPlugin.getBasePath(field);
|
|
64
|
-
/**
|
|
65
|
-
* Transform the value for the search.
|
|
66
|
-
*/
|
|
67
|
-
const value = fieldPlugin.toSearchValue({
|
|
68
|
-
value: initialValue,
|
|
69
|
-
path,
|
|
70
|
-
basePath
|
|
71
|
-
});
|
|
72
|
-
operatorPlugin.apply(query, {
|
|
73
|
-
name: field,
|
|
74
|
-
value,
|
|
75
|
-
path,
|
|
76
|
-
basePath,
|
|
77
|
-
keyword: fieldPlugin.keyword
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
46
|
};
|
|
47
|
+
export { applyWhere, parseWhereKey };
|
|
81
48
|
|
|
82
49
|
//# sourceMappingURL=where.js.map
|
package/where.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"where.js","sources":["../src/where.ts"],"sourcesContent":["import type { OpenSearchBoolQueryConfig } from \"~/types.js\";\nimport {\n OpenSearchField,\n OpenSearchFieldAll\n} from \"~/features/OpenSearchField/abstractions/OpenSearchField.js\";\nimport type { OpenSearchQueryBuilderOperator } from \"~/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js\";\nimport WebinyError from \"@webiny/error\";\n\ntype Records<T> = Record<string, T>;\n\nexport interface ApplyWhereParams {\n query: OpenSearchBoolQueryConfig;\n where: Records<any>;\n fields: Records<OpenSearchField.Interface>;\n operators: Records<OpenSearchQueryBuilderOperator.Interface>;\n}\n\nexport interface ParseWhereKeyResult {\n field: string;\n operator: string;\n}\n\nconst parseWhereKeyRegExp = new RegExp(/^((?:wbyAco_)?[a-zA-Z0-9]+)(_[a-zA-Z0-9_]+)?$/);\n\nexport const parseWhereKey = (key: string): ParseWhereKeyResult => {\n const match = key.match(parseWhereKeyRegExp);\n\n if (!match) {\n throw new Error(`It is not possible to search by key \"${key}\"`);\n }\n\n const [, field, operation = \"eq\"] = match;\n\n if (!field.match(/^(?:wbyAco_)?([a-zA-Z0-9]+)$/)) {\n throw new Error(`Cannot filter by \"${field}\".`);\n }\n\n const operator = operation.match(/^_/) ? operation.slice(1) : operation;\n\n return { field, operator };\n};\n\nconst ALL = OpenSearchFieldAll;\n\nexport const applyWhere = (params: ApplyWhereParams): void => {\n const { query, where, fields, operators } = params;\n\n for (const key in where) {\n if (where.hasOwnProperty(key) === false) {\n continue;\n }\n const initialValue = where[key];\n if (initialValue === undefined) {\n continue;\n }\n const { field, operator } = parseWhereKey(key);\n const fieldPlugin: OpenSearchField.Interface = fields[field] || fields[ALL];\n if (!fieldPlugin) {\n throw new WebinyError(\n `Missing plugin for the field \"${field}\".`,\n \"PLUGIN_WHERE_ERROR\",\n {\n field\n }\n );\n }\n const operatorInstance = operators[operator];\n if (!operatorInstance) {\n throw new WebinyError(\n `Missing plugin for the operator \"${operator}\"`,\n \"PLUGIN_WHERE_ERROR\",\n {\n operator\n }\n );\n }\n\n const path = fieldPlugin.getPath(field);\n const basePath = fieldPlugin.getBasePath(field);\n const value = fieldPlugin.toSearchValue({\n value: initialValue,\n path,\n basePath\n });\n\n operatorInstance.apply(query, {\n name: field,\n value,\n path,\n basePath,\n keyword: fieldPlugin.keyword\n });\n }\n};\n"],"names":["parseWhereKeyRegExp","RegExp","parseWhereKey","key","match","Error","field","operation","operator","ALL","OpenSearchFieldAll","applyWhere","params","query","where","fields","operators","initialValue","undefined","fieldPlugin","WebinyError","operatorInstance","path","basePath","value"],"mappings":";;AAsBA,MAAMA,sBAAsB,IAAIC,OAAO;AAEhC,MAAMC,gBAAgB,CAACC;IAC1B,MAAMC,QAAQD,IAAI,KAAK,CAACH;IAExB,IAAI,CAACI,OACD,MAAM,IAAIC,MAAM,CAAC,qCAAqC,EAAEF,IAAI,CAAC,CAAC;IAGlE,MAAM,GAAGG,OAAOC,YAAY,IAAI,CAAC,GAAGH;IAEpC,IAAI,CAACE,MAAM,KAAK,CAAC,iCACb,MAAM,IAAID,MAAM,CAAC,kBAAkB,EAAEC,MAAM,EAAE,CAAC;IAGlD,MAAME,WAAWD,UAAU,KAAK,CAAC,QAAQA,UAAU,KAAK,CAAC,KAAKA;IAE9D,OAAO;QAAED;QAAOE;IAAS;AAC7B;AAEA,MAAMC,MAAMC;AAEL,MAAMC,aAAa,CAACC;IACvB,MAAM,EAAEC,KAAK,EAAEC,KAAK,EAAEC,MAAM,EAAEC,SAAS,EAAE,GAAGJ;IAE5C,IAAK,MAAMT,OAAOW,MAAO;QACrB,IAAIA,AAA8B,UAA9BA,MAAM,cAAc,CAACX,MACrB;QAEJ,MAAMc,eAAeH,KAAK,CAACX,IAAI;QAC/B,IAAIc,AAAiBC,WAAjBD,cACA;QAEJ,MAAM,EAAEX,KAAK,EAAEE,QAAQ,EAAE,GAAGN,cAAcC;QAC1C,MAAMgB,cAAyCJ,MAAM,CAACT,MAAM,IAAIS,MAAM,CAACN,IAAI;QAC3E,IAAI,CAACU,aACD,MAAM,IAAIC,MACN,CAAC,8BAA8B,EAAEd,MAAM,EAAE,CAAC,EAC1C,sBACA;YACIA;QACJ;QAGR,MAAMe,mBAAmBL,SAAS,CAACR,SAAS;QAC5C,IAAI,CAACa,kBACD,MAAM,IAAID,MACN,CAAC,iCAAiC,EAAEZ,SAAS,CAAC,CAAC,EAC/C,sBACA;YACIA;QACJ;QAIR,MAAMc,OAAOH,YAAY,OAAO,CAACb;QACjC,MAAMiB,WAAWJ,YAAY,WAAW,CAACb;QACzC,MAAMkB,QAAQL,YAAY,aAAa,CAAC;YACpC,OAAOF;YACPK;YACAC;QACJ;QAEAF,iBAAiB,KAAK,CAACR,OAAO;YAC1B,MAAMP;YACNkB;YACAF;YACAC;YACA,SAASJ,YAAY,OAAO;QAChC;IACJ;AACJ"}
|
package/db/entity.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type ITable } from "@webiny/db-dynamodb";
|
|
2
|
-
import type { IOpenSearchEntity } from "../db/types.js";
|
|
3
|
-
export interface ICreateOpenSearchEntityParams {
|
|
4
|
-
table: ITable;
|
|
5
|
-
entityName: string;
|
|
6
|
-
}
|
|
7
|
-
export declare const createOpenSearchEntity: (params: ICreateOpenSearchEntityParams) => IOpenSearchEntity;
|
package/db/entity.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { createEntity, standardEntityAttributes } from "@webiny/db-dynamodb";
|
|
2
|
-
export const createOpenSearchEntity = params => {
|
|
3
|
-
const {
|
|
4
|
-
table,
|
|
5
|
-
entityName
|
|
6
|
-
} = params;
|
|
7
|
-
return createEntity({
|
|
8
|
-
name: entityName,
|
|
9
|
-
table: table.table,
|
|
10
|
-
attributes: {
|
|
11
|
-
...standardEntityAttributes,
|
|
12
|
-
index: {
|
|
13
|
-
type: "string",
|
|
14
|
-
required: true
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
//# sourceMappingURL=entity.js.map
|
package/db/entity.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createEntity","standardEntityAttributes","createOpenSearchEntity","params","table","entityName","name","attributes","index","type","required"],"sources":["entity.ts"],"sourcesContent":["import { createEntity, type ITable, standardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport type { IOpenSearchEntity, IOpenSearchEntityAttributes } from \"~/db/types.js\";\n\nexport interface ICreateOpenSearchEntityParams {\n table: ITable;\n entityName: string;\n}\n\nexport const createOpenSearchEntity = (\n params: ICreateOpenSearchEntityParams\n): IOpenSearchEntity => {\n const { table, entityName } = params;\n return createEntity<IOpenSearchEntityAttributes>({\n name: entityName,\n table: table.table,\n attributes: {\n ...standardEntityAttributes,\n index: {\n type: \"string\",\n required: true\n }\n }\n });\n};\n"],"mappings":"AAAA,SAASA,YAAY,EAAeC,wBAAwB,QAAQ,qBAAqB;AAQzF,OAAO,MAAMC,sBAAsB,GAC/BC,MAAqC,IACjB;EACpB,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOH,YAAY,CAA8B;IAC7CM,IAAI,EAAED,UAAU;IAChBD,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBG,UAAU,EAAE;MACR,GAAGN,wBAAwB;MAC3BO,KAAK,EAAE;QACHC,IAAI,EAAE,QAAQ;QACdC,QAAQ,EAAE;MACd;IACJ;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
package/db/index.d.ts
DELETED
package/db/index.js
DELETED
package/db/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./table.js\";\nexport * from \"./entity.js\";\nexport * from \"./types.js\";\n"],"mappings":"AAAA;AACA;AACA","ignoreList":[]}
|
package/db/table.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
|
|
2
|
-
import { type ITable } from "@webiny/db-dynamodb";
|
|
3
|
-
export interface ICreateOpenSearchTableParams {
|
|
4
|
-
name?: string;
|
|
5
|
-
documentClient: DynamoDBDocument;
|
|
6
|
-
}
|
|
7
|
-
export declare const createOpenSearchTable: ({ name, documentClient }: ICreateOpenSearchTableParams) => ITable;
|
package/db/table.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { createTable } from "@webiny/db-dynamodb";
|
|
2
|
-
export const createOpenSearchTable = ({
|
|
3
|
-
name,
|
|
4
|
-
documentClient
|
|
5
|
-
}) => {
|
|
6
|
-
return createTable({
|
|
7
|
-
name: name || process.env.DB_TABLE_OPENSEARCH,
|
|
8
|
-
indexes: {
|
|
9
|
-
GSI_TENANT: {
|
|
10
|
-
partitionKey: "GSI_TENANT"
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
documentClient
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
//# sourceMappingURL=table.js.map
|
package/db/table.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createTable","createOpenSearchTable","name","documentClient","process","env","DB_TABLE_OPENSEARCH","indexes","GSI_TENANT","partitionKey"],"sources":["table.ts"],"sourcesContent":["import type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport { createTable, type ITable } from \"@webiny/db-dynamodb\";\n\nexport interface ICreateOpenSearchTableParams {\n name?: string;\n documentClient: DynamoDBDocument;\n}\n\nexport const createOpenSearchTable = ({\n name,\n documentClient\n}: ICreateOpenSearchTableParams): ITable => {\n return createTable({\n name: name || (process.env.DB_TABLE_OPENSEARCH as string),\n indexes: {\n GSI_TENANT: {\n partitionKey: \"GSI_TENANT\"\n }\n },\n documentClient\n });\n};\n"],"mappings":"AACA,SAASA,WAAW,QAAqB,qBAAqB;AAO9D,OAAO,MAAMC,qBAAqB,GAAGA,CAAC;EAClCC,IAAI;EACJC;AAC0B,CAAC,KAAa;EACxC,OAAOH,WAAW,CAAC;IACfE,IAAI,EAAEA,IAAI,IAAKE,OAAO,CAACC,GAAG,CAACC,mBAA8B;IACzDC,OAAO,EAAE;MACLC,UAAU,EAAE;QACRC,YAAY,EAAE;MAClB;IACJ,CAAC;IACDN;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
package/db/types.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
|
|
2
|
-
import type { GenericRecord } from "@webiny/api/types.js";
|
|
3
|
-
export interface IOpenSearchEntityAttributes extends IStandardEntityAttributes<GenericRecord> {
|
|
4
|
-
index: string;
|
|
5
|
-
}
|
|
6
|
-
export type IOpenSearchEntity = IEntity<IOpenSearchEntityAttributes>;
|
package/db/types.js
DELETED
package/db/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntity, IStandardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\n\nexport interface IOpenSearchEntityAttributes extends IStandardEntityAttributes<GenericRecord> {\n index: string;\n}\n\nexport type IOpenSearchEntity = IEntity<IOpenSearchEntityAttributes>;\n"],"mappings":"","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createOpenSearchClient","OpenSearchClient","OpenSearchContext","OpenSearchClientFactory"],"sources":["opensearch.ts"],"sourcesContent":["export { createOpenSearchClient } from \"~/client.js\";\nexport { OpenSearchClient } from \"~/features/OpenSearchClient/abstraction.js\";\nexport { OpenSearchContext } from \"~/features/OpenSearchContext/abstraction.js\";\nexport { OpenSearchClientFactory } from \"~/features/OpenSearchClientFactory/abstraction.js\";\n"],"mappings":"AAAA,SAASA,sBAAsB;AAC/B,SAASC,gBAAgB;AACzB,SAASC,iBAAiB;AAC1B,SAASC,uBAAuB","ignoreList":[]}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { OpenSearchClient as OpenSearchClientAbstraction } from "./abstraction.js";
|
|
2
|
-
import type { Client } from "../../types.js";
|
|
3
|
-
import { OpenSearchContext } from "../../features/OpenSearchContext/abstraction.js";
|
|
4
|
-
declare class OpenSearchClientImpl implements OpenSearchClientAbstraction.Interface {
|
|
5
|
-
private readonly context;
|
|
6
|
-
constructor(context: OpenSearchContext.Interface);
|
|
7
|
-
use(): Client;
|
|
8
|
-
}
|
|
9
|
-
export declare const OpenSearchClient: typeof OpenSearchClientImpl & {
|
|
10
|
-
__abstraction: import("@webiny/di").Abstraction<import("./abstraction.js").IOpenSearchClient>;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { OpenSearchClient as OpenSearchClientAbstraction } from "./abstraction.js";
|
|
2
|
-
import { OpenSearchContext } from "../OpenSearchContext/abstraction.js";
|
|
3
|
-
class OpenSearchClientImpl {
|
|
4
|
-
constructor(context) {
|
|
5
|
-
this.context = context;
|
|
6
|
-
}
|
|
7
|
-
use() {
|
|
8
|
-
return this.context.opensearch;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
export const OpenSearchClient = OpenSearchClientAbstraction.createImplementation({
|
|
12
|
-
implementation: OpenSearchClientImpl,
|
|
13
|
-
dependencies: [OpenSearchContext]
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
//# sourceMappingURL=OpenSearchClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["OpenSearchClient","OpenSearchClientAbstraction","OpenSearchContext","OpenSearchClientImpl","constructor","context","use","opensearch","createImplementation","implementation","dependencies"],"sources":["OpenSearchClient.ts"],"sourcesContent":["import { OpenSearchClient as OpenSearchClientAbstraction } from \"./abstraction.js\";\nimport type { Client } from \"~/types.js\";\nimport { OpenSearchContext } from \"~/features/OpenSearchContext/abstraction.js\";\n\nclass OpenSearchClientImpl implements OpenSearchClientAbstraction.Interface {\n public constructor(private readonly context: OpenSearchContext.Interface) {}\n\n public use(): Client {\n return this.context.opensearch;\n }\n}\n\nexport const OpenSearchClient = OpenSearchClientAbstraction.createImplementation({\n implementation: OpenSearchClientImpl,\n dependencies: [OpenSearchContext]\n});\n"],"mappings":"AAAA,SAASA,gBAAgB,IAAIC,2BAA2B;AAExD,SAASC,iBAAiB;AAE1B,MAAMC,oBAAoB,CAAkD;EACjEC,WAAWA,CAAkBC,OAAoC,EAAE;IAAA,KAAtCA,OAAoC,GAApCA,OAAoC;EAAG;EAEpEC,GAAGA,CAAA,EAAW;IACjB,OAAO,IAAI,CAACD,OAAO,CAACE,UAAU;EAClC;AACJ;AAEA,OAAO,MAAMP,gBAAgB,GAAGC,2BAA2B,CAACO,oBAAoB,CAAC;EAC7EC,cAAc,EAAEN,oBAAoB;EACpCO,YAAY,EAAE,CAACR,iBAAiB;AACpC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { OpenSearchContext as OpenSearchContextAbstraction } from "./abstraction.js";
|
|
2
|
-
import { OpenSearchContext as OpenSearchContextType } from "../../types.js";
|
|
3
|
-
export declare class OpenSearchContext implements OpenSearchContextAbstraction.Interface {
|
|
4
|
-
private readonly context;
|
|
5
|
-
constructor(context: OpenSearchContextType);
|
|
6
|
-
get opensearch(): OpenSearchContextAbstraction.Client;
|
|
7
|
-
get elasticsearch(): OpenSearchContextAbstraction.Client;
|
|
8
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export class OpenSearchContext {
|
|
2
|
-
constructor(context) {
|
|
3
|
-
this.context = context;
|
|
4
|
-
}
|
|
5
|
-
get opensearch() {
|
|
6
|
-
return this.context.opensearch;
|
|
7
|
-
}
|
|
8
|
-
get elasticsearch() {
|
|
9
|
-
return this.context.opensearch;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=OpenSearchContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["OpenSearchContext","constructor","context","opensearch","elasticsearch"],"sources":["OpenSearchContext.ts"],"sourcesContent":["import { OpenSearchContext as OpenSearchContextAbstraction } from \"./abstraction.js\";\nimport { OpenSearchContext as OpenSearchContextType } from \"~/types.js\";\n\nexport class OpenSearchContext implements OpenSearchContextAbstraction.Interface {\n private readonly context;\n\n public constructor(context: OpenSearchContextType) {\n this.context = context;\n }\n\n public get opensearch(): OpenSearchContextAbstraction.Client {\n return this.context.opensearch;\n }\n\n public get elasticsearch(): OpenSearchContextAbstraction.Client {\n return this.context.opensearch;\n }\n}\n"],"mappings":"AAGA,OAAO,MAAMA,iBAAiB,CAAmD;EAGtEC,WAAWA,CAACC,OAA8B,EAAE;IAC/C,IAAI,CAACA,OAAO,GAAGA,OAAO;EAC1B;EAEA,IAAWC,UAAUA,CAAA,EAAwC;IACzD,OAAO,IAAI,CAACD,OAAO,CAACC,UAAU;EAClC;EAEA,IAAWC,aAAaA,CAAA,EAAwC;IAC5D,OAAO,IAAI,CAACF,OAAO,CAACC,UAAU;EAClC;AACJ","ignoreList":[]}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Client as OpenSearchClient } from "../../types.js";
|
|
2
|
-
export interface IOpenSearchContext {
|
|
3
|
-
opensearch: OpenSearchClient;
|
|
4
|
-
/**
|
|
5
|
-
* @deprecated use `opensearch`property instead.
|
|
6
|
-
* @see IOpenSearchContext.opensearch
|
|
7
|
-
*/
|
|
8
|
-
elasticsearch: OpenSearchClient;
|
|
9
|
-
}
|
|
10
|
-
export declare const OpenSearchContext: import("@webiny/di").Abstraction<IOpenSearchContext>;
|
|
11
|
-
export declare namespace OpenSearchContext {
|
|
12
|
-
type Interface = IOpenSearchContext;
|
|
13
|
-
type Client = OpenSearchClient;
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createAbstraction","OpenSearchContext"],"sources":["abstraction.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Client as OpenSearchClient } from \"~/types.js\";\n\nexport interface IOpenSearchContext {\n opensearch: OpenSearchClient;\n /**\n * @deprecated use `opensearch`property instead.\n * @see IOpenSearchContext.opensearch\n */\n elasticsearch: OpenSearchClient;\n}\n\nexport const OpenSearchContext = createAbstraction<IOpenSearchContext>(\"OpenSearch/Context\");\n\nexport namespace OpenSearchContext {\n export type Interface = IOpenSearchContext;\n export type Client = OpenSearchClient;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;AAYvD,OAAO,MAAMC,iBAAiB,GAAGD,iBAAiB,CAAqB,oBAAoB,CAAC","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
-
import { OpenSearchContext } from "./abstraction.js";
|
|
3
|
-
import { OpenSearchContext as OpenSearchContextImplementation } from "./OpenSearchContext.js";
|
|
4
|
-
export const OpenSearchContextFeature = createFeature({
|
|
5
|
-
name: "opensearch.internal.context",
|
|
6
|
-
register(container, context) {
|
|
7
|
-
container.registerFactory(OpenSearchContext, () => {
|
|
8
|
-
return new OpenSearchContextImplementation(context);
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createFeature","OpenSearchContext","OpenSearchContextImplementation","OpenSearchContextFeature","name","register","container","context","registerFactory"],"sources":["feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport { OpenSearchContext } from \"./abstraction.js\";\nimport { OpenSearchContext as OpenSearchContextType } from \"~/types.js\";\nimport { OpenSearchContext as OpenSearchContextImplementation } from \"./OpenSearchContext.js\";\n\nexport const OpenSearchContextFeature = createFeature<OpenSearchContextType>({\n name: \"opensearch.internal.context\",\n register(container, context) {\n container.registerFactory(OpenSearchContext, () => {\n return new OpenSearchContextImplementation(context!);\n });\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,8BAA8B;AAC5D,SAASC,iBAAiB;AAE1B,SAASA,iBAAiB,IAAIC,+BAA+B;AAE7D,OAAO,MAAMC,wBAAwB,GAAGH,aAAa,CAAwB;EACzEI,IAAI,EAAE,6BAA6B;EACnCC,QAAQA,CAACC,SAAS,EAAEC,OAAO,EAAE;IACzBD,SAAS,CAACE,eAAe,CAACP,iBAAiB,EAAE,MAAM;MAC/C,OAAO,IAAIC,+BAA+B,CAACK,OAAQ,CAAC;IACxD,CAAC,CAAC;EACN;AACJ,CAAC,CAAC","ignoreList":[]}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["ContextPlugin","Client","createOpenSearchClient","getOpenSearchOperators","OpenSearchClientFactoryFeature","OpenSearchClientFeature","OpenSearchContextFeature","createOpenSearchContext","params","plugin","context","opensearch","Error","client","elasticsearch","plugins","register","container","name"],"sources":["index.ts"],"sourcesContent":["import type { OpenSearchContext } from \"./types.js\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport type { OpenSearchClientOptions } from \"./client.js\";\nimport { Client, createOpenSearchClient } from \"./client.js\";\nimport { getOpenSearchOperators } from \"./operators.js\";\nimport { OpenSearchClientFactoryFeature } from \"./features/OpenSearchClientFactory/feature.js\";\nimport { OpenSearchClientFeature } from \"./features/OpenSearchClient/feature.js\";\nimport { OpenSearchContextFeature } from \"~/features/OpenSearchContext/feature.js\";\n\nexport * from \"./indexConfiguration/index.js\";\nexport * from \"./plugins/index.js\";\nexport * from \"./sort.js\";\nexport * from \"./indices.js\";\nexport * from \"./where.js\";\nexport * from \"./limit.js\";\nexport * from \"./normalize.js\";\nexport * from \"./operators.js\";\nexport * from \"./cursors.js\";\nexport {\n createOpenSearchClient,\n type Client,\n type ClientOptions,\n type OpenSearchClientOptions\n} from \"./client.js\";\nexport * from \"./utils/index.js\";\nexport * from \"./operations/index.js\";\nexport * from \"./sharedIndex.js\";\nexport * from \"./indexPrefix.js\";\nexport * from \"./db/index.js\";\nexport * from \"./types.js\";\n\nexport const createOpenSearchContext = (\n params: OpenSearchClientOptions | Client\n): ContextPlugin<OpenSearchContext> => {\n const plugin = new ContextPlugin<OpenSearchContext>(context => {\n if (context.opensearch) {\n throw new Error(\"OpenSearch context must not be loaded more than once!\");\n }\n const client = params instanceof Client ? params : createOpenSearchClient(params);\n context.opensearch = client;\n context.elasticsearch = client;\n\n context.plugins.register(getOpenSearchOperators());\n\n OpenSearchContextFeature.register(context.container, context);\n OpenSearchClientFeature.register(context.container);\n OpenSearchClientFactoryFeature.register(context.container);\n });\n\n plugin.name = \"context.opensearch\";\n\n return plugin;\n};\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,aAAa;AAE3C,SAASC,MAAM,EAAEC,sBAAsB;AACvC,SAASC,sBAAsB;AAC/B,SAASC,8BAA8B;AACvC,SAASC,uBAAuB;AAChC,SAASC,wBAAwB;AAEjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SACIJ,sBAAsB;AAK1B;AACA;AACA;AACA;AACA;AACA;AAEA,OAAO,MAAMK,uBAAuB,GAChCC,MAAwC,IACL;EACnC,MAAMC,MAAM,GAAG,IAAIT,aAAa,CAAoBU,OAAO,IAAI;IAC3D,IAAIA,OAAO,CAACC,UAAU,EAAE;MACpB,MAAM,IAAIC,KAAK,CAAC,uDAAuD,CAAC;IAC5E;IACA,MAAMC,MAAM,GAAGL,MAAM,YAAYP,MAAM,GAAGO,MAAM,GAAGN,sBAAsB,CAACM,MAAM,CAAC;IACjFE,OAAO,CAACC,UAAU,GAAGE,MAAM;IAC3BH,OAAO,CAACI,aAAa,GAAGD,MAAM;IAE9BH,OAAO,CAACK,OAAO,CAACC,QAAQ,CAACb,sBAAsB,CAAC,CAAC,CAAC;IAElDG,wBAAwB,CAACU,QAAQ,CAACN,OAAO,CAACO,SAAS,EAAEP,OAAO,CAAC;IAC7DL,uBAAuB,CAACW,QAAQ,CAACN,OAAO,CAACO,SAAS,CAAC;IACnDb,8BAA8B,CAACY,QAAQ,CAACN,OAAO,CAACO,SAAS,CAAC;EAC9D,CAAC,CAAC;EAEFR,MAAM,CAACS,IAAI,GAAG,oBAAoB;EAElC,OAAOT,MAAM;AACjB,CAAC","ignoreList":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./base.js\";\nexport * from \"./common.js\";\n"],"mappings":"AAAA;AACA","ignoreList":[]}
|
package/indices.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","listIndicesPlugins","container","type","byType","filter","plugin","canUse","getLastAddedIndexPlugin","params","plugins","length","pop"],"sources":["indices.ts"],"sourcesContent":["import type { OpenSearchIndexPlugin } from \"~/plugins/definition/OpenSearchIndexPlugin.js\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport WebinyError from \"@webiny/error\";\n\ninterface IndicesPluginsParams {\n container: PluginsContainer;\n type: string;\n}\nconst listIndicesPlugins = <T extends OpenSearchIndexPlugin>({\n container,\n type\n}: IndicesPluginsParams): T[] => {\n return container.byType<T>(type).filter(plugin => {\n return plugin.canUse();\n });\n};\n\nexport const getLastAddedIndexPlugin = <T extends OpenSearchIndexPlugin>(\n params: IndicesPluginsParams\n): T => {\n const plugins = listIndicesPlugins<T>(params);\n if (plugins.length === 0) {\n throw new WebinyError(\n `Could not find a single OpenSearchIndexPlugin of type \"${params.type}\".`,\n \"OPENSEARCH_INDEX_TEMPLATE_ERROR\",\n {\n type: params.type\n }\n );\n }\n\n return plugins.pop() as T;\n};\n"],"mappings":"AAEA,OAAOA,WAAW,MAAM,eAAe;AAMvC,MAAMC,kBAAkB,GAAGA,CAAkC;EACzDC,SAAS;EACTC;AACkB,CAAC,KAAU;EAC7B,OAAOD,SAAS,CAACE,MAAM,CAAID,IAAI,CAAC,CAACE,MAAM,CAACC,MAAM,IAAI;IAC9C,OAAOA,MAAM,CAACC,MAAM,CAAC,CAAC;EAC1B,CAAC,CAAC;AACN,CAAC;AAED,OAAO,MAAMC,uBAAuB,GAChCC,MAA4B,IACxB;EACJ,MAAMC,OAAO,GAAGT,kBAAkB,CAAIQ,MAAM,CAAC;EAC7C,IAAIC,OAAO,CAACC,MAAM,KAAK,CAAC,EAAE;IACtB,MAAM,IAAIX,WAAW,CACjB,0DAA0DS,MAAM,CAACN,IAAI,IAAI,EACzE,iCAAiC,EACjC;MACIA,IAAI,EAAEM,MAAM,CAACN;IACjB,CACJ,CAAC;EACL;EAEA,OAAOO,OAAO,CAACE,GAAG,CAAC,CAAC;AACxB,CAAC","ignoreList":[]}
|
package/operations/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./OpenSearchCatHealth.js\";\nexport * from \"./OpenSearchCatNodes.js\";\nexport * from \"./types.js\";\n"],"mappings":"AAAA;AACA;AACA","ignoreList":[]}
|
package/operators.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { OpenSearchQueryBuilderOperatorBetweenPlugin, OpenSearchQueryBuilderOperatorAndInPlugin, OpenSearchQueryBuilderOperatorGreaterThanOrEqualToPlugin, OpenSearchQueryBuilderOperatorGreaterThanPlugin, OpenSearchQueryBuilderOperatorContainsPlugin, OpenSearchQueryBuilderOperatorLesserThanOrEqualToPlugin, OpenSearchQueryBuilderOperatorInPlugin, OpenSearchQueryBuilderOperatorLesserThanPlugin, OpenSearchQueryBuilderOperatorNotBetweenPlugin, OpenSearchQueryBuilderOperatorNotContainsPlugin, OpenSearchQueryBuilderOperatorNotPlugin, OpenSearchQueryBuilderOperatorNotInPlugin, OpenSearchQueryBuilderOperatorEqualPlugin, OpenSearchQueryBuilderOperatorStartsWithPlugin, OpenSearchQueryBuilderOperatorNotStartsWithPlugin } from "./plugins/operator/index.js";
|
|
2
|
-
/**
|
|
3
|
-
* We export as a function because there might be something to be sent to the operators at some point.
|
|
4
|
-
* This way, we make it easier to upgrade.
|
|
5
|
-
*/
|
|
6
|
-
export declare const getOpenSearchOperators: () => (OpenSearchQueryBuilderOperatorBetweenPlugin | OpenSearchQueryBuilderOperatorContainsPlugin | OpenSearchQueryBuilderOperatorEqualPlugin | OpenSearchQueryBuilderOperatorGreaterThanPlugin | OpenSearchQueryBuilderOperatorGreaterThanOrEqualToPlugin | OpenSearchQueryBuilderOperatorAndInPlugin | OpenSearchQueryBuilderOperatorInPlugin | OpenSearchQueryBuilderOperatorLesserThanPlugin | OpenSearchQueryBuilderOperatorLesserThanOrEqualToPlugin | OpenSearchQueryBuilderOperatorNotPlugin | OpenSearchQueryBuilderOperatorNotBetweenPlugin | OpenSearchQueryBuilderOperatorNotContainsPlugin | OpenSearchQueryBuilderOperatorNotInPlugin | OpenSearchQueryBuilderOperatorStartsWithPlugin | OpenSearchQueryBuilderOperatorNotStartsWithPlugin)[];
|
package/operators.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { OpenSearchQueryBuilderOperatorBetweenPlugin, OpenSearchQueryBuilderOperatorAndInPlugin, OpenSearchQueryBuilderOperatorGreaterThanOrEqualToPlugin, OpenSearchQueryBuilderOperatorGreaterThanPlugin, OpenSearchQueryBuilderOperatorContainsPlugin, OpenSearchQueryBuilderOperatorLesserThanOrEqualToPlugin, OpenSearchQueryBuilderOperatorInPlugin, OpenSearchQueryBuilderOperatorLesserThanPlugin, OpenSearchQueryBuilderOperatorNotBetweenPlugin, OpenSearchQueryBuilderOperatorNotContainsPlugin, OpenSearchQueryBuilderOperatorNotPlugin, OpenSearchQueryBuilderOperatorNotInPlugin, OpenSearchQueryBuilderOperatorEqualPlugin, OpenSearchQueryBuilderOperatorStartsWithPlugin, OpenSearchQueryBuilderOperatorNotStartsWithPlugin } from "./plugins/operator/index.js";
|
|
2
|
-
const operators = [new OpenSearchQueryBuilderOperatorBetweenPlugin(), new OpenSearchQueryBuilderOperatorNotBetweenPlugin(), new OpenSearchQueryBuilderOperatorContainsPlugin(), new OpenSearchQueryBuilderOperatorNotContainsPlugin(), new OpenSearchQueryBuilderOperatorEqualPlugin(), new OpenSearchQueryBuilderOperatorNotPlugin(), new OpenSearchQueryBuilderOperatorGreaterThanPlugin(), new OpenSearchQueryBuilderOperatorGreaterThanOrEqualToPlugin(), new OpenSearchQueryBuilderOperatorLesserThanPlugin(), new OpenSearchQueryBuilderOperatorLesserThanOrEqualToPlugin(), new OpenSearchQueryBuilderOperatorInPlugin(), new OpenSearchQueryBuilderOperatorAndInPlugin(), new OpenSearchQueryBuilderOperatorNotInPlugin(), new OpenSearchQueryBuilderOperatorStartsWithPlugin(), new OpenSearchQueryBuilderOperatorNotStartsWithPlugin()];
|
|
3
|
-
/**
|
|
4
|
-
* We export as a function because there might be something to be sent to the operators at some point.
|
|
5
|
-
* This way, we make it easier to upgrade.
|
|
6
|
-
*/
|
|
7
|
-
export const getOpenSearchOperators = () => operators;
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=operators.js.map
|
package/operators.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["OpenSearchQueryBuilderOperatorBetweenPlugin","OpenSearchQueryBuilderOperatorAndInPlugin","OpenSearchQueryBuilderOperatorGreaterThanOrEqualToPlugin","OpenSearchQueryBuilderOperatorGreaterThanPlugin","OpenSearchQueryBuilderOperatorContainsPlugin","OpenSearchQueryBuilderOperatorLesserThanOrEqualToPlugin","OpenSearchQueryBuilderOperatorInPlugin","OpenSearchQueryBuilderOperatorLesserThanPlugin","OpenSearchQueryBuilderOperatorNotBetweenPlugin","OpenSearchQueryBuilderOperatorNotContainsPlugin","OpenSearchQueryBuilderOperatorNotPlugin","OpenSearchQueryBuilderOperatorNotInPlugin","OpenSearchQueryBuilderOperatorEqualPlugin","OpenSearchQueryBuilderOperatorStartsWithPlugin","OpenSearchQueryBuilderOperatorNotStartsWithPlugin","operators","getOpenSearchOperators"],"sources":["operators.ts"],"sourcesContent":["import {\n OpenSearchQueryBuilderOperatorBetweenPlugin,\n OpenSearchQueryBuilderOperatorAndInPlugin,\n OpenSearchQueryBuilderOperatorGreaterThanOrEqualToPlugin,\n OpenSearchQueryBuilderOperatorGreaterThanPlugin,\n OpenSearchQueryBuilderOperatorContainsPlugin,\n OpenSearchQueryBuilderOperatorLesserThanOrEqualToPlugin,\n OpenSearchQueryBuilderOperatorInPlugin,\n OpenSearchQueryBuilderOperatorLesserThanPlugin,\n OpenSearchQueryBuilderOperatorNotBetweenPlugin,\n OpenSearchQueryBuilderOperatorNotContainsPlugin,\n OpenSearchQueryBuilderOperatorNotPlugin,\n OpenSearchQueryBuilderOperatorNotInPlugin,\n OpenSearchQueryBuilderOperatorEqualPlugin,\n OpenSearchQueryBuilderOperatorStartsWithPlugin,\n OpenSearchQueryBuilderOperatorNotStartsWithPlugin\n} from \"~/plugins/operator/index.js\";\n\nconst operators = [\n new OpenSearchQueryBuilderOperatorBetweenPlugin(),\n new OpenSearchQueryBuilderOperatorNotBetweenPlugin(),\n new OpenSearchQueryBuilderOperatorContainsPlugin(),\n new OpenSearchQueryBuilderOperatorNotContainsPlugin(),\n new OpenSearchQueryBuilderOperatorEqualPlugin(),\n new OpenSearchQueryBuilderOperatorNotPlugin(),\n new OpenSearchQueryBuilderOperatorGreaterThanPlugin(),\n new OpenSearchQueryBuilderOperatorGreaterThanOrEqualToPlugin(),\n new OpenSearchQueryBuilderOperatorLesserThanPlugin(),\n new OpenSearchQueryBuilderOperatorLesserThanOrEqualToPlugin(),\n new OpenSearchQueryBuilderOperatorInPlugin(),\n new OpenSearchQueryBuilderOperatorAndInPlugin(),\n new OpenSearchQueryBuilderOperatorNotInPlugin(),\n new OpenSearchQueryBuilderOperatorStartsWithPlugin(),\n new OpenSearchQueryBuilderOperatorNotStartsWithPlugin()\n];\n/**\n * We export as a function because there might be something to be sent to the operators at some point.\n * This way, we make it easier to upgrade.\n */\nexport const getOpenSearchOperators = () => operators;\n"],"mappings":"AAAA,SACIA,2CAA2C,EAC3CC,yCAAyC,EACzCC,wDAAwD,EACxDC,+CAA+C,EAC/CC,4CAA4C,EAC5CC,uDAAuD,EACvDC,sCAAsC,EACtCC,8CAA8C,EAC9CC,8CAA8C,EAC9CC,+CAA+C,EAC/CC,uCAAuC,EACvCC,yCAAyC,EACzCC,yCAAyC,EACzCC,8CAA8C,EAC9CC,iDAAiD;AAGrD,MAAMC,SAAS,GAAG,CACd,IAAIf,2CAA2C,CAAC,CAAC,EACjD,IAAIQ,8CAA8C,CAAC,CAAC,EACpD,IAAIJ,4CAA4C,CAAC,CAAC,EAClD,IAAIK,+CAA+C,CAAC,CAAC,EACrD,IAAIG,yCAAyC,CAAC,CAAC,EAC/C,IAAIF,uCAAuC,CAAC,CAAC,EAC7C,IAAIP,+CAA+C,CAAC,CAAC,EACrD,IAAID,wDAAwD,CAAC,CAAC,EAC9D,IAAIK,8CAA8C,CAAC,CAAC,EACpD,IAAIF,uDAAuD,CAAC,CAAC,EAC7D,IAAIC,sCAAsC,CAAC,CAAC,EAC5C,IAAIL,yCAAyC,CAAC,CAAC,EAC/C,IAAIU,yCAAyC,CAAC,CAAC,EAC/C,IAAIE,8CAA8C,CAAC,CAAC,EACpD,IAAIC,iDAAiD,CAAC,CAAC,CAC1D;AACD;AACA;AACA;AACA;AACA,OAAO,MAAME,sBAAsB,GAAGA,CAAA,KAAMD,SAAS","ignoreList":[]}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import type { SearchBody } from "../../types.js";
|
|
3
|
-
export interface ModifyBodyParams {
|
|
4
|
-
body: SearchBody;
|
|
5
|
-
}
|
|
6
|
-
export interface ModifyBodyCallable<T extends ModifyBodyParams> {
|
|
7
|
-
(params: T): void;
|
|
8
|
-
}
|
|
9
|
-
export declare abstract class OpenSearchBodyModifierPlugin<T extends ModifyBodyParams = ModifyBodyParams> extends Plugin {
|
|
10
|
-
private readonly callable?;
|
|
11
|
-
constructor(callable?: ModifyBodyCallable<T>);
|
|
12
|
-
modifyBody(params: T): void;
|
|
13
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import WebinyError from "@webiny/error";
|
|
2
|
-
import { Plugin } from "@webiny/plugins";
|
|
3
|
-
export class OpenSearchBodyModifierPlugin extends Plugin {
|
|
4
|
-
constructor(callable) {
|
|
5
|
-
super();
|
|
6
|
-
this.callable = callable;
|
|
7
|
-
}
|
|
8
|
-
modifyBody(params) {
|
|
9
|
-
if (typeof this.callable !== "function") {
|
|
10
|
-
throw new WebinyError(`Missing modification for the body.`, "BODY_MODIFICATION_MISSING", {
|
|
11
|
-
params
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
this.callable(params);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
//# sourceMappingURL=OpenSearchBodyModifierPlugin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["WebinyError","Plugin","OpenSearchBodyModifierPlugin","constructor","callable","modifyBody","params"],"sources":["OpenSearchBodyModifierPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Plugin } from \"@webiny/plugins\";\nimport type { SearchBody } from \"~/types.js\";\n\nexport interface ModifyBodyParams {\n body: SearchBody;\n}\n\nexport interface ModifyBodyCallable<T extends ModifyBodyParams> {\n (params: T): void;\n}\n\nexport abstract class OpenSearchBodyModifierPlugin<\n T extends ModifyBodyParams = ModifyBodyParams\n> extends Plugin {\n private readonly callable?: ModifyBodyCallable<T>;\n\n public constructor(callable?: ModifyBodyCallable<T>) {\n super();\n this.callable = callable;\n }\n\n public modifyBody(params: T): void {\n if (typeof this.callable !== \"function\") {\n throw new WebinyError(\n `Missing modification for the body.`,\n \"BODY_MODIFICATION_MISSING\",\n {\n params\n }\n );\n }\n this.callable(params);\n }\n}\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,MAAM,QAAQ,iBAAiB;AAWxC,OAAO,MAAeC,4BAA4B,SAExCD,MAAM,CAAC;EAGNE,WAAWA,CAACC,QAAgC,EAAE;IACjD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC5B;EAEOC,UAAUA,CAACC,MAAS,EAAQ;IAC/B,IAAI,OAAO,IAAI,CAACF,QAAQ,KAAK,UAAU,EAAE;MACrC,MAAM,IAAIJ,WAAW,CACjB,oCAAoC,EACpC,2BAA2B,EAC3B;QACIM;MACJ,CACJ,CAAC;IACL;IACA,IAAI,CAACF,QAAQ,CAACE,MAAM,CAAC;EACzB;AACJ","ignoreList":[]}
|