@webiny/api-headless-cms-ddb 5.43.3 → 6.0.0-alpha.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.d.ts +3 -2
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +3 -2
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +3 -2
- package/definitions/model.js.map +1 -1
- package/definitions/system.d.ts +3 -2
- package/definitions/system.js.map +1 -1
- package/definitions/table.d.ts +2 -2
- package/definitions/table.js.map +1 -1
- package/dynamoDb/path/locationFolderId.js.map +1 -1
- package/dynamoDb/path/plainObject.js.map +1 -1
- package/dynamoDb/storage/richText.js +1 -8
- package/dynamoDb/storage/richText.js.map +1 -1
- package/dynamoDb/transformValue/datetime.d.ts +1 -1
- package/dynamoDb/transformValue/datetime.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +2 -2
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +2 -2
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +2 -2
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.d.ts +2 -2
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.d.ts +2 -2
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoader/types.d.ts +1 -1
- package/operations/entry/dataLoader/types.js.map +1 -1
- package/operations/entry/dataLoaders.d.ts +3 -3
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/filtering/createExpressions.d.ts +3 -3
- package/operations/entry/filtering/createExpressions.js.map +1 -1
- package/operations/entry/filtering/createFields.d.ts +3 -3
- package/operations/entry/filtering/createFields.js.map +1 -1
- package/operations/entry/filtering/extractSort.d.ts +3 -3
- package/operations/entry/filtering/extractSort.js.map +1 -1
- package/operations/entry/filtering/filter.d.ts +3 -3
- package/operations/entry/filtering/filter.js.map +1 -1
- package/operations/entry/filtering/fullTextSearch.d.ts +3 -3
- package/operations/entry/filtering/fullTextSearch.js.map +1 -1
- package/operations/entry/filtering/mapPlugins.d.ts +1 -1
- package/operations/entry/filtering/mapPlugins.js.map +1 -1
- package/operations/entry/filtering/plugins/index.js +2 -1
- package/operations/entry/filtering/plugins/index.js.map +1 -1
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/refFilterCreate.d.ts +1 -1
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +65 -0
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +1 -0
- package/operations/entry/filtering/sort.d.ts +3 -3
- package/operations/entry/filtering/sort.js.map +1 -1
- package/operations/entry/filtering/systemFields.d.ts +1 -1
- package/operations/entry/filtering/systemFields.js.map +1 -1
- package/operations/entry/filtering/transform.d.ts +1 -1
- package/operations/entry/filtering/transform.js.map +1 -1
- package/operations/entry/filtering/types.d.ts +2 -2
- package/operations/entry/filtering/types.js.map +1 -1
- package/operations/entry/filtering/values.d.ts +1 -1
- package/operations/entry/filtering/values.js.map +1 -1
- package/operations/entry/index.js +1 -1
- package/operations/entry/index.js.map +1 -1
- package/operations/group/index.d.ts +3 -3
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +2 -2
- package/operations/model/index.js.map +1 -1
- package/operations/system/index.d.ts +2 -2
- package/operations/system/index.js.map +1 -1
- package/package.json +13 -11
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +1 -1
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldFilterPlugin.d.ts +3 -3
- package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldSortingPlugin.d.ts +2 -2
- package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -1
- package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +1 -1
- package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -1
- package/types.d.ts +6 -6
- package/types.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.0-alpha.1",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-headless-cms",
|
|
@@ -22,21 +22,23 @@
|
|
|
22
22
|
],
|
|
23
23
|
"license": "MIT",
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@webiny/api": "
|
|
26
|
-
"@webiny/api-headless-cms": "
|
|
27
|
-
"@webiny/aws-sdk": "
|
|
28
|
-
"@webiny/db-dynamodb": "
|
|
29
|
-
"@webiny/error": "
|
|
30
|
-
"@webiny/handler-db": "
|
|
31
|
-
"@webiny/utils": "
|
|
25
|
+
"@webiny/api": "6.0.0-alpha.1",
|
|
26
|
+
"@webiny/api-headless-cms": "6.0.0-alpha.1",
|
|
27
|
+
"@webiny/aws-sdk": "6.0.0-alpha.1",
|
|
28
|
+
"@webiny/db-dynamodb": "6.0.0-alpha.1",
|
|
29
|
+
"@webiny/error": "6.0.0-alpha.1",
|
|
30
|
+
"@webiny/handler-db": "6.0.0-alpha.1",
|
|
31
|
+
"@webiny/utils": "6.0.0-alpha.1",
|
|
32
32
|
"dataloader": "2.2.3",
|
|
33
|
+
"dot-object": "2.1.5",
|
|
33
34
|
"dot-prop": "6.0.1",
|
|
34
35
|
"lodash": "4.17.21"
|
|
35
36
|
},
|
|
36
37
|
"devDependencies": {
|
|
38
|
+
"@types/dot-object": "2.1.6",
|
|
37
39
|
"@types/jsonpack": "1.1.6",
|
|
38
|
-
"@webiny/plugins": "
|
|
39
|
-
"@webiny/project-utils": "
|
|
40
|
+
"@webiny/plugins": "6.0.0-alpha.1",
|
|
41
|
+
"@webiny/project-utils": "6.0.0-alpha.1",
|
|
40
42
|
"jest": "29.7.0",
|
|
41
43
|
"jest-dynalite": "3.6.1",
|
|
42
44
|
"typescript": "5.3.3"
|
|
@@ -49,5 +51,5 @@
|
|
|
49
51
|
"build": "node ../cli/bin.js run build",
|
|
50
52
|
"watch": "node ../cli/bin.js run watch"
|
|
51
53
|
},
|
|
52
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "9bd236cf5e689f209a11bec089207dcc2d41a53c"
|
|
53
55
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins/Plugin";
|
|
2
|
-
import { CmsModelField } from "@webiny/api-headless-cms/types";
|
|
2
|
+
import type { CmsModelField } from "@webiny/api-headless-cms/types";
|
|
3
3
|
export interface CreatePathCallableParams {
|
|
4
4
|
field: Partial<CmsModelField> & Pick<CmsModelField, "fieldId" | "storageId" | "id">;
|
|
5
5
|
index?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_error","_interopRequireDefault","require","_Plugin","CmsEntryFieldFilterPathPlugin","Plugin","type","fieldType","config","constructor","name","canUse","field","parents","fieldId","Array","isArray","length","includes","createPath","params","path","WebinyError","exports"],"sources":["CmsEntryFieldFilterPathPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Plugin } from \"@webiny/plugins/Plugin\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams {\n field: Partial<CmsModelField> & Pick<CmsModelField, \"fieldId\" | \"storageId\" | \"id\">;\n index?: number;\n}\nexport interface CreatePathCallable {\n (params: CreatePathCallableParams): string;\n}\nexport interface CmsEntryFieldFilterPathPluginParams {\n fieldType: string;\n fieldId?: string[];\n path: string | CreatePathCallable;\n canUse?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents?: string[]) => boolean;\n}\nexport class CmsEntryFieldFilterPathPlugin extends Plugin {\n public static override readonly type: string = \"cms-field-filter-path\";\n\n private readonly config: CmsEntryFieldFilterPathPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(config: CmsEntryFieldFilterPathPluginParams) {\n super();\n\n this.config = config;\n\n /**\n * We expect error here because we know that `this.constructor.type` is defined, but TS does not.\n */\n // @ts-expect-error\n this.name = `${this.constructor.type}-${this.config.fieldType}`;\n }\n\n public canUse(field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents: string[]): boolean {\n if (field.type !== this.config.fieldType) {\n return false;\n } else if (this.config.canUse) {\n return this.config.canUse(field, parents);\n }\n const fieldId = this.config.fieldId;\n if (!fieldId || Array.isArray(fieldId) === false || fieldId.length === 0) {\n return true;\n }\n return fieldId.includes(field.fieldId);\n }\n\n public createPath(params: CreatePathCallableParams): string {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n throw new WebinyError(`Missing path in \"${this.name}\" plugin.`);\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAgBO,MAAME,6BAA6B,SAASC,cAAM,CAAC;EACtD,OAAgCC,IAAI,GAAW,uBAAuB;EAItE,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEOE,WAAWA,CAACD,MAA2C,EAAE;IAC5D,KAAK,CAAC,CAAC;IAEP,IAAI,CAACA,MAAM,GAAGA,MAAM;;IAEpB;AACR;AACA;IACQ;IACA,IAAI,CAACE,IAAI,GAAG,GAAG,IAAI,CAACD,WAAW,CAACH,IAAI,IAAI,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;EACnE;EAEOI,MAAMA,CAACC,KAA8C,EAAEC,OAAiB,EAAW;IACtF,IAAID,KAAK,CAACN,IAAI,KAAK,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;MACtC,OAAO,KAAK;IAChB,CAAC,MAAM,IAAI,IAAI,CAACC,MAAM,CAACG,MAAM,EAAE;MAC3B,OAAO,IAAI,CAACH,MAAM,CAACG,MAAM,CAACC,KAAK,EAAEC,OAAO,CAAC;IAC7C;IACA,MAAMC,OAAO,GAAG,IAAI,CAACN,MAAM,CAACM,OAAO;IACnC,IAAI,CAACA,OAAO,IAAIC,KAAK,CAACC,OAAO,CAACF,OAAO,CAAC,KAAK,KAAK,IAAIA,OAAO,CAACG,MAAM,KAAK,CAAC,EAAE;MACtE,OAAO,IAAI;IACf;IACA,OAAOH,OAAO,CAACI,QAAQ,CAACN,KAAK,CAACE,OAAO,CAAC;EAC1C;EAEOK,UAAUA,CAACC,MAAgC,EAAU;IACxD,IAAI,OAAO,IAAI,CAACZ,MAAM,CAACa,IAAI,KAAK,UAAU,EAAE;MACxC,OAAO,IAAI,CAACb,MAAM,CAACa,IAAI,CAACD,MAAM,CAAC;IACnC,CAAC,MAAM,IAAI,OAAO,IAAI,CAACZ,MAAM,CAACa,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO,IAAI,CAACb,MAAM,CAACa,IAAI;IAC3B;IACA,MAAM,IAAIC,cAAW,CAAC,oBAAoB,IAAI,CAACZ,IAAI,WAAW,CAAC;EACnE;AACJ;AAACa,OAAA,CAAAnB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_Plugin","CmsEntryFieldFilterPathPlugin","Plugin","type","fieldType","config","constructor","name","canUse","field","parents","fieldId","Array","isArray","length","includes","createPath","params","path","WebinyError","exports"],"sources":["CmsEntryFieldFilterPathPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Plugin } from \"@webiny/plugins/Plugin\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams {\n field: Partial<CmsModelField> & Pick<CmsModelField, \"fieldId\" | \"storageId\" | \"id\">;\n index?: number;\n}\nexport interface CreatePathCallable {\n (params: CreatePathCallableParams): string;\n}\nexport interface CmsEntryFieldFilterPathPluginParams {\n fieldType: string;\n fieldId?: string[];\n path: string | CreatePathCallable;\n canUse?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents?: string[]) => boolean;\n}\nexport class CmsEntryFieldFilterPathPlugin extends Plugin {\n public static override readonly type: string = \"cms-field-filter-path\";\n\n private readonly config: CmsEntryFieldFilterPathPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(config: CmsEntryFieldFilterPathPluginParams) {\n super();\n\n this.config = config;\n\n /**\n * We expect error here because we know that `this.constructor.type` is defined, but TS does not.\n */\n // @ts-expect-error\n this.name = `${this.constructor.type}-${this.config.fieldType}`;\n }\n\n public canUse(field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents: string[]): boolean {\n if (field.type !== this.config.fieldType) {\n return false;\n } else if (this.config.canUse) {\n return this.config.canUse(field, parents);\n }\n const fieldId = this.config.fieldId;\n if (!fieldId || Array.isArray(fieldId) === false || fieldId.length === 0) {\n return true;\n }\n return fieldId.includes(field.fieldId);\n }\n\n public createPath(params: CreatePathCallableParams): string {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n throw new WebinyError(`Missing path in \"${this.name}\" plugin.`);\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAgBO,MAAME,6BAA6B,SAASC,cAAM,CAAC;EACtD,OAAgCC,IAAI,GAAW,uBAAuB;EAItE,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEOE,WAAWA,CAACD,MAA2C,EAAE;IAC5D,KAAK,CAAC,CAAC;IAEP,IAAI,CAACA,MAAM,GAAGA,MAAM;;IAEpB;AACR;AACA;IACQ;IACA,IAAI,CAACE,IAAI,GAAG,GAAG,IAAI,CAACD,WAAW,CAACH,IAAI,IAAI,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;EACnE;EAEOI,MAAMA,CAACC,KAA8C,EAAEC,OAAiB,EAAW;IACtF,IAAID,KAAK,CAACN,IAAI,KAAK,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;MACtC,OAAO,KAAK;IAChB,CAAC,MAAM,IAAI,IAAI,CAACC,MAAM,CAACG,MAAM,EAAE;MAC3B,OAAO,IAAI,CAACH,MAAM,CAACG,MAAM,CAACC,KAAK,EAAEC,OAAO,CAAC;IAC7C;IACA,MAAMC,OAAO,GAAG,IAAI,CAACN,MAAM,CAACM,OAAO;IACnC,IAAI,CAACA,OAAO,IAAIC,KAAK,CAACC,OAAO,CAACF,OAAO,CAAC,KAAK,KAAK,IAAIA,OAAO,CAACG,MAAM,KAAK,CAAC,EAAE;MACtE,OAAO,IAAI;IACf;IACA,OAAOH,OAAO,CAACI,QAAQ,CAACN,KAAK,CAACE,OAAO,CAAC;EAC1C;EAEOK,UAAUA,CAACC,MAAgC,EAAU;IACxD,IAAI,OAAO,IAAI,CAACZ,MAAM,CAACa,IAAI,KAAK,UAAU,EAAE;MACxC,OAAO,IAAI,CAACb,MAAM,CAACa,IAAI,CAACD,MAAM,CAAC;IACnC,CAAC,MAAM,IAAI,OAAO,IAAI,CAACZ,MAAM,CAACa,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO,IAAI,CAACb,MAAM,CAACa,IAAI;IAC3B;IACA,MAAM,IAAIC,cAAW,CAAC,oBAAoB,IAAI,CAACZ,IAAI,WAAW,CAAC;EACnE;AACJ;AAACa,OAAA,CAAAnB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin";
|
|
3
|
-
import { Field } from "../operations/entry/filtering/types";
|
|
4
|
-
import { CmsFieldFilterValueTransformPlugin } from "../types";
|
|
2
|
+
import type { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin";
|
|
3
|
+
import type { Field } from "../operations/entry/filtering/types";
|
|
4
|
+
import type { CmsFieldFilterValueTransformPlugin } from "../types";
|
|
5
5
|
/**
|
|
6
6
|
* This plugin is used to create the filter.
|
|
7
7
|
* Internally we have default one + the one for the reference field - because it is actually an object when filtering.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","CmsEntryFieldFilterPlugin","Plugin","type","ALL","constructor","config","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<T = any> {\n fieldType: string;\n create: (\n params: CmsEntryFieldFilterPluginCreateParams<T>\n ) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];\n}\n\ninterface CmsEntryFieldFilterPluginCreateParams<T = any> {\n key: string;\n value: T;\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<T = any> 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<T>;\n\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFieldFilterPluginParams<T>) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public create(params: CmsEntryFieldFilterPluginCreateParams<T>) {\n return this.config.create(params);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACA;;AAiCO,MAAMC,yBAAyB,SAAkBC,eAAM,CAAC;EAC3D,OAAgCC,IAAI,GAAW,iCAAiC;EAChF,OAAuBC,GAAG,GAAW,GAAG;EAMjCC,WAAWA,CAACC,MAA0C,EAAE;IAC3D,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACD,MAAM,CAACC,SAAS;EAC1C;EAEOC,MAAMA,CAACC,MAAgD,EAAE;IAC5D,OAAO,IAAI,CAACH,MAAM,CAACE,MAAM,CAACC,MAAM,CAAC;EACrC;AACJ;AAACC,OAAA,CAAAT,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_plugins","require","CmsEntryFieldFilterPlugin","Plugin","type","ALL","constructor","config","fieldType","create","params","exports"],"sources":["CmsEntryFieldFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport type { Field } from \"~/operations/entry/filtering/types\";\nimport type { 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<T = any> {\n fieldType: string;\n create: (\n params: CmsEntryFieldFilterPluginCreateParams<T>\n ) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];\n}\n\ninterface CmsEntryFieldFilterPluginCreateParams<T = any> {\n key: string;\n value: T;\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<T = any> 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<T>;\n\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFieldFilterPluginParams<T>) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public create(params: CmsEntryFieldFilterPluginCreateParams<T>) {\n return this.config.create(params);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACA;;AAiCO,MAAMC,yBAAyB,SAAkBC,eAAM,CAAC;EAC3D,OAAgCC,IAAI,GAAW,iCAAiC;EAChF,OAAuBC,GAAG,GAAW,GAAG;EAMjCC,WAAWA,CAACC,MAA0C,EAAE;IAC3D,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACD,MAAM,CAACC,SAAS;EAC1C;EAEOC,MAAMA,CAACC,MAAgD,EAAE;IAC5D,OAAO,IAAI,CAACH,MAAM,CAACE,MAAM,CAACC,MAAM,CAAC;EACrC;AACJ;AAACC,OAAA,CAAAT,yBAAA,GAAAA,yBAAA","ignoreList":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { Field } from "../operations/entry/filtering/types";
|
|
3
|
-
import { CmsModel } from "@webiny/api-headless-cms/types";
|
|
2
|
+
import type { Field } from "../operations/entry/filtering/types";
|
|
3
|
+
import type { CmsModel } from "@webiny/api-headless-cms/types";
|
|
4
4
|
interface CmsEntryFieldSortingPluginCanUseParams {
|
|
5
5
|
model: CmsModel;
|
|
6
6
|
field?: Field;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","CmsEntryFieldSortingPlugin","Plugin","type","constructor","config","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;EACnD,OAAgCC,IAAI,GAAW,yBAAyB;EAGjEC,WAAWA,CAACC,MAAwC,EAAE;IACzD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOC,MAAMA,CAACC,MAA8C,EAAW;IACnE,OAAO,IAAI,CAACF,MAAM,CAACC,MAAM,CAACC,MAAM,CAAC;EACrC;EAEOC,UAAUA,CACbD,MAAkD,EACR;IAC1C,OAAO,IAAI,CAACF,MAAM,CAACG,UAAU,CAACD,MAAM,CAAC;EACzC;AACJ;AAACE,OAAA,CAAAR,0BAAA,GAAAA,0BAAA;AAEM,MAAMS,gCAAgC,GAAIL,MAAwC,IAAK;EAC1F,OAAO,IAAIJ,0BAA0B,CAACI,MAAM,CAAC;AACjD,CAAC;AAACI,OAAA,CAAAC,gCAAA,GAAAA,gCAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_plugins","require","CmsEntryFieldSortingPlugin","Plugin","type","constructor","config","canUse","params","createSort","exports","createCmsEntryFieldSortingPlugin"],"sources":["CmsEntryFieldSortingPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Field } from \"~/operations/entry/filtering/types\";\nimport type { 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;EACnD,OAAgCC,IAAI,GAAW,yBAAyB;EAGjEC,WAAWA,CAACC,MAAwC,EAAE;IACzD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOC,MAAMA,CAACC,MAA8C,EAAW;IACnE,OAAO,IAAI,CAACF,MAAM,CAACC,MAAM,CAACC,MAAM,CAAC;EACrC;EAEOC,UAAUA,CACbD,MAAkD,EACR;IAC1C,OAAO,IAAI,CAACF,MAAM,CAACG,UAAU,CAACD,MAAM,CAAC;EACzC;AACJ;AAACE,OAAA,CAAAR,0BAAA,GAAAA,0BAAA;AAEM,MAAMS,gCAAgC,GAAIL,MAAwC,IAAK;EAC1F,OAAO,IAAIJ,0BAA0B,CAACI,MAAM,CAAC;AACjD,CAAC;AAACI,OAAA,CAAAC,gCAAA,GAAAA,gCAAA","ignoreList":[]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Plugin } from "@webiny/plugins";
|
|
2
|
-
import { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from "../types";
|
|
2
|
+
import type { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from "../types";
|
|
3
3
|
type CmsFieldFilterValueTransformPluginParams = Omit<CmsFieldFilterValueTransformPluginInterface, "type">;
|
|
4
4
|
export declare class CmsFieldFilterValueTransformPlugin extends Plugin implements Omit<CmsFieldFilterValueTransformPluginInterface, "type"> {
|
|
5
5
|
static type: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_plugins","require","CmsFieldFilterValueTransformPlugin","Plugin","type","fieldType","config","transform","constructor","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;EACI,OAAuBC,IAAI,GAAG,kCAAkC;EAIhE,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;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;AACJ;AAACG,OAAA,CAAAP,kCAAA,GAAAA,kCAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["_plugins","require","CmsFieldFilterValueTransformPlugin","Plugin","type","fieldType","config","transform","constructor","exports"],"sources":["CmsFieldFilterValueTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { 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;EACI,OAAuBC,IAAI,GAAG,kCAAkC;EAIhE,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;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;AACJ;AAACG,OAAA,CAAAP,kCAAA,GAAAA,kCAAA","ignoreList":[]}
|
package/types.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { Plugin } from "@webiny/plugins/types";
|
|
2
|
-
import { CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
|
|
3
|
-
import { TableConstructor } from "@webiny/db-dynamodb/toolbox";
|
|
4
|
-
import { AttributeDefinition } from "@webiny/db-dynamodb/toolbox";
|
|
5
|
-
import { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
6
|
-
import { Entity, Table } from "@webiny/db-dynamodb/toolbox";
|
|
1
|
+
import type { Plugin } from "@webiny/plugins/types";
|
|
2
|
+
import type { CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types";
|
|
3
|
+
import type { TableConstructor } from "@webiny/db-dynamodb/toolbox";
|
|
4
|
+
import type { AttributeDefinition } from "@webiny/db-dynamodb/toolbox";
|
|
5
|
+
import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb";
|
|
6
|
+
import type { Entity, Table } from "@webiny/db-dynamodb/toolbox";
|
|
7
7
|
interface CmsFieldFilterValueTransformParams {
|
|
8
8
|
/**
|
|
9
9
|
* A field which value we are transforming.
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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 { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\nimport { AttributeDefinition } from \"@webiny/db-dynamodb/toolbox\";\nimport { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport { Entity, Table } from \"@webiny/db-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 Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n table?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: Plugin[] | Plugin[][];\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => Table<string, string, string>;\n getEntities: () => Record<\"system\" | \"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":";;;;;;IAsCYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ENTITIES","exports"],"sources":["types.ts"],"sourcesContent":["import type { Plugin } from \"@webiny/plugins/types\";\nimport type {\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\n CmsModelField,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport type { TableConstructor } from \"@webiny/db-dynamodb/toolbox\";\nimport type { AttributeDefinition } from \"@webiny/db-dynamodb/toolbox\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb\";\nimport type { Entity, Table } from \"@webiny/db-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 Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor<string, string, string>): TableConstructor<string, string, string>;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n table?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: Plugin[] | Plugin[][];\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => Table<string, string, string>;\n getEntities: () => Record<\"system\" | \"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":";;;;;;IAsCYA,QAAQ,GAAAC,OAAA,CAAAD,QAAA,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
|