@webiny/api-headless-cms 5.29.0 → 5.30.0
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/{content/contextSetup.js → context.js} +13 -8
- package/context.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry/afterDelete.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/afterDelete.js +0 -0
- package/{content/plugins/crud → crud}/contentEntry/afterDelete.js.map +0 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeCreate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/beforeCreate.js +0 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeCreate.js.map +0 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.js +0 -0
- package/{content/plugins/crud → crud}/contentEntry/beforeUpdate.js.map +0 -0
- package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/entryDataValidation.js +7 -1
- package/crud/contentEntry/entryDataValidation.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry/markLockedFields.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/markLockedFields.js +1 -1
- package/crud/contentEntry/markLockedFields.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry/referenceFieldsMapping.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry/referenceFieldsMapping.js +0 -0
- package/{content/plugins/crud → crud}/contentEntry/referenceFieldsMapping.js.map +0 -0
- package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentEntry.crud.js +68 -42
- package/crud/contentEntry.crud.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/afterCreate.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreate.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreateFrom.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/afterCreateFrom.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterCreateFrom.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterDelete.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/afterDelete.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterDelete.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterUpdate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/afterUpdate.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/afterUpdate.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/beforeCreate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +1 -1
- package/crud/contentModel/beforeCreate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +1 -1
- package/crud/contentModel/beforeDelete.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/beforeUpdate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/beforeUpdate.js +0 -0
- package/crud/contentModel/beforeUpdate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/contentModelManagerFactory.js.map +0 -0
- package/crud/contentModel/createFieldModels.d.ts +2 -0
- package/{content/plugins/crud → crud}/contentModel/createFieldModels.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/createFieldModels.js.map +0 -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 +0 -0
- package/{content/plugins/crud → crud}/contentModel/models.js +2 -2
- package/crud/contentModel/models.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel/validateLayout.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/validateLayout.js +0 -0
- package/{content/plugins/crud → crud}/contentModel/validateLayout.js.map +0 -0
- package/{content/plugins/crud → crud}/contentModel/validateModelFields.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel/validateModelFields.js +2 -2
- package/crud/contentModel/validateModelFields.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel.crud.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModel.crud.js +14 -12
- package/crud/contentModel.crud.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +5 -5
- package/crud/contentModelGroup/beforeCreate.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.d.ts +1 -1
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +1 -1
- package/crud/contentModelGroup/beforeDelete.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.d.ts +1 -1
- 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 +1 -1
- package/{content/plugins/crud → crud}/contentModelGroup.crud.js +15 -13
- package/crud/contentModelGroup.crud.js.map +1 -0
- package/crud/index.d.ts +6 -0
- package/{content/plugins/crud → crud}/index.js +5 -17
- package/crud/index.js.map +1 -0
- package/{plugins/crud → crud}/settings.crud.d.ts +1 -1
- package/{plugins/crud → crud}/settings.crud.js +3 -7
- package/crud/settings.crud.js.map +1 -0
- package/{plugins/crud → crud}/system.crud.d.ts +1 -1
- package/{plugins/crud → crud}/system.crud.js +0 -0
- package/{plugins/crud → crud}/system.crud.js.map +0 -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/{content → graphql}/graphQLHandlerFactory.js +26 -18
- 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} +3 -27
- package/graphql/schema/baseContentSchema.js.map +1 -0
- package/graphql/schema/contentEntries.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentEntries.js +5 -58
- package/graphql/schema/contentEntries.js.map +1 -0
- package/graphql/schema/contentModelGroups.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentModelGroups.js +27 -11
- package/graphql/schema/contentModelGroups.js.map +1 -0
- package/graphql/schema/contentModels.d.ts +3 -0
- package/{content/plugins → graphql}/schema/contentModels.js +13 -7
- package/graphql/schema/contentModels.js.map +1 -0
- package/{content/plugins → graphql}/schema/createFieldResolvers.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createFieldResolvers.js +1 -1
- package/graphql/schema/createFieldResolvers.js.map +1 -0
- package/{content/plugins → graphql}/schema/createManageResolvers.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createManageResolvers.js +7 -3
- package/graphql/schema/createManageResolvers.js.map +1 -0
- package/{content/plugins → graphql}/schema/createManageSDL.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createManageSDL.js +11 -7
- package/graphql/schema/createManageSDL.js.map +1 -0
- package/{content/plugins → graphql}/schema/createPreviewResolvers.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createPreviewResolvers.js +2 -2
- package/graphql/schema/createPreviewResolvers.js.map +1 -0
- package/{content/plugins → graphql}/schema/createReadResolvers.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createReadResolvers.js +2 -2
- package/graphql/schema/createReadResolvers.js.map +1 -0
- package/{content/plugins → graphql}/schema/createReadSDL.d.ts +1 -1
- package/{content/plugins → graphql}/schema/createReadSDL.js +6 -6
- 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/{content/plugins → graphql}/schema/resolvers/commonFieldResolvers.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreate.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveCreateFrom.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveDelete.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGet.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGet.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGet.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetByIds.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveGetRevisions.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveList.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveList.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveList.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolvePublish.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRepublish.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRepublish.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRepublish.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestChanges.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveRequestReview.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUnpublish.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/manage/resolveUpdate.js.map +0 -0
- package/{content/plugins/schema/resolvers/read → graphql/schema/resolvers/preview}/resolveGet.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveGet.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveGet.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/preview/resolveList.js.map +0 -0
- package/{content/plugins/schema/resolvers/preview → graphql/schema/resolvers/read}/resolveGet.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/read/resolveGet.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/read/resolveGet.js.map +0 -0
- package/{content/plugins → graphql}/schema/resolvers/read/resolveList.d.ts +1 -1
- package/{content/plugins → graphql}/schema/resolvers/read/resolveList.js +0 -0
- package/{content/plugins → graphql}/schema/resolvers/read/resolveList.js.map +0 -0
- package/{content/plugins → graphql}/schema/schemaPlugins.d.ts +1 -1
- package/{content/plugins → graphql}/schema/schemaPlugins.js +18 -5
- 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/{content/plugins/graphqlFields → graphqlFields}/datetime.js +42 -40
- 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/{content/plugins/graphqlFields → graphqlFields}/helpers.d.ts +1 -1
- package/{content/plugins/graphqlFields → graphqlFields}/helpers.js +0 -0
- package/{content/plugins/graphqlFields → graphqlFields}/helpers.js.map +0 -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 -17
- package/index.js +73 -56
- package/index.js.map +1 -1
- package/modelManager/DefaultCmsModelManager.d.ts +14 -0
- package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js +0 -0
- package/{content/plugins/modelManager → modelManager}/DefaultCmsModelManager.js.map +0 -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 +26 -27
- 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/{plugins/context.js → parameters/manual.js} +27 -27
- package/parameters/manual.js.map +1 -0
- package/parameters/path.d.ts +2 -0
- package/parameters/path.js +54 -0
- package/parameters/path.js.map +1 -0
- package/{content/plugins → plugins}/CmsGroupPlugin.d.ts +1 -1
- package/{content/plugins → plugins}/CmsGroupPlugin.js +0 -0
- package/{content/plugins → plugins}/CmsGroupPlugin.js.map +0 -0
- package/{content/plugins → plugins}/CmsModelPlugin.d.ts +1 -1
- package/{content/plugins → plugins}/CmsModelPlugin.js +0 -0
- package/{content/plugins → plugins}/CmsModelPlugin.js.map +0 -0
- package/{content/plugins → plugins}/CmsParametersPlugin.d.ts +8 -3
- package/{content/plugins → plugins}/CmsParametersPlugin.js +0 -0
- package/plugins/CmsParametersPlugin.js.map +1 -0
- package/{content/plugins/storage → plugins}/StorageTransformPlugin.d.ts +2 -1
- package/{content/plugins/storage → plugins}/StorageTransformPlugin.js +1 -0
- package/plugins/StorageTransformPlugin.js.map +1 -0
- package/plugins/index.d.ts +4 -0
- package/plugins/index.js +57 -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/{content/plugins/storage → storage}/object.js +63 -64
- package/storage/object.js.map +1 -0
- package/types.d.ts +28 -3
- package/types.js.map +1 -1
- package/upgrades/index.d.ts +1 -0
- package/upgrades/index.js +10 -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/{content/plugins/utils → utils}/createTypeName.d.ts +0 -0
- package/{content/plugins/utils → utils}/createTypeName.js +0 -0
- package/{content/plugins/utils → utils}/createTypeName.js.map +0 -0
- package/{content/plugins/utils → utils}/entryStorage.d.ts +1 -1
- package/{content/plugins/utils → utils}/entryStorage.js +1 -1
- 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/{content/plugins/utils → utils}/getEntryTitle.d.ts +1 -1
- package/{content/plugins/utils → utils}/getEntryTitle.js +0 -0
- package/{content/plugins/utils → utils}/getEntryTitle.js.map +0 -0
- package/{content/plugins/utils → utils}/getSchemaFromFieldPlugins.d.ts +1 -1
- package/{content/plugins/utils → utils}/getSchemaFromFieldPlugins.js +0 -0
- package/{content/plugins/utils → utils}/getSchemaFromFieldPlugins.js.map +0 -0
- package/utils/ownership.d.ts +8 -0
- package/utils/ownership.js +39 -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/{content/plugins/utils → utils}/pluralizedTypeName.d.ts +0 -0
- package/{content/plugins/utils → utils}/pluralizedTypeName.js +0 -0
- package/{content/plugins/utils → utils}/pluralizedTypeName.js.map +0 -0
- package/{content/plugins/utils → utils}/renderFields.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderFields.js +0 -0
- package/{content/plugins/utils → utils}/renderFields.js.map +0 -0
- package/{content/plugins/utils → utils}/renderGetFilterFields.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderGetFilterFields.js +0 -0
- package/{content/plugins/utils → utils}/renderGetFilterFields.js.map +0 -0
- package/{content/plugins/utils → utils}/renderInputFields.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderInputFields.js +0 -0
- package/{content/plugins/utils → utils}/renderInputFields.js.map +0 -0
- package/{content/plugins/utils → utils}/renderListFilterFields.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderListFilterFields.js +0 -0
- package/{content/plugins/utils → utils}/renderListFilterFields.js.map +0 -0
- package/{content/plugins/utils → utils}/renderSortEnum.d.ts +1 -1
- package/{content/plugins/utils → utils}/renderSortEnum.js +0 -0
- package/{content/plugins/utils → utils}/renderSortEnum.js.map +0 -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 +3 -3
- package/validators/dateGte.js.map +1 -0
- package/validators/dateLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/dateLte.js +3 -3
- 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 +3 -3
- package/validators/timeGte.js.map +1 -0
- package/validators/timeLte.d.ts +2 -0
- package/{content/plugins/validators → validators}/timeLte.js +3 -3
- package/validators/timeLte.js.map +1 -0
- package/{content/plugins/validators → validators}/unique.d.ts +2 -3
- package/{content/plugins/validators → validators}/unique.js +3 -3
- package/validators/unique.js.map +1 -0
- package/content/contextSetup.d.ts +0 -4
- package/content/contextSetup.js.map +0 -1
- package/content/graphQLHandlerFactory.d.ts +0 -5
- package/content/graphQLHandlerFactory.js.map +0 -1
- package/content/parameterPlugins.d.ts +0 -6
- package/content/parameterPlugins.js +0 -78
- package/content/parameterPlugins.js.map +0 -1
- package/content/plugins/CmsParametersPlugin.js.map +0 -1
- package/content/plugins/buildSchemaPlugins.js +0 -29
- package/content/plugins/buildSchemaPlugins.js.map +0 -1
- package/content/plugins/crud/contentEntry/entryDataValidation.js.map +0 -1
- package/content/plugins/crud/contentEntry/markLockedFields.js.map +0 -1
- package/content/plugins/crud/contentEntry.crud.js.map +0 -1
- package/content/plugins/crud/contentModel/beforeCreate.js.map +0 -1
- package/content/plugins/crud/contentModel/beforeDelete.js.map +0 -1
- package/content/plugins/crud/contentModel/beforeUpdate.js.map +0 -1
- 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/idValidation.js.map +0 -1
- package/content/plugins/crud/contentModel/models.js.map +0 -1
- package/content/plugins/crud/contentModel/validateModelFields.js.map +0 -1
- package/content/plugins/crud/contentModel.crud.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/beforeCreate.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/beforeDelete.js.map +0 -1
- package/content/plugins/crud/contentModelGroup/beforeUpdate.js.map +0 -1
- package/content/plugins/crud/contentModelGroup.crud.js.map +0 -1
- package/content/plugins/crud/index.d.ts +0 -6
- package/content/plugins/crud/index.js.map +0 -1
- package/content/plugins/graphqlFields/boolean.d.ts +0 -3
- package/content/plugins/graphqlFields/boolean.js +0 -67
- package/content/plugins/graphqlFields/boolean.js.map +0 -1
- package/content/plugins/graphqlFields/datetime.d.ts +0 -3
- package/content/plugins/graphqlFields/datetime.js.map +0 -1
- package/content/plugins/graphqlFields/file.d.ts +0 -3
- package/content/plugins/graphqlFields/file.js +0 -48
- package/content/plugins/graphqlFields/file.js.map +0 -1
- package/content/plugins/graphqlFields/index.d.ts +0 -2
- package/content/plugins/graphqlFields/index.js +0 -30
- package/content/plugins/graphqlFields/index.js.map +0 -1
- package/content/plugins/graphqlFields/longText.d.ts +0 -3
- package/content/plugins/graphqlFields/longText.js +0 -61
- package/content/plugins/graphqlFields/longText.js.map +0 -1
- package/content/plugins/graphqlFields/number.d.ts +0 -3
- package/content/plugins/graphqlFields/number.js +0 -73
- package/content/plugins/graphqlFields/number.js.map +0 -1
- package/content/plugins/graphqlFields/object.d.ts +0 -3
- package/content/plugins/graphqlFields/object.js +0 -223
- package/content/plugins/graphqlFields/object.js.map +0 -1
- package/content/plugins/graphqlFields/ref.d.ts +0 -3
- package/content/plugins/graphqlFields/ref.js +0 -276
- package/content/plugins/graphqlFields/ref.js.map +0 -1
- package/content/plugins/graphqlFields/richText.d.ts +0 -3
- package/content/plugins/graphqlFields/richText.js +0 -54
- package/content/plugins/graphqlFields/richText.js.map +0 -1
- package/content/plugins/graphqlFields/text.d.ts +0 -3
- package/content/plugins/graphqlFields/text.js +0 -71
- package/content/plugins/graphqlFields/text.js.map +0 -1
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.d.ts +0 -8
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js +0 -55
- package/content/plugins/internalSecurity/InternalAuthenticationPlugin.js.map +0 -1
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.d.ts +0 -7
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js +0 -36
- package/content/plugins/internalSecurity/InternalAuthorizationPlugin.js.map +0 -1
- package/content/plugins/modelManager/DefaultCmsModelManager.d.ts +0 -14
- package/content/plugins/modelManager/index.d.ts +0 -3
- package/content/plugins/modelManager/index.js.map +0 -1
- package/content/plugins/schema/baseSchema.d.ts +0 -4
- package/content/plugins/schema/baseSchema.js.map +0 -1
- package/content/plugins/schema/contentEntries.d.ts +0 -4
- package/content/plugins/schema/contentEntries.js.map +0 -1
- package/content/plugins/schema/contentModelGroups.d.ts +0 -4
- package/content/plugins/schema/contentModelGroups.js.map +0 -1
- package/content/plugins/schema/contentModels.d.ts +0 -4
- package/content/plugins/schema/contentModels.js.map +0 -1
- package/content/plugins/schema/createFieldResolvers.js.map +0 -1
- package/content/plugins/schema/createManageResolvers.js.map +0 -1
- package/content/plugins/schema/createManageSDL.js.map +0 -1
- package/content/plugins/schema/createPreviewResolvers.js.map +0 -1
- package/content/plugins/schema/createReadResolvers.js.map +0 -1
- package/content/plugins/schema/createReadSDL.js.map +0 -1
- package/content/plugins/schema/resolvers/commonFieldResolvers.d.ts +0 -6
- package/content/plugins/schema/schemaPlugins.js.map +0 -1
- package/content/plugins/storage/StorageTransformPlugin.js.map +0 -1
- package/content/plugins/storage/default.d.ts +0 -3
- package/content/plugins/storage/default.js +0 -28
- package/content/plugins/storage/default.js.map +0 -1
- package/content/plugins/storage/object.d.ts +0 -3
- package/content/plugins/storage/object.js.map +0 -1
- package/content/plugins/utils/entryStorage.js.map +0 -1
- package/content/plugins/validators/dateGte.d.ts +0 -3
- package/content/plugins/validators/dateGte.js.map +0 -1
- package/content/plugins/validators/dateLte.d.ts +0 -3
- package/content/plugins/validators/dateLte.js.map +0 -1
- package/content/plugins/validators/gte.d.ts +0 -3
- package/content/plugins/validators/gte.js +0 -34
- package/content/plugins/validators/gte.js.map +0 -1
- package/content/plugins/validators/in.d.ts +0 -3
- package/content/plugins/validators/in.js +0 -34
- package/content/plugins/validators/in.js.map +0 -1
- package/content/plugins/validators/index.d.ts +0 -2
- package/content/plugins/validators/index.js +0 -38
- package/content/plugins/validators/index.js.map +0 -1
- package/content/plugins/validators/lte.d.ts +0 -3
- package/content/plugins/validators/lte.js +0 -34
- package/content/plugins/validators/lte.js.map +0 -1
- package/content/plugins/validators/maxLength.d.ts +0 -3
- package/content/plugins/validators/maxLength.js +0 -34
- package/content/plugins/validators/maxLength.js.map +0 -1
- package/content/plugins/validators/minLength.d.ts +0 -3
- package/content/plugins/validators/minLength.js +0 -34
- package/content/plugins/validators/minLength.js.map +0 -1
- package/content/plugins/validators/pattern.d.ts +0 -3
- package/content/plugins/validators/pattern.js +0 -47
- package/content/plugins/validators/pattern.js.map +0 -1
- package/content/plugins/validators/patternPlugins/email.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/email.js +0 -17
- package/content/plugins/validators/patternPlugins/email.js.map +0 -1
- package/content/plugins/validators/patternPlugins/index.d.ts +0 -2
- package/content/plugins/validators/patternPlugins/index.js +0 -23
- package/content/plugins/validators/patternPlugins/index.js.map +0 -1
- package/content/plugins/validators/patternPlugins/lowerCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/lowerCase.js +0 -17
- package/content/plugins/validators/patternPlugins/lowerCase.js.map +0 -1
- package/content/plugins/validators/patternPlugins/lowerCaseSpace.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/lowerCaseSpace.js +0 -17
- package/content/plugins/validators/patternPlugins/lowerCaseSpace.js.map +0 -1
- package/content/plugins/validators/patternPlugins/upperCase.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/upperCase.js +0 -17
- package/content/plugins/validators/patternPlugins/upperCase.js.map +0 -1
- package/content/plugins/validators/patternPlugins/upperCaseSpace.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/upperCaseSpace.js +0 -17
- package/content/plugins/validators/patternPlugins/upperCaseSpace.js.map +0 -1
- package/content/plugins/validators/patternPlugins/url.d.ts +0 -3
- package/content/plugins/validators/patternPlugins/url.js +0 -17
- package/content/plugins/validators/patternPlugins/url.js.map +0 -1
- package/content/plugins/validators/required.d.ts +0 -3
- package/content/plugins/validators/required.js +0 -25
- package/content/plugins/validators/required.js.map +0 -1
- package/content/plugins/validators/timeGte.d.ts +0 -3
- package/content/plugins/validators/timeGte.js.map +0 -1
- package/content/plugins/validators/timeLte.d.ts +0 -3
- package/content/plugins/validators/timeLte.js.map +0 -1
- package/content/plugins/validators/unique.js.map +0 -1
- package/migrateCMSPermissions.d.ts +0 -17
- package/migrateCMSPermissions.js +0 -199
- package/migrateCMSPermissions.js.map +0 -1
- package/plugins/context.d.ts +0 -4
- package/plugins/context.js.map +0 -1
- package/plugins/crud/index.d.ts +0 -6
- package/plugins/crud/index.js +0 -108
- package/plugins/crud/index.js.map +0 -1
- package/plugins/crud/settings.crud.js.map +0 -1
- package/plugins/graphql/system.d.ts +0 -18
- package/plugins/graphql/system.js +0 -74
- package/plugins/graphql/system.js.map +0 -1
- package/plugins/graphql.d.ts +0 -2
- package/plugins/graphql.js +0 -86
- package/plugins/graphql.js.map +0 -1
- package/plugins/upgrades/index.d.ts +0 -2
- package/plugins/upgrades/index.js +0 -14
- package/plugins/upgrades/index.js.map +0 -1
- 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/helpers.js.map +0 -1
- package/plugins/upgrades/v5.5.0/index.d.ts +0 -4
- package/plugins/upgrades/v5.5.0/index.js +0 -134
- package/plugins/upgrades/v5.5.0/index.js.map +0 -1
- package/transformers.d.ts +0 -2
- package/transformers.js +0 -25
- package/transformers.js.map +0 -1
- package/utils.d.ts +0 -23
- package/utils.js +0 -251
- package/utils.js.map +0 -1
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("./helpers");
|
|
9
|
-
|
|
10
|
-
const createListFilters = ({
|
|
11
|
-
field
|
|
12
|
-
}) => {
|
|
13
|
-
return `
|
|
14
|
-
${field.fieldId}: Boolean
|
|
15
|
-
${field.fieldId}_not: Boolean
|
|
16
|
-
`;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const plugin = {
|
|
20
|
-
name: "cms-model-field-to-graphql-boolean",
|
|
21
|
-
type: "cms-model-field-to-graphql",
|
|
22
|
-
fieldType: "boolean",
|
|
23
|
-
isSortable: true,
|
|
24
|
-
isSearchable: true,
|
|
25
|
-
read: {
|
|
26
|
-
createListFilters,
|
|
27
|
-
|
|
28
|
-
createGetFilters({
|
|
29
|
-
field
|
|
30
|
-
}) {
|
|
31
|
-
return `${field.fieldId}: Boolean`;
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
createTypeField({
|
|
35
|
-
field
|
|
36
|
-
}) {
|
|
37
|
-
if (field.multipleValues) {
|
|
38
|
-
return `${field.fieldId}: [Boolean]`;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
return `${field.fieldId}: Boolean`;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
manage: {
|
|
46
|
-
createListFilters,
|
|
47
|
-
|
|
48
|
-
createTypeField({
|
|
49
|
-
field
|
|
50
|
-
}) {
|
|
51
|
-
if (field.multipleValues) {
|
|
52
|
-
return field.fieldId + ": [Boolean]";
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
return field.fieldId + ": Boolean";
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
createInputField({
|
|
59
|
-
field
|
|
60
|
-
}) {
|
|
61
|
-
return (0, _helpers.createGraphQLInputField)(field, "Boolean");
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var _default = plugin;
|
|
67
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createListFilters","field","fieldId","plugin","name","type","fieldType","isSortable","isSearchable","read","createGetFilters","createTypeField","multipleValues","manage","createInputField","createGraphQLInputField"],"sources":["boolean.ts"],"sourcesContent":["import { CmsModelField, CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { createGraphQLInputField } from \"./helpers\";\n\ninterface CreateListFiltersParams {\n field: CmsModelField;\n}\nconst createListFilters = ({ field }: CreateListFiltersParams) => {\n return `\n ${field.fieldId}: Boolean\n ${field.fieldId}_not: Boolean\n `;\n};\n\nconst plugin: CmsModelFieldToGraphQLPlugin = {\n name: \"cms-model-field-to-graphql-boolean\",\n type: \"cms-model-field-to-graphql\",\n fieldType: \"boolean\",\n isSortable: true,\n isSearchable: true,\n read: {\n createListFilters,\n createGetFilters({ field }) {\n return `${field.fieldId}: Boolean`;\n },\n createTypeField({ field }) {\n if (field.multipleValues) {\n return `${field.fieldId}: [Boolean]`;\n }\n\n return `${field.fieldId}: Boolean`;\n }\n },\n manage: {\n createListFilters,\n createTypeField({ field }) {\n if (field.multipleValues) {\n return field.fieldId + \": [Boolean]\";\n }\n\n return field.fieldId + \": Boolean\";\n },\n createInputField({ field }) {\n return createGraphQLInputField(field, \"Boolean\");\n }\n }\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;AACA;;AAKA,MAAMA,iBAAiB,GAAG,CAAC;EAAEC;AAAF,CAAD,KAAwC;EAC9D,OAAQ;AACZ,UAAUA,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,KAHI;AAIH,CALD;;AAOA,MAAMC,MAAoC,GAAG;EACzCC,IAAI,EAAE,oCADmC;EAEzCC,IAAI,EAAE,4BAFmC;EAGzCC,SAAS,EAAE,SAH8B;EAIzCC,UAAU,EAAE,IAJ6B;EAKzCC,YAAY,EAAE,IAL2B;EAMzCC,IAAI,EAAE;IACFT,iBADE;;IAEFU,gBAAgB,CAAC;MAAET;IAAF,CAAD,EAAY;MACxB,OAAQ,GAAEA,KAAK,CAACC,OAAQ,WAAxB;IACH,CAJC;;IAKFS,eAAe,CAAC;MAAEV;IAAF,CAAD,EAAY;MACvB,IAAIA,KAAK,CAACW,cAAV,EAA0B;QACtB,OAAQ,GAAEX,KAAK,CAACC,OAAQ,aAAxB;MACH;;MAED,OAAQ,GAAED,KAAK,CAACC,OAAQ,WAAxB;IACH;;EAXC,CANmC;EAmBzCW,MAAM,EAAE;IACJb,iBADI;;IAEJW,eAAe,CAAC;MAAEV;IAAF,CAAD,EAAY;MACvB,IAAIA,KAAK,CAACW,cAAV,EAA0B;QACtB,OAAOX,KAAK,CAACC,OAAN,GAAgB,aAAvB;MACH;;MAED,OAAOD,KAAK,CAACC,OAAN,GAAgB,WAAvB;IACH,CARG;;IASJY,gBAAgB,CAAC;MAAEb;IAAF,CAAD,EAAY;MACxB,OAAO,IAAAc,gCAAA,EAAwBd,KAAxB,EAA+B,SAA/B,CAAP;IACH;;EAXG;AAnBiC,CAA7C;eAkCeE,M"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["fieldGraphQLTypes","time","dateTimeWithoutTimezone","dateTimeWithTimezone","date","getFieldGraphQLType","field","type","settings","createListFilters","fieldId","plugin","name","fieldType","isSortable","isSearchable","read","createGetFilters","createTypeField","multipleValues","manage","createInputField","createGraphQLInputField"],"sources":["datetime.ts"],"sourcesContent":["import { CmsModelField, CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { createGraphQLInputField } from \"./helpers\";\n\nconst fieldGraphQLTypes: Record<string, string> = {\n time: \"Time\",\n dateTimeWithoutTimezone: \"DateTime\",\n dateTimeWithTimezone: \"DateTimeZ\",\n date: \"Date\"\n};\n\nconst getFieldGraphQLType = (field: CmsModelField): string => {\n const type = field.settings?.type;\n if (!type || !fieldGraphQLTypes[type]) {\n return \"DateTime\";\n }\n return fieldGraphQLTypes[type];\n};\n\ninterface CreateListFiltersParams {\n field: CmsModelField;\n}\nconst createListFilters = ({ field }: CreateListFiltersParams) => {\n return `\n ${field.fieldId}: ${getFieldGraphQLType(field)}\n ${field.fieldId}_not: ${getFieldGraphQLType(field)}\n ${field.fieldId}_in: [${getFieldGraphQLType(field)}]\n ${field.fieldId}_not_in: [${getFieldGraphQLType(field)}]\n ${field.fieldId}_lt: ${getFieldGraphQLType(field)}\n ${field.fieldId}_lte: ${getFieldGraphQLType(field)}\n ${field.fieldId}_gt: ${getFieldGraphQLType(field)}\n ${field.fieldId}_gte: ${getFieldGraphQLType(field)}\n `;\n};\n\nconst plugin: CmsModelFieldToGraphQLPlugin = {\n name: \"cms-model-field-to-graphql-datetime\",\n type: \"cms-model-field-to-graphql\",\n fieldType: \"datetime\",\n isSortable: true,\n isSearchable: true,\n read: {\n createListFilters,\n createGetFilters({ field }) {\n return `${field.fieldId}: ${getFieldGraphQLType(field)}`;\n },\n createTypeField({ field }) {\n if (field.multipleValues) {\n return `${field.fieldId}: [${getFieldGraphQLType(field)}]`;\n }\n\n return `${field.fieldId}: ${getFieldGraphQLType(field)}`;\n }\n },\n manage: {\n createListFilters,\n createTypeField({ field }) {\n return `${field.fieldId}: ${getFieldGraphQLType(field)}`;\n },\n createInputField({ field }) {\n return createGraphQLInputField(field, getFieldGraphQLType(field));\n }\n }\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;AACA;;AAEA,MAAMA,iBAAyC,GAAG;EAC9CC,IAAI,EAAE,MADwC;EAE9CC,uBAAuB,EAAE,UAFqB;EAG9CC,oBAAoB,EAAE,WAHwB;EAI9CC,IAAI,EAAE;AAJwC,CAAlD;;AAOA,MAAMC,mBAAmB,GAAIC,KAAD,IAAkC;EAAA;;EAC1D,MAAMC,IAAI,sBAAGD,KAAK,CAACE,QAAT,oDAAG,gBAAgBD,IAA7B;;EACA,IAAI,CAACA,IAAD,IAAS,CAACP,iBAAiB,CAACO,IAAD,CAA/B,EAAuC;IACnC,OAAO,UAAP;EACH;;EACD,OAAOP,iBAAiB,CAACO,IAAD,CAAxB;AACH,CAND;;AAWA,MAAME,iBAAiB,GAAG,CAAC;EAAEH;AAAF,CAAD,KAAwC;EAC9D,OAAQ;AACZ,UAAUA,KAAK,CAACI,OAAQ,KAAIL,mBAAmB,CAACC,KAAD,CAAQ;AACvD,UAAUA,KAAK,CAACI,OAAQ,SAAQL,mBAAmB,CAACC,KAAD,CAAQ;AAC3D,UAAUA,KAAK,CAACI,OAAQ,SAAQL,mBAAmB,CAACC,KAAD,CAAQ;AAC3D,UAAUA,KAAK,CAACI,OAAQ,aAAYL,mBAAmB,CAACC,KAAD,CAAQ;AAC/D,UAAUA,KAAK,CAACI,OAAQ,QAAOL,mB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+0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("./helpers");
|
|
9
|
-
|
|
10
|
-
const plugin = {
|
|
11
|
-
name: "cms-model-field-to-graphql-file",
|
|
12
|
-
type: "cms-model-field-to-graphql",
|
|
13
|
-
fieldType: "file",
|
|
14
|
-
isSortable: false,
|
|
15
|
-
isSearchable: false,
|
|
16
|
-
read: {
|
|
17
|
-
createTypeField({
|
|
18
|
-
field
|
|
19
|
-
}) {
|
|
20
|
-
if (field.multipleValues) {
|
|
21
|
-
return `${field.fieldId}: [String]`;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return `${field.fieldId}: String`;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
},
|
|
28
|
-
manage: {
|
|
29
|
-
createTypeField({
|
|
30
|
-
field
|
|
31
|
-
}) {
|
|
32
|
-
if (field.multipleValues) {
|
|
33
|
-
return field.fieldId + ": [String]";
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return field.fieldId + ": String";
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
createInputField({
|
|
40
|
-
field
|
|
41
|
-
}) {
|
|
42
|
-
return (0, _helpers.createGraphQLInputField)(field, "String");
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
var _default = plugin;
|
|
48
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["plugin","name","type","fieldType","isSortable","isSearchable","read","createTypeField","field","multipleValues","fieldId","manage","createInputField","createGraphQLInputField"],"sources":["file.ts"],"sourcesContent":["import { CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { createGraphQLInputField } from \"./helpers\";\n\nconst plugin: CmsModelFieldToGraphQLPlugin = {\n name: \"cms-model-field-to-graphql-file\",\n type: \"cms-model-field-to-graphql\",\n fieldType: \"file\",\n isSortable: false,\n isSearchable: false,\n read: {\n createTypeField({ field }) {\n if (field.multipleValues) {\n return `${field.fieldId}: [String]`;\n }\n\n return `${field.fieldId}: String`;\n }\n },\n manage: {\n createTypeField({ field }) {\n if (field.multipleValues) {\n return field.fieldId + \": [String]\";\n }\n return field.fieldId + \": String\";\n },\n createInputField({ field }) {\n return createGraphQLInputField(field, \"String\");\n }\n }\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;AACA;;AAEA,MAAMA,MAAoC,GAAG;EACzCC,IAAI,EAAE,iCADmC;EAEzCC,IAAI,EAAE,4BAFmC;EAGzCC,SAAS,EAAE,MAH8B;EAIzCC,UAAU,EAAE,KAJ6B;EAKzCC,YAAY,EAAE,KAL2B;EAMzCC,IAAI,EAAE;IACFC,eAAe,CAAC;MAAEC;IAAF,CAAD,EAAY;MACvB,IAAIA,KAAK,CAACC,cAAV,EAA0B;QACtB,OAAQ,GAAED,KAAK,CAACE,OAAQ,YAAxB;MACH;;MAED,OAAQ,GAAEF,KAAK,CAACE,OAAQ,UAAxB;IACH;;EAPC,CANmC;EAezCC,MAAM,EAAE;IACJJ,eAAe,CAAC;MAAEC;IAAF,CAAD,EAAY;MACvB,IAAIA,KAAK,CAACC,cAAV,EAA0B;QACtB,OAAOD,KAAK,CAACE,OAAN,GAAgB,YAAvB;MACH;;MACD,OAAOF,KAAK,CAACE,OAAN,GAAgB,UAAvB;IACH,CANG;;IAOJE,gBAAgB,CAAC;MAAEJ;IAAF,CAAD,EAAY;MACxB,OAAO,IAAAK,gCAAA,EAAwBL,KAAxB,EAA+B,QAA/B,CAAP;IACH;;EATG;AAfiC,CAA7C;eA4BeR,M"}
|
|
@@ -1,30 +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 _text = _interopRequireDefault(require("./text"));
|
|
11
|
-
|
|
12
|
-
var _longText = _interopRequireDefault(require("./longText"));
|
|
13
|
-
|
|
14
|
-
var _ref = _interopRequireDefault(require("./ref"));
|
|
15
|
-
|
|
16
|
-
var _number = _interopRequireDefault(require("./number"));
|
|
17
|
-
|
|
18
|
-
var _boolean = _interopRequireDefault(require("./boolean"));
|
|
19
|
-
|
|
20
|
-
var _datetime = _interopRequireDefault(require("./datetime"));
|
|
21
|
-
|
|
22
|
-
var _richText = _interopRequireDefault(require("./richText"));
|
|
23
|
-
|
|
24
|
-
var _file = _interopRequireDefault(require("./file"));
|
|
25
|
-
|
|
26
|
-
var _object = _interopRequireDefault(require("./object"));
|
|
27
|
-
|
|
28
|
-
var _default = () => [_text.default, _ref.default, _number.default, _datetime.default, _boolean.default, _longText.default, _richText.default, _file.default, _object.default];
|
|
29
|
-
|
|
30
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["text","ref","number","datetime","boolean","longText","richText","file","object"],"sources":["index.ts"],"sourcesContent":["import text from \"./text\";\nimport longText from \"./longText\";\nimport ref from \"./ref\";\nimport number from \"./number\";\nimport boolean from \"./boolean\";\nimport datetime from \"./datetime\";\nimport richText from \"./richText\";\nimport file from \"./file\";\nimport object from \"./object\";\n\nexport default () => [text, ref, number, datetime, boolean, longText, richText, file, object];\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;eAEe,MAAM,CAACA,aAAD,EAAOC,YAAP,EAAYC,eAAZ,EAAoBC,iBAApB,EAA8BC,gBAA9B,EAAuCC,iBAAvC,EAAiDC,iBAAjD,EAA2DC,aAA3D,EAAiEC,eAAjE,C"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("./helpers");
|
|
9
|
-
|
|
10
|
-
const createListFilters = ({
|
|
11
|
-
field
|
|
12
|
-
}) => {
|
|
13
|
-
return `
|
|
14
|
-
${field.fieldId}_contains: String
|
|
15
|
-
${field.fieldId}_not_contains: String
|
|
16
|
-
`;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const plugin = {
|
|
20
|
-
name: "cms-model-field-to-graphql-long-text",
|
|
21
|
-
type: "cms-model-field-to-graphql",
|
|
22
|
-
fieldType: "long-text",
|
|
23
|
-
isSortable: false,
|
|
24
|
-
isSearchable: true,
|
|
25
|
-
fullTextSearch: true,
|
|
26
|
-
read: {
|
|
27
|
-
createTypeField({
|
|
28
|
-
field
|
|
29
|
-
}) {
|
|
30
|
-
if (field.multipleValues) {
|
|
31
|
-
return `${field.fieldId}: [String]`;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return `${field.fieldId}: String`;
|
|
35
|
-
},
|
|
36
|
-
|
|
37
|
-
createListFilters
|
|
38
|
-
},
|
|
39
|
-
manage: {
|
|
40
|
-
createListFilters,
|
|
41
|
-
|
|
42
|
-
createTypeField({
|
|
43
|
-
field
|
|
44
|
-
}) {
|
|
45
|
-
if (field.multipleValues) {
|
|
46
|
-
return field.fieldId + ": [String]";
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return field.fieldId + ": String";
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
createInputField({
|
|
53
|
-
field
|
|
54
|
-
}) {
|
|
55
|
-
return (0, _helpers.createGraphQLInputField)(field, "String");
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
};
|
|
60
|
-
var _default = plugin;
|
|
61
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createListFilters","field","fieldId","plugin","name","type","fieldType","isSortable","isSearchable","fullTextSearch","read","createTypeField","multipleValues","manage","createInputField","createGraphQLInputField"],"sources":["longText.ts"],"sourcesContent":["import { CmsModelField, CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { createGraphQLInputField } from \"./helpers\";\n\ninterface CreateListFiltersParams {\n field: CmsModelField;\n}\nconst createListFilters = ({ field }: CreateListFiltersParams) => {\n return `\n ${field.fieldId}_contains: String\n ${field.fieldId}_not_contains: String\n `;\n};\n\nconst plugin: CmsModelFieldToGraphQLPlugin = {\n name: \"cms-model-field-to-graphql-long-text\",\n type: \"cms-model-field-to-graphql\",\n fieldType: \"long-text\",\n isSortable: false,\n isSearchable: true,\n fullTextSearch: true,\n read: {\n createTypeField({ field }) {\n if (field.multipleValues) {\n return `${field.fieldId}: [String]`;\n }\n\n return `${field.fieldId}: String`;\n },\n createListFilters\n },\n manage: {\n createListFilters,\n createTypeField({ field }) {\n if (field.multipleValues) {\n return field.fieldId + \": [String]\";\n }\n\n return field.fieldId + \": String\";\n },\n createInputField({ field }) {\n return createGraphQLInputField(field, \"String\");\n }\n }\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;AACA;;AAKA,MAAMA,iBAAiB,GAAG,CAAC;EAAEC;AAAF,CAAD,KAAwC;EAC9D,OAAQ;AACZ,UAAUA,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,KAHI;AAIH,CALD;;AAOA,MAAMC,MAAoC,GAAG;EACzCC,IAAI,EAAE,sCADmC;EAEzCC,IAAI,EAAE,4BAFmC;EAGzCC,SAAS,EAAE,WAH8B;EAIzCC,UAAU,EAAE,KAJ6B;EAKzCC,YAAY,EAAE,IAL2B;EAMzCC,cAAc,EAAE,IANyB;EAOzCC,IAAI,EAAE;IACFC,eAAe,CAAC;MAAEV;IAAF,CAAD,EAAY;MACvB,IAAIA,KAAK,CAACW,cAAV,EAA0B;QACtB,OAAQ,GAAEX,KAAK,CAACC,OAAQ,YAAxB;MACH;;MAED,OAAQ,GAAED,KAAK,CAACC,OAAQ,UAAxB;IACH,CAPC;;IAQFF;EARE,CAPmC;EAiBzCa,MAAM,EAAE;IACJb,iBADI;;IAEJW,eAAe,CAAC;MAAEV;IAAF,CAAD,EAAY;MACvB,IAAIA,KAAK,CAACW,cAAV,EAA0B;QACtB,OAAOX,KAAK,CAACC,OAAN,GAAgB,YAAvB;MACH;;MAED,OAAOD,KAAK,CAACC,OAAN,GAAgB,UAAvB;IACH,CARG;;IASJY,gBAAgB,CAAC;MAAEb;IAAF,CAAD,EAAY;MACxB,OAAO,IAAAc,gCAAA,EAAwBd,KAAxB,EAA+B,QAA/B,CAAP;IACH;;EAXG;AAjBiC,CAA7C;eAgCeE,M"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = void 0;
|
|
7
|
-
|
|
8
|
-
var _helpers = require("./helpers");
|
|
9
|
-
|
|
10
|
-
const createListFilters = ({
|
|
11
|
-
field
|
|
12
|
-
}) => {
|
|
13
|
-
return `
|
|
14
|
-
${field.fieldId}: Number
|
|
15
|
-
${field.fieldId}_not: Number
|
|
16
|
-
${field.fieldId}_in: [Number]
|
|
17
|
-
${field.fieldId}_not_in: [Number]
|
|
18
|
-
${field.fieldId}_lt: Number
|
|
19
|
-
${field.fieldId}_lte: Number
|
|
20
|
-
${field.fieldId}_gt: Number
|
|
21
|
-
${field.fieldId}_gte: Number
|
|
22
|
-
`;
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
const plugin = {
|
|
26
|
-
name: "cms-model-field-to-graphql-number",
|
|
27
|
-
type: "cms-model-field-to-graphql",
|
|
28
|
-
fieldType: "number",
|
|
29
|
-
isSortable: true,
|
|
30
|
-
isSearchable: true,
|
|
31
|
-
read: {
|
|
32
|
-
createGetFilters({
|
|
33
|
-
field
|
|
34
|
-
}) {
|
|
35
|
-
return `${field.fieldId}: Number`;
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
createListFilters,
|
|
39
|
-
|
|
40
|
-
createTypeField({
|
|
41
|
-
field
|
|
42
|
-
}) {
|
|
43
|
-
if (field.multipleValues) {
|
|
44
|
-
return `${field.fieldId}: [Number]`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
return `${field.fieldId}: Number`;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
},
|
|
51
|
-
manage: {
|
|
52
|
-
createListFilters,
|
|
53
|
-
|
|
54
|
-
createTypeField({
|
|
55
|
-
field
|
|
56
|
-
}) {
|
|
57
|
-
if (field.multipleValues) {
|
|
58
|
-
return field.fieldId + ": [Number]";
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return field.fieldId + ": Number";
|
|
62
|
-
},
|
|
63
|
-
|
|
64
|
-
createInputField({
|
|
65
|
-
field
|
|
66
|
-
}) {
|
|
67
|
-
return (0, _helpers.createGraphQLInputField)(field, "Number");
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
var _default = plugin;
|
|
73
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["createListFilters","field","fieldId","plugin","name","type","fieldType","isSortable","isSearchable","read","createGetFilters","createTypeField","multipleValues","manage","createInputField","createGraphQLInputField"],"sources":["number.ts"],"sourcesContent":["import { CmsModelField, CmsModelFieldToGraphQLPlugin } from \"~/types\";\nimport { createGraphQLInputField } from \"./helpers\";\n\ninterface CreateListFiltersParams {\n field: CmsModelField;\n}\nconst createListFilters = ({ field }: CreateListFiltersParams) => {\n return `\n ${field.fieldId}: Number\n ${field.fieldId}_not: Number\n ${field.fieldId}_in: [Number]\n ${field.fieldId}_not_in: [Number]\n ${field.fieldId}_lt: Number\n ${field.fieldId}_lte: Number\n ${field.fieldId}_gt: Number\n ${field.fieldId}_gte: Number\n `;\n};\n\nconst plugin: CmsModelFieldToGraphQLPlugin = {\n name: \"cms-model-field-to-graphql-number\",\n type: \"cms-model-field-to-graphql\",\n fieldType: \"number\",\n isSortable: true,\n isSearchable: true,\n read: {\n createGetFilters({ field }) {\n return `${field.fieldId}: Number`;\n },\n createListFilters,\n createTypeField({ field }) {\n if (field.multipleValues) {\n return `${field.fieldId}: [Number]`;\n }\n\n return `${field.fieldId}: Number`;\n }\n },\n manage: {\n createListFilters,\n createTypeField({ field }) {\n if (field.multipleValues) {\n return field.fieldId + \": [Number]\";\n }\n\n return field.fieldId + \": Number\";\n },\n createInputField({ field }) {\n return createGraphQLInputField(field, \"Number\");\n }\n }\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;AACA;;AAKA,MAAMA,iBAAiB,GAAG,CAAC;EAAEC;AAAF,CAAD,KAAwC;EAC9D,OAAQ;AACZ,UAAUA,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,UAAUD,KAAK,CAACC,OAAQ;AACxB,KATI;AAUH,CAXD;;AAaA,MAAMC,MAAoC,GAAG;EACzCC,IAAI,EAAE,mCADmC;EAEzCC,IAAI,EAAE,4BAFmC;EAGzCC,SAAS,EAAE,QAH8B;EAIzCC,UAAU,EAAE,IAJ6B;EAKzCC,YAAY,EAAE,IAL2B;EAMzCC,IAAI,EAAE;IACFC,gBAAgB,CAAC;MAAET;IAAF,CAAD,EAAY;MACxB,OAAQ,GAAEA,KAAK,CAACC,OAAQ,UAAxB;IACH,CAHC;;IAIFF,iBAJE;;IAKFW,eAAe,CAAC;MAAEV;IAAF,CAAD,EAAY;MACvB,IAAIA,KAAK,CAACW,cAAV,EAA0B;QACtB,OAAQ,GAAEX,KAAK,CAACC,OAAQ,YAAxB;MACH;;MAED,OAAQ,GAAED,KAAK,CAACC,OAAQ,UAAxB;IACH;;EAXC,CANmC;EAmBzCW,MAAM,EAAE;IACJb,iBADI;;IAEJW,eAAe,CAAC;MAAEV;IAAF,CAAD,EAAY;MACvB,IAAIA,KAAK,CAACW,cAAV,EAA0B;QACtB,OAAOX,KAAK,CAACC,OAAN,GAAgB,YAAvB;MACH;;MAED,OAAOD,KAAK,CAACC,OAAN,GAAgB,UAAvB;IACH,CARG;;IASJY,gBAAgB,CAAC;MAAEb;IAAF,CAAD,EAAY;MACxB,OAAO,IAAAc,gCAAA,EAAwBd,KAAxB,EAA+B,QAA/B,CAAP;IACH;;EAXG;AAnBiC,CAA7C;eAkCeE,M"}
|
|
@@ -1,223 +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 _upperFirst = _interopRequireDefault(require("lodash/upperFirst"));
|
|
11
|
-
|
|
12
|
-
var _renderFields = require("../utils/renderFields");
|
|
13
|
-
|
|
14
|
-
var _renderInputFields = require("../utils/renderInputFields");
|
|
15
|
-
|
|
16
|
-
var _createTypeName = require("../utils/createTypeName");
|
|
17
|
-
|
|
18
|
-
var _helpers = require("./helpers");
|
|
19
|
-
|
|
20
|
-
const typeFromField = params => {
|
|
21
|
-
var _field$settings;
|
|
22
|
-
|
|
23
|
-
const {
|
|
24
|
-
typeOfType,
|
|
25
|
-
model,
|
|
26
|
-
type,
|
|
27
|
-
field,
|
|
28
|
-
fieldTypePlugins
|
|
29
|
-
} = params;
|
|
30
|
-
const typeSuffix = typeOfType === "input" ? "Input" : "";
|
|
31
|
-
const typeName = (0, _createTypeName.createTypeName)(model.modelId);
|
|
32
|
-
const mTypeName = (0, _createTypeName.createManageTypeName)(typeName); // `field` is an "object" field
|
|
33
|
-
|
|
34
|
-
const fields = ((_field$settings = field.settings) === null || _field$settings === void 0 ? void 0 : _field$settings.fields) || [];
|
|
35
|
-
const fieldTypeName = `${mTypeName}_${(0, _upperFirst.default)(field.fieldId)}`;
|
|
36
|
-
const typeFields = [];
|
|
37
|
-
const nestedTypes = []; // Once the loop below starts, we'll be executing a recursive "object" type generation.
|
|
38
|
-
// The main trick here is that nested objects don't know who the parent is, and will generate
|
|
39
|
-
// type names using the "model", as if they're at the top level:
|
|
40
|
-
// Every time the types are returned, we need to replace the model name in the generated type name
|
|
41
|
-
// with the actual prefix which includes parent field name type.
|
|
42
|
-
|
|
43
|
-
const replace = new RegExp(`${mTypeName}_`, "g");
|
|
44
|
-
|
|
45
|
-
for (const f of fields) {
|
|
46
|
-
const result = typeOfType === "type" ? (0, _renderFields.renderField)({
|
|
47
|
-
field: f,
|
|
48
|
-
type,
|
|
49
|
-
model,
|
|
50
|
-
fieldTypePlugins
|
|
51
|
-
}) : (0, _renderInputFields.renderInputField)({
|
|
52
|
-
field: f,
|
|
53
|
-
model,
|
|
54
|
-
fieldTypePlugins
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
if (!result) {
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
const {
|
|
62
|
-
fields,
|
|
63
|
-
typeDefs
|
|
64
|
-
} = result;
|
|
65
|
-
typeFields.push(fields.replace(replace, `${fieldTypeName}_`));
|
|
66
|
-
|
|
67
|
-
if (typeDefs) {
|
|
68
|
-
nestedTypes.push(typeDefs.replace(replace, `${fieldTypeName}_`));
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return {
|
|
73
|
-
fieldType: `${fieldTypeName}${typeSuffix}`,
|
|
74
|
-
typeDefs:
|
|
75
|
-
/* GraphQL */
|
|
76
|
-
`
|
|
77
|
-
${nestedTypes.join("\n")}
|
|
78
|
-
|
|
79
|
-
${typeOfType} ${fieldTypeName}${typeSuffix} {
|
|
80
|
-
${typeFields.join("\n")}
|
|
81
|
-
}
|
|
82
|
-
`
|
|
83
|
-
};
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const plugin = {
|
|
87
|
-
name: "cms-model-field-to-graphql-object",
|
|
88
|
-
type: "cms-model-field-to-graphql",
|
|
89
|
-
fieldType: "object",
|
|
90
|
-
isSortable: false,
|
|
91
|
-
isSearchable: false,
|
|
92
|
-
read: {
|
|
93
|
-
createTypeField({
|
|
94
|
-
field,
|
|
95
|
-
model,
|
|
96
|
-
fieldTypePlugins
|
|
97
|
-
}) {
|
|
98
|
-
const result = typeFromField({
|
|
99
|
-
typeOfType: "type",
|
|
100
|
-
model,
|
|
101
|
-
type: "read",
|
|
102
|
-
field,
|
|
103
|
-
fieldTypePlugins
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
if (!result) {
|
|
107
|
-
return null;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
const {
|
|
111
|
-
fieldType,
|
|
112
|
-
typeDefs
|
|
113
|
-
} = result;
|
|
114
|
-
return {
|
|
115
|
-
fields: `${field.fieldId}: ${field.multipleValues ? `[${fieldType}!]` : fieldType}`,
|
|
116
|
-
typeDefs
|
|
117
|
-
};
|
|
118
|
-
},
|
|
119
|
-
|
|
120
|
-
createResolver({
|
|
121
|
-
field,
|
|
122
|
-
createFieldResolvers,
|
|
123
|
-
graphQLType
|
|
124
|
-
}) {
|
|
125
|
-
var _field$settings2;
|
|
126
|
-
|
|
127
|
-
if (!((_field$settings2 = field.settings) !== null && _field$settings2 !== void 0 && _field$settings2.fields) || field.settings.fields.length === 0) {
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
const fieldType = `${graphQLType}_${(0, _upperFirst.default)(field.fieldId)}`;
|
|
132
|
-
const typeResolvers = createFieldResolvers({
|
|
133
|
-
graphQLType: fieldType,
|
|
134
|
-
fields: field.settings.fields
|
|
135
|
-
});
|
|
136
|
-
return {
|
|
137
|
-
resolver: null,
|
|
138
|
-
typeResolvers: typeResolvers || {}
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
},
|
|
143
|
-
manage: {
|
|
144
|
-
createTypeField({
|
|
145
|
-
model,
|
|
146
|
-
field,
|
|
147
|
-
fieldTypePlugins
|
|
148
|
-
}) {
|
|
149
|
-
const result = typeFromField({
|
|
150
|
-
typeOfType: "type",
|
|
151
|
-
model,
|
|
152
|
-
type: "manage",
|
|
153
|
-
field,
|
|
154
|
-
fieldTypePlugins
|
|
155
|
-
});
|
|
156
|
-
|
|
157
|
-
if (!result) {
|
|
158
|
-
return null;
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
const {
|
|
162
|
-
fieldType,
|
|
163
|
-
typeDefs
|
|
164
|
-
} = result;
|
|
165
|
-
return {
|
|
166
|
-
fields: `${field.fieldId}: ${field.multipleValues ? `[${fieldType}!]` : fieldType}`,
|
|
167
|
-
typeDefs
|
|
168
|
-
};
|
|
169
|
-
},
|
|
170
|
-
|
|
171
|
-
createInputField({
|
|
172
|
-
model,
|
|
173
|
-
field,
|
|
174
|
-
fieldTypePlugins
|
|
175
|
-
}) {
|
|
176
|
-
const result = typeFromField({
|
|
177
|
-
typeOfType: "input",
|
|
178
|
-
model,
|
|
179
|
-
type: "manage",
|
|
180
|
-
field,
|
|
181
|
-
fieldTypePlugins
|
|
182
|
-
});
|
|
183
|
-
|
|
184
|
-
if (!result) {
|
|
185
|
-
return null;
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
const {
|
|
189
|
-
fieldType,
|
|
190
|
-
typeDefs
|
|
191
|
-
} = result;
|
|
192
|
-
return {
|
|
193
|
-
fields: (0, _helpers.attachRequiredFieldValue)(`${field.fieldId}: ${field.multipleValues ? `[${fieldType}!]` : fieldType}`, field),
|
|
194
|
-
typeDefs
|
|
195
|
-
};
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
createResolver({
|
|
199
|
-
graphQLType,
|
|
200
|
-
field,
|
|
201
|
-
createFieldResolvers
|
|
202
|
-
}) {
|
|
203
|
-
var _field$settings3;
|
|
204
|
-
|
|
205
|
-
if (!((_field$settings3 = field.settings) !== null && _field$settings3 !== void 0 && _field$settings3.fields) || field.settings.fields.length === 0) {
|
|
206
|
-
return false;
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
const fieldType = `${graphQLType}_${(0, _upperFirst.default)(field.fieldId)}`;
|
|
210
|
-
const typeResolvers = createFieldResolvers({
|
|
211
|
-
graphQLType: fieldType,
|
|
212
|
-
fields: field.settings.fields
|
|
213
|
-
});
|
|
214
|
-
return {
|
|
215
|
-
resolver: null,
|
|
216
|
-
typeResolvers: typeResolvers || {}
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
};
|
|
222
|
-
var _default = plugin;
|
|
223
|
-
exports.default = _default;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["typeFromField","params","typeOfType","model","type","field","fieldTypePlugins","typeSuffix","typeName","createTypeName","modelId","mTypeName","createManageTypeName","fields","settings","fieldTypeName","upperFirst","fieldId","typeFields","nestedTypes","replace","RegExp","f","result","renderField","renderInputField","typeDefs","push","fieldType","join","plugin","name","isSortable","isSearchable","read","createTypeField","multipleValues","createResolver","createFieldResolvers","graphQLType","length","typeResolvers","resolver","manage","createInputField","attachRequiredFieldValue"],"sources":["object.ts"],"sourcesContent":["import upperFirst from \"lodash/upperFirst\";\nimport {\n ApiEndpoint,\n CmsFieldTypePlugins,\n CmsModel,\n CmsModelField,\n CmsModelFieldToGraphQLPlugin\n} from \"~/types\";\nimport { renderField } from \"~/content/plugins/utils/renderFields\";\nimport { renderInputField } from \"~/content/plugins/utils/renderInputFields\";\nimport { createManageTypeName, createTypeName } from \"~/content/plugins/utils/createTypeName\";\nimport { attachRequiredFieldValue } from \"./helpers\";\n\ninterface TypeFromFieldParams {\n typeOfType: string;\n model: CmsModel;\n type: ApiEndpoint;\n field: CmsModelField;\n fieldTypePlugins: CmsFieldTypePlugins;\n}\ninterface TypeFromFieldResponse {\n fieldType: string;\n typeDefs: string;\n}\nconst typeFromField = (params: TypeFromFieldParams): TypeFromFieldResponse | null => {\n const { typeOfType, model, type, field, fieldTypePlugins } = params;\n const typeSuffix = typeOfType === \"input\" ? \"Input\" : \"\";\n const typeName = createTypeName(model.modelId);\n const mTypeName = createManageTypeName(typeName);\n\n // `field` is an \"object\" field\n const fields: CmsModelField[] = field.settings?.fields || [];\n\n const fieldTypeName = `${mTypeName}_${upperFirst(field.fieldId)}`;\n\n const typeFields = [];\n const nestedTypes = [];\n\n // Once the loop below starts, we'll be executing a recursive \"object\" type generation.\n // The main trick here is that nested objects don't know who the parent is, and will generate\n // type names using the \"model\", as if they're at the top level:\n // Every time the types are returned, we need to replace the model name in the generated type name\n // with the actual prefix which includes parent field name type.\n const replace = new RegExp(`${mTypeName}_`, \"g\");\n\n for (const f of fields) {\n const result =\n typeOfType === \"type\"\n ? renderField({ field: f, type, model, fieldTypePlugins })\n : renderInputField({ field: f, model, fieldTypePlugins });\n\n if (!result) {\n continue;\n }\n\n const { fields, typeDefs } = result;\n\n typeFields.push(fields.replace(replace, `${fieldTypeName}_`));\n if (typeDefs) {\n nestedTypes.push(typeDefs.replace(replace, `${fieldTypeName}_`));\n }\n }\n\n return {\n fieldType: `${fieldTypeName}${typeSuffix}`,\n typeDefs: /* GraphQL */ `\n ${nestedTypes.join(\"\\n\")}\n \n ${typeOfType} ${fieldTypeName}${typeSuffix} {\n ${typeFields.join(\"\\n\")}\n }\n `\n };\n};\n\nconst plugin: CmsModelFieldToGraphQLPlugin = {\n name: \"cms-model-field-to-graphql-object\",\n type: \"cms-model-field-to-graphql\",\n fieldType: \"object\",\n isSortable: false,\n isSearchable: false,\n read: {\n createTypeField({ field, model, fieldTypePlugins }) {\n const result = typeFromField({\n typeOfType: \"type\",\n model,\n type: \"read\",\n field,\n fieldTypePlugins\n });\n\n if (!result) {\n return null;\n }\n const { fieldType, typeDefs } = result;\n\n return {\n fields: `${field.fieldId}: ${field.multipleValues ? `[${fieldType}!]` : fieldType}`,\n typeDefs\n };\n },\n createResolver({ field, createFieldResolvers, graphQLType }) {\n if (!field.settings?.fields || field.settings.fields.length === 0) {\n return false;\n }\n\n const fieldType = `${graphQLType}_${upperFirst(field.fieldId)}`;\n\n const typeResolvers = createFieldResolvers({\n graphQLType: fieldType,\n fields: field.settings.fields\n });\n return {\n resolver: null,\n typeResolvers: typeResolvers || {}\n };\n }\n },\n manage: {\n createTypeField({ model, field, fieldTypePlugins }) {\n const result = typeFromField({\n typeOfType: \"type\",\n model,\n type: \"manage\",\n field,\n fieldTypePlugins\n });\n\n if (!result) {\n return null;\n }\n const { fieldType, typeDefs } = result;\n\n return {\n fields: `${field.fieldId}: ${field.multipleValues ? `[${fieldType}!]` : fieldType}`,\n typeDefs\n };\n },\n createInputField({ model, field, fieldTypePlugins }) {\n const result = typeFromField({\n typeOfType: \"input\",\n model,\n type: \"manage\",\n field,\n fieldTypePlugins\n });\n if (!result) {\n return null;\n }\n const { fieldType, typeDefs } = result;\n\n return {\n fields: attachRequiredFieldValue(\n `${field.fieldId}: ${field.multipleValues ? `[${fieldType}!]` : fieldType}`,\n field\n ),\n typeDefs\n };\n },\n createResolver({ graphQLType, field, createFieldResolvers }) {\n if (!field.settings?.fields || field.settings.fields.length === 0) {\n return false;\n }\n const fieldType = `${graphQLType}_${upperFirst(field.fieldId)}`;\n const typeResolvers = createFieldResolvers({\n graphQLType: fieldType,\n fields: field.settings.fields\n });\n return {\n resolver: null,\n typeResolvers: typeResolvers || {}\n };\n }\n }\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;AAAA;;AAQA;;AACA;;AACA;;AACA;;AAaA,MAAMA,aAAa,GAAIC,MAAD,IAA+D;EAAA;;EACjF,MAAM;IAAEC,UAAF;IAAcC,KAAd;IAAqB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