@webiny/api-headless-cms-ddb 5.36.2 → 5.37.0-beta.1
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.js +3 -0
- package/definitions/entry.js.map +1 -1
- package/definitions/group.js.map +1 -1
- package/definitions/model.js.map +1 -1
- package/definitions/settings.js.map +1 -1
- package/definitions/system.js.map +1 -1
- package/definitions/table.js.map +1 -1
- package/dynamoDb/index.js +2 -1
- package/dynamoDb/index.js.map +1 -1
- package/dynamoDb/path/locationFolderId.d.ts +2 -0
- package/dynamoDb/path/locationFolderId.js +41 -0
- package/dynamoDb/path/locationFolderId.js.map +1 -0
- package/dynamoDb/path/plainObject.js.map +1 -1
- package/dynamoDb/storage/date.js +2 -11
- package/dynamoDb/storage/date.js.map +1 -1
- package/dynamoDb/storage/longText.js.map +1 -1
- package/dynamoDb/storage/richText.js +1 -2
- package/dynamoDb/storage/richText.js.map +1 -1
- package/dynamoDb/transformValue/datetime.js.map +1 -1
- package/index.js.map +1 -1
- package/operations/entry/dataLoader/DataLoaderCache.js.map +1 -1
- package/operations/entry/dataLoader/constants.js.map +1 -1
- package/operations/entry/dataLoader/createBatchScheduleFn.js.map +1 -1
- package/operations/entry/dataLoader/getAllEntryRevisions.js.map +1 -1
- package/operations/entry/dataLoader/getLatestRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getPublishedRevisionByEntryId.js.map +1 -1
- package/operations/entry/dataLoader/getRevisionById.js.map +1 -1
- package/operations/entry/dataLoader/index.js.map +1 -1
- package/operations/entry/dataLoaders.js.map +1 -1
- package/operations/entry/filtering/createExpressions.js.map +1 -1
- package/operations/entry/filtering/createFields.d.ts +3 -1
- package/operations/entry/filtering/createFields.js +72 -72
- package/operations/entry/filtering/createFields.js.map +1 -1
- package/operations/entry/filtering/extractSort.js.map +1 -1
- package/operations/entry/filtering/filter.js.map +1 -1
- package/operations/entry/filtering/fullTextSearch.js.map +1 -1
- package/operations/entry/filtering/getValue.js.map +1 -1
- package/operations/entry/filtering/index.js.map +1 -1
- package/operations/entry/filtering/mapPlugins.js.map +1 -1
- package/operations/entry/filtering/plugins/defaultFilterCreate.js +3 -1
- package/operations/entry/filtering/plugins/defaultFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/index.js.map +1 -1
- package/operations/entry/filtering/plugins/objectFilterCreate.js +3 -1
- package/operations/entry/filtering/plugins/objectFilterCreate.js.map +1 -1
- package/operations/entry/filtering/plugins/refFilterCreate.js +3 -1
- package/operations/entry/filtering/plugins/refFilterCreate.js.map +1 -1
- package/operations/entry/filtering/sort.js.map +1 -1
- package/operations/entry/filtering/systemFields.js +18 -0
- package/operations/entry/filtering/systemFields.js.map +1 -1
- package/operations/entry/filtering/transform.js.map +1 -1
- package/operations/entry/filtering/values.js.map +1 -1
- package/operations/entry/filtering/where.js +3 -2
- package/operations/entry/filtering/where.js.map +1 -1
- package/operations/entry/index.js +70 -1
- package/operations/entry/index.js.map +1 -1
- package/operations/entry/keys.js.map +1 -1
- package/operations/group/index.js.map +1 -1
- package/operations/model/index.js.map +1 -1
- package/operations/settings/index.js.map +1 -1
- package/operations/system/index.js.map +1 -1
- package/package.json +16 -16
- package/plugins/CmsEntryFieldFilterPathPlugin.d.ts +2 -1
- package/plugins/CmsEntryFieldFilterPathPlugin.js +3 -1
- package/plugins/CmsEntryFieldFilterPathPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldFilterPlugin.js +5 -0
- package/plugins/CmsEntryFieldFilterPlugin.js.map +1 -1
- package/plugins/CmsEntryFieldSortingPlugin.js.map +1 -1
- package/plugins/CmsFieldFilterValueTransformPlugin.js.map +1 -1
- package/plugins/index.js.map +1 -1
- package/types.js +4 -4
- package/types.js.map +1 -1
- package/operations/entry/systemFields.d.ts +0 -2
- package/operations/entry/systemFields.js +0 -72
- package/operations/entry/systemFields.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createPartitionKey","params","tenant","locale","createSortKeys","id","createKeys","PK","SK","createType","createGroupsStorageOperations","entity","plugins","filteringPlugins","byType","ValueFilterPlugin","type","length","WebinyError","create","group","keys","put","TYPE","ex","message","code","error","update","deleteGroup","delete","get","getRecord","cleanupItem","list","sort","where","queryAllParams","partitionKey","options","gte","records","queryAll","filteredItems","filterItems","items","fields","sortItems"],"sources":["index.ts"],"sourcesContent":["import {\n CmsGroup,\n CmsGroupStorageOperations,\n CmsGroupStorageOperationsCreateParams,\n CmsGroupStorageOperationsDeleteParams,\n CmsGroupStorageOperationsGetParams,\n CmsGroupStorageOperationsListParams,\n CmsGroupStorageOperationsUpdateParams\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\";\nimport { queryAll, QueryAllParams } from \"@webiny/db-dynamodb/utils/query\";\nimport { filterItems } from \"@webiny/db-dynamodb/utils/filter\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport { sortItems } from \"@webiny/db-dynamodb/utils/sort\";\n\ninterface PartitionKeyParams {\n tenant: string;\n locale: string;\n}\nconst createPartitionKey = (params: PartitionKeyParams): string => {\n const { tenant, locale } = params;\n return `T#${tenant}#L#${locale}#CMS#CMG`;\n};\n\ninterface SortKeyParams {\n id: string;\n}\nconst createSortKeys = (params: SortKeyParams): string => {\n const { id } = params;\n return id;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\nconst createKeys = (params: PartitionKeyParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKeys(params)\n };\n};\n\nconst createType = (): string => {\n return \"cms.group\";\n};\n\ninterface CreateGroupsStorageOperationsParams {\n entity: Entity<any>;\n plugins: PluginsContainer;\n}\nexport const createGroupsStorageOperations = (\n params: CreateGroupsStorageOperationsParams\n): CmsGroupStorageOperations => {\n const { entity, plugins } = params;\n\n const filteringPlugins = plugins.byType<ValueFilterPlugin>(ValueFilterPlugin.type);\n if (filteringPlugins.length === 0) {\n throw new WebinyError(\n \"DynamoDB filtering plugins not loaded.\",\n \"MISSING_DYNAMODB_FILTERING_PLUGINS\"\n );\n }\n\n const create = async (params: CmsGroupStorageOperationsCreateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n ...group,\n TYPE: createType(),\n ...keys\n });\n return group;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create group.\",\n ex.code || \"CREATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const update = async (params: CmsGroupStorageOperationsUpdateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n ...group,\n TYPE: createType(),\n ...keys\n });\n return group;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update group.\",\n ex.code || \"UPDATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const deleteGroup = async (params: CmsGroupStorageOperationsDeleteParams) => {\n const { group } = params;\n // TODO make sure that group has locale and tenant on it - add it in the crud just in case\n const keys = createKeys(group);\n\n try {\n await entity.delete(keys);\n return group;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete group.\",\n ex.code || \"DELETE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const get = async (params: CmsGroupStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const group = await getRecord<CmsGroup>({\n entity,\n keys\n });\n\n return cleanupItem(entity, group);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get group.\",\n ex.code || \"GET_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n keys\n }\n );\n }\n };\n const list = async (params: CmsGroupStorageOperationsListParams) => {\n const { sort, where } = params;\n\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey: createPartitionKey(where),\n options: {\n gte: \" \"\n }\n };\n\n let records: CmsGroup[] = [];\n try {\n records = await queryAll(queryAllParams);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list groups.\",\n ex.code || \"LIST_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n sort,\n where\n }\n );\n }\n\n const filteredItems = filterItems({\n items: records,\n where,\n fields: [],\n plugins\n });\n if (!sort || sort.length === 0) {\n return filteredItems;\n }\n return sortItems({\n items: filteredItems,\n sort,\n fields: []\n });\n };\n\n return {\n create,\n update,\n delete: deleteGroup,\n get,\n list\n };\n};\n"],"mappings":";;;;;;;;AAUA;AACA;AACA;AACA;AACA;AAEA;AACA;AAMA,MAAMA,kBAAkB,GAAIC,MAA0B,IAAa;EAC/D,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGF,MAAM;EACjC,OAAQ,KAAIC,MAAO,MAAKC,MAAO,UAAS;AAC5C,CAAC;AAKD,MAAMC,cAAc,GAAIH,MAAqB,IAAa;EACtD,MAAM;IAAEI;EAAG,CAAC,GAAGJ,MAAM;EACrB,OAAOI,EAAE;AACb,CAAC;AAMD,MAAMC,UAAU,GAAIL,MAA0C,IAAW;EACrE,OAAO;IACHM,EAAE,EAAEP,kBAAkB,CAACC,MAAM,CAAC;IAC9BO,EAAE,EAAEJ,cAAc,CAACH,MAAM;EAC7B,CAAC;AACL,CAAC;AAED,MAAMQ,UAAU,GAAG,MAAc;EAC7B,OAAO,WAAW;AACtB,CAAC;AAMM,MAAMC,6BAA6B,GACtCT,MAA2C,IACf;EAC5B,MAAM;IAAEU,MAAM;IAAEC;EAAQ,CAAC,GAAGX,MAAM;EAElC,MAAMY,gBAAgB,GAAGD,OAAO,CAACE,MAAM,CAAoBC,oCAAiB,CAACC,IAAI,CAAC;EAClF,IAAIH,gBAAgB,CAACI,MAAM,KAAK,CAAC,EAAE;IAC/B,MAAM,IAAIC,cAAW,CACjB,wCAAwC,EACxC,oCAAoC,CAC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AAM;QACTkC,IAAI;QACJC;MAAK,GAEZ;IACL;IAEA,MAAMO,aAAa,GAAG,IAAAC,mBAAW,EAAC;MAC9BC,KAAK,EAAEJ,OAAO;MACdL,KAAK;MACLU,MAAM,EAAE,EAAE;MACVlC;IACJ,CAAC,CAAC;IACF,IAAI,CAACuB,IAAI,IAAIA,IAAI,CAAClB,MAAM,KAAK,CAAC,EAAE;MAC5B,OAAO0B,aAAa;IACxB;IACA,OAAO,IAAAI,eAAS,EAAC;MACbF,KAAK,EAAEF,aAAa;MACpBR,IAAI;MACJW,MAAM,EAAE;IACZ,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACH3B,MAAM;IACNS,MAAM;IACNE,MAAM,EAAED,WAAW;IACnBE,GAAG;IACHG;EACJ,CAAC;AACL,CAAC;AAAC"}
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_get","_cleanup","_query","_filter","_ValueFilterPlugin","_sort","createPartitionKey","params","tenant","locale","createSortKeys","id","createKeys","PK","SK","createType","createGroupsStorageOperations","entity","plugins","filteringPlugins","byType","ValueFilterPlugin","type","length","WebinyError","create","group","keys","put","_objectSpread2","default","TYPE","ex","message","code","error","update","deleteGroup","delete","get","getRecord","cleanupItem","list","sort","where","queryAllParams","partitionKey","options","gte","records","queryAll","filteredItems","filterItems","items","fields","sortItems","exports"],"sources":["index.ts"],"sourcesContent":["import {\n CmsGroup,\n CmsGroupStorageOperations,\n CmsGroupStorageOperationsCreateParams,\n CmsGroupStorageOperationsDeleteParams,\n CmsGroupStorageOperationsGetParams,\n CmsGroupStorageOperationsListParams,\n CmsGroupStorageOperationsUpdateParams\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\";\nimport { queryAll, QueryAllParams } from \"@webiny/db-dynamodb/utils/query\";\nimport { filterItems } from \"@webiny/db-dynamodb/utils/filter\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { ValueFilterPlugin } from \"@webiny/db-dynamodb/plugins/definitions/ValueFilterPlugin\";\nimport { sortItems } from \"@webiny/db-dynamodb/utils/sort\";\n\ninterface PartitionKeyParams {\n tenant: string;\n locale: string;\n}\nconst createPartitionKey = (params: PartitionKeyParams): string => {\n const { tenant, locale } = params;\n return `T#${tenant}#L#${locale}#CMS#CMG`;\n};\n\ninterface SortKeyParams {\n id: string;\n}\nconst createSortKeys = (params: SortKeyParams): string => {\n const { id } = params;\n return id;\n};\n\ninterface Keys {\n PK: string;\n SK: string;\n}\nconst createKeys = (params: PartitionKeyParams & SortKeyParams): Keys => {\n return {\n PK: createPartitionKey(params),\n SK: createSortKeys(params)\n };\n};\n\nconst createType = (): string => {\n return \"cms.group\";\n};\n\ninterface CreateGroupsStorageOperationsParams {\n entity: Entity<any>;\n plugins: PluginsContainer;\n}\nexport const createGroupsStorageOperations = (\n params: CreateGroupsStorageOperationsParams\n): CmsGroupStorageOperations => {\n const { entity, plugins } = params;\n\n const filteringPlugins = plugins.byType<ValueFilterPlugin>(ValueFilterPlugin.type);\n if (filteringPlugins.length === 0) {\n throw new WebinyError(\n \"DynamoDB filtering plugins not loaded.\",\n \"MISSING_DYNAMODB_FILTERING_PLUGINS\"\n );\n }\n\n const create = async (params: CmsGroupStorageOperationsCreateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n ...group,\n TYPE: createType(),\n ...keys\n });\n return group;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create group.\",\n ex.code || \"CREATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const update = async (params: CmsGroupStorageOperationsUpdateParams) => {\n const { group } = params;\n const keys = createKeys(group);\n try {\n await entity.put({\n ...group,\n TYPE: createType(),\n ...keys\n });\n return group;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update group.\",\n ex.code || \"UPDATE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const deleteGroup = async (params: CmsGroupStorageOperationsDeleteParams) => {\n const { group } = params;\n // TODO make sure that group has locale and tenant on it - add it in the crud just in case\n const keys = createKeys(group);\n\n try {\n await entity.delete(keys);\n return group;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not delete group.\",\n ex.code || \"DELETE_GROUP_ERROR\",\n {\n error: ex,\n group,\n keys\n }\n );\n }\n };\n const get = async (params: CmsGroupStorageOperationsGetParams) => {\n const keys = createKeys(params);\n\n try {\n const group = await getRecord<CmsGroup>({\n entity,\n keys\n });\n\n return cleanupItem(entity, group);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get group.\",\n ex.code || \"GET_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n keys\n }\n );\n }\n };\n const list = async (params: CmsGroupStorageOperationsListParams) => {\n const { sort, where } = params;\n\n const queryAllParams: QueryAllParams = {\n entity,\n partitionKey: createPartitionKey(where),\n options: {\n gte: \" \"\n }\n };\n\n let records: CmsGroup[] = [];\n try {\n records = await queryAll(queryAllParams);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not list groups.\",\n ex.code || \"LIST_GROUP_ERROR\",\n {\n error: ex,\n ...params,\n sort,\n where\n }\n );\n }\n\n const filteredItems = filterItems({\n items: records,\n where,\n fields: [],\n plugins\n });\n if (!sort || sort.length === 0) {\n return filteredItems;\n }\n return sortItems({\n items: filteredItems,\n sort,\n fields: []\n });\n };\n\n return {\n create,\n update,\n delete: deleteGroup,\n get,\n list\n };\n};\n"],"mappings":";;;;;;;;AAUA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAEA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IA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IACJ,CAAC,CAAC;IACF,IAAI,CAACyB,IAAI,IAAIA,IAAI,CAACpB,MAAM,KAAK,CAAC,EAAE;MAC5B,OAAO4B,aAAa;IACxB;IACA,OAAO,IAAAI,eAAS,EAAC;MACbF,KAAK,EAAEF,aAAa;MACpBR,IAAI;MACJW,MAAM,EAAE;IACZ,CAAC,CAAC;EACN,CAAC;EAED,OAAO;IACH7B,MAAM;IACNW,MAAM;IACNE,MAAM,EAAED,WAAW;IACnBE,GAAG;IACHG;EACJ,CAAC;AACL,CAAC;AAACc,OAAA,CAAAxC,6BAAA,GAAAA,6BAAA"}
|
|
@@ -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"],"mappings":";;;;;;;;AAAA;AAWA;AACA;AACA;AAMA,
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_get","_cleanup","_query","createPartitionKey","params","tenant","locale","WebinyError","createSortKey","modelId","createKeys","PK","SK","createType","createModelsStorageOperations","entity","create","model","keys","put","_objectSpread2","default","cleanupItem","TYPE","ex","error","update","message","code","deleteModel","delete","get","item","getRecord","list","where","queryAllParams","partitionKey","options","gte","items","queryAll","cleanupItems","exports"],"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"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAWA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAMA,MAAMI,kBAAkB,GAAIC,MAA2B,IAAa;EAChE,MAAM;IAAEC,MAAM;IAAEC;EAAO,CAAC,GAAGF,MAAM;EACjC,IAAI,CAACC,MAAM,EAAE;IACT,MAAM,IAAIE,cAAW,CAAE,2DAA0D,CAAC;EACtF,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;IAChB,MAAM,IAAIC,cAAW,CAAE,2DAA0D,CAAC;EACtF;EACA,OAAQ,KAAIF,MAAO,MAAKC,MAAO,SAAQ;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,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KAAK,GAAG,MAAM,IAAAC,eAAQ,EAAWL,cAAc,CAAC;MAEtD,OAAO,IAAAM,qBAAY,EAAC3B,MAAM,EAAEyB,KAAK,CAAC;IACtC,CAAC,CAAC,OAAOhB,EAAE,EAAE;MACT,MAAM,IAAIjB,cAAW,CACjBiB,EAAE,CAACG,OAAO,IAAI,wBAAwB,EACtCH,EAAE,CAACI,IAAI,IAAI,kBAAkB,EAC7B;QACIH,KAAK,EAAED,EAAE;QACTa,YAAY,EAAED,cAAc,CAACC;MACjC,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHrB,MAAM;IACNU,MAAM;IACNI,MAAM,EAAED,WAAW;IACnBE,GAAG;IACHG;EACJ,CAAC;AACL,CAAC;AAACS,OAAA,CAAA7B,6BAAA,GAAAA,6BAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["convertToDbData","settings","contentModelLastChange","toISOString","convertFromDbData","Date","createPartitionKey","tenant","locale","createSortKey","createKeys","params","PK","SK","createSettingsStorageOperations","entity","create","keys","dbSettings","put","ex","WebinyError","message","code","error","update","get","record","getRecord","cleanupItem"],"sources":["index.ts"],"sourcesContent":["import {\n CmsSettings,\n CmsSettingsStorageOperations,\n CmsSettingsStorageOperationsCreateParams,\n CmsSettingsStorageOperationsGetParams,\n CmsSettingsStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport { get as getRecord } from \"@webiny/db-dynamodb/utils/get\";\nimport WebinyError from \"@webiny/error\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\n\ninterface CmsSettingsDb extends Omit<CmsSettings, \"contentModelLastChange\"> {\n contentModelLastChange: string;\n}\n\nconst convertToDbData = (settings: CmsSettings): CmsSettingsDb => {\n return {\n ...settings,\n contentModelLastChange: settings.contentModelLastChange.toISOString()\n };\n};\n\nconst convertFromDbData = (settings?: CmsSettingsDb): CmsSettings | null => {\n if (!settings) {\n return null;\n }\n let contentModelLastChange;\n try {\n contentModelLastChange = new Date(settings.contentModelLastChange);\n } catch {\n contentModelLastChange = new Date();\n }\n return {\n ...settings,\n contentModelLastChange\n };\n};\n\ninterface PartitionKeyParams {\n tenant: string;\n locale: string;\n}\n\nconst createPartitionKey = ({ tenant, locale }: PartitionKeyParams): string => {\n return `T#${tenant}#L#${locale}#CMS#SETTINGS`;\n};\n\nconst createSortKey = (): string => {\n return \"settings\";\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\ninterface CreateSettingsStorageOperationsParams {\n entity: Entity<any>;\n}\n\nexport const createSettingsStorageOperations = (\n params: CreateSettingsStorageOperationsParams\n): CmsSettingsStorageOperations => {\n const { entity } = params;\n\n const create = async (params: CmsSettingsStorageOperationsCreateParams) => {\n const { settings } = params;\n const keys = createKeys(settings);\n\n const dbSettings: CmsSettingsDb = convertToDbData(settings);\n\n try {\n await entity.put({\n ...dbSettings,\n ...keys\n });\n return settings;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create settings.\",\n ex.code || \"CREATE_SETTINGS_ERROR\",\n {\n error: ex,\n settings,\n dbSettings,\n keys\n }\n );\n }\n };\n\n const update = async (params: CmsSettingsStorageOperationsUpdateParams) => {\n const { settings } = params;\n\n const keys = createKeys(settings);\n\n const dbSettings: CmsSettingsDb = convertToDbData(settings);\n\n try {\n await entity.put({\n ...dbSettings,\n ...keys\n });\n return settings;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update settings.\",\n ex.code || \"UPDATE_SETTINGS_ERROR\",\n {\n error: ex,\n settings,\n dbSettings,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsSettingsStorageOperationsGetParams) => {\n const keys = createKeys(params);\n try {\n const record = await getRecord<CmsSettingsDb>({\n entity,\n keys\n });\n if (!record) {\n return null;\n }\n const settings = cleanupItem(entity, record) as CmsSettingsDb;\n return convertFromDbData(settings);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get settings.\",\n ex.code || \"GET_SETTINGS_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n return {\n create,\n get,\n update\n };\n};\n"],"mappings":";;;;;;;;AAQA;AACA;AACA;AAMA,
|
|
1
|
+
{"version":3,"names":["_get","require","_error","_interopRequireDefault","_cleanup","convertToDbData","settings","_objectSpread2","default","contentModelLastChange","toISOString","convertFromDbData","Date","createPartitionKey","tenant","locale","createSortKey","createKeys","params","PK","SK","createSettingsStorageOperations","entity","create","keys","dbSettings","put","ex","WebinyError","message","code","error","update","get","record","getRecord","cleanupItem","exports"],"sources":["index.ts"],"sourcesContent":["import {\n CmsSettings,\n CmsSettingsStorageOperations,\n CmsSettingsStorageOperationsCreateParams,\n CmsSettingsStorageOperationsGetParams,\n CmsSettingsStorageOperationsUpdateParams\n} from \"@webiny/api-headless-cms/types\";\nimport { Entity } from \"dynamodb-toolbox\";\nimport { get as getRecord } from \"@webiny/db-dynamodb/utils/get\";\nimport WebinyError from \"@webiny/error\";\nimport { cleanupItem } from \"@webiny/db-dynamodb/utils/cleanup\";\n\ninterface CmsSettingsDb extends Omit<CmsSettings, \"contentModelLastChange\"> {\n contentModelLastChange: string;\n}\n\nconst convertToDbData = (settings: CmsSettings): CmsSettingsDb => {\n return {\n ...settings,\n contentModelLastChange: settings.contentModelLastChange.toISOString()\n };\n};\n\nconst convertFromDbData = (settings?: CmsSettingsDb): CmsSettings | null => {\n if (!settings) {\n return null;\n }\n let contentModelLastChange;\n try {\n contentModelLastChange = new Date(settings.contentModelLastChange);\n } catch {\n contentModelLastChange = new Date();\n }\n return {\n ...settings,\n contentModelLastChange\n };\n};\n\ninterface PartitionKeyParams {\n tenant: string;\n locale: string;\n}\n\nconst createPartitionKey = ({ tenant, locale }: PartitionKeyParams): string => {\n return `T#${tenant}#L#${locale}#CMS#SETTINGS`;\n};\n\nconst createSortKey = (): string => {\n return \"settings\";\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\ninterface CreateSettingsStorageOperationsParams {\n entity: Entity<any>;\n}\n\nexport const createSettingsStorageOperations = (\n params: CreateSettingsStorageOperationsParams\n): CmsSettingsStorageOperations => {\n const { entity } = params;\n\n const create = async (params: CmsSettingsStorageOperationsCreateParams) => {\n const { settings } = params;\n const keys = createKeys(settings);\n\n const dbSettings: CmsSettingsDb = convertToDbData(settings);\n\n try {\n await entity.put({\n ...dbSettings,\n ...keys\n });\n return settings;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not create settings.\",\n ex.code || \"CREATE_SETTINGS_ERROR\",\n {\n error: ex,\n settings,\n dbSettings,\n keys\n }\n );\n }\n };\n\n const update = async (params: CmsSettingsStorageOperationsUpdateParams) => {\n const { settings } = params;\n\n const keys = createKeys(settings);\n\n const dbSettings: CmsSettingsDb = convertToDbData(settings);\n\n try {\n await entity.put({\n ...dbSettings,\n ...keys\n });\n return settings;\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not update settings.\",\n ex.code || \"UPDATE_SETTINGS_ERROR\",\n {\n error: ex,\n settings,\n dbSettings,\n keys\n }\n );\n }\n };\n\n const get = async (params: CmsSettingsStorageOperationsGetParams) => {\n const keys = createKeys(params);\n try {\n const record = await getRecord<CmsSettingsDb>({\n entity,\n keys\n });\n if (!record) {\n return null;\n }\n const settings = cleanupItem(entity, record) as CmsSettingsDb;\n return convertFromDbData(settings);\n } catch (ex) {\n throw new WebinyError(\n ex.message || \"Could not get settings.\",\n ex.code || \"GET_SETTINGS_ERROR\",\n {\n error: ex,\n keys\n }\n );\n }\n };\n\n return {\n create,\n get,\n update\n };\n};\n"],"mappings":";;;;;;;;AAQA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,QAAA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AAI;MACf;MACA,MAAM5B,QAAQ,GAAG,IAAA8B,oBAAW,EAACd,MAAM,EAAEY,MAAM,CAAkB;MAC7D,OAAOvB,iBAAiB,CAACL,QAAQ,CAAC;IACtC,CAAC,CAAC,OAAOqB,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,yBAAyB,EACvCF,EAAE,CAACG,IAAI,IAAI,oBAAoB,EAC/B;QACIC,KAAK,EAAEJ,EAAE;QACTH;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHD,MAAM;IACNU,GAAG;IACHD;EACJ,CAAC;AACL,CAAC;AAACK,OAAA,CAAAhB,+BAAA,GAAAA,+BAAA"}
|
|
@@ -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,
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_get","_cleanup","createPartitionKey","tenant","toLowerCase","createSortKey","createKeys","params","PK","SK","createSystemStorageOperations","entity","create","system","keys","put","_objectSpread2","default","ex","WebinyError","message","code","error","update","get","getRecord","cleanupItem","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AASA,MAAMG,kBAA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OK,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,0BAA0B,EACxCF,EAAE,CAACG,IAAI,IAAI,qBAAqB,EAChC;QACIC,KAAK,EAAEJ,EAAE;QACTL,MAAM;QACNC;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,MAAMU,GAAG,GAAG,MAAOjB,MAA2C,IAAK;IAC/D,MAAMO,IAAI,GAAGR,UAAU,CAACC,MAAM,CAAC;IAE/B,IAAI;MACA,MAAMM,MAAM,GAAG,MAAM,IAAAY,QAAS,EAAY;QACtCd,MAAM;QACNG;MACJ,CAAC,CAAC;MACF,OAAO,IAAAY,oBAAW,EAACf,MAAM,EAAEE,MAAM,CAAC;IACtC,CAAC,CAAC,OAAOK,EAAE,EAAE;MACT,MAAM,IAAIC,cAAW,CACjBD,EAAE,CAACE,OAAO,IAAI,uBAAuB,EACrCF,EAAE,CAACG,IAAI,IAAI,kBAAkB,EAC7B;QACIC,KAAK,EAAEJ,EAAE;QACTJ;MACJ,CACJ,CAAC;IACL;EACJ,CAAC;EAED,OAAO;IACHF,MAAM;IACNW,MAAM;IACNC;EACJ,CAAC;AACL,CAAC;AAACG,OAAA,CAAAjB,6BAAA,GAAAA,6BAAA"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms-ddb",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.37.0-beta.1",
|
|
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,12 +22,12 @@
|
|
|
21
22
|
],
|
|
22
23
|
"license": "MIT",
|
|
23
24
|
"dependencies": {
|
|
24
|
-
"@babel/runtime": "7.
|
|
25
|
-
"@webiny/api-headless-cms": "5.
|
|
26
|
-
"@webiny/db-dynamodb": "5.
|
|
27
|
-
"@webiny/error": "5.
|
|
28
|
-
"@webiny/handler-db": "5.
|
|
29
|
-
"@webiny/utils": "5.
|
|
25
|
+
"@babel/runtime": "7.22.6",
|
|
26
|
+
"@webiny/api-headless-cms": "5.37.0-beta.1",
|
|
27
|
+
"@webiny/db-dynamodb": "5.37.0-beta.1",
|
|
28
|
+
"@webiny/error": "5.37.0-beta.1",
|
|
29
|
+
"@webiny/handler-db": "5.37.0-beta.1",
|
|
30
|
+
"@webiny/utils": "5.37.0-beta.1",
|
|
30
31
|
"aws-sdk": "2.1310.0",
|
|
31
32
|
"dataloader": "2.2.1",
|
|
32
33
|
"dot-prop": "6.0.1",
|
|
@@ -35,16 +36,15 @@
|
|
|
35
36
|
"lodash": "4.17.21"
|
|
36
37
|
},
|
|
37
38
|
"devDependencies": {
|
|
38
|
-
"@babel/cli": "7.
|
|
39
|
-
"@babel/core": "7.
|
|
40
|
-
"@babel/preset-env": "7.
|
|
39
|
+
"@babel/cli": "7.22.6",
|
|
40
|
+
"@babel/core": "7.22.8",
|
|
41
|
+
"@babel/preset-env": "7.22.7",
|
|
41
42
|
"@types/jsonpack": "1.1.2",
|
|
42
|
-
"@webiny/cli": "5.
|
|
43
|
-
"@webiny/plugins": "5.
|
|
44
|
-
"@webiny/project-utils": "5.
|
|
45
|
-
"jest": "
|
|
43
|
+
"@webiny/cli": "5.37.0-beta.1",
|
|
44
|
+
"@webiny/plugins": "5.37.0-beta.1",
|
|
45
|
+
"@webiny/project-utils": "5.37.0-beta.1",
|
|
46
|
+
"jest": "29.5.0",
|
|
46
47
|
"jest-dynalite": "3.6.1",
|
|
47
|
-
"jest-environment-node": "27.5.1",
|
|
48
48
|
"ttypescript": "1.5.15",
|
|
49
49
|
"typescript": "4.7.4"
|
|
50
50
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"build": "yarn webiny run build",
|
|
57
57
|
"watch": "yarn webiny run watch"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "176c29425477d1daaca1b7da79bacc79a1d35f6e"
|
|
60
60
|
}
|
|
@@ -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
|
}
|
|
@@ -18,9 +18,11 @@ class CmsEntryFieldFilterPathPlugin extends _Plugin.Plugin {
|
|
|
18
18
|
this.config = config;
|
|
19
19
|
this.name = `${this.constructor.type}-${this.config.fieldType}`;
|
|
20
20
|
}
|
|
21
|
-
canUse(field) {
|
|
21
|
+
canUse(field, parents) {
|
|
22
22
|
if (field.type !== this.config.fieldType) {
|
|
23
23
|
return false;
|
|
24
|
+
} else if (this.config.canUse) {
|
|
25
|
+
return this.config.canUse(field, parents);
|
|
24
26
|
}
|
|
25
27
|
const fieldId = this.config.fieldId;
|
|
26
28
|
if (!fieldId || Array.isArray(fieldId) === false || fieldId.length === 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["CmsEntryFieldFilterPathPlugin","Plugin","fieldType","config","constructor","name","type","canUse","field","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}\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\"
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","_Plugin","CmsEntryFieldFilterPathPlugin","Plugin","fieldType","config","constructor","_defineProperty2","default","name","type","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 { 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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAgBO,MAAME,6BAA6B,SAASC,cAAM,CAAC;EAKtD,IAAWC,SAASA,CAAA,EAAW;IAC3B,OAAO,IAAI,CAACC,MAAM,CAACD,SAAS;EAChC;EAEOE,WAAWA,CAACD,MAA2C,EAAE;IAC5D,KAAK,CAAC,CAAC;IAAC,IAAAE,gBAAA,CAAAC,OAAA;IAER,IAAI,CAACH,MAAM,GAAGA,MAAM;IAEpB,IAAI,CAACI,IAAI,GAAI,GAAG,IAAI,CAACH,WAAW,CAASI,IAAK,IAAG,IAAI,CAACL,MAAM,CAACD,SAAU,EAAC;EAC5E;EAEOO,MAAMA,CAACC,KAA8C,EAAEC,OAAiB,EAAW;IACtF,IAAID,KAAK,CAACF,IAAI,KAAK,IAAI,CAACL,MAAM,CAACD,SAAS,EAAE;MACtC,OAAO,KAAK;IAChB,CAAC,MAAM,IAAI,IAAI,CAACC,MAAM,CAACM,MAAM,EAAE;MAC3B,OAAO,IAAI,CAACN,MAAM,CAACM,MAAM,CAACC,KAAK,EAAEC,OAAO,CAAC;IAC7C;IACA,MAAMC,OAAO,GAAG,IAAI,CAACT,MAAM,CAACS,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,CAACf,MAAM,CAACgB,IAAI,KAAK,UAAU,EAAE;MACxC,OAAO,IAAI,CAAChB,MAAM,CAACgB,IAAI,CAACD,MAAM,CAAC;IACnC,CAAC,MAAM,IAAI,OAAO,IAAI,CAACf,MAAM,CAACgB,IAAI,KAAK,QAAQ,EAAE;MAC7C,OAAO,IAAI,CAAChB,MAAM,CAACgB,IAAI;IAC3B;IACA,MAAM,IAAIC,cAAW,CAAE,oBAAmB,IAAI,CAACb,IAAK,WAAU,CAAC;EACnE;AACJ;AAACc,OAAA,CAAArB,6BAAA,GAAAA,6BAAA;AAAA,IAAAK,gBAAA,CAAAC,OAAA,EAtCYN,6BAA6B,UACS,uBAAuB"}
|
|
@@ -7,6 +7,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.CmsEntryFieldFilterPlugin = void 0;
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _plugins = require("@webiny/plugins");
|
|
10
|
+
/**
|
|
11
|
+
* This plugin is used to create the filter.
|
|
12
|
+
* Internally we have default one + the one for the reference field - because it is actually an object when filtering.
|
|
13
|
+
*/
|
|
14
|
+
|
|
10
15
|
class CmsEntryFieldFilterPlugin extends _plugins.Plugin {
|
|
11
16
|
constructor(config) {
|
|
12
17
|
super();
|
|
@@ -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;
|
|
1
|
+
{"version":3,"names":["_plugins","require","CmsEntryFieldFilterPlugin","Plugin","constructor","config","_defineProperty2","default","fieldType","create","params","exports"],"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,IAAAA,QAAA,GAAAC,OAAA;AAKA;AACA;AACA;AACA;;AAiCO,MAAMC,yBAAyB,SAASC,eAAM,CAAC;EAQ3CC,WAAWA,CAACC,MAAuC,EAAE;IACxD,KAAK,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IAAA,IAAAD,gBAAA,CAAAC,OAAA;IACR,IAAI,CAACF,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACG,SAAS,GAAG,IAAI,CAACH,MAAM,CAACG,SAAS;EAC1C;EAEOC,MAAMA,CAACC,MAA6C,EAAE;IACzD,OAAO,IAAI,CAACL,MAAM,CAACI,MAAM,CAACC,MAAM,CAAC;EACrC;AACJ;AAACC,OAAA,CAAAT,yBAAA,GAAAA,yBAAA;AAAA,IAAAI,gBAAA,CAAAC,OAAA,EAjBYL,yBAAyB,UACa,iCAAiC;AAAA,IAAAI,gBAAA,CAAAC,OAAA,EADvEL,yBAAyB,SAEG,GAAG"}
|
|
@@ -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,
|
|
1
|
+
{"version":3,"names":["_plugins","require","CmsEntryFieldSortingPlugin","Plugin","constructor","config","_defineProperty2","default","canUse","params","createSort","exports","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,IAAAA,QAAA,GAAAC,OAAA;AAwCO,MAAMC,0BAA0B,SAASC,eAAM,CAAC;EAI5CC,WAAWA,CAACC,MAAwC,EAAE;IACzD,KAAK,CAAC,CAAC;IAAC,IAAAC,gBAAA,CAAAC,OAAA;IACR,IAAI,CAACF,MAAM,GAAGA,MAAM;EACxB;EAEOG,MAAMA,CAACC,MAA8C,EAAW;IACnE,OAAO,IAAI,CAACJ,MAAM,CAACG,MAAM,CAACC,MAAM,CAAC;EACrC;EAEOC,UAAUA,CACbD,MAAkD,EACR;IAC1C,OAAO,IAAI,CAACJ,MAAM,CAACK,UAAU,CAACD,MAAM,CAAC;EACzC;AACJ;AAACE,OAAA,CAAAT,0BAAA,GAAAA,0BAAA;AAAA,IAAAI,gBAAA,CAAAC,OAAA,EAlBYL,0BAA0B,UACY,yBAAyB;AAmBrE,MAAMU,gCAAgC,GAAIP,MAAwC,IAAK;EAC1F,OAAO,IAAIH,0BAA0B,CAACG,MAAM,CAAC;AACjD,CAAC;AAACM,OAAA,CAAAC,gCAAA,GAAAA,gCAAA"}
|
|
@@ -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,
|
|
1
|
+
{"version":3,"names":["_plugins","require","CmsFieldFilterValueTransformPlugin","Plugin","fieldType","config","transform","constructor","_defineProperty2","default","exports"],"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,IAAAA,QAAA,GAAAC,OAAA;AAOO,MAAMC,kCAAkC,SACnCC,eAAM,CAElB;EAKI,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;IAAC,IAAAG,gBAAA,CAAAC,OAAA;IACR,IAAI,CAACJ,MAAM,GAAGA,MAAM;EACxB;AACJ;AAACK,OAAA,CAAAR,kCAAA,GAAAA,kCAAA;AAAA,IAAAM,gBAAA,CAAAC,OAAA,EApBYP,kCAAkC,UAIb,kCAAkC"}
|
package/plugins/index.js.map
CHANGED
|
@@ -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;
|
|
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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-4,12 +4,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.ENTITIES = void 0;
|
|
7
|
-
let ENTITIES
|
|
8
|
-
exports.ENTITIES = ENTITIES;
|
|
9
|
-
(function (ENTITIES) {
|
|
7
|
+
let ENTITIES = /*#__PURE__*/function (ENTITIES) {
|
|
10
8
|
ENTITIES["SYSTEM"] = "CmsSystem";
|
|
11
9
|
ENTITIES["SETTINGS"] = "CmsSettings";
|
|
12
10
|
ENTITIES["GROUPS"] = "CmsGroups";
|
|
13
11
|
ENTITIES["MODELS"] = "CmsModels";
|
|
14
12
|
ENTITIES["ENTRIES"] = "CmsEntries";
|
|
15
|
-
|
|
13
|
+
return ENTITIES;
|
|
14
|
+
}({});
|
|
15
|
+
exports.ENTITIES = ENTITIES;
|
package/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ENTITIES"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport {\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\n CmsModelField,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport { DynamoDBTypes, TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\n\ninterface CmsFieldFilterValueTransformParams {\n /**\n * A field which value we are transforming.\n */\n field: Partial<CmsModelField> &\n Pick<CmsModelField, \"id\" | \"storageId\" | \"fieldId\" | \"settings\">;\n value: any;\n}\n\nexport interface CmsFieldFilterValueTransformPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-field-filter-value-transform\";\n /**\n * A field type this plugin is for.\n */\n fieldType: string;\n /**\n * Transform method which expect field definition and value to transform.\n */\n transform: (params: CmsFieldFilterValueTransformParams) => any;\n}\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n SETTINGS = \"CmsSettings\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor): TableConstructor;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DocumentClient;\n table?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: Plugin[] | Plugin[][];\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => Table;\n getEntities: () => Record<\"system\" | \"settings\" | \"groups\" | \"models\" | \"entries\", Entity<any>>;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: DataLoadersHandlerInterface;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\">;\n}\nexport interface DataLoadersHandlerInterface {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":";;;;;;IA2CYA,QAAQ
|
|
1
|
+
{"version":3,"names":["ENTITIES","exports"],"sources":["types.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins/types\";\nimport {\n CmsEntryStorageOperations as BaseCmsEntryStorageOperations,\n CmsModel,\n CmsModelField,\n HeadlessCmsStorageOperations as BaseHeadlessCmsStorageOperations\n} from \"@webiny/api-headless-cms/types\";\nimport { DynamoDBTypes, TableConstructor } from \"dynamodb-toolbox/dist/classes/Table\";\nimport {\n EntityAttributeConfig,\n EntityCompositeAttributes\n} from \"dynamodb-toolbox/dist/classes/Entity\";\nimport { DocumentClient } from \"aws-sdk/clients/dynamodb\";\nimport { Entity, Table } from \"dynamodb-toolbox\";\n\ninterface CmsFieldFilterValueTransformParams {\n /**\n * A field which value we are transforming.\n */\n field: Partial<CmsModelField> &\n Pick<CmsModelField, \"id\" | \"storageId\" | \"fieldId\" | \"settings\">;\n value: any;\n}\n\nexport interface CmsFieldFilterValueTransformPlugin extends Plugin {\n /**\n * A plugin type.\n */\n type: \"cms-field-filter-value-transform\";\n /**\n * A field type this plugin is for.\n */\n fieldType: string;\n /**\n * Transform method which expect field definition and value to transform.\n */\n transform: (params: CmsFieldFilterValueTransformParams) => any;\n}\n\nexport type AttributeDefinition = DynamoDBTypes | EntityAttributeConfig | EntityCompositeAttributes;\n\nexport type Attributes = Record<string, AttributeDefinition>;\n\nexport enum ENTITIES {\n SYSTEM = \"CmsSystem\",\n SETTINGS = \"CmsSettings\",\n GROUPS = \"CmsGroups\",\n MODELS = \"CmsModels\",\n ENTRIES = \"CmsEntries\"\n}\n\nexport interface TableModifier {\n (table: TableConstructor): TableConstructor;\n}\n\nexport interface StorageOperationsFactoryParams {\n documentClient: DocumentClient;\n table?: TableModifier;\n attributes?: Record<ENTITIES, Attributes>;\n plugins?: Plugin[] | Plugin[][];\n}\n\nexport interface HeadlessCmsStorageOperations extends BaseHeadlessCmsStorageOperations {\n getTable: () => Table;\n getEntities: () => Record<\"system\" | \"settings\" | \"groups\" | \"models\" | \"entries\", Entity<any>>;\n}\n\nexport interface StorageOperationsFactory {\n (params: StorageOperationsFactoryParams): HeadlessCmsStorageOperations;\n}\n\nexport interface CmsEntryStorageOperations extends BaseCmsEntryStorageOperations {\n dataLoaders: DataLoadersHandlerInterface;\n}\n\nexport interface DataLoadersHandlerInterfaceClearAllParams {\n model: Pick<CmsModel, \"tenant\" | \"locale\">;\n}\nexport interface DataLoadersHandlerInterface {\n clearAll: (params?: DataLoadersHandlerInterfaceClearAllParams) => void;\n}\n"],"mappings":";;;;;;IA2CYA,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAAAC,OAAA,CAAAD,QAAA,GAAAA,QAAA"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.systemFields = void 0;
|
|
7
|
-
const createSystemField = field => {
|
|
8
|
-
return field;
|
|
9
|
-
};
|
|
10
|
-
const systemFields = {
|
|
11
|
-
id: createSystemField({
|
|
12
|
-
id: "id",
|
|
13
|
-
type: "text",
|
|
14
|
-
storageId: "id",
|
|
15
|
-
fieldId: "id"
|
|
16
|
-
}),
|
|
17
|
-
entryId: createSystemField({
|
|
18
|
-
id: "entryId",
|
|
19
|
-
type: "text",
|
|
20
|
-
storageId: "entryId",
|
|
21
|
-
fieldId: "entryId"
|
|
22
|
-
}),
|
|
23
|
-
createdOn: createSystemField({
|
|
24
|
-
id: "createdOn",
|
|
25
|
-
type: "datetime",
|
|
26
|
-
storageId: "createdOn",
|
|
27
|
-
fieldId: "createdOn"
|
|
28
|
-
}),
|
|
29
|
-
savedOn: createSystemField({
|
|
30
|
-
id: "savedOn",
|
|
31
|
-
type: "datetime",
|
|
32
|
-
storageId: "savedOn",
|
|
33
|
-
fieldId: "savedOn"
|
|
34
|
-
}),
|
|
35
|
-
createdBy: createSystemField({
|
|
36
|
-
id: "createdBy",
|
|
37
|
-
type: "plainObject",
|
|
38
|
-
storageId: "createdBy",
|
|
39
|
-
fieldId: "createdBy",
|
|
40
|
-
settings: {
|
|
41
|
-
path: "createdBy.id"
|
|
42
|
-
}
|
|
43
|
-
}),
|
|
44
|
-
meta: createSystemField({
|
|
45
|
-
id: "meta",
|
|
46
|
-
type: "plainObject",
|
|
47
|
-
storageId: "meta",
|
|
48
|
-
fieldId: "meta"
|
|
49
|
-
}),
|
|
50
|
-
ownedBy: createSystemField({
|
|
51
|
-
id: "ownedBy",
|
|
52
|
-
type: "plainObject",
|
|
53
|
-
storageId: "ownedBy",
|
|
54
|
-
fieldId: "ownedBy",
|
|
55
|
-
settings: {
|
|
56
|
-
path: "ownedBy.id"
|
|
57
|
-
}
|
|
58
|
-
}),
|
|
59
|
-
version: createSystemField({
|
|
60
|
-
id: "version",
|
|
61
|
-
type: "number",
|
|
62
|
-
storageId: "version",
|
|
63
|
-
fieldId: "version"
|
|
64
|
-
}),
|
|
65
|
-
status: createSystemField({
|
|
66
|
-
id: "status",
|
|
67
|
-
type: "string",
|
|
68
|
-
storageId: "status",
|
|
69
|
-
fieldId: "status"
|
|
70
|
-
})
|
|
71
|
-
};
|
|
72
|
-
exports.systemFields = systemFields;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createSystemField","field","systemFields","id","type","storageId","fieldId","entryId","createdOn","savedOn","createdBy","settings","path","meta","ownedBy","version","status"],"sources":["systemFields.ts"],"sourcesContent":["import { CmsModelField } from \"@webiny/api-headless-cms/types\";\n\ntype CmsModelFieldInput = Partial<CmsModelField> &\n Pick<CmsModelField, \"id\" | \"type\" | \"storageId\" | \"fieldId\">;\nconst createSystemField = (field: CmsModelFieldInput): CmsModelField => {\n return field as CmsModelField;\n};\n\nexport const systemFields: Record<string, CmsModelField> = {\n id: createSystemField({\n id: \"id\",\n type: \"text\",\n storageId: \"id\",\n fieldId: \"id\"\n }),\n entryId: createSystemField({\n id: \"entryId\",\n type: \"text\",\n storageId: \"entryId\",\n fieldId: \"entryId\"\n }),\n createdOn: createSystemField({\n id: \"createdOn\",\n type: \"datetime\",\n storageId: \"createdOn\",\n fieldId: \"createdOn\"\n }),\n savedOn: createSystemField({\n id: \"savedOn\",\n type: \"datetime\",\n storageId: \"savedOn\",\n fieldId: \"savedOn\"\n }),\n createdBy: createSystemField({\n id: \"createdBy\",\n type: \"plainObject\",\n storageId: \"createdBy\",\n fieldId: \"createdBy\",\n settings: {\n path: \"createdBy.id\"\n }\n }),\n meta: createSystemField({\n id: \"meta\",\n type: \"plainObject\",\n storageId: \"meta\",\n fieldId: \"meta\"\n }),\n ownedBy: createSystemField({\n id: \"ownedBy\",\n type: \"plainObject\",\n storageId: \"ownedBy\",\n fieldId: \"ownedBy\",\n settings: {\n path: \"ownedBy.id\"\n }\n }),\n version: createSystemField({\n id: \"version\",\n type: \"number\",\n storageId: \"version\",\n fieldId: \"version\"\n }),\n status: createSystemField({\n id: \"status\",\n type: \"string\",\n storageId: \"status\",\n fieldId: \"status\"\n })\n};\n"],"mappings":";;;;;;AAIA,MAAMA,iBAAiB,GAAIC,KAAyB,IAAoB;EACpE,OAAOA,KAAK;AAChB,CAAC;AAEM,MAAMC,YAA2C,GAAG;EACvDC,EAAE,EAAEH,iBAAiB,CAAC;IAClBG,EAAE,EAAE,IAAI;IACRC,IAAI,EAAE,MAAM;IACZC,SAAS,EAAE,IAAI;IACfC,OAAO,EAAE;EACb,CAAC,CAAC;EACFC,OAAO,EAAEP,iBAAiB,CAAC;IACvBG,EAAE,EAAE,SAAS;IACbC,IAAI,EAAE,MAAM;IACZC,SAAS,EAAE,SAAS;IACpBC,OAAO,EAAE;EACb,CAAC,CAAC;EACFE,SAAS,EAAER,iBAAiB,CAAC;IACzBG,EAAE,EAAE,WAAW;IACfC,IAAI,EAAE,UAAU;IAChBC,SAAS,EAAE,WAAW;IACtBC,OAAO,EAAE;EACb,CAAC,CAAC;EACFG,OAAO,EAAET,iBAAiB,CAAC;IACvBG,EAAE,EAAE,SAAS;IACbC,IAAI,EAAE,UAAU;IAChBC,SAAS,EAAE,SAAS;IACpBC,OAAO,EAAE;EACb,CAAC,CAAC;EACFI,SAAS,EAAEV,iBAAiB,CAAC;IACzBG,EAAE,EAAE,WAAW;IACfC,IAAI,EAAE,aAAa;IACnBC,SAAS,EAAE,WAAW;IACtBC,OAAO,EAAE,WAAW;IACpBK,QAAQ,EAAE;MACNC,IAAI,EAAE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