@webiny/api-headless-cms-ddb-es 0.0.0-mt-2 → 0.0.0-unstable.0156a4c312
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/abstractions/CmsDdbEsDataLoaders.d.ts +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js +5 -0
- package/abstractions/CmsDdbEsDataLoaders.js.map +1 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js +5 -0
- package/abstractions/CmsDdbEsEntriesEsEntity.js.map +1 -0
- package/abstractions/CmsDdbEsEntryEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js +5 -0
- package/abstractions/CmsDdbEsEntryEntity.js.map +1 -0
- package/abstractions/CmsDdbEsGroupEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js +5 -0
- package/abstractions/CmsDdbEsGroupEntity.js.map +1 -0
- package/abstractions/CmsDdbEsModelEntity.d.ts +5 -0
- package/abstractions/CmsDdbEsModelEntity.js +5 -0
- package/abstractions/CmsDdbEsModelEntity.js.map +1 -0
- package/abstractions/CmsDdbEsOsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsOsTable.js +5 -0
- package/abstractions/CmsDdbEsOsTable.js.map +1 -0
- package/abstractions/CmsDdbEsTable.d.ts +5 -0
- package/abstractions/CmsDdbEsTable.js +5 -0
- package/abstractions/CmsDdbEsTable.js.map +1 -0
- package/debuggerNamespaces.d.ts +12 -0
- package/debuggerNamespaces.js +0 -0
- package/definitions/entry.d.ts +5 -6
- package/definitions/entry.js +9 -89
- package/definitions/entry.js.map +1 -0
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +9 -72
- package/definitions/group.js.map +1 -0
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +9 -94
- package/definitions/model.js.map +1 -0
- package/definitions/types.d.ts +65 -0
- package/definitions/types.js +0 -0
- package/feature.d.ts +10 -0
- package/feature.js +69 -0
- package/feature.js.map +1 -0
- package/index.d.ts +1 -2
- package/index.js +1 -171
- package/operations/entry/DdbEsCreateEntry.d.ts +24 -0
- package/operations/entry/DdbEsCreateEntry.js +134 -0
- package/operations/entry/DdbEsCreateEntry.js.map +1 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.d.ts +24 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.js +139 -0
- package/operations/entry/DdbEsCreateEntryRevisionFrom.js.map +1 -0
- package/operations/entry/DdbEsDeleteEntry.d.ts +18 -0
- package/operations/entry/DdbEsDeleteEntry.js +79 -0
- package/operations/entry/DdbEsDeleteEntry.js.map +1 -0
- package/operations/entry/DdbEsDeleteEntryRevision.d.ts +24 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js +136 -0
- package/operations/entry/DdbEsDeleteEntryRevision.js.map +1 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.d.ts +18 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js +80 -0
- package/operations/entry/DdbEsDeleteMultipleEntries.js.map +1 -0
- package/operations/entry/DdbEsGetEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetEntry.d.ts +14 -0
- package/operations/entry/DdbEsGetEntry.js +27 -0
- package/operations/entry/DdbEsGetEntry.js.map +1 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetLatestEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetPreviousRevision.d.ts +14 -0
- package/operations/entry/DdbEsGetPreviousRevision.js +56 -0
- package/operations/entry/DdbEsGetPreviousRevision.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js +31 -0
- package/operations/entry/DdbEsGetPublishedEntriesByIds.js.map +1 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.d.ts +14 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js +34 -0
- package/operations/entry/DdbEsGetPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/DdbEsGetRevisionById.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisionById.js +34 -0
- package/operations/entry/DdbEsGetRevisionById.js.map +1 -0
- package/operations/entry/DdbEsGetRevisions.d.ts +14 -0
- package/operations/entry/DdbEsGetRevisions.js +33 -0
- package/operations/entry/DdbEsGetRevisions.js.map +1 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.d.ts +18 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js +77 -0
- package/operations/entry/DdbEsGetUniqueFieldValues.js.map +1 -0
- package/operations/entry/DdbEsListEntries.d.ts +28 -0
- package/operations/entry/DdbEsListEntries.js +110 -0
- package/operations/entry/DdbEsListEntries.js.map +1 -0
- package/operations/entry/DdbEsMoveEntry.d.ts +20 -0
- package/operations/entry/DdbEsMoveEntry.js +113 -0
- package/operations/entry/DdbEsMoveEntry.js.map +1 -0
- package/operations/entry/DdbEsMoveToBin.d.ts +23 -0
- package/operations/entry/DdbEsMoveToBin.js +137 -0
- package/operations/entry/DdbEsMoveToBin.js.map +1 -0
- package/operations/entry/DdbEsPublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsPublishEntry.js +231 -0
- package/operations/entry/DdbEsPublishEntry.js.map +1 -0
- package/operations/entry/DdbEsRestoreFromBin.d.ts +23 -0
- package/operations/entry/DdbEsRestoreFromBin.js +137 -0
- package/operations/entry/DdbEsRestoreFromBin.js.map +1 -0
- package/operations/entry/DdbEsUnpublishEntry.d.ts +24 -0
- package/operations/entry/DdbEsUnpublishEntry.js +127 -0
- package/operations/entry/DdbEsUnpublishEntry.js.map +1 -0
- package/operations/entry/DdbEsUpdateEntry.d.ts +24 -0
- package/operations/entry/DdbEsUpdateEntry.js +175 -0
- package/operations/entry/DdbEsUpdateEntry.js.map +1 -0
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +27 -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 +5 -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 +10 -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 +24 -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 +34 -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 +34 -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 +40 -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 +18 -0
- package/operations/entry/dataLoader/index.js.map +1 -0
- package/operations/entry/dataLoader/types.d.ts +6 -0
- package/operations/entry/dataLoader/types.js +0 -0
- package/operations/entry/dataLoaders.d.ts +22 -39
- package/operations/entry/dataLoaders.js +90 -339
- package/operations/entry/dataLoaders.js.map +1 -0
- package/operations/entry/feature.d.ts +4 -0
- package/operations/entry/feature.js +55 -0
- package/operations/entry/feature.js.map +1 -0
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +45 -35
- package/operations/entry/keys.js.map +1 -0
- package/operations/entry/recordType.d.ts +3 -0
- package/operations/entry/recordType.js +6 -0
- package/operations/entry/recordType.js.map +1 -0
- package/operations/entry/storageEntryUtils.d.ts +7 -0
- package/operations/entry/storageEntryUtils.js +14 -0
- package/operations/entry/storageEntryUtils.js.map +1 -0
- package/operations/entry/transformations/convertEntryKeys.d.ts +8 -0
- package/operations/entry/transformations/convertEntryKeys.js +25 -0
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -0
- package/operations/entry/transformations/index.d.ts +32 -0
- package/operations/entry/transformations/index.js +91 -0
- package/operations/entry/transformations/index.js.map +1 -0
- package/operations/entry/transformations/modifyEntryValues.d.ts +53 -0
- package/operations/entry/transformations/modifyEntryValues.js +16 -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 +17 -0
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -0
- package/operations/group/DdbEsCreateGroup.d.ts +12 -0
- package/operations/group/DdbEsCreateGroup.js +35 -0
- package/operations/group/DdbEsCreateGroup.js.map +1 -0
- package/operations/group/DdbEsDeleteGroup.d.ts +12 -0
- package/operations/group/DdbEsDeleteGroup.js +31 -0
- package/operations/group/DdbEsDeleteGroup.js.map +1 -0
- package/operations/group/DdbEsGetGroup.d.ts +12 -0
- package/operations/group/DdbEsGetGroup.js +31 -0
- package/operations/group/DdbEsGetGroup.js.map +1 -0
- package/operations/group/DdbEsListGroups.d.ts +14 -0
- package/operations/group/DdbEsListGroups.js +52 -0
- package/operations/group/DdbEsListGroups.js.map +1 -0
- package/operations/group/DdbEsUpdateGroup.d.ts +12 -0
- package/operations/group/DdbEsUpdateGroup.js +35 -0
- package/operations/group/DdbEsUpdateGroup.js.map +1 -0
- package/operations/group/feature.d.ts +4 -0
- package/operations/group/feature.js +19 -0
- package/operations/group/feature.js.map +1 -0
- package/operations/group/keys.d.ts +15 -0
- package/operations/group/keys.js +17 -0
- package/operations/group/keys.js.map +1 -0
- package/operations/model/DdbEsCreateModel.d.ts +16 -0
- package/operations/model/DdbEsCreateModel.js +56 -0
- package/operations/model/DdbEsCreateModel.js.map +1 -0
- package/operations/model/DdbEsDeleteModel.d.ts +12 -0
- package/operations/model/DdbEsDeleteModel.js +31 -0
- package/operations/model/DdbEsDeleteModel.js.map +1 -0
- package/operations/model/DdbEsGetModel.d.ts +12 -0
- package/operations/model/DdbEsGetModel.js +30 -0
- package/operations/model/DdbEsGetModel.js.map +1 -0
- package/operations/model/DdbEsListModels.d.ts +12 -0
- package/operations/model/DdbEsListModels.js +36 -0
- package/operations/model/DdbEsListModels.js.map +1 -0
- package/operations/model/DdbEsUpdateModel.d.ts +12 -0
- package/operations/model/DdbEsUpdateModel.js +36 -0
- package/operations/model/DdbEsUpdateModel.js.map +1 -0
- package/operations/model/feature.d.ts +4 -0
- package/operations/model/feature.js +19 -0
- package/operations/model/feature.js.map +1 -0
- package/operations/model/keys.d.ts +15 -0
- package/operations/model/keys.js +17 -0
- package/operations/model/keys.js.map +1 -0
- package/package.json +49 -46
- package/registry/CmsEntitiesDbRegistryDecorator.d.ts +27 -0
- package/registry/CmsEntitiesDbRegistryDecorator.js +46 -0
- package/registry/CmsEntitiesDbRegistryDecorator.js.map +1 -0
- package/tasks/CreateElasticsearchIndexTask.d.ts +15 -0
- package/tasks/CreateElasticsearchIndexTask.js +49 -0
- package/tasks/CreateElasticsearchIndexTask.js.map +1 -0
- package/types.d.ts +13 -182
- package/types.js +10 -60
- package/types.js.map +1 -0
- package/configurations.d.ts +0 -12
- package/configurations.js +0 -32
- package/definitions/entryElasticsearch.d.ts +0 -8
- package/definitions/entryElasticsearch.js +0 -46
- package/definitions/settings.d.ts +0 -8
- package/definitions/settings.js +0 -62
- package/definitions/system.d.ts +0 -8
- package/definitions/system.js +0 -50
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -24
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -24
- package/dynamoDb/index.d.ts +0 -2
- package/dynamoDb/index.js +0 -18
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -65
- package/dynamoDb/storage/longText.d.ts +0 -7
- package/dynamoDb/storage/longText.js +0 -83
- package/dynamoDb/storage/richText.d.ts +0 -8
- package/dynamoDb/storage/richText.js +0 -110
- package/elasticsearch/index.d.ts +0 -2
- package/elasticsearch/index.js +0 -16
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +0 -3
- package/elasticsearch/indexing/dateTimeIndexing.js +0 -89
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +0 -3
- package/elasticsearch/indexing/defaultFieldIndexing.js +0 -47
- package/elasticsearch/indexing/index.d.ts +0 -2
- package/elasticsearch/indexing/index.js +0 -24
- package/elasticsearch/indexing/longTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/longTextIndexing.js +0 -36
- package/elasticsearch/indexing/numberIndexing.d.ts +0 -3
- package/elasticsearch/indexing/numberIndexing.js +0 -48
- package/elasticsearch/indexing/objectIndexing.d.ts +0 -3
- package/elasticsearch/indexing/objectIndexing.js +0 -200
- package/elasticsearch/indexing/richTextIndexing.d.ts +0 -3
- package/elasticsearch/indexing/richTextIndexing.js +0 -34
- package/elasticsearch/search/index.d.ts +0 -3
- package/elasticsearch/search/index.js +0 -16
- package/elasticsearch/search/refSearch.d.ts +0 -3
- package/elasticsearch/search/refSearch.js +0 -24
- package/elasticsearch/search/timeSearch.d.ts +0 -3
- package/elasticsearch/search/timeSearch.js +0 -25
- package/helpers/createElasticsearchQueryBody.d.ts +0 -11
- package/helpers/createElasticsearchQueryBody.js +0 -375
- package/helpers/entryIndexHelpers.d.ts +0 -18
- package/helpers/entryIndexHelpers.js +0 -189
- package/helpers/fields.d.ts +0 -77
- package/helpers/fields.js +0 -174
- package/helpers/index.d.ts +0 -2
- package/helpers/index.js +0 -31
- package/helpers/operatorPluginsList.d.ts +0 -7
- package/helpers/operatorPluginsList.js +0 -30
- package/helpers/searchPluginsList.d.ts +0 -6
- package/helpers/searchPluginsList.js +0 -26
- package/helpers/transformValueForSearch.d.ts +0 -9
- package/helpers/transformValueForSearch.js +0 -26
- package/operations/entry/elasticsearchFields.d.ts +0 -2
- package/operations/entry/elasticsearchFields.js +0 -32
- package/operations/entry/fields.d.ts +0 -3
- package/operations/entry/fields.js +0 -60
- package/operations/entry/index.d.ts +0 -13
- package/operations/entry/index.js +0 -1152
- package/operations/group/index.d.ts +0 -8
- package/operations/group/index.js +0 -202
- package/operations/model/index.d.ts +0 -8
- package/operations/model/index.js +0 -205
- package/operations/settings/index.d.ts +0 -6
- package/operations/settings/index.js +0 -141
- package/operations/system/createElasticsearchTemplate.d.ts +0 -5
- package/operations/system/createElasticsearchTemplate.js +0 -62
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -105
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +0 -17
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchFieldPlugin.d.ts +0 -12
- package/plugins/CmsEntryElasticsearchFieldPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +0 -17
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +0 -24
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +0 -17
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +0 -24
- package/upgrades/index.d.ts +0 -2
- package/upgrades/index.js +0 -16
- package/upgrades/utils.d.ts +0 -1
- package/upgrades/utils.js +0 -16
- package/upgrades/v5.0.0/cleanDatabaseRecord.d.ts +0 -6
- package/upgrades/v5.0.0/cleanDatabaseRecord.js +0 -16
- package/upgrades/v5.0.0/createOldVersionIndiceName.d.ts +0 -2
- package/upgrades/v5.0.0/createOldVersionIndiceName.js +0 -12
- package/upgrades/v5.0.0/entryValueFixer.d.ts +0 -4
- package/upgrades/v5.0.0/entryValueFixer.js +0 -124
- package/upgrades/v5.0.0/fieldFinder.d.ts +0 -6
- package/upgrades/v5.0.0/fieldFinder.js +0 -42
- package/upgrades/v5.0.0/helpers.d.ts +0 -4
- package/upgrades/v5.0.0/helpers.js +0 -57
- package/upgrades/v5.0.0/index.d.ts +0 -4
- package/upgrades/v5.0.0/index.js +0 -232
- package/upgrades/v5.8.0/index.d.ts +0 -4
- package/upgrades/v5.8.0/index.js +0 -426
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createSystemStorageOperations = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
-
|
|
14
|
-
var _get = require("@webiny/db-dynamodb/utils/get");
|
|
15
|
-
|
|
16
|
-
var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
-
|
|
22
|
-
const createPartitionKey = ({
|
|
23
|
-
tenant
|
|
24
|
-
}) => {
|
|
25
|
-
return `T#${tenant.toLowerCase()}#SYSTEM`;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
const createSortKey = () => {
|
|
29
|
-
return "CMS";
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
const createKeys = params => {
|
|
33
|
-
return {
|
|
34
|
-
PK: createPartitionKey(params),
|
|
35
|
-
SK: createSortKey()
|
|
36
|
-
};
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const createSystemStorageOperations = params => {
|
|
40
|
-
const {
|
|
41
|
-
entity
|
|
42
|
-
} = params;
|
|
43
|
-
|
|
44
|
-
const create = async ({
|
|
45
|
-
system
|
|
46
|
-
}) => {
|
|
47
|
-
const keys = createKeys(system);
|
|
48
|
-
|
|
49
|
-
try {
|
|
50
|
-
await entity.put(_objectSpread(_objectSpread({}, system), keys));
|
|
51
|
-
return system;
|
|
52
|
-
} catch (ex) {
|
|
53
|
-
throw new _error.default(ex.message || "Could not create system.", ex.code || "CREATE_SYSTEM_ERROR", {
|
|
54
|
-
error: ex,
|
|
55
|
-
system,
|
|
56
|
-
keys
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
const update = async params => {
|
|
62
|
-
const {
|
|
63
|
-
system,
|
|
64
|
-
original
|
|
65
|
-
} = params;
|
|
66
|
-
const keys = createKeys(system);
|
|
67
|
-
|
|
68
|
-
try {
|
|
69
|
-
await entity.put(_objectSpread(_objectSpread({}, system), keys));
|
|
70
|
-
return system;
|
|
71
|
-
} catch (ex) {
|
|
72
|
-
throw new _error.default(ex.message || "Could not update system.", ex.code || "UPDATE_SYSTEM_ERROR", {
|
|
73
|
-
error: ex,
|
|
74
|
-
system,
|
|
75
|
-
original,
|
|
76
|
-
keys
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
const get = async params => {
|
|
82
|
-
const keys = createKeys(params);
|
|
83
|
-
|
|
84
|
-
try {
|
|
85
|
-
const system = await (0, _get.get)({
|
|
86
|
-
entity,
|
|
87
|
-
keys
|
|
88
|
-
});
|
|
89
|
-
return (0, _cleanup.cleanupItem)(entity, system);
|
|
90
|
-
} catch (ex) {
|
|
91
|
-
throw new _error.default(ex.message || "Could not get system.", ex.code || "GET_SYSTEM_ERROR", {
|
|
92
|
-
error: ex,
|
|
93
|
-
keys
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
return {
|
|
99
|
-
create,
|
|
100
|
-
update,
|
|
101
|
-
get
|
|
102
|
-
};
|
|
103
|
-
};
|
|
104
|
-
|
|
105
|
-
exports.createSystemStorageOperations = createSystemStorageOperations;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ElasticsearchBodyModifierPlugin, ModifyBodyCallable, ModifyBodyParams as BaseModifyBodyParams } from "@webiny/api-elasticsearch/plugins/definition/ElasticsearchBodyModifierPlugin";
|
|
2
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
|
-
export interface ModifyBodyParams extends BaseModifyBodyParams {
|
|
4
|
-
model: CmsModel;
|
|
5
|
-
}
|
|
6
|
-
export interface Config {
|
|
7
|
-
modifyBody: ModifyBodyCallable<ModifyBodyParams>;
|
|
8
|
-
/**
|
|
9
|
-
* If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
|
|
10
|
-
*/
|
|
11
|
-
modelId?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class CmsEntryElasticsearchBodyModifierPlugin extends ElasticsearchBodyModifierPlugin<ModifyBodyParams> {
|
|
14
|
-
static readonly type: string;
|
|
15
|
-
readonly modelId?: string;
|
|
16
|
-
constructor(config: Config);
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.CmsEntryElasticsearchBodyModifierPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _ElasticsearchBodyModifierPlugin = require("@webiny/api-elasticsearch/plugins/definition/ElasticsearchBodyModifierPlugin");
|
|
13
|
-
|
|
14
|
-
class CmsEntryElasticsearchBodyModifierPlugin extends _ElasticsearchBodyModifierPlugin.ElasticsearchBodyModifierPlugin {
|
|
15
|
-
constructor(config) {
|
|
16
|
-
super(config.modifyBody);
|
|
17
|
-
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
18
|
-
this.modelId = config.modelId;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.CmsEntryElasticsearchBodyModifierPlugin = CmsEntryElasticsearchBodyModifierPlugin;
|
|
24
|
-
(0, _defineProperty2.default)(CmsEntryElasticsearchBodyModifierPlugin, "type", "cms.elasticsearch.modifier.body.entry");
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ElasticsearchFieldPlugin, Params as BaseParams } from "@webiny/api-elasticsearch/plugins/definition/ElasticsearchFieldPlugin";
|
|
2
|
-
export interface Params extends BaseParams {
|
|
3
|
-
/**
|
|
4
|
-
* If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
|
|
5
|
-
*/
|
|
6
|
-
modelId?: string;
|
|
7
|
-
}
|
|
8
|
-
export declare class CmsEntryElasticsearchFieldPlugin extends ElasticsearchFieldPlugin {
|
|
9
|
-
static readonly type: string;
|
|
10
|
-
readonly modelId?: string;
|
|
11
|
-
constructor(params: Params);
|
|
12
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.CmsEntryElasticsearchFieldPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _ElasticsearchFieldPlugin = require("@webiny/api-elasticsearch/plugins/definition/ElasticsearchFieldPlugin");
|
|
13
|
-
|
|
14
|
-
class CmsEntryElasticsearchFieldPlugin extends _ElasticsearchFieldPlugin.ElasticsearchFieldPlugin {
|
|
15
|
-
constructor(params) {
|
|
16
|
-
super(params);
|
|
17
|
-
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
18
|
-
this.modelId = params.modelId;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.CmsEntryElasticsearchFieldPlugin = CmsEntryElasticsearchFieldPlugin;
|
|
24
|
-
(0, _defineProperty2.default)(CmsEntryElasticsearchFieldPlugin, "type", "elasticsearch.fieldDefinition.cms.entry");
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ElasticsearchQueryModifierPlugin, ModifyQueryCallable, ModifyQueryParams as BaseModifyQueryParams } from "@webiny/api-elasticsearch/plugins/definition/ElasticsearchQueryModifierPlugin";
|
|
2
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
|
-
export interface ModifyQueryParams extends BaseModifyQueryParams {
|
|
4
|
-
model: CmsModel;
|
|
5
|
-
}
|
|
6
|
-
export interface Config {
|
|
7
|
-
modifyQuery: ModifyQueryCallable<ModifyQueryParams>;
|
|
8
|
-
/**
|
|
9
|
-
* If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
|
|
10
|
-
*/
|
|
11
|
-
modelId?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class CmsEntryElasticsearchQueryModifierPlugin extends ElasticsearchQueryModifierPlugin<ModifyQueryParams> {
|
|
14
|
-
static readonly type: string;
|
|
15
|
-
readonly modelId?: string;
|
|
16
|
-
constructor(config: Config);
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.CmsEntryElasticsearchQueryModifierPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _ElasticsearchQueryModifierPlugin = require("@webiny/api-elasticsearch/plugins/definition/ElasticsearchQueryModifierPlugin");
|
|
13
|
-
|
|
14
|
-
class CmsEntryElasticsearchQueryModifierPlugin extends _ElasticsearchQueryModifierPlugin.ElasticsearchQueryModifierPlugin {
|
|
15
|
-
constructor(config) {
|
|
16
|
-
super(config.modifyQuery);
|
|
17
|
-
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
18
|
-
this.modelId = config.modelId;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.CmsEntryElasticsearchQueryModifierPlugin = CmsEntryElasticsearchQueryModifierPlugin;
|
|
24
|
-
(0, _defineProperty2.default)(CmsEntryElasticsearchQueryModifierPlugin, "type", "cms.elasticsearch.modifier.query.entry");
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ElasticsearchSortModifierPlugin, ModifySortCallable, ModifySortParams as BaseModifySortParams } from "@webiny/api-elasticsearch/plugins/definition/ElasticsearchSortModifierPlugin";
|
|
2
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
3
|
-
export interface ModifySortParams extends BaseModifySortParams {
|
|
4
|
-
model: CmsModel;
|
|
5
|
-
}
|
|
6
|
-
export interface Config {
|
|
7
|
-
modifySort: ModifySortCallable<ModifySortParams>;
|
|
8
|
-
/**
|
|
9
|
-
* If modelId is not passed, there is no filtering of plugins by it when plugin is applied during the runtime.
|
|
10
|
-
*/
|
|
11
|
-
modelId?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare class CmsEntryElasticsearchSortModifierPlugin extends ElasticsearchSortModifierPlugin<ModifySortParams> {
|
|
14
|
-
static readonly type: string;
|
|
15
|
-
readonly modelId?: string;
|
|
16
|
-
constructor(config: Config);
|
|
17
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.CmsEntryElasticsearchSortModifierPlugin = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _ElasticsearchSortModifierPlugin = require("@webiny/api-elasticsearch/plugins/definition/ElasticsearchSortModifierPlugin");
|
|
13
|
-
|
|
14
|
-
class CmsEntryElasticsearchSortModifierPlugin extends _ElasticsearchSortModifierPlugin.ElasticsearchSortModifierPlugin {
|
|
15
|
-
constructor(config) {
|
|
16
|
-
super(config.modifySort);
|
|
17
|
-
(0, _defineProperty2.default)(this, "modelId", void 0);
|
|
18
|
-
this.modelId = config.modelId;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.CmsEntryElasticsearchSortModifierPlugin = CmsEntryElasticsearchSortModifierPlugin;
|
|
24
|
-
(0, _defineProperty2.default)(CmsEntryElasticsearchSortModifierPlugin, "type", "cms.elasticsearch.modifier.sort.entry");
|
package/upgrades/index.d.ts
DELETED
package/upgrades/index.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _index = _interopRequireDefault(require("./v5.0.0/index"));
|
|
11
|
-
|
|
12
|
-
var _index2 = _interopRequireDefault(require("./v5.8.0/index"));
|
|
13
|
-
|
|
14
|
-
var _default = () => [(0, _index.default)(), (0, _index2.default)()];
|
|
15
|
-
|
|
16
|
-
exports.default = _default;
|
package/upgrades/utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const paginateBatch: (items: any, perPage: any, execute: any) => Promise<void>;
|
package/upgrades/utils.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.paginateBatch = void 0;
|
|
7
|
-
|
|
8
|
-
const paginateBatch = async (items, perPage, execute) => {
|
|
9
|
-
const pages = Math.ceil(items.length / perPage);
|
|
10
|
-
|
|
11
|
-
for (let i = 0; i < pages; i++) {
|
|
12
|
-
await execute(items.slice(i * perPage, i * perPage + perPage));
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.paginateBatch = paginateBatch;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.cleanDatabaseRecord = void 0;
|
|
9
|
-
|
|
10
|
-
var _lodash = _interopRequireDefault(require("lodash.omit"));
|
|
11
|
-
|
|
12
|
-
const cleanDatabaseRecord = record => {
|
|
13
|
-
return (0, _lodash.default)(record, ["PK", "SK", "TYPE"]);
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
exports.cleanDatabaseRecord = cleanDatabaseRecord;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createOldVersionIndiceName = void 0;
|
|
7
|
-
|
|
8
|
-
const createOldVersionIndiceName = context => {
|
|
9
|
-
return `${context.tenancy.getCurrentTenant().id}-headless-cms`;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
exports.createOldVersionIndiceName = createOldVersionIndiceName;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ModelFieldFinder } from "./fieldFinder";
|
|
2
|
-
import { CmsIndexEntry } from "../../types";
|
|
3
|
-
import { CmsEntry, CmsModel } from "@webiny/api-headless-cms/types";
|
|
4
|
-
export declare const entryValueFixer: (_: CmsModel, finder: ModelFieldFinder, target: CmsIndexEntry) => CmsEntry;
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.entryValueFixer = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _cleanDatabaseRecord = require("./cleanDatabaseRecord");
|
|
13
|
-
|
|
14
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
15
|
-
|
|
16
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
17
|
-
|
|
18
|
-
const convertTimeToNumber = time => {
|
|
19
|
-
if (!time) {
|
|
20
|
-
return null;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const [hours, minutes, seconds = 0] = time.split(":").map(Number);
|
|
24
|
-
return hours * 60 * 60 + minutes * 60 + seconds;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const fixRawValues = (target, finder) => {
|
|
28
|
-
const entry = _objectSpread({}, target);
|
|
29
|
-
|
|
30
|
-
for (const fieldId in entry.rawValues) {
|
|
31
|
-
// if field is ref field then continue, otherwise break
|
|
32
|
-
const field = finder.findById(target.modelId, fieldId);
|
|
33
|
-
|
|
34
|
-
if (field.type !== "ref") {
|
|
35
|
-
continue;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const existingValue = entry.values[fieldId];
|
|
39
|
-
const rawValue = entry.rawValues[fieldId]; // always remove from rawValue
|
|
40
|
-
|
|
41
|
-
delete entry.rawValues[fieldId]; // if there is something in values - do not switch it
|
|
42
|
-
|
|
43
|
-
if (typeof existingValue !== "undefined" || rawValue === undefined || rawValue === null) {
|
|
44
|
-
continue;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
entry.values[fieldId] = rawValue;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return entry;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
const fixTime = (field, time) => {
|
|
54
|
-
if (isNaN(time) === false) {
|
|
55
|
-
return parseInt(time);
|
|
56
|
-
} // lets not reinvent the wheel
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
return convertTimeToNumber(time);
|
|
61
|
-
} catch (err) {
|
|
62
|
-
console.log(`fixTime on field "${field.fieldId}" failed`, err);
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
const fixDateTime = (field, dateTime) => {
|
|
68
|
-
switch (field.settings.type) {
|
|
69
|
-
case "time":
|
|
70
|
-
return fixTime(field, dateTime);
|
|
71
|
-
|
|
72
|
-
case "date":
|
|
73
|
-
return new Date(dateTime).toISOString();
|
|
74
|
-
|
|
75
|
-
case "dateTimeWithoutTimezone":
|
|
76
|
-
return new Date(dateTime).toISOString();
|
|
77
|
-
|
|
78
|
-
default:
|
|
79
|
-
return dateTime;
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const fixNumber = (_, value) => {
|
|
84
|
-
if (value === undefined || value === null) {
|
|
85
|
-
return null;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
return parseFloat(value);
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
const fieldFixMethods = {
|
|
92
|
-
datetime: fixDateTime,
|
|
93
|
-
number: fixNumber
|
|
94
|
-
};
|
|
95
|
-
|
|
96
|
-
const fixFieldValues = (target, finder) => {
|
|
97
|
-
const entry = _objectSpread({}, target);
|
|
98
|
-
|
|
99
|
-
for (const fieldId in target.values) {
|
|
100
|
-
const field = finder.findById(target.modelId, fieldId);
|
|
101
|
-
|
|
102
|
-
if (!field) {
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const fixMethod = fieldFixMethods[field.type];
|
|
107
|
-
|
|
108
|
-
if (!fixMethod) {
|
|
109
|
-
continue;
|
|
110
|
-
} else if (target.values[fieldId] === null || target.values[fieldId] === undefined) {
|
|
111
|
-
continue;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
target.values[fieldId] = fixMethod(field, target.values[fieldId]);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
return entry;
|
|
118
|
-
};
|
|
119
|
-
|
|
120
|
-
const entryValueFixer = (_, finder, target) => {
|
|
121
|
-
return (0, _cleanDatabaseRecord.cleanDatabaseRecord)(fixFieldValues(fixRawValues(target, finder), finder));
|
|
122
|
-
};
|
|
123
|
-
|
|
124
|
-
exports.entryValueFixer = entryValueFixer;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
|
|
2
|
-
export interface ModelFieldFinder {
|
|
3
|
-
findById: (model: CmsModel | string, fieldId: string) => CmsModelField;
|
|
4
|
-
findByType: (model: CmsModel | string, type: string) => CmsModelField[];
|
|
5
|
-
}
|
|
6
|
-
export declare const createFieldFinder: (models: CmsModel[]) => ModelFieldFinder;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createFieldFinder = void 0;
|
|
7
|
-
|
|
8
|
-
const createFieldFinder = models => {
|
|
9
|
-
const modelsList = {};
|
|
10
|
-
|
|
11
|
-
for (const model of models) {
|
|
12
|
-
const values = {
|
|
13
|
-
id: {},
|
|
14
|
-
type: {}
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
for (const field of model.fields) {
|
|
18
|
-
values.id[field.fieldId] = field;
|
|
19
|
-
|
|
20
|
-
if (!values.type[field.type]) {
|
|
21
|
-
values.type[field.type] = [];
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
values.type[field.type].push(field);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
modelsList[model.modelId] = values;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
return {
|
|
31
|
-
findById: (model, fieldId) => {
|
|
32
|
-
const modelId = typeof model === "string" ? model : model.modelId;
|
|
33
|
-
return modelsList[modelId].id[fieldId];
|
|
34
|
-
},
|
|
35
|
-
findByType: (model, type) => {
|
|
36
|
-
const modelId = typeof model === "string" ? model : model.modelId;
|
|
37
|
-
return modelsList[modelId].type[type];
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
exports.createFieldFinder = createFieldFinder;
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
|
|
7
|
-
var _cleanDatabaseRecord = require("./cleanDatabaseRecord");
|
|
8
|
-
|
|
9
|
-
Object.keys(_cleanDatabaseRecord).forEach(function (key) {
|
|
10
|
-
if (key === "default" || key === "__esModule") return;
|
|
11
|
-
if (key in exports && exports[key] === _cleanDatabaseRecord[key]) return;
|
|
12
|
-
Object.defineProperty(exports, key, {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () {
|
|
15
|
-
return _cleanDatabaseRecord[key];
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
var _entryValueFixer = require("./entryValueFixer");
|
|
21
|
-
|
|
22
|
-
Object.keys(_entryValueFixer).forEach(function (key) {
|
|
23
|
-
if (key === "default" || key === "__esModule") return;
|
|
24
|
-
if (key in exports && exports[key] === _entryValueFixer[key]) return;
|
|
25
|
-
Object.defineProperty(exports, key, {
|
|
26
|
-
enumerable: true,
|
|
27
|
-
get: function () {
|
|
28
|
-
return _entryValueFixer[key];
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
var _fieldFinder = require("./fieldFinder");
|
|
34
|
-
|
|
35
|
-
Object.keys(_fieldFinder).forEach(function (key) {
|
|
36
|
-
if (key === "default" || key === "__esModule") return;
|
|
37
|
-
if (key in exports && exports[key] === _fieldFinder[key]) return;
|
|
38
|
-
Object.defineProperty(exports, key, {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
get: function () {
|
|
41
|
-
return _fieldFinder[key];
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
var _createOldVersionIndiceName = require("./createOldVersionIndiceName");
|
|
47
|
-
|
|
48
|
-
Object.keys(_createOldVersionIndiceName).forEach(function (key) {
|
|
49
|
-
if (key === "default" || key === "__esModule") return;
|
|
50
|
-
if (key in exports && exports[key] === _createOldVersionIndiceName[key]) return;
|
|
51
|
-
Object.defineProperty(exports, key, {
|
|
52
|
-
enumerable: true,
|
|
53
|
-
get: function () {
|
|
54
|
-
return _createOldVersionIndiceName[key];
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
});
|