@webiny/api-opensearch 6.4.12-beta.4 → 6.5.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/exports/api/opensearch.d.ts +6 -1
- package/exports/api/opensearch.js +6 -1
- package/features/OpenSearchClient/abstraction.d.ts +3 -3
- package/features/OpenSearchClient/abstraction.js.map +1 -1
- package/features/OpenSearchClient/feature.d.ts +2 -1
- package/features/OpenSearchClient/feature.js +5 -3
- package/features/OpenSearchClient/feature.js.map +1 -1
- 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/OpenSearchFieldImpl.d.ts +17 -0
- package/{plugins/definition/OpenSearchFieldPlugin.js → features/OpenSearchField/OpenSearchFieldImpl.js} +8 -14
- package/features/OpenSearchField/OpenSearchFieldImpl.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/{plugins/operator/andIn.js → features/OpenSearchQueryBuilderOperator/operators/AndIn.js} +8 -7
- 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/{plugins/operator/equal.js → features/OpenSearchQueryBuilderOperator/operators/Equal.js} +8 -7
- 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/{plugins/operator/in.js → features/OpenSearchQueryBuilderOperator/operators/In.js} +8 -7
- 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/{plugins/operator/not.js → features/OpenSearchQueryBuilderOperator/operators/Not.js} +8 -7
- 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/{plugins/operator/notIn.js → features/OpenSearchQueryBuilderOperator/operators/NotIn.js} +8 -7
- 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 -9
- package/index.js +3 -27
- package/indices.d.ts +2 -8
- package/indices.js +1 -12
- package/package.json +12 -11
- package/registerOpenSearchCore.d.ts +3 -0
- package/registerOpenSearchCore.js +20 -0
- package/registerOpenSearchCore.js.map +1 -0
- package/sort.d.ts +2 -2
- package/sort.js +2 -2
- 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.map +1 -1
- package/utils/createIndex.d.ts +2 -2
- package/utils/createIndex.js +2 -8
- package/utils/createIndex.js.map +1 -1
- package/utils/waitUntilHealthy/WaitUntilHealthy.js +2 -1
- package/utils/waitUntilHealthy/WaitUntilHealthy.js.map +1 -1
- package/where.d.ts +4 -4
- package/where.js +5 -5
- package/where.js.map +1 -1
- package/features/OpenSearchClient/OpenSearchClient.d.ts +0 -12
- package/features/OpenSearchClient/OpenSearchClient.js +0 -19
- package/features/OpenSearchClient/OpenSearchClient.js.map +0 -1
- package/features/OpenSearchContext/OpenSearchContext.d.ts +0 -8
- package/features/OpenSearchContext/OpenSearchContext.js +0 -14
- package/features/OpenSearchContext/OpenSearchContext.js.map +0 -1
- package/features/OpenSearchContext/abstraction.d.ts +0 -14
- package/features/OpenSearchContext/abstraction.js +0 -5
- package/features/OpenSearchContext/abstraction.js.map +0 -1
- package/features/OpenSearchContext/feature.d.ts +0 -5
- package/features/OpenSearchContext/feature.js +0 -12
- package/features/OpenSearchContext/feature.js.map +0 -1
- package/index.js.map +0 -1
- package/indices.js.map +0 -1
- package/operators.d.ts +0 -6
- package/operators.js +0 -22
- package/operators.js.map +0 -1
- package/plugins/definition/OpenSearchBodyModifierPlugin.d.ts +0 -13
- package/plugins/definition/OpenSearchBodyModifierPlugin.js +0 -17
- package/plugins/definition/OpenSearchBodyModifierPlugin.js.map +0 -1
- package/plugins/definition/OpenSearchFieldPlugin.d.ts +0 -81
- package/plugins/definition/OpenSearchFieldPlugin.js.map +0 -1
- package/plugins/definition/OpenSearchIndexPlugin.d.ts +0 -10
- package/plugins/definition/OpenSearchIndexPlugin.js +0 -16
- 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 -17
- package/plugins/definition/OpenSearchQueryModifierPlugin.js.map +0 -1
- package/plugins/definition/OpenSearchSortModifierPlugin.d.ts +0 -13
- package/plugins/definition/OpenSearchSortModifierPlugin.js +0 -17
- package/plugins/definition/OpenSearchSortModifierPlugin.js.map +0 -1
- package/plugins/definition/index.d.ts +0 -6
- package/plugins/definition/index.js +0 -6
- package/plugins/index.d.ts +0 -2
- package/plugins/index.js +0 -2
- package/plugins/operator/andIn.d.ts +0 -7
- package/plugins/operator/andIn.js.map +0 -1
- package/plugins/operator/between.d.ts +0 -7
- package/plugins/operator/between.js +0 -26
- package/plugins/operator/between.js.map +0 -1
- package/plugins/operator/contains.d.ts +0 -7
- package/plugins/operator/contains.js +0 -26
- package/plugins/operator/contains.js.map +0 -1
- package/plugins/operator/equal.d.ts +0 -7
- 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.map +0 -1
- package/plugins/operator/index.d.ts +0 -15
- package/plugins/operator/index.js +0 -15
- 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.map +0 -1
- package/plugins/operator/notBetween.d.ts +0 -7
- package/plugins/operator/notBetween.js +0 -26
- package/plugins/operator/notBetween.js.map +0 -1
- package/plugins/operator/notContains.d.ts +0 -7
- package/plugins/operator/notContains.js +0 -26
- package/plugins/operator/notContains.js.map +0 -1
- package/plugins/operator/notIn.d.ts +0 -7
- package/plugins/operator/notIn.js.map +0 -1
- package/plugins/operator/notStartsWith.d.ts +0 -7
- package/plugins/operator/notStartsWith.js +0 -21
- package/plugins/operator/notStartsWith.js.map +0 -1
- package/plugins/operator/startsWith.d.ts +0 -7
- package/plugins/operator/startsWith.js +0 -21
- package/plugins/operator/startsWith.js.map +0 -1
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export { createOpenSearchClient } from "../../client.js";
|
|
2
2
|
export { OpenSearchClient } from "../../features/OpenSearchClient/abstraction.js";
|
|
3
|
-
export { OpenSearchContext } from "../../features/OpenSearchContext/abstraction.js";
|
|
4
3
|
export { OpenSearchClientFactory } from "../../features/OpenSearchClientFactory/abstraction.js";
|
|
4
|
+
export { OpenSearchQueryBuilderOperator } from "../../features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js";
|
|
5
|
+
export { OpenSearchQueryBuilderOperatorRegistry } from "../../features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.js";
|
|
6
|
+
export { OpenSearchField, OpenSearchFieldAll } from "../../features/OpenSearchField/abstractions/OpenSearchField.js";
|
|
7
|
+
export { OpenSearchFieldFactory } from "../../features/OpenSearchField/abstractions/OpenSearchFieldFactory.js";
|
|
8
|
+
export { OpenSearchIndex } from "../../features/OpenSearchIndex/abstractions/OpenSearchIndex.js";
|
|
9
|
+
export { OpenSearchIndexRegistry } from "../../features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js";
|
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export { createOpenSearchClient } from "../../client.js";
|
|
2
2
|
export { OpenSearchClient } from "../../features/OpenSearchClient/abstraction.js";
|
|
3
|
-
export { OpenSearchContext } from "../../features/OpenSearchContext/abstraction.js";
|
|
4
3
|
export { OpenSearchClientFactory } from "../../features/OpenSearchClientFactory/abstraction.js";
|
|
4
|
+
export { OpenSearchQueryBuilderOperator } from "../../features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js";
|
|
5
|
+
export { OpenSearchQueryBuilderOperatorRegistry } from "../../features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.js";
|
|
6
|
+
export { OpenSearchField, OpenSearchFieldAll } from "../../features/OpenSearchField/abstractions/OpenSearchField.js";
|
|
7
|
+
export { OpenSearchFieldFactory } from "../../features/OpenSearchField/abstractions/OpenSearchFieldFactory.js";
|
|
8
|
+
export { OpenSearchIndex } from "../../features/OpenSearchIndex/abstractions/OpenSearchIndex.js";
|
|
9
|
+
export { OpenSearchIndexRegistry } from "../../features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type { Client } from "../../client.js";
|
|
1
|
+
import type { Client as IClient } from "../../client.js";
|
|
2
2
|
export interface IOpenSearchClient {
|
|
3
|
-
use():
|
|
3
|
+
use(): IClient;
|
|
4
4
|
}
|
|
5
5
|
export declare const OpenSearchClient: import("@webiny/di").Abstraction<IOpenSearchClient>;
|
|
6
6
|
export declare namespace OpenSearchClient {
|
|
7
7
|
type Interface = IOpenSearchClient;
|
|
8
|
-
type
|
|
8
|
+
type Client = IClient;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/OpenSearchClient/abstraction.js","sources":["../../../src/features/OpenSearchClient/abstraction.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Client } from \"~/client.js\";\n\nexport interface IOpenSearchClient {\n use():
|
|
1
|
+
{"version":3,"file":"features/OpenSearchClient/abstraction.js","sources":["../../../src/features/OpenSearchClient/abstraction.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Client as IClient } from \"~/client.js\";\n\nexport interface IOpenSearchClient {\n use(): IClient;\n}\n\nexport const OpenSearchClient = createAbstraction<IOpenSearchClient>(\"OpenSearch/Client\");\n\nexport namespace OpenSearchClient {\n export type Interface = IOpenSearchClient;\n export type Client = IClient;\n}\n"],"names":["OpenSearchClient","createAbstraction"],"mappings":";AAOO,MAAMA,mBAAmBC,kBAAqC"}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
-
import { OpenSearchClient } from "./
|
|
2
|
+
import { OpenSearchClient } from "./abstraction.js";
|
|
3
3
|
const OpenSearchClientFeature = createFeature({
|
|
4
4
|
name: "opensearch.internal.client",
|
|
5
|
-
register (container) {
|
|
6
|
-
container.
|
|
5
|
+
register (container, client) {
|
|
6
|
+
container.registerInstance(OpenSearchClient, {
|
|
7
|
+
use: ()=>client
|
|
8
|
+
});
|
|
7
9
|
}
|
|
8
10
|
});
|
|
9
11
|
export { OpenSearchClientFeature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features/OpenSearchClient/feature.js","sources":["../../../src/features/OpenSearchClient/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\
|
|
1
|
+
{"version":3,"file":"features/OpenSearchClient/feature.js","sources":["../../../src/features/OpenSearchClient/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport type { Client } from \"~/client.js\";\nimport { OpenSearchClient } from \"./abstraction.js\";\n\nexport const OpenSearchClientFeature = createFeature<Client>({\n name: \"opensearch.internal.client\",\n register(container, client) {\n container.registerInstance(OpenSearchClient, {\n use: () => {\n return client;\n }\n });\n }\n});\n"],"names":["OpenSearchClientFeature","createFeature","container","client","OpenSearchClient"],"mappings":";;AAIO,MAAMA,0BAA0BC,cAAsB;IACzD,MAAM;IACN,UAASC,SAAS,EAAEC,MAAM;QACtBD,UAAU,gBAAgB,CAACE,kBAAkB;YACzC,KAAK,IACMD;QAEf;IACJ;AACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSearchFieldFactory as Abstraction } from "./abstractions/OpenSearchFieldFactory.js";
|
|
2
|
+
import type { OpenSearchField } from "./abstractions/OpenSearchField.js";
|
|
3
|
+
declare class OpenSearchFieldFactoryImpl implements Abstraction.Interface {
|
|
4
|
+
create(params: OpenSearchField.Params): OpenSearchField.Interface;
|
|
5
|
+
}
|
|
6
|
+
export declare const OpenSearchFieldFactory: typeof OpenSearchFieldFactoryImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/OpenSearchFieldFactory.js").IOpenSearchFieldFactory>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { OpenSearchFieldFactory } from "./abstractions/OpenSearchFieldFactory.js";
|
|
2
|
+
import { OpenSearchFieldImpl } from "./OpenSearchFieldImpl.js";
|
|
3
|
+
class OpenSearchFieldFactoryImpl {
|
|
4
|
+
create(params) {
|
|
5
|
+
return new OpenSearchFieldImpl(params);
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
const OpenSearchFieldFactory_OpenSearchFieldFactory = OpenSearchFieldFactory.createImplementation({
|
|
9
|
+
implementation: OpenSearchFieldFactoryImpl,
|
|
10
|
+
dependencies: []
|
|
11
|
+
});
|
|
12
|
+
export { OpenSearchFieldFactory_OpenSearchFieldFactory as OpenSearchFieldFactory };
|
|
13
|
+
|
|
14
|
+
//# sourceMappingURL=OpenSearchFieldFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchField/OpenSearchFieldFactory.js","sources":["../../../src/features/OpenSearchField/OpenSearchFieldFactory.ts"],"sourcesContent":["import { OpenSearchFieldFactory as Abstraction } from \"./abstractions/OpenSearchFieldFactory.js\";\nimport type { OpenSearchField } from \"./abstractions/OpenSearchField.js\";\nimport { OpenSearchFieldImpl } from \"./OpenSearchFieldImpl.js\";\n\nclass OpenSearchFieldFactoryImpl implements Abstraction.Interface {\n public create(params: OpenSearchField.Params): OpenSearchField.Interface {\n return new OpenSearchFieldImpl(params);\n }\n}\n\nexport const OpenSearchFieldFactory = Abstraction.createImplementation({\n implementation: OpenSearchFieldFactoryImpl,\n dependencies: []\n});\n"],"names":["OpenSearchFieldFactoryImpl","params","OpenSearchFieldImpl","OpenSearchFieldFactory","Abstraction"],"mappings":";;AAIA,MAAMA;IACK,OAAOC,MAA8B,EAA6B;QACrE,OAAO,IAAIC,oBAAoBD;IACnC;AACJ;AAEO,MAAME,gDAAyBC,uBAAAA,oBAAgC,CAAC;IACnE,gBAAgBJ;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FieldSortOptions } from "../../types.js";
|
|
2
|
+
import type { SortOrder } from "../../types.js";
|
|
3
|
+
import type { OpenSearchField } from "./abstractions/OpenSearchField.js";
|
|
4
|
+
export declare class OpenSearchFieldImpl implements OpenSearchField.Interface {
|
|
5
|
+
readonly field: string;
|
|
6
|
+
readonly path: string;
|
|
7
|
+
readonly keyword: boolean;
|
|
8
|
+
readonly unmappedType?: string;
|
|
9
|
+
readonly sortable: boolean;
|
|
10
|
+
readonly searchable: boolean;
|
|
11
|
+
private readonly searchValueFn?;
|
|
12
|
+
constructor(params: OpenSearchField.Params);
|
|
13
|
+
getSortOptions(order: SortOrder): FieldSortOptions;
|
|
14
|
+
getPath(field: string): string;
|
|
15
|
+
getBasePath(field: string): string;
|
|
16
|
+
toSearchValue(params: OpenSearchField.SearchValueParams): any;
|
|
17
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins";
|
|
2
1
|
const keywordLessUnmappedType = [
|
|
3
2
|
"date",
|
|
4
3
|
"long"
|
|
@@ -9,22 +8,16 @@ const unmappedTypeHasKeyword = (type)=>{
|
|
|
9
8
|
}
|
|
10
9
|
return true;
|
|
11
10
|
};
|
|
12
|
-
class
|
|
13
|
-
static{
|
|
14
|
-
this.type = "opensearch.fieldDefinition";
|
|
15
|
-
}
|
|
16
|
-
static{
|
|
17
|
-
this.ALL = "*";
|
|
18
|
-
}
|
|
11
|
+
class OpenSearchFieldImpl {
|
|
19
12
|
constructor(params){
|
|
20
|
-
super();
|
|
21
13
|
this.field = params.field;
|
|
22
14
|
this.path = params.path || params.field;
|
|
23
|
-
this.keyword = void 0 === params.keyword ? true : params.keyword;
|
|
24
15
|
this.unmappedType = params.unmappedType;
|
|
25
|
-
|
|
16
|
+
const keyword = void 0 === params.keyword ? true : params.keyword;
|
|
17
|
+
this.keyword = unmappedTypeHasKeyword(params.unmappedType) ? keyword : false;
|
|
26
18
|
this.sortable = void 0 === params.sortable ? true : params.sortable;
|
|
27
19
|
this.searchable = void 0 === params.searchable ? true : params.searchable;
|
|
20
|
+
this.searchValueFn = params.toSearchValue;
|
|
28
21
|
}
|
|
29
22
|
getSortOptions(order) {
|
|
30
23
|
const options = {
|
|
@@ -40,13 +33,14 @@ class OpenSearchFieldPlugin extends Plugin {
|
|
|
40
33
|
return `${this.getBasePath(field)}${this.keyword ? ".keyword" : ""}`;
|
|
41
34
|
}
|
|
42
35
|
getBasePath(field) {
|
|
43
|
-
if (
|
|
36
|
+
if ("*" === this.path) return field;
|
|
44
37
|
return this.path;
|
|
45
38
|
}
|
|
46
39
|
toSearchValue(params) {
|
|
40
|
+
if (this.searchValueFn) return this.searchValueFn(params);
|
|
47
41
|
return params.value;
|
|
48
42
|
}
|
|
49
43
|
}
|
|
50
|
-
export {
|
|
44
|
+
export { OpenSearchFieldImpl };
|
|
51
45
|
|
|
52
|
-
//# sourceMappingURL=
|
|
46
|
+
//# sourceMappingURL=OpenSearchFieldImpl.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchField/OpenSearchFieldImpl.js","sources":["../../../src/features/OpenSearchField/OpenSearchFieldImpl.ts"],"sourcesContent":["import type { FieldSortOptions } from \"~/types.js\";\nimport type { SortOrder } from \"~/types.js\";\nimport type { OpenSearchField } from \"./abstractions/OpenSearchField.js\";\n\nconst keywordLessUnmappedType = [\"date\", \"long\"];\n\nconst unmappedTypeHasKeyword = (type?: string): boolean => {\n if (!type) {\n return true;\n } else if (keywordLessUnmappedType.includes(type)) {\n return false;\n }\n return true;\n};\n\nexport class OpenSearchFieldImpl implements OpenSearchField.Interface {\n public readonly field: string;\n public readonly path: string;\n public readonly keyword: boolean;\n public readonly unmappedType?: string;\n public readonly sortable: boolean;\n public readonly searchable: boolean;\n private readonly searchValueFn?: (params: OpenSearchField.SearchValueParams) => any;\n\n public constructor(params: OpenSearchField.Params) {\n this.field = params.field;\n this.path = params.path || params.field;\n this.unmappedType = params.unmappedType;\n const keyword = params.keyword === undefined ? true : params.keyword;\n this.keyword = unmappedTypeHasKeyword(params.unmappedType) ? keyword : false;\n this.sortable = params.sortable === undefined ? true : params.sortable;\n this.searchable = params.searchable === undefined ? true : params.searchable;\n this.searchValueFn = params.toSearchValue;\n }\n\n public getSortOptions(order: SortOrder): FieldSortOptions {\n const options = {\n order\n };\n if (!this.unmappedType) {\n return options;\n }\n return {\n ...options,\n unmapped_type: this.unmappedType as any\n };\n }\n\n public getPath(field: string): string {\n return `${this.getBasePath(field)}${this.keyword ? \".keyword\" : \"\"}`;\n }\n\n public getBasePath(field: string): string {\n if (this.path === \"*\") {\n return field;\n }\n return this.path;\n }\n\n public toSearchValue(params: OpenSearchField.SearchValueParams): any {\n if (this.searchValueFn) {\n return this.searchValueFn(params);\n }\n return params.value;\n }\n}\n"],"names":["keywordLessUnmappedType","unmappedTypeHasKeyword","type","OpenSearchFieldImpl","params","keyword","undefined","order","options","field"],"mappings":"AAIA,MAAMA,0BAA0B;IAAC;IAAQ;CAAO;AAEhD,MAAMC,yBAAyB,CAACC;IAC5B,IAAKA,MAEE;QAAA,IAAIF,wBAAwB,QAAQ,CAACE,OACxC,OAAO;IACX;IACA,OAAO;AACX;AAEO,MAAMC;IAST,YAAmBC,MAA8B,CAAE;QAC/C,IAAI,CAAC,KAAK,GAAGA,OAAO,KAAK;QACzB,IAAI,CAAC,IAAI,GAAGA,OAAO,IAAI,IAAIA,OAAO,KAAK;QACvC,IAAI,CAAC,YAAY,GAAGA,OAAO,YAAY;QACvC,MAAMC,UAAUD,AAAmBE,WAAnBF,OAAO,OAAO,GAAiB,OAAOA,OAAO,OAAO;QACpE,IAAI,CAAC,OAAO,GAAGH,uBAAuBG,OAAO,YAAY,IAAIC,UAAU;QACvE,IAAI,CAAC,QAAQ,GAAGD,AAAoBE,WAApBF,OAAO,QAAQ,GAAiB,OAAOA,OAAO,QAAQ;QACtE,IAAI,CAAC,UAAU,GAAGA,AAAsBE,WAAtBF,OAAO,UAAU,GAAiB,OAAOA,OAAO,UAAU;QAC5E,IAAI,CAAC,aAAa,GAAGA,OAAO,aAAa;IAC7C;IAEO,eAAeG,KAAgB,EAAoB;QACtD,MAAMC,UAAU;YACZD;QACJ;QACA,IAAI,CAAC,IAAI,CAAC,YAAY,EAClB,OAAOC;QAEX,OAAO;YACH,GAAGA,OAAO;YACV,eAAe,IAAI,CAAC,YAAY;QACpC;IACJ;IAEO,QAAQC,KAAa,EAAU;QAClC,OAAO,GAAG,IAAI,CAAC,WAAW,CAACA,SAAS,IAAI,CAAC,OAAO,GAAG,aAAa,IAAI;IACxE;IAEO,YAAYA,KAAa,EAAU;QACtC,IAAI,AAAc,QAAd,IAAI,CAAC,IAAI,EACT,OAAOA;QAEX,OAAO,IAAI,CAAC,IAAI;IACpB;IAEO,cAAcL,MAAyC,EAAO;QACjE,IAAI,IAAI,CAAC,aAAa,EAClB,OAAO,IAAI,CAAC,aAAa,CAACA;QAE9B,OAAOA,OAAO,KAAK;IACvB;AACJ"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { FieldSortOptions } from "../../../types.js";
|
|
2
|
+
import type { SortOrder } from "../../../types.js";
|
|
3
|
+
export interface ToSearchValueParams {
|
|
4
|
+
value: any;
|
|
5
|
+
path: string;
|
|
6
|
+
basePath: string;
|
|
7
|
+
}
|
|
8
|
+
export interface OpenSearchFieldParams {
|
|
9
|
+
field: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
keyword?: boolean;
|
|
12
|
+
unmappedType?: string;
|
|
13
|
+
sortable?: boolean;
|
|
14
|
+
searchable?: boolean;
|
|
15
|
+
toSearchValue?: (params: ToSearchValueParams) => any;
|
|
16
|
+
}
|
|
17
|
+
export interface IOpenSearchField {
|
|
18
|
+
readonly field: string;
|
|
19
|
+
readonly path: string;
|
|
20
|
+
readonly keyword: boolean;
|
|
21
|
+
readonly unmappedType?: string;
|
|
22
|
+
readonly sortable: boolean;
|
|
23
|
+
readonly searchable: boolean;
|
|
24
|
+
getPath(field: string): string;
|
|
25
|
+
getBasePath(field: string): string;
|
|
26
|
+
getSortOptions(order: SortOrder): FieldSortOptions;
|
|
27
|
+
toSearchValue(params: ToSearchValueParams): any;
|
|
28
|
+
}
|
|
29
|
+
export declare const OpenSearchField: import("@webiny/di").Abstraction<IOpenSearchField>;
|
|
30
|
+
export declare namespace OpenSearchField {
|
|
31
|
+
type Interface = IOpenSearchField;
|
|
32
|
+
type Params = OpenSearchFieldParams;
|
|
33
|
+
type SearchValueParams = ToSearchValueParams;
|
|
34
|
+
}
|
|
35
|
+
export declare const OpenSearchFieldAll: "*";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchField/abstractions/OpenSearchField.js","sources":["../../../../src/features/OpenSearchField/abstractions/OpenSearchField.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/exports/api.js\";\nimport type { FieldSortOptions } from \"~/types.js\";\nimport type { SortOrder } from \"~/types.js\";\n\nexport interface ToSearchValueParams {\n value: any;\n path: string;\n basePath: string;\n}\n\nexport interface OpenSearchFieldParams {\n field: string;\n path?: string;\n keyword?: boolean;\n unmappedType?: string;\n sortable?: boolean;\n searchable?: boolean;\n toSearchValue?: (params: ToSearchValueParams) => any;\n}\n\nexport interface IOpenSearchField {\n readonly field: string;\n readonly path: string;\n readonly keyword: boolean;\n readonly unmappedType?: string;\n readonly sortable: boolean;\n readonly searchable: boolean;\n getPath(field: string): string;\n getBasePath(field: string): string;\n getSortOptions(order: SortOrder): FieldSortOptions;\n toSearchValue(params: ToSearchValueParams): any;\n}\n\nexport const OpenSearchField = createAbstraction<IOpenSearchField>(\"OpenSearch/Field\");\n\nexport namespace OpenSearchField {\n export type Interface = IOpenSearchField;\n export type Params = OpenSearchFieldParams;\n export type SearchValueParams = ToSearchValueParams;\n}\n\n/* The wildcard sentinel value used to match any field path. */\nexport const OpenSearchFieldAll = \"*\" as const;\n"],"names":["OpenSearchField","createAbstraction","OpenSearchFieldAll"],"mappings":";AAiCO,MAAMA,kBAAkBC,kBAAoC;AAS5D,MAAMC,qBAAqB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { OpenSearchField } from "./OpenSearchField.js";
|
|
2
|
+
export interface IOpenSearchFieldFactory {
|
|
3
|
+
create(params: OpenSearchField.Params): OpenSearchField.Interface;
|
|
4
|
+
}
|
|
5
|
+
export declare const OpenSearchFieldFactory: import("@webiny/di").Abstraction<IOpenSearchFieldFactory>;
|
|
6
|
+
export declare namespace OpenSearchFieldFactory {
|
|
7
|
+
type Interface = IOpenSearchFieldFactory;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchField/abstractions/OpenSearchFieldFactory.js","sources":["../../../../src/features/OpenSearchField/abstractions/OpenSearchFieldFactory.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/exports/api.js\";\nimport type { OpenSearchField } from \"./OpenSearchField.js\";\n\nexport interface IOpenSearchFieldFactory {\n create(params: OpenSearchField.Params): OpenSearchField.Interface;\n}\n\nexport const OpenSearchFieldFactory =\n createAbstraction<IOpenSearchFieldFactory>(\"OpenSearch/FieldFactory\");\n\nexport namespace OpenSearchFieldFactory {\n export type Interface = IOpenSearchFieldFactory;\n}\n"],"names":["OpenSearchFieldFactory","createAbstraction"],"mappings":";AAOO,MAAMA,yBACTC,kBAA2C"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
+
import { OpenSearchFieldFactory } from "./OpenSearchFieldFactory.js";
|
|
3
|
+
const OpenSearchFieldFeature = createFeature({
|
|
4
|
+
name: "opensearch.internal.field",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(OpenSearchFieldFactory).inSingletonScope();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { OpenSearchFieldFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchField/feature.js","sources":["../../../src/features/OpenSearchField/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport { OpenSearchFieldFactory } from \"./OpenSearchFieldFactory.js\";\n\nexport const OpenSearchFieldFeature = createFeature({\n name: \"opensearch.internal.field\",\n register(container) {\n container.register(OpenSearchFieldFactory).inSingletonScope();\n }\n});\n"],"names":["OpenSearchFieldFeature","createFeature","container","OpenSearchFieldFactory"],"mappings":";;AAGO,MAAMA,yBAAyBC,cAAc;IAChD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,wBAAwB,gBAAgB;IAC/D;AACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OpenSearchIndex } from "./abstractions/OpenSearchIndex.js";
|
|
2
|
+
import { OpenSearchIndexRegistry as Abstraction } from "./abstractions/OpenSearchIndexRegistry.js";
|
|
3
|
+
declare class OpenSearchIndexRegistryImpl implements Abstraction.Interface {
|
|
4
|
+
private readonly indices;
|
|
5
|
+
constructor(indices: OpenSearchIndex.Interface[]);
|
|
6
|
+
getLastAdded(): OpenSearchIndex.Interface;
|
|
7
|
+
getAll(): OpenSearchIndex.Interface[];
|
|
8
|
+
}
|
|
9
|
+
export declare const OpenSearchIndexRegistry: typeof OpenSearchIndexRegistryImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/OpenSearchIndexRegistry.js").IOpenSearchIndexRegistry>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import error from "@webiny/error";
|
|
2
|
+
import { OpenSearchIndex } from "./abstractions/OpenSearchIndex.js";
|
|
3
|
+
import { OpenSearchIndexRegistry } from "./abstractions/OpenSearchIndexRegistry.js";
|
|
4
|
+
class OpenSearchIndexRegistryImpl {
|
|
5
|
+
constructor(indices){
|
|
6
|
+
this.indices = indices;
|
|
7
|
+
}
|
|
8
|
+
getLastAdded() {
|
|
9
|
+
const usable = this.indices.filter((index)=>index.canUse());
|
|
10
|
+
if (0 === usable.length) throw new error("Could not find a single OpenSearchIndex.", "OPENSEARCH_INDEX_TEMPLATE_ERROR");
|
|
11
|
+
return usable[usable.length - 1];
|
|
12
|
+
}
|
|
13
|
+
getAll() {
|
|
14
|
+
return this.indices.filter((index)=>index.canUse());
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
const OpenSearchIndexRegistry_OpenSearchIndexRegistry = OpenSearchIndexRegistry.createImplementation({
|
|
18
|
+
implementation: OpenSearchIndexRegistryImpl,
|
|
19
|
+
dependencies: [
|
|
20
|
+
[
|
|
21
|
+
OpenSearchIndex,
|
|
22
|
+
{
|
|
23
|
+
multiple: true
|
|
24
|
+
}
|
|
25
|
+
]
|
|
26
|
+
]
|
|
27
|
+
});
|
|
28
|
+
export { OpenSearchIndexRegistry_OpenSearchIndexRegistry as OpenSearchIndexRegistry };
|
|
29
|
+
|
|
30
|
+
//# sourceMappingURL=OpenSearchIndexRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchIndex/OpenSearchIndexRegistry.js","sources":["../../../src/features/OpenSearchIndex/OpenSearchIndexRegistry.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { OpenSearchIndex } from \"./abstractions/OpenSearchIndex.js\";\nimport { OpenSearchIndexRegistry as Abstraction } from \"./abstractions/OpenSearchIndexRegistry.js\";\n\nclass OpenSearchIndexRegistryImpl implements Abstraction.Interface {\n private readonly indices: OpenSearchIndex.Interface[];\n\n public constructor(indices: OpenSearchIndex.Interface[]) {\n this.indices = indices;\n }\n\n public getLastAdded(): OpenSearchIndex.Interface {\n const usable = this.indices.filter(index => index.canUse());\n if (usable.length === 0) {\n throw new WebinyError(\n \"Could not find a single OpenSearchIndex.\",\n \"OPENSEARCH_INDEX_TEMPLATE_ERROR\"\n );\n }\n return usable[usable.length - 1];\n }\n\n public getAll(): OpenSearchIndex.Interface[] {\n return this.indices.filter(index => index.canUse());\n }\n}\n\nexport const OpenSearchIndexRegistry = Abstraction.createImplementation({\n implementation: OpenSearchIndexRegistryImpl,\n dependencies: [[OpenSearchIndex, { multiple: true }]]\n});\n"],"names":["OpenSearchIndexRegistryImpl","indices","usable","index","WebinyError","OpenSearchIndexRegistry","Abstraction","OpenSearchIndex"],"mappings":";;;AAIA,MAAMA;IAGF,YAAmBC,OAAoC,CAAE;QACrD,IAAI,CAAC,OAAO,GAAGA;IACnB;IAEO,eAA0C;QAC7C,MAAMC,SAAS,IAAI,CAAC,OAAO,CAAC,MAAM,CAACC,CAAAA,QAASA,MAAM,MAAM;QACxD,IAAID,AAAkB,MAAlBA,OAAO,MAAM,EACb,MAAM,IAAIE,MACN,4CACA;QAGR,OAAOF,MAAM,CAACA,OAAO,MAAM,GAAG,EAAE;IACpC;IAEO,SAAsC;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAACC,CAAAA,QAASA,MAAM,MAAM;IACpD;AACJ;AAEO,MAAME,kDAA0BC,wBAAAA,oBAAgC,CAAC;IACpE,gBAAgBN;IAChB,cAAc;QAAC;YAACO;YAAiB;gBAAE,UAAU;YAAK;SAAE;KAAC;AACzD"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OpenSearchIndexRequestBody } from "../../../types.js";
|
|
2
|
+
export interface IOpenSearchIndex {
|
|
3
|
+
readonly body: OpenSearchIndexRequestBody;
|
|
4
|
+
canUse(): boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare const OpenSearchIndex: import("@webiny/di").Abstraction<IOpenSearchIndex>;
|
|
7
|
+
export declare namespace OpenSearchIndex {
|
|
8
|
+
type Interface = IOpenSearchIndex;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchIndex/abstractions/OpenSearchIndex.js","sources":["../../../../src/features/OpenSearchIndex/abstractions/OpenSearchIndex.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/exports/api.js\";\nimport type { OpenSearchIndexRequestBody } from \"~/types.js\";\n\nexport interface IOpenSearchIndex {\n readonly body: OpenSearchIndexRequestBody;\n canUse(): boolean;\n}\n\nexport const OpenSearchIndex = createAbstraction<IOpenSearchIndex>(\"OpenSearch/Index\");\n\nexport namespace OpenSearchIndex {\n export type Interface = IOpenSearchIndex;\n}\n"],"names":["OpenSearchIndex","createAbstraction"],"mappings":";AAQO,MAAMA,kBAAkBC,kBAAoC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { OpenSearchIndex } from "./OpenSearchIndex.js";
|
|
2
|
+
export interface IOpenSearchIndexRegistry {
|
|
3
|
+
getLastAdded(): OpenSearchIndex.Interface;
|
|
4
|
+
getAll(): OpenSearchIndex.Interface[];
|
|
5
|
+
}
|
|
6
|
+
export declare const OpenSearchIndexRegistry: import("@webiny/di").Abstraction<IOpenSearchIndexRegistry>;
|
|
7
|
+
export declare namespace OpenSearchIndexRegistry {
|
|
8
|
+
type Interface = IOpenSearchIndexRegistry;
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.js","sources":["../../../../src/features/OpenSearchIndex/abstractions/OpenSearchIndexRegistry.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/exports/api.js\";\nimport type { OpenSearchIndex } from \"./OpenSearchIndex.js\";\n\nexport interface IOpenSearchIndexRegistry {\n getLastAdded(): OpenSearchIndex.Interface;\n getAll(): OpenSearchIndex.Interface[];\n}\n\nexport const OpenSearchIndexRegistry = createAbstraction<IOpenSearchIndexRegistry>(\n \"OpenSearch/IndexRegistry\"\n);\n\nexport namespace OpenSearchIndexRegistry {\n export type Interface = IOpenSearchIndexRegistry;\n}\n"],"names":["OpenSearchIndexRegistry","createAbstraction"],"mappings":";AAQO,MAAMA,0BAA0BC,kBACnC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
+
import { OpenSearchIndexRegistry } from "./OpenSearchIndexRegistry.js";
|
|
3
|
+
const OpenSearchIndexFeature = createFeature({
|
|
4
|
+
name: "opensearch.internal.index",
|
|
5
|
+
register (container) {
|
|
6
|
+
container.register(OpenSearchIndexRegistry).inSingletonScope();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
export { OpenSearchIndexFeature };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchIndex/feature.js","sources":["../../../src/features/OpenSearchIndex/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport { OpenSearchIndexRegistry } from \"./OpenSearchIndexRegistry.js\";\n\nexport const OpenSearchIndexFeature = createFeature({\n name: \"opensearch.internal.index\",\n register(container) {\n container.register(OpenSearchIndexRegistry).inSingletonScope();\n }\n});\n"],"names":["OpenSearchIndexFeature","createFeature","container","OpenSearchIndexRegistry"],"mappings":";;AAGO,MAAMA,yBAAyBC,cAAc;IAChD,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,yBAAyB,gBAAgB;IAChE;AACJ"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "./abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
import { OpenSearchQueryBuilderOperatorRegistry as Abstraction } from "./abstractions/OpenSearchQueryBuilderOperatorRegistry.js";
|
|
3
|
+
declare class OpenSearchQueryBuilderOperatorRegistryImpl implements Abstraction.Interface {
|
|
4
|
+
private readonly operators;
|
|
5
|
+
constructor(operators: OpenSearchQueryBuilderOperator.Interface[]);
|
|
6
|
+
get(operator: string): OpenSearchQueryBuilderOperator.Interface | undefined;
|
|
7
|
+
getAll(): OpenSearchQueryBuilderOperator.Interface[];
|
|
8
|
+
}
|
|
9
|
+
export declare const OpenSearchQueryBuilderOperatorRegistry: typeof OpenSearchQueryBuilderOperatorRegistryImpl & {
|
|
10
|
+
__abstraction: import("@webiny/di").Abstraction<import("./abstractions/OpenSearchQueryBuilderOperatorRegistry.js").IOpenSearchQueryBuilderOperatorRegistry>;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "./abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
import { OpenSearchQueryBuilderOperatorRegistry } from "./abstractions/OpenSearchQueryBuilderOperatorRegistry.js";
|
|
3
|
+
class OpenSearchQueryBuilderOperatorRegistryImpl {
|
|
4
|
+
constructor(operators){
|
|
5
|
+
this.operators = new Map();
|
|
6
|
+
for (const operator of operators)this.operators.set(operator.getOperator(), operator);
|
|
7
|
+
}
|
|
8
|
+
get(operator) {
|
|
9
|
+
return this.operators.get(operator);
|
|
10
|
+
}
|
|
11
|
+
getAll() {
|
|
12
|
+
return Array.from(this.operators.values());
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const OpenSearchQueryBuilderOperatorRegistry_OpenSearchQueryBuilderOperatorRegistry = OpenSearchQueryBuilderOperatorRegistry.createImplementation({
|
|
16
|
+
implementation: OpenSearchQueryBuilderOperatorRegistryImpl,
|
|
17
|
+
dependencies: [
|
|
18
|
+
[
|
|
19
|
+
OpenSearchQueryBuilderOperator,
|
|
20
|
+
{
|
|
21
|
+
multiple: true
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
]
|
|
25
|
+
});
|
|
26
|
+
export { OpenSearchQueryBuilderOperatorRegistry_OpenSearchQueryBuilderOperatorRegistry as OpenSearchQueryBuilderOperatorRegistry };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=OpenSearchQueryBuilderOperatorRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.js","sources":["../../../src/features/OpenSearchQueryBuilderOperator/OpenSearchQueryBuilderOperatorRegistry.ts"],"sourcesContent":["import { OpenSearchQueryBuilderOperator } from \"./abstractions/OpenSearchQueryBuilderOperator.js\";\nimport { OpenSearchQueryBuilderOperatorRegistry as Abstraction } from \"./abstractions/OpenSearchQueryBuilderOperatorRegistry.js\";\n\nclass OpenSearchQueryBuilderOperatorRegistryImpl implements Abstraction.Interface {\n private readonly operators: Map<string, OpenSearchQueryBuilderOperator.Interface>;\n\n public constructor(operators: OpenSearchQueryBuilderOperator.Interface[]) {\n this.operators = new Map();\n for (const operator of operators) {\n this.operators.set(operator.getOperator(), operator);\n }\n }\n\n public get(operator: string): OpenSearchQueryBuilderOperator.Interface | undefined {\n return this.operators.get(operator);\n }\n\n public getAll(): OpenSearchQueryBuilderOperator.Interface[] {\n return Array.from(this.operators.values());\n }\n}\n\nexport const OpenSearchQueryBuilderOperatorRegistry = Abstraction.createImplementation({\n implementation: OpenSearchQueryBuilderOperatorRegistryImpl,\n dependencies: [[OpenSearchQueryBuilderOperator, { multiple: true }]]\n});\n"],"names":["OpenSearchQueryBuilderOperatorRegistryImpl","operators","Map","operator","Array","OpenSearchQueryBuilderOperatorRegistry","Abstraction","OpenSearchQueryBuilderOperator"],"mappings":";;AAGA,MAAMA;IAGF,YAAmBC,SAAqD,CAAE;QACtE,IAAI,CAAC,SAAS,GAAG,IAAIC;QACrB,KAAK,MAAMC,YAAYF,UACnB,IAAI,CAAC,SAAS,CAAC,GAAG,CAACE,SAAS,WAAW,IAAIA;IAEnD;IAEO,IAAIA,QAAgB,EAAwD;QAC/E,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAACA;IAC9B;IAEO,SAAqD;QACxD,OAAOC,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM;IAC3C;AACJ;AAEO,MAAMC,gFAAyCC,uCAAAA,oBAAgC,CAAC;IACnF,gBAAgBN;IAChB,cAAc;QAAC;YAACO;YAAgC;gBAAE,UAAU;YAAK;SAAE;KAAC;AACxE"}
|
package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from "../../../types.js";
|
|
2
|
+
export interface IOpenSearchQueryBuilderOperator {
|
|
3
|
+
getOperator(): string;
|
|
4
|
+
apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const OpenSearchQueryBuilderOperator: import("@webiny/di").Abstraction<IOpenSearchQueryBuilderOperator>;
|
|
7
|
+
export declare namespace OpenSearchQueryBuilderOperator {
|
|
8
|
+
type Interface = IOpenSearchQueryBuilderOperator;
|
|
9
|
+
type Query = OpenSearchBoolQueryConfig;
|
|
10
|
+
type Params = OpenSearchQueryBuilderArgsPlugin;
|
|
11
|
+
}
|
package/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperator.ts"],"sourcesContent":["import type { OpenSearchBoolQueryConfig, OpenSearchQueryBuilderArgsPlugin } from \"~/types.js\";\nimport { createAbstraction } from \"@webiny/feature/exports/api.js\";\n\nexport interface IOpenSearchQueryBuilderOperator {\n getOperator(): string;\n apply(query: OpenSearchBoolQueryConfig, params: OpenSearchQueryBuilderArgsPlugin): void;\n}\n\nexport const OpenSearchQueryBuilderOperator = createAbstraction<IOpenSearchQueryBuilderOperator>(\n \"OpenSearch/QueryBuilder/Operator\"\n);\n\nexport namespace OpenSearchQueryBuilderOperator {\n export type Interface = IOpenSearchQueryBuilderOperator;\n export type Query = OpenSearchBoolQueryConfig;\n export type Params = OpenSearchQueryBuilderArgsPlugin;\n}\n"],"names":["OpenSearchQueryBuilderOperator","createAbstraction"],"mappings":";AAQO,MAAMA,iCAAiCC,kBAC1C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { OpenSearchQueryBuilderOperator } from "./OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
export interface IOpenSearchQueryBuilderOperatorRegistry {
|
|
3
|
+
get(operator: string): OpenSearchQueryBuilderOperator.Interface | undefined;
|
|
4
|
+
getAll(): OpenSearchQueryBuilderOperator.Interface[];
|
|
5
|
+
}
|
|
6
|
+
export declare const OpenSearchQueryBuilderOperatorRegistry: import("@webiny/di").Abstraction<IOpenSearchQueryBuilderOperatorRegistry>;
|
|
7
|
+
export declare namespace OpenSearchQueryBuilderOperatorRegistry {
|
|
8
|
+
type Interface = IOpenSearchQueryBuilderOperatorRegistry;
|
|
9
|
+
type Operator = OpenSearchQueryBuilderOperator.Interface;
|
|
10
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/exports/api.js";
|
|
2
|
+
const OpenSearchQueryBuilderOperatorRegistry = createAbstraction("OpenSearch/QueryBuilder/OperatorRegistry");
|
|
3
|
+
export { OpenSearchQueryBuilderOperatorRegistry };
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=OpenSearchQueryBuilderOperatorRegistry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.js","sources":["../../../../src/features/OpenSearchQueryBuilderOperator/abstractions/OpenSearchQueryBuilderOperatorRegistry.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/exports/api.js\";\nimport type { OpenSearchQueryBuilderOperator } from \"./OpenSearchQueryBuilderOperator.js\";\n\nexport interface IOpenSearchQueryBuilderOperatorRegistry {\n get(operator: string): OpenSearchQueryBuilderOperator.Interface | undefined;\n getAll(): OpenSearchQueryBuilderOperator.Interface[];\n}\n\nexport const OpenSearchQueryBuilderOperatorRegistry =\n createAbstraction<IOpenSearchQueryBuilderOperatorRegistry>(\n \"OpenSearch/QueryBuilder/OperatorRegistry\"\n );\n\nexport namespace OpenSearchQueryBuilderOperatorRegistry {\n export type Interface = IOpenSearchQueryBuilderOperatorRegistry;\n export type Operator = OpenSearchQueryBuilderOperator.Interface;\n}\n"],"names":["OpenSearchQueryBuilderOperatorRegistry","createAbstraction"],"mappings":";AAQO,MAAMA,yCACTC,kBACI"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { createFeature } from "@webiny/feature/api/index.js";
|
|
2
|
+
import { OpenSearchQueryBuilderOperatorRegistry } from "./OpenSearchQueryBuilderOperatorRegistry.js";
|
|
3
|
+
import { Equal } from "./operators/Equal.js";
|
|
4
|
+
import { Not } from "./operators/Not.js";
|
|
5
|
+
import { Contains } from "./operators/Contains.js";
|
|
6
|
+
import { NotContains } from "./operators/NotContains.js";
|
|
7
|
+
import { Between } from "./operators/Between.js";
|
|
8
|
+
import { NotBetween } from "./operators/NotBetween.js";
|
|
9
|
+
import { GreaterThan } from "./operators/GreaterThan.js";
|
|
10
|
+
import { GreaterThanOrEqual } from "./operators/GreaterThanOrEqual.js";
|
|
11
|
+
import { LesserThan } from "./operators/LesserThan.js";
|
|
12
|
+
import { LesserThanOrEqual } from "./operators/LesserThanOrEqual.js";
|
|
13
|
+
import { In } from "./operators/In.js";
|
|
14
|
+
import { AndIn } from "./operators/AndIn.js";
|
|
15
|
+
import { NotIn } from "./operators/NotIn.js";
|
|
16
|
+
import { StartsWith } from "./operators/StartsWith.js";
|
|
17
|
+
import { NotStartsWith } from "./operators/NotStartsWith.js";
|
|
18
|
+
const OpenSearchQueryBuilderOperatorFeature = createFeature({
|
|
19
|
+
name: "opensearch.internal.queryBuilderOperator",
|
|
20
|
+
register (container) {
|
|
21
|
+
container.register(Equal).inSingletonScope();
|
|
22
|
+
container.register(Not).inSingletonScope();
|
|
23
|
+
container.register(Contains).inSingletonScope();
|
|
24
|
+
container.register(NotContains).inSingletonScope();
|
|
25
|
+
container.register(Between).inSingletonScope();
|
|
26
|
+
container.register(NotBetween).inSingletonScope();
|
|
27
|
+
container.register(GreaterThan).inSingletonScope();
|
|
28
|
+
container.register(GreaterThanOrEqual).inSingletonScope();
|
|
29
|
+
container.register(LesserThan).inSingletonScope();
|
|
30
|
+
container.register(LesserThanOrEqual).inSingletonScope();
|
|
31
|
+
container.register(In).inSingletonScope();
|
|
32
|
+
container.register(AndIn).inSingletonScope();
|
|
33
|
+
container.register(NotIn).inSingletonScope();
|
|
34
|
+
container.register(StartsWith).inSingletonScope();
|
|
35
|
+
container.register(NotStartsWith).inSingletonScope();
|
|
36
|
+
container.register(OpenSearchQueryBuilderOperatorRegistry).inSingletonScope();
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
export { OpenSearchQueryBuilderOperatorFeature };
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/OpenSearchQueryBuilderOperator/feature.js","sources":["../../../src/features/OpenSearchQueryBuilderOperator/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api/index.js\";\nimport { OpenSearchQueryBuilderOperatorRegistry } from \"./OpenSearchQueryBuilderOperatorRegistry.js\";\nimport { Equal } from \"./operators/Equal.js\";\nimport { Not } from \"./operators/Not.js\";\nimport { Contains } from \"./operators/Contains.js\";\nimport { NotContains } from \"./operators/NotContains.js\";\nimport { Between } from \"./operators/Between.js\";\nimport { NotBetween } from \"./operators/NotBetween.js\";\nimport { GreaterThan } from \"./operators/GreaterThan.js\";\nimport { GreaterThanOrEqual } from \"./operators/GreaterThanOrEqual.js\";\nimport { LesserThan } from \"./operators/LesserThan.js\";\nimport { LesserThanOrEqual } from \"./operators/LesserThanOrEqual.js\";\nimport { In } from \"./operators/In.js\";\nimport { AndIn } from \"./operators/AndIn.js\";\nimport { NotIn } from \"./operators/NotIn.js\";\nimport { StartsWith } from \"./operators/StartsWith.js\";\nimport { NotStartsWith } from \"./operators/NotStartsWith.js\";\n\nexport const OpenSearchQueryBuilderOperatorFeature = createFeature({\n name: \"opensearch.internal.queryBuilderOperator\",\n register(container) {\n container.register(Equal).inSingletonScope();\n container.register(Not).inSingletonScope();\n container.register(Contains).inSingletonScope();\n container.register(NotContains).inSingletonScope();\n container.register(Between).inSingletonScope();\n container.register(NotBetween).inSingletonScope();\n container.register(GreaterThan).inSingletonScope();\n container.register(GreaterThanOrEqual).inSingletonScope();\n container.register(LesserThan).inSingletonScope();\n container.register(LesserThanOrEqual).inSingletonScope();\n container.register(In).inSingletonScope();\n container.register(AndIn).inSingletonScope();\n container.register(NotIn).inSingletonScope();\n container.register(StartsWith).inSingletonScope();\n container.register(NotStartsWith).inSingletonScope();\n container.register(OpenSearchQueryBuilderOperatorRegistry).inSingletonScope();\n }\n});\n"],"names":["OpenSearchQueryBuilderOperatorFeature","createFeature","container","Equal","Not","Contains","NotContains","Between","NotBetween","GreaterThan","GreaterThanOrEqual","LesserThan","LesserThanOrEqual","In","AndIn","NotIn","StartsWith","NotStartsWith","OpenSearchQueryBuilderOperatorRegistry"],"mappings":";;;;;;;;;;;;;;;;;AAkBO,MAAMA,wCAAwCC,cAAc;IAC/D,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC,OAAO,gBAAgB;QAC1CD,UAAU,QAAQ,CAACE,KAAK,gBAAgB;QACxCF,UAAU,QAAQ,CAACG,UAAU,gBAAgB;QAC7CH,UAAU,QAAQ,CAACI,aAAa,gBAAgB;QAChDJ,UAAU,QAAQ,CAACK,SAAS,gBAAgB;QAC5CL,UAAU,QAAQ,CAACM,YAAY,gBAAgB;QAC/CN,UAAU,QAAQ,CAACO,aAAa,gBAAgB;QAChDP,UAAU,QAAQ,CAACQ,oBAAoB,gBAAgB;QACvDR,UAAU,QAAQ,CAACS,YAAY,gBAAgB;QAC/CT,UAAU,QAAQ,CAACU,mBAAmB,gBAAgB;QACtDV,UAAU,QAAQ,CAACW,IAAI,gBAAgB;QACvCX,UAAU,QAAQ,CAACY,OAAO,gBAAgB;QAC1CZ,UAAU,QAAQ,CAACa,OAAO,gBAAgB;QAC1Cb,UAAU,QAAQ,CAACc,YAAY,gBAAgB;QAC/Cd,UAAU,QAAQ,CAACe,eAAe,gBAAgB;QAClDf,UAAU,QAAQ,CAACgB,wCAAwC,gBAAgB;IAC/E;AACJ"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
declare class AndInImpl implements OpenSearchQueryBuilderOperator.Interface {
|
|
3
|
+
getOperator(): string;
|
|
4
|
+
apply(query: OpenSearchQueryBuilderOperator.Query, params: OpenSearchQueryBuilderOperator.Params): void;
|
|
5
|
+
}
|
|
6
|
+
export declare const AndIn: typeof AndInImpl & {
|
|
7
|
+
__abstraction: import("@webiny/di").Abstraction<import("../abstractions/OpenSearchQueryBuilderOperator.js").IOpenSearchQueryBuilderOperator>;
|
|
8
|
+
};
|
|
9
|
+
export {};
|
package/{plugins/operator/andIn.js → features/OpenSearchQueryBuilderOperator/operators/AndIn.js}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
class
|
|
1
|
+
import { OpenSearchQueryBuilderOperator } from "../abstractions/OpenSearchQueryBuilderOperator.js";
|
|
2
|
+
class AndInImpl {
|
|
3
3
|
getOperator() {
|
|
4
4
|
return "and_in";
|
|
5
5
|
}
|
|
@@ -18,10 +18,11 @@ class OpenSearchQueryBuilderOperatorAndInPlugin extends OpenSearchQueryBuilderOp
|
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
constructor(...args){
|
|
22
|
-
super(...args), this.name = "opensearch.queryBuilder.operator.andIn.default";
|
|
23
|
-
}
|
|
24
21
|
}
|
|
25
|
-
|
|
22
|
+
const AndIn = OpenSearchQueryBuilderOperator.createImplementation({
|
|
23
|
+
implementation: AndInImpl,
|
|
24
|
+
dependencies: []
|
|
25
|
+
});
|
|
26
|
+
export { AndIn };
|
|
26
27
|
|
|
27
|
-
//# sourceMappingURL=
|
|
28
|
+
//# sourceMappingURL=AndIn.js.map
|