@webiny/api-headless-cms-ddb 0.0.0-unstable.2af142b57e → 0.0.0-unstable.3bc8100a7f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/definitions/entry.d.ts +4 -3
- package/definitions/entry.js +109 -12
- package/definitions/entry.js.map +1 -1
- package/definitions/group.d.ts +4 -3
- package/definitions/group.js +9 -8
- package/definitions/group.js.map +1 -1
- package/definitions/model.d.ts +4 -3
- package/definitions/model.js +26 -8
- package/definitions/model.js.map +1 -1
- package/definitions/system.d.ts +4 -3
- package/definitions/system.js +9 -8
- package/definitions/system.js.map +1 -1
- package/definitions/table.d.ts +5 -5
- package/definitions/table.js +8 -4
- package/definitions/table.js.map +1 -1
- package/dynamoDb/index.js +5 -3
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/path/locationFolderId.d.ts +2 -0
- package/dynamoDb/path/locationFolderId.js +43 -0
- package/dynamoDb/path/locationFolderId.js.map +1 -0
- package/dynamoDb/path/plainObject.js +3 -1
- package/dynamoDb/path/plainObject.js.map +1 -1
- package/dynamoDb/storage/longText.js +4 -1
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.js +24 -58
- package/dynamoDb/storage/richText.js.map +1 -1
- package/dynamoDb/transformValue/datetime.d.ts +1 -1
- package/dynamoDb/transformValue/datetime.js +3 -1
- package/dynamoDb/transformValue/datetime.js.map +1 -1
- package/index.d.ts +1 -1
- package/index.js +16 -23
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.d.ts +17 -0
- package/operations/entry/dataLoader/DataLoaderCache.js +41 -0
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -0
- package/operations/entry/dataLoader/constants.d.ts +1 -0
- package/operations/entry/dataLoader/constants.js +10 -0
- package/operations/entry/dataLoader/constants.js.map +1 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.d.ts +8 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js +25 -0
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.d.ts +4 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js +45 -0
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js +56 -0
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.d.ts +4 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js +56 -0
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -0
- package/operations/entry/dataLoader/getRevisionById.d.ts +4 -0
- package/operations/entry/dataLoader/getRevisionById.js +62 -0
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -0
- package/operations/entry/dataLoader/index.d.ts +8 -0
- package/operations/entry/dataLoader/index.js +40 -0
- package/operations/entry/dataLoader/index.js.map +1 -0
- package/operations/entry/dataLoader/types.d.ts +6 -0
- package/operations/entry/dataLoader/types.js +7 -0
- package/operations/entry/dataLoader/types.js.map +1 -0
- package/operations/entry/dataLoaders.d.ts +12 -27
- package/operations/entry/dataLoaders.js +55 -217
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/filtering/createExpressions.d.ts +4 -4
- package/operations/entry/filtering/createExpressions.js +3 -1
- package/operations/entry/filtering/createExpressions.js.map +1 -1
- package/operations/entry/filtering/createFields.d.ts +6 -4
- package/operations/entry/filtering/createFields.js +77 -74
- package/operations/entry/filtering/createFields.js.map +1 -1
- package/operations/entry/filtering/extractSort.d.ts +3 -3
- package/operations/entry/filtering/extractSort.js +3 -1
- package/operations/entry/filtering/extractSort.js.map +1 -1
- package/operations/entry/filtering/filter.d.ts +3 -3
- package/operations/entry/filtering/filter.js +24 -9
- package/operations/entry/filtering/filter.js.map +1 -1
- package/operations/entry/filtering/fullTextSearch.d.ts +3 -3
- package/operations/entry/filtering/fullTextSearch.js +3 -1
- package/operations/entry/filtering/fullTextSearch.js.map +1 -1
- package/operations/entry/filtering/getValue.js +6 -3
- package/operations/entry/filtering/getValue.js.map +1 -1
- package/operations/entry/filtering/index.js +3 -1
- package/operations/entry/filtering/index.js.map +1 -1
- package/operations/entry/filtering/mapPlugins.d.ts +2 -2
- package/operations/entry/filtering/mapPlugins.js +3 -1
- package/operations/entry/filtering/mapPlugins.js.map +1 -1
- package/operations/entry/filtering/plugins/defaultFilterCreate.d.ts +1 -1
- package/operations/entry/filtering/plugins/defaultFilterCreate.js +6 -2
- package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/index.d.ts +1 -1
- package/operations/entry/filtering/plugins/index.js +5 -2
- package/operations/entry/filtering/plugins/index.js.map +1 -1
- package/operations/entry/filtering/plugins/objectFilterCreate.d.ts +1 -1
- package/operations/entry/filtering/plugins/objectFilterCreate.js +6 -2
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/refFilterCreate.d.ts +2 -1
- package/operations/entry/filtering/plugins/refFilterCreate.js +12 -3
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.d.ts +2 -0
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js +65 -0
- package/operations/entry/filtering/plugins/searchableJsonFilterCreate.js.map +1 -0
- package/operations/entry/filtering/sort.d.ts +3 -3
- package/operations/entry/filtering/sort.js +5 -3
- package/operations/entry/filtering/sort.js.map +1 -1
- package/operations/entry/filtering/systemFields.d.ts +2 -2
- package/operations/entry/filtering/systemFields.js +49 -29
- package/operations/entry/filtering/systemFields.js.map +1 -1
- package/operations/entry/filtering/transform.d.ts +1 -1
- package/operations/entry/filtering/transform.js +3 -1
- package/operations/entry/filtering/transform.js.map +1 -1
- package/operations/entry/filtering/types.d.ts +2 -2
- package/operations/entry/filtering/types.js +3 -1
- package/operations/entry/filtering/types.js.map +1 -1
- package/operations/entry/filtering/values.d.ts +1 -1
- package/operations/entry/filtering/values.js +3 -1
- package/operations/entry/filtering/values.js.map +1 -1
- package/operations/entry/filtering/where.js +6 -3
- package/operations/entry/filtering/where.js.map +1 -1
- package/operations/entry/index.d.ts +3 -3
- package/operations/entry/index.js +712 -193
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.js +3 -1
- package/operations/entry/keys.js.map +1 -1
- package/operations/group/index.d.ts +3 -3
- package/operations/group/index.js +33 -21
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.d.ts +2 -2
- package/operations/model/index.js +26 -13
- package/operations/model/index.js.map +1 -1
- package/operations/system/index.d.ts +2 -2
- package/operations/system/index.js +19 -7
- package/operations/system/index.js.map +1 -1
- package/package.json +21 -26
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +3 -2
- package/plugins/CmsEntryFieldFilterPathPlugin.js +11 -4
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldFilterPlugin.d.ts +10 -10
- package/plugins/CmsEntryFieldFilterPlugin.js +9 -6
- package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldSortingPlugin.d.ts +2 -2
- package/plugins/CmsEntryFieldSortingPlugin.js +4 -5
- package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -1
- package/plugins/CmsFieldFilterValueTransformPlugin.d.ts +11 -0
- package/plugins/CmsFieldFilterValueTransformPlugin.js +23 -0
- package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +14 -1
- package/plugins/index.js.map +1 -1
- package/types.d.ts +20 -13
- package/types.js +5 -5
- package/types.js.map +1 -1
- package/definitions/settings.d.ts +0 -9
- package/definitions/settings.js +0 -53
- package/definitions/settings.js.map +0 -1
- package/dynamoDb/storage/date.d.ts +0 -3
- package/dynamoDb/storage/date.js +0 -91
- package/dynamoDb/storage/date.js.map +0 -1
- package/operations/entry/systemFields.d.ts +0 -2
- package/operations/entry/systemFields.js +0 -72
- package/operations/entry/systemFields.js.map +0 -1
- package/operations/settings/index.d.ts +0 -7
- package/operations/settings/index.js +0 -111
- 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
|
|
48
|
-
|
|
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
|
|
66
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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","
|
|
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,GAAIC,MAA2B,IAAa;EAChE,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGF,MAAM;EACjC,IAAI,CAACC,MAAM,EAAE;IACT,MAAM,IAAIE,cAAW,CAAC,2DAA2D,CAAC;EACtF,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;IAChB,MAAM,IAAIC,cAAW,CAAC,2DAA2D,CAAC;EACtF;EACA,OAAO,KAAKF,MAAM,MAAMC,MAAM,SAAS;AAC3C,CAAC;AAKD,MAAME,aAAa,GAAIJ,MAAqB,IAAa;EACrD,OAAOA,MAAM,CAACK,OAAO;AACzB,CAAC;AAMD,MAAMC,UAAU,GAAIN,MAA2C,IAAW;EACtE,OAAO;IACHO,EAAE,EAAER,kBAAkB,CAACC,MAAM,CAAC;IAC9BQ,EAAE,EAAEJ,aAAa,CAACJ,MAAM;EAC5B,CAAC;AACL,CAAC;AAED,MAAMS,UAAU,GAAGA,CAAA,KAAc;EAC7B,OAAO,WAAW;AACtB,CAAC;AAKM,MAAMC,6BAA6B,GACtCV,MAA2C,IACf;EAC5B,MAAM;IAAEW;EAAO,CAAC,GAAGX,MAAM;EAEzB,MAAMY,MAAM,GAAG,MAAOZ,MAA6C,IAAK;IACpE,MAAM;MAAEa;IAAM,CAAC,GAAGb,MAAM;IAExB,MAAMc,IAAI,GAAGR,UAAU,CAACO,KAAK,CAAC;IAE9B,IAAI;MACA,MAAM,IAAAE,eAAG,EAAC;QACNJ,MAAM;QACNK,IAAI,EAAE;UACF,GAAG,IAAAC,oBAAW,EAACN,MAAM,EAAEE,KAAK,CAAC;UAC7B,GAAGC,IAAI;UACPI,IAAI,EAAET,UAAU,CAAC;QACrB;MACJ,CAAC,CAAC;MACF,OAAOI,KAAK;IAChB,CAAC,CAAC,OAAOM,EAAE,EAAE;MACT,MAAM,IAAIhB,cAAW,CAAC,qCAAqC,EAAE,oBAAoB,EAAE;QAC/EiB,KAAK,EAAED,EAAE;QACTN,KAAK;QACLC;MACJ,CAAC,CAAC;IACN;EACJ,CAAC;EAED,MAAMO,MAAM,GAAG,MAAOrB,MAA6C,IAAK;IACpE,MAAM;MAAEa;IAAM,CAAC,GAAGb,MAAM;IAExB,MAAMc,IAAI,GAAGR,UAAU,CAACO,KAAK,CAAC;IAE9B,IAAI;MACA,MAAM,IAAAE,eAAG,EAAC;QACNJ,MAAM;QACNK,IAAI,EAAE;UACF,GAAG,IAAAC,oBAAW,EAACN,MAAM,EAAEE,KAAK,CAAC;UAC7B,GAAGC,IAAI;UACPI,IAAI,EAAET,UAAU,CAAC;QACrB;MACJ,CAAC,CAAC;MACF,OAAOI,KAAK;IAChB,CAAC,CAAC,OAAOM,EAAE,EAAE;MACT,MAAM,IAAIhB,cAAW,CACjBgB,EAAE,CAACG,OAAO,IAAI,yBAAyB,EACvCH,EAAE,CAACI,IAAI,IAAI,oBAAoB,EAC/B;QACIH,KAAK,EAAED,EAAE;QACTN,KAAK;QACLC;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMU,WAAW,GAAG,MAAOxB,MAA6C,IAAK;IACzE,MAAM;MAAEa;IAAM,CAAC,GAAGb,MAAM;IACxB,MAAMc,IAAI,GAAGR,UAAU,CAACO,KAAK,CAAC;IAE9B,IAAI;MACA,MAAM,IAAAY,sBAAU,EAAC;QACbd,MAAM;QACNG;MACJ,CAAC,CAAC;MACF,OAAOD,KAAK;IAChB,CAAC,CAAC,OAAOM,EAAE,EAAE;MACT,MAAM,IAAIhB,cAAW,CACjBgB,EAAE,CAACG,OAAO,IAAI,yBAAyB,EACvCH,EAAE,CAACI,IAAI,IAAI,oBAAoB,EAC/B;QACIH,KAAK,EAAED,EAAE;QACTN,KAAK;QACLC;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMY,GAAG,GAAG,MAAO1B,MAA0C,IAAK;IAC9D,MAAMc,IAAI,GAAGR,UAAU,CAACN,MAAM,CAAC;IAE/B,IAAI;MACA,OAAO,MAAM,IAAA2B,aAAQ,EAAW;QAC5BhB,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
|
|
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
|
|
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
|
|
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
|
|
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
|
-
|
|
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","
|
|
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_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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AASA,MAAMG,kBAAkB,GAAGA,CAAC;EAAEC;AAA2B,CAAC,KAAa;EACnE,OAAO,KAAKA,MAAM,CAACC,WAAW,CAAC,CAAC,SAAS;AAC7C,CAAC;AACD,MAAMC,aAAa,GAAGA,CAAA,KAAc;EAChC,OAAO,KAAK;AAChB,CAAC;AAMD,MAAMC,UAAU,GAAIC,MAA0B,IAAW;EACrD,OAAO;IACHC,EAAE,EAAEN,kBAAkB,CAACK,MAAM,CAAC;IAC9BE,EAAE,EAAEJ,aAAa,CAAC;EACtB,CAAC;AACL,CAAC;AAEM,MAAMK,6BAA6B,GACtCH,MAA2C,IACd;EAC7B,MAAM;IAAEI;EAAO,CAAC,GAAGJ,MAAM;EAEzB,MAAMK,MAAM,GAAG,MAAAA,CAAO;IAAEC;EAA+C,CAAC,KAAK;IACzE,MAAMC,IAAI,GAAGR,UAAU,CAACO,MAAM,CAAC;IAC/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,MAAMQ,MAAM,GAAG,MAAOf,MAA8C,IAAK;IACrE,MAAM;MAAEM;IAAO,CAAC,GAAGN,MAAM;IAEzB,MAAMO,IAAI,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,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.3bc8100a7f",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"@webiny/api-headless-cms",
|
|
7
7
|
"storage-operations",
|
|
8
8
|
"dynamodb",
|
|
9
|
+
"ddb",
|
|
9
10
|
"cms:ddb"
|
|
10
11
|
],
|
|
11
12
|
"repository": {
|
|
@@ -21,40 +22,34 @@
|
|
|
21
22
|
],
|
|
22
23
|
"license": "MIT",
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@
|
|
25
|
-
"@webiny/api-headless-cms": "0.0.0-unstable.
|
|
26
|
-
"@webiny/
|
|
27
|
-
"@webiny/
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
30
|
-
"
|
|
31
|
-
"dataloader": "2.2.
|
|
25
|
+
"@webiny/api": "0.0.0-unstable.3bc8100a7f",
|
|
26
|
+
"@webiny/api-headless-cms": "0.0.0-unstable.3bc8100a7f",
|
|
27
|
+
"@webiny/aws-sdk": "0.0.0-unstable.3bc8100a7f",
|
|
28
|
+
"@webiny/db-dynamodb": "0.0.0-unstable.3bc8100a7f",
|
|
29
|
+
"@webiny/error": "0.0.0-unstable.3bc8100a7f",
|
|
30
|
+
"@webiny/handler-db": "0.0.0-unstable.3bc8100a7f",
|
|
31
|
+
"@webiny/utils": "0.0.0-unstable.3bc8100a7f",
|
|
32
|
+
"dataloader": "2.2.3",
|
|
33
|
+
"dot-object": "2.1.5",
|
|
32
34
|
"dot-prop": "6.0.1",
|
|
33
|
-
"dynamodb-toolbox": "0.3.5",
|
|
34
|
-
"jsonpack": "1.1.5",
|
|
35
35
|
"lodash": "4.17.21"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@
|
|
39
|
-
"@
|
|
40
|
-
"@
|
|
41
|
-
"@
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"jest": "^28.1.0",
|
|
46
|
-
"jest-dynalite": "^3.2.0",
|
|
47
|
-
"jest-environment-node": "^27.2.4",
|
|
48
|
-
"ttypescript": "^1.5.12",
|
|
49
|
-
"typescript": "4.7.4"
|
|
38
|
+
"@types/dot-object": "2.1.6",
|
|
39
|
+
"@types/jsonpack": "1.1.6",
|
|
40
|
+
"@webiny/plugins": "0.0.0-unstable.3bc8100a7f",
|
|
41
|
+
"@webiny/project-utils": "0.0.0-unstable.3bc8100a7f",
|
|
42
|
+
"jest": "29.7.0",
|
|
43
|
+
"jest-dynalite": "3.6.1",
|
|
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": "
|
|
57
|
-
"watch": "
|
|
51
|
+
"build": "node ../cli/bin.js run build",
|
|
52
|
+
"watch": "node ../cli/bin.js run watch"
|
|
58
53
|
},
|
|
59
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "3bc8100a7f1fb3a8d6a3454a2765f8ef377c279e"
|
|
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;
|
|
@@ -11,12 +11,13 @@ export interface CmsEntryFieldFilterPathPluginParams {
|
|
|
11
11
|
fieldType: string;
|
|
12
12
|
fieldId?: string[];
|
|
13
13
|
path: string | CreatePathCallable;
|
|
14
|
+
canUse?: (field: Pick<CmsModelField, "fieldId" | "type">, parents?: string[]) => boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare class CmsEntryFieldFilterPathPlugin extends Plugin {
|
|
16
17
|
static readonly type: string;
|
|
17
18
|
private readonly config;
|
|
18
19
|
get fieldType(): string;
|
|
19
20
|
constructor(config: CmsEntryFieldFilterPathPluginParams);
|
|
20
|
-
canUse(field: Pick<CmsModelField, "fieldId" | "type"
|
|
21
|
+
canUse(field: Pick<CmsModelField, "fieldId" | "type">, parents: string[]): boolean;
|
|
21
22
|
createPath(params: CreatePathCallableParams): string;
|
|
22
23
|
}
|
|
@@ -5,22 +5,28 @@ 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
|
-
canUse(field) {
|
|
25
|
+
canUse(field, parents) {
|
|
22
26
|
if (field.type !== this.config.fieldType) {
|
|
23
27
|
return false;
|
|
28
|
+
} else if (this.config.canUse) {
|
|
29
|
+
return this.config.canUse(field, parents);
|
|
24
30
|
}
|
|
25
31
|
const fieldId = this.config.fieldId;
|
|
26
32
|
if (!fieldId || Array.isArray(fieldId) === false || fieldId.length === 0) {
|
|
@@ -38,4 +44,5 @@ class CmsEntryFieldFilterPathPlugin extends _Plugin.Plugin {
|
|
|
38
44
|
}
|
|
39
45
|
}
|
|
40
46
|
exports.CmsEntryFieldFilterPathPlugin = CmsEntryFieldFilterPathPlugin;
|
|
41
|
-
|
|
47
|
+
|
|
48
|
+
//# sourceMappingURL=CmsEntryFieldFilterPathPlugin.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryFieldFilterPathPlugin","Plugin","fieldType","config","constructor","name","
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_Plugin","CmsEntryFieldFilterPathPlugin","Plugin","type","fieldType","config","constructor","name","canUse","field","parents","fieldId","Array","isArray","length","includes","createPath","params","path","WebinyError","exports"],"sources":["CmsEntryFieldFilterPathPlugin.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { Plugin } from \"@webiny/plugins/Plugin\";\nimport type { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\nexport interface CreatePathCallableParams {\n field: Partial<CmsModelField> & Pick<CmsModelField, \"fieldId\" | \"storageId\" | \"id\">;\n index?: number;\n}\nexport interface CreatePathCallable {\n (params: CreatePathCallableParams): string;\n}\nexport interface CmsEntryFieldFilterPathPluginParams {\n fieldType: string;\n fieldId?: string[];\n path: string | CreatePathCallable;\n canUse?: (field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents?: string[]) => boolean;\n}\nexport class CmsEntryFieldFilterPathPlugin extends Plugin {\n public static override readonly type: string = \"cms-field-filter-path\";\n\n private readonly config: CmsEntryFieldFilterPathPluginParams;\n\n public get fieldType(): string {\n return this.config.fieldType;\n }\n\n public constructor(config: CmsEntryFieldFilterPathPluginParams) {\n super();\n\n this.config = config;\n\n /**\n * We expect error here because we know that `this.constructor.type` is defined, but TS does not.\n */\n // @ts-expect-error\n this.name = `${this.constructor.type}-${this.config.fieldType}`;\n }\n\n public canUse(field: Pick<CmsModelField, \"fieldId\" | \"type\">, parents: string[]): boolean {\n if (field.type !== this.config.fieldType) {\n return false;\n } else if (this.config.canUse) {\n return this.config.canUse(field, parents);\n }\n const fieldId = this.config.fieldId;\n if (!fieldId || Array.isArray(fieldId) === false || fieldId.length === 0) {\n return true;\n }\n return fieldId.includes(field.fieldId);\n }\n\n public createPath(params: CreatePathCallableParams): string {\n if (typeof this.config.path === \"function\") {\n return this.config.path(params);\n } else if (typeof this.config.path === \"string\") {\n return this.config.path;\n }\n throw new WebinyError(`Missing path in \"${this.name}\" plugin.`);\n }\n}\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAgBO,MAAME,6BAA6B,SAASC,cAAM,CAAC;EACtD,OAAgCC,IAAI,GAAW,uBAAuB;EAItE,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEOE,WAAWA,CAACD,MAA2C,EAAE;IAC5D,KAAK,CAAC,CAAC;IAEP,IAAI,CAACA,MAAM,GAAGA,MAAM;;IAEpB;AACR;AACA;IACQ;IACA,IAAI,CAACE,IAAI,GAAG,GAAG,IAAI,CAACD,WAAW,CAACH,IAAI,IAAI,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;EACnE;EAEOI,MAAMA,CAACC,KAA8C,EAAEC,OAAiB,EAAW;IACtF,IAAID,KAAK,CAACN,IAAI,KAAK,IAAI,CAACE,MAAM,CAACD,SAAS,EAAE;MACtC,OAAO,KAAK;IAChB,CAAC,MAAM,IAAI,IAAI,CAACC,MAAM,CAACG,MAAM,EAAE;MAC3B,OAAO,IAAI,CAACH,MAAM,CAACG,MAAM,CAACC,KAAK,EAAEC,OAAO,CAAC;IAC7C;IACA,MAAMC,OAAO,GAAG,IAAI,CAACN,MAAM,CAACM,OAAO;IACnC,IAAI,CAACA,OAAO,IAAIC,KAAK,CAACC,OAAO,CAACF,OAAO,CAAC,KAAK,KAAK,IAAIA,OAAO,CAACG,MAAM,KAAK,CAAC,EAAE;MACtE,OAAO,IAAI;IACf;IACA,OAAOH,OAAO,CAACI,QAAQ,CAACN,KAAK,CAACE,OAAO,CAAC;EAC1C;EAEOK,UAAUA,CAACC,MAAgC,EAAU;IACxD,IAAI,OAAO,IAAI,CAACZ,MAAM,CAACa,IAAI,KAAK,UAAU,EAAE;MACxC,OAAO,IAAI,CAACb,MAAM,CAACa,IAAI,CAACD,MAAM,CAAC;IACnC,CAAC,MAAM,IAAI,OAAO,IAAI,CAACZ,MAAM,CAACa,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO,IAAI,CAACb,MAAM,CAACa,IAAI;IAC3B;IACA,MAAM,IAAIC,cAAW,CAAC,oBAAoB,IAAI,CAACZ,IAAI,WAAW,CAAC;EACnE;AACJ;AAACa,OAAA,CAAAnB,6BAAA,GAAAA,6BAAA","ignoreList":[]}
|
|
@@ -1,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:
|
|
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
|
-
|
|
24
|
-
|
|
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
|
|
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":"
|
|
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":[]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
import type { CmsFieldFilterValueTransformPlugin as CmsFieldFilterValueTransformPluginInterface } from "../types";
|
|
3
|
+
type CmsFieldFilterValueTransformPluginParams = Omit<CmsFieldFilterValueTransformPluginInterface, "type">;
|
|
4
|
+
export declare class CmsFieldFilterValueTransformPlugin extends Plugin implements Omit<CmsFieldFilterValueTransformPluginInterface, "type"> {
|
|
5
|
+
static type: string;
|
|
6
|
+
private config;
|
|
7
|
+
get fieldType(): string;
|
|
8
|
+
get transform(): CmsFieldFilterValueTransformPluginParams["transform"];
|
|
9
|
+
constructor(config: CmsFieldFilterValueTransformPluginParams);
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.CmsFieldFilterValueTransformPlugin = void 0;
|
|
7
|
+
var _plugins = require("@webiny/plugins");
|
|
8
|
+
class CmsFieldFilterValueTransformPlugin extends _plugins.Plugin {
|
|
9
|
+
static type = "cms-field-filter-value-transform";
|
|
10
|
+
get fieldType() {
|
|
11
|
+
return this.config.fieldType;
|
|
12
|
+
}
|
|
13
|
+
get transform() {
|
|
14
|
+
return this.config.transform;
|
|
15
|
+
}
|
|
16
|
+
constructor(config) {
|
|
17
|
+
super();
|
|
18
|
+
this.config = config;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.CmsFieldFilterValueTransformPlugin = CmsFieldFilterValueTransformPlugin;
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=CmsFieldFilterValueTransformPlugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_plugins","require","CmsFieldFilterValueTransformPlugin","Plugin","type","fieldType","config","transform","constructor","exports"],"sources":["CmsFieldFilterValueTransformPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport 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.d.ts
CHANGED
package/plugins/index.js
CHANGED
|
@@ -35,4 +35,17 @@ Object.keys(_CmsEntryFieldFilterPlugin).forEach(function (key) {
|
|
|
35
35
|
return _CmsEntryFieldFilterPlugin[key];
|
|
36
36
|
}
|
|
37
37
|
});
|
|
38
|
-
});
|
|
38
|
+
});
|
|
39
|
+
var _CmsFieldFilterValueTransformPlugin = require("./CmsFieldFilterValueTransformPlugin");
|
|
40
|
+
Object.keys(_CmsFieldFilterValueTransformPlugin).forEach(function (key) {
|
|
41
|
+
if (key === "default" || key === "__esModule") return;
|
|
42
|
+
if (key in exports && exports[key] === _CmsFieldFilterValueTransformPlugin[key]) return;
|
|
43
|
+
Object.defineProperty(exports, key, {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
get: function () {
|
|
46
|
+
return _CmsFieldFilterValueTransformPlugin[key];
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=index.js.map
|