@webiny/api-headless-cms-ddb 5.34.8 → 5.35.0-beta.1
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/definitions/entry.js +3 -5
- package/definitions/entry.js.map +1 -1
- package/definitions/group.js +0 -5
- package/definitions/group.js.map +1 -1
- package/definitions/model.js +17 -5
- package/definitions/model.js.map +1 -1
- package/definitions/settings.js +0 -5
- package/definitions/settings.js.map +1 -1
- package/definitions/system.js +0 -5
- package/definitions/system.js.map +1 -1
- package/definitions/table.js +0 -3
- package/definitions/table.js.map +1 -1
- package/dynamoDb/index.js +0 -7
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/path/plainObject.js +1 -8
- package/dynamoDb/path/plainObject.js.map +1 -1
- package/dynamoDb/storage/date.js +1 -19
- package/dynamoDb/storage/date.js.map +1 -1
- package/dynamoDb/storage/longText.js +1 -18
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.js +0 -18
- package/dynamoDb/storage/richText.js.map +1 -1
- package/dynamoDb/transformValue/datetime.js +1 -8
- package/dynamoDb/transformValue/datetime.js.map +1 -1
- package/index.js +6 -30
- package/index.js.map +1 -1
- package/operations/entry/dataLoaders.js +1 -44
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/filtering/createExpressions.js +2 -39
- package/operations/entry/filtering/createExpressions.js.map +1 -1
- package/operations/entry/filtering/createFields.js +0 -18
- package/operations/entry/filtering/createFields.js.map +1 -1
- package/operations/entry/filtering/extractSort.js +0 -10
- package/operations/entry/filtering/extractSort.js.map +1 -1
- package/operations/entry/filtering/filter.js +1 -36
- package/operations/entry/filtering/filter.js.map +1 -1
- package/operations/entry/filtering/fullTextSearch.js +0 -12
- package/operations/entry/filtering/fullTextSearch.js.map +1 -1
- package/operations/entry/filtering/getValue.js +0 -18
- package/operations/entry/filtering/getValue.js.map +1 -1
- package/operations/entry/filtering/index.js +0 -2
- package/operations/entry/filtering/index.js.map +1 -1
- package/operations/entry/filtering/mapPlugins.js +0 -8
- package/operations/entry/filtering/mapPlugins.js.map +1 -1
- package/operations/entry/filtering/plugins/defaultFilterCreate.js +0 -7
- package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/index.js +0 -5
- package/operations/entry/filtering/plugins/index.js.map +1 -1
- package/operations/entry/filtering/plugins/objectFilterCreate.js +0 -21
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/refFilterCreate.js +0 -18
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -1
- package/operations/entry/filtering/sort.js +0 -15
- package/operations/entry/filtering/sort.js.map +1 -1
- package/operations/entry/filtering/systemFields.js +0 -2
- package/operations/entry/filtering/systemFields.js.map +1 -1
- package/operations/entry/filtering/transform.js +0 -3
- package/operations/entry/filtering/transform.js.map +1 -1
- package/operations/entry/filtering/values.js +0 -6
- package/operations/entry/filtering/values.js.map +1 -1
- package/operations/entry/filtering/where.js +0 -6
- package/operations/entry/filtering/where.js.map +1 -1
- package/operations/entry/index.js +58 -116
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.js +0 -18
- package/operations/entry/keys.js.map +1 -1
- package/operations/entry/systemFields.js +0 -2
- package/operations/entry/systemFields.js.map +1 -1
- package/operations/group/index.js +2 -32
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.js +0 -25
- package/operations/model/index.js.map +1 -1
- package/operations/settings/index.js +0 -24
- package/operations/settings/index.js.map +1 -1
- package/operations/system/index.js +0 -17
- package/operations/system/index.js.map +1 -1
- package/package.json +13 -13
- package/plugins/CmsEntryFieldFilterPathPlugin.js +0 -14
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldFilterPlugin.js +0 -7
- package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldSortingPlugin.js +0 -10
- package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -1
- package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +11 -0
- package/plugins/CmsFieldFilterValueTransformPlugin.js +24 -0
- package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +11 -6
- package/plugins/index.js.map +1 -1
- package/types.js +0 -1
- package/types.js.map +1 -1
|
@@ -1,38 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createCmsEntryFieldSortingPlugin = exports.CmsEntryFieldSortingPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _plugins = require("@webiny/plugins");
|
|
13
|
-
|
|
14
10
|
class CmsEntryFieldSortingPlugin extends _plugins.Plugin {
|
|
15
11
|
constructor(config) {
|
|
16
12
|
super();
|
|
17
13
|
(0, _defineProperty2.default)(this, "config", void 0);
|
|
18
14
|
this.config = config;
|
|
19
15
|
}
|
|
20
|
-
|
|
21
16
|
canUse(params) {
|
|
22
17
|
return this.config.canUse(params);
|
|
23
18
|
}
|
|
24
|
-
|
|
25
19
|
createSort(params) {
|
|
26
20
|
return this.config.createSort(params);
|
|
27
21
|
}
|
|
28
|
-
|
|
29
22
|
}
|
|
30
|
-
|
|
31
23
|
exports.CmsEntryFieldSortingPlugin = CmsEntryFieldSortingPlugin;
|
|
32
24
|
(0, _defineProperty2.default)(CmsEntryFieldSortingPlugin, "type", "cms.entry.field.sorting");
|
|
33
|
-
|
|
34
25
|
const createCmsEntryFieldSortingPlugin = config => {
|
|
35
26
|
return new CmsEntryFieldSortingPlugin(config);
|
|
36
27
|
};
|
|
37
|
-
|
|
38
28
|
exports.createCmsEntryFieldSortingPlugin = createCmsEntryFieldSortingPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryFieldSortingPlugin","Plugin","constructor","config","canUse","params","createSort","createCmsEntryFieldSortingPlugin"],"sources":["CmsEntryFieldSortingPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { Field } from \"~/operations/entry/filtering/types\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface CmsEntryFieldSortingPluginCanUseParams {\n model: CmsModel;\n field?: Field;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n /**\n * Combination of fieldId and sortBy\n *\n * example: id_ASC or createdBy_DESC\n */\n sortBy: string;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortParams {\n model: CmsModel;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n sortBy: string;\n fields: Record<string, Field>;\n field?: Field;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortResult {\n valuePath: string;\n reverse: boolean;\n fieldId: string;\n field: Field;\n}\n\ninterface CmsEntryFieldSortingPluginConfig {\n createSort: (\n params: CmsEntryFieldSortingPluginCreateSortParams\n ) => CmsEntryFieldSortingPluginCreateSortResult;\n canUse: (params: CmsEntryFieldSortingPluginCanUseParams) => boolean;\n}\n\nexport class CmsEntryFieldSortingPlugin extends Plugin {\n public static override readonly type: string = \"cms.entry.field.sorting\";\n private readonly config: CmsEntryFieldSortingPluginConfig;\n\n public constructor(config: CmsEntryFieldSortingPluginConfig) {\n super();\n this.config = config;\n }\n\n public canUse(params: CmsEntryFieldSortingPluginCanUseParams): boolean {\n return this.config.canUse(params);\n }\n\n public createSort(\n params: CmsEntryFieldSortingPluginCreateSortParams\n ): CmsEntryFieldSortingPluginCreateSortResult {\n return this.config.createSort(params);\n }\n}\n\nexport const createCmsEntryFieldSortingPlugin = (config: CmsEntryFieldSortingPluginConfig) => {\n return new CmsEntryFieldSortingPlugin(config);\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["CmsEntryFieldSortingPlugin","Plugin","constructor","config","canUse","params","createSort","createCmsEntryFieldSortingPlugin"],"sources":["CmsEntryFieldSortingPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { Field } from \"~/operations/entry/filtering/types\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface CmsEntryFieldSortingPluginCanUseParams {\n model: CmsModel;\n field?: Field;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n /**\n * Combination of fieldId and sortBy\n *\n * example: id_ASC or createdBy_DESC\n */\n sortBy: string;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortParams {\n model: CmsModel;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n sortBy: string;\n fields: Record<string, Field>;\n field?: Field;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortResult {\n valuePath: string;\n reverse: boolean;\n fieldId: string;\n field: Field;\n}\n\ninterface CmsEntryFieldSortingPluginConfig {\n createSort: (\n params: CmsEntryFieldSortingPluginCreateSortParams\n ) => CmsEntryFieldSortingPluginCreateSortResult;\n canUse: (params: CmsEntryFieldSortingPluginCanUseParams) => boolean;\n}\n\nexport class CmsEntryFieldSortingPlugin extends Plugin {\n public static override readonly type: string = \"cms.entry.field.sorting\";\n private readonly config: CmsEntryFieldSortingPluginConfig;\n\n public constructor(config: CmsEntryFieldSortingPluginConfig) {\n super();\n this.config = config;\n }\n\n public canUse(params: CmsEntryFieldSortingPluginCanUseParams): boolean {\n return this.config.canUse(params);\n }\n\n public createSort(\n params: CmsEntryFieldSortingPluginCreateSortParams\n ): CmsEntryFieldSortingPluginCreateSortResult {\n return this.config.createSort(params);\n }\n}\n\nexport const createCmsEntryFieldSortingPlugin = (config: CmsEntryFieldSortingPluginConfig) => {\n return new CmsEntryFieldSortingPlugin(config);\n};\n"],"mappings":";;;;;;;;AAAA;AAwCO,MAAMA,0BAA0B,SAASC,eAAM,CAAC;EAI5CC,WAAW,CAACC,MAAwC,EAAE;IACzD,KAAK,EAAE;IAAC;IACR,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOC,MAAM,CAACC,MAA8C,EAAW;IACnE,OAAO,IAAI,CAACF,MAAM,CAACC,MAAM,CAACC,MAAM,CAAC;EACrC;EAEOC,UAAU,CACbD,MAAkD,EACR;IAC1C,OAAO,IAAI,CAACF,MAAM,CAACG,UAAU,CAACD,MAAM,CAAC;EACzC;AACJ;AAAC;AAAA,8BAlBYL,0BAA0B,UACY,yBAAyB;AAmBrE,MAAMO,gCAAgC,GAAIJ,MAAwC,IAAK;EAC1F,OAAO,IAAIH,0BAA0B,CAACG,MAAM,CAAC;AACjD,CAAC;AAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
import { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from "../types";
|
|
3
|
+
declare type CmsFieldFilterValueTransformPluginParams = Omit<CmsFieldFilterValueTransformPluginInterface, "type">;
|
|
4
|
+
export declare class CmsFieldFilterValueTransformPlugin extends Plugin implements Omit<CmsFieldFilterValueTransformPluginInterface, "type"> {
|
|
5
|
+
static type: string;
|
|
6
|
+
private config;
|
|
7
|
+
get fieldType(): string;
|
|
8
|
+
get transform(): CmsFieldFilterValueTransformPluginParams["transform"];
|
|
9
|
+
constructor(config: CmsFieldFilterValueTransformPluginParams);
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.CmsFieldFilterValueTransformPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _plugins = require("@webiny/plugins");
|
|
10
|
+
class CmsFieldFilterValueTransformPlugin extends _plugins.Plugin {
|
|
11
|
+
get fieldType() {
|
|
12
|
+
return this.config.fieldType;
|
|
13
|
+
}
|
|
14
|
+
get transform() {
|
|
15
|
+
return this.config.transform;
|
|
16
|
+
}
|
|
17
|
+
constructor(config) {
|
|
18
|
+
super();
|
|
19
|
+
(0, _defineProperty2.default)(this, "config", void 0);
|
|
20
|
+
this.config = config;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.CmsFieldFilterValueTransformPlugin = CmsFieldFilterValueTransformPlugin;
|
|
24
|
+
(0, _defineProperty2.default)(CmsFieldFilterValueTransformPlugin, "type", "cms-field-filter-value-transform");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsFieldFilterValueTransformPlugin","Plugin","fieldType","config","transform","constructor"],"sources":["CmsFieldFilterValueTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from \"~/types\";\n\ntype CmsFieldFilterValueTransformPluginParams = Omit<\n CmsFieldFilterValueTransformPluginInterface,\n \"type\"\n>;\nexport class CmsFieldFilterValueTransformPlugin\n extends Plugin\n implements Omit<CmsFieldFilterValueTransformPluginInterface, \"type\">\n{\n public static override type = \"cms-field-filter-value-transform\";\n\n private config: CmsFieldFilterValueTransformPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public get transform(): CmsFieldFilterValueTransformPluginParams[\"transform\"] {\n return this.config.transform;\n }\n\n public constructor(config: CmsFieldFilterValueTransformPluginParams) {\n super();\n this.config = config;\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAOO,MAAMA,kCAAkC,SACnCC,eAAM,CAElB;EAKI,IAAWC,SAAS,GAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEA,IAAWE,SAAS,GAA0D;IAC1E,OAAO,IAAI,CAACD,MAAM,CAACC,SAAS;EAChC;EAEOC,WAAW,CAACF,MAAgD,EAAE;IACjE,KAAK,EAAE;IAAC;IACR,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;AACJ;AAAC;AAAA,8BApBYH,kCAAkC,UAIb,kCAAkC"}
|
package/plugins/index.d.ts
CHANGED
package/plugins/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _CmsEntryFieldFilterPathPlugin = require("./CmsEntryFieldFilterPathPlugin");
|
|
8
|
-
|
|
9
7
|
Object.keys(_CmsEntryFieldFilterPathPlugin).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _CmsEntryFieldFilterPathPlugin[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_CmsEntryFieldFilterPathPlugin).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _CmsEntryFieldSortingPlugin = require("./CmsEntryFieldSortingPlugin");
|
|
21
|
-
|
|
22
18
|
Object.keys(_CmsEntryFieldSortingPlugin).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _CmsEntryFieldSortingPlugin[key]) return;
|
|
@@ -29,9 +25,7 @@ Object.keys(_CmsEntryFieldSortingPlugin).forEach(function (key) {
|
|
|
29
25
|
}
|
|
30
26
|
});
|
|
31
27
|
});
|
|
32
|
-
|
|
33
28
|
var _CmsEntryFieldFilterPlugin = require("./CmsEntryFieldFilterPlugin");
|
|
34
|
-
|
|
35
29
|
Object.keys(_CmsEntryFieldFilterPlugin).forEach(function (key) {
|
|
36
30
|
if (key === "default" || key === "__esModule") return;
|
|
37
31
|
if (key in exports && exports[key] === _CmsEntryFieldFilterPlugin[key]) return;
|
|
@@ -41,4 +35,15 @@ Object.keys(_CmsEntryFieldFilterPlugin).forEach(function (key) {
|
|
|
41
35
|
return _CmsEntryFieldFilterPlugin[key];
|
|
42
36
|
}
|
|
43
37
|
});
|
|
38
|
+
});
|
|
39
|
+
var _CmsFieldFilterValueTransformPlugin = require("./CmsFieldFilterValueTransformPlugin");
|
|
40
|
+
Object.keys(_CmsFieldFilterValueTransformPlugin).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _CmsFieldFilterValueTransformPlugin[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _CmsFieldFilterValueTransformPlugin[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
44
49
|
});
|
package/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryFieldFilterPathPlugin\";\nexport * from \"./CmsEntryFieldSortingPlugin\";\nexport * from \"./CmsEntryFieldFilterPlugin\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryFieldFilterPathPlugin\";\nexport * from \"./CmsEntryFieldSortingPlugin\";\nexport * from \"./CmsEntryFieldFilterPlugin\";\nexport * from \"./CmsFieldFilterValueTransformPlugin\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
package/types.js
CHANGED
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport {\n CmsModelField,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport { DynamoDBTypes, TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\n\ninterface CmsFieldFilterValueTransformParams {\n /**\n * A field which value we are transforming.\n */\n field: Partial<CmsModelField> &\n Pick<CmsModelField, \"id\" | \"storageId\" | \"fieldId\" | \"settings\">;\n value: any;\n}\n\nexport interface CmsFieldFilterValueTransformPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-field-filter-value-transform\";\n /**\n * A field type this plugin is for.\n */\n fieldType: string;\n /**\n * Transform method which expect field definition and value to transform.\n */\n transform: (params: CmsFieldFilterValueTransformParams) => any;\n}\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n SETTINGS = \"CmsSettings\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor): TableConstructor;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DocumentClient;\n table?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: Plugin[] | Plugin[][];\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => Table;\n getEntities: () => Record<\"system\" | \"settings\" | \"groups\" | \"models\" | \"entries\", Entity<any>>;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n"],"mappings":";;;;;;IAyCYA,
|
|
1
|
+
{"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport {\n CmsModelField,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport { DynamoDBTypes, TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\n\ninterface CmsFieldFilterValueTransformParams {\n /**\n * A field which value we are transforming.\n */\n field: Partial<CmsModelField> &\n Pick<CmsModelField, \"id\" | \"storageId\" | \"fieldId\" | \"settings\">;\n value: any;\n}\n\nexport interface CmsFieldFilterValueTransformPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-field-filter-value-transform\";\n /**\n * A field type this plugin is for.\n */\n fieldType: string;\n /**\n * Transform method which expect field definition and value to transform.\n */\n transform: (params: CmsFieldFilterValueTransformParams) => any;\n}\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n SETTINGS = \"CmsSettings\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor): TableConstructor;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DocumentClient;\n table?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: Plugin[] | Plugin[][];\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => Table;\n getEntities: () => Record<\"system\" | \"settings\" | \"groups\" | \"models\" | \"entries\", Entity<any>>;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n"],"mappings":";;;;;;IAyCYA,QAAQ;AAAA;AAAA,WAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;AAAA,GAARA,QAAQ,wBAARA,QAAQ"}
|