@webiny/api-headless-cms-ddb 0.0.0-unstable.97a151f74d → 0.0.0-unstable.98511f29f1
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 +6 -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 +2 -8
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/path/locationFolderId.d.ts +2 -0
- package/dynamoDb/path/locationFolderId.js +41 -0
- package/dynamoDb/path/locationFolderId.js.map +1 -0
- package/dynamoDb/path/plainObject.js +1 -8
- package/dynamoDb/path/plainObject.js.map +1 -1
- package/dynamoDb/storage/date.js +3 -30
- package/dynamoDb/storage/date.js.map +1 -1
- package/dynamoDb/storage/longText.js +7 -17
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.js +1 -20
- 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 +12 -28
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +17 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +43 -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 +9 -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 +23 -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 +43 -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 +57 -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 +57 -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 +63 -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 +38 -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 +5 -0
- package/operations/entry/dataLoader/types.js.map +1 -0
- package/operations/entry/dataLoaders.d.ts +11 -26
- package/operations/entry/dataLoaders.js +43 -249
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/filtering/{createFilters.d.ts → createExpressions.d.ts} +9 -3
- package/operations/entry/filtering/createExpressions.js +176 -0
- package/operations/entry/filtering/createExpressions.js.map +1 -0
- package/operations/entry/filtering/createFields.d.ts +5 -7
- package/operations/entry/filtering/createFields.js +73 -92
- package/operations/entry/filtering/createFields.js.map +1 -1
- package/operations/entry/filtering/extractSort.d.ts +4 -0
- package/operations/entry/filtering/extractSort.js +23 -11
- package/operations/entry/filtering/extractSort.js.map +1 -1
- package/operations/entry/filtering/filter.d.ts +2 -3
- package/operations/entry/filtering/filter.js +79 -73
- package/operations/entry/filtering/filter.js.map +1 -1
- package/operations/entry/filtering/fullTextSearch.d.ts +2 -6
- package/operations/entry/filtering/fullTextSearch.js +2 -18
- 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 +3 -8
- package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/index.d.ts +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 +3 -22
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/refFilterCreate.js +3 -19
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -1
- package/operations/entry/filtering/sort.d.ts +4 -1
- package/operations/entry/filtering/sort.js +6 -17
- package/operations/entry/filtering/sort.js.map +1 -1
- package/operations/entry/filtering/systemFields.js +18 -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.d.ts +2 -0
- package/operations/entry/filtering/values.js +22 -0
- package/operations/entry/filtering/values.js.map +1 -0
- package/operations/entry/filtering/where.js +3 -8
- package/operations/entry/filtering/where.js.map +1 -1
- package/operations/entry/index.d.ts +1 -1
- package/operations/entry/index.js +240 -130
- 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/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 +21 -21
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +2 -1
- package/plugins/CmsEntryFieldFilterPathPlugin.js +3 -15
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldFilterPlugin.js +4 -6
- package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldSortingPlugin.d.ts +42 -0
- package/plugins/CmsEntryFieldSortingPlugin.js +28 -0
- package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -0
- 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 +3 -0
- package/plugins/index.js +33 -2
- package/plugins/index.js.map +1 -1
- package/types.d.ts +10 -1
- package/types.js +4 -5
- package/types.js.map +1 -1
- package/operations/entry/filtering/createFilters.js +0 -155
- package/operations/entry/filtering/createFilters.js.map +0 -1
- package/operations/entry/systemFields.d.ts +0 -2
- package/operations/entry/systemFields.js +0 -74
- package/operations/entry/systemFields.js.map +0 -1
- package/operations/entry/utils.d.ts +0 -36
- package/operations/entry/utils.js +0 -684
- package/operations/entry/utils.js.map +0 -1
|
@@ -1,15 +1,16 @@
|
|
|
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.CmsEntryFieldFilterPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _plugins = require("@webiny/plugins");
|
|
10
|
+
/**
|
|
11
|
+
* This plugin is used to create the filter.
|
|
12
|
+
* Internally we have default one + the one for the reference field - because it is actually an object when filtering.
|
|
13
|
+
*/
|
|
13
14
|
|
|
14
15
|
class CmsEntryFieldFilterPlugin extends _plugins.Plugin {
|
|
15
16
|
constructor(config) {
|
|
@@ -19,13 +20,10 @@ class CmsEntryFieldFilterPlugin extends _plugins.Plugin {
|
|
|
19
20
|
this.config = config;
|
|
20
21
|
this.fieldType = this.config.fieldType;
|
|
21
22
|
}
|
|
22
|
-
|
|
23
23
|
create(params) {
|
|
24
24
|
return this.config.create(params);
|
|
25
25
|
}
|
|
26
|
-
|
|
27
26
|
}
|
|
28
|
-
|
|
29
27
|
exports.CmsEntryFieldFilterPlugin = CmsEntryFieldFilterPlugin;
|
|
30
28
|
(0, _defineProperty2.default)(CmsEntryFieldFilterPlugin, "type", "cms.dynamodb.entry.field.filter");
|
|
31
29
|
(0, _defineProperty2.default)(CmsEntryFieldFilterPlugin, "ALL", "*");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryFieldFilterPlugin","Plugin","constructor","config","fieldType","create","params"],"sources":["CmsEntryFieldFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport { Field } from \"~/operations/entry/filtering/types\";\nimport { CmsFieldFilterValueTransformPlugin } from \"~/types\";\n\n/**\n * This plugin is used to create the filter.\n * Internally we have default one + the one for the reference field - because it is actually an object when filtering.\n */\n\ninterface CmsEntryFieldFilterPluginParams {\n fieldType: string;\n create: (\n params: CmsEntryFieldFilterPluginCreateParams\n ) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];\n}\n\ninterface CmsEntryFieldFilterPluginCreateParams {\n key: string;\n value: any;\n field: Field;\n fields: Record<string, Field>;\n operation: string;\n valueFilterPlugins: Record<string, ValueFilterPlugin>;\n transformValuePlugins: Record<string, CmsFieldFilterValueTransformPlugin>;\n getFilterCreatePlugin: (type: string) => CmsEntryFieldFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport interface CmsEntryFieldFilterPluginCreateResponse {\n field: Field;\n path: string;\n fieldPathId: string;\n plugin: ValueFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport class CmsEntryFieldFilterPlugin extends Plugin {\n public static override readonly type: string = \"cms.dynamodb.entry.field.filter\";\n public static readonly ALL: string = \"*\";\n\n private readonly config: CmsEntryFieldFilterPluginParams;\n\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFieldFilterPluginParams) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public create(params: CmsEntryFieldFilterPluginCreateParams) {\n return this.config.create(params);\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_plugins","require","CmsEntryFieldFilterPlugin","Plugin","constructor","config","_defineProperty2","default","fieldType","create","params","exports"],"sources":["CmsEntryFieldFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport { Field } from \"~/operations/entry/filtering/types\";\nimport { CmsFieldFilterValueTransformPlugin } from \"~/types\";\n\n/**\n * This plugin is used to create the filter.\n * Internally we have default one + the one for the reference field - because it is actually an object when filtering.\n */\n\ninterface CmsEntryFieldFilterPluginParams {\n fieldType: string;\n create: (\n params: CmsEntryFieldFilterPluginCreateParams\n ) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];\n}\n\ninterface CmsEntryFieldFilterPluginCreateParams {\n key: string;\n value: any;\n field: Field;\n fields: Record<string, Field>;\n operation: string;\n valueFilterPlugins: Record<string, ValueFilterPlugin>;\n transformValuePlugins: Record<string, CmsFieldFilterValueTransformPlugin>;\n getFilterCreatePlugin: (type: string) => CmsEntryFieldFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport interface CmsEntryFieldFilterPluginCreateResponse {\n field: Field;\n path: string;\n fieldPathId: string;\n plugin: ValueFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport class CmsEntryFieldFilterPlugin extends Plugin {\n public static override readonly type: string = \"cms.dynamodb.entry.field.filter\";\n public static readonly ALL: string = \"*\";\n\n private readonly config: CmsEntryFieldFilterPluginParams;\n\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFieldFilterPluginParams) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public create(params: CmsEntryFieldFilterPluginCreateParams) {\n return this.config.create(params);\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACA;;AAiCO,MAAMC,yBAAyB,SAASC,eAAM,CAAC;EAQ3CC,WAAWA,CAACC,MAAuC,EAAE;IACxD,KAAK,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACR,IAAI,CAACF,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACG,SAAS,GAAG,IAAI,CAACH,MAAM,CAACG,SAAS;EAC1C;EAEOC,MAAMA,CAACC,MAA6C,EAAE;IACzD,OAAO,IAAI,CAACL,MAAM,CAACI,MAAM,CAACC,MAAM,CAAC;EACrC;AACJ;AAACC,OAAA,CAAAT,yBAAA,GAAAA,yBAAA;AAAA,IAAAI,gBAAA,CAAAC,OAAA,EAjBYL,yBAAyB,UACa,iCAAiC;AAAA,IAAAI,gBAAA,CAAAC,OAAA,EADvEL,yBAAyB,SAEG,GAAG"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
import { Field } from "../operations/entry/filtering/types";
|
|
3
|
+
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
4
|
+
interface CmsEntryFieldSortingPluginCanUseParams {
|
|
5
|
+
model: CmsModel;
|
|
6
|
+
field?: Field;
|
|
7
|
+
fieldId: string;
|
|
8
|
+
order: "ASC" | "DESC";
|
|
9
|
+
/**
|
|
10
|
+
* Combination of fieldId and sortBy
|
|
11
|
+
*
|
|
12
|
+
* example: id_ASC or createdBy_DESC
|
|
13
|
+
*/
|
|
14
|
+
sortBy: string;
|
|
15
|
+
}
|
|
16
|
+
interface CmsEntryFieldSortingPluginCreateSortParams {
|
|
17
|
+
model: CmsModel;
|
|
18
|
+
fieldId: string;
|
|
19
|
+
order: "ASC" | "DESC";
|
|
20
|
+
sortBy: string;
|
|
21
|
+
fields: Record<string, Field>;
|
|
22
|
+
field?: Field;
|
|
23
|
+
}
|
|
24
|
+
interface CmsEntryFieldSortingPluginCreateSortResult {
|
|
25
|
+
valuePath: string;
|
|
26
|
+
reverse: boolean;
|
|
27
|
+
fieldId: string;
|
|
28
|
+
field: Field;
|
|
29
|
+
}
|
|
30
|
+
interface CmsEntryFieldSortingPluginConfig {
|
|
31
|
+
createSort: (params: CmsEntryFieldSortingPluginCreateSortParams) => CmsEntryFieldSortingPluginCreateSortResult;
|
|
32
|
+
canUse: (params: CmsEntryFieldSortingPluginCanUseParams) => boolean;
|
|
33
|
+
}
|
|
34
|
+
export declare class CmsEntryFieldSortingPlugin extends Plugin {
|
|
35
|
+
static readonly type: string;
|
|
36
|
+
private readonly config;
|
|
37
|
+
constructor(config: CmsEntryFieldSortingPluginConfig);
|
|
38
|
+
canUse(params: CmsEntryFieldSortingPluginCanUseParams): boolean;
|
|
39
|
+
createSort(params: CmsEntryFieldSortingPluginCreateSortParams): CmsEntryFieldSortingPluginCreateSortResult;
|
|
40
|
+
}
|
|
41
|
+
export declare const createCmsEntryFieldSortingPlugin: (config: CmsEntryFieldSortingPluginConfig) => CmsEntryFieldSortingPlugin;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createCmsEntryFieldSortingPlugin = exports.CmsEntryFieldSortingPlugin = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
|
+
var _plugins = require("@webiny/plugins");
|
|
10
|
+
class CmsEntryFieldSortingPlugin extends _plugins.Plugin {
|
|
11
|
+
constructor(config) {
|
|
12
|
+
super();
|
|
13
|
+
(0, _defineProperty2.default)(this, "config", void 0);
|
|
14
|
+
this.config = config;
|
|
15
|
+
}
|
|
16
|
+
canUse(params) {
|
|
17
|
+
return this.config.canUse(params);
|
|
18
|
+
}
|
|
19
|
+
createSort(params) {
|
|
20
|
+
return this.config.createSort(params);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
exports.CmsEntryFieldSortingPlugin = CmsEntryFieldSortingPlugin;
|
|
24
|
+
(0, _defineProperty2.default)(CmsEntryFieldSortingPlugin, "type", "cms.entry.field.sorting");
|
|
25
|
+
const createCmsEntryFieldSortingPlugin = config => {
|
|
26
|
+
return new CmsEntryFieldSortingPlugin(config);
|
|
27
|
+
};
|
|
28
|
+
exports.createCmsEntryFieldSortingPlugin = createCmsEntryFieldSortingPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_plugins","require","CmsEntryFieldSortingPlugin","Plugin","constructor","config","_defineProperty2","default","canUse","params","createSort","exports","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,IAAAA,QAAA,GAAAC,OAAA;AAwCO,MAAMC,0BAA0B,SAASC,eAAM,CAAC;EAI5CC,WAAWA,CAACC,MAAwC,EAAE;IACzD,KAAK,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IACR,IAAI,CAACF,MAAM,GAAGA,MAAM;EACxB;EAEOG,MAAMA,CAACC,MAA8C,EAAW;IACnE,OAAO,IAAI,CAACJ,MAAM,CAACG,MAAM,CAACC,MAAM,CAAC;EACrC;EAEOC,UAAUA,CACbD,MAAkD,EACR;IAC1C,OAAO,IAAI,CAACJ,MAAM,CAACK,UAAU,CAACD,MAAM,CAAC;EACzC;AACJ;AAACE,OAAA,CAAAT,0BAAA,GAAAA,0BAAA;AAAA,IAAAI,gBAAA,CAAAC,OAAA,EAlBYL,0BAA0B,UACY,yBAAyB;AAmBrE,MAAMU,gCAAgC,GAAIP,MAAwC,IAAK;EAC1F,OAAO,IAAIH,0BAA0B,CAACG,MAAM,CAAC;AACjD,CAAC;AAACM,OAAA,CAAAC,gCAAA,GAAAA,gCAAA"}
|
|
@@ -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":["_plugins","require","CmsFieldFilterValueTransformPlugin","Plugin","fieldType","config","transform","constructor","_defineProperty2","default","exports"],"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,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,kCAAkC,SACnCC,eAAM,CAElB;EAKI,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEA,IAAWE,SAASA,CAAA,EAA0D;IAC1E,OAAO,IAAI,CAACD,MAAM,CAACC,SAAS;EAChC;EAEOC,WAAWA,CAACF,MAAgD,EAAE;IACjE,KAAK,CAAC,CAAC;IAAC,IAAAG,gBAAA,CAAAC,OAAA;IACR,IAAI,CAACJ,MAAM,GAAGA,MAAM;EACxB;AACJ;AAACK,OAAA,CAAAR,kCAAA,GAAAA,kCAAA;AAAA,IAAAM,gBAAA,CAAAC,OAAA,EApBYP,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;
|
|
@@ -15,4 +13,37 @@ Object.keys(_CmsEntryFieldFilterPathPlugin).forEach(function (key) {
|
|
|
15
13
|
return _CmsEntryFieldFilterPathPlugin[key];
|
|
16
14
|
}
|
|
17
15
|
});
|
|
16
|
+
});
|
|
17
|
+
var _CmsEntryFieldSortingPlugin = require("./CmsEntryFieldSortingPlugin");
|
|
18
|
+
Object.keys(_CmsEntryFieldSortingPlugin).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _CmsEntryFieldSortingPlugin[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function () {
|
|
24
|
+
return _CmsEntryFieldSortingPlugin[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _CmsEntryFieldFilterPlugin = require("./CmsEntryFieldFilterPlugin");
|
|
29
|
+
Object.keys(_CmsEntryFieldFilterPlugin).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _CmsEntryFieldFilterPlugin[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () {
|
|
35
|
+
return _CmsEntryFieldFilterPlugin[key];
|
|
36
|
+
}
|
|
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
|
+
});
|
|
18
49
|
});
|
package/plugins/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryFieldFilterPathPlugin\";\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_CmsEntryFieldFilterPathPlugin","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CmsEntryFieldSortingPlugin","_CmsEntryFieldFilterPlugin","_CmsFieldFilterValueTransformPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryFieldFilterPathPlugin\";\nexport * from \"./CmsEntryFieldSortingPlugin\";\nexport * from \"./CmsEntryFieldFilterPlugin\";\nexport * from \"./CmsFieldFilterValueTransformPlugin\";\n"],"mappings":";;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,8BAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,8BAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,8BAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,2BAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,2BAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,2BAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,2BAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,0BAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,0BAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAM,0BAAA,CAAAN,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAE,0BAAA,CAAAN,GAAA;IAAA;EAAA;AAAA;AACA,IAAAO,mCAAA,GAAAX,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAS,mCAAA,EAAAR,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAO,mCAAA,CAAAP,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAG,mCAAA,CAAAP,GAAA;IAAA;EAAA;AAAA"}
|
package/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins/types";
|
|
2
|
-
import { CmsModelField, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
|
|
2
|
+
import { CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
|
|
3
3
|
import { DynamoDBTypes, TableConstructor } from "dynamodb-toolbox/dist/classes/Table";
|
|
4
4
|
import { EntityAttributeConfig, EntityCompositeAttributes } from "dynamodb-toolbox/dist/classes/Entity";
|
|
5
5
|
import { DocumentClient } from "aws-sdk/clients/dynamodb";
|
|
@@ -50,4 +50,13 @@ export interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOper
|
|
|
50
50
|
export interface StorageOperationsFactory {
|
|
51
51
|
(params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;
|
|
52
52
|
}
|
|
53
|
+
export interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {
|
|
54
|
+
dataLoaders: DataLoadersHandlerInterface;
|
|
55
|
+
}
|
|
56
|
+
export interface DataLoadersHandlerInterfaceClearAllParams {
|
|
57
|
+
model: Pick<CmsModel, "tenant" | "locale">;
|
|
58
|
+
}
|
|
59
|
+
export interface DataLoadersHandlerInterface {
|
|
60
|
+
clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;
|
|
61
|
+
}
|
|
53
62
|
export {};
|
package/types.js
CHANGED
|
@@ -4,13 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ENTITIES = void 0;
|
|
7
|
-
let ENTITIES
|
|
8
|
-
exports.ENTITIES = ENTITIES;
|
|
9
|
-
|
|
10
|
-
(function (ENTITIES) {
|
|
7
|
+
let ENTITIES = /*#__PURE__*/function (ENTITIES) {
|
|
11
8
|
ENTITIES["SYSTEM"] = "CmsSystem";
|
|
12
9
|
ENTITIES["SETTINGS"] = "CmsSettings";
|
|
13
10
|
ENTITIES["GROUPS"] = "CmsGroups";
|
|
14
11
|
ENTITIES["MODELS"] = "CmsModels";
|
|
15
12
|
ENTITIES["ENTRIES"] = "CmsEntries";
|
|
16
|
-
|
|
13
|
+
return ENTITIES;
|
|
14
|
+
}({});
|
|
15
|
+
exports.ENTITIES = ENTITIES;
|
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":";;;;;;
|
|
1
|
+
{"version":3,"names":["ENTITIES","exports"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport {\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\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\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: DataLoadersHandlerInterface;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\">;\n}\nexport interface DataLoadersHandlerInterface {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":";;;;;;IA2CYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAAC,OAAA,CAAAD,QAAA,GAAAA,QAAA"}
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.createFilters = void 0;
|
|
9
|
-
|
|
10
|
-
var _ValueFilterPlugin = require("@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin");
|
|
11
|
-
|
|
12
|
-
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
-
|
|
14
|
-
var _mapPlugins = require("./mapPlugins");
|
|
15
|
-
|
|
16
|
-
var _where = require("./where");
|
|
17
|
-
|
|
18
|
-
var _transform = require("./transform");
|
|
19
|
-
|
|
20
|
-
var _CmsEntryFieldFilterPlugin = require("../../../plugins/CmsEntryFieldFilterPlugin");
|
|
21
|
-
|
|
22
|
-
const createFilters = params => {
|
|
23
|
-
const {
|
|
24
|
-
where,
|
|
25
|
-
plugins,
|
|
26
|
-
fields
|
|
27
|
-
} = params;
|
|
28
|
-
const filterPlugins = (0, _mapPlugins.getMappedPlugins)({
|
|
29
|
-
plugins,
|
|
30
|
-
type: _ValueFilterPlugin.ValueFilterPlugin.type,
|
|
31
|
-
property: "operation"
|
|
32
|
-
});
|
|
33
|
-
const transformValuePlugins = (0, _mapPlugins.getMappedPlugins)({
|
|
34
|
-
plugins,
|
|
35
|
-
type: "cms-field-filter-value-transform",
|
|
36
|
-
property: "fieldType"
|
|
37
|
-
});
|
|
38
|
-
const fieldFilterCreatePlugins = (0, _mapPlugins.getMappedPlugins)({
|
|
39
|
-
plugins,
|
|
40
|
-
type: _CmsEntryFieldFilterPlugin.CmsEntryFieldFilterPlugin.type,
|
|
41
|
-
property: "fieldType"
|
|
42
|
-
});
|
|
43
|
-
const defaultFilterCreatePlugin = fieldFilterCreatePlugins["*"];
|
|
44
|
-
|
|
45
|
-
const getFilterCreatePlugin = type => {
|
|
46
|
-
const filterCreatePlugin = fieldFilterCreatePlugins[type] || defaultFilterCreatePlugin;
|
|
47
|
-
|
|
48
|
-
if (filterCreatePlugin) {
|
|
49
|
-
return filterCreatePlugin;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
throw new _error.default(`There is no filter create plugin for the field type "${type}".`, "MISSING_FILTER_CREATE_PLUGIN", {
|
|
53
|
-
type
|
|
54
|
-
});
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const filters = [];
|
|
58
|
-
|
|
59
|
-
for (const key in where) {
|
|
60
|
-
if (where.hasOwnProperty(key) === false) {
|
|
61
|
-
continue;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* At the moment we do not allow "OR" and "AND" conditional filtering, so throw an error on it.
|
|
65
|
-
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
if (key === "AND") {
|
|
69
|
-
throw new _error.default(`Conditional "AND" is currently disabled in the DynamoDB only deployment.`, "DISABLED_AND_CONDITIONAL");
|
|
70
|
-
} else if (key === "OR") {
|
|
71
|
-
throw new _error.default(`Conditional "OR" is currently disabled in the DynamoDB only deployment.`, "DISABLED_OR_CONDITIONAL");
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
const value = where[key];
|
|
75
|
-
|
|
76
|
-
if (value === undefined) {
|
|
77
|
-
continue;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
const whereParams = (0, _where.extractWhereParams)(key);
|
|
81
|
-
|
|
82
|
-
if (!whereParams) {
|
|
83
|
-
continue;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
const {
|
|
87
|
-
fieldId,
|
|
88
|
-
operation,
|
|
89
|
-
negate
|
|
90
|
-
} = whereParams;
|
|
91
|
-
const field = fields[fieldId];
|
|
92
|
-
|
|
93
|
-
if (!field) {
|
|
94
|
-
throw new _error.default(`There is no field with the fieldId "${fieldId}".`, "FIELD_ERROR", {
|
|
95
|
-
fieldId
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* We need a filter create plugin for this type.
|
|
100
|
-
*/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
const filterCreatePlugin = getFilterCreatePlugin(field.type);
|
|
104
|
-
const transformValuePlugin = transformValuePlugins[field.type];
|
|
105
|
-
|
|
106
|
-
const transformValueCallable = value => {
|
|
107
|
-
if (!transformValuePlugin) {
|
|
108
|
-
return value;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return transformValuePlugin.transform({
|
|
112
|
-
field,
|
|
113
|
-
value
|
|
114
|
-
});
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
const result = filterCreatePlugin.create({
|
|
118
|
-
key,
|
|
119
|
-
value,
|
|
120
|
-
valueFilterPlugins: filterPlugins,
|
|
121
|
-
transformValuePlugins,
|
|
122
|
-
getFilterCreatePlugin,
|
|
123
|
-
operation,
|
|
124
|
-
negate,
|
|
125
|
-
field,
|
|
126
|
-
fields,
|
|
127
|
-
compareValue: (0, _transform.transformValue)({
|
|
128
|
-
value,
|
|
129
|
-
transform: transformValueCallable
|
|
130
|
-
}),
|
|
131
|
-
transformValue: transformValueCallable
|
|
132
|
-
});
|
|
133
|
-
/**
|
|
134
|
-
* There is a possibility of
|
|
135
|
-
* - no result
|
|
136
|
-
* - result being an array
|
|
137
|
-
* - result being an object
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
if (!result) {
|
|
141
|
-
continue;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (Array.isArray(result)) {
|
|
145
|
-
filters.push(...result);
|
|
146
|
-
continue;
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
filters.push(result);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return filters;
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
exports.createFilters = createFilters;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createFilters","params","where","plugins","fields","filterPlugins","getMappedPlugins","type","ValueFilterPlugin","property","transformValuePlugins","fieldFilterCreatePlugins","CmsEntryFieldFilterPlugin","defaultFilterCreatePlugin","getFilterCreatePlugin","filterCreatePlugin","WebinyError","filters","key","hasOwnProperty","value","undefined","whereParams","extractWhereParams","fieldId","operation","negate","field","transformValuePlugin","transformValueCallable","transform","result","create","valueFilterPlugins","compareValue","transformValue","Array","isArray","push"],"sources":["createFilters.ts"],"sourcesContent":["import { CmsEntryListWhere } from \"@webiny/api-headless-cms/types\";\nimport { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport { CmsFieldFilterValueTransformPlugin } from \"~/types\";\nimport WebinyError from \"@webiny/error\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { Field } from \"./types\";\nimport { getMappedPlugins } from \"./mapPlugins\";\nimport { extractWhereParams } from \"./where\";\nimport { transformValue } from \"./transform\";\nimport { CmsEntryFieldFilterPlugin } from \"~/plugins/CmsEntryFieldFilterPlugin\";\n\ninterface CreateFiltersParams {\n plugins: PluginsContainer;\n where: Partial<CmsEntryListWhere>;\n fields: Record<string, Field>;\n}\n\nexport interface ItemFilter {\n field: Field;\n path: string;\n fieldPathId: string;\n plugin: ValueFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport const createFilters = (params: CreateFiltersParams): ItemFilter[] => {\n const { where, plugins, fields } = params;\n const filterPlugins = getMappedPlugins<ValueFilterPlugin>({\n plugins,\n type: ValueFilterPlugin.type,\n property: \"operation\"\n });\n const transformValuePlugins = getMappedPlugins<CmsFieldFilterValueTransformPlugin>({\n plugins,\n type: \"cms-field-filter-value-transform\",\n property: \"fieldType\"\n });\n const fieldFilterCreatePlugins = getMappedPlugins<CmsEntryFieldFilterPlugin>({\n plugins,\n type: CmsEntryFieldFilterPlugin.type,\n property: \"fieldType\"\n });\n\n const defaultFilterCreatePlugin = fieldFilterCreatePlugins[\"*\"] as CmsEntryFieldFilterPlugin;\n\n const getFilterCreatePlugin = (type: string) => {\n const filterCreatePlugin = fieldFilterCreatePlugins[type] || defaultFilterCreatePlugin;\n if (filterCreatePlugin) {\n return filterCreatePlugin;\n }\n throw new WebinyError(\n `There is no filter create plugin for the field type \"${type}\".`,\n \"MISSING_FILTER_CREATE_PLUGIN\",\n {\n type\n }\n );\n };\n\n const filters: ItemFilter[] = [];\n\n for (const key in where) {\n if (where.hasOwnProperty(key) === false) {\n continue;\n }\n /**\n * At the moment we do not allow \"OR\" and \"AND\" conditional filtering, so throw an error on it.\n */\n if (key === \"AND\") {\n throw new WebinyError(\n `Conditional \"AND\" is currently disabled in the DynamoDB only deployment.`,\n \"DISABLED_AND_CONDITIONAL\"\n );\n } else if (key === \"OR\") {\n throw new WebinyError(\n `Conditional \"OR\" is currently disabled in the DynamoDB only deployment.`,\n \"DISABLED_OR_CONDITIONAL\"\n );\n }\n\n const value = (where as any)[key];\n if (value === undefined) {\n continue;\n }\n\n const whereParams = extractWhereParams(key);\n if (!whereParams) {\n continue;\n }\n\n const { fieldId, operation, negate } = whereParams;\n\n const field = fields[fieldId];\n if (!field) {\n throw new WebinyError(\n `There is no field with the fieldId \"${fieldId}\".`,\n \"FIELD_ERROR\",\n {\n fieldId\n }\n );\n }\n\n /**\n * We need a filter create plugin for this type.\n */\n const filterCreatePlugin = getFilterCreatePlugin(field.type);\n\n const transformValuePlugin: CmsFieldFilterValueTransformPlugin =\n transformValuePlugins[field.type];\n\n const transformValueCallable = (value: any) => {\n if (!transformValuePlugin) {\n return value;\n }\n return transformValuePlugin.transform({\n field,\n value\n });\n };\n\n const result = filterCreatePlugin.create({\n key,\n value,\n valueFilterPlugins: filterPlugins,\n transformValuePlugins,\n getFilterCreatePlugin,\n operation,\n negate,\n field,\n fields,\n compareValue: transformValue({\n value,\n transform: transformValueCallable\n }),\n transformValue: transformValueCallable\n });\n /**\n * There is a possibility of\n * - no result\n * - result being an array\n * - result being an object\n */\n if (!result) {\n continue;\n }\n if (Array.isArray(result)) {\n filters.push(...result);\n continue;\n }\n filters.push(result);\n }\n\n return filters;\n};\n"],"mappings":"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"}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.systemFields = void 0;
|
|
7
|
-
|
|
8
|
-
const createSystemField = field => {
|
|
9
|
-
return field;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const systemFields = {
|
|
13
|
-
id: createSystemField({
|
|
14
|
-
id: "id",
|
|
15
|
-
type: "text",
|
|
16
|
-
storageId: "id",
|
|
17
|
-
fieldId: "id"
|
|
18
|
-
}),
|
|
19
|
-
entryId: createSystemField({
|
|
20
|
-
id: "entryId",
|
|
21
|
-
type: "text",
|
|
22
|
-
storageId: "entryId",
|
|
23
|
-
fieldId: "entryId"
|
|
24
|
-
}),
|
|
25
|
-
createdOn: createSystemField({
|
|
26
|
-
id: "createdOn",
|
|
27
|
-
type: "datetime",
|
|
28
|
-
storageId: "createdOn",
|
|
29
|
-
fieldId: "createdOn"
|
|
30
|
-
}),
|
|
31
|
-
savedOn: createSystemField({
|
|
32
|
-
id: "savedOn",
|
|
33
|
-
type: "datetime",
|
|
34
|
-
storageId: "savedOn",
|
|
35
|
-
fieldId: "savedOn"
|
|
36
|
-
}),
|
|
37
|
-
createdBy: createSystemField({
|
|
38
|
-
id: "createdBy",
|
|
39
|
-
type: "plainObject",
|
|
40
|
-
storageId: "createdBy",
|
|
41
|
-
fieldId: "createdBy",
|
|
42
|
-
settings: {
|
|
43
|
-
path: "createdBy.id"
|
|
44
|
-
}
|
|
45
|
-
}),
|
|
46
|
-
meta: createSystemField({
|
|
47
|
-
id: "meta",
|
|
48
|
-
type: "plainObject",
|
|
49
|
-
storageId: "meta",
|
|
50
|
-
fieldId: "meta"
|
|
51
|
-
}),
|
|
52
|
-
ownedBy: createSystemField({
|
|
53
|
-
id: "ownedBy",
|
|
54
|
-
type: "plainObject",
|
|
55
|
-
storageId: "ownedBy",
|
|
56
|
-
fieldId: "ownedBy",
|
|
57
|
-
settings: {
|
|
58
|
-
path: "ownedBy.id"
|
|
59
|
-
}
|
|
60
|
-
}),
|
|
61
|
-
version: createSystemField({
|
|
62
|
-
id: "version",
|
|
63
|
-
type: "number",
|
|
64
|
-
storageId: "version",
|
|
65
|
-
fieldId: "version"
|
|
66
|
-
}),
|
|
67
|
-
status: createSystemField({
|
|
68
|
-
id: "status",
|
|
69
|
-
type: "string",
|
|
70
|
-
storageId: "status",
|
|
71
|
-
fieldId: "status"
|
|
72
|
-
})
|
|
73
|
-
};
|
|
74
|
-
exports.systemFields = systemFields;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createSystemField","field","systemFields","id","type","storageId","fieldId","entryId","createdOn","savedOn","createdBy","settings","path","meta","ownedBy","version","status"],"sources":["systemFields.ts"],"sourcesContent":["import { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\ntype CmsModelFieldInput = Partial<CmsModelField> &\n Pick<CmsModelField, \"id\" | \"type\" | \"storageId\" | \"fieldId\">;\nconst createSystemField = (field: CmsModelFieldInput): CmsModelField => {\n return field as CmsModelField;\n};\n\nexport const systemFields: Record<string, CmsModelField> = {\n id: createSystemField({\n id: \"id\",\n type: \"text\",\n storageId: \"id\",\n fieldId: \"id\"\n }),\n entryId: createSystemField({\n id: \"entryId\",\n type: \"text\",\n storageId: \"entryId\",\n fieldId: \"entryId\"\n }),\n createdOn: createSystemField({\n id: \"createdOn\",\n type: \"datetime\",\n storageId: \"createdOn\",\n fieldId: \"createdOn\"\n }),\n savedOn: createSystemField({\n id: \"savedOn\",\n type: \"datetime\",\n storageId: \"savedOn\",\n fieldId: \"savedOn\"\n }),\n createdBy: createSystemField({\n id: \"createdBy\",\n type: \"plainObject\",\n storageId: \"createdBy\",\n fieldId: \"createdBy\",\n settings: {\n path: \"createdBy.id\"\n }\n }),\n meta: createSystemField({\n id: \"meta\",\n type: \"plainObject\",\n storageId: \"meta\",\n fieldId: \"meta\"\n }),\n ownedBy: createSystemField({\n id: \"ownedBy\",\n type: \"plainObject\",\n storageId: \"ownedBy\",\n fieldId: \"ownedBy\",\n settings: {\n path: \"ownedBy.id\"\n }\n }),\n version: createSystemField({\n id: \"version\",\n type: \"number\",\n storageId: \"version\",\n fieldId: \"version\"\n }),\n status: createSystemField({\n id: \"status\",\n type: \"string\",\n storageId: \"status\",\n fieldId: \"status\"\n })\n};\n"],"mappings":";;;;;;;AAIA,MAAMA,iBAAiB,GAAIC,KAAD,IAA8C;EACpE,OAAOA,KAAP;AACH,CAFD;;AAIO,MAAMC,YAA2C,GAAG;EACvDC,EAAE,EAAEH,iBAAiB,CAAC;IAClBG,EAAE,EAAE,IADc;IAElBC,IAAI,EAAE,MAFY;IAGlBC,SAAS,EAAE,IAHO;IAIlBC,OAAO,EAAE;EAJS,CAAD,CADkC;EAOvDC,OAAO,EAAEP,iBAAiB,CAAC;IACvBG,EAAE,EAAE,SADmB;IAEvBC,IAAI,EAAE,MAFiB;IAGvBC,SAAS,EAAE,SAHY;IAIvBC,OAAO,EAAE;EAJc,CAAD,CAP6B;EAavDE,SAAS,EAAER,iBAAiB,CAAC;IACzBG,EAAE,EAAE,WADqB;IAEzBC,IAAI,EAAE,UAFmB;IAGzBC,SAAS,EAAE,WAHc;IAIzBC,OAAO,EAAE;EAJgB,CAAD,CAb2B;EAmBvDG,OAAO,EAAET,iBAAiB,CAAC;IACvBG,EAAE,EAAE,SADmB;IAEvBC,IAAI,EAAE,UAFiB;IAGvBC,SAAS,EAAE,SAHY;IAIvBC,OAAO,EAAE;EAJc,CAAD,CAnB6B;EAyBvDI,SAAS,EAAEV,iBAAiB,CAAC;IACzBG,EAAE,EAAE,WADqB;IAEzBC,IAAI,EAAE,aAFmB;IAGzBC,SAAS,EAAE,WAHc;IAIzBC,OAAO,EAAE,WAJgB;IAKzBK,QAAQ,EAAE;MACNC,IAAI,EAAE;IADA;EALe,CAAD,CAzB2B;EAkCvDC,IAAI,EAAEb,iBAAiB,CAAC;IACpBG,EAAE,EAAE,MADgB;IAEpBC,IAAI,EAAE,aAFc;IAGpBC,SAAS,EAAE,MAHS;IAIpBC,OAAO,EAAE;EAJW,CAAD,CAlCgC;EAwCvDQ,OAAO,EAAEd,iBAAiB,CAAC;IACvBG,EAAE,EAAE,SADmB;IAEvBC,IAAI,EAAE,aAFiB;IAGvBC,SAAS,EAAE,SAHY;IAIvBC,OAAO,EAAE,SAJc;IAKvBK,QAAQ,EAAE;MACNC,IAAI,EAAE;IADA;EALa,CAAD,CAxC6B;EAiDvDG,OAAO,EAAEf,iBAAiB,CAAC;IACvBG,EAAE,EAAE,SADmB;IAEvBC,IAAI,EAAE,QAFiB;IAGvBC,SAAS,EAAE,SAHY;IAIvBC,OAAO,EAAE;EAJc,CAAD,CAjD6B;EAuDvDU,MAAM,EAAEhB,iBAAiB,CAAC;IACtBG,EAAE,EAAE,QADkB;IAEtBC,IAAI,EAAE,QAFgB;IAGtBC,SAAS,EAAE,QAHW;IAItBC,OAAO,EAAE;EAJa,CAAD;AAvD8B,CAApD"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { CmsEntry, CmsEntryListWhere, CmsModel, CmsModelField } from "@webiny/api-headless-cms/types";
|
|
2
|
-
import { PluginsContainer } from "@webiny/plugins";
|
|
3
|
-
import { CreatePathCallable as CmsEntryFieldFieldCreatePathCallable } from "../../plugins/CmsEntryFieldFilterPathPlugin";
|
|
4
|
-
interface ModelField {
|
|
5
|
-
def: CmsModelField;
|
|
6
|
-
valueTransformer: (value: any) => any;
|
|
7
|
-
createPath: CmsEntryFieldFieldCreatePathCallable;
|
|
8
|
-
isSystemField?: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare type ModelFieldRecords = Record<string, ModelField>;
|
|
11
|
-
export interface FilterItemFromStorage {
|
|
12
|
-
<T = any>(field: CmsModelField, value: any): Promise<T>;
|
|
13
|
-
}
|
|
14
|
-
interface FilterItemsParams {
|
|
15
|
-
items: CmsEntry[];
|
|
16
|
-
where: Partial<CmsEntryListWhere>;
|
|
17
|
-
plugins: PluginsContainer;
|
|
18
|
-
fields: ModelFieldRecords;
|
|
19
|
-
fromStorage: FilterItemFromStorage;
|
|
20
|
-
fullTextSearch?: {
|
|
21
|
-
term?: string;
|
|
22
|
-
fields?: string[];
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
export declare const filterItems: (params: FilterItemsParams) => Promise<CmsEntry[]>;
|
|
26
|
-
interface SortEntryItemsArgs {
|
|
27
|
-
items: CmsEntry[];
|
|
28
|
-
sort?: string[];
|
|
29
|
-
fields: ModelFieldRecords;
|
|
30
|
-
}
|
|
31
|
-
export declare const sortEntryItems: (params: SortEntryItemsArgs) => CmsEntry[];
|
|
32
|
-
export declare const buildModelFields: ({ plugins, model }: {
|
|
33
|
-
plugins: PluginsContainer;
|
|
34
|
-
model: CmsModel;
|
|
35
|
-
}) => ModelFieldRecords;
|
|
36
|
-
export {};
|