@webiny/api-headless-cms 0.0.0-mt-3 → 0.0.0-unstable.5e7233243f
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/context.d.ts +3 -0
- package/context.js +64 -0
- package/context.js.map +1 -0
- package/crud/contentEntry/afterDelete.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentEntry/afterDelete.js +2 -2
- package/crud/contentEntry/afterDelete.js.map +1 -0
- package/crud/contentEntry/beforeCreate.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeCreate.js +2 -2
- package/crud/contentEntry/beforeCreate.js.map +1 -0
- package/crud/contentEntry/beforeUpdate.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.js +2 -2
- package/crud/contentEntry/beforeUpdate.js.map +1 -0
- package/crud/contentEntry/entryDataValidation.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.js +26 -10
- package/crud/contentEntry/entryDataValidation.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry/markLockedFields.d.ts +3 -2
- package/{content/plugins/crud → crud}/contentEntry/markLockedFields.js +6 -6
- package/crud/contentEntry/markLockedFields.js.map +1 -0
- package/crud/contentEntry/referenceFieldsMapping.d.ts +13 -0
- package/crud/contentEntry/referenceFieldsMapping.js +294 -0
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +5 -7
- package/{content/plugins/crud → crud}/contentEntry.crud.js +585 -219
- package/crud/contentEntry.crud.js.map +1 -0
- package/crud/contentModel/afterCreate.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreate.js +2 -2
- package/crud/contentModel/afterCreate.js.map +1 -0
- package/crud/contentModel/afterCreateFrom.d.ts +8 -0
- package/crud/contentModel/afterCreateFrom.js +18 -0
- package/crud/contentModel/afterCreateFrom.js.map +1 -0
- package/crud/contentModel/afterDelete.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentModel/afterDelete.js +2 -2
- package/crud/contentModel/afterDelete.js.map +1 -0
- package/crud/contentModel/afterUpdate.d.ts +8 -0
- package/{content/plugins/crud → crud}/contentModel/afterUpdate.js +2 -2
- package/crud/contentModel/afterUpdate.js.map +1 -0
- package/crud/contentModel/beforeCreate.d.ts +15 -0
- package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +58 -10
- package/crud/contentModel/beforeCreate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.d.ts +5 -4
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +10 -6
- package/crud/contentModel/beforeDelete.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/beforeUpdate.d.ts +5 -4
- package/crud/contentModel/beforeUpdate.js +37 -0
- package/crud/contentModel/beforeUpdate.js.map +1 -0
- package/crud/contentModel/contentModelManagerFactory.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js +0 -0
- package/crud/contentModel/contentModelManagerFactory.js.map +1 -0
- package/crud/contentModel/createFieldModels.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/createFieldModels.js +6 -2
- package/crud/contentModel/createFieldModels.js.map +1 -0
- package/crud/contentModel/createFieldStorageId.d.ts +2 -0
- package/crud/contentModel/createFieldStorageId.js +16 -0
- package/crud/contentModel/createFieldStorageId.js.map +1 -0
- package/crud/contentModel/fieldIdValidation.d.ts +1 -0
- package/crud/contentModel/fieldIdValidation.js +25 -0
- package/crud/contentModel/fieldIdValidation.js.map +1 -0
- package/crud/contentModel/idValidation.d.ts +1 -0
- package/{content/plugins/crud → crud}/contentModel/idValidation.js +3 -3
- package/crud/contentModel/idValidation.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/models.d.ts +2 -1
- package/{content/plugins/crud → crud}/contentModel/models.js +64 -25
- package/crud/contentModel/models.js.map +1 -0
- package/crud/contentModel/systemFields.d.ts +1 -0
- package/crud/contentModel/systemFields.js +8 -0
- package/crud/contentModel/systemFields.js.map +1 -0
- package/crud/contentModel/validateLayout.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/validateLayout.js +1 -3
- package/crud/contentModel/validateLayout.js.map +1 -0
- package/crud/contentModel/validateModel.d.ts +9 -0
- package/crud/contentModel/validateModel.js +32 -0
- package/crud/contentModel/validateModel.js.map +1 -0
- package/crud/contentModel/validateModelFields.d.ts +9 -0
- package/crud/contentModel/validateModelFields.js +363 -0
- package/crud/contentModel/validateModelFields.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel.crud.d.ts +3 -3
- package/{content/plugins/crud → crud}/contentModel.crud.js +251 -95
- package/crud/contentModel.crud.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.d.ts +4 -3
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +6 -6
- package/crud/contentModelGroup/beforeCreate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.d.ts +4 -3
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +1 -1
- package/crud/contentModelGroup/beforeDelete.js.map +1 -0
- package/crud/contentModelGroup/beforeUpdate.d.ts +9 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.js +1 -1
- package/crud/contentModelGroup/beforeUpdate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup.crud.d.ts +3 -3
- package/{content/plugins/crud → crud}/contentModelGroup.crud.js +54 -59
- package/crud/contentModelGroup.crud.js.map +1 -0
- package/crud/index.d.ts +6 -0
- package/{content/plugins/crud → crud}/index.js +15 -26
- package/crud/index.js.map +1 -0
- package/{plugins/crud → crud}/settings.crud.d.ts +3 -3
- package/crud/settings.crud.js +88 -0
- package/crud/settings.crud.js.map +1 -0
- package/{plugins/crud → crud}/system.crud.d.ts +6 -3
- package/{plugins/crud → crud}/system.crud.js +43 -16
- package/crud/system.crud.js.map +1 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.d.ts +7 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +66 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.d.ts +11 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +306 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -0
- package/fieldConverters/index.d.ts +3 -0
- package/fieldConverters/index.js +16 -0
- package/fieldConverters/index.js.map +1 -0
- package/{content/plugins → graphql}/buildSchemaPlugins.d.ts +2 -3
- package/graphql/buildSchemaPlugins.js +27 -0
- package/graphql/buildSchemaPlugins.js.map +1 -0
- package/graphql/graphQLHandlerFactory.d.ts +5 -0
- package/graphql/graphQLHandlerFactory.js +158 -0
- package/graphql/graphQLHandlerFactory.js.map +1 -0
- package/graphql/index.d.ts +5 -0
- package/graphql/index.js +57 -0
- package/graphql/index.js.map +1 -0
- package/graphql/schema/baseContentSchema.d.ts +3 -0
- package/{content/plugins/schema/baseSchema.js → graphql/schema/baseContentSchema.js} +10 -28
- package/graphql/schema/baseContentSchema.js.map +1 -0
- package/graphql/schema/contentEntries.d.ts +3 -0
- package/graphql/schema/contentEntries.js +351 -0
- package/graphql/schema/contentEntries.js.map +1 -0
- package/graphql/schema/contentModelGroups.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentModelGroups.js +34 -15
- package/graphql/schema/contentModelGroups.js.map +1 -0
- package/graphql/schema/contentModels.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentModels.js +47 -10
- package/graphql/schema/contentModels.js.map +1 -0
- package/graphql/schema/createFieldResolvers.d.ts +20 -0
- package/{content/plugins → graphql}/schema/createFieldResolvers.js +48 -17
- package/graphql/schema/createFieldResolvers.js.map +1 -0
- package/graphql/schema/createManageResolvers.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createManageResolvers.js +35 -19
- package/graphql/schema/createManageResolvers.js.map +1 -0
- package/graphql/schema/createManageSDL.d.ts +10 -0
- package/{content/plugins → graphql}/schema/createManageSDL.js +20 -9
- package/graphql/schema/createManageSDL.js.map +1 -0
- package/graphql/schema/createPreviewResolvers.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createPreviewResolvers.js +16 -9
- package/graphql/schema/createPreviewResolvers.js.map +1 -0
- package/graphql/schema/createReadResolvers.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createReadResolvers.js +16 -9
- package/graphql/schema/createReadResolvers.js.map +1 -0
- package/graphql/schema/createReadSDL.d.ts +10 -0
- package/{content/plugins → graphql}/schema/createReadSDL.js +14 -8
- package/graphql/schema/createReadSDL.js.map +1 -0
- package/graphql/schema/resolvers/commonFieldResolvers.d.ts +6 -0
- package/{content/plugins → graphql}/schema/resolvers/commonFieldResolvers.js +0 -0
- package/graphql/schema/resolvers/commonFieldResolvers.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveCreate.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js +2 -4
- package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveCreateFrom.d.ts +8 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js +2 -4
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveDelete.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js +10 -8
- package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveGet.d.ts +7 -0
- package/graphql/schema/resolvers/manage/resolveGet.js +83 -0
- package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveGetByIds.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js +2 -4
- package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveGetRevisions.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js +2 -4
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveList.d.ts +4 -0
- package/{content/plugins/schema/resolvers/read → graphql/schema/resolvers/manage}/resolveList.js +2 -4
- package/graphql/schema/resolvers/manage/resolveList.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolvePublish.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js +0 -0
- package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveRepublish.d.ts +7 -0
- package/{content/plugins/schema/resolvers/manage/resolveGet.js → graphql/schema/resolvers/manage/resolveRepublish.js} +4 -4
- package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.d.ts +4 -3
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.js +2 -4
- package/graphql/schema/resolvers/manage/resolveRequestChanges.js.map +1 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.d.ts +4 -3
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.js +2 -4
- package/graphql/schema/resolvers/manage/resolveRequestReview.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveUnpublish.d.ts +7 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js +0 -0
- package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveUpdate.d.ts +8 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js +2 -4
- package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -0
- package/graphql/schema/resolvers/preview/resolveGet.d.ts +4 -0
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveGet.js +2 -2
- package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -0
- package/graphql/schema/resolvers/preview/resolveList.d.ts +4 -0
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js +2 -4
- package/graphql/schema/resolvers/preview/resolveList.js.map +1 -0
- package/graphql/schema/resolvers/read/resolveGet.d.ts +4 -0
- package/{content/plugins → graphql}/schema/resolvers/read/resolveGet.js +2 -2
- package/graphql/schema/resolvers/read/resolveGet.js.map +1 -0
- package/graphql/schema/resolvers/read/resolveList.d.ts +4 -0
- package/{content/plugins/schema/resolvers/manage → graphql/schema/resolvers/read}/resolveList.js +2 -4
- package/graphql/schema/resolvers/read/resolveList.js.map +1 -0
- package/{content/plugins → graphql}/schema/schemaPlugins.d.ts +1 -1
- package/{content/plugins → graphql}/schema/schemaPlugins.js +25 -6
- package/graphql/schema/schemaPlugins.js.map +1 -0
- package/graphql/system.d.ts +6 -0
- package/graphql/system.js +119 -0
- package/graphql/system.js.map +1 -0
- package/graphqlFields/boolean.d.ts +2 -0
- package/graphqlFields/boolean.js +69 -0
- package/graphqlFields/boolean.js.map +1 -0
- package/graphqlFields/datetime.d.ts +2 -0
- package/graphqlFields/datetime.js +95 -0
- package/graphqlFields/datetime.js.map +1 -0
- package/graphqlFields/file.d.ts +2 -0
- package/graphqlFields/file.js +50 -0
- package/graphqlFields/file.js.map +1 -0
- package/graphqlFields/helpers.d.ts +6 -0
- package/graphqlFields/helpers.js +49 -0
- package/graphqlFields/helpers.js.map +1 -0
- package/graphqlFields/index.d.ts +2 -0
- package/graphqlFields/index.js +28 -0
- package/graphqlFields/index.js.map +1 -0
- package/graphqlFields/longText.d.ts +2 -0
- package/graphqlFields/longText.js +63 -0
- package/graphqlFields/longText.js.map +1 -0
- package/graphqlFields/number.d.ts +2 -0
- package/graphqlFields/number.js +75 -0
- package/graphqlFields/number.js.map +1 -0
- package/graphqlFields/object.d.ts +2 -0
- package/graphqlFields/object.js +225 -0
- package/graphqlFields/object.js.map +1 -0
- package/graphqlFields/ref.d.ts +2 -0
- package/graphqlFields/ref.js +279 -0
- package/graphqlFields/ref.js.map +1 -0
- package/graphqlFields/richText.d.ts +2 -0
- package/graphqlFields/richText.js +56 -0
- package/graphqlFields/richText.js.map +1 -0
- package/graphqlFields/text.d.ts +2 -0
- package/graphqlFields/text.js +73 -0
- package/graphqlFields/text.js.map +1 -0
- package/index.d.ts +10 -12
- package/index.js +80 -37
- package/index.js.map +1 -0
- package/modelManager/DefaultCmsModelManager.d.ts +14 -0
- package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js +11 -9
- package/modelManager/DefaultCmsModelManager.js.map +1 -0
- package/modelManager/index.d.ts +2 -0
- package/{content/plugins/modelManager → modelManager}/index.js +3 -3
- package/modelManager/index.js.map +1 -0
- package/package.json +37 -36
- package/parameters/context.d.ts +2 -0
- package/parameters/context.js +22 -0
- package/parameters/context.js.map +1 -0
- package/parameters/header.d.ts +2 -0
- package/parameters/header.js +55 -0
- package/parameters/header.js.map +1 -0
- package/parameters/index.d.ts +4 -0
- package/parameters/index.js +57 -0
- package/parameters/index.js.map +1 -0
- package/parameters/manual.d.ts +6 -0
- package/parameters/manual.js +45 -0
- package/parameters/manual.js.map +1 -0
- package/parameters/path.d.ts +2 -0
- package/parameters/path.js +51 -0
- package/parameters/path.js.map +1 -0
- package/plugins/CmsGroupPlugin.d.ts +13 -0
- package/{content/plugins → plugins}/CmsGroupPlugin.js +8 -2
- package/plugins/CmsGroupPlugin.js.map +1 -0
- package/plugins/CmsModelFieldConverterPlugin.d.ts +14 -0
- package/plugins/CmsModelFieldConverterPlugin.js +17 -0
- package/plugins/CmsModelFieldConverterPlugin.js.map +1 -0
- package/plugins/CmsModelPlugin.d.ts +41 -0
- package/plugins/CmsModelPlugin.js +189 -0
- package/plugins/CmsModelPlugin.js.map +1 -0
- package/plugins/CmsParametersPlugin.d.ts +20 -0
- package/plugins/CmsParametersPlugin.js +28 -0
- package/plugins/CmsParametersPlugin.js.map +1 -0
- package/{content/plugins/storage → plugins}/StorageTransformPlugin.d.ts +4 -3
- package/{content/plugins/storage → plugins}/StorageTransformPlugin.js +1 -0
- package/plugins/StorageTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +5 -0
- package/plugins/index.js +70 -0
- package/plugins/index.js.map +1 -0
- package/storage/default.d.ts +2 -0
- package/storage/default.js +27 -0
- package/storage/default.js.map +1 -0
- package/storage/object.d.ts +2 -0
- package/storage/object.js +128 -0
- package/storage/object.js.map +1 -0
- package/types.d.ts +413 -246
- package/types.js +52 -0
- package/types.js.map +1 -0
- package/upgrades/5.33.0/index.d.ts +3 -0
- package/upgrades/5.33.0/index.js +186 -0
- package/upgrades/5.33.0/index.js.map +1 -0
- package/upgrades/index.d.ts +1 -0
- package/upgrades/index.js +12 -0
- package/upgrades/index.js.map +1 -0
- package/utils/access.d.ts +8 -0
- package/utils/access.js +90 -0
- package/utils/access.js.map +1 -0
- package/utils/converters/Converter.d.ts +27 -0
- package/utils/converters/Converter.js +71 -0
- package/utils/converters/Converter.js.map +1 -0
- package/utils/converters/ConverterCollection.d.ts +24 -0
- package/utils/converters/ConverterCollection.js +115 -0
- package/utils/converters/ConverterCollection.js.map +1 -0
- package/utils/converters/valueKeyStorageConverter.d.ts +18 -0
- package/utils/converters/valueKeyStorageConverter.js +152 -0
- package/utils/converters/valueKeyStorageConverter.js.map +1 -0
- package/{content/plugins/utils → utils}/createTypeName.d.ts +3 -3
- package/{content/plugins/utils → utils}/createTypeName.js +0 -0
- package/utils/createTypeName.js.map +1 -0
- package/{content/plugins/utils → utils}/entryStorage.d.ts +3 -3
- package/{content/plugins/utils → utils}/entryStorage.js +3 -7
- package/utils/entryStorage.js.map +1 -0
- package/utils/filterAsync.d.ts +1 -0
- package/utils/filterAsync.js +23 -0
- package/utils/filterAsync.js.map +1 -0
- package/utils/filterModelFields.d.ts +16 -0
- package/utils/filterModelFields.js +81 -0
- package/utils/filterModelFields.js.map +1 -0
- package/utils/getEntryTitle.d.ts +2 -0
- package/{content/plugins/utils → utils}/getEntryTitle.js +7 -6
- package/utils/getEntryTitle.js.map +1 -0
- package/utils/getSchemaFromFieldPlugins.d.ts +12 -0
- package/utils/getSchemaFromFieldPlugins.js +35 -0
- package/utils/getSchemaFromFieldPlugins.js.map +1 -0
- package/utils/ownership.d.ts +8 -0
- package/utils/ownership.js +41 -0
- package/utils/ownership.js.map +1 -0
- package/utils/permissions.d.ts +7 -0
- package/utils/permissions.js +110 -0
- package/utils/permissions.js.map +1 -0
- package/utils/pluralizedTypeName.d.ts +1 -0
- package/{content/plugins/utils → utils}/pluralizedTypeName.js +0 -0
- package/utils/pluralizedTypeName.js.map +1 -0
- package/utils/renderFields.d.ts +15 -0
- package/{content/plugins/utils → utils}/renderFields.js +4 -2
- package/utils/renderFields.js.map +1 -0
- package/utils/renderGetFilterFields.d.ts +10 -0
- package/{content/plugins/utils → utils}/renderGetFilterFields.js +28 -13
- package/utils/renderGetFilterFields.js.map +1 -0
- package/utils/renderInputFields.d.ts +14 -0
- package/{content/plugins/utils → utils}/renderInputFields.js +1 -1
- package/utils/renderInputFields.js.map +1 -0
- package/utils/renderListFilterFields.d.ts +11 -0
- package/{content/plugins/utils → utils}/renderListFilterFields.js +30 -17
- package/utils/renderListFilterFields.js.map +1 -0
- package/{content/plugins/utils → utils}/renderSortEnum.d.ts +1 -1
- package/utils/renderSortEnum.js +32 -0
- package/utils/renderSortEnum.js.map +1 -0
- package/utils/toSlug.d.ts +1 -0
- package/utils/toSlug.js +20 -0
- package/utils/toSlug.js.map +1 -0
- package/validators/dateGte.d.ts +2 -0
- package/{content/plugins/validators → validators}/dateGte.js +4 -4
- package/validators/dateGte.js.map +1 -0
- package/validators/dateLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/dateLte.js +4 -4
- package/validators/dateLte.js.map +1 -0
- package/validators/gte.d.ts +2 -0
- package/validators/gte.js +36 -0
- package/validators/gte.js.map +1 -0
- package/validators/in.d.ts +2 -0
- package/validators/in.js +36 -0
- package/validators/in.js.map +1 -0
- package/validators/index.d.ts +1 -0
- package/validators/index.js +36 -0
- package/validators/index.js.map +1 -0
- package/validators/lte.d.ts +2 -0
- package/validators/lte.js +36 -0
- package/validators/lte.js.map +1 -0
- package/validators/maxLength.d.ts +2 -0
- package/validators/maxLength.js +36 -0
- package/validators/maxLength.js.map +1 -0
- package/validators/minLength.d.ts +2 -0
- package/validators/minLength.js +36 -0
- package/validators/minLength.js.map +1 -0
- package/validators/pattern.d.ts +2 -0
- package/validators/pattern.js +50 -0
- package/validators/pattern.js.map +1 -0
- package/validators/patternPlugins/email.d.ts +2 -0
- package/validators/patternPlugins/email.js +20 -0
- package/validators/patternPlugins/email.js.map +1 -0
- package/validators/patternPlugins/index.d.ts +2 -0
- package/validators/patternPlugins/index.js +24 -0
- package/validators/patternPlugins/index.js.map +1 -0
- package/validators/patternPlugins/lowerCase.d.ts +2 -0
- package/validators/patternPlugins/lowerCase.js +20 -0
- package/validators/patternPlugins/lowerCase.js.map +1 -0
- package/validators/patternPlugins/lowerCaseSpace.d.ts +2 -0
- package/validators/patternPlugins/lowerCaseSpace.js +20 -0
- package/validators/patternPlugins/lowerCaseSpace.js.map +1 -0
- package/validators/patternPlugins/upperCase.d.ts +2 -0
- package/validators/patternPlugins/upperCase.js +20 -0
- package/validators/patternPlugins/upperCase.js.map +1 -0
- package/validators/patternPlugins/upperCaseSpace.d.ts +2 -0
- package/validators/patternPlugins/upperCaseSpace.js +20 -0
- package/validators/patternPlugins/upperCaseSpace.js.map +1 -0
- package/validators/patternPlugins/url.d.ts +2 -0
- package/validators/patternPlugins/url.js +20 -0
- package/validators/patternPlugins/url.js.map +1 -0
- package/validators/required.d.ts +2 -0
- package/validators/required.js +27 -0
- package/validators/required.js.map +1 -0
- package/validators/timeGte.d.ts +2 -0
- package/{content/plugins/validators → validators}/timeGte.js +6 -4
- package/validators/timeGte.js.map +1 -0
- package/validators/timeLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/timeLte.js +6 -4
- package/validators/timeLte.js.map +1 -0
- package/validators/unique.d.ts +6 -0
- package/validators/unique.js +63 -0
- package/validators/unique.js.map +1 -0
- package/content/contextSetup.d.ts +0 -4
- package/content/contextSetup.js +0 -65
- package/content/graphQLHandlerFactory.d.ts +0 -5
- package/content/graphQLHandlerFactory.js +0 -173
- package/content/plugins/CmsGroupPlugin.d.ts +0 -11
- package/content/plugins/CmsModelPlugin.d.ts +0 -11
- package/content/plugins/CmsModelPlugin.js +0 -24
- package/content/plugins/buildSchemaPlugins.js +0 -29
- package/content/plugins/crud/contentEntry/afterDelete.d.ts +0 -7
- package/content/plugins/crud/contentEntry/beforeCreate.d.ts +0 -7
- package/content/plugins/crud/contentEntry/beforeUpdate.d.ts +0 -7
- package/content/plugins/crud/contentEntry/entryDataValidation.d.ts +0 -4
- package/content/plugins/crud/contentModel/afterCreate.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterDelete.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterUpdate.d.ts +0 -7
- package/content/plugins/crud/contentModel/beforeCreate.d.ts +0 -9
- package/content/plugins/crud/contentModel/beforeUpdate.js +0 -128
- package/content/plugins/crud/contentModel/contentModelManagerFactory.d.ts +0 -2
- package/content/plugins/crud/contentModel/createFieldModels.d.ts +0 -2
- package/content/plugins/crud/contentModel/idValidation.d.ts +0 -2
- package/content/plugins/crud/contentModel/validateLayout.d.ts +0 -2
- package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +0 -8
- package/content/plugins/crud/index.d.ts +0 -6
- package/content/plugins/graphqlFields/boolean.d.ts +0 -3
- package/content/plugins/graphqlFields/boolean.js +0 -69
- package/content/plugins/graphqlFields/datetime.d.ts +0 -3
- package/content/plugins/graphqlFields/datetime.js +0 -83
- package/content/plugins/graphqlFields/file.d.ts +0 -3
- package/content/plugins/graphqlFields/file.js +0 -49
- package/content/plugins/graphqlFields/index.d.ts +0 -2
- package/content/plugins/graphqlFields/index.js +0 -30
- package/content/plugins/graphqlFields/longText.d.ts +0 -3
- package/content/plugins/graphqlFields/longText.js +0 -62
- package/content/plugins/graphqlFields/number.d.ts +0 -3
- package/content/plugins/graphqlFields/number.js +0 -75
- package/content/plugins/graphqlFields/object.d.ts +0 -3
- package/content/plugins/graphqlFields/object.js +0 -180
- package/content/plugins/graphqlFields/ref.d.ts +0 -3
- package/content/plugins/graphqlFields/ref.js +0 -205
- package/content/plugins/graphqlFields/richText.d.ts +0 -3
- package/content/plugins/graphqlFields/richText.js +0 -55
- package/content/plugins/graphqlFields/text.d.ts +0 -3
- package/content/plugins/graphqlFields/text.js +0 -72
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +0 -8
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +0 -54
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +0 -7
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +0 -35
- package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +0 -15
- package/content/plugins/modelManager/index.d.ts +0 -3
- package/content/plugins/schema/baseSchema.d.ts +0 -4
- package/content/plugins/schema/contentEntries.d.ts +0 -4
- package/content/plugins/schema/contentEntries.js +0 -166
- package/content/plugins/schema/contentModelGroups.d.ts +0 -4
- package/content/plugins/schema/contentModels.d.ts +0 -4
- package/content/plugins/schema/createFieldResolvers.d.ts +0 -19
- package/content/plugins/schema/createManageResolvers.d.ts +0 -11
- package/content/plugins/schema/createManageSDL.d.ts +0 -9
- package/content/plugins/schema/createPreviewResolvers.d.ts +0 -10
- package/content/plugins/schema/createReadResolvers.d.ts +0 -10
- package/content/plugins/schema/createReadSDL.d.ts +0 -9
- package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +0 -6
- package/content/plugins/schema/resolvers/manage/resolveCreate.d.ts +0 -6
- package/content/plugins/schema/resolvers/manage/resolveCreateFrom.d.ts +0 -7
- package/content/plugins/schema/resolvers/manage/resolveDelete.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveGet.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveGetByIds.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveGetRevisions.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveList.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolvePublish.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveUnpublish.d.ts +0 -2
- package/content/plugins/schema/resolvers/manage/resolveUpdate.d.ts +0 -7
- package/content/plugins/schema/resolvers/preview/resolveGet.d.ts +0 -2
- package/content/plugins/schema/resolvers/preview/resolveList.d.ts +0 -2
- package/content/plugins/schema/resolvers/read/resolveGet.d.ts +0 -2
- package/content/plugins/schema/resolvers/read/resolveList.d.ts +0 -2
- package/content/plugins/storage/default.d.ts +0 -3
- package/content/plugins/storage/default.js +0 -28
- package/content/plugins/storage/object.d.ts +0 -3
- package/content/plugins/storage/object.js +0 -119
- package/content/plugins/utils/getEntryTitle.d.ts +0 -2
- package/content/plugins/utils/getSchemaFromFieldPlugins.d.ts +0 -11
- package/content/plugins/utils/getSchemaFromFieldPlugins.js +0 -30
- package/content/plugins/utils/pluralizedTypeName.d.ts +0 -1
- package/content/plugins/utils/renderFields.d.ts +0 -16
- package/content/plugins/utils/renderGetFilterFields.d.ts +0 -9
- package/content/plugins/utils/renderInputFields.d.ts +0 -14
- package/content/plugins/utils/renderListFilterFields.d.ts +0 -10
- package/content/plugins/utils/renderSortEnum.js +0 -32
- package/content/plugins/validators/dateGte.d.ts +0 -3
- package/content/plugins/validators/dateLte.d.ts +0 -3
- package/content/plugins/validators/gte.d.ts +0 -3
- package/content/plugins/validators/gte.js +0 -32
- package/content/plugins/validators/in.d.ts +0 -3
- package/content/plugins/validators/in.js +0 -32
- package/content/plugins/validators/index.d.ts +0 -2
- package/content/plugins/validators/index.js +0 -36
- package/content/plugins/validators/lte.d.ts +0 -3
- package/content/plugins/validators/lte.js +0 -32
- package/content/plugins/validators/maxLength.d.ts +0 -3
- package/content/plugins/validators/maxLength.js +0 -32
- package/content/plugins/validators/minLength.d.ts +0 -3
- package/content/plugins/validators/minLength.js +0 -32
- package/content/plugins/validators/pattern.d.ts +0 -3
- package/content/plugins/validators/pattern.js +0 -47
- package/content/plugins/validators/patternPlugins/email.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/email.js +0 -17
- package/content/plugins/validators/patternPlugins/index.d.ts +0 -2
- package/content/plugins/validators/patternPlugins/index.js +0 -19
- package/content/plugins/validators/patternPlugins/lowerCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/lowerCase.js +0 -17
- package/content/plugins/validators/patternPlugins/upperCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/upperCase.js +0 -17
- package/content/plugins/validators/patternPlugins/url.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/url.js +0 -17
- package/content/plugins/validators/required.d.ts +0 -3
- package/content/plugins/validators/required.js +0 -25
- package/content/plugins/validators/timeGte.d.ts +0 -3
- package/content/plugins/validators/timeLte.d.ts +0 -3
- package/migrateCMSPermissions.d.ts +0 -17
- package/migrateCMSPermissions.js +0 -193
- package/plugins/context.d.ts +0 -4
- package/plugins/context.js +0 -34
- package/plugins/crud/index.d.ts +0 -6
- package/plugins/crud/index.js +0 -100
- package/plugins/crud/settings.crud.js +0 -93
- package/plugins/graphql/system.d.ts +0 -17
- package/plugins/graphql/system.js +0 -72
- package/plugins/graphql.d.ts +0 -2
- package/plugins/graphql.js +0 -79
- package/plugins/upgrades/index.d.ts +0 -2
- package/plugins/upgrades/index.js +0 -14
- package/plugins/upgrades/v5.5.0/helpers.d.ts +0 -6
- package/plugins/upgrades/v5.5.0/helpers.js +0 -10
- package/plugins/upgrades/v5.5.0/index.d.ts +0 -4
- package/plugins/upgrades/v5.5.0/index.js +0 -129
- package/transformers.d.ts +0 -2
- package/transformers.js +0 -25
- package/utils.d.ts +0 -25
- package/utils.js +0 -251
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
9
|
-
|
|
10
|
-
var _apiSecurity = require("@webiny/api-security");
|
|
11
|
-
|
|
12
|
-
var _GraphQLSchemaPlugin = require("@webiny/handler-graphql/plugins/GraphQLSchemaPlugin");
|
|
13
|
-
|
|
14
|
-
var _getEntryTitle = require("../utils/getEntryTitle");
|
|
15
|
-
|
|
16
|
-
const plugin = context => {
|
|
17
|
-
if (!context.cms.MANAGE) {
|
|
18
|
-
return null;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
return new _GraphQLSchemaPlugin.GraphQLSchemaPlugin({
|
|
22
|
-
typeDefs:
|
|
23
|
-
/* GraphQL */
|
|
24
|
-
`
|
|
25
|
-
type CmsModelMeta {
|
|
26
|
-
modelId: String
|
|
27
|
-
name: String
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
type CmsContentEntry {
|
|
31
|
-
id: ID
|
|
32
|
-
model: CmsModelMeta
|
|
33
|
-
status: String
|
|
34
|
-
title: String
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
type CmsContentEntriesResponse {
|
|
38
|
-
data: [CmsContentEntry]
|
|
39
|
-
error: CmsError
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
type CmsContentEntryResponse {
|
|
43
|
-
data: CmsContentEntry
|
|
44
|
-
error: CmsError
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
input CmsModelEntryInput {
|
|
48
|
-
modelId: ID!
|
|
49
|
-
entryId: ID!
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
extend type Query {
|
|
53
|
-
# Search content entries for given content models using the query string.
|
|
54
|
-
searchContentEntries(
|
|
55
|
-
modelIds: [ID!]!
|
|
56
|
-
query: String!
|
|
57
|
-
limit: Int
|
|
58
|
-
): CmsContentEntriesResponse
|
|
59
|
-
|
|
60
|
-
# Get content entry meta data
|
|
61
|
-
getContentEntry(entry: CmsModelEntryInput!): CmsContentEntryResponse
|
|
62
|
-
|
|
63
|
-
# Get content entries meta data
|
|
64
|
-
getContentEntries(entries: [CmsModelEntryInput!]!): CmsContentEntriesResponse
|
|
65
|
-
}
|
|
66
|
-
`,
|
|
67
|
-
resolvers: {
|
|
68
|
-
Query: {
|
|
69
|
-
async searchContentEntries(_, args, context) {
|
|
70
|
-
const {
|
|
71
|
-
modelIds,
|
|
72
|
-
query,
|
|
73
|
-
limit = 10
|
|
74
|
-
} = args;
|
|
75
|
-
const models = await context.cms.listModels();
|
|
76
|
-
const getters = models.filter(model => modelIds.includes(model.modelId)).map(async model => {
|
|
77
|
-
const latest = query === "__latest__";
|
|
78
|
-
const modelManager = await context.cms.getModelManager(model.modelId);
|
|
79
|
-
const [items] = await modelManager.listLatest({
|
|
80
|
-
limit,
|
|
81
|
-
where: latest ? undefined : {
|
|
82
|
-
[`${model.titleFieldId}_contains`]: query
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
return items.map(entry => ({
|
|
86
|
-
id: entry.id,
|
|
87
|
-
model: {
|
|
88
|
-
modelId: model.modelId,
|
|
89
|
-
name: model.name
|
|
90
|
-
},
|
|
91
|
-
status: entry.status,
|
|
92
|
-
title: (0, _getEntryTitle.getEntryTitle)(model, entry),
|
|
93
|
-
// We need `savedOn` to sort entries from latest to oldest
|
|
94
|
-
savedOn: entry.savedOn
|
|
95
|
-
}));
|
|
96
|
-
});
|
|
97
|
-
const entries = await Promise.all(getters).then(results => results.reduce((result, item) => result.concat(item), []));
|
|
98
|
-
return new _handlerGraphql.Response(entries.sort((a, b) => Date.parse(b.savedOn) - Date.parse(a.savedOn)).slice(0, limit));
|
|
99
|
-
},
|
|
100
|
-
|
|
101
|
-
async getContentEntry(_, args, context) {
|
|
102
|
-
const {
|
|
103
|
-
modelId,
|
|
104
|
-
entryId
|
|
105
|
-
} = args.entry;
|
|
106
|
-
const models = await context.cms.listModels();
|
|
107
|
-
const model = models.find(m => m.modelId === modelId);
|
|
108
|
-
|
|
109
|
-
if (!model) {
|
|
110
|
-
return new _apiSecurity.NotAuthorizedResponse({
|
|
111
|
-
data: {
|
|
112
|
-
modelId
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
const [entry] = await context.cms.getEntriesByIds(model, [entryId]);
|
|
118
|
-
return new _handlerGraphql.Response({
|
|
119
|
-
id: entry.id,
|
|
120
|
-
model: {
|
|
121
|
-
modelId: model.modelId,
|
|
122
|
-
name: model.name
|
|
123
|
-
},
|
|
124
|
-
status: entry.status,
|
|
125
|
-
title: (0, _getEntryTitle.getEntryTitle)(model, entry)
|
|
126
|
-
});
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
async getContentEntries(_, args, context) {
|
|
130
|
-
const models = await context.cms.listModels();
|
|
131
|
-
const entriesByModel = args.entries.map((ref, index) => {
|
|
132
|
-
return {
|
|
133
|
-
entryId: ref.entryId,
|
|
134
|
-
modelId: ref.modelId,
|
|
135
|
-
index
|
|
136
|
-
};
|
|
137
|
-
});
|
|
138
|
-
const getters = entriesByModel.map(async ({
|
|
139
|
-
modelId,
|
|
140
|
-
entryId
|
|
141
|
-
}) => {
|
|
142
|
-
// Get model manager, to get access to CRUD methods
|
|
143
|
-
const model = models.find(m => m.modelId === modelId);
|
|
144
|
-
const entries = await context.cms.getEntriesByIds(model, [entryId]);
|
|
145
|
-
return entries.map(entry => ({
|
|
146
|
-
id: entry.id,
|
|
147
|
-
model: {
|
|
148
|
-
modelId: model.modelId,
|
|
149
|
-
name: model.name
|
|
150
|
-
},
|
|
151
|
-
status: entry.status,
|
|
152
|
-
title: (0, _getEntryTitle.getEntryTitle)(model, entry)
|
|
153
|
-
}));
|
|
154
|
-
});
|
|
155
|
-
return new _handlerGraphql.Response(await Promise.all(getters).then(results => {
|
|
156
|
-
return results.reduce((result, item) => result.concat(item), []);
|
|
157
|
-
}));
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
});
|
|
163
|
-
};
|
|
164
|
-
|
|
165
|
-
var _default = plugin;
|
|
166
|
-
exports.default = _default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CmsModelField } from "../../../types";
|
|
2
|
-
import { Resolvers } from "@webiny/handler-graphql/types";
|
|
3
|
-
interface CreateFieldResolvers {
|
|
4
|
-
graphQLType: string;
|
|
5
|
-
fields: CmsModelField[];
|
|
6
|
-
isRoot: boolean;
|
|
7
|
-
extraResolvers?: Resolvers<any>;
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* We use a factory to avoid passing the parameters for recursive invocations.
|
|
11
|
-
* This way they will always be in the function scope and we can only pass "fields".
|
|
12
|
-
*/
|
|
13
|
-
export declare function createFieldResolversFactory({ endpointType, models, model, fieldTypePlugins }: {
|
|
14
|
-
endpointType: any;
|
|
15
|
-
models: any;
|
|
16
|
-
model: any;
|
|
17
|
-
fieldTypePlugins: any;
|
|
18
|
-
}): (params: CreateFieldResolvers) => {};
|
|
19
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CmsModel, CmsFieldTypePlugins, CmsContext } from "../../../types";
|
|
2
|
-
interface CreateManageResolvers {
|
|
3
|
-
(params: {
|
|
4
|
-
models: CmsModel[];
|
|
5
|
-
model: CmsModel;
|
|
6
|
-
context: CmsContext;
|
|
7
|
-
fieldTypePlugins: CmsFieldTypePlugins;
|
|
8
|
-
}): any;
|
|
9
|
-
}
|
|
10
|
-
export declare const createManageResolvers: CreateManageResolvers;
|
|
11
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CmsModel, CmsFieldTypePlugins, CmsContext } from "../../../types";
|
|
2
|
-
export interface CreateReadResolvers {
|
|
3
|
-
(params: {
|
|
4
|
-
models: CmsModel[];
|
|
5
|
-
model: CmsModel;
|
|
6
|
-
context: CmsContext;
|
|
7
|
-
fieldTypePlugins: CmsFieldTypePlugins;
|
|
8
|
-
}): any;
|
|
9
|
-
}
|
|
10
|
-
export declare const createPreviewResolvers: CreateReadResolvers;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CmsModel, CmsFieldTypePlugins, CmsContext } from "../../../types";
|
|
2
|
-
export interface CreateReadResolvers {
|
|
3
|
-
(params: {
|
|
4
|
-
models: CmsModel[];
|
|
5
|
-
model: CmsModel;
|
|
6
|
-
context: CmsContext;
|
|
7
|
-
fieldTypePlugins: CmsFieldTypePlugins;
|
|
8
|
-
}): any;
|
|
9
|
-
}
|
|
10
|
-
export declare const createReadResolvers: CreateReadResolvers;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CmsEntry } from "../../../../types";
|
|
2
|
-
export declare const commonFieldResolvers: () => {
|
|
3
|
-
id: (entry: CmsEntry) => string;
|
|
4
|
-
createdBy: (entry: CmsEntry) => import("../../../../types").CreatedBy;
|
|
5
|
-
ownedBy: (entry: CmsEntry) => import("../../../../types").CreatedBy;
|
|
6
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { CmsEntryResolverFactory as ResolverFactory } from "../../../../../types";
|
|
2
|
-
declare type ResolveCreateFrom = ResolverFactory<any, {
|
|
3
|
-
revision: string;
|
|
4
|
-
data: Record<string, any>;
|
|
5
|
-
}>;
|
|
6
|
-
export declare const resolveCreateFrom: ResolveCreateFrom;
|
|
7
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _StorageTransformPlugin = require("./StorageTransformPlugin");
|
|
9
|
-
|
|
10
|
-
const plugin = new _StorageTransformPlugin.StorageTransformPlugin({
|
|
11
|
-
fieldType: "*",
|
|
12
|
-
fromStorage: async ({
|
|
13
|
-
value
|
|
14
|
-
}) => {
|
|
15
|
-
return value;
|
|
16
|
-
},
|
|
17
|
-
toStorage: async ({
|
|
18
|
-
value
|
|
19
|
-
}) => {
|
|
20
|
-
return value;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
var _default = () => {
|
|
25
|
-
return plugin;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
exports.default = _default;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.default = void 0;
|
|
9
|
-
|
|
10
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
|
-
var _pReduce = _interopRequireDefault(require("p-reduce"));
|
|
13
|
-
|
|
14
|
-
var _pMap = _interopRequireDefault(require("p-map"));
|
|
15
|
-
|
|
16
|
-
var _StorageTransformPlugin = require("./StorageTransformPlugin");
|
|
17
|
-
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
19
|
-
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
21
|
-
|
|
22
|
-
const processValue = async ({
|
|
23
|
-
fields,
|
|
24
|
-
sourceValue,
|
|
25
|
-
getStoragePlugin,
|
|
26
|
-
plugins,
|
|
27
|
-
model,
|
|
28
|
-
operation
|
|
29
|
-
}) => {
|
|
30
|
-
return await (0, _pReduce.default)(fields, async (values, field) => {
|
|
31
|
-
const plugin = getStoragePlugin(field.type);
|
|
32
|
-
const value = await plugin[operation]({
|
|
33
|
-
plugins,
|
|
34
|
-
model,
|
|
35
|
-
field,
|
|
36
|
-
value: sourceValue[field.fieldId],
|
|
37
|
-
getStoragePlugin
|
|
38
|
-
});
|
|
39
|
-
return _objectSpread(_objectSpread({}, values), {}, {
|
|
40
|
-
[field.fieldId]: value
|
|
41
|
-
});
|
|
42
|
-
}, {});
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const plugin = new _StorageTransformPlugin.StorageTransformPlugin({
|
|
46
|
-
fieldType: "object",
|
|
47
|
-
toStorage: async ({
|
|
48
|
-
field,
|
|
49
|
-
value,
|
|
50
|
-
getStoragePlugin,
|
|
51
|
-
model,
|
|
52
|
-
plugins
|
|
53
|
-
}) => {
|
|
54
|
-
if (!value) {
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const fields = field.settings.fields;
|
|
59
|
-
|
|
60
|
-
if (field.multipleValues) {
|
|
61
|
-
return await (0, _pMap.default)(value, value => processValue({
|
|
62
|
-
sourceValue: value,
|
|
63
|
-
getStoragePlugin,
|
|
64
|
-
model,
|
|
65
|
-
plugins,
|
|
66
|
-
operation: "toStorage",
|
|
67
|
-
fields
|
|
68
|
-
}));
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return processValue({
|
|
72
|
-
sourceValue: value,
|
|
73
|
-
getStoragePlugin,
|
|
74
|
-
model,
|
|
75
|
-
plugins,
|
|
76
|
-
operation: "toStorage",
|
|
77
|
-
fields
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
fromStorage: async ({
|
|
81
|
-
field,
|
|
82
|
-
value,
|
|
83
|
-
getStoragePlugin,
|
|
84
|
-
plugins,
|
|
85
|
-
model
|
|
86
|
-
}) => {
|
|
87
|
-
if (!value) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
const fields = field.settings.fields;
|
|
92
|
-
|
|
93
|
-
if (field.multipleValues) {
|
|
94
|
-
return (0, _pMap.default)(value, value => processValue({
|
|
95
|
-
sourceValue: value,
|
|
96
|
-
getStoragePlugin,
|
|
97
|
-
model,
|
|
98
|
-
plugins,
|
|
99
|
-
operation: "fromStorage",
|
|
100
|
-
fields
|
|
101
|
-
}));
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
return processValue({
|
|
105
|
-
sourceValue: value,
|
|
106
|
-
getStoragePlugin,
|
|
107
|
-
model,
|
|
108
|
-
plugins,
|
|
109
|
-
operation: "fromStorage",
|
|
110
|
-
fields
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
var _default = () => {
|
|
116
|
-
return plugin;
|
|
117
|
-
};
|
|
118
|
-
|
|
119
|
-
exports.default = _default;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { CmsModel, CmsContext, CmsFieldTypePlugins } from "../../../types";
|
|
2
|
-
import { GraphQLSchemaDefinition } from "@webiny/handler-graphql/types";
|
|
3
|
-
interface RenderTypesFromFieldPlugins {
|
|
4
|
-
(params: {
|
|
5
|
-
models: CmsModel[];
|
|
6
|
-
fieldTypePlugins: CmsFieldTypePlugins;
|
|
7
|
-
type: string;
|
|
8
|
-
}): GraphQLSchemaDefinition<CmsContext>[];
|
|
9
|
-
}
|
|
10
|
-
export declare const getSchemaFromFieldPlugins: RenderTypesFromFieldPlugins;
|
|
11
|
-
export {};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.getSchemaFromFieldPlugins = void 0;
|
|
7
|
-
const TYPE_MAP = {
|
|
8
|
-
preview: "read",
|
|
9
|
-
read: "read",
|
|
10
|
-
manage: "manage"
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const getSchemaFromFieldPlugins = ({
|
|
14
|
-
models,
|
|
15
|
-
fieldTypePlugins,
|
|
16
|
-
type
|
|
17
|
-
}) => {
|
|
18
|
-
return Object.values(fieldTypePlugins).map(pl => {
|
|
19
|
-
// Render gql types generated by field type plugins
|
|
20
|
-
if (typeof pl[TYPE_MAP[type]].createSchema === "function") {
|
|
21
|
-
return pl[TYPE_MAP[type]].createSchema({
|
|
22
|
-
models
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
return null;
|
|
27
|
-
}).filter(Boolean);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
exports.getSchemaFromFieldPlugins = getSchemaFromFieldPlugins;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const pluralizedTypeName: (typeName: string) => any;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { CmsFieldTypePlugins, CmsModel, CmsModelFieldDefinition } from "../../../types";
|
|
2
|
-
interface RenderFields {
|
|
3
|
-
(params: {
|
|
4
|
-
model: CmsModel;
|
|
5
|
-
type: string;
|
|
6
|
-
fieldTypePlugins: CmsFieldTypePlugins;
|
|
7
|
-
}): CmsModelFieldDefinition[];
|
|
8
|
-
}
|
|
9
|
-
export declare const renderFields: RenderFields;
|
|
10
|
-
export declare const renderField: ({ model, type, field, fieldTypePlugins }: {
|
|
11
|
-
model: any;
|
|
12
|
-
type: any;
|
|
13
|
-
field: any;
|
|
14
|
-
fieldTypePlugins: any;
|
|
15
|
-
}) => any;
|
|
16
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { CmsFieldTypePlugins, CmsModel } from "../../../types";
|
|
2
|
-
interface RenderGetFilterFields {
|
|
3
|
-
(params: {
|
|
4
|
-
model: CmsModel;
|
|
5
|
-
fieldTypePlugins: CmsFieldTypePlugins;
|
|
6
|
-
}): string;
|
|
7
|
-
}
|
|
8
|
-
export declare const renderGetFilterFields: RenderGetFilterFields;
|
|
9
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { CmsFieldTypePlugins, CmsModel, CmsModelFieldDefinition } from "../../../types";
|
|
2
|
-
interface RenderInputFields {
|
|
3
|
-
(params: {
|
|
4
|
-
model: CmsModel;
|
|
5
|
-
fieldTypePlugins: CmsFieldTypePlugins;
|
|
6
|
-
}): CmsModelFieldDefinition[];
|
|
7
|
-
}
|
|
8
|
-
export declare const renderInputFields: RenderInputFields;
|
|
9
|
-
export declare const renderInputField: ({ model, field, fieldTypePlugins }: {
|
|
10
|
-
model: any;
|
|
11
|
-
field: any;
|
|
12
|
-
fieldTypePlugins: any;
|
|
13
|
-
}) => CmsModelFieldDefinition;
|
|
14
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { CmsFieldTypePlugins, CmsModel } from "../../../types";
|
|
2
|
-
interface RenderListFilterFields {
|
|
3
|
-
(params: {
|
|
4
|
-
model: CmsModel;
|
|
5
|
-
type: "read" | "manage";
|
|
6
|
-
fieldTypePlugins: CmsFieldTypePlugins;
|
|
7
|
-
}): string;
|
|
8
|
-
}
|
|
9
|
-
export declare const renderListFilterFields: RenderListFilterFields;
|
|
10
|
-
export {};
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.renderSortEnum = void 0;
|
|
9
|
-
|
|
10
|
-
var _get = _interopRequireDefault(require("lodash/get"));
|
|
11
|
-
|
|
12
|
-
const renderSortEnum = ({
|
|
13
|
-
model,
|
|
14
|
-
fieldTypePlugins
|
|
15
|
-
}) => {
|
|
16
|
-
const sorters = [`id_ASC`, `id_DESC`, "savedOn_ASC", "savedOn_DESC", "createdOn_ASC", "createdOn_DESC"];
|
|
17
|
-
const fieldIds = model.fields.filter(f => {
|
|
18
|
-
// Every time a client updates content model's fields, we check the type of each field. If a field plugin
|
|
19
|
-
// for a particular "field.type" doesn't exist on the backend yet, we throw an error. But still, we also
|
|
20
|
-
// want to be careful when accessing the field plugin here too. It is still possible to have a content model
|
|
21
|
-
// that contains a field, for which we don't have a plugin registered on the backend. For example, user
|
|
22
|
-
// could've just removed the plugin from the backend.
|
|
23
|
-
return (0, _get.default)(fieldTypePlugins, `${f.type}.isSortable`);
|
|
24
|
-
}).map(f => f.fieldId);
|
|
25
|
-
fieldIds.forEach(fieldId => {
|
|
26
|
-
sorters.push(`${fieldId}_ASC`);
|
|
27
|
-
sorters.push(`${fieldId}_DESC`);
|
|
28
|
-
});
|
|
29
|
-
return sorters.join("\n");
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
exports.renderSortEnum = renderSortEnum;
|