@webiny/api-headless-cms-ddb-es 0.0.0-unstable.40876133bb → 0.0.0-unstable.496cf268ac
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/configurations.js +0 -8
- package/configurations.js.map +1 -1
- package/definitions/entry.js +3 -5
- package/definitions/entry.js.map +1 -1
- package/definitions/entryElasticsearch.js +0 -5
- package/definitions/entryElasticsearch.js.map +1 -1
- package/definitions/group.js +0 -5
- package/definitions/group.js.map +1 -1
- package/definitions/model.js +22 -5
- package/definitions/model.js.map +1 -1
- package/definitions/settings.js +0 -5
- package/definitions/settings.js.map +1 -1
- package/definitions/system.js +0 -5
- package/definitions/system.js.map +1 -1
- package/definitions/table.js +0 -3
- package/definitions/table.js.map +1 -1
- package/definitions/tableElasticsearch.js +0 -3
- package/definitions/tableElasticsearch.js.map +1 -1
- package/dynamoDb/index.d.ts +1 -1
- package/dynamoDb/index.js +0 -5
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/storage/date.d.ts +2 -1
- package/dynamoDb/storage/date.js +4 -17
- package/dynamoDb/storage/date.js.map +1 -1
- package/dynamoDb/storage/longText.d.ts +1 -1
- package/dynamoDb/storage/longText.js +10 -18
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.d.ts +1 -1
- package/dynamoDb/storage/richText.js +12 -30
- package/dynamoDb/storage/richText.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.js +0 -11
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.js +0 -7
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/elasticsearch/index.js +0 -5
- package/elasticsearch/index.js.map +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.js +4 -21
- package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.js +15 -10
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
- package/elasticsearch/indexing/index.js +0 -9
- package/elasticsearch/indexing/index.js.map +1 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +4 -0
- package/elasticsearch/indexing/longTextIndexing.js +19 -9
- package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
- package/elasticsearch/indexing/numberIndexing.js +0 -9
- package/elasticsearch/indexing/numberIndexing.js.map +1 -1
- package/elasticsearch/indexing/objectIndexing.js +3 -30
- package/elasticsearch/indexing/objectIndexing.js.map +1 -1
- package/elasticsearch/indexing/richTextIndexing.js +0 -5
- package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
- package/elasticsearch/indices/base.js +0 -3
- package/elasticsearch/indices/base.js.map +1 -1
- package/elasticsearch/indices/index.js +0 -4
- package/elasticsearch/indices/index.js.map +1 -1
- package/elasticsearch/indices/japanese.js +0 -3
- package/elasticsearch/indices/japanese.js.map +1 -1
- package/elasticsearch/search/index.js +0 -4
- package/elasticsearch/search/index.js.map +1 -1
- package/elasticsearch/search/refSearch.js +4 -8
- package/elasticsearch/search/refSearch.js.map +1 -1
- package/elasticsearch/search/timeSearch.js +0 -7
- package/elasticsearch/search/timeSearch.js.map +1 -1
- package/helpers/entryIndexHelpers.js +20 -49
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/index.d.ts +0 -1
- package/helpers/index.js +0 -15
- package/helpers/index.js.map +1 -1
- package/index.js +19 -73
- package/index.js.map +1 -1
- package/operations/entry/dataLoaders.js +0 -52
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +18 -0
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +32 -0
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -0
- package/operations/entry/elasticsearch/body.d.ts +13 -0
- package/operations/entry/elasticsearch/body.js +140 -0
- package/operations/entry/elasticsearch/body.js.map +1 -0
- package/operations/entry/elasticsearch/fields.d.ts +9 -0
- package/operations/entry/elasticsearch/fields.js +229 -0
- package/operations/entry/elasticsearch/fields.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +8 -0
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +57 -0
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/exec.d.ts +17 -0
- package/operations/entry/elasticsearch/filtering/exec.js +172 -0
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/index.d.ts +1 -0
- package/operations/entry/elasticsearch/filtering/index.js +16 -0
- package/operations/entry/elasticsearch/filtering/index.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/path.d.ts +15 -0
- package/operations/entry/elasticsearch/filtering/path.js +44 -0
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +28 -0
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/index.js +13 -0
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +65 -0
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +48 -0
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/populated.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/populated.js +23 -0
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -0
- package/operations/entry/elasticsearch/filtering/values.d.ts +2 -0
- package/operations/entry/elasticsearch/filtering/values.js +22 -0
- package/operations/entry/elasticsearch/filtering/values.js.map +1 -0
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +12 -0
- package/operations/entry/elasticsearch/fullTextSearch.js +89 -0
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -0
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +8 -0
- package/operations/entry/elasticsearch/fullTextSearchFields.js +25 -0
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -0
- package/operations/entry/elasticsearch/initialQuery.d.ts +17 -0
- package/operations/entry/elasticsearch/initialQuery.js +103 -0
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -0
- package/operations/entry/elasticsearch/keyword.d.ts +2 -0
- package/operations/entry/elasticsearch/keyword.js +34 -0
- package/operations/entry/elasticsearch/keyword.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +9 -0
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +16 -0
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/operator.d.ts +8 -0
- package/operations/entry/elasticsearch/plugins/operator.js +37 -0
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +9 -0
- package/operations/entry/elasticsearch/plugins/queryModifier.js +16 -0
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/search.d.ts +7 -0
- package/{helpers/searchPluginsList.js → operations/entry/elasticsearch/plugins/search.js} +7 -9
- package/operations/entry/elasticsearch/plugins/search.js.map +1 -0
- package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +9 -0
- package/operations/entry/elasticsearch/plugins/sortModifier.js +16 -0
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -0
- package/operations/entry/elasticsearch/sort.d.ts +12 -0
- package/operations/entry/elasticsearch/sort.js +82 -0
- package/operations/entry/elasticsearch/sort.js.map +1 -0
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +16 -0
- package/{helpers → operations/entry/elasticsearch}/transformValueForSearch.js +7 -6
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -0
- package/operations/entry/elasticsearch/types.d.ts +41 -0
- package/operations/entry/elasticsearch/types.js +5 -0
- package/operations/entry/elasticsearch/types.js.map +1 -0
- package/operations/entry/index.d.ts +0 -2
- package/operations/entry/index.js +72 -210
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.js +0 -9
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.d.ts +3 -0
- package/operations/entry/recordType.js +18 -0
- package/operations/entry/recordType.js.map +1 -0
- package/operations/group/index.js +2 -32
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.js +1 -34
- package/operations/model/index.js.map +1 -1
- package/operations/settings/index.js +0 -24
- package/operations/settings/index.js.map +1 -1
- package/operations/system/index.js +0 -17
- package/operations/system/index.js.map +1 -1
- package/package.json +16 -16
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +1 -0
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +6 -8
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -6
- package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +23 -0
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +28 -0
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -0
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +0 -5
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +1 -0
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +6 -12
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +1 -0
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +6 -8
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +1 -0
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +6 -8
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +49 -0
- package/plugins/CmsEntryFilterPlugin.js +24 -0
- package/plugins/CmsEntryFilterPlugin.js.map +1 -0
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +11 -12
- package/plugins/index.js.map +1 -1
- package/types.js +0 -5
- package/types.js.map +1 -1
- package/helpers/createElasticsearchQueryBody.d.ts +0 -11
- package/helpers/createElasticsearchQueryBody.js +0 -611
- package/helpers/createElasticsearchQueryBody.js.map +0 -1
- package/helpers/fields.d.ts +0 -19
- package/helpers/fields.js +0 -205
- package/helpers/fields.js.map +0 -1
- package/helpers/searchPluginsList.d.ts +0 -6
- package/helpers/searchPluginsList.js.map +0 -1
- package/helpers/transformValueForSearch.d.ts +0 -12
- package/helpers/transformValueForSearch.js.map +0 -1
- package/operations/entry/elasticsearchFields.d.ts +0 -2
- package/operations/entry/elasticsearchFields.js +0 -38
- package/operations/entry/elasticsearchFields.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryElasticsearchBodyModifierPlugin","ElasticsearchBodyModifierPlugin","constructor","config","modifyBody","modelId"],"sources":["CmsEntryElasticsearchBodyModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchBodyModifierPlugin,\n ModifyBodyCallable,\n ModifyBodyParams as BaseModifyBodyParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyBodyParams extends BaseModifyBodyParams {\n model: CmsModel;\n where: {\n [key: string]: any;\n };\n}\n\nexport interface CmsEntryElasticsearchBodyModifierPluginConfig {\n modifyBody: ModifyBodyCallable<ModifyBodyParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin<ModifyBodyParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.body.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig) {\n super(config.modifyBody);\n\n this.modelId = config.modelId;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchBodyModifierPlugin","ElasticsearchBodyModifierPlugin","constructor","config","modifyBody","modelId","createCmsEntryElasticsearchBodyModifierPlugin"],"sources":["CmsEntryElasticsearchBodyModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchBodyModifierPlugin,\n ModifyBodyCallable,\n ModifyBodyParams as BaseModifyBodyParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyBodyParams extends BaseModifyBodyParams {\n model: CmsModel;\n where: {\n [key: string]: any;\n };\n}\n\nexport interface CmsEntryElasticsearchBodyModifierPluginConfig {\n modifyBody: ModifyBodyCallable<ModifyBodyParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin<ModifyBodyParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.body.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchBodyModifierPluginConfig) {\n super(config.modifyBody);\n\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchBodyModifierPlugin = (\n config: CmsEntryElasticsearchBodyModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchBodyModifierPlugin(config);\n};\n"],"mappings":";;;;;;;;AAAA;AAsBO,MAAMA,uCAAuC,SAASC,iDAA+B,CAAmB;EAKpGC,WAAW,CAACC,MAAqD,EAAE;IACtE,KAAK,CAACA,MAAM,CAACC,UAAU,CAAC;IAAC;IAEzB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAAC;AAAA,8BAVYL,uCAAuC,UACD,uCAAuC;AAWnF,MAAMM,6CAA6C,GACtDH,MAAqD,IACpD;EACD,OAAO,IAAIH,uCAAuC,CAACG,MAAM,CAAC;AAC9D,CAAC;AAAC"}
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.CmsEntryElasticsearchFieldPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
13
|
-
|
|
14
10
|
class CmsEntryElasticsearchFieldPlugin extends _apiElasticsearch.ElasticsearchFieldPlugin {
|
|
15
11
|
constructor(params) {
|
|
16
12
|
super(params);
|
|
17
13
|
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
18
14
|
this.modelId = params.modelId;
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
exports.CmsEntryElasticsearchFieldPlugin = CmsEntryElasticsearchFieldPlugin;
|
|
24
18
|
(0, _defineProperty2.default)(CmsEntryElasticsearchFieldPlugin, "type", "elasticsearch.fieldDefinition.cms.entry");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryElasticsearchFieldPlugin","ElasticsearchFieldPlugin","constructor","params","modelId"],"sources":["CmsEntryElasticsearchFieldPlugin.ts"],"sourcesContent":["import {\n ElasticsearchFieldPlugin,\n ElasticsearchFieldPluginParams as ElasticsearchFieldPluginParamsBaseParams\n} from \"@webiny/api-elasticsearch\";\n\nexport interface CmsEntryElasticsearchFieldPluginParams\n extends ElasticsearchFieldPluginParamsBaseParams {\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\nexport class CmsEntryElasticsearchFieldPlugin extends ElasticsearchFieldPlugin {\n public static override readonly type: string = \"elasticsearch.fieldDefinition.cms.entry\";\n\n public readonly modelId?: string;\n\n public constructor(params: CmsEntryElasticsearchFieldPluginParams) {\n super(params);\n\n this.modelId = params.modelId;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchFieldPlugin","ElasticsearchFieldPlugin","constructor","params","modelId"],"sources":["CmsEntryElasticsearchFieldPlugin.ts"],"sourcesContent":["import {\n ElasticsearchFieldPlugin,\n ElasticsearchFieldPluginParams as ElasticsearchFieldPluginParamsBaseParams\n} from \"@webiny/api-elasticsearch\";\n\nexport interface CmsEntryElasticsearchFieldPluginParams\n extends ElasticsearchFieldPluginParamsBaseParams {\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\nexport class CmsEntryElasticsearchFieldPlugin extends ElasticsearchFieldPlugin {\n public static override readonly type: string = \"elasticsearch.fieldDefinition.cms.entry\";\n\n public readonly modelId?: string;\n\n public constructor(params: CmsEntryElasticsearchFieldPluginParams) {\n super(params);\n\n this.modelId = params.modelId;\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAYO,MAAMA,gCAAgC,SAASC,0CAAwB,CAAC;EAKpEC,WAAW,CAACC,MAA8C,EAAE;IAC/D,KAAK,CAACA,MAAM,CAAC;IAAC;IAEd,IAAI,CAACC,OAAO,GAAGD,MAAM,CAACC,OAAO;EACjC;AACJ;AAAC;AAAA,8BAVYJ,gCAAgC,UACM,yCAAyC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
import { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
|
|
3
|
+
import { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
|
|
4
|
+
export interface CmsEntryElasticsearchFullTextSearchPluginCbParams {
|
|
5
|
+
model: CmsModel;
|
|
6
|
+
query: ElasticsearchBoolQueryConfig;
|
|
7
|
+
term: string;
|
|
8
|
+
fields: CmsModelField[];
|
|
9
|
+
createFieldPath: (field: CmsModelField) => string;
|
|
10
|
+
prepareTerm: (term: string) => string;
|
|
11
|
+
}
|
|
12
|
+
export interface CmsEntryElasticsearchFullTextSearchPluginParams {
|
|
13
|
+
models?: string[];
|
|
14
|
+
apply: (params: CmsEntryElasticsearchFullTextSearchPluginCbParams) => void;
|
|
15
|
+
}
|
|
16
|
+
export declare class CmsEntryElasticsearchFullTextSearchPlugin extends Plugin {
|
|
17
|
+
static readonly type: string;
|
|
18
|
+
private readonly params;
|
|
19
|
+
get models(): string[] | undefined;
|
|
20
|
+
constructor(params: CmsEntryElasticsearchFullTextSearchPluginParams);
|
|
21
|
+
apply(params: CmsEntryElasticsearchFullTextSearchPluginCbParams): void;
|
|
22
|
+
}
|
|
23
|
+
export declare const createCmsEntryElasticsearchFullTextSearchPlugin: (params: CmsEntryElasticsearchFullTextSearchPluginParams) => CmsEntryElasticsearchFullTextSearchPlugin;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createCmsEntryElasticsearchFullTextSearchPlugin = exports.CmsEntryElasticsearchFullTextSearchPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _plugins = require("@webiny/plugins");
|
|
10
|
+
class CmsEntryElasticsearchFullTextSearchPlugin extends _plugins.Plugin {
|
|
11
|
+
get models() {
|
|
12
|
+
return this.params.models;
|
|
13
|
+
}
|
|
14
|
+
constructor(params) {
|
|
15
|
+
super();
|
|
16
|
+
(0, _defineProperty2.default)(this, "params", void 0);
|
|
17
|
+
this.params = params;
|
|
18
|
+
}
|
|
19
|
+
apply(params) {
|
|
20
|
+
return this.params.apply(params);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.CmsEntryElasticsearchFullTextSearchPlugin = CmsEntryElasticsearchFullTextSearchPlugin;
|
|
24
|
+
(0, _defineProperty2.default)(CmsEntryElasticsearchFullTextSearchPlugin, "type", "headless-cms.elasticsearch.entry.fullTextSearch");
|
|
25
|
+
const createCmsEntryElasticsearchFullTextSearchPlugin = params => {
|
|
26
|
+
return new CmsEntryElasticsearchFullTextSearchPlugin(params);
|
|
27
|
+
};
|
|
28
|
+
exports.createCmsEntryElasticsearchFullTextSearchPlugin = createCmsEntryElasticsearchFullTextSearchPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchFullTextSearchPlugin","Plugin","models","params","constructor","apply","createCmsEntryElasticsearchFullTextSearchPlugin"],"sources":["CmsEntryElasticsearchFullTextSearchPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\nimport { CmsModel, CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CmsEntryElasticsearchFullTextSearchPluginCbParams {\n model: CmsModel;\n query: ElasticsearchBoolQueryConfig;\n term: string;\n fields: CmsModelField[];\n createFieldPath: (field: CmsModelField) => string;\n prepareTerm: (term: string) => string;\n}\nexport interface CmsEntryElasticsearchFullTextSearchPluginParams {\n models?: string[];\n apply: (params: CmsEntryElasticsearchFullTextSearchPluginCbParams) => void;\n}\nexport class CmsEntryElasticsearchFullTextSearchPlugin extends Plugin {\n public static override readonly type: string =\n \"headless-cms.elasticsearch.entry.fullTextSearch\";\n\n private readonly params: CmsEntryElasticsearchFullTextSearchPluginParams;\n\n public get models() {\n return this.params.models;\n }\n\n public constructor(params: CmsEntryElasticsearchFullTextSearchPluginParams) {\n super();\n this.params = params;\n }\n\n public apply(params: CmsEntryElasticsearchFullTextSearchPluginCbParams): void {\n return this.params.apply(params);\n }\n}\n\nexport const createCmsEntryElasticsearchFullTextSearchPlugin = (\n params: CmsEntryElasticsearchFullTextSearchPluginParams\n) => {\n return new CmsEntryElasticsearchFullTextSearchPlugin(params);\n};\n"],"mappings":";;;;;;;;AAAA;AAgBO,MAAMA,yCAAyC,SAASC,eAAM,CAAC;EAMlE,IAAWC,MAAM,GAAG;IAChB,OAAO,IAAI,CAACC,MAAM,CAACD,MAAM;EAC7B;EAEOE,WAAW,CAACD,MAAuD,EAAE;IACxE,KAAK,EAAE;IAAC;IACR,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOE,KAAK,CAACF,MAAyD,EAAQ;IAC1E,OAAO,IAAI,CAACA,MAAM,CAACE,KAAK,CAACF,MAAM,CAAC;EACpC;AACJ;AAAC;AAAA,8BAlBYH,yCAAyC,UAE9C,iDAAiD;AAkBlD,MAAMM,+CAA+C,GACxDH,MAAuD,IACtD;EACD,OAAO,IAAIH,yCAAyC,CAACG,MAAM,CAAC;AAChE,CAAC;AAAC"}
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.CmsEntryElasticsearchIndexPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
13
|
-
|
|
14
10
|
class CmsEntryElasticsearchIndexPlugin extends _apiElasticsearch.ElasticsearchIndexPlugin {}
|
|
15
|
-
|
|
16
11
|
exports.CmsEntryElasticsearchIndexPlugin = CmsEntryElasticsearchIndexPlugin;
|
|
17
12
|
(0, _defineProperty2.default)(CmsEntryElasticsearchIndexPlugin, "type", "cms.entry.elasticsearch.index");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryElasticsearchIndexPlugin","ElasticsearchIndexPlugin"],"sources":["CmsEntryElasticsearchIndexPlugin.ts"],"sourcesContent":["import { ElasticsearchIndexPlugin } from \"@webiny/api-elasticsearch\";\n\nexport class CmsEntryElasticsearchIndexPlugin extends ElasticsearchIndexPlugin {\n public static override readonly type: string = \"cms.entry.elasticsearch.index\";\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchIndexPlugin","ElasticsearchIndexPlugin"],"sources":["CmsEntryElasticsearchIndexPlugin.ts"],"sourcesContent":["import { ElasticsearchIndexPlugin } from \"@webiny/api-elasticsearch\";\n\nexport class CmsEntryElasticsearchIndexPlugin extends ElasticsearchIndexPlugin {\n public static override readonly type: string = \"cms.entry.elasticsearch.index\";\n}\n"],"mappings":";;;;;;;;AAAA;AAEO,MAAMA,gCAAgC,SAASC,0CAAwB,CAAC;AAE9E;AAAA,8BAFYD,gCAAgC,UACM,+BAA+B"}
|
|
@@ -28,3 +28,4 @@ export declare class CmsEntryElasticsearchQueryBuilderValueSearchPlugin extends
|
|
|
28
28
|
transform(params: TransformCallableParams): any;
|
|
29
29
|
createPath(params: CreatePathCallableParams): string | null;
|
|
30
30
|
}
|
|
31
|
+
export declare const createCmsEntryElasticsearchQueryBuilderValueSearchPlugin: (params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams) => CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
|
|
@@ -1,43 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.CmsEntryElasticsearchQueryBuilderValueSearchPlugin = void 0;
|
|
9
|
-
|
|
7
|
+
exports.createCmsEntryElasticsearchQueryBuilderValueSearchPlugin = exports.CmsEntryElasticsearchQueryBuilderValueSearchPlugin = void 0;
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _Plugin = require("@webiny/plugins/Plugin");
|
|
13
|
-
|
|
14
10
|
class CmsEntryElasticsearchQueryBuilderValueSearchPlugin extends _Plugin.Plugin {
|
|
15
11
|
get fieldType() {
|
|
16
12
|
return this.config.fieldType;
|
|
17
13
|
}
|
|
18
|
-
|
|
19
14
|
constructor(params) {
|
|
20
15
|
super();
|
|
21
16
|
(0, _defineProperty2.default)(this, "config", void 0);
|
|
22
17
|
this.config = params;
|
|
23
18
|
this.name = `${this.constructor.type}-${this.config.fieldType}`;
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
transform(params) {
|
|
27
21
|
return this.config.transform(params);
|
|
28
22
|
}
|
|
29
|
-
|
|
30
23
|
createPath(params) {
|
|
31
24
|
if (typeof this.config.path === "function") {
|
|
32
25
|
return this.config.path(params);
|
|
33
26
|
} else if (typeof this.config.path === "string") {
|
|
34
27
|
return this.config.path;
|
|
35
28
|
}
|
|
36
|
-
|
|
37
29
|
return null;
|
|
38
30
|
}
|
|
39
|
-
|
|
40
31
|
}
|
|
41
|
-
|
|
42
32
|
exports.CmsEntryElasticsearchQueryBuilderValueSearchPlugin = CmsEntryElasticsearchQueryBuilderValueSearchPlugin;
|
|
43
|
-
(0, _defineProperty2.default)(CmsEntryElasticsearchQueryBuilderValueSearchPlugin, "type", "cms-elastic-search-query-builder-value-search");
|
|
33
|
+
(0, _defineProperty2.default)(CmsEntryElasticsearchQueryBuilderValueSearchPlugin, "type", "cms-elastic-search-query-builder-value-search");
|
|
34
|
+
const createCmsEntryElasticsearchQueryBuilderValueSearchPlugin = params => {
|
|
35
|
+
return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin(params);
|
|
36
|
+
};
|
|
37
|
+
exports.createCmsEntryElasticsearchQueryBuilderValueSearchPlugin = createCmsEntryElasticsearchQueryBuilderValueSearchPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin","Plugin","fieldType","config","constructor","params","name","type","transform","createPath","path"],"sources":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams<T = any> {\n field: CmsModelField;\n key: string;\n value: T;\n}\n\nexport interface CreatePathCallable<T = any> {\n (params: CreatePathCallableParams<T>): string;\n}\n\nexport interface TransformCallableParams<T = any> {\n field: CmsModelField;\n value: T;\n}\nexport interface TransformCallable<T = any> {\n (params: TransformCallableParams<T>): string;\n}\n\nexport interface CmsEntryElasticsearchQueryBuilderValueSearchPluginParams {\n fieldType: string;\n path?: string | CreatePathCallable;\n transform: TransformCallable;\n}\nexport class CmsEntryElasticsearchQueryBuilderValueSearchPlugin extends Plugin {\n public static override readonly type: string = \"cms-elastic-search-query-builder-value-search\";\n\n private readonly config: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams) {\n super();\n\n this.config = params;\n this.name = `${(this.constructor as any).type}-${this.config.fieldType}`;\n }\n\n public transform(params: TransformCallableParams): any {\n return this.config.transform(params);\n }\n\n public createPath(params: CreatePathCallableParams): string | null {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n return null;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin","Plugin","fieldType","config","constructor","params","name","type","transform","createPath","path","createCmsEntryElasticsearchQueryBuilderValueSearchPlugin"],"sources":["CmsEntryElasticsearchQueryBuilderValueSearchPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/Plugin\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams<T = any> {\n field: CmsModelField;\n key: string;\n value: T;\n}\n\nexport interface CreatePathCallable<T = any> {\n (params: CreatePathCallableParams<T>): string;\n}\n\nexport interface TransformCallableParams<T = any> {\n field: CmsModelField;\n value: T;\n}\nexport interface TransformCallable<T = any> {\n (params: TransformCallableParams<T>): string;\n}\n\nexport interface CmsEntryElasticsearchQueryBuilderValueSearchPluginParams {\n fieldType: string;\n path?: string | CreatePathCallable;\n transform: TransformCallable;\n}\nexport class CmsEntryElasticsearchQueryBuilderValueSearchPlugin extends Plugin {\n public static override readonly type: string = \"cms-elastic-search-query-builder-value-search\";\n\n private readonly config: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams) {\n super();\n\n this.config = params;\n this.name = `${(this.constructor as any).type}-${this.config.fieldType}`;\n }\n\n public transform(params: TransformCallableParams): any {\n return this.config.transform(params);\n }\n\n public createPath(params: CreatePathCallableParams): string | null {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n return null;\n }\n}\n\nexport const createCmsEntryElasticsearchQueryBuilderValueSearchPlugin = (\n params: CmsEntryElasticsearchQueryBuilderValueSearchPluginParams\n) => {\n return new CmsEntryElasticsearchQueryBuilderValueSearchPlugin(params);\n};\n"],"mappings":";;;;;;;;AAAA;AA0BO,MAAMA,kDAAkD,SAASC,cAAM,CAAC;EAK3E,IAAWC,SAAS,GAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEOE,WAAW,CAACC,MAAgE,EAAE;IACjF,KAAK,EAAE;IAAC;IAER,IAAI,CAACF,MAAM,GAAGE,MAAM;IACpB,IAAI,CAACC,IAAI,GAAI,GAAG,IAAI,CAACF,WAAW,CAASG,IAAK,IAAG,IAAI,CAACJ,MAAM,CAACD,SAAU,EAAC;EAC5E;EAEOM,SAAS,CAACH,MAA+B,EAAO;IACnD,OAAO,IAAI,CAACF,MAAM,CAACK,SAAS,CAACH,MAAM,CAAC;EACxC;EAEOI,UAAU,CAACJ,MAAgC,EAAiB;IAC/D,IAAI,OAAO,IAAI,CAACF,MAAM,CAACO,IAAI,KAAK,UAAU,EAAE;MACxC,OAAO,IAAI,CAACP,MAAM,CAACO,IAAI,CAACL,MAAM,CAAC;IACnC,CAAC,MAAM,IAAI,OAAO,IAAI,CAACF,MAAM,CAACO,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO,IAAI,CAACP,MAAM,CAACO,IAAI;IAC3B;IACA,OAAO,IAAI;EACf;AACJ;AAAC;AAAA,8BA5BYV,kDAAkD,UACZ,+CAA+C;AA6B3F,MAAMW,wDAAwD,GACjEN,MAAgE,IAC/D;EACD,OAAO,IAAIL,kDAAkD,CAACK,MAAM,CAAC;AACzE,CAAC;AAAC"}
|
|
@@ -15,3 +15,4 @@ export declare class CmsEntryElasticsearchQueryModifierPlugin extends Elasticsea
|
|
|
15
15
|
readonly modelId?: string;
|
|
16
16
|
constructor(config: CmsEntryElasticsearchQueryModifierPluginConfig);
|
|
17
17
|
}
|
|
18
|
+
export declare const createCmsEntryElasticsearchQueryModifierPlugin: (config: CmsEntryElasticsearchQueryModifierPluginConfig) => CmsEntryElasticsearchQueryModifierPlugin;
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.CmsEntryElasticsearchQueryModifierPlugin = void 0;
|
|
9
|
-
|
|
7
|
+
exports.createCmsEntryElasticsearchQueryModifierPlugin = exports.CmsEntryElasticsearchQueryModifierPlugin = void 0;
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
13
|
-
|
|
14
10
|
class CmsEntryElasticsearchQueryModifierPlugin extends _apiElasticsearch.ElasticsearchQueryModifierPlugin {
|
|
15
11
|
constructor(config) {
|
|
16
12
|
super(config.modifyQuery);
|
|
17
13
|
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
18
14
|
this.modelId = config.modelId;
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
exports.CmsEntryElasticsearchQueryModifierPlugin = CmsEntryElasticsearchQueryModifierPlugin;
|
|
24
|
-
(0, _defineProperty2.default)(CmsEntryElasticsearchQueryModifierPlugin, "type", "cms.elasticsearch.modifier.query.entry");
|
|
18
|
+
(0, _defineProperty2.default)(CmsEntryElasticsearchQueryModifierPlugin, "type", "cms.elasticsearch.modifier.query.entry");
|
|
19
|
+
const createCmsEntryElasticsearchQueryModifierPlugin = config => {
|
|
20
|
+
return new CmsEntryElasticsearchQueryModifierPlugin(config);
|
|
21
|
+
};
|
|
22
|
+
exports.createCmsEntryElasticsearchQueryModifierPlugin = createCmsEntryElasticsearchQueryModifierPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryElasticsearchQueryModifierPlugin","ElasticsearchQueryModifierPlugin","constructor","config","modifyQuery","modelId"],"sources":["CmsEntryElasticsearchQueryModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchQueryModifierPlugin,\n ModifyQueryCallable,\n ModifyQueryParams as BaseModifyQueryParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyQueryParams extends BaseModifyQueryParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchQueryModifierPluginConfig {\n modifyQuery: ModifyQueryCallable<ModifyQueryParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchQueryModifierPlugin extends ElasticsearchQueryModifierPlugin<ModifyQueryParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.query.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchQueryModifierPluginConfig) {\n super(config.modifyQuery);\n\n this.modelId = config.modelId;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchQueryModifierPlugin","ElasticsearchQueryModifierPlugin","constructor","config","modifyQuery","modelId","createCmsEntryElasticsearchQueryModifierPlugin"],"sources":["CmsEntryElasticsearchQueryModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchQueryModifierPlugin,\n ModifyQueryCallable,\n ModifyQueryParams as BaseModifyQueryParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifyQueryParams extends BaseModifyQueryParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchQueryModifierPluginConfig {\n modifyQuery: ModifyQueryCallable<ModifyQueryParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchQueryModifierPlugin extends ElasticsearchQueryModifierPlugin<ModifyQueryParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.query.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchQueryModifierPluginConfig) {\n super(config.modifyQuery);\n\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchQueryModifierPlugin = (\n config: CmsEntryElasticsearchQueryModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchQueryModifierPlugin(config);\n};\n"],"mappings":";;;;;;;;AAAA;AAmBO,MAAMA,wCAAwC,SAASC,kDAAgC,CAAoB;EAKvGC,WAAW,CAACC,MAAsD,EAAE;IACvE,KAAK,CAACA,MAAM,CAACC,WAAW,CAAC;IAAC;IAE1B,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAAC;AAAA,8BAVYL,wCAAwC,UACF,wCAAwC;AAWpF,MAAMM,8CAA8C,GACvDH,MAAsD,IACrD;EACD,OAAO,IAAIH,wCAAwC,CAACG,MAAM,CAAC;AAC/D,CAAC;AAAC"}
|
|
@@ -15,3 +15,4 @@ export declare class CmsEntryElasticsearchSortModifierPlugin extends Elasticsear
|
|
|
15
15
|
readonly modelId?: string;
|
|
16
16
|
constructor(config: CmsEntryElasticsearchSortModifierPluginConfig);
|
|
17
17
|
}
|
|
18
|
+
export declare const createCmsEntryElasticsearchSortModifierPlugin: (config: CmsEntryElasticsearchSortModifierPluginConfig) => CmsEntryElasticsearchSortModifierPlugin;
|
|
@@ -1,24 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
|
-
exports.CmsEntryElasticsearchSortModifierPlugin = void 0;
|
|
9
|
-
|
|
7
|
+
exports.createCmsEntryElasticsearchSortModifierPlugin = exports.CmsEntryElasticsearchSortModifierPlugin = void 0;
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
13
|
-
|
|
14
10
|
class CmsEntryElasticsearchSortModifierPlugin extends _apiElasticsearch.ElasticsearchSortModifierPlugin {
|
|
15
11
|
constructor(config) {
|
|
16
12
|
super(config.modifySort);
|
|
17
13
|
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
18
14
|
this.modelId = config.modelId;
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
}
|
|
22
|
-
|
|
23
17
|
exports.CmsEntryElasticsearchSortModifierPlugin = CmsEntryElasticsearchSortModifierPlugin;
|
|
24
|
-
(0, _defineProperty2.default)(CmsEntryElasticsearchSortModifierPlugin, "type", "cms.elasticsearch.modifier.sort.entry");
|
|
18
|
+
(0, _defineProperty2.default)(CmsEntryElasticsearchSortModifierPlugin, "type", "cms.elasticsearch.modifier.sort.entry");
|
|
19
|
+
const createCmsEntryElasticsearchSortModifierPlugin = config => {
|
|
20
|
+
return new CmsEntryElasticsearchSortModifierPlugin(config);
|
|
21
|
+
};
|
|
22
|
+
exports.createCmsEntryElasticsearchSortModifierPlugin = createCmsEntryElasticsearchSortModifierPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryElasticsearchSortModifierPlugin","ElasticsearchSortModifierPlugin","constructor","config","modifySort","modelId"],"sources":["CmsEntryElasticsearchSortModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchSortModifierPlugin,\n ModifySortCallable,\n ModifySortParams as BaseModifySortParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifySortParams extends BaseModifySortParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchSortModifierPluginConfig {\n modifySort: ModifySortCallable<ModifySortParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchSortModifierPlugin extends ElasticsearchSortModifierPlugin<ModifySortParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.sort.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchSortModifierPluginConfig) {\n super(config.modifySort);\n this.modelId = config.modelId;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchSortModifierPlugin","ElasticsearchSortModifierPlugin","constructor","config","modifySort","modelId","createCmsEntryElasticsearchSortModifierPlugin"],"sources":["CmsEntryElasticsearchSortModifierPlugin.ts"],"sourcesContent":["import {\n ElasticsearchSortModifierPlugin,\n ModifySortCallable,\n ModifySortParams as BaseModifySortParams\n} from \"@webiny/api-elasticsearch\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\nexport interface ModifySortParams extends BaseModifySortParams {\n model: CmsModel;\n}\n\nexport interface CmsEntryElasticsearchSortModifierPluginConfig {\n modifySort: ModifySortCallable<ModifySortParams>;\n /**\n * If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.\n */\n modelId?: string;\n}\n\nexport class CmsEntryElasticsearchSortModifierPlugin extends ElasticsearchSortModifierPlugin<ModifySortParams> {\n public static override readonly type: string = \"cms.elasticsearch.modifier.sort.entry\";\n\n public readonly modelId?: string;\n\n public constructor(config: CmsEntryElasticsearchSortModifierPluginConfig) {\n super(config.modifySort);\n this.modelId = config.modelId;\n }\n}\n\nexport const createCmsEntryElasticsearchSortModifierPlugin = (\n config: CmsEntryElasticsearchSortModifierPluginConfig\n) => {\n return new CmsEntryElasticsearchSortModifierPlugin(config);\n};\n"],"mappings":";;;;;;;;AAAA;AAmBO,MAAMA,uCAAuC,SAASC,iDAA+B,CAAmB;EAKpGC,WAAW,CAACC,MAAqD,EAAE;IACtE,KAAK,CAACA,MAAM,CAACC,UAAU,CAAC;IAAC;IACzB,IAAI,CAACC,OAAO,GAAGF,MAAM,CAACE,OAAO;EACjC;AACJ;AAAC;AAAA,8BATYL,uCAAuC,UACD,uCAAuC;AAUnF,MAAMM,6CAA6C,GACtDH,MAAqD,IACpD;EACD,OAAO,IAAIH,uCAAuC,CAACG,MAAM,CAAC;AAC9D,CAAC;AAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
import { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin";
|
|
3
|
+
import { ModelField, ModelFields } from "../operations/entry/elasticsearch/types";
|
|
4
|
+
import { ElasticsearchBoolQueryConfig } from "@webiny/api-elasticsearch/types";
|
|
5
|
+
interface CmsEntryFilterPluginConfig {
|
|
6
|
+
fieldType: string;
|
|
7
|
+
exec: (params: ExecParams) => void;
|
|
8
|
+
}
|
|
9
|
+
interface ApplyParams {
|
|
10
|
+
key: string;
|
|
11
|
+
value: any;
|
|
12
|
+
query: ElasticsearchBoolQueryConfig;
|
|
13
|
+
operator: string;
|
|
14
|
+
field: ModelField;
|
|
15
|
+
}
|
|
16
|
+
export interface ApplyFilteringCb {
|
|
17
|
+
(params: ApplyParams): void;
|
|
18
|
+
}
|
|
19
|
+
export interface GetFilterPluginCb {
|
|
20
|
+
(type: string): CmsEntryFilterPlugin;
|
|
21
|
+
}
|
|
22
|
+
interface ExecParams {
|
|
23
|
+
applyFiltering: ApplyFilteringCb;
|
|
24
|
+
getFilterPlugin: GetFilterPluginCb;
|
|
25
|
+
key: string;
|
|
26
|
+
value: any;
|
|
27
|
+
operator: string;
|
|
28
|
+
field: ModelField;
|
|
29
|
+
fields: ModelFields;
|
|
30
|
+
query: ElasticsearchBoolQueryConfig;
|
|
31
|
+
}
|
|
32
|
+
export interface CmsEntryFilterPluginCreateResponse {
|
|
33
|
+
field: ModelField;
|
|
34
|
+
path: string;
|
|
35
|
+
fieldPathId: string;
|
|
36
|
+
plugin: ValueFilterPlugin;
|
|
37
|
+
negate: boolean;
|
|
38
|
+
compareValue: any;
|
|
39
|
+
transformValue: <I = any, O = any>(value: I) => O;
|
|
40
|
+
}
|
|
41
|
+
export declare class CmsEntryFilterPlugin extends Plugin {
|
|
42
|
+
static readonly type: string;
|
|
43
|
+
static readonly ALL: string;
|
|
44
|
+
private readonly config;
|
|
45
|
+
readonly fieldType: string;
|
|
46
|
+
constructor(config: CmsEntryFilterPluginConfig);
|
|
47
|
+
exec(params: ExecParams): void;
|
|
48
|
+
}
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.CmsEntryFilterPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _plugins = require("@webiny/plugins");
|
|
10
|
+
class CmsEntryFilterPlugin extends _plugins.Plugin {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
super();
|
|
13
|
+
(0, _defineProperty2.default)(this, "config", void 0);
|
|
14
|
+
(0, _defineProperty2.default)(this, "fieldType", void 0);
|
|
15
|
+
this.config = config;
|
|
16
|
+
this.fieldType = this.config.fieldType;
|
|
17
|
+
}
|
|
18
|
+
exec(params) {
|
|
19
|
+
return this.config.exec(params);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.CmsEntryFilterPlugin = CmsEntryFilterPlugin;
|
|
23
|
+
(0, _defineProperty2.default)(CmsEntryFilterPlugin, "type", "cms.elasticsearch.entry.filter");
|
|
24
|
+
(0, _defineProperty2.default)(CmsEntryFilterPlugin, "ALL", "*");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsEntryFilterPlugin","Plugin","constructor","config","fieldType","exec","params"],"sources":["CmsEntryFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport { ModelField, ModelFields } from \"~/operations/entry/elasticsearch/types\";\nimport { ElasticsearchBoolQueryConfig } from \"@webiny/api-elasticsearch/types\";\n\ninterface CmsEntryFilterPluginConfig {\n fieldType: string;\n exec: (params: ExecParams) => void;\n}\ninterface ApplyParams {\n key: string;\n value: any;\n query: ElasticsearchBoolQueryConfig;\n operator: string;\n field: ModelField;\n}\nexport interface ApplyFilteringCb {\n (params: ApplyParams): void;\n}\n\nexport interface GetFilterPluginCb {\n (type: string): CmsEntryFilterPlugin;\n}\n\ninterface ExecParams {\n applyFiltering: ApplyFilteringCb;\n getFilterPlugin: GetFilterPluginCb;\n key: string;\n value: any;\n operator: string;\n field: ModelField;\n fields: ModelFields;\n query: ElasticsearchBoolQueryConfig;\n}\n\nexport interface CmsEntryFilterPluginCreateResponse {\n field: ModelField;\n path: string;\n fieldPathId: string;\n plugin: ValueFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport class CmsEntryFilterPlugin extends Plugin {\n public static override readonly type: string = \"cms.elasticsearch.entry.filter\";\n public static readonly ALL: string = \"*\";\n\n private readonly config: CmsEntryFilterPluginConfig;\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFilterPluginConfig) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public exec(params: ExecParams) {\n return this.config.exec(params);\n }\n}\n"],"mappings":";;;;;;;;AAAA;AA6CO,MAAMA,oBAAoB,SAASC,eAAM,CAAC;EAOtCC,WAAW,CAACC,MAAkC,EAAE;IACnD,KAAK,EAAE;IAAC;IAAA;IACR,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACD,MAAM,CAACC,SAAS;EAC1C;EAEOC,IAAI,CAACC,MAAkB,EAAE;IAC5B,OAAO,IAAI,CAACH,MAAM,CAACE,IAAI,CAACC,MAAM,CAAC;EACnC;AACJ;AAAC;AAAA,8BAhBYN,oBAAoB,UACkB,gCAAgC;AAAA,8BADtEA,oBAAoB,SAEQ,GAAG"}
|
package/plugins/index.d.ts
CHANGED
|
@@ -4,3 +4,4 @@ export * from "./CmsEntryElasticsearchIndexPlugin";
|
|
|
4
4
|
export * from "./CmsEntryElasticsearchQueryBuilderValueSearchPlugin";
|
|
5
5
|
export * from "./CmsEntryElasticsearchQueryModifierPlugin";
|
|
6
6
|
export * from "./CmsEntryElasticsearchSortModifierPlugin";
|
|
7
|
+
export * from "./CmsEntryElasticsearchFullTextSearchPlugin";
|
package/plugins/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _CmsEntryElasticsearchBodyModifierPlugin = require("./CmsEntryElasticsearchBodyModifierPlugin");
|
|
8
|
-
|
|
9
7
|
Object.keys(_CmsEntryElasticsearchBodyModifierPlugin).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _CmsEntryElasticsearchBodyModifierPlugin[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_CmsEntryElasticsearchBodyModifierPlugin).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _CmsEntryElasticsearchFieldPlugin = require("./CmsEntryElasticsearchFieldPlugin");
|
|
21
|
-
|
|
22
18
|
Object.keys(_CmsEntryElasticsearchFieldPlugin).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _CmsEntryElasticsearchFieldPlugin[key]) return;
|
|
@@ -29,9 +25,7 @@ Object.keys(_CmsEntryElasticsearchFieldPlugin).forEach(function (key) {
|
|
|
29
25
|
}
|
|
30
26
|
});
|
|
31
27
|
});
|
|
32
|
-
|
|
33
28
|
var _CmsEntryElasticsearchIndexPlugin = require("./CmsEntryElasticsearchIndexPlugin");
|
|
34
|
-
|
|
35
29
|
Object.keys(_CmsEntryElasticsearchIndexPlugin).forEach(function (key) {
|
|
36
30
|
if (key === "default" || key === "__esModule") return;
|
|
37
31
|
if (key in exports && exports[key] === _CmsEntryElasticsearchIndexPlugin[key]) return;
|
|
@@ -42,9 +36,7 @@ Object.keys(_CmsEntryElasticsearchIndexPlugin).forEach(function (key) {
|
|
|
42
36
|
}
|
|
43
37
|
});
|
|
44
38
|
});
|
|
45
|
-
|
|
46
39
|
var _CmsEntryElasticsearchQueryBuilderValueSearchPlugin = require("./CmsEntryElasticsearchQueryBuilderValueSearchPlugin");
|
|
47
|
-
|
|
48
40
|
Object.keys(_CmsEntryElasticsearchQueryBuilderValueSearchPlugin).forEach(function (key) {
|
|
49
41
|
if (key === "default" || key === "__esModule") return;
|
|
50
42
|
if (key in exports && exports[key] === _CmsEntryElasticsearchQueryBuilderValueSearchPlugin[key]) return;
|
|
@@ -55,9 +47,7 @@ Object.keys(_CmsEntryElasticsearchQueryBuilderValueSearchPlugin).forEach(functio
|
|
|
55
47
|
}
|
|
56
48
|
});
|
|
57
49
|
});
|
|
58
|
-
|
|
59
50
|
var _CmsEntryElasticsearchQueryModifierPlugin = require("./CmsEntryElasticsearchQueryModifierPlugin");
|
|
60
|
-
|
|
61
51
|
Object.keys(_CmsEntryElasticsearchQueryModifierPlugin).forEach(function (key) {
|
|
62
52
|
if (key === "default" || key === "__esModule") return;
|
|
63
53
|
if (key in exports && exports[key] === _CmsEntryElasticsearchQueryModifierPlugin[key]) return;
|
|
@@ -68,9 +58,7 @@ Object.keys(_CmsEntryElasticsearchQueryModifierPlugin).forEach(function (key) {
|
|
|
68
58
|
}
|
|
69
59
|
});
|
|
70
60
|
});
|
|
71
|
-
|
|
72
61
|
var _CmsEntryElasticsearchSortModifierPlugin = require("./CmsEntryElasticsearchSortModifierPlugin");
|
|
73
|
-
|
|
74
62
|
Object.keys(_CmsEntryElasticsearchSortModifierPlugin).forEach(function (key) {
|
|
75
63
|
if (key === "default" || key === "__esModule") return;
|
|
76
64
|
if (key in exports && exports[key] === _CmsEntryElasticsearchSortModifierPlugin[key]) return;
|
|
@@ -80,4 +68,15 @@ Object.keys(_CmsEntryElasticsearchSortModifierPlugin).forEach(function (key) {
|
|
|
80
68
|
return _CmsEntryElasticsearchSortModifierPlugin[key];
|
|
81
69
|
}
|
|
82
70
|
});
|
|
71
|
+
});
|
|
72
|
+
var _CmsEntryElasticsearchFullTextSearchPlugin = require("./CmsEntryElasticsearchFullTextSearchPlugin");
|
|
73
|
+
Object.keys(_CmsEntryElasticsearchFullTextSearchPlugin).forEach(function (key) {
|
|
74
|
+
if (key === "default" || key === "__esModule") return;
|
|
75
|
+
if (key in exports && exports[key] === _CmsEntryElasticsearchFullTextSearchPlugin[key]) return;
|
|
76
|
+
Object.defineProperty(exports, key, {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
get: function () {
|
|
79
|
+
return _CmsEntryElasticsearchFullTextSearchPlugin[key];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
83
82
|
});
|
package/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryElasticsearchBodyModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchFieldPlugin\";\nexport * from \"./CmsEntryElasticsearchIndexPlugin\";\nexport * from \"./CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\nexport * from \"./CmsEntryElasticsearchQueryModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchSortModifierPlugin\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryElasticsearchBodyModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchFieldPlugin\";\nexport * from \"./CmsEntryElasticsearchIndexPlugin\";\nexport * from \"./CmsEntryElasticsearchQueryBuilderValueSearchPlugin\";\nexport * from \"./CmsEntryElasticsearchQueryModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchSortModifierPlugin\";\nexport * from \"./CmsEntryElasticsearchFullTextSearchPlugin\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/types.js
CHANGED
|
@@ -4,28 +4,24 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ENTITIES = void 0;
|
|
7
|
-
|
|
8
7
|
/**
|
|
9
8
|
* A definition of the entry that is being prepared for the Elasticsearch.
|
|
10
9
|
*
|
|
11
10
|
* @category Elasticsearch
|
|
12
11
|
* @category CmsEntry
|
|
13
12
|
*/
|
|
14
|
-
|
|
15
13
|
/**
|
|
16
14
|
* Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.
|
|
17
15
|
*
|
|
18
16
|
* @category Elasticsearch
|
|
19
17
|
* @category CmsEntry
|
|
20
18
|
*/
|
|
21
|
-
|
|
22
19
|
/**
|
|
23
20
|
* Arguments for the method that is transforming content entry from Elasticsearch into the original one.
|
|
24
21
|
*
|
|
25
22
|
* @category Elasticsearch
|
|
26
23
|
* @category CmsEntry
|
|
27
24
|
*/
|
|
28
|
-
|
|
29
25
|
/**
|
|
30
26
|
* A plugin defining transformation of entry for Elasticsearch.
|
|
31
27
|
*
|
|
@@ -36,7 +32,6 @@ exports.ENTITIES = void 0;
|
|
|
36
32
|
*/
|
|
37
33
|
let ENTITIES;
|
|
38
34
|
exports.ENTITIES = ENTITIES;
|
|
39
|
-
|
|
40
35
|
(function (ENTITIES) {
|
|
41
36
|
ENTITIES["SYSTEM"] = "CmsSystem";
|
|
42
37
|
ENTITIES["SETTINGS"] = "CmsSettings";
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import { Plugin, PluginCollection } from \"@webiny/plugins/types\";\nimport {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport { DynamoDBTypes, TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry extends CmsEntry {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Record<string, any>;\n /**\n * A first part of the ID, without the revision.\n * For example, we can search for all the revisions of the given entry.\n */\n primaryId: string;\n /**\n * Dev can add what ever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\n/**\n * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\ninterface CmsModelFieldToElasticsearchToParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n /**\n * Raw value on the entry - before prepare for storage.\n */\n rawValue: any;\n /**\n * Value prepared for storage received from base api-headless-cms package.\n */\n value: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * Arguments for the method that is transforming content entry from Elasticsearch into the original one.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\ninterface CmsModelFieldToElasticsearchFromParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n value: any;\n rawValue: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\ninterface ToIndexValue {\n /**\n * Use this key to store value for indexing.\n */\n value?: any;\n /**\n * Use this key to tell ES that this value should not be indexed.\n */\n rawValue?: any;\n}\n\n/**\n * A plugin defining transformation of entry for Elasticsearch.\n *\n * @category Plugin\n * @category ContentModelField\n * @category CmsEntry\n * @category Elasticsearch\n */\nexport interface CmsModelFieldToElasticsearchPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-elastic-search\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: string;\n /**\n * If you need to define a type when building an Elasticsearch query.\n * Check [dateTimeIndexing](https://github.com/webiny/webiny-js/blob/3074165701b8b45e5fc6ac2444caace7d04ada66/packages/api-headless-cms/src/content/plugins/es/indexing/dateTimeIndexing.ts) plugin for usage example.\n *\n * ```ts\n * unmappedType: \"date\"\n * ```\n */\n unmappedType?: (field: CmsModelField) => string;\n /**\n * This is meant to do some transformation of the entry, preferably only to fieldType it was defined for. Nothing is stopping you to do anything you want to other fields, but try to separate field transformations.\n * It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.\n *\n * ```ts\n * toIndex({ value }) {\n * return {\n * value: value, // This will be stored and indexed\n * rawValue: JSON.stringify(value) // This will be stored but excluded from indexing\n * };\n * }\n * ```\n */\n toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;\n /**\n * This is meant to revert a transformation done in the `toIndex` method.\n * You have access to \"value\" or a \"rawValue\", depending on what you returned from `toIndex`.\n *\n * ```ts\n * fromIndex({ value, rawValue }) {\n * return JSON.parse(rawValue);\n * }\n * ```\n */\n fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;\n}\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n SETTINGS = \"CmsSettings\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor): TableConstructor;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DocumentClient;\n elasticsearch: Client;\n table?: TableModifier;\n esTable?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: PluginCollection;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {\n getTable: () => Table;\n getEsTable: () => Table;\n getEntities: () => Record<\n \"system\" | \"settings\" | \"groups\" | \"models\" | \"entries\" | \"entriesEs\",\n Entity<any>\n >;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsContext extends BaseCmsContext {\n [key: string]: any;\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import { Plugin, PluginCollection } from \"@webiny/plugins/types\";\nimport {\n CmsContext as BaseCmsContext,\n CmsEntry,\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport { DynamoDBTypes, TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { Client } from \"@elastic/elasticsearch\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\nimport { PluginsContainer } from \"@webiny/plugins\";\n\n/**\n * A definition of the entry that is being prepared for the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\nexport interface CmsIndexEntry extends CmsEntry {\n /**\n * Values that are not going to be indexed.\n */\n rawValues: Record<string, any>;\n /**\n * A first part of the ID, without the revision.\n * For example, we can search for all the revisions of the given entry.\n */\n primaryId: string;\n /**\n * Dev can add what ever keys they want and need. Just need to be careful not to break the entry.\n */\n [key: string]: any;\n}\n\n/**\n * Arguments for the method that is transforming content entry in its original form to the one we are storing to the Elasticsearch.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\ninterface CmsModelFieldToElasticsearchToParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n /**\n * Raw value on the entry - before prepare for storage.\n */\n rawValue: any;\n /**\n * Value prepared for storage received from base api-headless-cms package.\n */\n value: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\n/**\n * Arguments for the method that is transforming content entry from Elasticsearch into the original one.\n *\n * @category Elasticsearch\n * @category CmsEntry\n */\ninterface CmsModelFieldToElasticsearchFromParams {\n plugins: PluginsContainer;\n model: CmsModel;\n field: CmsModelField;\n value: any;\n rawValue: any;\n getFieldIndexPlugin(fieldType: string): CmsModelFieldToElasticsearchPlugin;\n getFieldTypePlugin(fieldType: string): CmsModelFieldToGraphQLPlugin;\n}\n\ninterface ToIndexValue {\n /**\n * Use this key to store value for indexing.\n */\n value?: any;\n /**\n * Use this key to tell ES that this value should not be indexed.\n */\n rawValue?: any;\n}\n\n/**\n * A plugin defining transformation of entry for Elasticsearch.\n *\n * @category Plugin\n * @category ContentModelField\n * @category CmsEntry\n * @category Elasticsearch\n */\nexport interface CmsModelFieldToElasticsearchPlugin extends Plugin {\n /**\n * A plugin type\n */\n type: \"cms-model-field-to-elastic-search\";\n /**\n * A unique identifier of the field type (text, number, json, myField, ...).\n *\n * ```ts\n * fieldType: \"myField\"\n * ```\n */\n fieldType: string;\n /**\n * If you need to define a type when building an Elasticsearch query.\n * Check [dateTimeIndexing](https://github.com/webiny/webiny-js/blob/3074165701b8b45e5fc6ac2444caace7d04ada66/packages/api-headless-cms/src/content/plugins/es/indexing/dateTimeIndexing.ts) plugin for usage example.\n *\n * ```ts\n * unmappedType: \"date\"\n * ```\n */\n unmappedType?: (field: CmsModelField) => string;\n /**\n * This is meant to do some transformation of the entry, preferably only to fieldType it was defined for. Nothing is stopping you to do anything you want to other fields, but try to separate field transformations.\n * It returns `Partial<CmsContentIndexEntryType>`. Always return a top-level property of the entry since it is merged via spread operator.\n *\n * ```ts\n * toIndex({ value }) {\n * return {\n * value: value, // This will be stored and indexed\n * rawValue: JSON.stringify(value) // This will be stored but excluded from indexing\n * };\n * }\n * ```\n */\n toIndex?: (params: CmsModelFieldToElasticsearchToParams) => ToIndexValue;\n /**\n * This is meant to revert a transformation done in the `toIndex` method.\n * You have access to \"value\" or a \"rawValue\", depending on what you returned from `toIndex`.\n *\n * ```ts\n * fromIndex({ value, rawValue }) {\n * return JSON.parse(rawValue);\n * }\n * ```\n */\n fromIndex?: (params: CmsModelFieldToElasticsearchFromParams) => any;\n}\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n SETTINGS = \"CmsSettings\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\",\n ENTRIES_ES = \"CmsEntriesElasticsearch\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor): TableConstructor;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DocumentClient;\n elasticsearch: Client;\n table?: TableModifier;\n esTable?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: PluginCollection;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations<CmsContext> {\n getTable: () => Table;\n getEsTable: () => Table;\n getEntities: () => Record<\n \"system\" | \"settings\" | \"groups\" | \"models\" | \"entries\" | \"entriesEs\",\n Entity<any>\n >;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsContext extends BaseCmsContext {\n [key: string]: any;\n}\n"],"mappings":";;;;;;AAmBA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AAiBA;AACA;AACA;AACA;AACA;AACA;AAsBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IA6DYA,QAAQ;AAAA;AAAA,WAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,wBAARA,QAAQ"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CmsEntryListParams, CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import { SearchBody as esSearchBody } from "@webiny/api-elasticsearch/types";
|
|
3
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
4
|
-
interface CreateElasticsearchParams {
|
|
5
|
-
plugins: PluginsContainer;
|
|
6
|
-
model: CmsModel;
|
|
7
|
-
args: CmsEntryListParams;
|
|
8
|
-
parentPath?: string;
|
|
9
|
-
}
|
|
10
|
-
export declare const createElasticsearchQueryBody: (params: CreateElasticsearchParams) => esSearchBody;
|
|
11
|
-
export {};
|