@webiny/api-headless-cms-ddb 0.0.0-unstable.78f581c1d2 → 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 (172) hide show
  1. package/README.md +6 -20
  2. package/definitions/entry.d.ts +4 -5
  3. package/definitions/entry.js +9 -94
  4. package/definitions/entry.js.map +1 -1
  5. package/definitions/group.d.ts +4 -5
  6. package/definitions/group.js +9 -68
  7. package/definitions/group.js.map +1 -1
  8. package/definitions/model.d.ts +4 -5
  9. package/definitions/model.js +9 -90
  10. package/definitions/model.js.map +1 -1
  11. package/definitions/table.d.ts +4 -6
  12. package/definitions/table.js +8 -30
  13. package/definitions/table.js.map +1 -1
  14. package/definitions/types.d.ts +65 -0
  15. package/definitions/types.js +0 -0
  16. package/dynamoDb/index.d.ts +1 -1
  17. package/dynamoDb/index.js +11 -20
  18. package/dynamoDb/index.js.map +1 -1
  19. package/dynamoDb/path/locationFolderId.d.ts +2 -0
  20. package/dynamoDb/path/locationFolderId.js +21 -0
  21. package/dynamoDb/path/locationFolderId.js.map +1 -0
  22. package/dynamoDb/path/plainObject.d.ts +1 -1
  23. package/dynamoDb/path/plainObject.js +13 -37
  24. package/dynamoDb/path/plainObject.js.map +1 -1
  25. package/dynamoDb/transformValue/datetime.d.ts +1 -1
  26. package/dynamoDb/transformValue/datetime.js +27 -50
  27. package/dynamoDb/transformValue/datetime.js.map +1 -1
  28. package/index.d.ts +2 -3
  29. package/index.js +83 -139
  30. package/index.js.map +1 -1
  31. package/operations/entry/dataLoader/DataLoaderCache.d.ts +16 -0
  32. package/operations/entry/dataLoader/DataLoaderCache.js +27 -0
  33. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
  34. package/operations/entry/dataLoader/constants.d.ts +1 -0
  35. package/operations/entry/dataLoader/constants.js +5 -0
  36. package/operations/entry/dataLoader/constants.js.map +1 -0
  37. package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
  38. package/operations/entry/dataLoader/createBatchScheduleFn.js +10 -0
  39. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
  40. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
  41. package/operations/entry/dataLoader/getAllEntryRevisions.js +24 -0
  42. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
  43. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
  44. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +40 -0
  45. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
  46. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
  47. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +40 -0
  48. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
  49. package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
  50. package/operations/entry/dataLoader/getRevisionById.js +42 -0
  51. package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
  52. package/operations/entry/dataLoader/index.d.ts +8 -0
  53. package/operations/entry/dataLoader/index.js +18 -0
  54. package/operations/entry/dataLoader/index.js.map +1 -0
  55. package/operations/entry/dataLoader/types.d.ts +6 -0
  56. package/operations/entry/dataLoader/types.js +0 -0
  57. package/operations/entry/dataLoaders.d.ts +14 -30
  58. package/operations/entry/dataLoaders.js +83 -314
  59. package/operations/entry/dataLoaders.js.map +1 -1
  60. package/operations/entry/filtering/createExpressions.d.ts +27 -0
  61. package/operations/entry/filtering/createExpressions.js +124 -0
  62. package/operations/entry/filtering/createExpressions.js.map +1 -0
  63. package/operations/entry/filtering/createFields.d.ts +16 -0
  64. package/operations/entry/filtering/createFields.js +93 -0
  65. package/operations/entry/filtering/createFields.js.map +1 -0
  66. package/operations/entry/filtering/extractSort.d.ts +17 -0
  67. package/operations/entry/filtering/extractSort.js +60 -0
  68. package/operations/entry/filtering/extractSort.js.map +1 -0
  69. package/operations/entry/filtering/filter.d.ts +16 -0
  70. package/operations/entry/filtering/filter.js +85 -0
  71. package/operations/entry/filtering/filter.js.map +1 -0
  72. package/operations/entry/filtering/fullTextSearch.d.ts +14 -0
  73. package/operations/entry/filtering/fullTextSearch.js +25 -0
  74. package/operations/entry/filtering/fullTextSearch.js.map +1 -0
  75. package/operations/entry/filtering/getValue.d.ts +5 -0
  76. package/operations/entry/filtering/getValue.js +37 -0
  77. package/operations/entry/filtering/getValue.js.map +1 -0
  78. package/operations/entry/filtering/index.d.ts +2 -0
  79. package/operations/entry/filtering/index.js +2 -0
  80. package/operations/entry/filtering/mapPlugins.d.ts +8 -0
  81. package/operations/entry/filtering/mapPlugins.js +18 -0
  82. package/operations/entry/filtering/mapPlugins.js.map +1 -0
  83. package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +2 -0
  84. package/operations/entry/filtering/plugins/defaultFilterCreate.js +33 -0
  85. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -0
  86. package/operations/entry/filtering/plugins/index.d.ts +1 -0
  87. package/operations/entry/filtering/plugins/index.js +13 -0
  88. package/operations/entry/filtering/plugins/index.js.map +1 -0
  89. package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +2 -0
  90. package/operations/entry/filtering/plugins/objectFilterCreate.js +68 -0
  91. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -0
  92. package/operations/entry/filtering/plugins/refFilterCreate.d.ts +3 -0
  93. package/operations/entry/filtering/plugins/refFilterCreate.js +63 -0
  94. package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -0
  95. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +2 -0
  96. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +49 -0
  97. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +1 -0
  98. package/operations/entry/filtering/sort.d.ts +12 -0
  99. package/operations/entry/filtering/sort.js +41 -0
  100. package/operations/entry/filtering/sort.js.map +1 -0
  101. package/operations/entry/filtering/systemFields.d.ts +2 -0
  102. package/operations/entry/filtering/systemFields.js +149 -0
  103. package/operations/entry/filtering/systemFields.js.map +1 -0
  104. package/operations/entry/filtering/transform.d.ts +6 -0
  105. package/operations/entry/filtering/transform.js +7 -0
  106. package/operations/entry/filtering/transform.js.map +1 -0
  107. package/operations/entry/filtering/types.d.ts +40 -0
  108. package/operations/entry/filtering/types.js +0 -0
  109. package/operations/entry/filtering/values.d.ts +2 -0
  110. package/operations/entry/filtering/values.js +15 -0
  111. package/operations/entry/filtering/values.js.map +1 -0
  112. package/operations/entry/filtering/where.d.ts +5 -0
  113. package/operations/entry/filtering/where.js +22 -0
  114. package/operations/entry/filtering/where.js.map +1 -0
  115. package/operations/entry/index.d.ts +5 -4
  116. package/operations/entry/index.js +931 -845
  117. package/operations/entry/index.js.map +1 -1
  118. package/operations/entry/keys.d.ts +46 -2
  119. package/operations/entry/keys.js +53 -66
  120. package/operations/entry/keys.js.map +1 -1
  121. package/operations/group/index.d.ts +4 -5
  122. package/operations/group/index.js +116 -187
  123. package/operations/group/index.js.map +1 -1
  124. package/operations/model/index.d.ts +3 -3
  125. package/operations/model/index.js +102 -158
  126. package/operations/model/index.js.map +1 -1
  127. package/package.json +34 -33
  128. package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +5 -4
  129. package/plugins/CmsEntryFieldFilterPathPlugin.js +25 -50
  130. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
  131. package/plugins/CmsEntryFieldFilterPlugin.d.ts +43 -0
  132. package/plugins/CmsEntryFieldFilterPlugin.js +20 -0
  133. package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -0
  134. package/plugins/CmsEntryFieldSortingPlugin.d.ts +42 -0
  135. package/plugins/CmsEntryFieldSortingPlugin.js +20 -0
  136. package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -0
  137. package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +11 -0
  138. package/plugins/CmsFieldFilterValueTransformPlugin.js +19 -0
  139. package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -0
  140. package/plugins/index.d.ts +4 -1
  141. package/plugins/index.js +4 -18
  142. package/types.d.ts +28 -21
  143. package/types.js +8 -15
  144. package/types.js.map +1 -1
  145. package/definitions/settings.d.ts +0 -9
  146. package/definitions/settings.js +0 -58
  147. package/definitions/settings.js.map +0 -1
  148. package/definitions/system.d.ts +0 -9
  149. package/definitions/system.js +0 -46
  150. package/definitions/system.js.map +0 -1
  151. package/dynamoDb/storage/date.d.ts +0 -2
  152. package/dynamoDb/storage/date.js +0 -99
  153. package/dynamoDb/storage/date.js.map +0 -1
  154. package/dynamoDb/storage/longText.d.ts +0 -10
  155. package/dynamoDb/storage/longText.js +0 -101
  156. package/dynamoDb/storage/longText.js.map +0 -1
  157. package/dynamoDb/storage/richText.d.ts +0 -2
  158. package/dynamoDb/storage/richText.js +0 -113
  159. package/dynamoDb/storage/richText.js.map +0 -1
  160. package/operations/entry/systemFields.d.ts +0 -2
  161. package/operations/entry/systemFields.js +0 -74
  162. package/operations/entry/systemFields.js.map +0 -1
  163. package/operations/entry/utils.d.ts +0 -36
  164. package/operations/entry/utils.js +0 -680
  165. package/operations/entry/utils.js.map +0 -1
  166. package/operations/settings/index.d.ts +0 -7
  167. package/operations/settings/index.js +0 -135
  168. package/operations/settings/index.js.map +0 -1
  169. package/operations/system/index.d.ts +0 -7
  170. package/operations/system/index.js +0 -99
  171. package/operations/system/index.js.map +0 -1
  172. package/plugins/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,11 @@
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 => {
15
- const {
16
- table,
17
- entityName,
18
- attributes
19
- } = params;
20
- return new _dynamodbToolbox.Entity({
21
- 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 || {})
93
- });
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ const createEntryEntity = (params)=>{
3
+ const { table, entityName } = params;
4
+ return createStandardEntity({
5
+ name: entityName,
6
+ table: table.table
7
+ });
94
8
  };
