@webiny/api-headless-cms-ddb 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.9bd236cf5e

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 (154) hide show
  1. package/definitions/entry.d.ts +4 -3
  2. package/definitions/entry.js +104 -13
  3. package/definitions/entry.js.map +1 -1
  4. package/definitions/group.d.ts +4 -3
  5. package/definitions/group.js +9 -8
  6. package/definitions/group.js.map +1 -1
  7. package/definitions/model.d.ts +4 -3
  8. package/definitions/model.js +9 -8
  9. package/definitions/model.js.map +1 -1
  10. package/definitions/system.d.ts +4 -3
  11. package/definitions/system.js +9 -8
  12. package/definitions/system.js.map +1 -1
  13. package/definitions/table.d.ts +5 -5
  14. package/definitions/table.js +8 -4
  15. package/definitions/table.js.map +1 -1
  16. package/dynamoDb/index.js +4 -3
  17. package/dynamoDb/index.js.map +1 -1
  18. package/dynamoDb/path/locationFolderId.js +4 -2
  19. package/dynamoDb/path/locationFolderId.js.map +1 -1
  20. package/dynamoDb/path/plainObject.js +3 -1
  21. package/dynamoDb/path/plainObject.js.map +1 -1
  22. package/dynamoDb/storage/longText.js +4 -1
  23. package/dynamoDb/storage/longText.js.map +1 -1
  24. package/dynamoDb/storage/richText.js +24 -58
  25. package/dynamoDb/storage/richText.js.map +1 -1
  26. package/dynamoDb/transformValue/datetime.d.ts +1 -1
  27. package/dynamoDb/transformValue/datetime.js +3 -1
  28. package/dynamoDb/transformValue/datetime.js.map +1 -1
  29. package/index.d.ts +1 -1
  30. package/index.js +5 -12
  31. package/index.js.map +1 -1
  32. package/operations/entry/dataLoader/DataLoaderCache.d.ts +1 -1
  33. package/operations/entry/dataLoader/DataLoaderCache.js +7 -9
  34. package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
  35. package/operations/entry/dataLoader/constants.js +3 -2
  36. package/operations/entry/dataLoader/constants.js.map +1 -1
  37. package/operations/entry/dataLoader/createBatchScheduleFn.js +3 -1
  38. package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
  39. package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +2 -2
  40. package/operations/entry/dataLoader/getAllEntryRevisions.js +3 -1
  41. package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
  42. package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +2 -2
  43. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +5 -6
  44. package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
  45. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +2 -2
  46. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +5 -6
  47. package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
  48. package/operations/entry/dataLoader/getRevisionById.d.ts +2 -2
  49. package/operations/entry/dataLoader/getRevisionById.js +5 -6
  50. package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
  51. package/operations/entry/dataLoader/index.d.ts +3 -3
  52. package/operations/entry/dataLoader/index.js +3 -1
  53. package/operations/entry/dataLoader/index.js.map +1 -1
  54. package/operations/entry/dataLoader/types.d.ts +1 -1
  55. package/operations/entry/dataLoader/types.js +3 -1
  56. package/operations/entry/dataLoader/types.js.map +1 -1
  57. package/operations/entry/dataLoaders.d.ts +3 -3
  58. package/operations/entry/dataLoaders.js +15 -14
  59. package/operations/entry/dataLoaders.js.map +1 -1
  60. package/operations/entry/filtering/createExpressions.d.ts +4 -4
  61. package/operations/entry/filtering/createExpressions.js +3 -1
  62. package/operations/entry/filtering/createExpressions.js.map +1 -1
  63. package/operations/entry/filtering/createFields.d.ts +3 -3
  64. package/operations/entry/filtering/createFields.js +12 -9
  65. package/operations/entry/filtering/createFields.js.map +1 -1
  66. package/operations/entry/filtering/extractSort.d.ts +3 -3
  67. package/operations/entry/filtering/extractSort.js +3 -1
  68. package/operations/entry/filtering/extractSort.js.map +1 -1
  69. package/operations/entry/filtering/filter.d.ts +3 -3
  70. package/operations/entry/filtering/filter.js +24 -9
  71. package/operations/entry/filtering/filter.js.map +1 -1
  72. package/operations/entry/filtering/fullTextSearch.d.ts +3 -3
  73. package/operations/entry/filtering/fullTextSearch.js +3 -1
  74. package/operations/entry/filtering/fullTextSearch.js.map +1 -1
  75. package/operations/entry/filtering/getValue.js +6 -3
  76. package/operations/entry/filtering/getValue.js.map +1 -1
  77. package/operations/entry/filtering/index.js +3 -1
  78. package/operations/entry/filtering/index.js.map +1 -1
  79. package/operations/entry/filtering/mapPlugins.d.ts +2 -2
  80. package/operations/entry/filtering/mapPlugins.js +3 -1
  81. package/operations/entry/filtering/mapPlugins.js.map +1 -1
  82. package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +1 -1
  83. package/operations/entry/filtering/plugins/defaultFilterCreate.js +3 -1
  84. package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -1
  85. package/operations/entry/filtering/plugins/index.d.ts +1 -1
  86. package/operations/entry/filtering/plugins/index.js +5 -2
  87. package/operations/entry/filtering/plugins/index.js.map +1 -1
  88. package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +1 -1
  89. package/operations/entry/filtering/plugins/objectFilterCreate.js +3 -1
  90. package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -1
  91. package/operations/entry/filtering/plugins/refFilterCreate.d.ts +2 -1
  92. package/operations/entry/filtering/plugins/refFilterCreate.js +9 -2
  93. package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -1
  94. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +2 -0
  95. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +65 -0
  96. package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +1 -0
  97. package/operations/entry/filtering/sort.d.ts +3 -3
  98. package/operations/entry/filtering/sort.js +5 -3
  99. package/operations/entry/filtering/sort.js.map +1 -1
  100. package/operations/entry/filtering/systemFields.d.ts +2 -2
  101. package/operations/entry/filtering/systemFields.js +34 -32
  102. package/operations/entry/filtering/systemFields.js.map +1 -1
  103. package/operations/entry/filtering/transform.d.ts +1 -1
  104. package/operations/entry/filtering/transform.js +3 -1
  105. package/operations/entry/filtering/transform.js.map +1 -1
  106. package/operations/entry/filtering/types.d.ts +2 -2
  107. package/operations/entry/filtering/types.js +3 -1
  108. package/operations/entry/filtering/types.js.map +1 -1
  109. package/operations/entry/filtering/values.d.ts +1 -1
  110. package/operations/entry/filtering/values.js +3 -1
  111. package/operations/entry/filtering/values.js.map +1 -1
  112. package/operations/entry/filtering/where.js +3 -1
  113. package/operations/entry/filtering/where.js.map +1 -1
  114. package/operations/entry/index.d.ts +3 -3
  115. package/operations/entry/index.js +585 -197
  116. package/operations/entry/index.js.map +1 -1
  117. package/operations/entry/keys.js +3 -1
  118. package/operations/entry/keys.js.map +1 -1
  119. package/operations/group/index.d.ts +3 -3
  120. package/operations/group/index.js +33 -21
  121. package/operations/group/index.js.map +1 -1
  122. package/operations/model/index.d.ts +2 -2
  123. package/operations/model/index.js +26 -13
  124. package/operations/model/index.js.map +1 -1
  125. package/operations/system/index.d.ts +2 -2
  126. package/operations/system/index.js +19 -7
  127. package/operations/system/index.js.map +1 -1
  128. package/package.json +19 -24
  129. package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +1 -1
  130. package/plugins/CmsEntryFieldFilterPathPlugin.js +8 -3
  131. package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
  132. package/plugins/CmsEntryFieldFilterPlugin.d.ts +10 -10
  133. package/plugins/CmsEntryFieldFilterPlugin.js +9 -6
  134. package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -1
  135. package/plugins/CmsEntryFieldSortingPlugin.d.ts +2 -2
  136. package/plugins/CmsEntryFieldSortingPlugin.js +4 -5
  137. package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -1
  138. package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +2 -2
  139. package/plugins/CmsFieldFilterValueTransformPlugin.js +3 -4
  140. package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -1
  141. package/plugins/index.js +3 -1
  142. package/plugins/index.js.map +1 -1
  143. package/types.d.ts +11 -13
  144. package/types.js +5 -5
  145. package/types.js.map +1 -1
  146. package/definitions/settings.d.ts +0 -9
  147. package/definitions/settings.js +0 -53
  148. package/definitions/settings.js.map +0 -1
  149. package/dynamoDb/storage/date.d.ts +0 -3
  150. package/dynamoDb/storage/date.js +0 -82
  151. package/dynamoDb/storage/date.js.map +0 -1
  152. package/operations/settings/index.d.ts +0 -7
  153. package/operations/settings/index.js +0 -111
  154. package/operations/settings/index.js.map +0 -1
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.createModelsStorageOperations = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
8
  var _error = _interopRequireDefault(require("@webiny/error"));
