@webiny/api-headless-cms-ddb-es 0.0.0-unstable.d7f521b032 → 0.0.0-unstable.dbdf5d6258
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -30
- package/configurations.d.ts +12 -6
- package/configurations.js +20 -18
- package/configurations.js.map +1 -1
- package/definitions/entry.d.ts +4 -5
- package/definitions/entry.js +7 -79
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +7 -59
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +7 -86
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +60 -0
- package/definitions/types.js +3 -0
- package/definitions/types.js.map +1 -0
- package/dynamoDb/index.d.ts +2 -1
- package/dynamoDb/index.js +7 -10
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/storage/longText.js +15 -18
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.d.ts +0 -5
- package/dynamoDb/storage/richText.js +29 -86
- package/dynamoDb/storage/richText.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +4 -4
- package/elasticsearch/createElasticsearchIndex.js +23 -40
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +3 -3
- package/elasticsearch/deleteElasticsearchIndex.js +8 -13
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/elasticsearch/index.d.ts +1 -1
- package/elasticsearch/index.js +4 -10
- package/elasticsearch/index.js.map +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.js +5 -10
- package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.js +3 -8
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
- package/elasticsearch/indexing/index.d.ts +1 -1
- package/elasticsearch/indexing/index.js +9 -14
- package/elasticsearch/indexing/index.js.map +1 -1
- package/elasticsearch/indexing/jsonIndexing.d.ts +2 -0
- package/elasticsearch/indexing/jsonIndexing.js +21 -0
- package/elasticsearch/indexing/jsonIndexing.js.map +1 -0
- package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
- package/elasticsearch/indexing/longTextIndexing.js +5 -16
- package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
- package/elasticsearch/indexing/numberIndexing.js +3 -8
- package/elasticsearch/indexing/numberIndexing.js.map +1 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
- package/elasticsearch/indexing/objectIndexing.js +25 -27
- package/elasticsearch/indexing/objectIndexing.js.map +1 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
- package/elasticsearch/indexing/richTextIndexing.js +3 -8
- package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
- package/elasticsearch/indices/base.d.ts +1 -1
- package/elasticsearch/indices/base.js +6 -11
- package/elasticsearch/indices/base.js.map +1 -1
- package/elasticsearch/indices/index.d.ts +1 -1
- package/elasticsearch/indices/index.js +5 -11
- package/elasticsearch/indices/index.js.map +1 -1
- package/elasticsearch/search/index.d.ts +1 -1
- package/elasticsearch/search/index.js +5 -9
- package/elasticsearch/search/index.js.map +1 -1
- package/elasticsearch/search/refSearch.d.ts +1 -1
- package/elasticsearch/search/refSearch.js +5 -10
- package/elasticsearch/search/refSearch.js.map +1 -1
- package/elasticsearch/search/searchableJson.d.ts +2 -0
- package/elasticsearch/search/searchableJson.js +53 -0
- package/elasticsearch/search/searchableJson.js.map +1 -0
- package/elasticsearch/search/timeSearch.d.ts +1 -1
- package/elasticsearch/search/timeSearch.js +6 -12
- package/elasticsearch/search/timeSearch.js.map +1 -1
- package/helpers/entryIndexHelpers.d.ts +10 -10
- package/helpers/entryIndexHelpers.js +61 -40
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/fieldIdentifier.d.ts +6 -0
- package/helpers/fieldIdentifier.js +35 -0
- package/helpers/fieldIdentifier.js.map +1 -0
- package/helpers/index.d.ts +2 -1
- package/helpers/index.js +3 -15
- package/helpers/index.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +119 -147
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +15 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +34 -0
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
- package/operations/entry/dataLoader/constants.d.ts +1 -0
- package/operations/entry/dataLoader/constants.js +4 -0
- package/operations/entry/dataLoader/constants.js.map +1 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js +19 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js +32 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +40 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +40 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
- package/operations/entry/dataLoader/getRevisionById.js +50 -0
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
- package/operations/entry/dataLoader/index.d.ts +8 -0
- package/operations/entry/dataLoader/index.js +19 -0
- package/operations/entry/dataLoader/index.js.map +1 -0
- package/operations/entry/dataLoader/types.d.ts +5 -0
- package/operations/entry/dataLoader/types.js +3 -0
- package/operations/entry/dataLoader/types.js.map +1 -0
- package/operations/entry/dataLoaders.d.ts +17 -38
- package/operations/entry/dataLoaders.js +57 -264
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +3 -8
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js.map +1 -1
- package/operations/entry/elasticsearch/body.d.ts +3 -3
- package/operations/entry/elasticsearch/body.js +24 -29
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields/createSystemField.d.ts +4 -0
- package/operations/entry/elasticsearch/fields/createSystemField.js +10 -0
- package/operations/entry/elasticsearch/fields/createSystemField.js.map +1 -0
- package/operations/entry/elasticsearch/fields/live.d.ts +2 -0
- package/operations/entry/elasticsearch/fields/live.js +45 -0
- package/operations/entry/elasticsearch/fields/live.js.map +1 -0
- package/operations/entry/elasticsearch/fields/location.d.ts +2 -0
- package/operations/entry/elasticsearch/fields/location.js +45 -0
- package/operations/entry/elasticsearch/fields/location.js.map +1 -0
- package/operations/entry/elasticsearch/fields/state.d.ts +2 -0
- package/operations/entry/elasticsearch/fields/state.js +93 -0
- package/operations/entry/elasticsearch/fields/state.js.map +1 -0
- package/operations/entry/elasticsearch/fields.d.ts +6 -5
- package/operations/entry/elasticsearch/fields.js +161 -116
- package/operations/entry/elasticsearch/fields.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/applyFiltering.d.ts +2 -2
- package/operations/entry/elasticsearch/filtering/applyFiltering.js +12 -17
- package/operations/entry/elasticsearch/filtering/applyFiltering.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/exec.d.ts +7 -6
- package/operations/entry/elasticsearch/filtering/exec.js +50 -44
- package/operations/entry/elasticsearch/filtering/exec.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/index.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/index.js +2 -15
- package/operations/entry/elasticsearch/filtering/index.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/path.d.ts +2 -1
- package/operations/entry/elasticsearch/filtering/path.js +11 -17
- package/operations/entry/elasticsearch/filtering/path.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js +9 -15
- package/operations/entry/elasticsearch/filtering/plugins/defaultFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/index.js +7 -12
- package/operations/entry/elasticsearch/filtering/plugins/index.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js +11 -15
- package/operations/entry/elasticsearch/filtering/plugins/objectFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js +17 -16
- package/operations/entry/elasticsearch/filtering/plugins/refFilterPlugin.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/populated.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/populated.js +4 -9
- package/operations/entry/elasticsearch/filtering/populated.js.map +1 -1
- package/operations/entry/elasticsearch/filtering/values.d.ts +1 -1
- package/operations/entry/elasticsearch/filtering/values.js +6 -12
- package/operations/entry/elasticsearch/filtering/values.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearch.d.ts +3 -3
- package/operations/entry/elasticsearch/fullTextSearch.js +8 -12
- package/operations/entry/elasticsearch/fullTextSearch.js.map +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.d.ts +1 -1
- package/operations/entry/elasticsearch/fullTextSearchFields.js +3 -8
- package/operations/entry/elasticsearch/fullTextSearchFields.js.map +1 -1
- package/operations/entry/elasticsearch/initialQuery.d.ts +2 -2
- package/operations/entry/elasticsearch/initialQuery.js +11 -26
- package/operations/entry/elasticsearch/initialQuery.js.map +1 -1
- package/operations/entry/elasticsearch/keyword.d.ts +1 -1
- package/operations/entry/elasticsearch/keyword.js +6 -9
- package/operations/entry/elasticsearch/keyword.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/bodyModifier.d.ts +4 -4
- package/operations/entry/elasticsearch/plugins/bodyModifier.js +5 -10
- package/operations/entry/elasticsearch/plugins/bodyModifier.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/operator.d.ts +2 -3
- package/operations/entry/elasticsearch/plugins/operator.js +6 -19
- package/operations/entry/elasticsearch/plugins/operator.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/queryModifier.d.ts +4 -4
- package/operations/entry/elasticsearch/plugins/queryModifier.js +5 -10
- package/operations/entry/elasticsearch/plugins/queryModifier.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/search.d.ts +2 -2
- package/operations/entry/elasticsearch/plugins/search.js +7 -13
- package/operations/entry/elasticsearch/plugins/search.js.map +1 -1
- package/operations/entry/elasticsearch/plugins/sortModifier.d.ts +4 -4
- package/operations/entry/elasticsearch/plugins/sortModifier.js +5 -10
- package/operations/entry/elasticsearch/plugins/sortModifier.js.map +1 -1
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.d.ts +2 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js +6 -0
- package/operations/entry/elasticsearch/shouldIgnoreEsResponseError.js.map +1 -0
- package/operations/entry/elasticsearch/sort.d.ts +4 -4
- package/operations/entry/elasticsearch/sort.js +61 -36
- package/operations/entry/elasticsearch/sort.js.map +1 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
- package/operations/entry/elasticsearch/transformValueForSearch.js +6 -9
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
- package/operations/entry/elasticsearch/types.d.ts +8 -8
- package/operations/entry/elasticsearch/types.js +2 -4
- package/operations/entry/elasticsearch/types.js.map +1 -1
- package/operations/entry/index.d.ts +7 -6
- package/operations/entry/index.js +1193 -622
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +58 -19
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +5 -12
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
- package/operations/entry/transformations/convertEntryKeys.js +30 -0
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
- package/operations/entry/transformations/index.d.ts +29 -0
- package/operations/entry/transformations/index.js +119 -0
- package/operations/entry/transformations/index.js.map +1 -0
- package/operations/entry/transformations/modifyEntryValues.d.ts +52 -0
- package/operations/entry/transformations/modifyEntryValues.js +21 -0
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -0
- package/operations/entry/transformations/transformEntryKeys.d.ts +11 -0
- package/operations/entry/transformations/transformEntryKeys.js +20 -0
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
- package/operations/entry/transformations/transformEntryToIndex.d.ts +10 -0
- package/operations/entry/transformations/transformEntryToIndex.js +24 -0
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -0
- package/operations/group/index.d.ts +6 -5
- package/operations/group/index.js +47 -67
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +4 -4
- package/operations/model/index.js +39 -46
- package/operations/model/index.js.map +1 -1
- package/package.json +35 -37
- package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +69 -0
- package/plugins/CmsElasticsearchModelFieldPlugin.js +46 -0
- package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -0
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +6 -15
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +2 -2
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +6 -15
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +5 -11
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +10 -15
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +6 -15
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +6 -15
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +33 -0
- package/plugins/CmsEntryElasticsearchValuesModifier.js +42 -0
- package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -0
- package/plugins/CmsEntryFilterPlugin.d.ts +3 -3
- package/plugins/CmsEntryFilterPlugin.js +6 -15
- package/plugins/CmsEntryFilterPlugin.js.map +1 -1
- package/plugins/index.d.ts +8 -7
- package/plugins/index.js +9 -81
- package/plugins/index.js.map +1 -1
- package/tasks/createIndexTaskPlugin.d.ts +2 -0
- package/tasks/createIndexTaskPlugin.js +41 -0
- package/tasks/createIndexTaskPlugin.js.map +1 -0
- package/types.d.ts +38 -36
- package/types.js +9 -12
- package/types.js.map +1 -1
- package/values/NoValueContainer.d.ts +5 -0
- package/values/NoValueContainer.js +13 -0
- package/values/NoValueContainer.js.map +1 -0
- package/definitions/entryElasticsearch.d.ts +0 -8
- package/definitions/entryElasticsearch.js +0 -37
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/settings.d.ts +0 -8
- package/definitions/settings.js +0 -53
- package/definitions/settings.js.map +0 -1
- package/definitions/system.d.ts +0 -8
- package/definitions/system.js +0 -41
- package/definitions/system.js.map +0 -1
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -21
- package/definitions/table.js.map +0 -1
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -21
- package/definitions/tableElasticsearch.js.map +0 -1
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -84
- package/dynamoDb/storage/date.js.map +0 -1
- package/elasticsearch/indices/japanese.d.ts +0 -2
- package/elasticsearch/indices/japanese.js +0 -13
- package/elasticsearch/indices/japanese.js.map +0 -1
- package/operations/settings/index.d.ts +0 -6
- package/operations/settings/index.js +0 -111
- package/operations/settings/index.js.map +0 -1
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -82
- package/operations/system/index.js.map +0 -1
- package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
- package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -18
- package/plugins/CmsEntryElasticsearchFieldPlugin.js.map +0 -1
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.createLongTextStorageTransformPlugin = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
var _gzip = require("@webiny/utils/compression/gzip");
|
|
10
|
-
var _apiHeadlessCms = require("@webiny/api-headless-cms");
|
|
11
1
|
/**
|
|
12
2
|
* File is @internal
|
|
13
3
|
*/
|
|
14
4
|
|
|
5
|
+
import WebinyError from "@webiny/error";
|
|
6
|
+
import { compress as gzip, decompress as ungzip } from "@webiny/utils/compression/gzip.js";
|
|
7
|
+
import { StorageTransformPlugin } from "@webiny/api-headless-cms";
|
|
15
8
|
const GZIP = "gzip";
|
|
16
9
|
const TO_STORAGE_ENCODING = "base64";
|
|
17
10
|
const FROM_STORAGE_ENCODING = "utf8";
|
|
@@ -21,8 +14,9 @@ const convertToBuffer = value => {
|
|
|
21
14
|
}
|
|
22
15
|
return value;
|
|
23
16
|
};
|
|
24
|
-
const createLongTextStorageTransformPlugin = () => {
|
|
25
|
-
|
|
17
|
+
export const createLongTextStorageTransformPlugin = () => {
|
|
18
|
+
const plugin = new StorageTransformPlugin({
|
|
19
|
+
name: "headless-cms.storage-transform.long-text.default",
|
|
26
20
|
fieldType: "long-text",
|
|
27
21
|
fromStorage: async ({
|
|
28
22
|
field,
|
|
@@ -32,7 +26,7 @@ const createLongTextStorageTransformPlugin = () => {
|
|
|
32
26
|
if (!storageValue || typeOf === "string" || typeOf === "number" || Array.isArray(storageValue) === true) {
|
|
33
27
|
return storageValue;
|
|
34
28
|
} else if (typeOf !== "object") {
|
|
35
|
-
throw new
|
|
29
|
+
throw new WebinyError(`LongText value received in "fromStorage" function is not an object in field "${field.storageId}" - ${field.fieldId}.`);
|
|
36
30
|
}
|
|
37
31
|
const {
|
|
38
32
|
compression,
|
|
@@ -43,16 +37,16 @@ const createLongTextStorageTransformPlugin = () => {
|
|
|
43
37
|
* Check if possibly undefined, null, empty...
|
|
44
38
|
*/
|
|
45
39
|
if (!compression) {
|
|
46
|
-
throw new
|
|
40
|
+
throw new WebinyError(`Missing compression in "fromStorage" function in field "${field.storageId}" - ${field.fieldId}.": ${JSON.stringify(storageValue)}.`, "MISSING_COMPRESSION", {
|
|
47
41
|
value: storageValue
|
|
48
42
|
});
|
|
49
43
|
} else if (compression !== GZIP) {
|
|
50
|
-
throw new
|
|
44
|
+
throw new WebinyError(`This plugin cannot transform something not compressed with "GZIP".`, "WRONG_COMPRESSION", {
|
|
51
45
|
compression
|
|
52
46
|
});
|
|
53
47
|
}
|
|
54
48
|
try {
|
|
55
|
-
const buf = await (
|
|
49
|
+
const buf = await ungzip(convertToBuffer(value));
|
|
56
50
|
const result = buf.toString(FROM_STORAGE_ENCODING);
|
|
57
51
|
if (!isArray) {
|
|
58
52
|
return result;
|
|
@@ -75,7 +69,7 @@ const createLongTextStorageTransformPlugin = () => {
|
|
|
75
69
|
}
|
|
76
70
|
const isArray = Array.isArray(initialValue);
|
|
77
71
|
const value = isArray ? JSON.stringify(initialValue) : initialValue;
|
|
78
|
-
const compressedValue = await (
|
|
72
|
+
const compressedValue = await gzip(value);
|
|
79
73
|
const result = {
|
|
80
74
|
compression: GZIP,
|
|
81
75
|
value: compressedValue.toString(TO_STORAGE_ENCODING)
|
|
@@ -87,5 +81,8 @@ const createLongTextStorageTransformPlugin = () => {
|
|
|
87
81
|
return result;
|
|
88
82
|
}
|
|
89
83
|
});
|
|
84
|
+
plugin.name = plugin.name = `headless-cms.dynamodb.storageTransform.long-text`;
|
|
85
|
+
return plugin;
|
|
90
86
|
};
|
|
91
|
-
|
|
87
|
+
|
|
88
|
+
//# sourceMappingURL=longText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GZIP","TO_STORAGE_ENCODING","FROM_STORAGE_ENCODING","convertToBuffer","value","Buffer","from","createLongTextStorageTransformPlugin","
|
|
1
|
+
{"version":3,"names":["WebinyError","compress","gzip","decompress","ungzip","StorageTransformPlugin","GZIP","TO_STORAGE_ENCODING","FROM_STORAGE_ENCODING","convertToBuffer","value","Buffer","from","createLongTextStorageTransformPlugin","plugin","name","fieldType","fromStorage","field","storageValue","typeOf","Array","isArray","storageId","fieldId","compression","JSON","stringify","buf","result","toString","parse","ex","console","log","message","toStorage","initialValue","hasOwnProperty","compressedValue"],"sources":["longText.ts"],"sourcesContent":["/**\n * File is @internal\n */\n\nimport WebinyError from \"@webiny/error\";\nimport { compress as gzip, decompress as ungzip } from \"@webiny/utils/compression/gzip.js\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\n\nconst GZIP = \"gzip\";\nconst TO_STORAGE_ENCODING = \"base64\";\nconst FROM_STORAGE_ENCODING = \"utf8\";\n\nconst convertToBuffer = (value: string | Buffer): Buffer => {\n if (typeof value === \"string\") {\n return Buffer.from(value, TO_STORAGE_ENCODING);\n }\n return value;\n};\n\nexport interface StorageValue {\n compression: string;\n value: string;\n isArray?: boolean;\n}\n\nexport const createLongTextStorageTransformPlugin = () => {\n const plugin = new StorageTransformPlugin<string | string[], StorageValue>({\n name: \"headless-cms.storage-transform.long-text.default\",\n fieldType: \"long-text\",\n fromStorage: async ({ field, value: storageValue }) => {\n const typeOf = typeof storageValue;\n if (\n !storageValue ||\n typeOf === \"string\" ||\n typeOf === \"number\" ||\n Array.isArray(storageValue) === true\n ) {\n return storageValue as unknown as string | string[];\n } else if (typeOf !== \"object\") {\n throw new WebinyError(\n `LongText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n const { compression, value, isArray } = storageValue;\n /**\n * Check if possibly undefined, null, empty...\n */\n if (!compression) {\n throw new WebinyError(\n `Missing compression in \"fromStorage\" function in field \"${\n field.storageId\n }\" - ${field.fieldId}.\": ${JSON.stringify(storageValue)}.`,\n \"MISSING_COMPRESSION\",\n {\n value: storageValue\n }\n );\n } else if (compression !== GZIP) {\n throw new WebinyError(\n `This plugin cannot transform something not compressed with \"GZIP\".`,\n \"WRONG_COMPRESSION\",\n {\n compression\n }\n );\n }\n try {\n const buf = await ungzip(convertToBuffer(value));\n const result = buf.toString(FROM_STORAGE_ENCODING);\n if (!isArray) {\n return result;\n }\n return JSON.parse(result);\n } catch (ex) {\n console.log(\"Error while transforming long-text.\");\n console.log(ex.message);\n return \"\";\n }\n },\n toStorage: async ({ value: initialValue }) => {\n /**\n * There is a possibility that we are trying to compress already compressed value.\n */\n if (initialValue && initialValue.hasOwnProperty(\"compression\") === true) {\n return initialValue as unknown as StorageValue;\n }\n const isArray = Array.isArray(initialValue);\n const value = isArray ? JSON.stringify(initialValue) : initialValue;\n const compressedValue = await gzip(value);\n\n const result: StorageValue = {\n compression: GZIP,\n value: compressedValue.toString(TO_STORAGE_ENCODING)\n };\n if (!isArray) {\n return result;\n }\n result.isArray = isArray;\n return result;\n }\n });\n plugin.name = plugin.name = `headless-cms.dynamodb.storageTransform.long-text`;\n\n return plugin;\n};\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,QAAQ,IAAIC,IAAI,EAAEC,UAAU,IAAIC,MAAM,QAAQ,mCAAmC;AAC1F,SAASC,sBAAsB,QAAQ,0BAA0B;AAEjE,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,mBAAmB,GAAG,QAAQ;AACpC,MAAMC,qBAAqB,GAAG,MAAM;AAEpC,MAAMC,eAAe,GAAIC,KAAsB,IAAa;EACxD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOC,MAAM,CAACC,IAAI,CAACF,KAAK,EAAEH,mBAAmB,CAAC;EAClD;EACA,OAAOG,KAAK;AAChB,CAAC;AAQD,OAAO,MAAMG,oCAAoC,GAAGA,CAAA,KAAM;EACtD,MAAMC,MAAM,GAAG,IAAIT,sBAAsB,CAAkC;IACvEU,IAAI,EAAE,kDAAkD;IACxDC,SAAS,EAAE,WAAW;IACtBC,WAAW,EAAE,MAAAA,CAAO;MAAEC,KAAK;MAAER,KAAK,EAAES;IAAa,CAAC,KAAK;MACnD,MAAMC,MAAM,GAAG,OAAOD,YAAY;MAClC,IACI,CAACA,YAAY,IACbC,MAAM,KAAK,QAAQ,IACnBA,MAAM,KAAK,QAAQ,IACnBC,KAAK,CAACC,OAAO,CAACH,YAAY,CAAC,KAAK,IAAI,EACtC;QACE,OAAOA,YAAY;MACvB,CAAC,MAAM,IAAIC,MAAM,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAIpB,WAAW,CACjB,gFAAgFkB,KAAK,CAACK,SAAS,OAAOL,KAAK,CAACM,OAAO,GACvH,CAAC;MACL;MACA,M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Ae,GAAG,MAAMrC,IAAI,CAACQ,KAAK,CAAC;MAEzC,MAAMmB,MAAoB,GAAG;QACzBJ,WAAW,EAAEnB,IAAI;QACjBI,KAAK,EAAE6B,eAAe,CAACT,QAAQ,CAACvB,mBAAmB;MACvD,CAAC;MACD,IAAI,CAACe,OAAO,EAAE;QACV,OAAOO,MAAM;MACjB;MACAA,MAAM,CAACP,OAAO,GAAGA,OAAO;MACxB,OAAOO,MAAM;IACjB;EACJ,CAAC,CAAC;EACFf,MAAM,CAACC,IAAI,GAAGD,MAAM,CAACC,IAAI,GAAG,kDAAkD;EAE9E,OAAOD,MAAM;AACjB,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,2 @@
|
|
|
1
1
|
import { StorageTransformPlugin } from "@webiny/api-headless-cms";
|
|
2
|
-
export declare type OriginalValue = Record<string, any> | any[];
|
|
3
|
-
export interface StorageValue {
|
|
4
|
-
compression: string;
|
|
5
|
-
value: any;
|
|
6
|
-
}
|
|
7
2
|
export declare const createRichTextStorageTransformPlugin: () => StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types").CmsModelField>;
|
|
@@ -1,108 +1,51 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
exports.createRichTextStorageTransformPlugin = void 0;
|
|
8
|
-
var _jsonpack = _interopRequireDefault(require("jsonpack"));
|
|
9
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
10
|
-
var _apiHeadlessCms = require("@webiny/api-headless-cms");
|
|
11
|
-
/**
|
|
12
|
-
* Remove when jsonpack gets PR with a fix merged
|
|
13
|
-
* https://github.com/rgcl/jsonpack/pull/25/files
|
|
14
|
-
* NOTE 2021-07-28: it seems PR is not going to be merged so keep this.
|
|
15
|
-
*/
|
|
16
|
-
// TODO @ts-refactor figure better type
|
|
17
|
-
const transformArray = value => {
|
|
18
|
-
if (!value) {
|
|
19
|
-
return value;
|
|
20
|
-
}
|
|
21
|
-
let isArray = Array.isArray(value);
|
|
22
|
-
const shouldBeArray = value instanceof Array === false && isArray;
|
|
23
|
-
if (shouldBeArray) {
|
|
24
|
-
value = Array.from(value);
|
|
25
|
-
isArray = true;
|
|
26
|
-
}
|
|
27
|
-
if (typeof value === "object" || isArray) {
|
|
28
|
-
for (const k in value) {
|
|
29
|
-
value[k] = transformArray(value[k]);
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return value;
|
|
33
|
-
};
|
|
34
|
-
const createRichTextStorageTransformPlugin = () => {
|
|
35
|
-
return new _apiHeadlessCms.StorageTransformPlugin({
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { StorageTransformPlugin } from "@webiny/api-headless-cms";
|
|
3
|
+
import { CompressorPlugin } from "@webiny/api";
|
|
4
|
+
export const createRichTextStorageTransformPlugin = () => {
|
|
5
|
+
const plugin = new StorageTransformPlugin({
|
|
6
|
+
name: "headless-cms.storage-transform.rich-text.default",
|
|
36
7
|
fieldType: "rich-text",
|
|
37
8
|
fromStorage: async ({
|
|
38
9
|
field,
|
|
39
|
-
value: storageValue
|
|
10
|
+
value: storageValue,
|
|
11
|
+
plugins
|
|
40
12
|
}) => {
|
|
41
13
|
if (!storageValue) {
|
|
42
14
|
return storageValue;
|
|
43
15
|
} else if (typeof storageValue !== "object") {
|
|
44
|
-
throw new
|
|
16
|
+
throw new WebinyError(`RichText value received in "fromStorage" function is not an object in field "${field.storageId}" - ${field.fieldId}.`);
|
|
45
17
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
if (!storageValue["compression"]) {
|
|
18
|
+
let compressor;
|
|
19
|
+
try {
|
|
20
|
+
compressor = plugins.oneByType(CompressorPlugin.type);
|
|
21
|
+
} catch {
|
|
51
22
|
return storageValue;
|
|
52
23
|
}
|
|
53
|
-
const {
|
|
54
|
-
compression,
|
|
55
|
-
value
|
|
56
|
-
} = storageValue;
|
|
57
|
-
if (compression !== "jsonpack") {
|
|
58
|
-
throw new _error.default(`This plugin cannot transform something not packed with "jsonpack".`, "WRONG_COMPRESSION", {
|
|
59
|
-
compression
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* No point in going further if no value.
|
|
64
|
-
*/
|
|
65
|
-
if (!value) {
|
|
66
|
-
return null;
|
|
67
|
-
}
|
|
68
24
|
try {
|
|
69
|
-
return
|
|
70
|
-
} catch
|
|
71
|
-
|
|
72
|
-
return null;
|
|
73
|
-
}
|
|
74
|
-
console.log("Error while decompressing rich-text.");
|
|
75
|
-
console.log(ex.message);
|
|
76
|
-
return null;
|
|
25
|
+
return await compressor.getCompressor().decompress(storageValue);
|
|
26
|
+
} catch {
|
|
27
|
+
return storageValue;
|
|
77
28
|
}
|
|
78
29
|
},
|
|
79
30
|
toStorage: async ({
|
|
80
|
-
value
|
|
31
|
+
value,
|
|
32
|
+
plugins
|
|
81
33
|
}) => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
*/
|
|
87
|
-
if (!!((_value = value) !== null && _value !== void 0 && _value.compression)) {
|
|
34
|
+
let compressor;
|
|
35
|
+
try {
|
|
36
|
+
compressor = plugins.oneByType(CompressorPlugin.type);
|
|
37
|
+
} catch {
|
|
88
38
|
return value;
|
|
89
39
|
}
|
|
90
|
-
value = transformArray(value);
|
|
91
|
-
let jsonValue = null;
|
|
92
40
|
try {
|
|
93
|
-
|
|
94
|
-
} catch
|
|
95
|
-
|
|
96
|
-
return null;
|
|
97
|
-
}
|
|
98
|
-
console.log("Error while compressing rich-text.");
|
|
99
|
-
console.log(ex.message);
|
|
41
|
+
return await compressor.getCompressor().compress(value);
|
|
42
|
+
} catch {
|
|
43
|
+
return value;
|
|
100
44
|
}
|
|
101
|
-
return {
|
|
102
|
-
compression: "jsonpack",
|
|
103
|
-
value: jsonValue
|
|
104
|
-
};
|
|
105
45
|
}
|
|
106
46
|
});
|
|
47
|
+
plugin.name = `headless-cms.dynamodb.storageTransform.rich-text`;
|
|
48
|
+
return plugin;
|
|
107
49
|
};
|
|
108
|
-
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=richText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["WebinyError","StorageTransformPlugin","CompressorPlugin","createRichTextStorageTransformPlugin","plugin","name","fieldType","fromStorage","field","value","storageValue","plugins","storageId","fieldId","compressor","oneByType","type","getCompressor","decompress","toStorage","compress"],"sources":["richText.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\nimport { CompressorPlugin } from \"@webiny/api\";\n\nexport const createRichTextStorageTransformPlugin = () => {\n const plugin = new StorageTransformPlugin({\n name: \"headless-cms.storage-transform.rich-text.default\",\n fieldType: \"rich-text\",\n fromStorage: async ({ field, value: storageValue, plugins }) => {\n if (!storageValue) {\n return storageValue;\n } else if (typeof storageValue !== \"object\") {\n throw new WebinyError(\n `RichText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch {\n return storageValue;\n }\n\n try {\n return await compressor.getCompressor().decompress(storageValue);\n } catch {\n return storageValue;\n }\n },\n toStorage: async ({ value, plugins }) => {\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch {\n return value;\n }\n try {\n return await compressor.getCompressor().compress(value);\n } catch {\n return value;\n }\n }\n });\n plugin.name = `headless-cms.dynamodb.storageTransform.rich-text`;\n\n return plugin;\n};\n"],"mappings":"AAAA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,OAAO,MAAMC,oCAAoC,GAAGA,CAAA,KA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import { Client } from "@elastic/elasticsearch";
|
|
2
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
3
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
1
|
+
import type { Client } from "@elastic/elasticsearch";
|
|
2
|
+
import type { PluginsContainer } from "@webiny/plugins";
|
|
3
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
4
4
|
export interface CreateElasticsearchIndexParams {
|
|
5
|
-
|
|
5
|
+
client: Client;
|
|
6
6
|
plugins: PluginsContainer;
|
|
7
7
|
model: CmsModel;
|
|
8
8
|
}
|
|
@@ -1,49 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.createElasticsearchIndex = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
var _CmsEntryElasticsearchIndexPlugin = require("../plugins/CmsEntryElasticsearchIndexPlugin");
|
|
10
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
11
|
-
var _configurations = require("../configurations");
|
|
12
|
-
const createElasticsearchIndex = async params => {
|
|
1
|
+
import { CmsEntryElasticsearchIndexPlugin } from "../plugins/CmsEntryElasticsearchIndexPlugin.js";
|
|
2
|
+
import { createIndex } from "@webiny/api-elasticsearch";
|
|
3
|
+
import { configurations } from "../configurations.js";
|
|
4
|
+
export const createElasticsearchIndex = async params => {
|
|
13
5
|
const {
|
|
14
|
-
|
|
15
|
-
plugins
|
|
6
|
+
client,
|
|
7
|
+
plugins,
|
|
16
8
|
model
|
|
17
9
|
} = params;
|
|
18
|
-
const plugin = (0, _apiElasticsearch.getLastAddedIndexPlugin)({
|
|
19
|
-
container,
|
|
20
|
-
type: _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin.type,
|
|
21
|
-
locale: model.locale
|
|
22
|
-
});
|
|
23
10
|
const {
|
|
24
11
|
index
|
|
25
|
-
} =
|
|
12
|
+
} = configurations.es({
|
|
26
13
|
model
|
|
27
14
|
});
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
15
|
+
await createIndex({
|
|
16
|
+
client,
|
|
17
|
+
index,
|
|
18
|
+
type: CmsEntryElasticsearchIndexPlugin.type,
|
|
19
|
+
tenant: model.tenant,
|
|
20
|
+
plugins,
|
|
21
|
+
onExists: () => {
|
|
22
|
+
console.log(`Elasticsearch index "${index}" for the CMS model "${model.name}" already exists.`);
|
|
23
|
+
},
|
|
24
|
+
onError: ex => {
|
|
25
|
+
console.error(`Could not create Elasticsearch index "${index}" for the CMS model "${model.name}".`);
|
|
26
|
+
console.error(ex);
|
|
27
|
+
return ex;
|
|
34
28
|
}
|
|
35
|
-
|
|
36
|
-
index,
|
|
37
|
-
body: plugin.body
|
|
38
|
-
});
|
|
39
|
-
} catch (ex) {
|
|
40
|
-
throw new _error.default(ex.message || "Could not create Elasticsearch index for the Headless CMS model.", ex.code || "CMS_ELASTICSEARCH_INDEX_ERROR", {
|
|
41
|
-
error: ex,
|
|
42
|
-
type: _CmsEntryElasticsearchIndexPlugin.CmsEntryElasticsearchIndexPlugin.type,
|
|
43
|
-
locale: model.locale,
|
|
44
|
-
tenant: model.tenant,
|
|
45
|
-
body: plugin.body
|
|
46
|
-
});
|
|
47
|
-
}
|
|
29
|
+
});
|
|
48
30
|
};
|
|
49
|
-
|
|
31
|
+
|
|
32
|
+
//# sourceMappingURL=createElasticsearchIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["CmsEntryElasticsearchIndexPlugin","createIndex","configurations","createElasticsearchIndex","params","client","plugins","model","index","es","type","tenant","onExists","console","log","name","onError","ex","error"],"sources":["createElasticsearchIndex.ts"],"sourcesContent":["import type { Client } from \"@elastic/elasticsearch\";\nimport type { PluginsContainer } from \"@webiny/plugins\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/CmsEntryElasticsearchIndexPlugin.js\";\nimport { createIndex } from \"@webiny/api-elasticsearch\";\nimport { configurations } from \"~/configurations.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface CreateElasticsearchIndexParams {\n client: Client;\n plugins: PluginsContainer;\n model: CmsModel;\n}\n\nexport const createElasticsearchIndex = async (params: CreateElasticsearchIndexParams) => {\n const { client, plugins, model } = params;\n\n const { index } = configurations.es({\n model\n });\n\n await createIndex({\n client,\n index,\n type: CmsEntryElasticsearchIndexPlugin.type,\n tenant: model.tenant,\n plugins,\n onExists: () => {\n console.log(\n `Elasticsearch index \"${index}\" for the CMS model \"${model.name}\" already exists.`\n );\n },\n onError: ex => {\n console.error(\n `Could not create Elasticsearch index \"${index}\" for the CMS model \"${model.name}\".`\n );\n console.error(ex);\n return ex;\n }\n });\n};\n"],"mappings":"AAEA,SAASA,gCAAgC;AACzC,SAASC,WAAW,QAAQ,2BAA2B;AACvD,SAASC,cAAc;AASvB,OAAO,MAAMC,wBAAwB,GAAG,MAAOC,MAAsC,IAAK;EACtF,MAAM;IAAEC,MAAM;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAEzC,MAAM;IAAEI;EAAM,CAAC,GAAGN,cAAc,CAACO,EAAE,CAAC;IAChCF;EACJ,CAAC,CAAC;EAEF,MAAMN,WAAW,CAAC;IACdI,MAAM;IACNG,KAAK;IACLE,IAAI,EAAEV,gCAAgC,CAACU,IAAI;IAC3CC,MAAM,EAAEJ,KAAK,CAACI,MAAM;IACpBL,OAAO;IACPM,QAAQ,EAAEA,CAAA,KAAM;MACZC,OAAO,CAACC,GAAG,CACP,wBAAwBN,KAAK,wBAAwBD,KAAK,CAACQ,IAAI,mBACnE,CAAC;IACL,CAAC;IACDC,OAAO,EAAEC,EAAE,IAAI;MACXJ,OAAO,CAACK,KAAK,CACT,yCAAyCV,KAAK,wBAAwBD,KAAK,CAACQ,IAAI,IACpF,CAAC;MACDF,OAAO,CAACK,KAAK,CAACD,EAAE,CAAC;MACjB,OAAOA,EAAE;IACb;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Client } from "@elastic/elasticsearch";
|
|
2
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
1
|
+
import type { Client } from "@elastic/elasticsearch";
|
|
2
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
3
3
|
interface DeleteElasticsearchIndexParams {
|
|
4
|
-
|
|
4
|
+
client: Client;
|
|
5
5
|
model: CmsModel;
|
|
6
6
|
}
|
|
7
7
|
export declare const deleteElasticsearchIndex: (params: DeleteElasticsearchIndexParams) => Promise<void>;
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.deleteElasticsearchIndex = void 0;
|
|
7
|
-
var _configurations = require("../configurations");
|
|
8
|
-
const deleteElasticsearchIndex = async params => {
|
|
1
|
+
import { configurations } from "../configurations.js";
|
|
2
|
+
export const deleteElasticsearchIndex = async params => {
|
|
9
3
|
const {
|
|
10
|
-
|
|
4
|
+
client,
|
|
11
5
|
model
|
|
12
6
|
} = params;
|
|
13
7
|
const {
|
|
14
8
|
index
|
|
15
|
-
} =
|
|
9
|
+
} = configurations.es({
|
|
16
10
|
model
|
|
17
11
|
});
|
|
18
12
|
const {
|
|
19
13
|
body: exists
|
|
20
|
-
} = await
|
|
14
|
+
} = await client.indices.exists({
|
|
21
15
|
index
|
|
22
16
|
});
|
|
23
17
|
if (!exists) {
|
|
24
18
|
return;
|
|
25
19
|
}
|
|
26
20
|
try {
|
|
27
|
-
await
|
|
21
|
+
await client.indices.delete({
|
|
28
22
|
index,
|
|
29
23
|
ignore_unavailable: true
|
|
30
24
|
});
|
|
@@ -33,4 +27,5 @@ const deleteElasticsearchIndex = async params => {
|
|
|
33
27
|
console.log(ex.message);
|
|
34
28
|
}
|
|
35
29
|
};
|
|
36
|
-
|
|
30
|
+
|
|
31
|
+
//# sourceMappingURL=deleteElasticsearchIndex.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["deleteElasticsearchIndex","params","
|
|
1
|
+
{"version":3,"names":["configurations","deleteElasticsearchIndex","params","client","model","index","es","body","exists","indices","delete","ignore_unavailable","ex","console","log","message"],"sources":["deleteElasticsearchIndex.ts"],"sourcesContent":["import type { Client } from \"@elastic/elasticsearch\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport { configurations } from \"~/configurations.js\";\n\ninterface DeleteElasticsearchIndexParams {\n client: Client;\n model: CmsModel;\n}\n\nexport const deleteElasticsearchIndex = async (\n params: DeleteElasticsearchIndexParams\n): Promise<void> => {\n const { client, model } = params;\n\n const { index } = configurations.es({\n model\n });\n const { body: exists } = await client.indices.exists({\n index\n });\n if (!exists) {\n return;\n }\n\n try {\n await client.indices.delete({\n index,\n ignore_unavailable: true\n });\n } catch (ex) {\n console.log(`Could not delete Elasticsearch index \"${index}\". Please do it manually.`);\n console.log(ex.message);\n }\n};\n"],"mappings":"AAEA,SAASA,cAAc;AAOvB,OAAO,MAAMC,wBAAwB,GAAG,MACpCC,MAAsC,IACtB;EAChB,MAAM;IAAEC,MAAM;IAAEC;EAAM,CAAC,GAAGF,MAAM;EAEhC,MAAM;IAAEG;EAAM,CAAC,GAAGL,cAAc,CAACM,EAAE,CAAC;IAChCF;EACJ,CAAC,CAAC;EACF,MAAM;IAAEG,IAAI,EAAEC;EAAO,CAAC,GAAG,MAAML,MAAM,CAACM,OAAO,CAACD,MAAM,CAAC;IACjDH;EACJ,CAAC,CAAC;EACF,IAAI,CAACG,MAAM,EAAE;IACT;EACJ;EAEA,IAAI;IACA,MAAML,MAAM,CAACM,OAAO,CAACC,MAAM,CAAC;MACxBL,KAAK;MACLM,kBAAkB,EAAE;IACxB,CAAC,CAAC;EACN,CAAC,CAAC,OAAOC,EAAE,EAAE;IACTC,OAAO,CAACC,GAAG,CAAC,yCAAyCT,KAAK,2BAA2B,CAAC;IACtFQ,OAAO,CAACC,GAAG,CAACF,EAAE,CAACG,OAAO,CAAC;EAC3B;AACJ,CAAC","ignoreList":[]}
|
package/elasticsearch/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: () => (import("../types").CmsModelFieldToElasticsearchPlugin[] | import("
|
|
1
|
+
declare const _default: () => (import("../types.js").CmsModelFieldToElasticsearchPlugin[] | import("../index.js").CmsEntryElasticsearchQueryBuilderValueSearchPlugin[])[];
|
|
2
2
|
export default _default;
|
package/elasticsearch/index.js
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import elasticsearchIndexingPlugins from "./indexing/index.js";
|
|
2
|
+
import elasticsearchSearchPlugins from "./search/index.js";
|
|
3
|
+
export default () => [elasticsearchIndexingPlugins(), elasticsearchSearchPlugins()];
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.default = void 0;
|
|
8
|
-
var _indexing = _interopRequireDefault(require("./indexing"));
|
|
9
|
-
var _search = _interopRequireDefault(require("./search"));
|
|
10
|
-
var _default = () => [(0, _indexing.default)(), (0, _search.default)()];
|
|
11
|
-
exports.default = _default;
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["elasticsearchIndexingPlugins","elasticsearchSearchPlugins"],"sources":["index.ts"],"sourcesContent":["import elasticsearchIndexingPlugins from \"./indexing\";\nimport elasticsearchSearchPlugins from \"./search\";\n\nexport default () => [elasticsearchIndexingPlugins(), elasticsearchSearchPlugins()];\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["elasticsearchIndexingPlugins","elasticsearchSearchPlugins"],"sources":["index.ts"],"sourcesContent":["import elasticsearchIndexingPlugins from \"./indexing/index.js\";\nimport elasticsearchSearchPlugins from \"./search/index.js\";\n\nexport default () => [elasticsearchIndexingPlugins(), elasticsearchSearchPlugins()];\n"],"mappings":"AAAA,OAAOA,4BAA4B;AACnC,OAAOC,0BAA0B;AAEjC,eAAe,MAAM,CAACD,4BAA4B,CAAC,CAAC,EAAEC,0BAA0B,CAAC,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,9 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
1
|
const convertTimeToNumber = time => {
|
|
8
2
|
if (!time) {
|
|
9
3
|
return null;
|
|
@@ -27,7 +21,7 @@ const convertNumberToTime = value => {
|
|
|
27
21
|
return [hours, minutes, seconds].map(v => String(v).padStart(2, "0")).join(":");
|
|
28
22
|
};
|
|
29
23
|
const convertValueFromIndex = (value, field) => {
|
|
30
|
-
const type = field.settings
|
|
24
|
+
const type = field.settings?.type;
|
|
31
25
|
if (type === "time") {
|
|
32
26
|
return convertNumberToTime(value);
|
|
33
27
|
} else if (!value) {
|
|
@@ -43,12 +37,12 @@ const convertValueFromIndex = (value, field) => {
|
|
|
43
37
|
const convertValueToIndex = (value, field) => {
|
|
44
38
|
if (!value) {
|
|
45
39
|
return null;
|
|
46
|
-
} else if (field.settings
|
|
40
|
+
} else if (field.settings?.type === "time") {
|
|
47
41
|
return convertTimeToNumber(value);
|
|
48
42
|
}
|
|
49
43
|
return value;
|
|
50
44
|
};
|
|
51
|
-
|
|
45
|
+
export default () => ({
|
|
52
46
|
type: "cms-model-field-to-elastic-search",
|
|
53
47
|
name: "cms-model-field-to-elastic-search-datetime",
|
|
54
48
|
fieldType: "datetime",
|
|
@@ -83,4 +77,5 @@ var _default = () => ({
|
|
|
83
77
|
return convertValueFromIndex(value, field);
|
|
84
78
|
}
|
|
85
79
|
});
|
|
86
|
-
|
|
80
|
+
|
|
81
|
+
//# sourceMappingURL=dateTimeIndexing.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["convertTimeToNumber","time","hours","minutes","seconds","split","map","Number","convertNumberToTime","value","undefined","String","match","Math","floor","v","padStart","join","convertValueFromIndex","field","type","settings","dateValue","Date","toISOString","slice","convertValueToIndex","name","fieldType","unmappedType","toIndex","Array","isArray","fromIndex"],"sources":["dateTimeIndexing.ts"],"sourcesContent":["import { CmsModelDateTimeField } from \"@webiny/api-headless-cms/types\";\nimport { CmsModelFieldToElasticsearchPlugin } from \"~/types\";\n\nconst convertTimeToNumber = (time?: string): number | null => {\n if (!time) {\n return null;\n }\n const [hours, minutes, seconds = 0] = time.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nconst convertNumberToTime = (value?: number): string | null => {\n if (value === undefined || value === null) {\n return null;\n }\n // TODO remove when v5 goes out\n // this is a fix for pre beta.5\n if (String(value).match(/^([0-9]{2}):([0-9]{2})/) !== null) {\n return String(value);\n }\n //\n const hours = Math.floor(value / 60 / 60);\n\n const minutes = Math.floor((value - hours * 60 * 60) / 60);\n\n const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);\n\n return [hours, minutes, seconds].map(v => String(v).padStart(2, \"0\")).join(\":\");\n};\n\nconst convertValueFromIndex = (\n value: string | number,\n field: CmsModelDateTimeField\n): string | null => {\n const type = field.settings
|
|
1
|
+
{"version":3,"names":["convertTimeToNumber","time","hours","minutes","seconds","split","map","Number","convertNumberToTime","value","undefined","String","match","Math","floor","v","padStart","join","convertValueFromIndex","field","type","settings","dateValue","Date","toISOString","slice","convertValueToIndex","name","fieldType","unmappedType","toIndex","Array","isArray","fromIndex"],"sources":["dateTimeIndexing.ts"],"sourcesContent":["import type { CmsModelDateTimeField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CmsModelFieldToElasticsearchPlugin } from \"~/types.js\";\n\nconst convertTimeToNumber = (time?: string): number | null => {\n if (!time) {\n return null;\n }\n const [hours, minutes, seconds = 0] = time.split(\":\").map(Number);\n return hours * 60 * 60 + minutes * 60 + seconds;\n};\n\nconst convertNumberToTime = (value?: number): string | null => {\n if (value === undefined || value === null) {\n return null;\n }\n // TODO remove when v5 goes out\n // this is a fix for pre beta.5\n if (String(value).match(/^([0-9]{2}):([0-9]{2})/) !== null) {\n return String(value);\n }\n //\n const hours = Math.floor(value / 60 / 60);\n\n const minutes = Math.floor((value - hours * 60 * 60) / 60);\n\n const seconds = Math.floor(value - hours * 60 * 60 - minutes * 60);\n\n return [hours, minutes, seconds].map(v => String(v).padStart(2, \"0\")).join(\":\");\n};\n\nconst convertValueFromIndex = (\n value: string | number,\n field: CmsModelDateTimeField\n): string | null => {\n const type = field.settings?.type;\n if (type === \"time\") {\n return convertNumberToTime(value as number);\n } else if (!value) {\n return null;\n } else if (type === \"dateTimeWithTimezone\") {\n return value as string;\n } else if (type === \"date\") {\n const dateValue = new Date(value);\n return dateValue.toISOString().slice(0, 10);\n }\n return new Date(value).toISOString();\n};\n\nconst convertValueToIndex = (value: string, field: CmsModelDateTimeField) => {\n if (!value) {\n return null;\n } else if (field.settings?.type === \"time\") {\n return convertTimeToNumber(value);\n }\n return value;\n};\n\nexport default (): CmsModelFieldToElasticsearchPlugin => ({\n type: \"cms-model-field-to-elastic-search\",\n name: \"cms-model-field-to-elastic-search-datetime\",\n fieldType: \"datetime\",\n unmappedType: () => {\n return \"date\";\n },\n toIndex({ field, value }) {\n if (Array.isArray(value) === true) {\n return {\n value: value.map((v: string) => {\n return convertValueToIndex(v, field as CmsModelDateTimeField);\n })\n };\n }\n const dateValue = convertValueToIndex(value, field as CmsModelDateTimeField);\n return {\n value: dateValue\n };\n },\n fromIndex({ field, value }) {\n if (Array.isArray(value)) {\n return value.map((v: string) => {\n return convertValueFromIndex(v, field as CmsModelDateTimeField);\n });\n }\n return convertValueFromIndex(value, field as CmsModelDateTimeField);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AAMG,SAAS,GAAGI,mBAAmB,CAACjB,KAAK,EAAEU,KAA8B,CAAC;IAC5E,OAAO;MACHV,KAAK,EAAEa;IACX,CAAC;EACL,CAAC;EACDW,SAASA,CAAC;IAAEd,KAAK;IAAEV;EAAM,CAAC,EAAE;IACxB,IAAIsB,KAAK,CAACC,OAAO,CAACvB,KAAK,CAAC,EAAE;MACtB,OAAOA,KAAK,CAACH,GAAG,CAAES,CAAS,IAAK;QAC5B,OAAOG,qBAAqB,CAACH,CAAC,EAAEI,KAA8B,CAAC;MACnE,CAAC,CAAC;IACN;IACA,OAAOD,qBAAqB,CAACT,KAAK,EAAEU,KAA8B,CAAC;EACvE;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,10 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
var _default = () => ({
|
|
1
|
+
export default () => ({
|
|
8
2
|
type: "cms-model-field-to-elastic-search",
|
|
9
3
|
name: "cms-model-field-to-elastic-search-default",
|
|
10
4
|
fieldType: "*",
|
|
@@ -49,4 +43,5 @@ var _default = () => ({
|
|
|
49
43
|
return rawValue === undefined ? value : rawValue;
|
|
50
44
|
}
|
|
51
45
|
});
|
|
52
|
-
|
|
46
|
+
|
|
47
|
+
//# sourceMappingURL=defaultFieldIndexing.js.map
|