@webiny/api-headless-cms 0.0.0-mt-2 → 0.0.0-unstable.1e66d121db
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 +60 -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 +23 -11
- 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 +10 -14
- package/crud/contentEntry/markLockedFields.js.map +1 -0
- package/crud/contentEntry/referenceFieldsMapping.d.ts +13 -0
- package/crud/contentEntry/referenceFieldsMapping.js +288 -0
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -0
- package/{content/plugins/crud → crud}/contentEntry.crud.d.ts +5 -9
- package/crud/contentEntry.crud.js +1255 -0
- package/crud/contentEntry.crud.js.map +1 -0
- package/crud/contentModel/afterCreate.d.ts +8 -0
- package/crud/contentModel/afterCreate.js +18 -0
- 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/crud/contentModel/afterDelete.js +18 -0
- package/crud/contentModel/afterDelete.js.map +1 -0
- package/crud/contentModel/afterUpdate.d.ts +8 -0
- package/crud/contentModel/afterUpdate.js +18 -0
- package/crud/contentModel/afterUpdate.js.map +1 -0
- package/crud/contentModel/beforeCreate.d.ts +15 -0
- package/{content/plugins/crud → crud}/contentModel/beforeCreate.js +61 -13
- package/crud/contentModel/beforeCreate.js.map +1 -0
- package/crud/contentModel/beforeDelete.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentModel/beforeDelete.js +14 -10
- package/crud/contentModel/beforeDelete.js.map +1 -0
- package/crud/contentModel/beforeUpdate.d.ts +10 -0
- 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 +359 -0
- package/crud/contentModel/validateModelFields.js.map +1 -0
- package/{content/plugins/crud → crud}/contentModel.crud.d.ts +3 -3
- package/crud/contentModel.crud.js +590 -0
- package/crud/contentModel.crud.js.map +1 -0
- package/crud/contentModelGroup/beforeCreate.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeCreate.js +9 -9
- package/crud/contentModelGroup/beforeCreate.js.map +1 -0
- package/crud/contentModelGroup/beforeDelete.d.ts +10 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeDelete.js +4 -4
- package/crud/contentModelGroup/beforeDelete.js.map +1 -0
- package/crud/contentModelGroup/beforeUpdate.d.ts +9 -0
- package/{content/plugins/crud → crud}/contentModelGroup/beforeUpdate.js +3 -3
- 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 +108 -93
- package/crud/contentModelGroup.crud.js.map +1 -0
- package/crud/index.d.ts +6 -0
- package/crud/index.js +85 -0
- package/crud/index.js.map +1 -0
- package/{plugins/crud → crud}/settings.crud.d.ts +3 -3
- package/crud/settings.crud.js +83 -0
- package/crud/settings.crud.js.map +1 -0
- package/{plugins/crud → crud}/system.crud.d.ts +6 -3
- package/crud/system.crud.js +221 -0
- 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 +304 -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/graphql/schema/baseContentSchema.js +76 -0
- 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 -23
- package/graphql/schema/createFieldResolvers.js.map +1 -0
- package/graphql/schema/createManageResolvers.d.ts +12 -0
- package/{content/plugins → graphql}/schema/createManageResolvers.js +36 -34
- package/graphql/schema/createManageResolvers.js.map +1 -0
- package/graphql/schema/createManageSDL.d.ts +10 -0
- package/{content/plugins → graphql}/schema/createManageSDL.js +23 -16
- package/graphql/schema/createManageSDL.js.map +1 -0
- package/graphql/schema/createPreviewResolvers.d.ts +12 -0
- package/graphql/schema/createPreviewResolvers.js +58 -0
- package/graphql/schema/createPreviewResolvers.js.map +1 -0
- package/graphql/schema/createReadResolvers.d.ts +12 -0
- package/graphql/schema/createReadResolvers.js +58 -0
- 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 +79 -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/graphql/schema/resolvers/preview/resolveGet.js +34 -0
- 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/graphql/schema/resolvers/read/resolveGet.js +34 -0
- 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 +275 -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 +12 -10
- 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 +44 -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 +9 -3
- 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 +45 -0
- package/plugins/CmsModelPlugin.js +194 -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 +2 -1
- 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 +124 -0
- package/storage/object.js.map +1 -0
- package/types.d.ts +645 -348
- package/types.js +52 -2
- package/types.js.map +1 -0
- package/upgrades/5.33.0/index.d.ts +3 -0
- package/upgrades/5.33.0/index.js +182 -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 +113 -0
- package/utils/converters/ConverterCollection.js.map +1 -0
- package/utils/converters/valueKeyStorageConverter.d.ts +18 -0
- package/utils/converters/valueKeyStorageConverter.js +148 -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 +1 -1
- package/utils/createTypeName.js.map +1 -0
- package/{content/plugins/utils → utils}/entryStorage.d.ts +3 -3
- package/{content/plugins/utils → utils}/entryStorage.js +4 -12
- 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 +77 -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 +106 -0
- package/utils/permissions.js.map +1 -0
- package/utils/pluralizedTypeName.d.ts +1 -0
- package/{content/plugins/utils → utils}/pluralizedTypeName.js +1 -1
- 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 +37 -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/contentEntry.crud.js +0 -931
- package/content/plugins/crud/contentModel/afterCreate.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterCreate.js +0 -18
- package/content/plugins/crud/contentModel/afterDelete.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterDelete.js +0 -18
- package/content/plugins/crud/contentModel/afterUpdate.d.ts +0 -7
- package/content/plugins/crud/contentModel/afterUpdate.js +0 -18
- package/content/plugins/crud/contentModel/beforeCreate.d.ts +0 -9
- package/content/plugins/crud/contentModel/beforeDelete.d.ts +0 -9
- package/content/plugins/crud/contentModel/beforeUpdate.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/contentModel.crud.js +0 -425
- package/content/plugins/crud/contentModelGroup/beforeCreate.d.ts +0 -9
- package/content/plugins/crud/contentModelGroup/beforeDelete.d.ts +0 -9
- package/content/plugins/crud/contentModelGroup/beforeUpdate.d.ts +0 -8
- package/content/plugins/crud/index.d.ts +0 -6
- package/content/plugins/crud/index.js +0 -100
- 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/baseSchema.js +0 -98
- 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/createPreviewResolvers.js +0 -55
- package/content/plugins/schema/createReadResolvers.d.ts +0 -10
- package/content/plugins/schema/createReadResolvers.js +0 -55
- 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/resolveGet.js +0 -38
- 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/resolveGet.js +0 -38
- 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/crud/system.crud.js +0 -182
- 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
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CmsModelManager, CmsModel, CmsContext, CmsEntryListParams, CreateCmsEntryInput, UpdateCmsEntryInput } from "../types";
|
|
2
|
+
export declare class DefaultCmsModelManager implements CmsModelManager {
|
|
3
|
+
private readonly _context;
|
|
4
|
+
private readonly _model;
|
|
5
|
+
constructor(context: CmsContext, model: CmsModel);
|
|
6
|
+
create(data: CreateCmsEntryInput): Promise<import("../types").CmsEntry<import("~/types").CmsEntryValues>>;
|
|
7
|
+
delete(id: string): Promise<void>;
|
|
8
|
+
get(id: string): Promise<import("../types").CmsEntry<import("~/types").CmsEntryValues>>;
|
|
9
|
+
listPublished(params: CmsEntryListParams): Promise<[import("../types").CmsEntry<import("~/types").CmsEntryValues>[], import("../types").CmsEntryMeta]>;
|
|
10
|
+
listLatest(params: CmsEntryListParams): Promise<[import("../types").CmsEntry<import("~/types").CmsEntryValues>[], import("../types").CmsEntryMeta]>;
|
|
11
|
+
getPublishedByIds(ids: string[]): Promise<import("../types").CmsEntry<import("~/types").CmsEntryValues>[]>;
|
|
12
|
+
getLatestByIds(ids: string[]): Promise<import("../types").CmsEntry<import("~/types").CmsEntryValues>[]>;
|
|
13
|
+
update(id: string, data: UpdateCmsEntryInput): Promise<import("../types").CmsEntry<import("~/types").CmsEntryValues>>;
|
|
14
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -9,6 +9,8 @@ exports.DefaultCmsModelManager = void 0;
|
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
12
|
+
var _utils = require("@webiny/utils");
|
|
13
|
+
|
|
12
14
|
class DefaultCmsModelManager {
|
|
13
15
|
constructor(context, model) {
|
|
14
16
|
(0, _defineProperty2.default)(this, "_context", void 0);
|
|
@@ -22,7 +24,11 @@ class DefaultCmsModelManager {
|
|
|
22
24
|
}
|
|
23
25
|
|
|
24
26
|
async delete(id) {
|
|
25
|
-
|
|
27
|
+
const {
|
|
28
|
+
version
|
|
29
|
+
} = (0, _utils.parseIdentifier)(id);
|
|
30
|
+
|
|
31
|
+
if (version) {
|
|
26
32
|
return this._context.cms.deleteEntryRevision(this._model, id);
|
|
27
33
|
}
|
|
28
34
|
|
|
@@ -33,16 +39,12 @@ class DefaultCmsModelManager {
|
|
|
33
39
|
return this._context.cms.getEntryById(this._model, id);
|
|
34
40
|
}
|
|
35
41
|
|
|
36
|
-
async
|
|
37
|
-
return this._context.cms.
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
async listPublished(args) {
|
|
41
|
-
return this._context.cms.listPublishedEntries(this._model, args);
|
|
42
|
+
async listPublished(params) {
|
|
43
|
+
return this._context.cms.listPublishedEntries(this._model, params);
|
|
42
44
|
}
|
|
43
45
|
|
|
44
|
-
async listLatest(
|
|
45
|
-
return this._context.cms.listLatestEntries(this._model,
|
|
46
|
+
async listLatest(params) {
|
|
47
|
+
return this._context.cms.listLatestEntries(this._model, params);
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
async getPublishedByIds(ids) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DefaultCmsModelManager","constructor","context","model","_context","_model","create","data","cms","createEntry","delete","id","version","parseIdentifier","deleteEntryRevision","deleteEntry","get","getEntryById","listPublished","params","listPublishedEntries","listLatest","listLatestEntries","getPublishedByIds","ids","getPublishedEntriesByIds","getLatestByIds","getLatestEntriesByIds","update","updateEntry"],"sources":["DefaultCmsModelManager.ts"],"sourcesContent":["import {\n CmsModelManager,\n CmsModel,\n CmsContext,\n CmsEntryListParams,\n CreateCmsEntryInput,\n UpdateCmsEntryInput\n} from \"~/types\";\nimport { parseIdentifier } from \"@webiny/utils\";\n\nexport class DefaultCmsModelManager implements CmsModelManager {\n private readonly _context: CmsContext;\n private readonly _model: CmsModel;\n\n public constructor(context: CmsContext, model: CmsModel) {\n this._context = context;\n this._model = model;\n }\n\n public async create(data: CreateCmsEntryInput) {\n return this._context.cms.createEntry(this._model, data);\n }\n\n public async delete(id: string) {\n const { version } = parseIdentifier(id);\n if (version) {\n return this._context.cms.deleteEntryRevision(this._model, id);\n }\n\n return this._context.cms.deleteEntry(this._model, id);\n }\n\n public async get(id: string) {\n return this._context.cms.getEntryById(this._model, id);\n }\n\n public async listPublished(params: CmsEntryListParams) {\n return this._context.cms.listPublishedEntries(this._model, params);\n }\n\n public async listLatest(params: CmsEntryListParams) {\n return this._context.cms.listLatestEntries(this._model, params);\n }\n\n public async getPublishedByIds(ids: string[]) {\n return this._context.cms.getPublishedEntriesByIds(this._model, ids);\n }\n\n public async getLatestByIds(ids: string[]) {\n return this._context.cms.getLatestEntriesByIds(this._model, ids);\n }\n\n public async update(id: string, data: UpdateCmsEntryInput) {\n return this._context.cms.updateEntry(this._model, id, data);\n }\n}\n"],"mappings":";;;;;;;;;;;AAQA;;AAEO,MAAMA,sBAAN,CAAwD;EAIpDC,WAAW,CAACC,OAAD,EAAsBC,KAAtB,EAAuC;IAAA;IAAA;IACrD,KAAKC,QAAL,GAAgBF,OAAhB;IACA,KAAKG,MAAL,GAAcF,KAAd;EACH;;EAEkB,MAANG,MAAM,CAACC,IAAD,EAA4B;IAC3C,OAAO,KAAKH,QAAL,CAAcI,GAAd,CAAkBC,WAAlB,CAA8B,KAAKJ,MAAnC,EAA2CE,IAA3C,CAAP;EACH;;EAEkB,MAANG,MAAM,CAACC,EAAD,EAAa;IAC5B,MAAM;MAAEC;IAAF,IAAc,IAAAC,sBAAA,EAAgBF,EAAhB,CAApB;;IACA,IAAIC,OAAJ,EAAa;MACT,OAAO,KAAKR,QAAL,CAAcI,GAAd,CAAkBM,mBAAlB,CAAsC,KAAKT,MAA3C,EAAmDM,EAAnD,CAAP;IACH;;IAED,OAAO,KAAKP,QAAL,CAAcI,GAAd,CAAkBO,WAAlB,CAA8B,KAAKV,MAAnC,EAA2CM,EAA3C,CAAP;EACH;;EAEe,MAAHK,GAAG,CAACL,EAAD,EAAa;IACzB,OAAO,KAAKP,QAAL,CAAcI,GAAd,CAAkBS,YAAlB,CAA+B,KAAKZ,MAApC,EAA4CM,EAA5C,CAAP;EACH;;EAEyB,MAAbO,aAAa,CAACC,MAAD,EAA6B;IACnD,OAAO,KAAKf,QAAL,CAAcI,GAAd,CAAkBY,oBAAlB,CAAuC,KAAKf,MAA5C,EAAoDc,MAApD,CAAP;EACH;;EAEsB,MAAVE,UAAU,CAACF,MAAD,EAA6B;IAChD,OAAO,KAAKf,QAAL,CAAcI,GAAd,CAAkBc,iBAAlB,CAAoC,KAAKjB,MAAzC,EAAiDc,MAAjD,CAAP;EACH;;EAE6B,MAAjBI,iBAAiB,CAACC,GAAD,EAAgB;IAC1C,OAAO,KAAKpB,QAAL,CAAcI,GAAd,CAAkBiB,wBAAlB,CAA2C,KAAKpB,MAAhD,EAAwDmB,GAAxD,CAAP;EACH;;EAE0B,MAAdE,cAAc,CAACF,GAAD,EAAgB;IACvC,OAAO,KAAKpB,QAAL,CAAcI,GAAd,CAAkBmB,qBAAlB,CAAwC,KAAKtB,MAA7C,EAAqDmB,GAArD,CAAP;EACH;;EAEkB,MAANI,MAAM,CAACjB,EAAD,EAAaJ,IAAb,EAAwC;IACvD,OAAO,KAAKH,QAAL,CAAcI,GAAd,CAAkBqB,WAAlB,CAA8B,KAAKxB,MAAnC,EAA2CM,EAA3C,EAA+CJ,IAA/C,CAAP;EACH;;AA5C0D"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.createDefaultModelManager = void 0;
|
|
7
7
|
|
|
8
8
|
var _DefaultCmsModelManager = require("./DefaultCmsModelManager");
|
|
9
9
|
|
|
@@ -15,6 +15,6 @@ const plugin = {
|
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
17
|
|
|
18
|
-
|
|
18
|
+
const createDefaultModelManager = () => plugin;
|
|
19
19
|
|
|
20
|
-
exports.
|
|
20
|
+
exports.createDefaultModelManager = createDefaultModelManager;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["plugin","type","name","create","context","model","DefaultCmsModelManager","createDefaultModelManager"],"sources":["index.ts"],"sourcesContent":["import { ModelManagerPlugin } from \"~/types\";\nimport { DefaultCmsModelManager } from \"./DefaultCmsModelManager\";\n\nconst plugin: ModelManagerPlugin = {\n type: \"cms-content-model-manager\",\n name: \"content-model-manager-default\",\n create: async (context, model) => {\n return new DefaultCmsModelManager(context, model);\n }\n};\n\nexport const createDefaultModelManager = () => plugin;\n"],"mappings":";;;;;;;AACA;;AAEA,MAAMA,MAA0B,GAAG;EAC/BC,IAAI,EAAE,2BADyB;EAE/BC,IAAI,EAAE,+BAFyB;EAG/BC,MAAM,EAAE,OAAOC,OAAP,EAAgBC,KAAhB,KAA0B;IAC9B,OAAO,IAAIC,8CAAJ,CAA2BF,OAA3B,EAAoCC,KAApC,CAAP;EACH;AAL8B,CAAnC;;AAQO,MAAME,yBAAyB,GAAG,MAAMP,MAAxC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-unstable.1e66d121db",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms:base"
|
|
@@ -18,55 +18,56 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@babel/runtime": "7.
|
|
21
|
+
"@babel/runtime": "7.19.0",
|
|
22
22
|
"@commodo/fields": "1.1.2-beta.20",
|
|
23
23
|
"@graphql-tools/schema": "7.1.5",
|
|
24
|
-
"@webiny/api
|
|
25
|
-
"@webiny/api-
|
|
26
|
-
"@webiny/api-i18n
|
|
27
|
-
"@webiny/api-i18n-ddb": "0.0.0-
|
|
28
|
-
"@webiny/api-security": "0.0.0-
|
|
29
|
-
"@webiny/api-tenancy": "0.0.0-
|
|
30
|
-
"@webiny/api-upgrade": "0.0.0-
|
|
31
|
-
"@webiny/error": "0.0.0-
|
|
32
|
-
"@webiny/handler": "0.0.0-
|
|
33
|
-
"@webiny/handler-aws": "0.0.0-
|
|
34
|
-
"@webiny/handler-db": "0.0.0-
|
|
35
|
-
"@webiny/handler-graphql": "0.0.0-
|
|
36
|
-
"@webiny/
|
|
37
|
-
"@webiny/
|
|
38
|
-
"@webiny/
|
|
39
|
-
"@webiny/
|
|
40
|
-
"@webiny/validation": "0.0.0-mt-2",
|
|
41
|
-
"boolean": "3.1.4",
|
|
24
|
+
"@webiny/api": "0.0.0-unstable.1e66d121db",
|
|
25
|
+
"@webiny/api-file-manager": "0.0.0-unstable.1e66d121db",
|
|
26
|
+
"@webiny/api-i18n": "0.0.0-unstable.1e66d121db",
|
|
27
|
+
"@webiny/api-i18n-ddb": "0.0.0-unstable.1e66d121db",
|
|
28
|
+
"@webiny/api-security": "0.0.0-unstable.1e66d121db",
|
|
29
|
+
"@webiny/api-tenancy": "0.0.0-unstable.1e66d121db",
|
|
30
|
+
"@webiny/api-upgrade": "0.0.0-unstable.1e66d121db",
|
|
31
|
+
"@webiny/error": "0.0.0-unstable.1e66d121db",
|
|
32
|
+
"@webiny/handler": "0.0.0-unstable.1e66d121db",
|
|
33
|
+
"@webiny/handler-aws": "0.0.0-unstable.1e66d121db",
|
|
34
|
+
"@webiny/handler-db": "0.0.0-unstable.1e66d121db",
|
|
35
|
+
"@webiny/handler-graphql": "0.0.0-unstable.1e66d121db",
|
|
36
|
+
"@webiny/plugins": "0.0.0-unstable.1e66d121db",
|
|
37
|
+
"@webiny/pubsub": "0.0.0-unstable.1e66d121db",
|
|
38
|
+
"@webiny/utils": "0.0.0-unstable.1e66d121db",
|
|
39
|
+
"@webiny/validation": "0.0.0-unstable.1e66d121db",
|
|
42
40
|
"commodo-fields-object": "1.0.6",
|
|
43
|
-
"dataloader": "2.
|
|
41
|
+
"dataloader": "2.1.0",
|
|
42
|
+
"dot-prop": "6.0.1",
|
|
43
|
+
"graphql-tag": "2.12.6",
|
|
44
44
|
"lodash": "4.17.21",
|
|
45
45
|
"p-map": "4.0.0",
|
|
46
46
|
"p-reduce": "2.1.0",
|
|
47
47
|
"pluralize": "8.0.0",
|
|
48
|
-
"
|
|
49
|
-
"slugify": "1.6.
|
|
48
|
+
"semver": "6.3.0",
|
|
49
|
+
"slugify": "1.6.5"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@babel/cli": "^7.
|
|
53
|
-
"@babel/core": "^7.
|
|
54
|
-
"@babel/preset-env": "^7.
|
|
55
|
-
"@babel/preset-flow": "^7.
|
|
56
|
-
"@webiny/api-security-so-ddb": "^0.0.0-
|
|
57
|
-
"@webiny/api-tenancy-so-ddb": "^0.0.0-
|
|
58
|
-
"@webiny/
|
|
59
|
-
"@webiny/
|
|
60
|
-
"
|
|
52
|
+
"@babel/cli": "^7.19.3",
|
|
53
|
+
"@babel/core": "^7.19.3",
|
|
54
|
+
"@babel/preset-env": "^7.19.4",
|
|
55
|
+
"@babel/preset-flow": "^7.16.0",
|
|
56
|
+
"@webiny/api-security-so-ddb": "^0.0.0-unstable.1e66d121db",
|
|
57
|
+
"@webiny/api-tenancy-so-ddb": "^0.0.0-unstable.1e66d121db",
|
|
58
|
+
"@webiny/api-wcp": "^0.0.0-unstable.1e66d121db",
|
|
59
|
+
"@webiny/cli": "^0.0.0-unstable.1e66d121db",
|
|
60
|
+
"@webiny/project-utils": "^0.0.0-unstable.1e66d121db",
|
|
61
|
+
"apollo-graphql": "^0.9.5",
|
|
61
62
|
"get-yarn-workspaces": "^1.0.2",
|
|
62
|
-
"graphql": "^
|
|
63
|
-
"jest": "^
|
|
63
|
+
"graphql": "^15.7.2",
|
|
64
|
+
"jest": "^28.1.0",
|
|
64
65
|
"mdbid": "^1.0.0",
|
|
65
66
|
"prettier": "^2.3.2",
|
|
66
67
|
"rimraf": "^3.0.2",
|
|
67
68
|
"sinon": "^9.0.2",
|
|
68
69
|
"ttypescript": "^1.5.12",
|
|
69
|
-
"typescript": "
|
|
70
|
+
"typescript": "4.7.4"
|
|
70
71
|
},
|
|
71
72
|
"publishConfig": {
|
|
72
73
|
"access": "public",
|
|
@@ -76,5 +77,5 @@
|
|
|
76
77
|
"build": "yarn webiny run build",
|
|
77
78
|
"watch": "yarn webiny run watch"
|
|
78
79
|
},
|
|
79
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "b670bf27c5039de1a2b0be764a09ba4cb94ad5e2"
|
|
80
81
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.createContextParameterPlugin = void 0;
|
|
7
|
+
|
|
8
|
+
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
9
|
+
|
|
10
|
+
const DEFAULT_LOCALE_CODE = "en-US";
|
|
11
|
+
|
|
12
|
+
const createContextParameterPlugin = () => {
|
|
13
|
+
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
14
|
+
const locale = context.i18n.getContentLocale();
|
|
15
|
+
return {
|
|
16
|
+
locale: (locale === null || locale === void 0 ? void 0 : locale.code) || DEFAULT_LOCALE_CODE,
|
|
17
|
+
type: null
|
|
18
|
+
};
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
exports.createContextParameterPlugin = createContextParameterPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["DEFAULT_LOCALE_CODE","createContextParameterPlugin","CmsParametersPlugin","context","locale","i18n","getContentLocale","code","type"],"sources":["context.ts"],"sourcesContent":["import { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\n\nconst DEFAULT_LOCALE_CODE = \"en-US\";\n\nexport const createContextParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n const locale = context.i18n.getContentLocale();\n return {\n locale: locale?.code || DEFAULT_LOCALE_CODE,\n type: null\n };\n });\n};\n"],"mappings":";;;;;;;AAAA;;AAEA,MAAMA,mBAAmB,GAAG,OAA5B;;AAEO,MAAMC,4BAA4B,GAAG,MAAM;EAC9C,OAAO,IAAIC,wCAAJ,CAAwB,MAAMC,OAAN,IAAiB;IAC5C,MAAMC,MAAM,GAAGD,OAAO,CAACE,IAAR,CAAaC,gBAAb,EAAf;IACA,OAAO;MACHF,MAAM,EAAE,CAAAA,MAAM,SAAN,IAAAA,MAAM,WAAN,YAAAA,MAAM,CAAEG,IAAR,KAAgBP,mBADrB;MAEHQ,IAAI,EAAE;IAFH,CAAP;EAIH,CANM,CAAP;AAOH,CARM"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createHeaderParameterPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
+
|
|
12
|
+
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
13
|
+
|
|
14
|
+
var HeaderKeys;
|
|
15
|
+
|
|
16
|
+
(function (HeaderKeys) {
|
|
17
|
+
HeaderKeys["TYPE"] = "x-webiny-cms-endpoint";
|
|
18
|
+
HeaderKeys["LOCALE"] = "x-webiny-cms-locale";
|
|
19
|
+
})(HeaderKeys || (HeaderKeys = {}));
|
|
20
|
+
|
|
21
|
+
const createHeaderParameterPlugin = () => {
|
|
22
|
+
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
23
|
+
var _context$request;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* If any of the properties is not defined, just ignore this plugin
|
|
27
|
+
*/
|
|
28
|
+
if (!((_context$request = context.request) !== null && _context$request !== void 0 && _context$request.headers)) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const headers = context.request.headers;
|
|
33
|
+
const type = headers[HeaderKeys.TYPE];
|
|
34
|
+
const locale = headers[HeaderKeys.LOCALE];
|
|
35
|
+
|
|
36
|
+
if (!type && !locale) {
|
|
37
|
+
return null;
|
|
38
|
+
} else if (!locale || typeof locale !== "string") {
|
|
39
|
+
throw new _error.default(`There is a "${HeaderKeys.TYPE}" header but no "${HeaderKeys.LOCALE}".`, "MALFORMED_HEADERS_ERROR", {
|
|
40
|
+
headers
|
|
41
|
+
});
|
|
42
|
+
} else if (!type || typeof type !== "string") {
|
|
43
|
+
throw new _error.default(`There is a "${HeaderKeys.LOCALE}" header but no "${HeaderKeys.TYPE}".`, "MALFORMED_HEADERS_ERROR", {
|
|
44
|
+
headers
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
type: type,
|
|
50
|
+
locale
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
exports.createHeaderParameterPlugin = createHeaderParameterPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["HeaderKeys","createHeaderParameterPlugin","CmsParametersPlugin","context","request","headers","type","TYPE","locale","LOCALE","WebinyError"],"sources":["header.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\nimport { ApiEndpoint } from \"~/types\";\n\nenum HeaderKeys {\n TYPE = \"x-webiny-cms-endpoint\",\n LOCALE = \"x-webiny-cms-locale\"\n}\n\nexport const createHeaderParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n /**\n * If any of the properties is not defined, just ignore this plugin\n */\n if (!context.request?.headers) {\n return null;\n }\n\n const headers = context.request.headers;\n\n const type = headers[HeaderKeys.TYPE];\n const locale = headers[HeaderKeys.LOCALE];\n\n if (!type && !locale) {\n return null;\n } else if (!locale || typeof locale !== \"string\") {\n throw new WebinyError(\n `There is a \"${HeaderKeys.TYPE}\" header but no \"${HeaderKeys.LOCALE}\".`,\n \"MALFORMED_HEADERS_ERROR\",\n {\n headers\n }\n );\n } else if (!type || typeof type !== \"string\") {\n throw new WebinyError(\n `There is a \"${HeaderKeys.LOCALE}\" header but no \"${HeaderKeys.TYPE}\".`,\n \"MALFORMED_HEADERS_ERROR\",\n {\n headers\n }\n );\n }\n\n return {\n type: type as ApiEndpoint,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;;;AAAA;;AACA;;IAGKA,U;;WAAAA,U;EAAAA,U;EAAAA,U;GAAAA,U,KAAAA,U;;AAKE,MAAMC,2BAA2B,GAAG,MAAM;EAC7C,OAAO,IAAIC,wCAAJ,CAAwB,MAAMC,OAAN,IAAiB;IAAA;;IAC5C;AACR;AACA;IACQ,IAAI,sBAACA,OAAO,CAACC,OAAT,6CAAC,iBAAiBC,OAAlB,CAAJ,EAA+B;MAC3B,OAAO,IAAP;IACH;;IAED,MAAMA,OAAO,GAAGF,OAAO,CAACC,OAAR,CAAgBC,OAAhC;IAEA,MAAMC,IAAI,GAAGD,OAAO,CAACL,UAAU,CAACO,IAAZ,CAApB;IACA,MAAMC,MAAM,GAAGH,OAAO,CAACL,UAAU,CAACS,MAAZ,CAAtB;;IAEA,IAAI,CAACH,IAAD,IAAS,CAACE,MAAd,EAAsB;MAClB,OAAO,IAAP;IACH,CAFD,MAEO,IAAI,CAACA,MAAD,IAAW,OAAOA,MAAP,KAAkB,QAAjC,EAA2C;MAC9C,MAAM,IAAIE,cAAJ,CACD,eAAcV,UAAU,CAACO,IAAK,oBAAmBP,UAAU,CAACS,MAAO,IADlE,EAEF,yBAFE,EAGF;QACIJ;MADJ,CAHE,CAAN;IAOH,CARM,MAQA,IAAI,CAACC,IAAD,IAAS,OAAOA,IAAP,KAAgB,QAA7B,EAAuC;MAC1C,MAAM,IAAII,cAAJ,CACD,eAAcV,UAAU,CAACS,MAAO,oBAAmBT,UAAU,CAACO,IAAK,IADlE,EAEF,yBAFE,EAGF;QACIF;MADJ,CAHE,CAAN;IAOH;;IAED,OAAO;MACHC,IAAI,EAAEA,IADH;MAEHE;IAFG,CAAP;EAIH,CArCM,CAAP;AAsCH,CAvCM"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
var _manual = require("./manual");
|
|
8
|
+
|
|
9
|
+
Object.keys(_manual).forEach(function (key) {
|
|
10
|
+
if (key === "default" || key === "__esModule") return;
|
|
11
|
+
if (key in exports && exports[key] === _manual[key]) return;
|
|
12
|
+
Object.defineProperty(exports, key, {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return _manual[key];
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
var _path = require("./path");
|
|
21
|
+
|
|
22
|
+
Object.keys(_path).forEach(function (key) {
|
|
23
|
+
if (key === "default" || key === "__esModule") return;
|
|
24
|
+
if (key in exports && exports[key] === _path[key]) return;
|
|
25
|
+
Object.defineProperty(exports, key, {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return _path[key];
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
var _context = require("./context");
|
|
34
|
+
|
|
35
|
+
Object.keys(_context).forEach(function (key) {
|
|
36
|
+
if (key === "default" || key === "__esModule") return;
|
|
37
|
+
if (key in exports && exports[key] === _context[key]) return;
|
|
38
|
+
Object.defineProperty(exports, key, {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () {
|
|
41
|
+
return _context[key];
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
var _header = require("./header");
|
|
47
|
+
|
|
48
|
+
Object.keys(_header).forEach(function (key) {
|
|
49
|
+
if (key === "default" || key === "__esModule") return;
|
|
50
|
+
if (key in exports && exports[key] === _header[key]) return;
|
|
51
|
+
Object.defineProperty(exports, key, {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return _header[key];
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./manual\";\nexport * from \"./path\";\nexport * from \"./context\";\nexport * from \"./header\";\n"],"mappings":";;;;;;AAAA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;;AACA;;AAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CmsParametersPlugin, CmsParametersPluginResponseLocale, CmsParametersPluginResponseType } from "../plugins/CmsParametersPlugin";
|
|
2
|
+
export interface ManualPluginParams {
|
|
3
|
+
endpointType?: CmsParametersPluginResponseType;
|
|
4
|
+
locale?: CmsParametersPluginResponseLocale;
|
|
5
|
+
}
|
|
6
|
+
export declare const createManualPlugin: (params: ManualPluginParams) => CmsParametersPlugin;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createManualPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
+
|
|
12
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
+
|
|
14
|
+
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* This would be used for custom Lambdas when there is no path or header information about the endpoint type and locale.
|
|
18
|
+
*/
|
|
19
|
+
const createManualPlugin = params => {
|
|
20
|
+
return new _CmsParametersPlugin.CmsParametersPlugin(async () => {
|
|
21
|
+
const {
|
|
22
|
+
endpointType: type,
|
|
23
|
+
locale
|
|
24
|
+
} = params;
|
|
25
|
+
/**
|
|
26
|
+
* if both of parameters are not existing, just skip this plugin.
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
if (!type && !locale) {
|
|
30
|
+
return null;
|
|
31
|
+
} else if (!type) {
|
|
32
|
+
throw new _error.default(`There is defined "locale" CMS parameter but no "endpointType".`, "MALFORMED_ENDPOINT_TYPE", (0, _objectSpread2.default)({}, params));
|
|
33
|
+
} else if (!locale) {
|
|
34
|
+
throw new _error.default(`There is defined "endpointType" CMS parameter but no "locale".`, "MALFORMED_LOCALE_TYPE", (0, _objectSpread2.default)({}, params));
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return {
|
|
38
|
+
type,
|
|
39
|
+
locale
|
|
40
|
+
};
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
exports.createManualPlugin = createManualPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["createManualPlugin","params","CmsParametersPlugin","endpointType","type","locale","WebinyError"],"sources":["manual.ts"],"sourcesContent":["/**\n * This would be used for custom Lambdas when there is no path or header information about the endpoint type and locale.\n */\nimport WebinyError from \"@webiny/error\";\nimport {\n CmsParametersPlugin,\n CmsParametersPluginResponseLocale,\n CmsParametersPluginResponseType\n} from \"~/plugins/CmsParametersPlugin\";\n\nexport interface ManualPluginParams {\n endpointType?: CmsParametersPluginResponseType;\n locale?: CmsParametersPluginResponseLocale;\n}\n\nexport const createManualPlugin = (params: ManualPluginParams): CmsParametersPlugin => {\n return new CmsParametersPlugin(async () => {\n const { endpointType: type, locale } = params;\n /**\n * if both of parameters are not existing, just skip this plugin.\n */\n if (!type && !locale) {\n return null;\n } else if (!type) {\n throw new WebinyError(\n `There is defined \"locale\" CMS parameter but no \"endpointType\".`,\n \"MALFORMED_ENDPOINT_TYPE\",\n {\n ...params\n }\n );\n } else if (!locale) {\n throw new WebinyError(\n `There is defined \"endpointType\" CMS parameter but no \"locale\".`,\n \"MALFORMED_LOCALE_TYPE\",\n {\n ...params\n }\n );\n }\n\n return {\n type,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AAJA;AACA;AACA;AAaO,MAAMA,kBAAkB,GAAIC,MAAD,IAAqD;EACnF,OAAO,IAAIC,wCAAJ,CAAwB,YAAY;IACvC,MAAM;MAAEC,YAAY,EAAEC,IAAhB;MAAsBC;IAAtB,IAAiCJ,MAAvC;IACA;AACR;AACA;;IACQ,IAAI,CAACG,IAAD,IAAS,CAACC,MAAd,EAAsB;MAClB,OAAO,IAAP;IACH,CAFD,MAEO,IAAI,CAACD,IAAL,EAAW;MACd,MAAM,IAAIE,cAAJ,CACD,gEADC,EAEF,yBAFE,kCAIKL,MAJL,EAAN;IAOH,CARM,MAQA,IAAI,CAACI,MAAL,EAAa;MAChB,MAAM,IAAIC,cAAJ,CACD,gEADC,EAEF,uBAFE,kCAIKL,MAJL,EAAN;IAOH;;IAED,OAAO;MACHG,IADG;MAEHC;IAFG,CAAP;EAIH,CA7BM,CAAP;AA8BH,CA/BM"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.createPathParameterPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
+
|
|
12
|
+
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
13
|
+
|
|
14
|
+
const allowedEndpoints = ["manage", "read", "preview"];
|
|
15
|
+
|
|
16
|
+
const createPathParameterPlugin = () => {
|
|
17
|
+
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
18
|
+
var _context$request;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* If any of the properties is not defined, just ignore this plugin
|
|
22
|
+
*/
|
|
23
|
+
if (!((_context$request = context.request) !== null && _context$request !== void 0 && _context$request.params)) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const {
|
|
28
|
+
type,
|
|
29
|
+
locale
|
|
30
|
+
} = context.request.params;
|
|
31
|
+
|
|
32
|
+
if (!type && !locale) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (!type) {
|
|
37
|
+
throw new _error.default(`Missing request parameter "type".`);
|
|
38
|
+
} else if (!locale) {
|
|
39
|
+
throw new _error.default(`Missing request parameter "locale".`);
|
|
40
|
+
} else if (allowedEndpoints.includes(type) === false) {
|
|
41
|
+
throw new _error.default(`Endpoint "${type}" not allowed!`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
type: type,
|
|
46
|
+
locale
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
exports.createPathParameterPlugin = createPathParameterPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["allowedEndpoints","createPathParameterPlugin","CmsParametersPlugin","context","request","params","type","locale","WebinyError","includes"],"sources":["path.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\nimport { CmsParametersPlugin } from \"~/plugins/CmsParametersPlugin\";\nimport { ApiEndpoint } from \"~/types\";\n\nconst allowedEndpoints: ApiEndpoint[] = [\"manage\", \"read\", \"preview\"];\n\nexport const createPathParameterPlugin = () => {\n return new CmsParametersPlugin(async context => {\n /**\n * If any of the properties is not defined, just ignore this plugin\n */\n if (!context.request?.params) {\n return null;\n }\n\n const { type, locale } = context.request.params as Record<string, string | null>;\n if (!type && !locale) {\n return null;\n }\n\n if (!type) {\n throw new WebinyError(`Missing request parameter \"type\".`);\n } else if (!locale) {\n throw new WebinyError(`Missing request parameter \"locale\".`);\n } else if (allowedEndpoints.includes(type as ApiEndpoint) === false) {\n throw new WebinyError(`Endpoint \"${type}\" not allowed!`);\n }\n\n return {\n type: type as ApiEndpoint,\n locale\n };\n });\n};\n"],"mappings":";;;;;;;;;AAAA;;AACA;;AAGA,MAAMA,gBAA+B,GAAG,CAAC,QAAD,EAAW,MAAX,EAAmB,SAAnB,CAAxC;;AAEO,MAAMC,yBAAyB,GAAG,MAAM;EAC3C,OAAO,IAAIC,wCAAJ,CAAwB,MAAMC,OAAN,IAAiB;IAAA;;IAC5C;AACR;AACA;IACQ,IAAI,sBAACA,OAAO,CAACC,OAAT,6CAAC,iBAAiBC,MAAlB,CAAJ,EAA8B;MAC1B,OAAO,IAAP;IACH;;IAED,MAAM;MAAEC,IAAF;MAAQC;IAAR,IAAmBJ,OAAO,CAACC,OAAR,CAAgBC,MAAzC;;IACA,IAAI,CAACC,IAAD,IAAS,CAACC,MAAd,EAAsB;MAClB,OAAO,IAAP;IACH;;IAED,IAAI,CAACD,IAAL,EAAW;MACP,MAAM,IAAIE,cAAJ,CAAiB,mCAAjB,CAAN;IACH,CAFD,MAEO,IAAI,CAACD,MAAL,EAAa;MAChB,MAAM,IAAIC,cAAJ,CAAiB,qCAAjB,CAAN;IACH,CAFM,MAEA,IAAIR,gBAAgB,CAACS,QAAjB,CAA0BH,IAA1B,MAAmD,KAAvD,EAA8D;MACjE,MAAM,IAAIE,cAAJ,CAAiB,aAAYF,IAAK,gBAAlC,CAAN;IACH;;IAED,OAAO;MACHA,IAAI,EAAEA,IADH;MAEHC;IAFG,CAAP;EAIH,CAzBM,CAAP;AA0BH,CA3BM"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
import { CmsGroup as BaseCmsGroup } from "../types";
|
|
3
|
+
interface CmsGroup extends Omit<BaseCmsGroup, "locale" | "tenant" | "webinyVersion"> {
|
|
4
|
+
tenant?: string;
|
|
5
|
+
locale?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare class CmsGroupPlugin extends Plugin {
|
|
8
|
+
static readonly type: string;
|
|
9
|
+
readonly contentModelGroup: CmsGroup;
|
|
10
|
+
constructor(contentModelGroup: CmsGroup);
|
|
11
|
+
}
|
|
12
|
+
export declare const createCmsGroup: (group: CmsGroup) => CmsGroupPlugin;
|
|
13
|
+
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.CmsGroupPlugin = void 0;
|
|
8
|
+
exports.createCmsGroup = exports.CmsGroupPlugin = void 0;
|
|
9
9
|
|
|
10
10
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
11
|
|
|
@@ -21,4 +21,10 @@ class CmsGroupPlugin extends _plugins.Plugin {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
exports.CmsGroupPlugin = CmsGroupPlugin;
|
|
24
|
-
(0, _defineProperty2.default)(CmsGroupPlugin, "type", "cms-content-model-group");
|
|
24
|
+
(0, _defineProperty2.default)(CmsGroupPlugin, "type", "cms-content-model-group");
|
|
25
|
+
|
|
26
|
+
const createCmsGroup = group => {
|
|
27
|
+
return new CmsGroupPlugin(group);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
exports.createCmsGroup = createCmsGroup;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsGroupPlugin","Plugin","constructor","contentModelGroup","createCmsGroup","group"],"sources":["CmsGroupPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsGroup as BaseCmsGroup } from \"~/types\";\n\ninterface CmsGroup extends Omit<BaseCmsGroup, \"locale\" | \"tenant\" | \"webinyVersion\"> {\n tenant?: string;\n locale?: string;\n}\nexport class CmsGroupPlugin extends Plugin {\n public static override readonly type: string = \"cms-content-model-group\";\n public readonly contentModelGroup: CmsGroup;\n\n constructor(contentModelGroup: CmsGroup) {\n super();\n this.contentModelGroup = contentModelGroup;\n }\n}\n\nexport const createCmsGroup = (group: CmsGroup): CmsGroupPlugin => {\n return new CmsGroupPlugin(group);\n};\n"],"mappings":";;;;;;;;;;;AAAA;;AAOO,MAAMA,cAAN,SAA6BC,eAA7B,CAAoC;EAIvCC,WAAW,CAACC,iBAAD,EAA8B;IACrC;IADqC;IAErC,KAAKA,iBAAL,GAAyBA,iBAAzB;EACH;;AAPsC;;;8BAA9BH,c,UACsC,yB;;AAS5C,MAAMI,cAAc,GAAIC,KAAD,IAAqC;EAC/D,OAAO,IAAIL,cAAJ,CAAmBK,KAAnB,CAAP;AACH,CAFM"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
import { CmsEntryValues, CmsModelFieldWithParent } from "../types";
|
|
3
|
+
import { ConverterCollection } from "../utils/converters/ConverterCollection";
|
|
4
|
+
export interface ConvertParams {
|
|
5
|
+
field: CmsModelFieldWithParent;
|
|
6
|
+
value: any;
|
|
7
|
+
converterCollection: ConverterCollection;
|
|
8
|
+
}
|
|
9
|
+
export declare abstract class CmsModelFieldConverterPlugin extends Plugin {
|
|
10
|
+
static type: string;
|
|
11
|
+
abstract getFieldType(): string;
|
|
12
|
+
abstract convertToStorage(params: ConvertParams): CmsEntryValues;
|
|
13
|
+
abstract convertFromStorage(params: ConvertParams): CmsEntryValues;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.CmsModelFieldConverterPlugin = void 0;
|
|
9
|
+
|
|
10
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
+
|
|
12
|
+
var _plugins = require("@webiny/plugins");
|
|
13
|
+
|
|
14
|
+
class CmsModelFieldConverterPlugin extends _plugins.Plugin {}
|
|
15
|
+
|
|
16
|
+
exports.CmsModelFieldConverterPlugin = CmsModelFieldConverterPlugin;
|
|
17
|
+
(0, _defineProperty2.default)(CmsModelFieldConverterPlugin, "type", "cms.field.converter");
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["CmsModelFieldConverterPlugin","Plugin"],"sources":["CmsModelFieldConverterPlugin.ts"],"sourcesContent":["import { Plugin } from \"@webiny/plugins\";\nimport { CmsEntryValues, CmsModelFieldWithParent } from \"~/types\";\nimport { ConverterCollection } from \"~/utils/converters/ConverterCollection\";\n\nexport interface ConvertParams {\n field: CmsModelFieldWithParent;\n value: any;\n converterCollection: ConverterCollection;\n}\n\nexport abstract class CmsModelFieldConverterPlugin extends Plugin {\n public static override type = \"cms.field.converter\";\n\n public abstract getFieldType(): string;\n\n public abstract convertToStorage(params: ConvertParams): CmsEntryValues;\n public abstract convertFromStorage(params: ConvertParams): CmsEntryValues;\n}\n"],"mappings":";;;;;;;;;;;AAAA;;AAUO,MAAeA,4BAAf,SAAoDC,eAApD,CAA2D;;;8BAA5CD,4B,UACY,qB"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Plugin } from "@webiny/plugins";
|
|
2
|
+
import { CmsModel as CmsModelBase, CmsModelField as CmsModelFieldBase, CmsModelFieldSettings as BaseCmsModelFieldSettings } from "../types";
|
|
3
|
+
interface CmsModelFieldSettings extends Omit<BaseCmsModelFieldSettings, "fields"> {
|
|
4
|
+
/**
|
|
5
|
+
* Object field has child fields.
|
|
6
|
+
*/
|
|
7
|
+
fields?: CmsModelFieldInput[];
|
|
8
|
+
}
|
|
9
|
+
interface CmsModelFieldInput extends Omit<CmsModelFieldBase, "storageId" | "settings"> {
|
|
10
|
+
/**
|
|
11
|
+
* If defined, it must be camelCased string.
|
|
12
|
+
* This is for backwards compatibility - before fields had storageId.
|
|
13
|
+
*
|
|
14
|
+
* This should only be populated in old model fields.
|
|
15
|
+
* News ones must have this empty.
|
|
16
|
+
*/
|
|
17
|
+
storageId?: string;
|
|
18
|
+
/**
|
|
19
|
+
* We must have a possibility to have a nested field defined without the storageId.
|
|
20
|
+
*/
|
|
21
|
+
settings?: CmsModelFieldSettings;
|
|
22
|
+
}
|
|
23
|
+
interface CmsModelInput extends Omit<CmsModelBase, "locale" | "tenant" | "webinyVersion" | "fields"> {
|
|
24
|
+
fields: CmsModelFieldInput[];
|
|
25
|
+
locale?: string;
|
|
26
|
+
tenant?: string;
|
|
27
|
+
}
|
|
28
|
+
interface CmsModel extends Omit<CmsModelBase, "locale" | "tenant" | "webinyVersion"> {
|
|
29
|
+
locale?: string;
|
|
30
|
+
tenant?: string;
|
|
31
|
+
}
|
|
32
|
+
interface CmsModelPluginOptions {
|
|
33
|
+
validateLayout?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export declare class CmsModelPlugin extends Plugin {
|
|
36
|
+
static readonly type: string;
|
|
37
|
+
readonly contentModel: CmsModel;
|
|
38
|
+
private readonly options;
|
|
39
|
+
constructor(contentModel: CmsModelInput, options?: CmsModelPluginOptions);
|
|
40
|
+
private buildModel;
|
|
41
|
+
private buildFields;
|
|
42
|
+
private validateLayout;
|
|
43
|
+
}
|
|
44
|
+
export declare const createCmsModel: (model: CmsModelInput, options?: CmsModelPluginOptions) => CmsModelPlugin;
|
|
45
|
+
export {};
|