@webiny/api-headless-cms-ddb 0.0.0-unstable.6f45466a1d → 0.0.0-unstable.7be00a75a9

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.
Files changed (119) hide show
  1. package/definitions/entry.js +7 -9
  2. package/definitions/entry.js.map +1 -1
  3. package/definitions/group.js +7 -9
  4. package/definitions/group.js.map +1 -1
  5. package/definitions/model.js +7 -9
  6. package/definitions/model.js.map +1 -1
  7. package/definitions/table.js +6 -7
  8. package/definitions/table.js.map +1 -1
  9. package/definitions/types.d.ts +11 -5
  10. package/definitions/types.js +0 -3
  11. package/dynamoDb/index.d.ts +1 -1
  12. package/dynamoDb/index.js +6 -3
  13. package/dynamoDb/index.js.map +1 -1
  14. package/dynamoDb/path/locationFolderId.js +16 -29
  15. package/dynamoDb/path/locationFolderId.js.map +1 -1
  16. package/dynamoDb/path/plainObject.js +11 -21
  17. package/dynamoDb/path/plainObject.js.map +1 -1
  18. package/dynamoDb/transformValue/datetime.js +21 -32
  19. package/dynamoDb/transformValue/datetime.js.map +1 -1
  20. package/index.d.ts +1 -2
  21. package/index.js +74 -79
  22. package/index.js.map +1 -1
  23. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -0
  24. package/operations/entry/dataLoader/DataLoaderCache.js +22 -29
  25. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  26. package/operations/entry/dataLoader/constants.js +2 -1
  27. package/operations/entry/dataLoader/constants.js.map +1 -1
  28. package/operations/entry/dataLoader/createBatchScheduleFn.js +6 -15
  29. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  30. package/operations/entry/dataLoader/getAllEntryRevisions.js +18 -26
  31. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  32. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +32 -38
  33. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  34. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +32 -38
  35. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  36. package/operations/entry/dataLoader/getRevisionById.js +34 -44
  37. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  38. package/operations/entry/dataLoader/index.js +8 -9
  39. package/operations/entry/dataLoader/index.js.map +1 -1
  40. package/operations/entry/dataLoader/types.d.ts +1 -0
  41. package/operations/entry/dataLoader/types.js +0 -3
  42. package/operations/entry/dataLoaders.js +81 -97
  43. package/operations/entry/dataLoaders.js.map +1 -1
  44. package/operations/entry/filtering/createExpressions.d.ts +6 -5
  45. package/operations/entry/filtering/createExpressions.js +110 -161
  46. package/operations/entry/filtering/createExpressions.js.map +1 -1
  47. package/operations/entry/filtering/createFields.js +83 -96
  48. package/operations/entry/filtering/createFields.js.map +1 -1
  49. package/operations/entry/filtering/extractSort.js +50 -74
  50. package/operations/entry/filtering/extractSort.js.map +1 -1
  51. package/operations/entry/filtering/filter.d.ts +5 -4
  52. package/operations/entry/filtering/filter.js +73 -138
  53. package/operations/entry/filtering/filter.js.map +1 -1
  54. package/operations/entry/filtering/fullTextSearch.d.ts +2 -2
  55. package/operations/entry/filtering/fullTextSearch.js +21 -38
  56. package/operations/entry/filtering/fullTextSearch.js.map +1 -1
  57. package/operations/entry/filtering/getValue.js +31 -53
  58. package/operations/entry/filtering/getValue.js.map +1 -1
  59. package/operations/entry/filtering/index.js +0 -2
  60. package/operations/entry/filtering/mapPlugins.js +15 -22
  61. package/operations/entry/filtering/mapPlugins.js.map +1 -1
  62. package/operations/entry/filtering/plugins/defaultFilterCreate.js +29 -33
  63. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -1
  64. package/operations/entry/filtering/plugins/index.js +7 -3
  65. package/operations/entry/filtering/plugins/index.js.map +1 -1
  66. package/operations/entry/filtering/plugins/objectFilterCreate.js +60 -76
  67. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -1
  68. package/operations/entry/filtering/plugins/refFilterCreate.js +55 -66
  69. package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -1
  70. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +43 -51
  71. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +1 -1
  72. package/operations/entry/filtering/sort.js +34 -60
  73. package/operations/entry/filtering/sort.js.map +1 -1
  74. package/operations/entry/filtering/systemFields.js +144 -111
  75. package/operations/entry/filtering/systemFields.js.map +1 -1
  76. package/operations/entry/filtering/transform.js +4 -8
  77. package/operations/entry/filtering/transform.js.map +1 -1
  78. package/operations/entry/filtering/types.d.ts +2 -2
  79. package/operations/entry/filtering/types.js +0 -3
  80. package/operations/entry/filtering/values.js +11 -12
  81. package/operations/entry/filtering/values.js.map +1 -1
  82. package/operations/entry/filtering/where.js +17 -23
  83. package/operations/entry/filtering/where.js.map +1 -1
  84. package/operations/entry/index.d.ts +2 -0
  85. package/operations/entry/index.js +896 -1149
  86. package/operations/entry/index.js.map +1 -1
  87. package/operations/entry/keys.d.ts +6 -0
  88. package/operations/entry/keys.js +57 -77
  89. package/operations/entry/keys.js.map +1 -1
  90. package/operations/group/index.d.ts +2 -3
  91. package/operations/group/index.js +115 -139
  92. package/operations/group/index.js.map +1 -1
  93. package/operations/model/index.js +100 -122
  94. package/operations/model/index.js.map +1 -1
  95. package/package.json +27 -19
  96. package/plugins/CmsEntryFieldFilterPathPlugin.js +23 -33
  97. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
  98. package/plugins/CmsEntryFieldFilterPlugin.d.ts +3 -3
  99. package/plugins/CmsEntryFieldFilterPlugin.js +16 -17
  100. package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -1
  101. package/plugins/CmsEntryFieldSortingPlugin.js +16 -15
  102. package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -1
  103. package/plugins/CmsFieldFilterValueTransformPlugin.js +15 -12
  104. package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -1
  105. package/plugins/index.js +0 -2
  106. package/types.d.ts +5 -3
  107. package/types.js +6 -5
  108. package/types.js.map +1 -1
  109. package/definitions/types.js.map +0 -1
  110. package/dynamoDb/storage/longText.d.ts +0 -10
  111. package/dynamoDb/storage/longText.js +0 -86
  112. package/dynamoDb/storage/longText.js.map +0 -1
  113. package/dynamoDb/storage/richText.d.ts +0 -2
  114. package/dynamoDb/storage/richText.js +0 -52
  115. package/dynamoDb/storage/richText.js.map +0 -1
  116. package/operations/entry/dataLoader/types.js.map +0 -1
  117. package/operations/entry/filtering/index.js.map +0 -1
  118. package/operations/entry/filtering/types.js.map +0 -1
  119. package/plugins/index.js.map +0 -1