10
9
  var _get = require("@webiny/db-dynamodb/utils/get");
11
10
  var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
12
11
  var _query = require("@webiny/db-dynamodb/utils/query");
12
+ var _dbDynamodb = require("@webiny/db-dynamodb");
13
13
  const createPartitionKey = params => {
14
14
  const {
15
15
  tenant,
@@ -44,9 +44,14 @@ const createModelsStorageOperations = params => {
44
44
  } = params;
45
45
  const keys = createKeys(model);
46
46
  try {
47
- await entity.put((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _cleanup.cleanupItem)(entity, model)), keys), {}, {
48
- TYPE: createType()
49
- }));
47
+ await (0, _dbDynamodb.put)({
48
+ entity,
49
+ item: {
50
+ ...(0, _cleanup.cleanupItem)(entity, model),
51
+ ...keys,
52
+ TYPE: createType()
53
+ }
54
+ });
50
55
  return model;
51
56
  } catch (ex) {
52
57
  throw new _error.default(`Could not create CMS Content Model.`, "CREATE_MODEL_ERROR", {
@@ -62,9 +67,14 @@ const createModelsStorageOperations = params => {
62
67
  } = params;
63
68
  const keys = createKeys(model);
64
69
  try {
65
- await entity.put((0, _objectSpread2.default)((0, _objectSpread2.default)((0, _objectSpread2.default)({}, (0, _cleanup.cleanupItem)(entity, model)), keys), {}, {
66
- TYPE: createType()
67
- }));
70
+ await (0, _dbDynamodb.put)({
71
+ entity,
72
+ item: {
73
+ ...(0, _cleanup.cleanupItem)(entity, model),
74
+ ...keys,
75
+ TYPE: createType()
76
+ }
77
+ });
68
78
  return model;
69
79
  } catch (ex) {
70
80
  throw new _error.default(ex.message || "Could not update model.", ex.code || "MODEL_UPDATE_ERROR", {
@@ -80,7 +90,10 @@ const createModelsStorageOperations = params => {
80
90
  } = params;
81
91
  const keys = createKeys(model);
82
92
  try {
83
- await entity.delete(keys);
93
+ await (0, _dbDynamodb.deleteItem)({
94
+ entity,
95
+ keys
96
+ });
84
97
  return model;
85
98
  } catch (ex) {
86
99
  throw new _error.default(ex.message || "Could not delete model.", ex.code || "MODEL_DELETE_ERROR", {
@@ -93,11 +106,10 @@ const createModelsStorageOperations = params => {
93
106
  const get = async params => {
94
107
  const keys = createKeys(params);
95
108
  try {
96
- const item = await (0, _get.get)({
109
+ return await (0, _get.getClean)({
97
110
  entity,
98
111
  keys
99
112
  });
100
- return (0, _cleanup.cleanupItem)(entity, item);
101
113
  } catch (ex) {
102
114
  throw new _error.default(ex.message || "Could not get model.", ex.code || "MODEL_GET_ERROR", {
103
115
  error: ex,
@@ -117,8 +129,7 @@ const createModelsStorageOperations = params => {
117
129
  }
118
130
  };
119
131
  try {
120
- const items = await (0, _query.queryAll)(queryAllParams);
121
- return (0, _cleanup.cleanupItems)(entity, items);
132
+ return await (0, _query.queryAllClean)(queryAllParams);
122
133
  } catch (ex) {
123
134
  throw new _error.default(ex.message || "Could not list models.", ex.code || "MODEL_LIST_ERROR", {
124
135
  error: ex,
@@ -134,4 +145,6 @@ const createModelsStorageOperations = params => {
134
145
  list
135
146
  };
136
147
  };
137
- exports.createModelsStorageOperations = createModelsStorageOperations;
148
+ exports.createModelsStorageOperations = createModelsStorageOperations;
149
+
150
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createPartitionKey","params","tenant","locale","WebinyError","createSortKey","modelId","createKeys","PK","SK","createType","createModelsStorageOperations","entity","create","model","keys","put","cleanupItem","TYPE","ex","error","update","message","code","deleteModel","delete","get","item","getRecord","list","where","queryAllParams","partitionKey","options","gte","items","queryAll","cleanupItems"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport {\n CmsModel,\n CmsModelStorageOperations,\n CmsModelStorageOperationsCreateParams,\n CmsModelStorageOperationsDeleteParams,\n CmsModelStorageOperationsGetParams,\n CmsModelStorageOperationsListParams,\n CmsModelStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport { get as getRecord } from \"@webiny/db-dynamodb/utils/get\";\nimport { cleanupItem, cleanupItems } from \"@webiny/db-dynamodb/utils/cleanup\";\nimport { queryAll, QueryAllParams } from \"@webiny/db-dynamodb/utils/query\";\n\ninterface PartitionKeysParams {\n tenant: string;\n locale: string;\n}\nconst createPartitionKey = (params: PartitionKeysParams): string => {\n const { tenant, locale } = params;\n if (!tenant) {\n throw new WebinyError(`Missing tenant variable when creating model partitionKey.`);\n } else if (!locale) {\n throw new WebinyError(`Missing locale variable when creating model partitionKey.`);\n }\n return `T#${tenant}#L#${locale}#CMS#CM`;\n};\n\ninterface SortKeyParams {\n modelId: string;\n}\nconst createSortKey = (params: SortKeyParams): string => {\n return params.modelId;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\nconst createKeys = (params: PartitionKeysParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey(params)\n };\n};\n\nconst createType = (): string => {\n return \"cms.model\";\n};\n\ninterface CreateModelsStorageOperationsParams {\n entity: Entity<any>;\n}\nexport const createModelsStorageOperations = (\n params: CreateModelsStorageOperationsParams\n): CmsModelStorageOperations => {\n const { entity } = params;\n\n const create = async (params: CmsModelStorageOperationsCreateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await entity.put({\n ...cleanupItem(entity, model),\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n throw new WebinyError(`Could not create CMS Content Model.`, \"CREATE_MODEL_ERROR\", {\n error: ex,\n model,\n keys\n });\n }\n };\n\n const update = async (params: CmsModelStorageOperationsUpdateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await entity.put({\n ...cleanupItem(entity, model),\n ...keys,\n TYPE: createType()\n });\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update model.\",\n ex.code || \"MODEL_UPDATE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const deleteModel = async (params: CmsModelStorageOperationsDeleteParams) => {\n const { model } = params;\n const keys = createKeys(model);\n\n try {\n await entity.delete(keys);\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete model.\",\n ex.code || \"MODEL_DELETE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsModelStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const item = await getRecord<CmsModel>({\n entity,\n keys\n });\n return cleanupItem(entity, item);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get model.\",\n ex.code || \"MODEL_GET_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n const list = async (params: CmsModelStorageOperationsListParams) => {\n const { where } = params;\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey: createPartitionKey(where),\n options: {\n gte: \" \"\n }\n };\n try {\n const items = await queryAll<CmsModel>(queryAllParams);\n\n return cleanupItems(entity, items);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list models.\",\n ex.code || \"MODEL_LIST_ERROR\",\n {\n error: ex,\n partitionKey: queryAllParams.partitionKey\n }\n );\n }\n };\n\n return {\n create,\n update,\n delete: deleteModel,\n get,\n list\n };\n};\n"],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AI,CAAC;IACpC,CAAC,CAAC,OAAOR,EAAE,EAAE;MACT,MAAM,IAAIf,cAAW,CACjBe,EAAE,CAACG,OAAO,IAAI,sBAAsB,EACpCH,EAAE,CAACI,IAAI,IAAI,iBAAiB,EAC5B;QACIH,KAAK,EAAED,EAAE;QACTJ;MACJ,CAAC,CACJ;IACL;EACJ,CAAC;EAED,MAAMc,IAAI,GAAG,MAAO5B,MAA2C,IAAK;IAChE,MAAM;MAAE6B;IAAM,CAAC,GAAG7B,MAAM;IACxB,MAAM8B,cAA8B,GAAG;MACnCnB,MAAM;MACNoB,YAAY,EAAEhC,kBAAkB,CAAC8B,KAAK,CAAC;MACvCG,OAAO,EAAE;QACLC,GAAG,EAAE;MACT;IACJ,CAAC;IACD,IAAI;MACA,MAAMC,KAAK,GAAG,MAAM,IAAAC,eAAQ,EAAWL,cAAc,CAAC;MAEtD,OAAO,IAAAM,qBAAY,EAACzB,MAAM,EAAEuB,KAAK,CAAC;IACtC,CAAC,CAAC,OAAOhB,EAAE,EAAE;MACT,MAAM,IAAIf,cAAW,CACjBe,EAAE,CAACG,OAAO,IAAI,wBAAwB,EACtCH,EAAE,CAACI,IAAI,IAAI,kBAAkB,EAC7B;QACIH,KAAK,EAAED,EAAE;QACTa,YAAY,EAAED,cAAc,CAACC;MACjC,CAAC,CACJ;IACL;EACJ,CAAC;EAED,OAAO;IACHnB,MAAM;IACNQ,MAAM;IACNI,MAAM,EAAED,WAAW;IACnBE,GAAG;IACHG;EACJ,CAAC;AACL,CAAC;AAAC"}
1
+ {"version":3,"names":["_error","_interopRequireDefault","require","_get","_cleanup","_query","_dbDynamodb","createPartitionKey","params","tenant","locale","WebinyError","createSortKey","modelId","createKeys","PK","SK","createType","createModelsStorageOperations","entity","create","model","keys","put","item","cleanupItem","TYPE","ex","error","update","message","code","deleteModel","deleteItem","get","getClean","list","where","queryAllParams","partitionKey","options","gte","queryAllClean","delete","exports"],"sources":["index.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport type {\n CmsModel,\n CmsModelStorageOperations,\n CmsModelStorageOperationsCreateParams,\n CmsModelStorageOperationsDeleteParams,\n CmsModelStorageOperationsGetParams,\n CmsModelStorageOperationsListParams,\n CmsModelStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport type { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport { getClean } from \"@webiny/db-dynamodb/utils/get\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\nimport type { QueryAllParams } from \"@webiny/db-dynamodb/utils/query\";\nimport { queryAllClean } from \"@webiny/db-dynamodb/utils/query\";\nimport { deleteItem, put } from \"@webiny/db-dynamodb\";\n\ninterface PartitionKeysParams {\n tenant: string;\n locale: string;\n}\nconst createPartitionKey = (params: PartitionKeysParams): string => {\n const { tenant, locale } = params;\n if (!tenant) {\n throw new WebinyError(`Missing tenant variable when creating model partitionKey.`);\n } else if (!locale) {\n throw new WebinyError(`Missing locale variable when creating model partitionKey.`);\n }\n return `T#${tenant}#L#${locale}#CMS#CM`;\n};\n\ninterface SortKeyParams {\n modelId: string;\n}\nconst createSortKey = (params: SortKeyParams): string => {\n return params.modelId;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\nconst createKeys = (params: PartitionKeysParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey(params)\n };\n};\n\nconst createType = (): string => {\n return \"cms.model\";\n};\n\ninterface CreateModelsStorageOperationsParams {\n entity: Entity<any>;\n}\nexport const createModelsStorageOperations = (\n params: CreateModelsStorageOperationsParams\n): CmsModelStorageOperations => {\n const { entity } = params;\n\n const create = async (params: CmsModelStorageOperationsCreateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await put({\n entity,\n item: {\n ...cleanupItem(entity, model),\n ...keys,\n TYPE: createType()\n }\n });\n return model;\n } catch (ex) {\n throw new WebinyError(`Could not create CMS Content Model.`, \"CREATE_MODEL_ERROR\", {\n error: ex,\n model,\n keys\n });\n }\n };\n\n const update = async (params: CmsModelStorageOperationsUpdateParams) => {\n const { model } = params;\n\n const keys = createKeys(model);\n\n try {\n await put({\n entity,\n item: {\n ...cleanupItem(entity, model),\n ...keys,\n TYPE: createType()\n }\n });\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update model.\",\n ex.code || \"MODEL_UPDATE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const deleteModel = async (params: CmsModelStorageOperationsDeleteParams) => {\n const { model } = params;\n const keys = createKeys(model);\n\n try {\n await deleteItem({\n entity,\n keys\n });\n return model;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete model.\",\n ex.code || \"MODEL_DELETE_ERROR\",\n {\n error: ex,\n model,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsModelStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n return await getClean<CmsModel>({\n entity,\n keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get model.\",\n ex.code || \"MODEL_GET_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n const list = async (params: CmsModelStorageOperationsListParams) => {\n const { where } = params;\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey: createPartitionKey(where),\n options: {\n gte: \" \"\n }\n };\n try {\n return await queryAllClean<CmsModel>(queryAllParams);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list models.\",\n ex.code || \"MODEL_LIST_ERROR\",\n {\n error: ex,\n partitionKey: queryAllParams.partitionKey\n }\n );\n }\n };\n\n return {\n create,\n update,\n delete: deleteModel,\n get,\n list\n };\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAWA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,WAAA,GAAAJ,OAAA;AAMA,MAAMK,kBAAkB,GA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,MAAM;QACNG;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOK,EAAE,EAAE;MACT,MAAM,IAAIhB,cAAW,CACjBgB,EAAE,CAACG,OAAO,IAAI,sBAAsB,EACpCH,EAAE,CAACI,IAAI,IAAI,iBAAiB,EAC5B;QACIH,KAAK,EAAED,EAAE;QACTL;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMc,IAAI,GAAG,MAAO5B,MAA2C,IAAK;IAChE,MAAM;MAAE6B;IAAM,CAAC,GAAG7B,MAAM;IACxB,MAAM8B,cAA8B,GAAG;MACnCnB,MAAM;MACNoB,YAAY,EAAEhC,kBAAkB,CAAC8B,KAAK,CAAC;MACvCG,OAAO,EAAE;QACLC,GAAG,EAAE;MACT;IACJ,CAAC;IACD,IAAI;MACA,OAAO,MAAM,IAAAC,oBAAa,EAAWJ,cAAc,CAAC;IACxD,CAAC,CAAC,OAAOX,EAAE,EAAE;MACT,MAAM,IAAIhB,cAAW,CACjBgB,EAAE,CAACG,OAAO,IAAI,wBAAwB,EACtCH,EAAE,CAACI,IAAI,IAAI,kBAAkB,EAC7B;QACIH,KAAK,EAAED,EAAE;QACTY,YAAY,EAAED,cAAc,CAACC;MACjC,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHnB,MAAM;IACNS,MAAM;IACNc,MAAM,EAAEX,WAAW;IACnBE,GAAG;IACHE;EACJ,CAAC;AACL,CAAC;AAACQ,OAAA,CAAA1B,6BAAA,GAAAA,6BAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
- import { CmsSystemStorageOperations } from "@webiny/api-headless-cms/types";
2
- import { Entity } from "dynamodb-toolbox";
1
+ import type { CmsSystemStorageOperations } from "@webiny/api-headless-cms/types";
2
+ import type { Entity } from "@webiny/db-dynamodb/toolbox";
3
3
  interface CreateSystemStorageOperationsParams {
4
4
  entity: Entity<any>;
5
5
  }
@@ -5,10 +5,9 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.createSystemStorageOperations = void 0;
8
- var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
9
8
  var _error = _interopRequireDefault(require("@webiny/error"));
10
9
  var _get = require("@webiny/db-dynamodb/utils/get");
11
- var _cleanup = require("@webiny/db-dynamodb/utils/cleanup");
10
+ var _dbDynamodb = require("@webiny/db-dynamodb");
12
11
  const createPartitionKey = ({
13
12
  tenant
14
13
  }) => {
@@ -32,7 +31,13 @@ const createSystemStorageOperations = params => {
32
31
  }) => {
33
32
  const keys = createKeys(system);
34
33
  try {
35
- await entity.put((0, _objectSpread2.default)((0, _objectSpread2.default)({}, system), keys));
34
+ await (0, _dbDynamodb.put)({
35
+ entity,
36
+ item: {
37
+ ...system,
38
+ ...keys
39
+ }
40
+ });
36
41
  return system;
37
42
  } catch (ex) {
38
43
  throw new _error.default(ex.message || "Could not create system.", ex.code || "CREATE_SYSTEM_ERROR", {
@@ -48,7 +53,13 @@ const createSystemStorageOperations = params => {
48
53
  } = params;
49
54
  const keys = createKeys(system);
50
55
  try {
51
- await entity.put((0, _objectSpread2.default)((0, _objectSpread2.default)({}, system), keys));
56
+ await (0, _dbDynamodb.put)({
57
+ entity,
58
+ item: {
59
+ ...system,
60
+ ...keys
61
+ }
62
+ });
52
63
  return system;
53
64
  } catch (ex) {
54
65
  throw new _error.default(ex.message || "Could not update system.", ex.code || "UPDATE_SYSTEM_ERROR", {
@@ -61,11 +72,10 @@ const createSystemStorageOperations = params => {
61
72
  const get = async params => {
62
73
  const keys = createKeys(params);
63
74
  try {
64
- const system = await (0, _get.get)({
75
+ return await (0, _get.getClean)({
65
76
  entity,
66
77
  keys
67
78
  });
68
- return (0, _cleanup.cleanupItem)(entity, system);
69
79
  } catch (ex) {
70
80
  throw new _error.default(ex.message || "Could not get system.", ex.code || "GET_SYSTEM_ERROR", {
71
81
  error: ex,
@@ -79,4 +89,6 @@ const createSystemStorageOperations = params => {
79
89
  get
80
90
  };
81
91
  };
82
- exports.createSystemStorageOperations = createSystemStorageOperations;
92
+ exports.createSystemStorageOperations = createSystemStorageOperations;
93
+
94
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["createPartitionKey","tenant","toLowerCase","createSortKey","createKeys","params","PK","SK","createSystemStorageOperations","entity","create","system","keys","put","ex","WebinyError","message","code","error","update","get","getRecord","cleanupItem"],"sources":["index.ts"],"sourcesContent":["import {\n CmsSystem,\n CmsSystemStorageOperations,\n CmsSystemStorageOperationsCreateParams,\n CmsSystemStorageOperationsGetParams,\n CmsSystemStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport WebinyError from \"@webiny/error\";\nimport { get as getRecord } from \"@webiny/db-dynamodb/utils/get\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\n\ninterface CreateSystemStorageOperationsParams {\n entity: Entity<any>;\n}\n\ninterface PartitionKeyParams {\n tenant: string;\n}\nconst createPartitionKey = ({ tenant }: PartitionKeyParams): string => {\n return `T#${tenant.toLowerCase()}#SYSTEM`;\n};\nconst createSortKey = (): string => {\n return \"CMS\";\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\nconst createKeys = (params: PartitionKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey()\n };\n};\n\nexport const createSystemStorageOperations = (\n params: CreateSystemStorageOperationsParams\n): CmsSystemStorageOperations => {\n const { entity } = params;\n\n const create = async ({ system }: CmsSystemStorageOperationsCreateParams) => {\n const keys = createKeys(system);\n try {\n await entity.put({\n ...system,\n ...keys\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create system.\",\n ex.code || \"CREATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const update = async (params: CmsSystemStorageOperationsUpdateParams) => {\n const { system } = params;\n\n const keys = createKeys(system);\n\n try {\n await entity.put({\n ...system,\n ...keys\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update system.\",\n ex.code || \"UPDATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsSystemStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const system = await getRecord<CmsSystem>({\n entity,\n keys\n });\n return cleanupItem(entity, system);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get system.\",\n ex.code || \"GET_SYSTEM_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n return {\n create,\n update,\n get\n };\n};\n"],"mappings":";;;;;;;;AAQA;AACA;AACA;AASA,MAAMA,kBAAkB,GAAG,CAAC;EAAEC;AAA2B,CAAC,KAAa;EACnE,OAAQ,KAAIA,MAAM,CAACC,WAAW,EAAG,SAAQ;AAC7C,CAAC;AACD,MAAMC,aAAa,GAAG,MAAc;EAChC,OAAO,KAAK;AAChB,CAAC;AAMD,MAAMC,UAAU,GAAIC,MAA0B,IAAW;EACrD,OAAO;IACHC,EAAE,EAAEN,kBAAkB,CAACK,MAAM,CAAC;IAC9BE,EAAE,EAAEJ,aAAa;EACrB,CAAC;AACL,CAAC;AAEM,MAAMK,6BAA6B,GACtCH,MAA2C,IACd;EAC7B,MAAM;IAAEI;EAAO,CAAC,GAAGJ,MAAM;EAEzB,MAAMK,MAAM,GAAG,OAAO;IAAEC;EAA+C,CAAC,KAAK;IACzE,MAAMC,IAAI,GAAGR,UAAU,CAACO,MAAM,CAAC;IAC/B,IAAI;MACA,MAAMF,MAAM,CAACI,GAAG,6DACTF,MAAM,GACNC,IAAI,EACT;MACF,OAAOD,MAAM;IACjB,CAAC,CAAC,OAAOG,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,0BAA0B,EACxCF,EAAE,CAACG,IAAI,IAAI,qBAAqB,EAChC;QACIC,KAAK,EAAEJ,EAAE;QACTH,MAAM;QACNC;MACJ,CAAC,CACJ;IACL;EACJ,CAAC;EAED,MAAMO,MAAM,GAAG,MAAOd,MAA8C,IAAK;IACrE,MAAM;MAAEM;IAAO,CAAC,GAAGN,MAAM;IAEzB,MAAMO,IAAI,GAAGR,UAAU,CAACO,MAAM,CAAC;IAE/B,IAAI;MACA,MAAMF,MAAM,CAACI,GAAG,6DACTF,MAAM,GACNC,IAAI,EACT;MACF,OAAOD,MAAM;IACjB,CAAC,CAAC,OAAOG,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,0BAA0B,EACxCF,EAAE,CAACG,IAAI,IAAI,qBAAqB,EAChC;QACIC,KAAK,EAAEJ,EAAE;QACTH,MAAM;QACNC;MACJ,CAAC,CACJ;IACL;EACJ,CAAC;EAED,MAAMQ,GAAG,GAAG,MAAOf,MAA2C,IAAK;IAC/D,MAAMO,IAAI,GAAGR,UAAU,CAACC,MAAM,CAAC;IAE/B,IAAI;MACA,MAAMM,MAAM,GAAG,MAAM,IAAAU,QAAS,EAAY;QACtCZ,MAAM;QACNG;MACJ,CAAC,CAAC;MACF,OAAO,IAAAU,oBAAW,EAACb,MAAM,EAAEE,MAAM,CAAC;IACtC,CAAC,CAAC,OAAOG,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,uBAAuB,EACrCF,EAAE,CAACG,IAAI,IAAI,kBAAkB,EAC7B;QACIC,KAAK,EAAEJ,EAAE;QACTF;MACJ,CAAC,CACJ;IACL;EACJ,CAAC;EAED,OAAO;IACHF,MAAM;IACNS,MAAM;IACNC;EACJ,CAAC;AACL,CAAC;AAAC"}
1
+ {"version":3,"names":["_error","_interopRequireDefault","require","_get","_dbDynamodb","createPartitionKey","tenant","toLowerCase","createSortKey","createKeys","params","PK","SK","createSystemStorageOperations","entity","create","system","keys","put","item","ex","WebinyError","message","code","error","update","get","getClean","exports"],"sources":["index.ts"],"sourcesContent":["import type {\n CmsSystem,\n CmsSystemStorageOperations,\n CmsSystemStorageOperationsCreateParams,\n CmsSystemStorageOperationsGetParams,\n CmsSystemStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport type { Entity } from \"@webiny/db-dynamodb/toolbox\";\nimport WebinyError from \"@webiny/error\";\nimport { getClean } from \"@webiny/db-dynamodb/utils/get\";\nimport { put } from \"@webiny/db-dynamodb\";\n\ninterface CreateSystemStorageOperationsParams {\n entity: Entity<any>;\n}\n\ninterface PartitionKeyParams {\n tenant: string;\n}\nconst createPartitionKey = ({ tenant }: PartitionKeyParams): string => {\n return `T#${tenant.toLowerCase()}#SYSTEM`;\n};\nconst createSortKey = (): string => {\n return \"CMS\";\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\nconst createKeys = (params: PartitionKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKey()\n };\n};\n\nexport const createSystemStorageOperations = (\n params: CreateSystemStorageOperationsParams\n): CmsSystemStorageOperations => {\n const { entity } = params;\n\n const create = async ({ system }: CmsSystemStorageOperationsCreateParams) => {\n const keys = createKeys(system);\n try {\n await put({\n entity,\n item: {\n ...system,\n ...keys\n }\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create system.\",\n ex.code || \"CREATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const update = async (params: CmsSystemStorageOperationsUpdateParams) => {\n const { system } = params;\n\n const keys = createKeys(system);\n\n try {\n await put({\n entity,\n item: {\n ...system,\n ...keys\n }\n });\n return system;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update system.\",\n ex.code || \"UPDATE_SYSTEM_ERROR\",\n {\n error: ex,\n system,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsSystemStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n return await getClean<CmsSystem>({\n entity,\n keys\n });\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get system.\",\n ex.code || \"GET_SYSTEM_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I,GAAGR,UAAU,CAACO,MAAM,CAAC;IAE/B,IAAI;MACA,MAAM,IAAAE,eAAG,EAAC;QACNJ,MAAM;QACNK,IAAI,EAAE;UACF,GAAGH,MAAM;UACT,GAAGC;QACP;MACJ,CAAC,CAAC;MACF,OAAOD,MAAM;IACjB,CAAC,CAAC,OAAOI,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,0BAA0B,EACxCF,EAAE,CAACG,IAAI,IAAI,qBAAqB,EAChC;QACIC,KAAK,EAAEJ,EAAE;QACTJ,MAAM;QACNC;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMS,GAAG,GAAG,MAAOhB,MAA2C,IAAK;IAC/D,MAAMO,IAAI,GAAGR,UAAU,CAACC,MAAM,CAAC;IAE/B,IAAI;MACA,OAAO,MAAM,IAAAiB,aAAQ,EAAY;QAC7Bb,MAAM;QACNG;MACJ,CAAC,CAAC;IACN,CAAC,CAAC,OAAOG,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,uBAAuB,EACrCF,EAAE,CAACG,IAAI,IAAI,kBAAkB,EAC7B;QACIC,KAAK,EAAEJ,EAAE;QACTH;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHF,MAAM;IACNU,MAAM;IACNC;EACJ,CAAC;AACL,CAAC;AAACE,OAAA,CAAAf,6BAAA,GAAAA,6BAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/api-headless-cms-ddb",
3
- "version": "0.0.0-unstable.99666aeb00",
3
+ "version": "0.0.0-unstable.9bd236cf5e",
4
4
  "main": "index.js",
5
5
  "keywords": [
6
6
  "@webiny/api-headless-cms",
@@ -22,39 +22,34 @@
22
22
  ],
23
23
  "license": "MIT",
24
24
  "dependencies": {
25
- "@babel/runtime": "7.20.13",
26
- "@webiny/api-headless-cms": "0.0.0-unstable.99666aeb00",
27
- "@webiny/db-dynamodb": "0.0.0-unstable.99666aeb00",
28
- "@webiny/error": "0.0.0-unstable.99666aeb00",
29
- "@webiny/handler-db": "0.0.0-unstable.99666aeb00",
30
- "@webiny/utils": "0.0.0-unstable.99666aeb00",
31
- "aws-sdk": "2.1310.0",
32
- "dataloader": "2.2.1",
25
+ "@webiny/api": "0.0.0-unstable.9bd236cf5e",
26
+ "@webiny/api-headless-cms": "0.0.0-unstable.9bd236cf5e",
27
+ "@webiny/aws-sdk": "0.0.0-unstable.9bd236cf5e",
28
+ "@webiny/db-dynamodb": "0.0.0-unstable.9bd236cf5e",
29
+ "@webiny/error": "0.0.0-unstable.9bd236cf5e",
30
+ "@webiny/handler-db": "0.0.0-unstable.9bd236cf5e",
31
+ "@webiny/utils": "0.0.0-unstable.9bd236cf5e",
32
+ "dataloader": "2.2.3",
33
+ "dot-object": "2.1.5",
33
34
  "dot-prop": "6.0.1",
34
- "dynamodb-toolbox": "0.3.5",
35
- "jsonpack": "1.1.5",
36
35
  "lodash": "4.17.21"
37
36
  },
38
37
  "devDependencies": {
39
- "@babel/cli": "7.20.7",
40
- "@babel/core": "7.20.12",
41
- "@babel/preset-env": "7.20.2",
42
- "@types/jsonpack": "1.1.2",
43
- "@webiny/cli": "0.0.0-unstable.99666aeb00",
44
- "@webiny/plugins": "0.0.0-unstable.99666aeb00",
45
- "@webiny/project-utils": "0.0.0-unstable.99666aeb00",
46
- "jest": "29.5.0",
38
+ "@types/dot-object": "2.1.6",
39
+ "@types/jsonpack": "1.1.6",
40
+ "@webiny/plugins": "0.0.0-unstable.9bd236cf5e",
41
+ "@webiny/project-utils": "0.0.0-unstable.9bd236cf5e",
42
+ "jest": "29.7.0",
47
43
  "jest-dynalite": "3.6.1",
48
- "ttypescript": "1.5.15",
49
- "typescript": "4.7.4"
44
+ "typescript": "5.3.3"
50
45
  },
51
46
  "publishConfig": {
52
47
  "access": "public",
53
48
  "directory": "dist"
54
49
  },
55
50
  "scripts": {
56
- "build": "yarn webiny run build",
57
- "watch": "yarn webiny run watch"
51
+ "build": "node ../cli/bin.js run build",
52
+ "watch": "node ../cli/bin.js run watch"
58
53
  },
59
- "gitHead": "99666aeb00056c56292eeb5dbb6aba7fda2439e2"
54
+ "gitHead": "9bd236cf5e689f209a11bec089207dcc2d41a53c"
60
55
  }
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from "@webiny/plugins/Plugin";
2
- import { CmsModelField } from "@webiny/api-headless-cms/types";
2
+ import type { CmsModelField } from "@webiny/api-headless-cms/types";
3
3
  export interface CreatePathCallableParams {
4
4
  field: Partial<CmsModelField> & Pick<CmsModelField, "fieldId" | "storageId" | "id">;
5
5
  index?: number;
@@ -5,17 +5,21 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.CmsEntryFieldFilterPathPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
8
  var _error = _interopRequireDefault(require("@webiny/error"));
10
9
  var _Plugin = require("@webiny/plugins/Plugin");
11
10
  class CmsEntryFieldFilterPathPlugin extends _Plugin.Plugin {
11
+ static type = "cms-field-filter-path";
12
12
  get fieldType() {
13
13
  return this.config.fieldType;
14
14
  }
15
15
  constructor(config) {
16
16
  super();
17
- (0, _defineProperty2.default)(this, "config", void 0);
18
17
  this.config = config;
18
+
19
+ /**
20
+ * We expect error here because we know that `this.constructor.type` is defined, but TS does not.
21
+ */
22
+ // @ts-expect-error
19
23
  this.name = `${this.constructor.type}-${this.config.fieldType}`;
20
24
  }
21
25
  canUse(field, parents) {
@@ -40,4 +44,5 @@ class CmsEntryFieldFilterPathPlugin extends _Plugin.Plugin {
40
44
  }
41
45
  }
42
46
  exports.CmsEntryFieldFilterPathPlugin = CmsEntryFieldFilterPathPlugin;
43
- (0, _defineProperty2.default)(CmsEntryFieldFilterPathPlugin, "type", "cms-field-filter-path");
47
+
48
+ //# sourceMappingURL=CmsEntryFieldFilterPathPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CmsEntryFieldFilterPathPlugin","Plugin","fieldType","config","constructor","name","type","canUse","field","parents","fieldId","Array","isArray","length","includes","createPath","params","path","WebinyError"],"sources":["CmsEntryFieldFilterPathPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Plugin } from \"@webiny/plugins/Plugin\";\nimport { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams {\n field: Partial<CmsModelField> & Pick<CmsModelField, \"fieldId\" | \"storageId\" | \"id\">;\n index?: number;\n}\nexport interface CreatePathCallable {\n (params: CreatePathCallableParams): string;\n}\nexport interface CmsEntryFieldFilterPathPluginParams {\n fieldType: string;\n fieldId?: string[];\n path: string | CreatePathCallable;\n canUse?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents?: string[]) => boolean;\n}\nexport class CmsEntryFieldFilterPathPlugin extends Plugin {\n public static override readonly type: string = \"cms-field-filter-path\";\n\n private readonly config: CmsEntryFieldFilterPathPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(config: CmsEntryFieldFilterPathPluginParams) {\n super();\n\n this.config = config;\n\n this.name = `${(this.constructor as any).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;AACA;AAgBO,MAAMA,6BAA6B,SAASC,cAAM,CAAC;EAKt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S,uBAAuB"}
1
+ {"version":3,"names":["_error","_interopRequireDefault","require","_Plugin","CmsEntryFieldFilterPathPlugin","Plugin","type","fieldType","config","constructor","name","canUse","field","parents","fieldId","Array","isArray","length","includes","createPath","params","path","WebinyError","exports"],"sources":["CmsEntryFieldFilterPathPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Plugin } from \"@webiny/plugins/Plugin\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams {\n field: Partial<CmsModelField> & Pick<CmsModelField, \"fieldId\" | \"storageId\" | \"id\">;\n index?: number;\n}\nexport interface CreatePathCallable {\n (params: CreatePathCallableParams): string;\n}\nexport interface CmsEntryFieldFilterPathPluginParams {\n fieldType: string;\n fieldId?: string[];\n path: string | CreatePathCallable;\n canUse?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents?: string[]) => boolean;\n}\nexport class CmsEntryFieldFilterPathPlugin extends Plugin {\n public static override readonly type: string = \"cms-field-filter-path\";\n\n private readonly config: CmsEntryFieldFilterPathPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(config: CmsEntryFieldFilterPathPluginParams) {\n super();\n\n this.config = config;\n\n /**\n * We expect error here because we know that `this.constructor.type` is defined, but TS does not.\n */\n // @ts-expect-error\n this.name = `${this.constructor.type}-${this.config.fieldType}`;\n }\n\n public canUse(field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents: string[]): boolean {\n if (field.type !== this.config.fieldType) {\n return false;\n } else if (this.config.canUse) {\n return this.config.canUse(field, parents);\n }\n const fieldId = this.config.fieldId;\n if (!fieldId || Array.isArray(fieldId) === false || fieldId.length === 0) {\n return true;\n }\n return fieldId.includes(field.fieldId);\n }\n\n public createPath(params: CreatePathCallableParams): string {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n throw new WebinyError(`Missing path in \"${this.name}\" plugin.`);\n }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AI,CAACZ,MAAM,CAACa,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO,IAAI,CAACb,MAAM,CAACa,IAAI;IAC3B;IACA,MAAM,IAAIC,cAAW,CAAC,oBAAoB,IAAI,CAACZ,IAAI,WAAW,CAAC;EACnE;AACJ;AAACa,OAAA,CAAAnB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
@@ -1,18 +1,18 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin";
3
- import { Field } from "../operations/entry/filtering/types";
4
- import { CmsFieldFilterValueTransformPlugin } from "../types";
2
+ import type { ValueFilterPlugin } from "@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin";
3
+ import type { Field } from "../operations/entry/filtering/types";
4
+ import type { CmsFieldFilterValueTransformPlugin } from "../types";
5
5
  /**
6
6
  * This plugin is used to create the filter.
7
7
  * Internally we have default one + the one for the reference field - because it is actually an object when filtering.
8
8
  */
9
- interface CmsEntryFieldFilterPluginParams {
9
+ interface CmsEntryFieldFilterPluginParams<T = any> {
10
10
  fieldType: string;
11
- create: (params: CmsEntryFieldFilterPluginCreateParams) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];
11
+ create: (params: CmsEntryFieldFilterPluginCreateParams<T>) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];
12
12
  }
13
- interface CmsEntryFieldFilterPluginCreateParams {
13
+ interface CmsEntryFieldFilterPluginCreateParams<T = any> {
14
14
  key: string;
15
- value: any;
15
+ value: T;
16
16
  field: Field;
17
17
  fields: Record<string, Field>;
18
18
  operation: string;
@@ -32,12 +32,12 @@ export interface CmsEntryFieldFilterPluginCreateResponse {
32
32
  compareValue: any;
33
33
  transformValue: <I = any, O = any>(value: I) => O;
34
34
  }
35
- export declare class CmsEntryFieldFilterPlugin extends Plugin {
35
+ export declare class CmsEntryFieldFilterPlugin<T = any> extends Plugin {
36
36
  static readonly type: string;
37
37
  static readonly ALL: string;
38
38
  private readonly config;
39
39
  readonly fieldType: string;
40
- constructor(config: CmsEntryFieldFilterPluginParams);
41
- create(params: CmsEntryFieldFilterPluginCreateParams): CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[] | null;
40
+ constructor(config: CmsEntryFieldFilterPluginParams<T>);
41
+ create(params: CmsEntryFieldFilterPluginCreateParams<T>): CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[] | null;
42
42
  }
43
43
  export {};
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.CmsEntryFieldFilterPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
8
+ /**
9
+ * This plugin is used to create the filter.
10
+ * Internally we have default one + the one for the reference field - because it is actually an object when filtering.
11
+ */
12
+
10
13
  class CmsEntryFieldFilterPlugin extends _plugins.Plugin {
14
+ static type = "cms.dynamodb.entry.field.filter";
15
+ static ALL = "*";
11
16
  constructor(config) {
12
17
  super();
13
- (0, _defineProperty2.default)(this, "config", void 0);
14
- (0, _defineProperty2.default)(this, "fieldType", void 0);
15
18
  this.config = config;
16
19
  this.fieldType = this.config.fieldType;
17
20
  }
@@ -20,5 +23,5 @@ class CmsEntryFieldFilterPlugin extends _plugins.Plugin {
20
23
  }
21
24
  }
22
25
  exports.CmsEntryFieldFilterPlugin = CmsEntryFieldFilterPlugin;
23
- (0, _defineProperty2.default)(CmsEntryFieldFilterPlugin, "type", "cms.dynamodb.entry.field.filter");
24
- (0, _defineProperty2.default)(CmsEntryFieldFilterPlugin, "ALL", "*");
26
+
27
+ //# sourceMappingURL=CmsEntryFieldFilterPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CmsEntryFieldFilterPlugin","Plugin","constructor","config","fieldType","create","params"],"sources":["CmsEntryFieldFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport { Field } from \"~/operations/entry/filtering/types\";\nimport { CmsFieldFilterValueTransformPlugin } from \"~/types\";\n\n/**\n * This plugin is used to create the filter.\n * Internally we have default one + the one for the reference field - because it is actually an object when filtering.\n */\n\ninterface CmsEntryFieldFilterPluginParams {\n fieldType: string;\n create: (\n params: CmsEntryFieldFilterPluginCreateParams\n ) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];\n}\n\ninterface CmsEntryFieldFilterPluginCreateParams {\n key: string;\n value: any;\n field: Field;\n fields: Record<string, Field>;\n operation: string;\n valueFilterPlugins: Record<string, ValueFilterPlugin>;\n transformValuePlugins: Record<string, CmsFieldFilterValueTransformPlugin>;\n getFilterCreatePlugin: (type: string) => CmsEntryFieldFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport interface CmsEntryFieldFilterPluginCreateResponse {\n field: Field;\n path: string;\n fieldPathId: string;\n plugin: ValueFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport class CmsEntryFieldFilterPlugin extends Plugin {\n public static override readonly type: string = \"cms.dynamodb.entry.field.filter\";\n public static readonly ALL: string = \"*\";\n\n private readonly config: CmsEntryFieldFilterPluginParams;\n\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFieldFilterPluginParams) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public create(params: CmsEntryFieldFilterPluginCreateParams) {\n return this.config.create(params);\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAyCO,MAAMA,yBAAyB,SAASC,eAAM,CAAC;EAQ3CC,WAAW,CAACC,MAAuC,EAAE;IACxD,KAAK,EAAE;IAAC;IAAA;IACR,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACD,MAAM,CAACC,SAAS;EAC1C;EAEOC,MAAM,CAACC,MAA6C,EAAE;IACzD,OAAO,IAAI,CAACH,MAAM,CAACE,MAAM,CAACC,MAAM,CAAC;EACrC;AACJ;AAAC;AAAA,8BAjBYN,yBAAyB,UACa,iCAAiC;AAAA,8BADvEA,yBAAyB,SAEG,GAAG"}
1
+ {"version":3,"names":["_plugins","require","CmsEntryFieldFilterPlugin","Plugin","type","ALL","constructor","config","fieldType","create","params","exports"],"sources":["CmsEntryFieldFilterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport type { Field } from \"~/operations/entry/filtering/types\";\nimport type { CmsFieldFilterValueTransformPlugin } from \"~/types\";\n\n/**\n * This plugin is used to create the filter.\n * Internally we have default one + the one for the reference field - because it is actually an object when filtering.\n */\n\ninterface CmsEntryFieldFilterPluginParams<T = any> {\n fieldType: string;\n create: (\n params: CmsEntryFieldFilterPluginCreateParams<T>\n ) => null | CmsEntryFieldFilterPluginCreateResponse | CmsEntryFieldFilterPluginCreateResponse[];\n}\n\ninterface CmsEntryFieldFilterPluginCreateParams<T = any> {\n key: string;\n value: T;\n field: Field;\n fields: Record<string, Field>;\n operation: string;\n valueFilterPlugins: Record<string, ValueFilterPlugin>;\n transformValuePlugins: Record<string, CmsFieldFilterValueTransformPlugin>;\n getFilterCreatePlugin: (type: string) => CmsEntryFieldFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport interface CmsEntryFieldFilterPluginCreateResponse {\n field: Field;\n path: string;\n fieldPathId: string;\n plugin: ValueFilterPlugin;\n negate: boolean;\n compareValue: any;\n transformValue: <I = any, O = any>(value: I) => O;\n}\n\nexport class CmsEntryFieldFilterPlugin<T = any> extends Plugin {\n public static override readonly type: string = \"cms.dynamodb.entry.field.filter\";\n public static readonly ALL: string = \"*\";\n\n private readonly config: CmsEntryFieldFilterPluginParams<T>;\n\n public readonly fieldType: string;\n\n public constructor(config: CmsEntryFieldFilterPluginParams<T>) {\n super();\n this.config = config;\n this.fieldType = this.config.fieldType;\n }\n\n public create(params: CmsEntryFieldFilterPluginCreateParams<T>) {\n return this.config.create(params);\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACA;;AAiCO,MAAMC,yBAAyB,SAAkBC,eAAM,CAAC;EAC3D,OAAgCC,IAAI,GAAW,iCAAiC;EAChF,OAAuBC,GAAG,GAAW,GAAG;EAMjCC,WAAWA,CAACC,MAA0C,EAAE;IAC3D,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,SAAS,GAAG,IAAI,CAACD,MAAM,CAACC,SAAS;EAC1C;EAEOC,MAAMA,CAACC,MAAgD,EAAE;IAC5D,OAAO,IAAI,CAACH,MAAM,CAACE,MAAM,CAACC,MAAM,CAAC;EACrC;AACJ;AAACC,OAAA,CAAAT,yBAAA,GAAAA,yBAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { Field } from "../operations/entry/filtering/types";
3
- import { CmsModel } from "@webiny/api-headless-cms/types";
2
+ import type { Field } from "../operations/entry/filtering/types";
3
+ import type { CmsModel } from "@webiny/api-headless-cms/types";
4
4
  interface CmsEntryFieldSortingPluginCanUseParams {
5
5
  model: CmsModel;
6
6
  field?: Field;
@@ -1,16 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.createCmsEntryFieldSortingPlugin = exports.CmsEntryFieldSortingPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
10
8
  class CmsEntryFieldSortingPlugin extends _plugins.Plugin {
9
+ static type = "cms.entry.field.sorting";
11
10
  constructor(config) {
12
11
  super();
13
- (0, _defineProperty2.default)(this, "config", void 0);
14
12
  this.config = config;
15
13
  }
16
14
  canUse(params) {
@@ -21,8 +19,9 @@ class CmsEntryFieldSortingPlugin extends _plugins.Plugin {
21
19
  }
22
20
  }
23
21
  exports.CmsEntryFieldSortingPlugin = CmsEntryFieldSortingPlugin;
24
- (0, _defineProperty2.default)(CmsEntryFieldSortingPlugin, "type", "cms.entry.field.sorting");
25
22
  const createCmsEntryFieldSortingPlugin = config => {
26
23
  return new CmsEntryFieldSortingPlugin(config);
27
24
  };
28
- exports.createCmsEntryFieldSortingPlugin = createCmsEntryFieldSortingPlugin;
25
+ exports.createCmsEntryFieldSortingPlugin = createCmsEntryFieldSortingPlugin;
26
+
27
+ //# sourceMappingURL=CmsEntryFieldSortingPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CmsEntryFieldSortingPlugin","Plugin","constructor","config","canUse","params","createSort","createCmsEntryFieldSortingPlugin"],"sources":["CmsEntryFieldSortingPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { Field } from \"~/operations/entry/filtering/types\";\nimport { CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface CmsEntryFieldSortingPluginCanUseParams {\n model: CmsModel;\n field?: Field;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n /**\n * Combination of fieldId and sortBy\n *\n * example: id_ASC or createdBy_DESC\n */\n sortBy: string;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortParams {\n model: CmsModel;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n sortBy: string;\n fields: Record<string, Field>;\n field?: Field;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortResult {\n valuePath: string;\n reverse: boolean;\n fieldId: string;\n field: Field;\n}\n\ninterface CmsEntryFieldSortingPluginConfig {\n createSort: (\n params: CmsEntryFieldSortingPluginCreateSortParams\n ) => CmsEntryFieldSortingPluginCreateSortResult;\n canUse: (params: CmsEntryFieldSortingPluginCanUseParams) => boolean;\n}\n\nexport class CmsEntryFieldSortingPlugin extends Plugin {\n public static override readonly type: string = \"cms.entry.field.sorting\";\n private readonly config: CmsEntryFieldSortingPluginConfig;\n\n public constructor(config: CmsEntryFieldSortingPluginConfig) {\n super();\n this.config = config;\n }\n\n public canUse(params: CmsEntryFieldSortingPluginCanUseParams): boolean {\n return this.config.canUse(params);\n }\n\n public createSort(\n params: CmsEntryFieldSortingPluginCreateSortParams\n ): CmsEntryFieldSortingPluginCreateSortResult {\n return this.config.createSort(params);\n }\n}\n\nexport const createCmsEntryFieldSortingPlugin = (config: CmsEntryFieldSortingPluginConfig) => {\n return new CmsEntryFieldSortingPlugin(config);\n};\n"],"mappings":";;;;;;;;AAAA;AAwCO,MAAMA,0BAA0B,SAASC,eAAM,CAAC;EAI5CC,WAAW,CAACC,MAAwC,EAAE;IACzD,KAAK,EAAE;IAAC;IACR,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOC,MAAM,CAACC,MAA8C,EAAW;IACnE,OAAO,IAAI,CAACF,MAAM,CAACC,MAAM,CAACC,MAAM,CAAC;EACrC;EAEOC,UAAU,CACbD,MAAkD,EACR;IAC1C,OAAO,IAAI,CAACF,MAAM,CAACG,UAAU,CAACD,MAAM,CAAC;EACzC;AACJ;AAAC;AAAA,8BAlBYL,0BAA0B,UACY,yBAAyB;AAmBrE,MAAMO,gCAAgC,GAAIJ,MAAwC,IAAK;EAC1F,OAAO,IAAIH,0BAA0B,CAACG,MAAM,CAAC;AACjD,CAAC;AAAC"}
1
+ {"version":3,"names":["_plugins","require","CmsEntryFieldSortingPlugin","Plugin","type","constructor","config","canUse","params","createSort","exports","createCmsEntryFieldSortingPlugin"],"sources":["CmsEntryFieldSortingPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { Field } from \"~/operations/entry/filtering/types\";\nimport type { CmsModel } from \"@webiny/api-headless-cms/types\";\n\ninterface CmsEntryFieldSortingPluginCanUseParams {\n model: CmsModel;\n field?: Field;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n /**\n * Combination of fieldId and sortBy\n *\n * example: id_ASC or createdBy_DESC\n */\n sortBy: string;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortParams {\n model: CmsModel;\n fieldId: string;\n order: \"ASC\" | \"DESC\";\n sortBy: string;\n fields: Record<string, Field>;\n field?: Field;\n}\n\ninterface CmsEntryFieldSortingPluginCreateSortResult {\n valuePath: string;\n reverse: boolean;\n fieldId: string;\n field: Field;\n}\n\ninterface CmsEntryFieldSortingPluginConfig {\n createSort: (\n params: CmsEntryFieldSortingPluginCreateSortParams\n ) => CmsEntryFieldSortingPluginCreateSortResult;\n canUse: (params: CmsEntryFieldSortingPluginCanUseParams) => boolean;\n}\n\nexport class CmsEntryFieldSortingPlugin extends Plugin {\n public static override readonly type: string = \"cms.entry.field.sorting\";\n private readonly config: CmsEntryFieldSortingPluginConfig;\n\n public constructor(config: CmsEntryFieldSortingPluginConfig) {\n super();\n this.config = config;\n }\n\n public canUse(params: CmsEntryFieldSortingPluginCanUseParams): boolean {\n return this.config.canUse(params);\n }\n\n public createSort(\n params: CmsEntryFieldSortingPluginCreateSortParams\n ): CmsEntryFieldSortingPluginCreateSortResult {\n return this.config.createSort(params);\n }\n}\n\nexport const createCmsEntryFieldSortingPlugin = (config: CmsEntryFieldSortingPluginConfig) => {\n return new CmsEntryFieldSortingPlugin(config);\n};\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAwCO,MAAMC,0BAA0B,SAASC,eAAM,CAAC;EACnD,OAAgCC,IAAI,GAAW,yBAAyB;EAGjEC,WAAWA,CAACC,MAAwC,EAAE;IACzD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;EAEOC,MAAMA,CAACC,MAA8C,EAAW;IACnE,OAAO,IAAI,CAACF,MAAM,CAACC,MAAM,CAACC,MAAM,CAAC;EACrC;EAEOC,UAAUA,CACbD,MAAkD,EACR;IAC1C,OAAO,IAAI,CAACF,MAAM,CAACG,UAAU,CAACD,MAAM,CAAC;EACzC;AACJ;AAACE,OAAA,CAAAR,0BAAA,GAAAA,0BAAA;AAEM,MAAMS,gCAAgC,GAAIL,MAAwC,IAAK;EAC1F,OAAO,IAAIJ,0BAA0B,CAACI,MAAM,CAAC;AACjD,CAAC;AAACI,OAAA,CAAAC,gCAAA,GAAAA,gCAAA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { Plugin } from "@webiny/plugins";
2
- import { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from "../types";
3
- declare type CmsFieldFilterValueTransformPluginParams = Omit<CmsFieldFilterValueTransformPluginInterface, "type">;
2
+ import type { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from "../types";
3
+ type CmsFieldFilterValueTransformPluginParams = Omit<CmsFieldFilterValueTransformPluginInterface, "type">;
4
4
  export declare class CmsFieldFilterValueTransformPlugin extends Plugin implements Omit<CmsFieldFilterValueTransformPluginInterface, "type"> {
5
5
  static type: string;
6
6
  private config;
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
6
  exports.CmsFieldFilterValueTransformPlugin = void 0;
8
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
7
  var _plugins = require("@webiny/plugins");
10
8
  class CmsFieldFilterValueTransformPlugin extends _plugins.Plugin {
9
+ static type = "cms-field-filter-value-transform";
11
10
  get fieldType() {
12
11
  return this.config.fieldType;
13
12
  }
@@ -16,9 +15,9 @@ class CmsFieldFilterValueTransformPlugin extends _plugins.Plugin {
16
15
  }
17
16
  constructor(config) {
18
17
  super();
19
- (0, _defineProperty2.default)(this, "config", void 0);
20
18
  this.config = config;
21
19
  }
22
20
  }
23
21
  exports.CmsFieldFilterValueTransformPlugin = CmsFieldFilterValueTransformPlugin;
24
- (0, _defineProperty2.default)(CmsFieldFilterValueTransformPlugin, "type", "cms-field-filter-value-transform");
22
+
23
+ //# sourceMappingURL=CmsFieldFilterValueTransformPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["CmsFieldFilterValueTransformPlugin","Plugin","fieldType","config","transform","constructor"],"sources":["CmsFieldFilterValueTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from \"~/types\";\n\ntype CmsFieldFilterValueTransformPluginParams = Omit<\n CmsFieldFilterValueTransformPluginInterface,\n \"type\"\n>;\nexport class CmsFieldFilterValueTransformPlugin\n extends Plugin\n implements Omit<CmsFieldFilterValueTransformPluginInterface, \"type\">\n{\n public static override type = \"cms-field-filter-value-transform\";\n\n private config: CmsFieldFilterValueTransformPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public get transform(): CmsFieldFilterValueTransformPluginParams[\"transform\"] {\n return this.config.transform;\n }\n\n public constructor(config: CmsFieldFilterValueTransformPluginParams) {\n super();\n this.config = config;\n }\n}\n"],"mappings":";;;;;;;;AAAA;AAOO,MAAMA,kCAAkC,SACnCC,eAAM,CAElB;EAKI,IAAWC,SAAS,GAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEA,IAAWE,SAAS,GAA0D;IAC1E,OAAO,IAAI,CAACD,MAAM,CAACC,SAAS;EAChC;EAEOC,WAAW,CAACF,MAAgD,EAAE;IACjE,KAAK,EAAE;IAAC;IACR,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;AACJ;AAAC;AAAA,8BApBYH,kCAAkC,UAIb,kCAAkC"}
1
+ {"version":3,"names":["_plugins","require","CmsFieldFilterValueTransformPlugin","Plugin","type","fieldType","config","transform","constructor","exports"],"sources":["CmsFieldFilterValueTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport type { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from \"~/types\";\n\ntype CmsFieldFilterValueTransformPluginParams = Omit<\n CmsFieldFilterValueTransformPluginInterface,\n \"type\"\n>;\nexport class CmsFieldFilterValueTransformPlugin\n extends Plugin\n implements Omit<CmsFieldFilterValueTransformPluginInterface, \"type\">\n{\n public static override type = \"cms-field-filter-value-transform\";\n\n private config: CmsFieldFilterValueTransformPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public get transform(): CmsFieldFilterValueTransformPluginParams[\"transform\"] {\n return this.config.transform;\n }\n\n public constructor(config: CmsFieldFilterValueTransformPluginParams) {\n super();\n this.config = config;\n }\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,kCAAkC,SACnCC,eAAM,CAElB;EACI,OAAuBC,IAAI,GAAG,kCAAkC;EAIhE,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEA,IAAWE,SAASA,CAAA,EAA0D;IAC1E,OAAO,IAAI,CAACD,MAAM,CAACC,SAAS;EAChC;EAEOC,WAAWA,CAACF,MAAgD,EAAE;IACjE,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,MAAM,GAAGA,MAAM;EACxB;AACJ;AAACG,OAAA,CAAAP,kCAAA,GAAAA,kCAAA","ignoreList":[]}
package/plugins/index.js CHANGED
@@ -46,4 +46,6 @@ Object.keys(_CmsFieldFilterValueTransformPlugin).forEach(function (key) {
46
46
  return _CmsFieldFilterValueTransformPlugin[key];
47
47
  }
48
48
  });
49
- });
49
+ });
50
+
51
+ //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryFieldFilterPathPlugin\";\nexport * from \"./CmsEntryFieldSortingPlugin\";\nexport * from \"./CmsEntryFieldFilterPlugin\";\nexport * from \"./CmsFieldFilterValueTransformPlugin\";\n"],"mappings":";;;;;AAAA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
1
+ {"version":3,"names":["_CmsEntryFieldFilterPathPlugin","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_CmsEntryFieldSortingPlugin","_CmsEntryFieldFilterPlugin","_CmsFieldFilterValueTransformPlugin"],"sources":["index.ts"],"sourcesContent":["export * from \"./CmsEntryFieldFilterPathPlugin\";\nexport * from \"./CmsEntryFieldSortingPlugin\";\nexport * from \"./CmsEntryFieldFilterPlugin\";\nexport * from \"./CmsFieldFilterValueTransformPlugin\";\n"],"mappings":";;;;;AAAA,IAAAA,8BAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,8BAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,8BAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,8BAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,2BAAA,GAAAT,OA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