9
+ export { createEntryEntity };
95
10
 
96
- exports.createEntryEntity = createEntryEntity;
11
+ //# 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,"file":"definitions/entry.js","sources":["../../src/definitions/entry.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IEntryEntity, IEntryEntityAttributesData } 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<IEntryEntityAttributesData>({\n name: entityName,\n table: table.table\n });\n};\n"],"names":["createEntryEntity","params","table","entityName","createStandardEntity"],"mappings":";AAQO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAAiD;QACpD,MAAMD;QACN,OAAOD,MAAM,KAAK;IACtB;AACJ"}
@@ -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,11 @@
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 => {
15
- const {
16
- table,
17
- attributes,
18
- entityName
19
- } = 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 || {})
67
- });
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ const createGroupEntity = (params)=>{
3
+ const { table, entityName } = params;
4
+ return createStandardEntity({
5
+ table: table.table,
6
+ name: entityName
7
+ });
68
8
  };
9
+ export { createGroupEntity };
69
10
 
70
- exports.createGroupEntity = createGroupEntity;
11
+ //# 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,"file":"definitions/group.js","sources":["../../src/definitions/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"],"names":["createGroupEntity","params","table","entityName","createStandardEntity"],"mappings":";AASO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAA+B;QAClC,OAAOF,MAAM,KAAK;QAClB,MAAMC;IACV;AACJ"}
@@ -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,11 @@
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 => {
15
- const {
16
- table,
17
- attributes,
18
- entityName
19
- } = 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 || {})
89
- });
1
+ import { createStandardEntity } from "@webiny/db-dynamodb";
2
+ const createModelEntity = (params)=>{
3
+ const { table, entityName } = params;
4
+ return createStandardEntity({
5
+ table: table.table,
6
+ name: entityName
7
+ });
90
8
  };
