@webiny/api-headless-cms-ddb 0.0.0-unstable.615a930a68 → 0.0.0-unstable.61c048f412

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 (177) hide show
  1. package/README.md +6 -20
  2. package/definitions/entry.d.ts +4 -5
  3. package/definitions/entry.js +6 -89
  4. package/definitions/entry.js.map +1 -1
  5. package/definitions/group.d.ts +4 -5
  6. package/definitions/group.js +6 -63
  7. package/definitions/group.js.map +1 -1
  8. package/definitions/model.d.ts +4 -5
  9. package/definitions/model.js +6 -85
  10. package/definitions/model.js.map +1 -1
  11. package/definitions/table.d.ts +4 -6
  12. package/definitions/table.js +7 -28
  13. package/definitions/table.js.map +1 -1
  14. package/definitions/types.d.ts +59 -0
  15. package/definitions/types.js +3 -0
  16. package/definitions/types.js.map +1 -0
  17. package/dynamoDb/index.d.ts +1 -1
  18. package/dynamoDb/index.js +8 -20
  19. package/dynamoDb/index.js.map +1 -1
  20. package/dynamoDb/path/locationFolderId.d.ts +2 -0
  21. package/dynamoDb/path/locationFolderId.js +34 -0
  22. package/dynamoDb/path/locationFolderId.js.map +1 -0
  23. package/dynamoDb/path/plainObject.d.ts +1 -1
  24. package/dynamoDb/path/plainObject.js +6 -20
  25. package/dynamoDb/path/plainObject.js.map +1 -1
  26. package/dynamoDb/storage/longText.d.ts +1 -1
  27. package/dynamoDb/storage/longText.js +19 -34
  28. package/dynamoDb/storage/longText.js.map +1 -1
  29. package/dynamoDb/storage/richText.d.ts +1 -1
  30. package/dynamoDb/storage/richText.js +27 -88
  31. package/dynamoDb/storage/richText.js.map +1 -1
  32. package/dynamoDb/transformValue/datetime.d.ts +1 -1
  33. package/dynamoDb/transformValue/datetime.js +7 -19
  34. package/dynamoDb/transformValue/datetime.js.map +1 -1
  35. package/index.d.ts +2 -2
  36. package/index.js +47 -105
  37. package/index.js.map +1 -1
  38. package/operations/entry/dataLoader/DataLoaderCache.d.ts +15 -0
  39. package/operations/entry/dataLoader/DataLoaderCache.js +34 -0
  40. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
  41. package/operations/entry/dataLoader/constants.d.ts +1 -0
  42. package/operations/entry/dataLoader/constants.js +4 -0
  43. package/operations/entry/dataLoader/constants.js.map +1 -0
  44. package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
  45. package/operations/entry/dataLoader/createBatchScheduleFn.js +19 -0
  46. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
  47. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
  48. package/operations/entry/dataLoader/getAllEntryRevisions.js +32 -0
  49. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
  50. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
  51. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +46 -0
  52. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
  53. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
  54. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +46 -0
  55. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
  56. package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
  57. package/operations/entry/dataLoader/getRevisionById.js +52 -0
  58. package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
  59. package/operations/entry/dataLoader/index.d.ts +8 -0
  60. package/operations/entry/dataLoader/index.js +19 -0
  61. package/operations/entry/dataLoader/index.js.map +1 -0
  62. package/operations/entry/dataLoader/types.d.ts +5 -0
  63. package/operations/entry/dataLoader/types.js +3 -0
  64. package/operations/entry/dataLoader/types.js.map +1 -0
  65. package/operations/entry/dataLoaders.d.ts +14 -30
  66. package/operations/entry/dataLoaders.js +56 -271
  67. package/operations/entry/dataLoaders.js.map +1 -1
  68. package/operations/entry/filtering/createExpressions.d.ts +26 -0
  69. package/operations/entry/filtering/createExpressions.js +175 -0
  70. package/operations/entry/filtering/createExpressions.js.map +1 -0
  71. package/operations/entry/filtering/createFields.d.ts +7 -9
  72. package/operations/entry/filtering/createFields.js +87 -105
  73. package/operations/entry/filtering/createFields.js.map +1 -1
  74. package/operations/entry/filtering/extractSort.d.ts +8 -4
  75. package/operations/entry/filtering/extractSort.js +60 -31
  76. package/operations/entry/filtering/extractSort.js.map +1 -1
  77. package/operations/entry/filtering/filter.d.ts +6 -7
  78. package/operations/entry/filtering/filter.js +102 -89
  79. package/operations/entry/filtering/filter.js.map +1 -1
  80. package/operations/entry/filtering/fullTextSearch.d.ts +4 -8
  81. package/operations/entry/filtering/fullTextSearch.js +8 -30
  82. package/operations/entry/filtering/fullTextSearch.js.map +1 -1
  83. package/operations/entry/filtering/getValue.js +5 -27
  84. package/operations/entry/filtering/getValue.js.map +1 -1
  85. package/operations/entry/filtering/index.d.ts +2 -2
  86. package/operations/entry/filtering/index.js +3 -20
  87. package/operations/entry/filtering/index.js.map +1 -1
  88. package/operations/entry/filtering/mapPlugins.d.ts +2 -2
  89. package/operations/entry/filtering/mapPlugins.js +4 -18
  90. package/operations/entry/filtering/mapPlugins.js.map +1 -1
  91. package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +2 -2
  92. package/operations/entry/filtering/plugins/defaultFilterCreate.js +9 -20
  93. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -1
  94. package/operations/entry/filtering/plugins/index.d.ts +1 -1
  95. package/operations/entry/filtering/plugins/index.js +7 -16
  96. package/operations/entry/filtering/plugins/index.js.map +1 -1
  97. package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +2 -2
  98. package/operations/entry/filtering/plugins/objectFilterCreate.js +16 -39
  99. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -1
  100. package/operations/entry/filtering/plugins/refFilterCreate.d.ts +3 -2
  101. package/operations/entry/filtering/plugins/refFilterCreate.js +21 -36
  102. package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -1
  103. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +2 -0
  104. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +57 -0
  105. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +1 -0
  106. package/operations/entry/filtering/sort.d.ts +8 -5
  107. package/operations/entry/filtering/sort.js +23 -36
  108. package/operations/entry/filtering/sort.js.map +1 -1
  109. package/operations/entry/filtering/systemFields.d.ts +2 -4
  110. package/operations/entry/filtering/systemFields.js +87 -43
  111. package/operations/entry/filtering/systemFields.js.map +1 -1
  112. package/operations/entry/filtering/transform.d.ts +1 -1
  113. package/operations/entry/filtering/transform.js +2 -10
  114. package/operations/entry/filtering/transform.js.map +1 -1
  115. package/operations/entry/filtering/types.d.ts +2 -2
  116. package/operations/entry/filtering/types.js +2 -4
  117. package/operations/entry/filtering/types.js.map +1 -1
  118. package/operations/entry/filtering/values.d.ts +2 -0
  119. package/operations/entry/filtering/values.js +16 -0
  120. package/operations/entry/filtering/values.js.map +1 -0
  121. package/operations/entry/filtering/where.js +5 -15
  122. package/operations/entry/filtering/where.js.map +1 -1
  123. package/operations/entry/index.d.ts +3 -4
  124. package/operations/entry/index.js +751 -414
  125. package/operations/entry/index.js.map +1 -1
  126. package/operations/entry/keys.d.ts +40 -2
  127. package/operations/entry/keys.js +54 -47
  128. package/operations/entry/keys.js.map +1 -1
  129. package/operations/group/index.d.ts +4 -4
  130. package/operations/group/index.js +44 -91
  131. package/operations/group/index.js.map +1 -1
  132. package/operations/model/index.d.ts +3 -3
  133. package/operations/model/index.js +36 -70
  134. package/operations/model/index.js.map +1 -1
  135. package/package.json +22 -29
  136. package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +4 -3
  137. package/plugins/CmsEntryFieldFilterPathPlugin.js +14 -29
  138. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
  139. package/plugins/CmsEntryFieldFilterPlugin.d.ts +10 -10
  140. package/plugins/CmsEntryFieldFilterPlugin.js +9 -19
  141. package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -1
  142. package/plugins/CmsEntryFieldSortingPlugin.d.ts +42 -0
  143. package/plugins/CmsEntryFieldSortingPlugin.js +19 -0
  144. package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -0
  145. package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +11 -0
  146. package/plugins/CmsFieldFilterValueTransformPlugin.js +16 -0
  147. package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -0
  148. package/plugins/index.d.ts +4 -1
  149. package/plugins/index.js +5 -17
  150. package/plugins/index.js.map +1 -1
  151. package/types.d.ts +24 -19
  152. package/types.js +5 -13
  153. package/types.js.map +1 -1
  154. package/definitions/settings.d.ts +0 -9
  155. package/definitions/settings.js +0 -58
  156. package/definitions/settings.js.map +0 -1
  157. package/definitions/system.d.ts +0 -9
  158. package/definitions/system.js +0 -46
  159. package/definitions/system.js.map +0 -1
  160. package/dynamoDb/storage/date.d.ts +0 -2
  161. package/dynamoDb/storage/date.js +0 -109
  162. package/dynamoDb/storage/date.js.map +0 -1
  163. package/operations/entry/filtering/createFilters.d.ts +0 -20
  164. package/operations/entry/filtering/createFilters.js +0 -155
  165. package/operations/entry/filtering/createFilters.js.map +0 -1
  166. package/operations/entry/systemFields.d.ts +0 -2
  167. package/operations/entry/systemFields.js +0 -74
  168. package/operations/entry/systemFields.js.map +0 -1
  169. package/operations/entry/utils.d.ts +0 -36
  170. package/operations/entry/utils.js +0 -684
  171. package/operations/entry/utils.js.map +0 -1
  172. package/operations/settings/index.d.ts +0 -7
  173. package/operations/settings/index.js +0 -135
  174. package/operations/settings/index.js.map +0 -1
  175. package/operations/system/index.d.ts +0 -7
  176. package/operations/system/index.js +0 -99
  177. package/operations/system/index.js.map +0 -1