package/package.json CHANGED
@@ -1,8 +1,11 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms-ddb",
3
- "version": "0.0.0-unstable.6f45466a1d",
3
+ "version": "0.0.0-unstable.7be00a75a9",
4
4
  "type": "module",
5
- "main": "index.js",
5
+ "exports": {
6
+ ".": "./index.js",
7
+ "./*": "./*"
8
+ },
6
9
  "keywords": [
7
10
  "@webiny/api-headless-cms",
8
11
  "storage-operations",
@@ -23,31 +26,36 @@
23
26
  ],
24
27
  "license": "MIT",
25
28
  "dependencies": {
26
- "@webiny/api": "0.0.0-unstable.6f45466a1d",
27
- "@webiny/api-headless-cms": "0.0.0-unstable.6f45466a1d",
28
- "@webiny/aws-sdk": "0.0.0-unstable.6f45466a1d",
29
- "@webiny/db-dynamodb": "0.0.0-unstable.6f45466a1d",
30
- "@webiny/error": "0.0.0-unstable.6f45466a1d",
31
- "@webiny/handler-db": "0.0.0-unstable.6f45466a1d",
32
- "@webiny/utils": "0.0.0-unstable.6f45466a1d",
29
+ "@webiny/api": "0.0.0-unstable.7be00a75a9",
30
+ "@webiny/api-headless-cms": "0.0.0-unstable.7be00a75a9",
31
+ "@webiny/aws-sdk": "0.0.0-unstable.7be00a75a9",
32
+ "@webiny/db-dynamodb": "0.0.0-unstable.7be00a75a9",
33
+ "@webiny/error": "0.0.0-unstable.7be00a75a9",
34
+ "@webiny/feature": "0.0.0-unstable.7be00a75a9",
35
+ "@webiny/handler": "0.0.0-unstable.7be00a75a9",
36
+ "@webiny/handler-db": "0.0.0-unstable.7be00a75a9",
37
+ "@webiny/utils": "0.0.0-unstable.7be00a75a9",
33
38
  "dataloader": "2.2.3",
34
39
  "dot-object": "2.1.5",
35
- "dot-prop": "6.0.1",
36
- "lodash": "4.17.23"
40
+ "dot-prop": "10.1.0",
41
+ "lodash": "4.18.1"
37
42
  },
38
43
  "devDependencies": {
39
44
  "@types/dot-object": "2.1.6",
40
45
  "@types/jsonpack": "1.1.6",
41
- "@webiny/build-tools": "0.0.0-unstable.6f45466a1d",
42
- "@webiny/plugins": "0.0.0-unstable.6f45466a1d",
43
- "@webiny/project-utils": "0.0.0-unstable.6f45466a1d",
46
+ "@webiny/build-tools": "0.0.0-unstable.7be00a75a9",
47
+ "@webiny/di": "0.0.0-unstable.7be00a75a9",
48
+ "@webiny/plugins": "0.0.0-unstable.7be00a75a9",
49
+ "@webiny/project-utils": "0.0.0-unstable.7be00a75a9",
44
50
  "jest-dynalite": "3.6.1",
45
- "typescript": "5.9.3",
46
- "vitest": "3.2.4"
51
+ "typescript": "6.0.3",
52
+ "vitest": "4.1.7"
47
53
  },
48
54
  "publishConfig": {
49
- "access": "public",
50
- "directory": "dist"
55
+ "access": "public"
51
56
  },
52
- "gitHead": "6f45466a1d9fb94f6156923501eb90ac303b81a5"
57
+ "gitHead": "b8aec8a1be3f25c3b428b357fe1e352c7cbff9ae",
58
+ "webiny": {
59
+ "publishFrom": "dist"
60
+ }
53
61
  }
@@ -1,40 +1,30 @@
1
- import WebinyError from "@webiny/error";
1
+ import error from "@webiny/error";
2
2
  import { Plugin } from "@webiny/plugins/Plugin.js";