9
+ export { createModelEntity };
91
10
 
92
- exports.createModelEntity = createModelEntity;
11
+ //# 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,"file":"definitions/model.js","sources":["../../src/definitions/model.ts"],"sourcesContent":["import { createStandardEntity, type ITable } from \"@webiny/db-dynamodb\";\nimport type { IModelEntity } from \"./types.js\";\nimport type { StorageCmsModel } 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<StorageCmsModel>({\n table: table.table,\n name: entityName\n });\n};\n"],"names":["createModelEntity","params","table","entityName","createStandardEntity"],"mappings":";AASO,MAAMA,oBAAoB,CAACC;IAC9B,MAAM,EAAEC,KAAK,EAAEC,UAAU,EAAE,GAAGF;IAC9B,OAAOG,qBAAsC;QACzC,OAAOF,MAAM,KAAK;QAClB,MAAMC;IACV;AACJ"}
@@ -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,8 @@
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);
28
- };
29
-
30
- exports.createTable = createTable;
1
+ import { createTable } from "@webiny/db-dynamodb";
2
+ const table_createTable = (params)=>createTable({
3
+ name: params.name || process.env.DB_TABLE_HEADLESS_CMS || process.env.DB_TABLE,
4
+ documentClient: params.documentClient
5
+ });
6
+ export { table_createTable as createTable };
7
+
8
+ //# 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,"file":"definitions/table.js","sources":["../../src/definitions/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"],"names":["createTable","params","baseCreateTable","process"],"mappings":";AAQO,MAAMA,oBAAc,CAACC,SACjBC,YAAgB;QACnB,MAAMD,OAAO,IAAI,IAAIE,QAAQ,GAAG,CAAC,qBAAqB,IAAKA,QAAQ,GAAG,CAAC,QAAQ;QAC/E,gBAAgBF,OAAO,cAAc;IACzC"}
@@ -0,0 +1,65 @@
1
+ import type { IEntity, IStandardEntityAttributes } from "@webiny/db-dynamodb";
2
+ import type { GenericRecord } from "@webiny/api/types.js";
3
+ import type { CmsEntryStatus, CmsGroup, CmsIdentity, ICmsEntryLive, ICmsEntryLocation, ICmsEntrySystem, StorageCmsModel } from "@webiny/api-headless-cms/types/index.js";
4
+ export interface IEntryEntityAttributesData {
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
+ system?: ICmsEntrySystem;
55
+ live: ICmsEntryLive | null;
56
+ revisionDescription: string | undefined;
57
+ /**
58
+ * A timestamp of when the entry should be automatically deleted from the database.
59
+ */
60
+ expiresAt: number | null;
61
+ }
62
+ export type IEntryEntityAttributes = IStandardEntityAttributes<IEntryEntityAttributesData>;
63
+ export type IModelEntity = IEntity<IStandardEntityAttributes<StorageCmsModel>>;
64
+ export type IGroupEntity = IEntity<IStandardEntityAttributes<CmsGroup>>;
65
+ export type IEntryEntity = IEntity<IEntryEntityAttributes>;
File without changes
@@ -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("../index.js").CmsEntryFieldFilterPathPlugin | import("../types.js").CmsFieldFilterValueTransformPlugin)[];
2
2
  export default _default;