package/README.md CHANGED
@@ -1,25 +1,11 @@
1
1
  # @webiny/api-headless-cms-ddb
2
2
 
3
- [![](https://img.shields.io/npm/dw/@webiny/api-headless-cms-ddb.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb)
4
- [![](https://img.shields.io/npm/v/@webiny/api-headless-cms-ddb.svg)](https://www.npmjs.com/package/@webiny/api-headless-cms-ddb)
5
- [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
6
- [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
3
+ > [!NOTE]
4
+ > This package is part of the [Webiny](https://www.webiny.com) monorepo.
5
+ > It’s **included in every Webiny project by default** and is not meant to be used as a standalone package.
7
6
 
8
- ## Install
7
+ 📘 **Documentation:** [https://www.webiny.com/docs](https://www.webiny.com/docs)
9
8
 
10
- ```
11
- npm install --save @webiny/api-headless-cms-ddb
12
- ```
9
+ ---
13
10
 
14
- Or if you prefer yarn:
15
-
16
- ```
17
- yarn add @webiny/api-headless-cms-ddb
18
- ```
19
-
20
- ## Testing
21
- To run the tests only for this package you must filter it with keywords.
22
- ### Command
23
- ````
24
- yarn test packages/api-headless-cms --keyword=cms:ddb --keyword=cms:base
25
- ````
11
+ _This README file is automatically generated during the publish process._
@@ -1,9 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IEntryEntity } from "./types.js";
3
3
  interface Params {
4
- table: Table;
4
+ table: ITable;
5
5
  entityName: string;
6
- attributes: Attributes;
7
6
  }
8
- export declare const createEntryEntity: (params: Params) => Entity<any>;
7
+ export declare const createEntryEntity: (params: Params) => IEntryEntity;
9
8
  export {};
@@ -1,96 +1,13 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createEntryEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
- const createEntryEntity = params => {
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ export const createEntryEntity = params => {
15
3
  const {
16
4
  table,
17
- entityName,
18
- attributes
5
+ entityName
19
6
  } = params;
20
- return new _dynamodbToolbox.Entity({
7
+ return createStandardEntity({
21
8
  name: entityName,
22
- table,
23
- attributes: (0, _objectSpread2.default)({
24
- PK: {
25
- type: "string",
26
- partitionKey: true
27
- },
28
- SK: {
29
- type: "string",
30
- sortKey: true
31
- },
32
- GSI1_PK: {
33
- type: "string"
34
- },
35
- GSI1_SK: {
36
- type: "string"
37
- },
38
- TYPE: {
39
- type: "string"
40
- },
41
- __type: {
42
- type: "string"
43
- },
44
- webinyVersion: {
45
- type: "string"
46
- },
47
- tenant: {
48
- type: "string"
49
- },
50
- entryId: {
51
- type: "string"
52
- },
53
- id: {
54
- type: "string"
55
- },
56
- createdBy: {
57
- type: "map"
58
- },
59
- ownedBy: {
60
- type: "map"
61
- },
62
- createdOn: {
63
- type: "string"
64
- },
65
- savedOn: {
66
- type: "string"
67
- },
68
- modelId: {
69
- type: "string"
70
- },
71
- locale: {
72
- type: "string"
73
- },
74
- publishedOn: {
75
- type: "string"
76
- },
77
- version: {
78
- type: "number"
79
- },
80
- locked: {
81
- type: "boolean"
82
- },
83
- status: {
84
- type: "string"
85
- },
86
- values: {
87
- type: "map"
88
- },
89
- meta: {
90
- type: "map"
91
- }
92
- }, attributes || {})
9
+ table: table.table
93
10
  });
94
11
  };
95
12
 
96
- exports.createEntryEntity = createEntryEntity;
13
+ //# sourceMappingURL=entry.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createEntryEntity","params","table","entityName","attributes","Entity","name","PK","type","partitionKey","SK","sortKey","GSI1_PK","GSI1_SK","TYPE","__type","webinyVersion","tenant","entryId","id","createdBy","ownedBy","createdOn","savedOn","modelId","locale","publishedOn","version","locked","status","values","meta"],"sources":["entry.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createEntryEntity = (params: Params): Entity<any> => {\n const { table, entityName, attributes } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n type: \"string\",\n partitionKey: true\n },\n SK: {\n type: \"string\",\n sortKey: true\n },\n GSI1_PK: {\n type: \"string\"\n },\n GSI1_SK: {\n type: \"string\"\n },\n TYPE: {\n type: \"string\"\n },\n __type: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n entryId: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n createdBy: {\n type: \"map\"\n },\n ownedBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n modelId: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n publishedOn: {\n type: \"string\"\n },\n version: {\n type: \"number\"\n },\n locked: {\n type: \"boolean\"\n },\n status: {\n type: \"string\"\n },\n values: {\n type: \"map\"\n },\n meta: {\n type: \"map\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAQO,MAAMA,iBAAiB,GAAIC,MAAD,IAAiC;EAC9D,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEH,UADQ;IAEdD,KAFc;IAGdE,UAAU;MACNG,EAAE,EAAE;QACAC,IAAI,EAAE,QADN;QAEAC,YAAY,EAAE;MAFd,CADE;MAKNC,EAAE,EAAE;QACAF,IAAI,EAAE,QADN;QAEAG,OAAO,EAAE;MAFT,CALE;MASNC,OAAO,EAAE;QACLJ,IAAI,EAAE;MADD,CATH;MAYNK,OAAO,EAAE;QACLL,IAAI,EAAE;MADD,CAZH;MAeNM,IAAI,EAAE;QACFN,IAAI,EAAE;MADJ,CAfA;MAkBNO,MAAM,EAAE;QACJP,IAAI,EAAE;MADF,CAlBF;MAqBNQ,aAAa,EAAE;QACXR,IAAI,EAAE;MADK,CArBT;MAwBNS,MAAM,EAAE;QACJT,IAAI,EAAE;MADF,CAxBF;MA2BNU,OAAO,EAAE;QACLV,IAAI,EAAE;MADD,CA3BH;MA8BNW,EAAE,EAAE;QACAX,IAAI,EAAE;MADN,CA9BE;MAiCNY,SAAS,EAAE;QACPZ,IAAI,EAAE;MADC,CAjCL;MAoCNa,OAAO,EAAE;QACLb,IAAI,EAAE;MADD,CApCH;MAuCNc,SAAS,EAAE;QACPd,IAAI,EAAE;MADC,CAvCL;MA0CNe,OAAO,EAAE;QACLf,IAAI,EAAE;MADD,CA1CH;MA6CNgB,OAAO,EAAE;QACLhB,IAAI,EAAE;MADD,CA7CH;MAgDNiB,MAAM,EAAE;QACJjB,IAAI,EAAE;MADF,CAhDF;MAmDNkB,WAAW,EAAE;QACTlB,IAAI,EAAE;MADG,CAnDP;MAsDNmB,OAAO,EAAE;QACLnB,IAAI,EAAE;MADD,CAtDH;MAyDNoB,MAAM,EAAE;QACJpB,IAAI,EAAE;MADF,CAzDF;MA4DNqB,MAAM,EAAE;QACJrB,IAAI,EAAE;MADF,CA5DF;MA+DNsB,MAAM,EAAE;QACJtB,IAAI,EAAE;MADF,CA/DF;MAkENuB,IAAI,EAAE;QACFvB,IAAI,EAAE;MADJ;IAlEA,GAqEFJ,UAAU,IAAI,EArEZ;EAHI,CAAX,CAAP;AA2EH,CA7EM"}
1
+ {"version":3,"names":["createStandardEntity","createEntryEntity","params","table","entityName","name"],"sources":["entry.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IEntryEntity, IEntryEntityAttirbutesData } from \"./types.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createEntryEntity = (params: Params): IEntryEntity => {\n const { table, entityName } = params;\n return createStandardEntity<IEntryEntityAttirbutesData>({\n name: entityName,\n table: table.table\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AAQvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAA6B;IACpDK,IAAI,EAAED,UAAU;IAChBD,KAAK,EAAEA,KAAK,CAACA;EACjB,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,9 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IGroupEntity } from "./types.js";
3
3
  interface Params {
4
- table: Table;
4
+ table: ITable;
5
5
  entityName: string;
6
- attributes: Attributes;
7
6
  }
8
- export declare const createGroupEntity: (params: Params) => Entity<any>;
7
+ export declare const createGroupEntity: (params: Params) => IGroupEntity;
9
8
  export {};
@@ -1,70 +1,13 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createGroupEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
- const createGroupEntity = params => {
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ export const createGroupEntity = params => {
15
3
  const {
16
4
  table,
17
- attributes,
18
5
  entityName
19
6
  } = params;
20
- return new _dynamodbToolbox.Entity({
21
- name: entityName,
22
- table,
23
- attributes: (0, _objectSpread2.default)({
24
- PK: {
25
- partitionKey: true
26
- },
27
- SK: {
28
- sortKey: true
29
- },
30
- TYPE: {
31
- type: "string"
32
- },
33
- webinyVersion: {
34
- type: "string"
35
- },
36
- id: {
37
- type: "string"
38
- },
39
- name: {
40
- type: "string"
41
- },
42
- slug: {
43
- type: "string"
44
- },
45
- locale: {
46
- type: "string"
47
- },
48
- description: {
49
- type: "string"
50
- },
51
- icon: {
52
- type: "string"
53
- },
54
- createdBy: {
55
- type: "map"
56
- },
57
- createdOn: {
58
- type: "string"
59
- },
60
- savedOn: {
61
- type: "string"
62
- },
63
- tenant: {
64
- type: "string"
65
- }
66
- }, attributes || {})
7
+ return createStandardEntity({
8
+ table: table.table,
9
+ name: entityName
67
10
  });
68
11
  };
69
12
 
70
- exports.createGroupEntity = createGroupEntity;
13
+ //# sourceMappingURL=group.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createGroupEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","webinyVersion","id","slug","locale","description","icon","createdBy","createdOn","savedOn","tenant"],"sources":["group.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\nexport const createGroupEntity = (params: Params): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\"\n },\n webinyVersion: {\n type: \"string\"\n },\n id: {\n type: \"string\"\n },\n name: {\n type: \"string\"\n },\n slug: {\n type: \"string\"\n },\n locale: {\n type: \"string\"\n },\n description: {\n type: \"string\"\n },\n icon: {\n type: \"string\"\n },\n\n createdBy: {\n type: \"map\"\n },\n createdOn: {\n type: \"string\"\n },\n savedOn: {\n type: \"string\"\n },\n tenant: {\n type: \"string\"\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAQO,MAAMA,iBAAiB,GAAIC,MAAD,IAAiC;EAC9D,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEF,UADQ;IAEdF,KAFc;IAGdC,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,IAAI,EAAE;QACFC,IAAI,EAAE;MADJ,CAPA;MAUNC,aAAa,EAAE;QACXD,IAAI,EAAE;MADK,CAVT;MAaNE,EAAE,EAAE;QACAF,IAAI,EAAE;MADN,CAbE;MAgBNN,IAAI,EAAE;QACFM,IAAI,EAAE;MADJ,CAhBA;MAmBNG,IAAI,EAAE;QACFH,IAAI,EAAE;MADJ,CAnBA;MAsBNI,MAAM,EAAE;QACJJ,IAAI,EAAE;MADF,CAtBF;MAyBNK,WAAW,EAAE;QACTL,IAAI,EAAE;MADG,CAzBP;MA4BNM,IAAI,EAAE;QACFN,IAAI,EAAE;MADJ,CA5BA;MAgCNO,SAAS,EAAE;QACPP,IAAI,EAAE;MADC,CAhCL;MAmCNQ,SAAS,EAAE;QACPR,IAAI,EAAE;MADC,CAnCL;MAsCNS,OAAO,EAAE;QACLT,IAAI,EAAE;MADD,CAtCH;MAyCNU,MAAM,EAAE;QACJV,IAAI,EAAE;MADF;IAzCF,GA4CFT,UAAU,IAAI,EA5CZ;EAHI,CAAX,CAAP;AAkDH,CApDM"}
1
+ {"version":3,"names":["createStandardEntity","createGroupEntity","params","table","entityName","name"],"sources":["group.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IGroupEntity } from \"./types.js\";\nimport type { CmsGroup } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createGroupEntity = (params: Params): IGroupEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsGroup>({\n table: table.table,\n name: entityName\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AASvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAW;IAClCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,9 +1,8 @@
1
- import { Entity, Table } from "dynamodb-toolbox";
2
- import { Attributes } from "../types";
1
+ import { type ITable } from "@webiny/db-dynamodb";
2
+ import type { IModelEntity } from "./types.js";
3
3
  interface Params {
4
- table: Table;
4
+ table: ITable;
5
5
  entityName: string;
6
- attributes: Attributes;
7
6
  }
8
- export declare const createModelEntity: (params: Params) => Entity<any>;
7
+ export declare const createModelEntity: (params: Params) => IModelEntity;
9
8
  export {};
@@ -1,92 +1,13 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
-
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.createModelEntity = void 0;
9
-
10
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
11
-
12
- var _dynamodbToolbox = require("dynamodb-toolbox");
13
-
14
- const createModelEntity = params => {
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ export const createModelEntity = params => {
15
3
  const {
16
4
  table,
17
- attributes,
18
5
  entityName
19
6
  } = params;
20
- return new _dynamodbToolbox.Entity({
21
- name: entityName,
22
- table,
23
- attributes: (0, _objectSpread2.default)({
24
- PK: {
25
- partitionKey: true
26
- },
27
- SK: {
28
- sortKey: true
29
- },
30
- TYPE: {
31
- type: "string",
32
- required: true
33
- },
34
- webinyVersion: {
35
- type: "string",
36
- required: true
37
- },
38
- name: {
39
- type: "string",
40
- required: true
41
- },
42
- modelId: {
43
- type: "string",
44
- required: true
45
- },
46
- locale: {
47
- type: "string",
48
- required: true
49
- },
50
- group: {
51
- type: "map",
52
- required: true
53
- },
54
- description: {
55
- type: "string"
56
- },
57
- createdOn: {
58
- type: "string",
59
- required: true
60
- },
61
- savedOn: {
62
- type: "string",
63
- required: true
64
- },
65
- createdBy: {
66
- type: "map",
67
- required: true
68
- },
69
- fields: {
70
- type: "list",
71
- required: true
72
- },
73
- layout: {
74
- type: "list",
75
- required: true
76
- },
77
- lockedFields: {
78
- type: "list",
79
- required: true
80
- },
81
- titleFieldId: {
82
- type: "string"
83
- },
84
- tenant: {
85
- type: "string",
86
- required: true
87
- }
88
- }, attributes || {})
7
+ return createStandardEntity({
8
+ table: table.table,
9
+ name: entityName
89
10
  });
90
11
  };
91
12
 
92
- exports.createModelEntity = createModelEntity;
13
+ //# sourceMappingURL=model.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createModelEntity","params","table","attributes","entityName","Entity","name","PK","partitionKey","SK","sortKey","TYPE","type","required","webinyVersion","modelId","locale","group","description","createdOn","savedOn","createdBy","fields","layout","lockedFields","titleFieldId","tenant"],"sources":["model.ts"],"sourcesContent":["import { Entity, Table } from \"dynamodb-toolbox\";\nimport { Attributes } from \"~/types\";\n\ninterface Params {\n table: Table;\n entityName: string;\n attributes: Attributes;\n}\n\nexport const createModelEntity = (params: Params): Entity<any> => {\n const { table, attributes, entityName } = params;\n return new Entity({\n name: entityName,\n table,\n attributes: {\n PK: {\n partitionKey: true\n },\n SK: {\n sortKey: true\n },\n TYPE: {\n type: \"string\",\n required: true\n },\n webinyVersion: {\n type: \"string\",\n required: true\n },\n name: {\n type: \"string\",\n required: true\n },\n modelId: {\n type: \"string\",\n required: true\n },\n locale: {\n type: \"string\",\n required: true\n },\n group: {\n type: \"map\",\n required: true\n },\n description: {\n type: \"string\"\n },\n createdOn: {\n type: \"string\",\n required: true\n },\n savedOn: {\n type: \"string\",\n required: true\n },\n createdBy: {\n type: \"map\",\n required: true\n },\n fields: {\n type: \"list\",\n required: true\n },\n layout: {\n type: \"list\",\n required: true\n },\n lockedFields: {\n type: \"list\",\n required: true\n },\n titleFieldId: {\n type: \"string\"\n },\n tenant: {\n type: \"string\",\n required: true\n },\n ...(attributes || {})\n }\n });\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AASO,MAAMA,iBAAiB,GAAIC,MAAD,IAAiC;EAC9D,MAAM;IAAEC,KAAF;IAASC,UAAT;IAAqBC;EAArB,IAAoCH,MAA1C;EACA,OAAO,IAAII,uBAAJ,CAAW;IACdC,IAAI,EAAEF,UADQ;IAEdF,KAFc;IAGdC,UAAU;MACNI,EAAE,EAAE;QACAC,YAAY,EAAE;MADd,CADE;MAINC,EAAE,EAAE;QACAC,OAAO,EAAE;MADT,CAJE;MAONC,IAAI,EAAE;QACFC,IAAI,EAAE,QADJ;QAEFC,QAAQ,EAAE;MAFR,CAPA;MAWNC,aAAa,EAAE;QACXF,IAAI,EAAE,QADK;QAEXC,QAAQ,EAAE;MAFC,CAXT;MAeNP,IAAI,EAAE;QACFM,IAAI,EAAE,QADJ;QAEFC,QAAQ,EAAE;MAFR,CAfA;MAmBNE,OAAO,EAAE;QACLH,IAAI,EAAE,QADD;QAELC,QAAQ,EAAE;MAFL,CAnBH;MAuBNG,MAAM,EAAE;QACJJ,IAAI,EAAE,QADF;QAEJC,QAAQ,EAAE;MAFN,CAvBF;MA2BNI,KAAK,EAAE;QACHL,IAAI,EAAE,KADH;QAEHC,QAAQ,EAAE;MAFP,CA3BD;MA+BNK,WAAW,EAAE;QACTN,IAAI,EAAE;MADG,CA/BP;MAkCNO,SAAS,EAAE;QACPP,IAAI,EAAE,QADC;QAEPC,QAAQ,EAAE;MAFH,CAlCL;MAsCNO,OAAO,EAAE;QACLR,IAAI,EAAE,QADD;QAELC,QAAQ,EAAE;MAFL,CAtCH;MA0CNQ,SAAS,EAAE;QACPT,IAAI,EAAE,KADC;QAEPC,QAAQ,EAAE;MAFH,CA1CL;MA8CNS,MAAM,EAAE;QACJV,IAAI,EAAE,MADF;QAEJC,QAAQ,EAAE;MAFN,CA9CF;MAkDNU,MAAM,EAAE;QACJX,IAAI,EAAE,MADF;QAEJC,QAAQ,EAAE;MAFN,CAlDF;MAsDNW,YAAY,EAAE;QACVZ,IAAI,EAAE,MADI;QAEVC,QAAQ,EAAE;MAFA,CAtDR;MA0DNY,YAAY,EAAE;QACVb,IAAI,EAAE;MADI,CA1DR;MA6DNc,MAAM,EAAE;QACJd,IAAI,EAAE,QADF;QAEJC,QAAQ,EAAE;MAFN;IA7DF,GAiEFV,UAAU,IAAI,EAjEZ;EAHI,CAAX,CAAP;AAuEH,CAzEM"}
1
+ {"version":3,"names":["createStandardEntity","createModelEntity","params","table","entityName","name"],"sources":["model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"./types.js\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types/index.js\";\n\ninterface Params {\n table: ITable;\n entityName: string;\n}\n\nexport const createModelEntity = (params: Params): IModelEntity => {\n const { table, entityName } = params;\n return createStandardEntity<CmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAqB,qBAAqB;AASvE,OAAO,MAAMC,iBAAiB,GAAIC,MAAc,IAAmB;EAC/D,MAAM;IAAEC,KAAK;IAAEC;EAAW,CAAC,GAAGF,MAAM;EACpC,OAAOF,oBAAoB,CAAW;IAClCG,KAAK,EAAEA,KAAK,CAACA,KAAK;IAClBE,IAAI,EAAED;EACV,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,9 +1,7 @@
1
- import { TableModifier } from "../types";
2
- import { DocumentClient } from "aws-sdk/clients/dynamodb";
3
- import { Table } from "dynamodb-toolbox";
1
+ import type { DynamoDBDocument } from "@webiny/aws-sdk/client-dynamodb/index.js";
4
2
  interface Params {
5
- table?: TableModifier;
6
- documentClient: DocumentClient;
3
+ name?: string;
4
+ documentClient: DynamoDBDocument;
7
5
  }
8
- export declare const createTable: ({ table, documentClient }: Params) => Table;
6
+ export declare const createTable: (params: Params) => import("@webiny/db-dynamodb").ITable<string, "PK", "SK">;
9
7
  export {};
@@ -1,30 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.createTable = void 0;
7
-
8
- var _dynamodbToolbox = require("dynamodb-toolbox");
9
-
10
- const createTable = ({
11
- table,
12
- documentClient
13
- }) => {
14
- const tableConfig = {
15
- name: process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
16
- partitionKey: "PK",
17
- sortKey: "SK",
18
- DocumentClient: documentClient,
19
- indexes: {
20
- GSI1: {
21
- partitionKey: "GSI1_PK",
22
- sortKey: "GSI1_SK"
23
- }
24
- }
25
- };
26
- const config = typeof table === "function" ? table(tableConfig) : tableConfig;
27
- return new _dynamodbToolbox.Table(config);
1
+ import { createTable as baseCreateTable } from "@webiny/db-dynamodb";
2
+ export const createTable = params => {
3
+ return baseCreateTable({
4
+ name: params.name || process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
5
+ documentClient: params.documentClient
6
+ });
28
7
  };
29
8
 
30
- exports.createTable = createTable;
9
+ //# sourceMappingURL=table.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createTable","table","documentClient","tableConfig","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","partitionKey","sortKey","DocumentClient","indexes","GSI1","config","Table"],"sources":["table.ts"],"sourcesContent":["import { TableModifier } from \"~/types\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Table } from \"dynamodb-toolbox\";\nimport { TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\n\ninterface Params {\n table?: TableModifier;\n documentClient: DocumentClient;\n}\nexport const createTable = ({ table, documentClient }: Params): Table => {\n const tableConfig: TableConstructor = {\n name: process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n partitionKey: \"PK\",\n sortKey: \"SK\",\n DocumentClient: documentClient,\n indexes: {\n GSI1: {\n partitionKey: \"GSI1_PK\",\n sortKey: \"GSI1_SK\"\n }\n }\n };\n\n const config = typeof table === \"function\" ? table(tableConfig) : tableConfig;\n\n return new Table(config);\n};\n"],"mappings":";;;;;;;AAEA;;AAOO,MAAMA,WAAW,GAAG,CAAC;EAAEC,KAAF;EAASC;AAAT,CAAD,KAA8C;EACrE,MAAMC,WAA6B,GAAG;IAClCC,IAAI,EAAEC,OAAO,CAACC,GAAR,CAAYC,qBAAZ,IAAsCF,OAAO,CAACC,GAAR,CAAYE,QADtB;IAElCC,YAAY,EAAE,IAFoB;IAGlCC,OAAO,EAAE,IAHyB;IAIlCC,cAAc,EAAET,cAJkB;IAKlCU,OAAO,EAAE;MACLC,IAAI,EAAE;QACFJ,YAAY,EAAE,SADZ;QAEFC,OAAO,EAAE;MAFP;IADD;EALyB,CAAtC;EAaA,MAAMI,MAAM,GAAG,OAAOb,KAAP,KAAiB,UAAjB,GAA8BA,KAAK,CAACE,WAAD,CAAnC,GAAmDA,WAAlE;EAEA,OAAO,IAAIY,sBAAJ,CAAUD,MAAV,CAAP;AACH,CAjBM"}
1
+ {"version":3,"names":["createTable","baseCreateTable","params","name","process","env","DB_TABLE_HEADLESS_CMS","DB_TABLE","documentClient"],"sources":["table.ts"],"sourcesContent":["import { createTable as baseCreateTable } from \"@webiny/db-dynamodb\";\nimport type { DynamoDBDocument } from \"@webiny/aws-sdk/client-dynamodb/index.js\";\n\ninterface Params {\n name?: string;\n documentClient: DynamoDBDocument;\n}\n\nexport const createTable = (params: Params) => {\n return baseCreateTable({\n name: params.name || process.env.DB_TABLE_HEADLESS_CMS || (process.env.DB_TABLE as string),\n documentClient: params.documentClient\n });\n};\n"],"mappings":"AAAA,SAASA,WAAW,IAAIC,eAAe,QAAQ,qBAAqB;AAQpE,OAAO,MAAMD,WAAW,GAAIE,MAAc,IAAK;EAC3C,OAAOD,eAAe,CAAC;IACnBE,IAAI,EAAED,MAAM,CAACC,IAAI,IAAIC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAKF,OAAO,CAACC,GAAG,CAACE,QAAmB;IAC1FC,cAAc,EAAEN,MAAM,CAACM;EAC3B,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -0,0 +1,59 @@
1
+ import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
2
+ import type { GenericRecord } from "@webiny/api/types.js";
3
+ import type { CmsEntryStatus, CmsGroup, CmsIdentity, CmsModel, ICmsEntryLocation, IEntryState } from "@webiny/api-headless-cms/types/index.js";
4
+ export interface IEntryEntityAttirbutesData {
5
+ id: string;
6
+ entryId: string;
7
+ modelId: string;
8
+ tenant: string;
9
+ /**
10
+ * Revision-level meta fields. 👇
11
+ */
12
+ revisionCreatedOn: string;
13
+ revisionModifiedOn: string | null;
14
+ revisionSavedOn: string;
15
+ revisionDeletedOn: string | null;
16
+ revisionRestoredOn: string | null;
17
+ revisionFirstPublishedOn: string | null;
18
+ revisionLastPublishedOn: string | null;
19
+ revisionCreatedBy: CmsIdentity;
20
+ revisionModifiedBy: CmsIdentity | null;
21
+ revisionSavedBy: CmsIdentity;
22
+ revisionDeletedBy: CmsIdentity | null;
23
+ revisionRestoredBy: CmsIdentity | null;
24
+ revisionFirstPublishedBy: CmsIdentity | null;
25
+ revisionLastPublishedBy: CmsIdentity | null;
26
+ /**
27
+ * Entry-level meta fields. 👇
28
+ */
29
+ createdOn: string;
30
+ modifiedOn: string | null;
31
+ savedOn: string;
32
+ deletedOn: string | null;
33
+ restoredOn: string | null;
34
+ firstPublishedOn: string | null;
35
+ lastPublishedOn: string | null;
36
+ createdBy: CmsIdentity;
37
+ modifiedBy: CmsIdentity | null;
38
+ savedBy: CmsIdentity;
39
+ deletedBy: CmsIdentity | null;
40
+ restoredBy: CmsIdentity | null;
41
+ firstPublishedBy: CmsIdentity | null;
42
+ lastPublishedBy: CmsIdentity | null;
43
+ /**
44
+ * The rest. 👇
45
+ */
46
+ version: number;
47
+ locked: boolean;
48
+ status: CmsEntryStatus;
49
+ location?: ICmsEntryLocation;
50
+ wbyDeleted?: boolean | null;
51
+ binOriginalFolderId?: string;
52
+ values: GenericRecord;
53
+ meta?: GenericRecord;
54
+ state?: IEntryState;
55
+ }
56
+ export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttirbutesData>;
57
+ export type IModelEntity = IEntity<IStandardEntityAttributes<CmsModel>>;
58
+ export type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;
59
+ export type IEntryEntity = IEntity<IEntryEntityAttributes>;
@@ -0,0 +1,3 @@
1
+ export {};
2
+
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
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,2 +1,2 @@
1
- declare const _default: () => (import("@webiny/api-headless-cms").StorageTransformPlugin<any, any> | import("..").CmsEntryFieldFilterPathPlugin | import("../types").CmsFieldFilterValueTransformPlugin)[];
1
+ declare const _default: () => (import("@webiny/api-headless-cms/index.js").StorageTransformPlugin<any, any, import("@webiny/api-headless-cms/types/modelField.js").CmsModelField> | import("../index.js").CmsEntryFieldFilterPathPlugin | import("../types.js").CmsFieldFilterValueTransformPlugin)[];
2
2
  export default _default;
package/dynamoDb/index.js CHANGED
@@ -1,20 +1,8 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _richText = require("./storage/richText");
9
-
10
- var _longText = require("./storage/longText");
11
-
12
- var _date = require("./storage/date");
13
-
14
- var _plainObject = require("./path/plainObject");
15
-
16
- var _datetime = require("./transformValue/datetime");
17
-
18
- var _default = () => [(0, _richText.createRichTextStorageTransformPlugin)(), (0, _longText.createLongTextStorageTransformPlugin)(), (0, _date.createDateStorageTransformPlugin)(), (0, _plainObject.createPlainObjectPathPlugin)(), (0, _datetime.createDatetimeTransformValuePlugin)()];
19
-
20
- exports.default = _default;
1
+ import { createRichTextStorageTransformPlugin } from "./storage/richText.js";
2
+ import { createLongTextStorageTransformPlugin } from "./storage/longText.js";
3
+ import { createPlainObjectPathPlugin } from "./path/plainObject.js";
4
+ import { createDatetimeTransformValuePlugin } from "./transformValue/datetime.js";
5
+ import { createLocationFolderIdPathPlugin } from "./path/locationFolderId.js";
6
+ export default () => [createRichTextStorageTransformPlugin(), createLongTextStorageTransformPlugin(), createPlainObjectPathPlugin(), createLocationFolderIdPathPlugin(), createDatetimeTransformValuePlugin()];
7
+
8
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createDateStorageTransformPlugin","createPlainObjectPathPlugin","createDatetimeTransformValuePlugin"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText\";\nimport { createDateStorageTransformPlugin } from \"./storage/date\";\nimport { createPlainObjectPathPlugin } from \"./path/plainObject\";\nimport { createDatetimeTransformValuePlugin } from \"./transformValue/datetime\";\n\nexport default () => [\n createRichTextStorageTransformPlugin(),\n createLongTextStorageTransformPlugin(),\n createDateStorageTransformPlugin(),\n createPlainObjectPathPlugin(),\n createDatetimeTransformValuePlugin()\n];\n"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;eAEe,MAAM,CACjB,IAAAA,8CAAA,GADiB,EAEjB,IAAAC,8CAAA,GAFiB,EAGjB,IAAAC,sCAAA,GAHiB,EAIjB,IAAAC,wCAAA,GAJiB,EAKjB,IAAAC,4CAAA,GALiB,C"}
1
+ {"version":3,"names":["createRichTextStorageTransformPlugin","createLongTextStorageTransformPlugin","createPlainObjectPathPlugin","createDatetimeTransformValuePlugin","createLocationFolderIdPathPlugin"],"sources":["index.ts"],"sourcesContent":["import { createRichTextStorageTransformPlugin } from \"./storage/richText.js\";\nimport { createLongTextStorageTransformPlugin } from \"./storage/longText.js\";\nimport { createPlainObjectPathPlugin } from \"./path/plainObject.js\";\nimport { createDatetimeTransformValuePlugin } from \"./transformValue/datetime.js\";\nimport { createLocationFolderIdPathPlugin } from \"~/dynamoDb/path/locationFolderId.js\";\n\nexport default () => [\n createRichTextStorageTransformPlugin(),\n createLongTextStorageTransformPlugin(),\n createPlainObjectPathPlugin(),\n createLocationFolderIdPathPlugin(),\n createDatetimeTransformValuePlugin()\n];\n"],"mappings":"AAAA,SAASA,oCAAoC;AAC7C,SAASC,oCAAoC;AAC7C,SAASC,2BAA2B;AACpC,SAASC,kCAAkC;AAC3C,SAASC,gCAAgC;AAEzC,eAAe,MAAM,CACjBJ,oCAAoC,CAAC,CAAC,EACtCC,oCAAoC,CAAC,CAAC,EACtCC,2BAA2B,CAAC,CAAC,EAC7BE,gCAAgC,CAAC,CAAC,EAClCD,kCAAkC,CAAC,CAAC,CACvC","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
2
+ export declare const createLocationFolderIdPathPlugin: () => CmsEntryFieldFilterPathPlugin;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * File is @internal
3
+ */
4
+ import WebinyError from "@webiny/error";
5
+ import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
6
+ const createPath = ({
7
+ field
8
+ }) => {
9
+ const {
10
+ path
11
+ } = field.settings || {};
12
+ if (!path) {
13
+ throw new WebinyError("Missing path settings value.", "FIELD_SETTINGS_ERROR", {
14
+ field
15
+ });
16
+ }
17
+ return path;
18
+ };
19
+ export const createLocationFolderIdPathPlugin = () => {
20
+ return new CmsEntryFieldFilterPathPlugin({
21
+ fieldType: "text",
22
+ path: createPath,
23
+ canUse: (field, parents) => {
24
+ if (field.fieldId !== "folderId") {
25
+ return false;
26
+ } else if (!parents?.length) {
27
+ return false;
28
+ }
29
+ return parents[0] === "wbyAco_location";
30
+ }
31
+ });
32
+ };
33
+
34
+ //# sourceMappingURL=locationFolderId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["WebinyError","CmsEntryFieldFilterPathPlugin","createPath","field","path","settings","createLocationFolderIdPathPlugin","fieldType","canUse","parents","fieldId","length"],"sources":["locationFolderId.ts"],"sourcesContent":["/**\n * File is @internal\n */\nimport WebinyError from \"@webiny/error\";\nimport type { CreatePathCallable } from \"~/plugins/CmsEntryFieldFilterPathPlugin.js\";\nimport { CmsEntryFieldFilterPathPlugin } from \"~/plugins/CmsEntryFieldFilterPathPlugin.js\";\n\nconst createPath: CreatePathCallable = ({ field }) => {\n const { path } = field.settings || {};\n if (!path) {\n throw new WebinyError(\"Missing path settings value.\", \"FIELD_SETTINGS_ERROR\", {\n field\n });\n }\n return path;\n};\n\nexport const createLocationFolderIdPathPlugin = (): CmsEntryFieldFilterPathPlugin => {\n return new CmsEntryFieldFilterPathPlugin({\n fieldType: \"text\",\n path: createPath,\n canUse: (field, parents) => {\n if (field.fieldId !== \"folderId\") {\n return false;\n } else if (!parents?.length) {\n return false;\n }\n return parents[0] === \"wbyAco_location\";\n }\n });\n};\n"],"mappings":"AAAA;AACA;AACA;AACA,OAAOA,WAAW,MAAM,eAAe;AAEvC,SAASC,6BAA6B;AAEtC,MAAMC,UAA8B,GAAGA,CAAC;EAAEC;AAAM,CAAC,KAAK;EAClD,MAAM;IAAEC;EAAK,CAAC,GAAGD,KAAK,CAACE,QAAQ,IAAI,CAAC,CAAC;EACrC,IAAI,CAACD,IAAI,EAAE;IACP,MAAM,IAAIJ,WAAW,CAAC,8BAA8B,EAAE,sBAAsB,EAAE;MAC1EG;IACJ,CAAC,CAAC;EACN;EACA,OAAOC,IAAI;AACf,CAAC;AAED,OAAO,MAAME,gCAAgC,GAAGA,CAAA,KAAqC;EACjF,OAAO,IAAIL,6BAA6B,CAAC;IACrCM,SAAS,EAAE,MAAM;IACjBH,IAAI,EAAEF,UAAU;IAChBM,MAAM,EAAEA,CAACL,KAAK,EAAEM,OAAO,KAAK;MACxB,IAAIN,KAAK,CAACO,OAAO,KAAK,UAAU,EAAE;QAC9B,OAAO,KAAK;MAChB,CAAC,MAAM,IAAI,CAACD,OAAO,EAAEE,MAAM,EAAE;QACzB,OAAO,KAAK;MAChB;MACA,OAAOF,OAAO,CAAC,CAAC,CAAC,KAAK,iBAAiB;IAC3C;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin";
1
+ import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
2
2
  export declare const createPlainObjectPathPlugin: () => CmsEntryFieldFilterPathPlugin;