3
- export class CmsEntryFieldFilterPathPlugin extends Plugin {
4
- static type = "cms-field-filter-path";
5
- get fieldType() {
6
- return this.config.fieldType;
7
- }
8
- constructor(config) {
9
- super();
10
- this.config = config;
11
-
12
- /**
13
- * We expect error here because we know that `this.constructor.type` is defined, but TS does not.
14
- */
15
- // @ts-expect-error
16
- this.name = `${this.constructor.type}-${this.config.fieldType}`;
17
- }
18
- canUse(field, parents) {
19
- if (field.type !== this.config.fieldType) {
20
- return false;
21
- } else if (this.config.canUse) {
22
- return this.config.canUse(field, parents);
3
+ class CmsEntryFieldFilterPathPlugin extends Plugin {
4
+ static{
5
+ this.type = "cms-field-filter-path";
6
+ }
7
+ get fieldType() {
8
+ return this.config.fieldType;
9
+ }
10
+ constructor(config){
11
+ super();
12
+ this.config = config;
13
+ this.name = `${this.constructor.type}-${this.config.fieldType}`;
23
14
  }
24
- const fieldId = this.config.fieldId;
25
- if (!fieldId || Array.isArray(fieldId) === false || fieldId.length === 0) {
26
- return true;
15
+ canUse(field, parents) {
16
+ if (field.type !== this.config.fieldType) return false;
17
+ if (this.config.canUse) return this.config.canUse(field, parents);
18
+ const fieldId = this.config.fieldId;
19
+ if (!fieldId || false === Array.isArray(fieldId) || 0 === fieldId.length) return true;
20
+ return fieldId.includes(field.fieldId);
27
21
  }
28
- return fieldId.includes(field.fieldId);
29
- }
30
- createPath(params) {
31
- if (typeof this.config.path === "function") {
32
- return this.config.path(params);
33
- } else if (typeof this.config.path === "string") {
34
- return this.config.path;
22
+ createPath(params) {
23
+ if ("function" == typeof this.config.path) return this.config.path(params);
24
+ if ("string" == typeof this.config.path) return this.config.path;
25
+ throw new error(`Missing path in "${this.name}" plugin.`);
35
26
  }
36
- throw new WebinyError(`Missing path in "${this.name}" plugin.`);
37
- }
38
27
  }
28
+ export { CmsEntryFieldFilterPathPlugin };
39
29
 
40
30
  //# sourceMappingURL=CmsEntryFieldFilterPathPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["WebinyError","Plugin","CmsEntryFieldFilterPathPlugin","type","fieldType","config","constructor","name","canUse","field","parents","fieldId","Array","isArray","length","includes","createPath","params","path"],"sources":["CmsEntryFieldFilterPathPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Plugin } from \"@webiny/plugins/Plugin.js\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\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,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,MAAM,QAAQ,2BAA2B;AAgBlD,OAAO,MAAMC,6BAA6B,SAASD,MAAM,CAAC;EACtD,OAAgCE,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,IAAIlB,WAAW,CAAC,oBAAoB,IAAI,CAACO,IAAI,WAAW,CAAC;EACnE;AACJ","ignoreList":[]}
1
+ {"version":3,"file":"plugins/CmsEntryFieldFilterPathPlugin.js","sources":["../../src/plugins/CmsEntryFieldFilterPathPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Plugin } from \"@webiny/plugins/Plugin.js\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\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"],"names":["CmsEntryFieldFilterPathPlugin","Plugin","config","field","parents","fieldId","Array","params","WebinyError"],"mappings":";;AAiBO,MAAMA,sCAAsCC;;aACf,IAAI,GAAW;;IAI/C,IAAW,YAAoB;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS;IAChC;IAEA,YAAmBC,MAA2C,CAAE;QAC5D,KAAK;QAEL,IAAI,CAAC,MAAM,GAAGA;QAMd,IAAI,CAAC,IAAI,GAAG,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;IACnE;IAEO,OAAOC,KAA8C,EAAEC,OAAiB,EAAW;QACtF,IAAID,MAAM,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,SAAS,EACpC,OAAO;QACJ,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,EACzB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAACA,OAAOC;QAErC,MAAMC,UAAU,IAAI,CAAC,MAAM,CAAC,OAAO;QACnC,IAAI,CAACA,WAAWC,AAA2B,UAA3BA,MAAM,OAAO,CAACD,YAAsBA,AAAmB,MAAnBA,QAAQ,MAAM,EAC9D,OAAO;QAEX,OAAOA,QAAQ,QAAQ,CAACF,MAAM,OAAO;IACzC;IAEO,WAAWI,MAAgC,EAAU;QACxD,IAAI,AAA4B,cAA5B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EACvB,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAACA;QACrB,IAAI,AAA4B,YAA5B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,EAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI;QAE3B,MAAM,IAAIC,MAAY,CAAC,iBAAiB,EAAE,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC;IAClE;AACJ"}
@@ -1,7 +1,7 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import type { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin.js";
3
2
  import type { Field } from "../operations/entry/filtering/types.js";
4
3
  import type { CmsFieldFilterValueTransformPlugin } from "../types.js";
4
+ import { ValueFilterRegistry } from "@webiny/db-dynamodb/feature/ValueFilter/index.js";
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.
@@ -16,7 +16,7 @@ interface CmsEntryFieldFilterPluginCreateParams<T = any> {
16
16
  field: Field;
17
17
  fields: Record<string, Field>;
18
18
  operation: string;
19
- valueFilterPlugins: Record<string, ValueFilterPlugin>;
19
+ valueFilterRegistry: ValueFilterRegistry.Interface;
20
20
  transformValuePlugins: Record<string, CmsFieldFilterValueTransformPlugin>;
21
21
  getFilterCreatePlugin: (type: string) => CmsEntryFieldFilterPlugin;
22
22
  negate: boolean;
@@ -27,7 +27,7 @@ export interface CmsEntryFieldFilterPluginCreateResponse {
27
27
  field: Field;
28
28
  path: string;
29
29
  fieldPathId: string;
30
- plugin: ValueFilterPlugin;
30
+ filter: ValueFilterRegistry.Filter;
31
31
  negate: boolean;
32
32
  compareValue: any;
33
33
  transformValue: <I = any, O = any>(value: I) => O;
@@ -1,21 +1,20 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
-
3
- /**
4
- * This plugin is used to create the filter.
5
- * Internally we have default one + the one for the reference field - because it is actually an object when filtering.
6
- */
7
-
8
- export class CmsEntryFieldFilterPlugin extends Plugin {
9
- static type = "cms.dynamodb.entry.field.filter";
10
- static ALL = "*";
11
- constructor(config) {
12
- super();
13
- this.config = config;
14
- this.fieldType = this.config.fieldType;
15
- }
16
- create(params) {
17
- return this.config.create(params);
18
- }
2
+ class CmsEntryFieldFilterPlugin extends Plugin {
3
+ static{
4
+ this.type = "cms.dynamodb.entry.field.filter";
5
+ }
6
+ static{
7
+ this.ALL = "*";
8
+ }
9
+ constructor(config){
10
+ super();
11
+ this.config = config;
12
+ this.fieldType = this.config.fieldType;
13
+ }
14
+ create(params) {
15
+ return this.config.create(params);
16
+ }
19
17
  }
18
+ export { CmsEntryFieldFilterPlugin };
20
19
 
21
20
  //# sourceMappingURL=CmsEntryFieldFilterPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Plugin","CmsEntryFieldFilterPlugin","type","ALL","constructor","config","fieldType","create","params"],"sources":["CmsEntryFieldFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin.js\";\nimport type { Field } from \"~/operations/entry/filtering/types.js\";\nimport type { CmsFieldFilterValueTransformPlugin } from \"~/types.js\";\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,SAASA,MAAM,QAAQ,iBAAiB;;AAKxC;AACA;AACA;AACA;;AAiCA,OAAO,MAAMC,yBAAyB,SAAkBD,MAAM,CAAC;EAC3D,OAAgCE,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","ignoreList":[]}
1
+ {"version":3,"file":"plugins/CmsEntryFieldFilterPlugin.js","sources":["../../src/plugins/CmsEntryFieldFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Field } from \"~/operations/entry/filtering/types.js\";\nimport type { CmsFieldFilterValueTransformPlugin } from \"~/types.js\";\nimport { ValueFilterRegistry } from \"@webiny/db-dynamodb/feature/ValueFilter/index.js\";\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 valueFilterRegistry: ValueFilterRegistry.Interface;\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 filter: ValueFilterRegistry.Filter;\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"],"names":["CmsEntryFieldFilterPlugin","Plugin","config","params"],"mappings":";AAyCO,MAAMA,kCAA2CC;;aACpB,IAAI,GAAW;;;aACxB,GAAG,GAAW;;IAMrC,YAAmBC,MAA0C,CAAE;QAC3D,KAAK;QACL,IAAI,CAAC,MAAM,GAAGA;QACd,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,SAAS;IAC1C;IAEO,OAAOC,MAAgD,EAAE;QAC5D,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAACA;IAC9B;AACJ"}
@@ -1,19 +1,20 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- export class CmsEntryFieldSortingPlugin extends Plugin {
3
- static type = "cms.entry.field.sorting";
4
- constructor(config) {
5
- super();
6
- this.config = config;
7
- }
8
- canUse(params) {
9
- return this.config.canUse(params);
10
- }
11
- createSort(params) {
12
- return this.config.createSort(params);
13
- }
2
+ class CmsEntryFieldSortingPlugin extends Plugin {
3
+ static{
4
+ this.type = "cms.entry.field.sorting";
5
+ }
6
+ constructor(config){
7
+ super();
8
+ this.config = config;
9
+ }
10
+ canUse(params) {
11
+ return this.config.canUse(params);
12
+ }
13
+ createSort(params) {
14
+ return this.config.createSort(params);
15
+ }
14
16
  }
15
- export const createCmsEntryFieldSortingPlugin = config => {
16
- return new CmsEntryFieldSortingPlugin(config);
17
- };
17
+ const createCmsEntryFieldSortingPlugin = (config)=>new CmsEntryFieldSortingPlugin(config);
18
+ export { CmsEntryFieldSortingPlugin, createCmsEntryFieldSortingPlugin };
18
19
 
19
20
  //# sourceMappingURL=CmsEntryFieldSortingPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Plugin","CmsEntryFieldSortingPlugin","type","constructor","config","canUse","params","createSort","createCmsEntryFieldSortingPlugin"],"sources":["CmsEntryFieldSortingPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Field } from \"~/operations/entry/filtering/types.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\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,SAASA,MAAM,QAAQ,iBAAiB;AAwCxC,OAAO,MAAMC,0BAA0B,SAASD,MAAM,CAAC;EACnD,OAAgCE,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;AAEA,OAAO,MAAME,gCAAgC,GAAIJ,MAAwC,IAAK;EAC1F,OAAO,IAAIH,0BAA0B,CAACG,MAAM,CAAC;AACjD,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"plugins/CmsEntryFieldSortingPlugin.js","sources":["../../src/plugins/CmsEntryFieldSortingPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Field } from \"~/operations/entry/filtering/types.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\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"],"names":["CmsEntryFieldSortingPlugin","Plugin","config","params","createCmsEntryFieldSortingPlugin"],"mappings":";AAwCO,MAAMA,mCAAmCC;;aACZ,IAAI,GAAW;;IAG/C,YAAmBC,MAAwC,CAAE;QACzD,KAAK;QACL,IAAI,CAAC,MAAM,GAAGA;IAClB;IAEO,OAAOC,MAA8C,EAAW;QACnE,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAACA;IAC9B;IAEO,WACHA,MAAkD,EACR;QAC1C,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,CAACA;IAClC;AACJ;AAEO,MAAMC,mCAAmC,CAACF,SACtC,IAAIF,2BAA2BE"}
@@ -1,16 +1,19 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- export class CmsFieldFilterValueTransformPlugin extends Plugin {
3
- static type = "cms-field-filter-value-transform";
4
- get fieldType() {
5
- return this.config.fieldType;
6
- }
7
- get transform() {
8
- return this.config.transform;
9
- }
10
- constructor(config) {
11
- super();
12
- this.config = config;
13
- }
2
+ class CmsFieldFilterValueTransformPlugin extends Plugin {
3
+ static{
4
+ this.type = "cms-field-filter-value-transform";
5
+ }
6
+ get fieldType() {
7
+ return this.config.fieldType;
8
+ }
9
+ get transform() {
10
+ return this.config.transform;
11
+ }
12
+ constructor(config){
13
+ super();
14
+ this.config = config;
15
+ }
14
16
  }
17
+ export { CmsFieldFilterValueTransformPlugin };
15
18
 
16
19
  //# sourceMappingURL=CmsFieldFilterValueTransformPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["Plugin","CmsFieldFilterValueTransformPlugin","type","fieldType","config","transform","constructor"],"sources":["CmsFieldFilterValueTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from \"~/types.js\";\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,SAASA,MAAM,QAAQ,iBAAiB;AAOxC,OAAO,MAAMC,kCAAkC,SACnCD,MAAM,CAElB;EACI,OAAuBE,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","ignoreList":[]}
1
+ {"version":3,"file":"plugins/CmsFieldFilterValueTransformPlugin.js","sources":["../../src/plugins/CmsFieldFilterValueTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from \"~/types.js\";\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"],"names":["CmsFieldFilterValueTransformPlugin","Plugin","config"],"mappings":";AAOO,MAAMA,2CACDC;;aAGe,IAAI,GAAG;;IAI9B,IAAW,YAAoB;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS;IAChC;IAEA,IAAW,YAAmE;QAC1E,OAAO,IAAI,CAAC,MAAM,CAAC,SAAS;IAChC;IAEA,YAAmBC,MAAgD,CAAE;QACjE,KAAK;QACL,IAAI,CAAC,MAAM,GAAGA;IAClB;AACJ"}
package/plugins/index.js CHANGED
@@ -2,5 +2,3 @@ export * from "./CmsEntryFieldFilterPathPlugin.js";
2
2
  export * from "./CmsEntryFieldSortingPlugin.js";
3
3
  export * from "./CmsEntryFieldFilterPlugin.js";
4
4
  export * from "./CmsFieldFilterValueTransformPlugin.js";
5
-
6
- //# sourceMappingURL=index.js.map
package/types.d.ts CHANGED
@@ -1,8 +1,9 @@
1
- import type { Plugin } from "@webiny/plugins/types.js";
2
- import type { CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types/index.js";
1
+ import { type Plugin, PluginsContainer } from "@webiny/plugins/types.js";
2
+ import type { CmsContext, CmsEntryStorageOperations as BaseCmsEntryStorageOperations, CmsModel, CmsModelField, HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations } from "@webiny/api-headless-cms/types/index.js";
3
3
  import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
4
4
  import type { IEntryEntity, IGroupEntity, IModelEntity } from "./definitions/types.js";
5
5
  import type { ITable } from "@webiny/db-dynamodb";
6
+ export type { CmsContext };
6
7
  export type { IGroupEntity, IModelEntity, IEntryEntity };
7
8
  interface CmsFieldFilterValueTransformParams {
8
9
  /**
@@ -33,7 +34,8 @@ export declare enum ENTITIES {
33
34
  export interface StorageOperationsFactoryParams {
34
35
  documentClient: DynamoDBDocument;
35
36
  table?: string;
36
- plugins?: Plugin[] | Plugin[][];
37
+ plugins: PluginsContainer;
38
+ container: CmsContext["container"];
37
39
  }
38
40
  export interface IHeadlessCmsStorageOperationsGetEntitiesResult {
39
41
  groups: IGroupEntity;
package/types.js CHANGED
@@ -1,8 +1,9 @@
1
- export let ENTITIES = /*#__PURE__*/function (ENTITIES) {
2
- ENTITIES["GROUPS"] = "CmsGroups";
3
- ENTITIES["MODELS"] = "CmsModels";
4
- ENTITIES["ENTRIES"] = "CmsEntries";
5
- return ENTITIES;
1
+ var types_ENTITIES = /*#__PURE__*/ function(ENTITIES) {
2
+ ENTITIES["GROUPS"] = "CmsGroups";
3
+ ENTITIES["MODELS"] = "CmsModels";
4
+ ENTITIES["ENTRIES"] = "CmsEntries";
5
+ return ENTITIES;
6
6
  }({});
7
+ export { types_ENTITIES as ENTITIES };
7
8
 
8
9
  //# sourceMappingURL=types.js.map
package/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import type { Plugin } from \"@webiny/plugins/types.js\";\nimport type {\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\n CmsModelField,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { IEntryEntity, IGroupEntity, IModelEntity } from \"~/definitions/types.js\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport type { IGroupEntity, IModelEntity, IEntryEntity };\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 enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n table?: string;\n plugins?: Plugin[] | Plugin[][];\n}\n\nexport interface IHeadlessCmsStorageOperationsGetEntitiesResult {\n groups: IGroupEntity;\n models: IModelEntity;\n entries: IEntryEntity;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => ITable;\n getEntities: () => IHeadlessCmsStorageOperationsGetEntitiesResult;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: IDataLoadersHandler;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\">;\n}\nexport interface IDataLoadersHandler {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":"AAqCA,WAAYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","sources":["../src/types.ts"],"sourcesContent":["import { type Plugin, PluginsContainer } from \"@webiny/plugins/types.js\";\nimport type {\n CmsContext,\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\n CmsModelField,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types/index.js\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\nimport type { IEntryEntity, IGroupEntity, IModelEntity } from \"~/definitions/types.js\";\nimport type { ITable } from \"@webiny/db-dynamodb\";\n\nexport type { CmsContext };\n\nexport type { IGroupEntity, IModelEntity, IEntryEntity };\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 enum ENTITIES {\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DynamoDBDocument;\n table?: string;\n plugins: PluginsContainer;\n container: CmsContext[\"container\"];\n}\n\nexport interface IHeadlessCmsStorageOperationsGetEntitiesResult {\n groups: IGroupEntity;\n models: IModelEntity;\n entries: IEntryEntity;\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => ITable;\n getEntities: () => IHeadlessCmsStorageOperationsGetEntitiesResult;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: IDataLoadersHandler;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\">;\n}\nexport interface IDataLoadersHandler {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"names":["ENTITIES"],"mappings":"AAwCO,IAAKA,iBAAQA,WAAAA,GAAAA,SAARA,QAAQ;;;;WAARA"}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntity, IStandardEntityAttributes } from \"@webiny/db-dynamodb\";\nimport type { GenericRecord } from \"@webiny/api/types.js\";\nimport type {\n CmsEntryStatus,\n CmsGroup,\n CmsIdentity,\n CmsModel,\n ICmsEntryLocation,\n IEntryState\n} from \"@webiny/api-headless-cms/types/index.js\";\n\nexport interface IEntryEntityAttirbutesData {\n id: string;\n entryId: string;\n modelId: string;\n\n tenant: string;\n /**\n * Revision-level meta fields. 👇\n */\n revisionCreatedOn: string;\n revisionModifiedOn: string | null;\n revisionSavedOn: string;\n revisionDeletedOn: string | null;\n revisionRestoredOn: string | null;\n revisionFirstPublishedOn: string | null;\n revisionLastPublishedOn: string | null;\n revisionCreatedBy: CmsIdentity;\n revisionModifiedBy: CmsIdentity | null;\n revisionSavedBy: CmsIdentity;\n revisionDeletedBy: CmsIdentity | null;\n revisionRestoredBy: CmsIdentity | null;\n revisionFirstPublishedBy: CmsIdentity | null;\n revisionLastPublishedBy: CmsIdentity | null;\n\n /**\n * Entry-level meta fields. 👇\n */\n createdOn: string;\n modifiedOn: string | null;\n savedOn: string;\n deletedOn: string | null;\n restoredOn: string | null;\n firstPublishedOn: string | null;\n lastPublishedOn: string | null;\n createdBy: CmsIdentity;\n modifiedBy: CmsIdentity | null;\n savedBy: CmsIdentity;\n deletedBy: CmsIdentity | null;\n restoredBy: CmsIdentity | null;\n firstPublishedBy: CmsIdentity | null;\n lastPublishedBy: CmsIdentity | null;\n\n /**\n * The rest. 👇\n */\n version: number;\n locked: boolean;\n status: CmsEntryStatus;\n location?: ICmsEntryLocation;\n wbyDeleted?: boolean | null;\n binOriginalFolderId?: string;\n values: GenericRecord;\n meta?: GenericRecord;\n state?: IEntryState;\n}\n\nexport type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttirbutesData>;\n\nexport type IModelEntity = IEntity<IStandardEntityAttributes<CmsModel>>;\nexport type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;\nexport type IEntryEntity = IEntity<IEntryEntityAttributes>;\n"],"mappings":"","ignoreList":[]}
@@ -1,10 +0,0 @@
1
- /**
2
- * File is @internal
3
- */
4
- import { StorageTransformPlugin } from "@webiny/api-headless-cms";
5
- export interface StorageValue {
6
- compression: string;
7
- value: string;
8
- isArray?: boolean;
9
- }
10
- export declare const createLongTextStorageTransformPlugin: () => StorageTransformPlugin<string | string[], StorageValue, import("@webiny/api-headless-cms/types").CmsModelField>;
@@ -1,86 +0,0 @@
1
- /**
2
- * File is @internal
3
- */
4
-
5
- import WebinyError from "@webiny/error";
6
- import { compress as gzip, decompress as ungzip } from "@webiny/utils/compression/gzip.js";
7
- import { StorageTransformPlugin } from "@webiny/api-headless-cms";
8
- const GZIP = "gzip";
9
- const TO_STORAGE_ENCODING = "base64";
10
- const FROM_STORAGE_ENCODING = "utf8";
11
- const convertToBuffer = value => {
12
- if (typeof value === "string") {
13
- return Buffer.from(value, TO_STORAGE_ENCODING);
14
- }
15
- return value;
16
- };
17
- export const createLongTextStorageTransformPlugin = () => {
18
- return new StorageTransformPlugin({
19
- name: "headless-cms.storage-transform.long-text.default",
20
- fieldType: "long-text",
21
- fromStorage: async ({
22
- field,
23
- value: storageValue
24
- }) => {
25
- const typeOf = typeof storageValue;
26
- if (!storageValue || typeOf === "string" || typeOf === "number" || Array.isArray(storageValue) === true) {
27
- return storageValue;
28
- } else if (typeOf !== "object") {
29
- throw new WebinyError(`LongText value received in "fromStorage" function is not an object in field "${field.storageId}" - ${field.fieldId}.`);
30
- }
31
- const {
32
- compression,
33
- value,
34
- isArray
35
- } = storageValue;
36
- /**
37
- * Check if possibly undefined, null, empty...
38
- */
39
- if (!compression) {
40
- throw new WebinyError(`Missing compression in "fromStorage" function in field "${field.storageId}" - ${field.fieldId}.": ${JSON.stringify(storageValue)}.`, "MISSING_COMPRESSION", {
41
- value: storageValue
42
- });
43
- } else if (compression !== GZIP) {
44
- throw new WebinyError(`This plugin cannot transform something not compressed with "GZIP".`, "WRONG_COMPRESSION", {
45
- compression
46
- });
47
- }
48
- try {
49
- const buf = await ungzip(convertToBuffer(value));
50
- const result = buf.toString(FROM_STORAGE_ENCODING);
51
- if (!isArray) {
52
- return result;
53
- }
54
- return JSON.parse(result);
55
- } catch (ex) {
56
- console.log("Error while transforming long-text.");
57
- console.log(ex.message);
58
- return "";
59
- }
60
- },
61
- toStorage: async ({
62
- value: initialValue
63
- }) => {
64
- /**
65
- * There is a possibility that we are trying to compress already compressed value.
66
- */
67
- if (initialValue && initialValue.hasOwnProperty("compression") === true) {
68
- return initialValue;
69
- }
70
- const isArray = Array.isArray(initialValue);
71
- const value = isArray ? JSON.stringify(initialValue) : initialValue;
72
- const compressedValue = await gzip(value);
73
- const result = {
74
- compression: GZIP,
75
- value: compressedValue.toString(TO_STORAGE_ENCODING)
76
- };
77
- if (!isArray) {
78
- return result;
79
- }
80
- result.isArray = isArray;
81
- return result;
82
- }
83
- });
84
- };
85
-
86
- //# sourceMappingURL=longText.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","compress","gzip","decompress","ungzip","StorageTransformPlugin","GZIP","TO_STORAGE_ENCODING","FROM_STORAGE_ENCODING","convertToBuffer","value","Buffer","from","createLongTextStorageTransformPlugin","name","fieldType","fromStorage","field","storageValue","typeOf","Array","isArray","storageId","fieldId","compression","JSON","stringify","buf","result","toString","parse","ex","console","log","message","toStorage","initialValue","hasOwnProperty","compressedValue"],"sources":["longText.ts"],"sourcesContent":["/**\n * File is @internal\n */\n\nimport WebinyError from \"@webiny/error\";\nimport { compress as gzip, decompress as ungzip } from \"@webiny/utils/compression/gzip.js\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\n\nconst GZIP = \"gzip\";\nconst TO_STORAGE_ENCODING = \"base64\";\nconst FROM_STORAGE_ENCODING = \"utf8\";\n\nconst convertToBuffer = (value: string | Buffer): Buffer => {\n if (typeof value === \"string\") {\n return Buffer.from(value, TO_STORAGE_ENCODING);\n }\n return value;\n};\n\nexport interface StorageValue {\n compression: string;\n value: string;\n isArray?: boolean;\n}\n\nexport const createLongTextStorageTransformPlugin = () => {\n return new StorageTransformPlugin<string | string[], StorageValue>({\n name: \"headless-cms.storage-transform.long-text.default\",\n fieldType: \"long-text\",\n fromStorage: async ({ field, value: storageValue }) => {\n const typeOf = typeof storageValue;\n if (\n !storageValue ||\n typeOf === \"string\" ||\n typeOf === \"number\" ||\n Array.isArray(storageValue) === true\n ) {\n return storageValue as unknown as string | string[];\n } else if (typeOf !== \"object\") {\n throw new WebinyError(\n `LongText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n const { compression, value, isArray } = storageValue;\n /**\n * Check if possibly undefined, null, empty...\n */\n if (!compression) {\n throw new WebinyError(\n `Missing compression in \"fromStorage\" function in field \"${\n field.storageId\n }\" - ${field.fieldId}.\": ${JSON.stringify(storageValue)}.`,\n \"MISSING_COMPRESSION\",\n {\n value: storageValue\n }\n );\n } else if (compression !== GZIP) {\n throw new WebinyError(\n `This plugin cannot transform something not compressed with \"GZIP\".`,\n \"WRONG_COMPRESSION\",\n {\n compression\n }\n );\n }\n try {\n const buf = await ungzip(convertToBuffer(value));\n const result = buf.toString(FROM_STORAGE_ENCODING);\n if (!isArray) {\n return result;\n }\n return JSON.parse(result);\n } catch (ex) {\n console.log(\"Error while transforming long-text.\");\n console.log(ex.message);\n return \"\";\n }\n },\n toStorage: async ({ value: initialValue }) => {\n /**\n * There is a possibility that we are trying to compress already compressed value.\n */\n if (initialValue && initialValue.hasOwnProperty(\"compression\") === true) {\n return initialValue as unknown as StorageValue;\n }\n const isArray = Array.isArray(initialValue);\n const value = isArray ? JSON.stringify(initialValue) : initialValue;\n const compressedValue = await gzip(value);\n\n const result: StorageValue = {\n compression: GZIP,\n value: compressedValue.toString(TO_STORAGE_ENCODING)\n };\n if (!isArray) {\n return result;\n }\n result.isArray = isArray;\n return result;\n }\n });\n};\n"],"mappings":"AAAA;AACA;AACA;;AAEA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,QAAQ,IAAIC,IAAI,EAAEC,UAAU,IAAIC,MAAM,QAAQ,mCAAmC;AAC1F,SAASC,sBAAsB,QAAQ,0BAA0B;AAEjE,MAAMC,IAAI,GAAG,MAAM;AACnB,MAAMC,mBAAmB,GAAG,QAAQ;AACpC,MAAMC,qBAAqB,GAAG,MAAM;AAEpC,MAAMC,eAAe,GAAIC,KAAsB,IAAa;EACxD,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC3B,OAAOC,MAAM,CAACC,IAAI,CAACF,KAAK,EAAEH,mBAAmB,CAAC;EAClD;EACA,OAAOG,KAAK;AAChB,CAAC;AAQD,OAAO,MAAMG,oCAAoC,GAAGA,CAAA,KAAM;EACtD,OAAO,IAAIR,sBAAsB,CAAkC;IAC/DS,IAAI,EAAE,kDAAkD;IACxDC,SAAS,EAAE,WAAW;IACtBC,WAAW,EAAE,MAAAA,CAAO;MAAEC,KAAK;MAAEP,KAAK,EAAEQ;IAAa,CAAC,KAAK;MACnD,MAAMC,MAAM,GAAG,OAAOD,YAAY;MAClC,IACI,CAACA,YAAY,IACbC,MAAM,KAAK,QAAQ,IACnBA,MAAM,KAAK,QAAQ,IACnBC,KAAK,CAACC,OAAO,CAACH,YAAY,CAAC,KAAK,IAAI,EACtC;QACE,OAAOA,YAAY;MACvB,CAAC,MAAM,IAAIC,MAAM,KAAK,QAAQ,EAAE;QAC5B,MAAM,IAAInB,WAAW,CACjB,gFAAgFiB,KAAK,CAACK,SAAS,OAAOL,KAAK,CAACM,OAAO,GACvH,CAAC;MACL;MACA,MAAM;QAAEC,WAAW;QAAEd,KAAK;QAAEW;MAAQ,CAAC,GAAGH,YAAY;MACpD;AACZ;AACA;MACY,IAAI,CAACM,WAAW,EAAE;QACd,MAAM,IAAIxB,WAAW,CACjB,2DACIiB,KAAK,CAACK,SAAS,OACZL,KAAK,CAACM,OAAO,OAAOE,IAAI,CAACC,SAAS,CAACR,YAAY,CAAC,GAAG,EAC1D,qBAAqB,EACrB;UACIR,KAAK,EAAEQ;QACX,CACJ,CAAC;MACL,CAAC,MAAM,IAAIM,WAAW,KAAKlB,IAAI,EAAE;QAC7B,MAAM,IAAIN,WAAW,CACjB,oEAAoE,EACpE,mBAAmB,EACnB;UACIwB;QACJ,CACJ,CAAC;MACL;MACA,IAAI;QACA,MAAMG,GAAG,GAAG,MAAMvB,MAAM,CAACK,eAAe,CAACC,KAAK,CAAC,CAAC;QAChD,MAAMkB,MAAM,GAAGD,GAAG,CAACE,QAAQ,CAACrB,qBAAqB,CAAC;QAClD,IAAI,CAACa,OAAO,EAAE;UACV,OAAOO,MAAM;QACjB;QACA,OAAOH,IAAI,CAACK,KAAK,CAACF,MAAM,CAAC;MAC7B,CAAC,CAAC,OAAOG,EAAE,EAAE;QACTC,OAAO,CAACC,GAAG,CAAC,qCAAqC,CAAC;QAClDD,OAAO,CAACC,GAAG,CAACF,EAAE,CAACG,OAAO,CAAC;QACvB,OAAO,EAAE;MACb;IACJ,CAAC;IACDC,SAAS,EAAE,MAAAA,CAAO;MAAEzB,KAAK,EAAE0B;IAAa,CAAC,KAAK;MAC1C;AACZ;AACA;MACY,IAAIA,YAAY,IAAIA,YAAY,CAACC,cAAc,CAAC,aAAa,CAAC,KAAK,IAAI,EAAE;QACrE,OAAOD,YAAY;MACvB;MACA,MAAMf,OAAO,GAAGD,KAAK,CAACC,OAAO,CAACe,YAAY,CAAC;MAC3C,MAAM1B,KAAK,GAAGW,OAAO,GAAGI,IAAI,CAACC,SAAS,CAACU,YAAY,CAAC,GAAGA,YAAY;MACnE,MAAME,eAAe,GAAG,MAAMpC,IAAI,CAACQ,KAAK,CAAC;MAEzC,MAAMkB,MAAoB,GAAG;QACzBJ,WAAW,EAAElB,IAAI;QACjBI,KAAK,EAAE4B,eAAe,CAACT,QAAQ,CAACtB,mBAAmB;MACvD,CAAC;MACD,IAAI,CAACc,OAAO,EAAE;QACV,OAAOO,MAAM;MACjB;MACAA,MAAM,CAACP,OAAO,GAAGA,OAAO;MACxB,OAAOO,MAAM;IACjB;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- import { StorageTransformPlugin } from "@webiny/api-headless-cms";
2
- export declare const createRichTextStorageTransformPlugin: () => StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types").CmsModelField>;
@@ -1,52 +0,0 @@
1
- /**
2
- * File is @internal
3
- */
4
- import WebinyError from "@webiny/error";
5
- import { StorageTransformPlugin } from "@webiny/api-headless-cms";
6
- import { CompressorPlugin } from "@webiny/api";
7
- export const createRichTextStorageTransformPlugin = () => {
8
- return new StorageTransformPlugin({
9
- name: "headless-cms.storage-transform.rich-text.default",
10
- fieldType: "rich-text",
11
- fromStorage: async ({
12
- field,
13
- value: storageValue,
14
- plugins
15
- }) => {
16
- if (!storageValue) {
17
- return storageValue;
18
- } else if (typeof storageValue !== "object") {
19
- throw new WebinyError(`RichText value received in "fromStorage" function is not an object in field "${field.storageId}" - ${field.fieldId}.`);
20
- }
21
- let compressor;
22
- try {
23
- compressor = plugins.oneByType(CompressorPlugin.type);
24
- } catch {
25
- return storageValue;
26
- }
27
- try {
28
- return await compressor.getCompressor().decompress(storageValue);
29
- } catch {
30
- return storageValue;
31
- }
32
- },
33
- toStorage: async ({
34
- value,
35
- plugins
36
- }) => {
37
- let compressor;
38
- try {
39
- compressor = plugins.oneByType(CompressorPlugin.type);
40
- } catch {
41
- return value;
42
- }
43
- try {
44
- return await compressor.getCompressor().compress(value);
45
- } catch {
46
- return value;
47
- }
48
- }
49
- });
50
- };
51
-
52
- //# sourceMappingURL=richText.js.map
@@ -1 +0,0 @@
1
- {"version":3,"names":["WebinyError","StorageTransformPlugin","CompressorPlugin","createRichTextStorageTransformPlugin","name","fieldType","fromStorage","field","value","storageValue","plugins","storageId","fieldId","compressor","oneByType","type","getCompressor","decompress","toStorage","compress"],"sources":["richText.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport WebinyError from \"@webiny/error\";\nimport { StorageTransformPlugin } from \"@webiny/api-headless-cms\";\nimport { CompressorPlugin } from \"@webiny/api\";\n\nexport const createRichTextStorageTransformPlugin = () => {\n return new StorageTransformPlugin({\n name: \"headless-cms.storage-transform.rich-text.default\",\n fieldType: \"rich-text\",\n fromStorage: async ({ field, value: storageValue, plugins }) => {\n if (!storageValue) {\n return storageValue;\n } else if (typeof storageValue !== \"object\") {\n throw new WebinyError(\n `RichText value received in \"fromStorage\" function is not an object in field \"${field.storageId}\" - ${field.fieldId}.`\n );\n }\n\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch {\n return storageValue;\n }\n\n try {\n return await compressor.getCompressor().decompress(storageValue);\n } catch {\n return storageValue;\n }\n },\n toStorage: async ({ value, plugins }) => {\n let compressor: CompressorPlugin;\n\n try {\n compressor = plugins.oneByType<CompressorPlugin>(CompressorPlugin.type);\n } catch {\n return value;\n }\n try {\n return await compressor.getCompressor().compress(value);\n } catch {\n return value;\n }\n }\n });\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAW,MAAM,eAAe;AACvC,SAASC,sBAAsB,QAAQ,0BAA0B;AACjE,SAASC,gBAAgB,QAAQ,aAAa;AAE9C,OAAO,MAAMC,oCAAoC,GAAGA,CAAA,KAAM;EACtD,OAAO,IAAIF,sBAAsB,CAAC;IAC9BG,IAAI,EAAE,kDAAkD;IACxDC,SAAS,EAAE,WAAW;IACtBC,WAAW,EAAE,MAAAA,CAAO;MAAEC,KAAK;MAAEC,KAAK,EAAEC,YAAY;MAAEC;IAAQ,CAAC,KAAK;MAC5D,IAAI,CAACD,YAAY,EAAE;QACf,OAAOA,YAAY;MACvB,CAAC,MAAM,IAAI,OAAOA,YAAY,KAAK,QAAQ,EAAE;QACzC,MAAM,IAAIT,WAAW,CACjB,gFAAgFO,KAAK,CAACI,SAAS,OAAOJ,KAAK,CAACK,OAAO,GACvH,CAAC;MACL;MAEA,IAAIC,UAA4B;MAEhC,IAAI;QACAA,UAAU,GAAGH,OAAO,CAACI,SAAS,CAAmBZ,gBAAgB,CAACa,IAAI,CAAC;MAC3E,CAAC,CAAC,MAAM;QACJ,OAAON,YAAY;MACvB;MAEA,IAAI;QACA,OAAO,MAAMI,UAAU,CAACG,aAAa,CAAC,CAAC,CAACC,UAAU,CAACR,YAAY,CAAC;MACpE,CAAC,CAAC,MAAM;QACJ,OAAOA,YAAY;MACvB;IACJ,CAAC;IACDS,SAAS,EAAE,MAAAA,CAAO;MAAEV,KAAK;MAAEE;IAAQ,CAAC,KAAK;MACrC,IAAIG,UAA4B;MAEhC,IAAI;QACAA,UAAU,GAAGH,OAAO,CAACI,SAAS,CAAmBZ,gBAAgB,CAACa,IAAI,CAAC;MAC3E,CAAC,CAAC,MAAM;QACJ,OAAOP,KAAK;MAChB;MACA,IAAI;QACA,OAAO,MAAMK,UAAU,CAACG,aAAa,CAAC,CAAC,CAACG,QAAQ,CAACX,KAAK,CAAC;MAC3D,CAAC,CAAC,MAAM;QACJ,OAAOA,KAAK;MAChB;IACJ;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { IEntryEntity } from \"~/definitions/types.js\";\n\nexport interface IDataLoaderParams {\n entity: IEntryEntity;\n tenant: string;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":["filter","sort"],"sources":["index.ts"],"sourcesContent":["export { filter } from \"./filter.js\";\nexport { sort } from \"./sort.js\";\n"],"mappings":"AAAA,SAASA,MAAM;AACf,SAASC,IAAI","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["types.ts"],"sourcesContent":["import type { CmsModelField } from \"@webiny/api-headless-cms/types/index.js\";\nimport type { CreatePathCallable } from \"~/plugins/index.js\";\n\ninterface FieldValueTransform {\n (value: any): any;\n}\n\nexport interface FieldParent {\n fieldId: string;\n multipleValues?: boolean;\n}\n\nexport interface Field\n extends Partial<Omit<CmsModelField, \"id\" | \"type\" | \"storageId\" | \"fieldId\">>,\n Pick<CmsModelField, \"id\" | \"type\" | \"storageId\" | \"fieldId\"> {\n /**\n * A list od fieldId of all parents of the current field.\n *\n * This is used to check if we need to iterate through an array of parent values.\n */\n parents: FieldParent[];\n /**\n * The method which creates a path for the filtering.\n *\n * Always exists. In most cases it will return some fixed value.\n * When having a CmsEntryFieldFilterPathPlugin then it is executed to create a path.\n */\n createPath: CreatePathCallable;\n /**\n * In most cases, return value of this method is what ever is the input.\n *\n * In some cases there might be a CmsFieldFilterValueTransformPlugin, which transforms value to a comparable one.\n * For example, time in format 15:45:58 is not comparable, so we transform it into the seconds and then compare.\n */\n transform: FieldValueTransform;\n /**\n * Is the field a system field?\n * System fields are built into the code and cannot be changed.\n */\n system: boolean;\n}\n\nexport interface FilterItemFromStorage {\n <T = any>(\n field: Partial<CmsModelField> &\n Pick<CmsModelField, \"fieldId\" | \"storageId\" | \"id\" | \"settings\" | \"type\">,\n value: any\n ): Promise<T>;\n}\n"],"mappings":"","ignoreList":[]}
@@ -1 +0,0 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryFieldFilterPathPlugin.js\";\nexport * from \"./CmsEntryFieldSortingPlugin.js\";\nexport * from \"./CmsEntryFieldFilterPlugin.js\";\nexport * from \"./CmsFieldFilterValueTransformPlugin.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA","ignoreList":[]}