package/dynamoDb/index.js CHANGED
@@ -1,20 +1,11 @@
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 { createPlainObjectPathPlugin } from "./path/plainObject.js";
2
+ import { createDatetimeTransformValuePlugin } from "./transformValue/datetime.js";
3
+ import { createLocationFolderIdPathPlugin } from "./path/locationFolderId.js";
4
+ const dynamoDb = ()=>[
5
+ createPlainObjectPathPlugin(),
6
+ createLocationFolderIdPathPlugin(),
7
+ createDatetimeTransformValuePlugin()
8
+ ];
9
+ export default dynamoDb;
10
+
11
+ //# 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,"file":"dynamoDb/index.js","sources":["../../src/dynamoDb/index.ts"],"sourcesContent":["import { createPlainObjectPathPlugin } from \"./path/plainObject.js\";\nimport { createDatetimeTransformValuePlugin } from \"./transformValue/datetime.js\";\nimport { createLocationFolderIdPathPlugin } from \"~/dynamoDb/path/locationFolderId.js\";\n\nexport default () => [\n createPlainObjectPathPlugin(),\n createLocationFolderIdPathPlugin(),\n createDatetimeTransformValuePlugin()\n];\n"],"names":["createPlainObjectPathPlugin","createLocationFolderIdPathPlugin","createDatetimeTransformValuePlugin"],"mappings":";;;AAIA,iBAAgB,IAAK;QACjBA;QACAC;QACAC;KACJ"}
@@ -0,0 +1,2 @@
1
+ import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
2
+ export declare const createLocationFolderIdPathPlugin: () => CmsEntryFieldFilterPathPlugin;
@@ -0,0 +1,21 @@
1
+ import error from "@webiny/error";
2
+ import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
3
+ const createPath = ({ field })=>{
4
+ const { path } = field.settings || {};
5
+ if (!path) throw new error("Missing path settings value.", "FIELD_SETTINGS_ERROR", {
6
+ field
7
+ });
8
+ return path;
9
+ };
10
+ const createLocationFolderIdPathPlugin = ()=>new CmsEntryFieldFilterPathPlugin({
11
+ fieldType: "text",
12
+ path: createPath,
13
+ canUse: (field, parents)=>{
14
+ if ("folderId" !== field.fieldId) return false;
15
+ if (!parents?.length) return false;
16
+ return "wbyAco_location" === parents[0];
17
+ }
18
+ });
19
+ export { createLocationFolderIdPathPlugin };
20
+
21
+ //# sourceMappingURL=locationFolderId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamoDb/path/locationFolderId.js","sources":["../../../src/dynamoDb/path/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"],"names":["createPath","field","path","WebinyError","createLocationFolderIdPathPlugin","CmsEntryFieldFilterPathPlugin","parents"],"mappings":";;AAOA,MAAMA,aAAiC,CAAC,EAAEC,KAAK,EAAE;IAC7C,MAAM,EAAEC,IAAI,EAAE,GAAGD,MAAM,QAAQ,IAAI,CAAC;IACpC,IAAI,CAACC,MACD,MAAM,IAAIC,MAAY,gCAAgC,wBAAwB;QAC1EF;IACJ;IAEJ,OAAOC;AACX;AAEO,MAAME,mCAAmC,IACrC,IAAIC,8BAA8B;QACrC,WAAW;QACX,MAAML;QACN,QAAQ,CAACC,OAAOK;YACZ,IAAIL,AAAkB,eAAlBA,MAAM,OAAO,EACb,OAAO;YACJ,IAAI,CAACK,SAAS,QACjB,OAAO;YAEX,OAAOA,AAAe,sBAAfA,OAAO,CAAC,EAAE;QACrB;IACJ"}
@@ -1,2 +1,2 @@
1
- import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin";
1
+ import { CmsEntryFieldFilterPathPlugin } from "../../plugins/CmsEntryFieldFilterPathPlugin.js";
2
2
  export declare const createPlainObjectPathPlugin: () => CmsEntryFieldFilterPathPlugin;