@webiny/api-headless-cms-ddb-es 6.0.0-beta.0 → 6.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -30
- package/configurations.d.ts +4 -5
- package/configurations.js +12 -24
- package/configurations.js.map +1 -1
- package/definitions/entry.d.ts +4 -5
- package/definitions/entry.js +5 -174
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +6 -6
- package/definitions/group.js +5 -58
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +6 -6
- package/definitions/model.js +5 -102
- package/definitions/model.js.map +1 -1
- package/definitions/types.d.ts +59 -0
- package/definitions/types.js +3 -0
- package/definitions/types.js.map +1 -0
- package/dynamoDb/index.d.ts +2 -2
- package/dynamoDb/index.js +5 -14
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/storage/longText.js +11 -18
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.d.ts +0 -5
- package/dynamoDb/storage/richText.js +25 -80
- package/dynamoDb/storage/richText.js.map +1 -1
- package/elasticsearch/createElasticsearchIndex.d.ts +3 -3
- package/elasticsearch/createElasticsearchIndex.js +7 -15
- package/elasticsearch/createElasticsearchIndex.js.map +1 -1
- package/elasticsearch/deleteElasticsearchIndex.d.ts +2 -2
- package/elasticsearch/deleteElasticsearchIndex.js +3 -10
- package/elasticsearch/deleteElasticsearchIndex.js.map +1 -1
- package/elasticsearch/index.d.ts +1 -1
- package/elasticsearch/index.js +3 -11
- package/elasticsearch/index.js.map +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.d.ts +1 -1
- package/elasticsearch/indexing/dateTimeIndexing.js +1 -8
- package/elasticsearch/indexing/dateTimeIndexing.js.map +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.d.ts +1 -1
- package/elasticsearch/indexing/defaultFieldIndexing.js +1 -8
- package/elasticsearch/indexing/defaultFieldIndexing.js.map +1 -1
- package/elasticsearch/indexing/index.d.ts +1 -1
- package/elasticsearch/indexing/index.js +8 -16
- package/elasticsearch/indexing/index.js.map +1 -1
- package/elasticsearch/indexing/jsonIndexing.d.ts +1 -1
- package/elasticsearch/indexing/jsonIndexing.js +1 -8
- package/elasticsearch/indexing/jsonIndexing.js.map +1 -1
- package/elasticsearch/indexing/longTextIndexing.d.ts +1 -1
- package/elasticsearch/indexing/longTextIndexing.js +1 -8
- package/elasticsearch/indexing/longTextIndexing.js.map +1 -1
- package/elasticsearch/indexing/numberIndexing.d.ts +1 -1
- package/elasticsearch/indexing/numberIndexing.js +1 -8
- package/elasticsearch/indexing/numberIndexing.js.map +1 -1
- package/elasticsearch/indexing/objectIndexing.d.ts +1 -1
- package/elasticsearch/indexing/objectIndexing.js +6 -13
- package/elasticsearch/indexing/objectIndexing.js.map +1 -1
- package/elasticsearch/indexing/richTextIndexing.d.ts +1 -1
- package/elasticsearch/indexing/richTextIndexing.js +1 -8
- package/elasticsearch/indexing/richTextIndexing.js.map +1 -1
- package/elasticsearch/indices/base.d.ts +1 -1
- package/elasticsearch/indices/base.js +4 -10
- package/elasticsearch/indices/base.js.map +1 -1
- package/elasticsearch/indices/index.d.ts +1 -1
- package/elasticsearch/indices/index.js +3 -11
- package/elasticsearch/indices/index.js.map +1 -1
- package/elasticsearch/search/index.d.ts +1 -1
- package/elasticsearch/search/index.js +4 -10
- package/elasticsearch/search/index.js.map +1 -1
- package/elasticsearch/search/refSearch.d.ts +1 -1
- package/elasticsearch/search/refSearch.js +3 -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 +3 -10
- package/elasticsearch/search/timeSearch.js.map +1 -1
- package/helpers/entryIndexHelpers.d.ts +10 -10
- package/helpers/entryIndexHelpers.js +32 -26
- package/helpers/entryIndexHelpers.js.map +1 -1
- package/helpers/fieldIdentifier.d.ts +1 -1
- package/helpers/fieldIdentifier.js +2 -10
- package/helpers/fieldIdentifier.js.map +1 -1
- package/helpers/index.d.ts +2 -2
- package/helpers/index.js +2 -27
- package/helpers/index.js.map +1 -1
- package/index.d.ts +2 -2
- package/index.js +108 -134
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -3
- package/operations/entry/dataLoader/DataLoaderCache.js +2 -9
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js +1 -7
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js +4 -10
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +3 -3
- package/operations/entry/dataLoader/getAllEntryRevisions.js +11 -24
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +18 -30
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +3 -3
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +18 -30
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.d.ts +3 -3
- package/operations/entry/dataLoader/getRevisionById.js +23 -35
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.d.ts +5 -5
- package/operations/entry/dataLoader/index.js +10 -31
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +3 -4
- package/operations/entry/dataLoader/types.js +1 -5
- package/operations/entry/dataLoader/types.js.map +1 -1
- package/operations/entry/dataLoaders.d.ts +13 -13
- package/operations/entry/dataLoaders.js +15 -25
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.d.ts +1 -1
- package/operations/entry/elasticsearch/assignMinimumShouldMatchToQuery.js +1 -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 +21 -28
- package/operations/entry/elasticsearch/body.js.map +1 -1
- package/operations/entry/elasticsearch/fields.d.ts +3 -3
- package/operations/entry/elasticsearch/fields.js +110 -24
- 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 +10 -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 +48 -45
- 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 +1 -16
- 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 +9 -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 +6 -14
- 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 +5 -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 +7 -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 +15 -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 +1 -8
- 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 +4 -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 +6 -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 +1 -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 +9 -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 +4 -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 +3 -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 +4 -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 +3 -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 +5 -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 +3 -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 +57 -33
- package/operations/entry/elasticsearch/sort.js.map +1 -1
- package/operations/entry/elasticsearch/transformValueForSearch.d.ts +2 -2
- package/operations/entry/elasticsearch/transformValueForSearch.js +4 -9
- package/operations/entry/elasticsearch/transformValueForSearch.js.map +1 -1
- package/operations/entry/elasticsearch/types.d.ts +5 -5
- package/operations/entry/elasticsearch/types.js +1 -5
- package/operations/entry/elasticsearch/types.js.map +1 -1
- package/operations/entry/index.d.ts +7 -6
- package/operations/entry/index.js +634 -735
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.d.ts +31 -1
- package/operations/entry/keys.js +56 -19
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/recordType.js +3 -12
- package/operations/entry/recordType.js.map +1 -1
- package/operations/entry/transformations/convertEntryKeys.d.ts +6 -6
- package/operations/entry/transformations/convertEntryKeys.js +2 -10
- package/operations/entry/transformations/convertEntryKeys.js.map +1 -1
- package/operations/entry/transformations/index.d.ts +17 -17
- package/operations/entry/transformations/index.js +22 -30
- package/operations/entry/transformations/index.js.map +1 -1
- package/operations/entry/transformations/modifyEntryValues.d.ts +27 -34
- package/operations/entry/transformations/modifyEntryValues.js +1 -8
- package/operations/entry/transformations/modifyEntryValues.js.map +1 -1
- package/operations/entry/transformations/transformEntryKeys.d.ts +8 -8
- package/operations/entry/transformations/transformEntryKeys.js +4 -11
- package/operations/entry/transformations/transformEntryKeys.js.map +1 -1
- package/operations/entry/transformations/transformEntryToIndex.d.ts +7 -7
- package/operations/entry/transformations/transformEntryToIndex.js +3 -10
- package/operations/entry/transformations/transformEntryToIndex.js.map +1 -1
- package/operations/group/index.d.ts +6 -5
- package/operations/group/index.js +39 -73
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +4 -4
- package/operations/model/index.js +38 -57
- package/operations/model/index.js.map +1 -1
- package/package.json +29 -41
- package/plugins/CmsElasticsearchModelFieldPlugin.d.ts +1 -1
- package/plugins/CmsElasticsearchModelFieldPlugin.js +2 -8
- package/plugins/CmsElasticsearchModelFieldPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchBodyModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.d.ts +2 -2
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchFullTextSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchIndexPlugin.js +2 -9
- package/plugins/CmsEntryElasticsearchIndexPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryBuilderValueSearchPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchQueryModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.d.ts +3 -2
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js +3 -11
- package/plugins/CmsEntryElasticsearchSortModifierPlugin.js.map +1 -1
- package/plugins/CmsEntryElasticsearchValuesModifier.d.ts +12 -12
- package/plugins/CmsEntryElasticsearchValuesModifier.js +4 -12
- package/plugins/CmsEntryElasticsearchValuesModifier.js.map +1 -1
- package/plugins/CmsEntryFilterPlugin.d.ts +3 -3
- package/plugins/CmsEntryFilterPlugin.js +2 -9
- package/plugins/CmsEntryFilterPlugin.js.map +1 -1
- package/plugins/index.d.ts +8 -8
- package/plugins/index.js +8 -93
- package/plugins/index.js.map +1 -1
- package/tasks/createIndexTaskPlugin.d.ts +2 -2
- package/tasks/createIndexTaskPlugin.js +36 -62
- package/tasks/createIndexTaskPlugin.js.map +1 -1
- package/types.d.ts +28 -33
- package/types.js +5 -8
- 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 -38
- package/definitions/entryElasticsearch.js.map +0 -1
- package/definitions/system.d.ts +0 -8
- package/definitions/system.js +0 -42
- package/definitions/system.js.map +0 -1
- package/definitions/table.d.ts +0 -8
- package/definitions/table.js +0 -25
- package/definitions/table.js.map +0 -1
- package/definitions/tableElasticsearch.d.ts +0 -8
- package/definitions/tableElasticsearch.js +0 -25
- 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 -14
- package/elasticsearch/indices/japanese.js.map +0 -1
- package/operations/system/index.d.ts +0 -6
- package/operations/system/index.js +0 -94
- package/operations/system/index.js.map +0 -1
- package/operations/system/indexes.d.ts +0 -10
- package/operations/system/indexes.js +0 -41
- package/operations/system/indexes.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,35 +1,11 @@
|
|
|
1
1
|
# @webiny/api-headless-cms-ddb-es
|
|
2
2
|
|
|
3
|
-
[!
|
|
4
|
-
[
|
|
5
|
-
|
|
6
|
-
[](http://makeapullrequest.com)
|
|
3
|
+
> [!NOTE]
|
|
4
|
+
> This package is part of the [Webiny](https://www.webiny.com) monorepo.
|
|
5
|
+
> It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
npm install --save @webiny/api-headless-cms-ddb-es
|
|
12
|
-
```
|
|
9
|
+
---
|
|
13
10
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
yarn add @webiny/api-headless-cms-ddb-es
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
## Testing
|
|
22
|
-
To run the tests only for this package you must filter it with keywords.
|
|
23
|
-
|
|
24
|
-
### Env variables
|
|
25
|
-
|
|
26
|
-
###### LOCAL_ELASTICSEARCH
|
|
27
|
-
If set, does not run Elasticsearch when starting the tests, use local one. You must install it and run if, of course.
|
|
28
|
-
|
|
29
|
-
###### ELASTICSEARCH_PORT
|
|
30
|
-
Custom port for local elasticsearch.
|
|
31
|
-
|
|
32
|
-
### Command
|
|
33
|
-
````
|
|
34
|
-
ELASTICSEARCH_PORT=9200 LOCAL_ELASTICSEARCH=true yarn test packages/api-headless-cms --keyword=cms:ddb-es --keyword=cms:base
|
|
35
|
-
````
|
|
11
|
+
_This README file is automatically generated during the publish process._
|
package/configurations.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import { CmsContext } from "./types";
|
|
3
|
-
import { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types";
|
|
1
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types/index.js";
|
|
2
|
+
import type { CmsContext } from "./types.js";
|
|
3
|
+
import type { ElasticsearchIndexRequestBody } from "@webiny/api-elasticsearch/types.js";
|
|
4
4
|
interface ConfigurationsElasticsearch {
|
|
5
5
|
index: string;
|
|
6
6
|
}
|
|
7
7
|
export interface CmsElasticsearchParams {
|
|
8
|
-
model: Pick<CmsModel, "tenant" | "
|
|
8
|
+
model: Pick<CmsModel, "tenant" | "modelId">;
|
|
9
9
|
}
|
|
10
10
|
export interface ConfigurationsIndexSettingsParams {
|
|
11
11
|
context: CmsContext;
|
|
12
|
-
model: Pick<CmsModel, "locale">;
|
|
13
12
|
}
|
|
14
13
|
export interface Configurations {
|
|
15
14
|
es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;
|
package/configurations.js
CHANGED
|
@@ -1,29 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.configurations = void 0;
|
|
8
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
9
|
-
var _apiElasticsearch = require("@webiny/api-elasticsearch");
|
|
10
|
-
var _plugins = require("./plugins");
|
|
11
|
-
const configurations = exports.configurations = {
|
|
1
|
+
import WebinyError from "@webiny/error";
|
|
2
|
+
import { getElasticsearchIndexPrefix, getLastAddedIndexPlugin, isSharedElasticsearchIndex } from "@webiny/api-elasticsearch";
|
|
3
|
+
import { CmsEntryElasticsearchIndexPlugin } from "./plugins/index.js";
|
|
4
|
+
export const configurations = {
|
|
12
5
|
es({
|
|
13
6
|
model
|
|
14
7
|
}) {
|
|
15
8
|
const {
|
|
16
|
-
tenant
|
|
17
|
-
locale
|
|
9
|
+
tenant
|
|
18
10
|
} = model;
|
|
19
11
|
if (!tenant) {
|
|
20
|
-
throw new
|
|
21
|
-
} else if (!locale) {
|
|
22
|
-
throw new _error.default(`Missing "locale" parameter when trying to create Elasticsearch index name.`, "LOCALE_ERROR");
|
|
12
|
+
throw new WebinyError(`Missing "tenant" parameter when trying to create Elasticsearch index name.`, "TENANT_ERROR");
|
|
23
13
|
}
|
|
24
|
-
const sharedIndex =
|
|
25
|
-
const index = [sharedIndex ? "root" : tenant, "headless-cms",
|
|
26
|
-
const prefix =
|
|
14
|
+
const sharedIndex = isSharedElasticsearchIndex();
|
|
15
|
+
const index = [sharedIndex ? "root" : tenant, "headless-cms", model.modelId].join("-").toLowerCase();
|
|
16
|
+
const prefix = getElasticsearchIndexPrefix();
|
|
27
17
|
if (!prefix) {
|
|
28
18
|
return {
|
|
29
19
|
index
|
|
@@ -34,13 +24,11 @@ const configurations = exports.configurations = {
|
|
|
34
24
|
};
|
|
35
25
|
},
|
|
36
26
|
indexSettings: ({
|
|
37
|
-
context
|
|
38
|
-
model
|
|
27
|
+
context
|
|
39
28
|
}) => {
|
|
40
|
-
const plugin =
|
|
29
|
+
const plugin = getLastAddedIndexPlugin({
|
|
41
30
|
container: context.plugins,
|
|
42
|
-
type:
|
|
43
|
-
locale: model.locale
|
|
31
|
+
type: CmsEntryElasticsearchIndexPlugin.type
|
|
44
32
|
});
|
|
45
33
|
return plugin ? plugin.body : {};
|
|
46
34
|
}
|
package/configurations.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["WebinyError","getElasticsearchIndexPrefix","getLastAddedIndexPlugin","isSharedElasticsearchIndex","CmsEntryElasticsearchIndexPlugin","configurations","es","model","tenant","sharedIndex","index","modelId","join","toLowerCase","prefix","indexSettings","context","plugin","container","plugins","type","body"],"sources":["configurations.ts"],"sourcesContent":["import type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\nimport WebinyError from \"@webiny/error\";\nimport type { CmsContext } from \"~/types.js\";\nimport {\n getElasticsearchIndexPrefix,\n getLastAddedIndexPlugin,\n isSharedElasticsearchIndex\n} from \"@webiny/api-elasticsearch\";\nimport type { ElasticsearchIndexRequestBody } from \"@webiny/api-elasticsearch/types.js\";\nimport { CmsEntryElasticsearchIndexPlugin } from \"~/plugins/index.js\";\n\ninterface ConfigurationsElasticsearch {\n index: string;\n}\n\nexport interface CmsElasticsearchParams {\n model: Pick<CmsModel, \"tenant\" | \"modelId\">;\n}\n\nexport interface ConfigurationsIndexSettingsParams {\n context: CmsContext;\n}\n\nexport interface Configurations {\n es: (params: CmsElasticsearchParams) => ConfigurationsElasticsearch;\n indexSettings: (\n params: ConfigurationsIndexSettingsParams\n ) => Partial<ElasticsearchIndexRequestBody>;\n}\n\nexport const configurations: Configurations = {\n es({ model }) {\n const { tenant } = model;\n\n if (!tenant) {\n throw new WebinyError(\n `Missing \"tenant\" parameter when trying to create Elasticsearch index name.`,\n \"TENANT_ERROR\"\n );\n }\n\n const sharedIndex = isSharedElasticsearchIndex();\n const index = [sharedIndex ? \"root\" : tenant, \"headless-cms\", model.modelId]\n .join(\"-\")\n .toLowerCase();\n\n const prefix = getElasticsearchIndexPrefix();\n\n if (!prefix) {\n return {\n index\n };\n }\n return {\n index: prefix + index\n };\n },\n indexSettings: ({ context }) => {\n const plugin = getLastAddedIndexPlugin<CmsEntryElasticsearchIndexPlugin>({\n container: context.plugins,\n type: CmsEntryElasticsearchIndexPlugin.type\n });\n\n return plugin ? plugin.body : {};\n }\n};\n"],"mappings":"AACA,OAAOA,WAAW,MAAM,eAAe;AAEvC,SACIC,2BAA2B,EAC3BC,uBAAuB,EACvBC,0BAA0B,QACvB,2BAA2B;AAElC,SAASC,gCAAgC;AAqBzC,OAAO,MAAMC,cAA8B,GAAG;EAC1CC,EAAEA,CAAC;IAAEC;EAAM,CAAC,EAAE;IACV,MAAM;MAAEC;IAAO,CAAC,GAAGD,KAAK;IAExB,IAAI,CAACC,MAAM,EAAE;MACT,MAAM,IAAIR,WAAW,CACjB,4EAA4E,EAC5E,cACJ,CAAC;IACL;IAEA,MAAMS,WAAW,GAAGN,0BAA0B,CAAC,CAAC;IAChD,MAAMO,KAAK,GAAG,CAACD,WAAW,GAAG,MAAM,GAAGD,MAAM,EAAE,cAAc,EAAED,KAAK,CAACI,OAAO,CAAC,CACvEC,IAAI,CAAC,GAAG,CAAC,CACTC,WAAW,CAAC,CAAC;IAElB,MAAMC,MAAM,GAAGb,2BAA2B,CAAC,CAAC;IAE5C,IAAI,CAACa,MAAM,EAAE;MACT,OAAO;QACHJ;MACJ,CAAC;IACL;IACA,OAAO;MACHA,KAAK,EAAEI,MAAM,GAAGJ;IACpB,CAAC;EACL,CAAC;EACDK,aAAa,EAAEA,CAAC;IAAEC;EAAQ,CAAC,KAAK;IAC5B,MAAMC,MAAM,GAAGf,uBAAuB,CAAmC;MACrEgB,SAAS,EAAEF,OAAO,CAACG,OAAO;MAC1BC,IAAI,EAAEhB,gCAAgC,CAACgB;IAC3C,CAAC,CAAC;IAEF,OAAOH,MAAM,GAAGA,MAAM,CAACI,IAAI,GAAG,CAAC,CAAC;EACpC;AACJ,CAAC","ignoreList":[]}
|
package/definitions/entry.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { type ITable } from "@webiny/db-dynamodb";
|
|
2
|
+
import type { IEntryEntity } from "../definitions/types.js";
|
|
3
3
|
export interface CreateEntryEntityParams {
|
|
4
|
-
table:
|
|
4
|
+
table: ITable;
|
|
5
5
|
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
6
|
}
|
|
8
|
-
export declare const createEntryEntity: (params: CreateEntryEntityParams) =>
|
|
7
|
+
export declare const createEntryEntity: (params: CreateEntryEntityParams) => IEntryEntity;
|
package/definitions/entry.js
CHANGED
|
@@ -1,182 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createEntryEntity = void 0;
|
|
7
|
-
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
-
const createEntryEntity = params => {
|
|
1
|
+
import { createStandardEntity } from "@webiny/db-dynamodb";
|
|
2
|
+
export const createEntryEntity = params => {
|
|
9
3
|
const {
|
|
10
4
|
table,
|
|
11
|
-
entityName
|
|
12
|
-
attributes
|
|
5
|
+
entityName
|
|
13
6
|
} = params;
|
|
14
|
-
return
|
|
7
|
+
return createStandardEntity({
|
|
15
8
|
name: entityName,
|
|
16
|
-
table
|
|
17
|
-
attributes: {
|
|
18
|
-
PK: {
|
|
19
|
-
type: "string",
|
|
20
|
-
partitionKey: true
|
|
21
|
-
},
|
|
22
|
-
SK: {
|
|
23
|
-
type: "string",
|
|
24
|
-
sortKey: true
|
|
25
|
-
},
|
|
26
|
-
TYPE: {
|
|
27
|
-
type: "string"
|
|
28
|
-
},
|
|
29
|
-
__type: {
|
|
30
|
-
type: "string"
|
|
31
|
-
},
|
|
32
|
-
webinyVersion: {
|
|
33
|
-
type: "string"
|
|
34
|
-
},
|
|
35
|
-
tenant: {
|
|
36
|
-
type: "string"
|
|
37
|
-
},
|
|
38
|
-
entryId: {
|
|
39
|
-
type: "string"
|
|
40
|
-
},
|
|
41
|
-
id: {
|
|
42
|
-
type: "string"
|
|
43
|
-
},
|
|
44
|
-
/**
|
|
45
|
-
* Revision-level meta fields. 👇
|
|
46
|
-
*/
|
|
47
|
-
revisionCreatedOn: {
|
|
48
|
-
type: "string"
|
|
49
|
-
},
|
|
50
|
-
revisionSavedOn: {
|
|
51
|
-
type: "string"
|
|
52
|
-
},
|
|
53
|
-
revisionModifiedOn: {
|
|
54
|
-
type: "string"
|
|
55
|
-
},
|
|
56
|
-
revisionDeletedOn: {
|
|
57
|
-
type: "string"
|
|
58
|
-
},
|
|
59
|
-
revisionRestoredOn: {
|
|
60
|
-
type: "string"
|
|
61
|
-
},
|
|
62
|
-
revisionFirstPublishedOn: {
|
|
63
|
-
type: "string"
|
|
64
|
-
},
|
|
65
|
-
revisionLastPublishedOn: {
|
|
66
|
-
type: "string"
|
|
67
|
-
},
|
|
68
|
-
revisionCreatedBy: {
|
|
69
|
-
type: "map"
|
|
70
|
-
},
|
|
71
|
-
revisionSavedBy: {
|
|
72
|
-
type: "map"
|
|
73
|
-
},
|
|
74
|
-
revisionModifiedBy: {
|
|
75
|
-
type: "map"
|
|
76
|
-
},
|
|
77
|
-
revisionDeletedBy: {
|
|
78
|
-
type: "map"
|
|
79
|
-
},
|
|
80
|
-
revisionRestoredBy: {
|
|
81
|
-
type: "map"
|
|
82
|
-
},
|
|
83
|
-
revisionFirstPublishedBy: {
|
|
84
|
-
type: "map"
|
|
85
|
-
},
|
|
86
|
-
revisionLastPublishedBy: {
|
|
87
|
-
type: "map"
|
|
88
|
-
},
|
|
89
|
-
/**
|
|
90
|
-
* Entry-level meta fields. 👇
|
|
91
|
-
*/
|
|
92
|
-
createdOn: {
|
|
93
|
-
type: "string"
|
|
94
|
-
},
|
|
95
|
-
savedOn: {
|
|
96
|
-
type: "string"
|
|
97
|
-
},
|
|
98
|
-
modifiedOn: {
|
|
99
|
-
type: "string"
|
|
100
|
-
},
|
|
101
|
-
deletedOn: {
|
|
102
|
-
type: "string"
|
|
103
|
-
},
|
|
104
|
-
restoredOn: {
|
|
105
|
-
type: "string"
|
|
106
|
-
},
|
|
107
|
-
firstPublishedOn: {
|
|
108
|
-
type: "string"
|
|
109
|
-
},
|
|
110
|
-
lastPublishedOn: {
|
|
111
|
-
type: "string"
|
|
112
|
-
},
|
|
113
|
-
createdBy: {
|
|
114
|
-
type: "map"
|
|
115
|
-
},
|
|
116
|
-
savedBy: {
|
|
117
|
-
type: "map"
|
|
118
|
-
},
|
|
119
|
-
modifiedBy: {
|
|
120
|
-
type: "map"
|
|
121
|
-
},
|
|
122
|
-
deletedBy: {
|
|
123
|
-
type: "map"
|
|
124
|
-
},
|
|
125
|
-
restoredBy: {
|
|
126
|
-
type: "map"
|
|
127
|
-
},
|
|
128
|
-
firstPublishedBy: {
|
|
129
|
-
type: "map"
|
|
130
|
-
},
|
|
131
|
-
lastPublishedBy: {
|
|
132
|
-
type: "map"
|
|
133
|
-
},
|
|
134
|
-
/**
|
|
135
|
-
* Deprecated fields. 👇
|
|
136
|
-
*/
|
|
137
|
-
ownedBy: {
|
|
138
|
-
type: "map"
|
|
139
|
-
},
|
|
140
|
-
publishedOn: {
|
|
141
|
-
type: "string"
|
|
142
|
-
},
|
|
143
|
-
/**
|
|
144
|
-
* The rest. 👇
|
|
145
|
-
*/
|
|
146
|
-
modelId: {
|
|
147
|
-
type: "string"
|
|
148
|
-
},
|
|
149
|
-
locale: {
|
|
150
|
-
type: "string"
|
|
151
|
-
},
|
|
152
|
-
version: {
|
|
153
|
-
type: "number"
|
|
154
|
-
},
|
|
155
|
-
locked: {
|
|
156
|
-
type: "boolean"
|
|
157
|
-
},
|
|
158
|
-
status: {
|
|
159
|
-
type: "string"
|
|
160
|
-
},
|
|
161
|
-
location: {
|
|
162
|
-
type: "map"
|
|
163
|
-
},
|
|
164
|
-
wbyDeleted: {
|
|
165
|
-
type: "boolean"
|
|
166
|
-
},
|
|
167
|
-
binOriginalFolderId: {
|
|
168
|
-
type: "string"
|
|
169
|
-
},
|
|
170
|
-
values: {
|
|
171
|
-
type: "map"
|
|
172
|
-
},
|
|
173
|
-
meta: {
|
|
174
|
-
type: "map"
|
|
175
|
-
},
|
|
176
|
-
...(attributes || {})
|
|
177
|
-
}
|
|
9
|
+
table: table.table
|
|
178
10
|
});
|
|
179
11
|
};
|
|
180
|
-
exports.createEntryEntity = createEntryEntity;
|
|
181
12
|
|
|
182
13
|
//# sourceMappingURL=entry.js.map
|
package/definitions/entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createStandardEntity","createEntryEntity","params","table","entityName","name"],"sources":["entry.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IEntryEntity, IEntryEntityAttributesData } from \"~/definitions/types.js\";\n\nexport interface CreateEntryEntityParams {\n table: ITable;\n entityName: string;\n}\nexport const createEntryEntity = (params: CreateEntryEntityParams): IEntryEntity => {\n const { table, entityName } = params;\n return createStandardEntity<IEntryEntityAttributesData>({\n name: entityName,\n table: table.table\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AAOvE,OAAO,MAAMC,iBAAiB,GAAIC,MAA+B,IAAmB;EAChF,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAA6B;IACpDK,IAAI,EAAED,UAAU;IAChBD,KAAK,EAAEA,KAAK,CAACA;EACjB,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
package/definitions/group.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
table:
|
|
1
|
+
import { type ITable } from "@webiny/db-dynamodb";
|
|
2
|
+
import type { IGroupEntity } from "../definitions/types.js";
|
|
3
|
+
interface Params {
|
|
4
|
+
table: ITable;
|
|
5
5
|
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
6
|
}
|
|
8
|
-
export declare const createGroupEntity: (params:
|
|
7
|
+
export declare const createGroupEntity: (params: Params) => IGroupEntity;
|
|
8
|
+
export {};
|
package/definitions/group.js
CHANGED
|
@@ -1,66 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createGroupEntity = void 0;
|
|
7
|
-
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
-
const createGroupEntity = params => {
|
|
1
|
+
import { createStandardEntity } from "@webiny/db-dynamodb";
|
|
2
|
+
export const createGroupEntity = params => {
|
|
9
3
|
const {
|
|
10
4
|
table,
|
|
11
|
-
attributes,
|
|
12
5
|
entityName
|
|
13
6
|
} = params;
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
attributes: {
|
|
18
|
-
PK: {
|
|
19
|
-
partitionKey: true
|
|
20
|
-
},
|
|
21
|
-
SK: {
|
|
22
|
-
sortKey: true
|
|
23
|
-
},
|
|
24
|
-
TYPE: {
|
|
25
|
-
type: "string"
|
|
26
|
-
},
|
|
27
|
-
webinyVersion: {
|
|
28
|
-
type: "string"
|
|
29
|
-
},
|
|
30
|
-
id: {
|
|
31
|
-
type: "string"
|
|
32
|
-
},
|
|
33
|
-
name: {
|
|
34
|
-
type: "string"
|
|
35
|
-
},
|
|
36
|
-
slug: {
|
|
37
|
-
type: "string"
|
|
38
|
-
},
|
|
39
|
-
locale: {
|
|
40
|
-
type: "string"
|
|
41
|
-
},
|
|
42
|
-
description: {
|
|
43
|
-
type: "string"
|
|
44
|
-
},
|
|
45
|
-
icon: {
|
|
46
|
-
type: "string"
|
|
47
|
-
},
|
|
48
|
-
createdBy: {
|
|
49
|
-
type: "map"
|
|
50
|
-
},
|
|
51
|
-
createdOn: {
|
|
52
|
-
type: "string"
|
|
53
|
-
},
|
|
54
|
-
savedOn: {
|
|
55
|
-
type: "string"
|
|
56
|
-
},
|
|
57
|
-
tenant: {
|
|
58
|
-
type: "string"
|
|
59
|
-
},
|
|
60
|
-
...(attributes || {})
|
|
61
|
-
}
|
|
7
|
+
return createStandardEntity({
|
|
8
|
+
table: table.table,
|
|
9
|
+
name: entityName
|
|
62
10
|
});
|
|
63
11
|
};
|
|
64
|
-
exports.createGroupEntity = createGroupEntity;
|
|
65
12
|
|
|
66
13
|
//# sourceMappingURL=group.js.map
|
package/definitions/group.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createStandardEntity","createGroupEntity","params","table","entityName","name"],"sources":["group.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IGroupEntity } from \"~/definitions/types.js\";\nimport type { CmsGroup } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\nexport const createGroupEntity = (params: Params): IGroupEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsGroup>({\n table: table.table,\n name: entityName\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AAQvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAW;IAClCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
package/definitions/model.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
table:
|
|
1
|
+
import { type ITable } from "@webiny/db-dynamodb";
|
|
2
|
+
import type { IModelEntity } from "../definitions/types.js";
|
|
3
|
+
interface Params {
|
|
4
|
+
table: ITable;
|
|
5
5
|
entityName: string;
|
|
6
|
-
attributes: Attributes;
|
|
7
6
|
}
|
|
8
|
-
export declare const createModelEntity: (params:
|
|
7
|
+
export declare const createModelEntity: (params: Params) => IModelEntity;
|
|
8
|
+
export {};
|
package/definitions/model.js
CHANGED
|
@@ -1,110 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.createModelEntity = void 0;
|
|
7
|
-
var _toolbox = require("@webiny/db-dynamodb/toolbox");
|
|
8
|
-
const createModelEntity = params => {
|
|
1
|
+
import { createStandardEntity } from "@webiny/db-dynamodb";
|
|
2
|
+
export const createModelEntity = params => {
|
|
9
3
|
const {
|
|
10
4
|
table,
|
|
11
|
-
attributes,
|
|
12
5
|
entityName
|
|
13
6
|
} = params;
|
|
14
|
-
return
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
attributes: {
|
|
18
|
-
PK: {
|
|
19
|
-
partitionKey: true
|
|
20
|
-
},
|
|
21
|
-
SK: {
|
|
22
|
-
sortKey: true
|
|
23
|
-
},
|
|
24
|
-
TYPE: {
|
|
25
|
-
type: "string",
|
|
26
|
-
required: true
|
|
27
|
-
},
|
|
28
|
-
webinyVersion: {
|
|
29
|
-
type: "string",
|
|
30
|
-
required: true
|
|
31
|
-
},
|
|
32
|
-
name: {
|
|
33
|
-
type: "string",
|
|
34
|
-
required: true
|
|
35
|
-
},
|
|
36
|
-
modelId: {
|
|
37
|
-
type: "string",
|
|
38
|
-
required: true
|
|
39
|
-
},
|
|
40
|
-
singularApiName: {
|
|
41
|
-
type: "string",
|
|
42
|
-
required: true
|
|
43
|
-
},
|
|
44
|
-
pluralApiName: {
|
|
45
|
-
type: "string",
|
|
46
|
-
required: true
|
|
47
|
-
},
|
|
48
|
-
locale: {
|
|
49
|
-
type: "string",
|
|
50
|
-
required: true
|
|
51
|
-
},
|
|
52
|
-
group: {
|
|
53
|
-
type: "map",
|
|
54
|
-
required: true
|
|
55
|
-
},
|
|
56
|
-
icon: {
|
|
57
|
-
type: "string"
|
|
58
|
-
},
|
|
59
|
-
description: {
|
|
60
|
-
type: "string"
|
|
61
|
-
},
|
|
62
|
-
createdOn: {
|
|
63
|
-
type: "string",
|
|
64
|
-
required: true
|
|
65
|
-
},
|
|
66
|
-
savedOn: {
|
|
67
|
-
type: "string",
|
|
68
|
-
required: true
|
|
69
|
-
},
|
|
70
|
-
createdBy: {
|
|
71
|
-
type: "map",
|
|
72
|
-
required: true
|
|
73
|
-
},
|
|
74
|
-
fields: {
|
|
75
|
-
type: "list",
|
|
76
|
-
required: true
|
|
77
|
-
},
|
|
78
|
-
layout: {
|
|
79
|
-
type: "list",
|
|
80
|
-
required: true
|
|
81
|
-
},
|
|
82
|
-
tags: {
|
|
83
|
-
type: "list",
|
|
84
|
-
required: false,
|
|
85
|
-
default: []
|
|
86
|
-
},
|
|
87
|
-
lockedFields: {
|
|
88
|
-
type: "list",
|
|
89
|
-
required: true
|
|
90
|
-
},
|
|
91
|
-
titleFieldId: {
|
|
92
|
-
type: "string"
|
|
93
|
-
},
|
|
94
|
-
descriptionFieldId: {
|
|
95
|
-
type: "string"
|
|
96
|
-
},
|
|
97
|
-
imageFieldId: {
|
|
98
|
-
type: "string"
|
|
99
|
-
},
|
|
100
|
-
tenant: {
|
|
101
|
-
type: "string",
|
|
102
|
-
required: true
|
|
103
|
-
},
|
|
104
|
-
...(attributes || {})
|
|
105
|
-
}
|
|
7
|
+
return createStandardEntity({
|
|
8
|
+
table: table.table,
|
|
9
|
+
name: entityName
|
|
106
10
|
});
|
|
107
11
|
};
|
|
108
|
-
exports.createModelEntity = createModelEntity;
|
|
109
12
|
|
|
110
13
|
//# sourceMappingURL=model.js.map
|
package/definitions/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["createStandardEntity","createModelEntity","params","table","entityName","name"],"sources":["model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"~/definitions/types.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AASvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAW;IAClCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|