@webiny/api-headless-cms 0.0.0-unstable.97a151f74d → 0.0.0-unstable.99666aeb00
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/constants.d.ts +1 -0
- package/constants.js +8 -0
- package/constants.js.map +1 -0
- package/context.d.ts +5 -2
- package/context.js +94 -24
- package/context.js.map +1 -1
- package/crud/contentEntry/afterDelete.js +0 -5
- package/crud/contentEntry/afterDelete.js.map +1 -1
- package/crud/contentEntry/beforeCreate.js +0 -3
- package/crud/contentEntry/beforeCreate.js.map +1 -1
- package/crud/contentEntry/beforeUpdate.js +0 -3
- package/crud/contentEntry/beforeUpdate.js.map +1 -1
- package/crud/contentEntry/entryDataValidation.js +1 -40
- package/crud/contentEntry/entryDataValidation.js.map +1 -1
- package/crud/contentEntry/markLockedFields.d.ts +1 -1
- package/crud/contentEntry/markLockedFields.js +15 -28
- package/crud/contentEntry/markLockedFields.js.map +1 -1
- package/crud/contentEntry/referenceFieldsMapping.js +39 -66
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
- package/crud/contentEntry/searchableFields.js +1 -12
- package/crud/contentEntry/searchableFields.js.map +1 -1
- package/crud/contentEntry.crud.d.ts +12 -5
- package/crud/contentEntry.crud.js +1166 -917
- package/crud/contentEntry.crud.js.map +1 -1
- package/crud/contentModel/afterCreate.js +0 -2
- package/crud/contentModel/afterCreate.js.map +1 -1
- package/crud/contentModel/afterCreateFrom.js +0 -2
- package/crud/contentModel/afterCreateFrom.js.map +1 -1
- package/crud/contentModel/afterDelete.js +0 -2
- package/crud/contentModel/afterDelete.js.map +1 -1
- package/crud/contentModel/afterUpdate.js +0 -2
- package/crud/contentModel/afterUpdate.js.map +1 -1
- package/crud/contentModel/beforeCreate.d.ts +2 -3
- package/crud/contentModel/beforeCreate.js +43 -109
- package/crud/contentModel/beforeCreate.js.map +1 -1
- package/crud/contentModel/beforeDelete.d.ts +1 -1
- package/crud/contentModel/beforeDelete.js +1 -15
- package/crud/contentModel/beforeDelete.js.map +1 -1
- package/crud/contentModel/beforeUpdate.d.ts +2 -4
- package/crud/contentModel/beforeUpdate.js +33 -10
- package/crud/contentModel/beforeUpdate.js.map +1 -1
- package/crud/contentModel/compatibility/modelApiName.d.ts +3 -0
- package/crud/contentModel/compatibility/modelApiName.js +24 -0
- package/crud/contentModel/compatibility/modelApiName.js.map +1 -0
- package/crud/contentModel/contentModelManagerFactory.js +0 -7
- package/crud/contentModel/contentModelManagerFactory.js.map +1 -1
- package/crud/contentModel/createFieldStorageId.js +0 -3
- package/crud/contentModel/createFieldStorageId.js.map +1 -1
- package/crud/contentModel/defaultFields.d.ts +5 -0
- package/crud/contentModel/defaultFields.js +58 -0
- package/crud/contentModel/defaultFields.js.map +1 -0
- package/crud/contentModel/fields/descriptionField.d.ts +2 -0
- package/crud/contentModel/fields/descriptionField.js +42 -0
- package/crud/contentModel/fields/descriptionField.js.map +1 -0
- package/crud/contentModel/fields/imageField.d.ts +2 -0
- package/crud/contentModel/fields/imageField.js +46 -0
- package/crud/contentModel/fields/imageField.js.map +1 -0
- package/crud/contentModel/fields/titleField.d.ts +2 -0
- package/crud/contentModel/fields/titleField.js +58 -0
- package/crud/contentModel/fields/titleField.js.map +1 -0
- package/crud/contentModel/validate/endingAllowed.d.ts +6 -0
- package/crud/contentModel/validate/endingAllowed.js +26 -0
- package/crud/contentModel/validate/endingAllowed.js.map +1 -0
- package/crud/contentModel/validate/isModelEndingAllowed.d.ts +6 -0
- package/crud/contentModel/validate/isModelEndingAllowed.js +24 -0
- package/crud/contentModel/validate/isModelEndingAllowed.js.map +1 -0
- package/crud/contentModel/validate/modelId.d.ts +11 -0
- package/crud/contentModel/validate/modelId.js +36 -0
- package/crud/contentModel/validate/modelId.js.map +1 -0
- package/crud/contentModel/validate/pluralApiName.d.ts +7 -0
- package/crud/contentModel/validate/pluralApiName.js +24 -0
- package/crud/contentModel/validate/pluralApiName.js.map +1 -0
- package/crud/contentModel/validate/singularApiName.d.ts +7 -0
- package/crud/contentModel/validate/singularApiName.js +24 -0
- package/crud/contentModel/validate/singularApiName.js.map +1 -0
- package/crud/contentModel/validateLayout.js +0 -8
- package/crud/contentModel/validateLayout.js.map +1 -1
- package/crud/contentModel/validateModel.d.ts +4 -4
- package/crud/contentModel/validateModel.js +6 -11
- package/crud/contentModel/validateModel.js.map +1 -1
- package/crud/contentModel/validateModelFields.d.ts +4 -4
- package/crud/contentModel/validateModelFields.js +120 -145
- package/crud/contentModel/validateModelFields.js.map +1 -1
- package/crud/contentModel/validation.d.ts +551 -0
- package/crud/contentModel/validation.js +145 -0
- package/crud/contentModel/validation.js.map +1 -0
- package/crud/contentModel.crud.d.ts +2 -0
- package/crud/contentModel.crud.js +380 -381
- package/crud/contentModel.crud.js.map +1 -1
- package/crud/contentModelGroup/beforeCreate.js +0 -12
- package/crud/contentModelGroup/beforeCreate.js.map +1 -1
- package/crud/contentModelGroup/beforeDelete.js +0 -8
- package/crud/contentModelGroup/beforeDelete.js.map +1 -1
- package/crud/contentModelGroup/beforeUpdate.js +0 -5
- package/crud/contentModelGroup/beforeUpdate.js.map +1 -1
- package/crud/contentModelGroup/validation.d.ts +30 -0
- package/crud/contentModelGroup/validation.js +34 -0
- package/crud/contentModelGroup/validation.js.map +1 -0
- package/crud/contentModelGroup.crud.d.ts +2 -0
- package/crud/contentModelGroup.crud.js +223 -222
- package/crud/contentModelGroup.crud.js.map +1 -1
- package/crud/settings.crud.d.ts +3 -1
- package/crud/settings.crud.js +7 -28
- package/crud/settings.crud.js.map +1 -1
- package/crud/system.crud.js +1 -96
- package/crud/system.crud.js.map +1 -1
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +0 -13
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.d.ts +11 -0
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +203 -0
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -0
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +0 -53
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/index.d.ts +2 -1
- package/fieldConverters/index.js +2 -5
- package/fieldConverters/index.js.map +1 -1
- package/graphql/buildSchemaPlugins.d.ts +8 -3
- package/graphql/buildSchemaPlugins.js +6 -14
- package/graphql/buildSchemaPlugins.js.map +1 -1
- package/graphql/checkEndpointAccess.d.ts +2 -0
- package/graphql/checkEndpointAccess.js +18 -0
- package/graphql/checkEndpointAccess.js.map +1 -0
- package/graphql/createExecutableSchema.d.ts +6 -0
- package/graphql/createExecutableSchema.js +29 -0
- package/graphql/createExecutableSchema.js.map +1 -0
- package/graphql/createRequestBody.d.ts +2 -0
- package/graphql/createRequestBody.js +14 -0
- package/graphql/createRequestBody.js.map +1 -0
- package/graphql/formatErrorPayload.d.ts +1 -0
- package/graphql/formatErrorPayload.js +25 -0
- package/graphql/formatErrorPayload.js.map +1 -0
- package/graphql/generateSchema.d.ts +8 -0
- package/graphql/generateSchema.js +31 -0
- package/graphql/generateSchema.js.map +1 -0
- package/graphql/getSchema.d.ts +17 -0
- package/graphql/getSchema.js +102 -0
- package/graphql/getSchema.js.map +1 -0
- package/graphql/graphQLHandlerFactory.js +8 -169
- package/graphql/graphQLHandlerFactory.js.map +1 -1
- package/graphql/handleRequest.d.ts +11 -0
- package/graphql/handleRequest.js +81 -0
- package/graphql/handleRequest.js.map +1 -0
- package/graphql/index.d.ts +1 -3
- package/graphql/index.js +2 -46
- package/graphql/index.js.map +1 -1
- package/graphql/schema/baseContentSchema.d.ts +6 -2
- package/graphql/schema/baseContentSchema.js +10 -20
- package/graphql/schema/baseContentSchema.js.map +1 -1
- package/graphql/schema/baseSchema.d.ts +3 -0
- package/graphql/schema/baseSchema.js +84 -0
- package/graphql/schema/baseSchema.js.map +1 -0
- package/graphql/schema/contentEntries.d.ts +6 -2
- package/graphql/schema/contentEntries.js +123 -107
- package/graphql/schema/contentEntries.js.map +1 -1
- package/graphql/schema/contentModelGroups.d.ts +6 -2
- package/graphql/schema/contentModelGroups.js +16 -29
- package/graphql/schema/contentModelGroups.js.map +1 -1
- package/graphql/schema/contentModels.d.ts +6 -2
- package/graphql/schema/contentModels.js +46 -27
- package/graphql/schema/contentModels.js.map +1 -1
- package/graphql/schema/createFieldResolvers.d.ts +1 -1
- package/graphql/schema/createFieldResolvers.js +19 -36
- package/graphql/schema/createFieldResolvers.js.map +1 -1
- package/graphql/schema/createFieldTypePluginRecords.d.ts +3 -0
- package/graphql/schema/createFieldTypePluginRecords.js +13 -0
- package/graphql/schema/createFieldTypePluginRecords.js.map +1 -0
- package/graphql/schema/createManageResolvers.d.ts +1 -1
- package/graphql/schema/createManageResolvers.js +47 -43
- package/graphql/schema/createManageResolvers.js.map +1 -1
- package/graphql/schema/createManageSDL.d.ts +3 -0
- package/graphql/schema/createManageSDL.js +96 -77
- package/graphql/schema/createManageSDL.js.map +1 -1
- package/graphql/schema/createPreviewResolvers.js +3 -17
- package/graphql/schema/createPreviewResolvers.js.map +1 -1
- package/graphql/schema/createReadResolvers.js +8 -17
- package/graphql/schema/createReadResolvers.js.map +1 -1
- package/graphql/schema/createReadSDL.d.ts +3 -0
- package/graphql/schema/createReadSDL.js +47 -47
- package/graphql/schema/createReadSDL.js.map +1 -1
- package/graphql/schema/resolvers/commonFieldResolvers.d.ts +3 -2
- package/graphql/schema/resolvers/commonFieldResolvers.js +2 -3
- package/graphql/schema/resolvers/commonFieldResolvers.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreate.js +0 -3
- package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js +0 -3
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDelete.d.ts +2 -1
- package/graphql/schema/resolvers/manage/resolveDelete.js +13 -9
- package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.d.ts +7 -0
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +20 -0
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveGet.js +0 -16
- package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetByIds.js +0 -3
- package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js +0 -3
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.d.ts +4 -0
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +18 -0
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolveList.js +0 -3
- package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveMove.d.ts +8 -0
- package/graphql/schema/resolvers/manage/resolveMove.js +30 -0
- package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -0
- package/graphql/schema/resolvers/manage/resolvePublish.js +0 -3
- package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveRepublish.js +0 -3
- package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUnpublish.js +0 -3
- package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUpdate.js +0 -3
- package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
- package/graphql/schema/resolvers/preview/resolveGet.js +0 -8
- package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/preview/resolveList.js +0 -3
- package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveGet.js +0 -8
- package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveList.js +0 -3
- package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
- package/graphql/schema/schemaPlugins.d.ts +8 -3
- package/graphql/schema/schemaPlugins.js +58 -69
- package/graphql/schema/schemaPlugins.js.map +1 -1
- package/graphql/system.d.ts +2 -5
- package/graphql/system.js +56 -98
- package/graphql/system.js.map +1 -1
- package/graphqlFields/boolean.js +0 -12
- package/graphqlFields/boolean.js.map +1 -1
- package/graphqlFields/datetime.js +0 -17
- package/graphqlFields/datetime.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.d.ts +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.js +79 -45
- package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js +2 -18
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -1
- package/graphqlFields/dynamicZone/index.js +0 -2
- package/graphqlFields/dynamicZone/index.js.map +1 -1
- package/graphqlFields/file.js +0 -8
- package/graphqlFields/file.js.map +1 -1
- package/graphqlFields/helpers.js +0 -10
- package/graphqlFields/helpers.js.map +1 -1
- package/graphqlFields/index.js +0 -12
- package/graphqlFields/index.js.map +1 -1
- package/graphqlFields/longText.js +0 -10
- package/graphqlFields/longText.js.map +1 -1
- package/graphqlFields/number.js +1 -12
- package/graphqlFields/number.js.map +1 -1
- package/graphqlFields/object.js +48 -52
- package/graphqlFields/object.js.map +1 -1
- package/graphqlFields/ref.js +64 -66
- package/graphqlFields/ref.js.map +1 -1
- package/graphqlFields/richText.js +0 -9
- package/graphqlFields/richText.js.map +1 -1
- package/graphqlFields/text.js +2 -11
- package/graphqlFields/text.js.map +1 -1
- package/index.d.ts +5 -3
- package/index.js +26 -28
- package/index.js.map +1 -1
- package/modelManager/DefaultCmsModelManager.js +0 -16
- package/modelManager/DefaultCmsModelManager.js.map +1 -1
- package/modelManager/index.js +0 -4
- package/modelManager/index.js.map +1 -1
- package/package.json +35 -41
- package/parameters/context.js +0 -4
- package/parameters/context.js.map +1 -1
- package/parameters/header.js +0 -11
- package/parameters/header.js.map +1 -1
- package/parameters/index.js +0 -8
- package/parameters/index.js.map +1 -1
- package/parameters/manual.js +1 -8
- package/parameters/manual.js.map +1 -1
- package/parameters/path.js +0 -11
- package/parameters/path.js.map +1 -1
- package/plugins/CmsGraphQLSchemaPlugin.d.ts +5 -0
- package/plugins/CmsGraphQLSchemaPlugin.js +12 -0
- package/plugins/CmsGraphQLSchemaPlugin.js.map +1 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.d.ts +20 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.js +28 -0
- package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -0
- package/plugins/CmsGroupPlugin.js +0 -8
- package/plugins/CmsGroupPlugin.js.map +1 -1
- package/plugins/CmsModelFieldConverterPlugin.d.ts +2 -2
- package/plugins/CmsModelFieldConverterPlugin.js +0 -5
- package/plugins/CmsModelFieldConverterPlugin.js.map +1 -1
- package/plugins/CmsModelPlugin.d.ts +21 -3
- package/plugins/CmsModelPlugin.js +30 -40
- package/plugins/CmsModelPlugin.js.map +1 -1
- package/plugins/CmsParametersPlugin.js +0 -7
- package/plugins/CmsParametersPlugin.js.map +1 -1
- package/plugins/StorageOperationsCmsModelPlugin.d.ts +23 -0
- package/plugins/StorageOperationsCmsModelPlugin.js +42 -0
- package/plugins/StorageOperationsCmsModelPlugin.js.map +1 -0
- package/plugins/StorageTransformPlugin.js +0 -9
- package/plugins/StorageTransformPlugin.js.map +1 -1
- package/plugins/index.d.ts +3 -0
- package/plugins/index.js +33 -10
- package/plugins/index.js.map +1 -1
- package/storage/default.js +0 -3
- package/storage/default.js.map +1 -1
- package/storage/object.js +0 -19
- package/storage/object.js.map +1 -1
- package/types.d.ts +371 -96
- package/types.js +64 -64
- package/types.js.map +1 -1
- package/utils/converters/Converter.js +0 -13
- package/utils/converters/Converter.js.map +1 -1
- package/utils/converters/ConverterCollection.js +9 -33
- package/utils/converters/ConverterCollection.js.map +1 -1
- package/utils/converters/valueKeyStorageConverter.d.ts +1 -5
- package/utils/converters/valueKeyStorageConverter.js +26 -46
- package/utils/converters/valueKeyStorageConverter.js.map +1 -1
- package/utils/createTypeFromFields.d.ts +1 -0
- package/utils/createTypeFromFields.js +12 -21
- package/utils/createTypeFromFields.js.map +1 -1
- package/utils/createTypeName.d.ts +0 -2
- package/utils/createTypeName.js +2 -19
- package/utils/createTypeName.js.map +1 -1
- package/utils/entryStorage.js +17 -34
- package/utils/entryStorage.js.map +1 -1
- package/utils/filterAsync.js +0 -5
- package/utils/filterAsync.js.map +1 -1
- package/utils/getBaseFieldType.d.ts +1 -3
- package/utils/getBaseFieldType.js +0 -2
- package/utils/getBaseFieldType.js.map +1 -1
- package/utils/getEntryDescription.d.ts +2 -0
- package/utils/getEntryDescription.js +17 -0
- package/utils/getEntryDescription.js.map +1 -0
- package/utils/getEntryImage.d.ts +2 -0
- package/utils/getEntryImage.js +17 -0
- package/utils/getEntryImage.js.map +1 -0
- package/utils/getEntryTitle.d.ts +1 -1
- package/utils/getEntryTitle.js +0 -9
- package/utils/getEntryTitle.js.map +1 -1
- package/utils/getSchemaFromFieldPlugins.d.ts +4 -7
- package/utils/getSchemaFromFieldPlugins.js +23 -19
- package/utils/getSchemaFromFieldPlugins.js.map +1 -1
- package/utils/incrementEntryIdVersion.d.ts +5 -0
- package/utils/incrementEntryIdVersion.js +29 -0
- package/utils/incrementEntryIdVersion.js.map +1 -0
- package/utils/permissions/EntriesPermissions.d.ts +4 -0
- package/utils/permissions/EntriesPermissions.js +9 -0
- package/utils/permissions/EntriesPermissions.js.map +1 -0
- package/utils/permissions/ModelGroupsPermissions.d.ts +11 -0
- package/utils/permissions/ModelGroupsPermissions.js +48 -0
- package/utils/permissions/ModelGroupsPermissions.js.map +1 -0
- package/utils/permissions/ModelsPermissions.d.ts +20 -0
- package/utils/permissions/ModelsPermissions.js +91 -0
- package/utils/permissions/ModelsPermissions.js.map +1 -0
- package/utils/permissions/SettingsPermissions.d.ts +4 -0
- package/utils/permissions/SettingsPermissions.js +9 -0
- package/utils/permissions/SettingsPermissions.js.map +1 -0
- package/utils/renderFields.d.ts +4 -2
- package/utils/renderFields.js +10 -11
- package/utils/renderFields.js.map +1 -1
- package/utils/renderGetFilterFields.d.ts +2 -2
- package/utils/renderGetFilterFields.js +7 -33
- package/utils/renderGetFilterFields.js.map +1 -1
- package/utils/renderInputFields.d.ts +4 -2
- package/utils/renderInputFields.js +17 -14
- package/utils/renderInputFields.js.map +1 -1
- package/utils/renderListFilterFields.d.ts +3 -1
- package/utils/renderListFilterFields.js +16 -30
- package/utils/renderListFilterFields.js.map +1 -1
- package/utils/renderSortEnum.d.ts +9 -5
- package/utils/renderSortEnum.js +24 -12
- package/utils/renderSortEnum.js.map +1 -1
- package/utils/toSlug.js +0 -4
- package/utils/toSlug.js.map +1 -1
- package/validators/dateGte.js +0 -7
- package/validators/dateGte.js.map +1 -1
- package/validators/dateLte.js +0 -7
- package/validators/dateLte.js.map +1 -1
- package/validators/dynamicZone.js +0 -4
- package/validators/dynamicZone.js.map +1 -1
- package/validators/gte.js +0 -8
- package/validators/gte.js.map +1 -1
- package/validators/in.js +0 -8
- package/validators/in.js.map +1 -1
- package/validators/index.js +0 -16
- package/validators/index.js.map +1 -1
- package/validators/lte.js +0 -8
- package/validators/lte.js.map +1 -1
- package/validators/maxLength.js +0 -8
- package/validators/maxLength.js.map +1 -1
- package/validators/minLength.js +0 -8
- package/validators/minLength.js.map +1 -1
- package/validators/pattern.js +0 -9
- package/validators/pattern.js.map +1 -1
- package/validators/patternPlugins/email.js +0 -2
- package/validators/patternPlugins/email.js.map +1 -1
- package/validators/patternPlugins/index.js +0 -8
- package/validators/patternPlugins/index.js.map +1 -1
- package/validators/patternPlugins/lowerCase.js +0 -2
- package/validators/patternPlugins/lowerCase.js.map +1 -1
- package/validators/patternPlugins/lowerCaseSpace.js +0 -2
- package/validators/patternPlugins/lowerCaseSpace.js.map +1 -1
- package/validators/patternPlugins/upperCase.js +0 -2
- package/validators/patternPlugins/upperCase.js.map +1 -1
- package/validators/patternPlugins/upperCaseSpace.js +0 -2
- package/validators/patternPlugins/upperCaseSpace.js.map +1 -1
- package/validators/patternPlugins/url.js +0 -2
- package/validators/patternPlugins/url.js.map +1 -1
- package/validators/required.js +0 -5
- package/validators/required.js.map +1 -1
- package/validators/timeGte.js +0 -8
- package/validators/timeGte.js.map +1 -1
- package/validators/timeLte.js +0 -8
- package/validators/timeLte.js.map +1 -1
- package/validators/unique.js +0 -7
- package/validators/unique.js.map +1 -1
- package/crud/contentModel/createFieldModels.d.ts +0 -2
- package/crud/contentModel/createFieldModels.js +0 -26
- package/crud/contentModel/createFieldModels.js.map +0 -1
- package/crud/contentModel/fieldIdValidation.d.ts +0 -1
- package/crud/contentModel/fieldIdValidation.js +0 -25
- package/crud/contentModel/fieldIdValidation.js.map +0 -1
- package/crud/contentModel/idValidation.d.ts +0 -1
- package/crud/contentModel/idValidation.js +0 -22
- package/crud/contentModel/idValidation.js.map +0 -1
- package/crud/contentModel/models.d.ts +0 -4
- package/crud/contentModel/models.js +0 -192
- package/crud/contentModel/models.js.map +0 -1
- package/crud/contentModel/systemFields.d.ts +0 -1
- package/crud/contentModel/systemFields.js +0 -8
- package/crud/contentModel/systemFields.js.map +0 -1
- package/crud/index.d.ts +0 -6
- package/crud/index.js +0 -85
- package/crud/index.js.map +0 -1
- package/graphql/schema/resolvers/manage/resolveRequestChanges.d.ts +0 -7
- package/graphql/schema/resolvers/manage/resolveRequestChanges.js +0 -21
- package/graphql/schema/resolvers/manage/resolveRequestChanges.js.map +0 -1
- package/graphql/schema/resolvers/manage/resolveRequestReview.d.ts +0 -7
- package/graphql/schema/resolvers/manage/resolveRequestReview.js +0 -21
- package/graphql/schema/resolvers/manage/resolveRequestReview.js.map +0 -1
- package/upgrades/5.33.0/index.d.ts +0 -3
- package/upgrades/5.33.0/index.js +0 -182
- package/upgrades/5.33.0/index.js.map +0 -1
- package/upgrades/index.d.ts +0 -1
- package/upgrades/index.js +0 -12
- package/upgrades/index.js.map +0 -1
- package/utils/access.d.ts +0 -8
- package/utils/access.js +0 -90
- package/utils/access.js.map +0 -1
- package/utils/filterModelFields.d.ts +0 -16
- package/utils/filterModelFields.js +0 -77
- package/utils/filterModelFields.js.map +0 -1
- package/utils/ownership.d.ts +0 -8
- package/utils/ownership.js +0 -41
- package/utils/ownership.js.map +0 -1
- package/utils/permissions.d.ts +0 -7
- package/utils/permissions.js +0 -106
- package/utils/permissions.js.map +0 -1
- package/utils/pluralizedTypeName.d.ts +0 -1
- package/utils/pluralizedTypeName.js +0 -26
- package/utils/pluralizedTypeName.js.map +0 -1
package/index.js
CHANGED
|
@@ -29,17 +29,9 @@ Object.defineProperty(exports, "entryToStorageTransform", {
|
|
|
29
29
|
return _entryStorage.entryToStorageTransform;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
|
|
33
32
|
var _graphql = require("./graphql");
|
|
34
|
-
|
|
35
|
-
var _upgrades = require("./upgrades");
|
|
36
|
-
|
|
37
33
|
var _modelManager = require("./modelManager");
|
|
38
|
-
|
|
39
|
-
var _crud = require("./crud");
|
|
40
|
-
|
|
41
34
|
var _graphqlFields = require("./graphqlFields");
|
|
42
|
-
|
|
43
35
|
Object.keys(_graphqlFields).forEach(function (key) {
|
|
44
36
|
if (key === "default" || key === "__esModule") return;
|
|
45
37
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -51,25 +43,15 @@ Object.keys(_graphqlFields).forEach(function (key) {
|
|
|
51
43
|
}
|
|
52
44
|
});
|
|
53
45
|
});
|
|
54
|
-
|
|
55
46
|
var _validators = require("./validators");
|
|
56
|
-
|
|
57
47
|
var _default = require("./storage/default");
|
|
58
|
-
|
|
59
48
|
var _object = require("./storage/object");
|
|
60
|
-
|
|
61
49
|
var _dynamicZoneStorage = require("./graphqlFields/dynamicZone/dynamicZoneStorage");
|
|
62
|
-
|
|
63
50
|
var _parameters = require("./parameters");
|
|
64
|
-
|
|
65
51
|
var _context = require("./context");
|
|
66
|
-
|
|
67
52
|
var _entryStorage = require("./utils/entryStorage");
|
|
68
|
-
|
|
69
53
|
var _fieldConverters = require("./fieldConverters");
|
|
70
|
-
|
|
71
54
|
var _plugins = require("./plugins");
|
|
72
|
-
|
|
73
55
|
Object.keys(_plugins).forEach(function (key) {
|
|
74
56
|
if (key === "default" || key === "__esModule") return;
|
|
75
57
|
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
@@ -81,7 +63,30 @@ Object.keys(_plugins).forEach(function (key) {
|
|
|
81
63
|
}
|
|
82
64
|
});
|
|
83
65
|
});
|
|
84
|
-
|
|
66
|
+
var _incrementEntryIdVersion = require("./utils/incrementEntryIdVersion");
|
|
67
|
+
Object.keys(_incrementEntryIdVersion).forEach(function (key) {
|
|
68
|
+
if (key === "default" || key === "__esModule") return;
|
|
69
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
70
|
+
if (key in exports && exports[key] === _incrementEntryIdVersion[key]) return;
|
|
71
|
+
Object.defineProperty(exports, key, {
|
|
72
|
+
enumerable: true,
|
|
73
|
+
get: function () {
|
|
74
|
+
return _incrementEntryIdVersion[key];
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
var _handleRequest = require("./graphql/handleRequest");
|
|
79
|
+
Object.keys(_handleRequest).forEach(function (key) {
|
|
80
|
+
if (key === "default" || key === "__esModule") return;
|
|
81
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
82
|
+
if (key in exports && exports[key] === _handleRequest[key]) return;
|
|
83
|
+
Object.defineProperty(exports, key, {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function () {
|
|
86
|
+
return _handleRequest[key];
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
});
|
|
85
90
|
const createHeadlessCmsGraphQL = (params = {}) => {
|
|
86
91
|
return [
|
|
87
92
|
/**
|
|
@@ -91,21 +96,14 @@ const createHeadlessCmsGraphQL = (params = {}) => {
|
|
|
91
96
|
/**
|
|
92
97
|
* At this point we can create, or not create, CMS GraphQL Schema.
|
|
93
98
|
*/
|
|
94
|
-
(0, _graphql.createGraphQL)(params)];
|
|
99
|
+
...(0, _graphql.createGraphQL)(params)];
|
|
95
100
|
};
|
|
96
|
-
|
|
97
101
|
exports.createHeadlessCmsGraphQL = createHeadlessCmsGraphQL;
|
|
98
|
-
|
|
99
102
|
const createHeadlessCmsContext = params => {
|
|
100
103
|
return [
|
|
101
104
|
/**
|
|
102
105
|
* Context for all Lambdas - everything is loaded now.
|
|
103
106
|
*/
|
|
104
|
-
(0, _context.createContextPlugin)(), (0, _modelManager.createDefaultModelManager)(),
|
|
105
|
-
/**
|
|
106
|
-
*
|
|
107
|
-
*/
|
|
108
|
-
(0, _crud.createCrud)(params), (0, _graphqlFields.createGraphQLFields)(), (0, _fieldConverters.createFieldConverters)(), (0, _validators.createValidators)(), (0, _default.createDefaultStorageTransform)(), (0, _object.createObjectStorageTransform)(), (0, _dynamicZoneStorage.createDynamicZoneStorageTransform)(), (0, _upgrades.createUpgrades)()];
|
|
107
|
+
(0, _context.createContextPlugin)(params), (0, _modelManager.createDefaultModelManager)(), (0, _graphqlFields.createGraphQLFields)(), (0, _fieldConverters.createFieldConverters)(), (0, _validators.createValidators)(), (0, _default.createDefaultStorageTransform)(), (0, _object.createObjectStorageTransform)(), (0, _dynamicZoneStorage.createDynamicZoneStorageTransform)()];
|
|
109
108
|
};
|
|
110
|
-
|
|
111
109
|
exports.createHeadlessCmsContext = createHeadlessCmsContext;
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createHeadlessCmsGraphQL","params","createPathParameterPlugin","createHeaderParameterPlugin","createContextParameterPlugin","baseCreateGraphQL","createHeadlessCmsContext","createContextPlugin","createDefaultModelManager","
|
|
1
|
+
{"version":3,"names":["createHeadlessCmsGraphQL","params","createPathParameterPlugin","createHeaderParameterPlugin","createContextParameterPlugin","baseCreateGraphQL","createHeadlessCmsContext","createContextPlugin","createDefaultModelManager","createGraphQLFields","createFieldConverters","createValidators","createDefaultStorageTransform","createObjectStorageTransform","createDynamicZoneStorageTransform"],"sources":["index.ts"],"sourcesContent":["import { createGraphQL as baseCreateGraphQL, CreateGraphQLParams } from \"~/graphql\";\nimport { createDefaultModelManager } from \"~/modelManager\";\nimport { createGraphQLFields } from \"~/graphqlFields\";\nimport { createValidators } from \"~/validators\";\nimport { createDefaultStorageTransform } from \"~/storage/default\";\nimport { createObjectStorageTransform } from \"~/storage/object\";\nimport { createDynamicZoneStorageTransform } from \"~/graphqlFields/dynamicZone/dynamicZoneStorage\";\nimport {\n createContextParameterPlugin,\n createHeaderParameterPlugin,\n createPathParameterPlugin\n} from \"~/parameters\";\nimport { createContextPlugin, CrudParams } from \"~/context\";\nimport {\n entryFieldFromStorageTransform,\n entryFromStorageTransform,\n entryToStorageTransform\n} from \"./utils/entryStorage\";\nimport { createFieldConverters } from \"~/fieldConverters\";\n\nexport type CreateHeadlessCmsGraphQLParams = CreateGraphQLParams;\nexport const createHeadlessCmsGraphQL = (params: CreateHeadlessCmsGraphQLParams = {}) => {\n return [\n /**\n * PathParameter plugins are used to determine the type of the cms endpoint\n */\n createPathParameterPlugin(),\n createHeaderParameterPlugin(),\n createContextParameterPlugin(),\n /**\n * At this point we can create, or not create, CMS GraphQL Schema.\n */\n ...baseCreateGraphQL(params)\n ];\n};\n\nexport type ContentContextParams = CrudParams;\nexport const createHeadlessCmsContext = (params: ContentContextParams) => {\n return [\n /**\n * Context for all Lambdas - everything is loaded now.\n */\n createContextPlugin(params),\n createDefaultModelManager(),\n createGraphQLFields(),\n createFieldConverters(),\n createValidators(),\n createDefaultStorageTransform(),\n createObjectStorageTransform(),\n createDynamicZoneStorageTransform()\n ];\n};\nexport * from \"~/graphqlFields\";\nexport * from \"~/plugins\";\nexport * from \"~/utils/incrementEntryIdVersion\";\nexport * from \"./graphql/handleRequest\";\nexport { entryToStorageTransform, entryFieldFromStorageTransform, entryFromStorageTransform };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AAkDA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAjDA;AACA;AACA;AACA;AACA;AAKA;AACA;AAKA;AAmCA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AACA;AAAA;EAAA;EAAA;EAAA;EAAA;IAAA;IAAA;MAAA;IAAA;EAAA;AAAA;AAlCO,MAAMA,wBAAwB,GAAG,CAACC,MAAsC,GAAG,CAAC,CAAC,KAAK;EACrF,OAAO;EACH;AACR;AACA;EACQ,IAAAC,qCAAyB,GAAE,EAC3B,IAAAC,uCAA2B,GAAE,EAC7B,IAAAC,wCAA4B,GAAE;EAC9B;AACR;AACA;EACQ,GAAG,IAAAC,sBAAiB,EAACJ,MAAM,CAAC,CAC/B;AACL,CAAC;AAAC;AAGK,MAAMK,wBAAwB,GAAIL,MAA4B,IAAK;EACtE,OAAO;EACH;AACR;AACA;EACQ,IAAAM,4BAAmB,EAACN,MAAM,CAAC,EAC3B,IAAAO,uCAAyB,GAAE,EAC3B,IAAAC,kCAAmB,GAAE,EACrB,IAAAC,sCAAqB,GAAE,EACvB,IAAAC,4BAAgB,GAAE,EAClB,IAAAC,sCAA6B,GAAE,EAC/B,IAAAC,oCAA4B,GAAE,EAC9B,IAAAC,qDAAiC,GAAE,CACtC;AACL,CAAC;AAAC"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.DefaultCmsModelManager = void 0;
|
|
9
|
-
|
|
10
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
11
|
-
|
|
12
9
|
var _utils = require("@webiny/utils");
|
|
13
|
-
|
|
14
10
|
class DefaultCmsModelManager {
|
|
15
11
|
constructor(context, model) {
|
|
16
12
|
(0, _defineProperty2.default)(this, "_context", void 0);
|
|
@@ -18,47 +14,35 @@ class DefaultCmsModelManager {
|
|
|
18
14
|
this._context = context;
|
|
19
15
|
this._model = model;
|
|
20
16
|
}
|
|
21
|
-
|
|
22
17
|
async create(data) {
|
|
23
18
|
return this._context.cms.createEntry(this._model, data);
|
|
24
19
|
}
|
|
25
|
-
|
|
26
20
|
async delete(id) {
|
|
27
21
|
const {
|
|
28
22
|
version
|
|
29
23
|
} = (0, _utils.parseIdentifier)(id);
|
|
30
|
-
|
|
31
24
|
if (version) {
|
|
32
25
|
return this._context.cms.deleteEntryRevision(this._model, id);
|
|
33
26
|
}
|
|
34
|
-
|
|
35
27
|
return this._context.cms.deleteEntry(this._model, id);
|
|
36
28
|
}
|
|
37
|
-
|
|
38
29
|
async get(id) {
|
|
39
30
|
return this._context.cms.getEntryById(this._model, id);
|
|
40
31
|
}
|
|
41
|
-
|
|
42
32
|
async listPublished(params) {
|
|
43
33
|
return this._context.cms.listPublishedEntries(this._model, params);
|
|
44
34
|
}
|
|
45
|
-
|
|
46
35
|
async listLatest(params) {
|
|
47
36
|
return this._context.cms.listLatestEntries(this._model, params);
|
|
48
37
|
}
|
|
49
|
-
|
|
50
38
|
async getPublishedByIds(ids) {
|
|
51
39
|
return this._context.cms.getPublishedEntriesByIds(this._model, ids);
|
|
52
40
|
}
|
|
53
|
-
|
|
54
41
|
async getLatestByIds(ids) {
|
|
55
42
|
return this._context.cms.getLatestEntriesByIds(this._model, ids);
|
|
56
43
|
}
|
|
57
|
-
|
|
58
44
|
async update(id, data) {
|
|
59
45
|
return this._context.cms.updateEntry(this._model, id, data);
|
|
60
46
|
}
|
|
61
|
-
|
|
62
47
|
}
|
|
63
|
-
|
|
64
48
|
exports.DefaultCmsModelManager = DefaultCmsModelManager;
|
|
@@ -1 +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":"
|
|
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,sBAAsB,CAA4B;EAIpDC,WAAW,CAACC,OAAmB,EAAEC,KAAe,EAAE;IAAA;IAAA;IACrD,IAAI,CAACC,QAAQ,GAAGF,OAAO;IACvB,IAAI,CAACG,MAAM,GAAGF,KAAK;EACvB;EAEA,MAAaG,MAAM,CAACC,IAAyB,EAAE;IAC3C,OAAO,IAAI,CAACH,QAAQ,CAACI,GAAG,CAACC,WAAW,CAAC,IAAI,CAACJ,MAAM,EAAEE,IAAI,CAAC;EAC3D;EAEA,MAAaG,MAAM,CAACC,EAAU,EAAE;IAC5B,MAAM;MAAEC;IAAQ,CAAC,GAAG,IAAAC,sBAAe,EAACF,EAAE,CAAC;IACvC,IAAIC,OAAO,EAAE;MACT,OAAO,IAAI,CAACR,QAAQ,CAACI,GAAG,CAACM,mBAAmB,CAAC,IAAI,CAACT,MAAM,EAAEM,EAAE,CAAC;IACjE;IAEA,OAAO,IAAI,CAACP,QAAQ,CAACI,GAAG,CAACO,WAAW,CAAC,IAAI,CAACV,MAAM,EAAEM,EAAE,CAAC;EACzD;EAEA,MAAaK,GAAG,CAACL,EAAU,EAAE;IACzB,OAAO,IAAI,CAACP,QAAQ,CAACI,GAAG,CAACS,YAAY,CAAC,IAAI,CAACZ,MAAM,EAAEM,EAAE,CAAC;EAC1D;EAEA,MAAaO,aAAa,CAACC,MAA0B,EAAE;IACnD,OAAO,IAAI,CAACf,QAAQ,CAACI,GAAG,CAACY,oBAAoB,CAAC,IAAI,CAACf,MAAM,EAAEc,MAAM,CAAC;EACtE;EAEA,MAAaE,UAAU,CAACF,MAA0B,EAAE;IAChD,OAAO,IAAI,CAACf,QAAQ,CAACI,GAAG,CAACc,iBAAiB,CAAC,IAAI,CAACjB,MAAM,EAAEc,MAAM,CAAC;EACnE;EAEA,MAAaI,iBAAiB,CAACC,GAAa,EAAE;IAC1C,OAAO,IAAI,CAACpB,QAAQ,CAACI,GAAG,CAACiB,wBAAwB,CAAC,IAAI,CAACpB,MAAM,EAAEmB,GAAG,CAAC;EACvE;EAEA,MAAaE,cAAc,CAACF,GAAa,EAAE;IACvC,OAAO,IAAI,CAACpB,QAAQ,CAACI,GAAG,CAACmB,qBAAqB,CAAC,IAAI,CAACtB,MAAM,EAAEmB,GAAG,CAAC;EACpE;EAEA,MAAaI,MAAM,CAACjB,EAAU,EAAEJ,IAAyB,EAAE;IACvD,OAAO,IAAI,CAACH,QAAQ,CAACI,GAAG,CAACqB,WAAW,CAAC,IAAI,CAACxB,MAAM,EAAEM,EAAE,EAAEJ,IAAI,CAAC;EAC/D;AACJ;AAAC"}
|
package/modelManager/index.js
CHANGED
|
@@ -4,9 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createDefaultModelManager = void 0;
|
|
7
|
-
|
|
8
7
|
var _DefaultCmsModelManager = require("./DefaultCmsModelManager");
|
|
9
|
-
|
|
10
8
|
const plugin = {
|
|
11
9
|
type: "cms-content-model-manager",
|
|
12
10
|
name: "content-model-manager-default",
|
|
@@ -14,7 +12,5 @@ const plugin = {
|
|
|
14
12
|
return new _DefaultCmsModelManager.DefaultCmsModelManager(context, model);
|
|
15
13
|
}
|
|
16
14
|
};
|
|
17
|
-
|
|
18
15
|
const createDefaultModelManager = () => plugin;
|
|
19
|
-
|
|
20
16
|
exports.createDefaultModelManager = createDefaultModelManager;
|
|
@@ -1 +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":"
|
|
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,2BAA2B;EACjCC,IAAI,EAAE,+BAA+B;EACrCC,MAAM,EAAE,OAAOC,OAAO,EAAEC,KAAK,KAAK;IAC9B,OAAO,IAAIC,8CAAsB,CAACF,OAAO,EAAEC,KAAK,CAAC;EACrD;AACJ,CAAC;AAEM,MAAME,yBAAyB,GAAG,MAAMP,MAAM;AAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/api-headless-cms",
|
|
3
|
-
"version": "0.0.0-unstable.
|
|
3
|
+
"version": "0.0.0-unstable.99666aeb00",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cms:base"
|
|
@@ -18,28 +18,23 @@
|
|
|
18
18
|
],
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@babel/runtime": "7.
|
|
22
|
-
"@commodo/fields": "1.1.2-beta.20",
|
|
21
|
+
"@babel/runtime": "7.20.13",
|
|
23
22
|
"@graphql-tools/schema": "7.1.5",
|
|
24
|
-
"@webiny/api": "0.0.0-unstable.
|
|
25
|
-
"@webiny/api-
|
|
26
|
-
"@webiny/api-
|
|
27
|
-
"@webiny/api-
|
|
28
|
-
"@webiny/
|
|
29
|
-
"@webiny/
|
|
30
|
-
"@webiny/
|
|
31
|
-
"@webiny/
|
|
32
|
-
"@webiny/handler": "0.0.0-unstable.
|
|
33
|
-
"@webiny/
|
|
34
|
-
"@webiny/
|
|
35
|
-
"@webiny/
|
|
36
|
-
"@webiny/
|
|
37
|
-
"@webiny/pubsub": "0.0.0-unstable.97a151f74d",
|
|
38
|
-
"@webiny/utils": "0.0.0-unstable.97a151f74d",
|
|
39
|
-
"@webiny/validation": "0.0.0-unstable.97a151f74d",
|
|
23
|
+
"@webiny/api": "0.0.0-unstable.99666aeb00",
|
|
24
|
+
"@webiny/api-i18n": "0.0.0-unstable.99666aeb00",
|
|
25
|
+
"@webiny/api-security": "0.0.0-unstable.99666aeb00",
|
|
26
|
+
"@webiny/api-tenancy": "0.0.0-unstable.99666aeb00",
|
|
27
|
+
"@webiny/error": "0.0.0-unstable.99666aeb00",
|
|
28
|
+
"@webiny/handler": "0.0.0-unstable.99666aeb00",
|
|
29
|
+
"@webiny/handler-aws": "0.0.0-unstable.99666aeb00",
|
|
30
|
+
"@webiny/handler-db": "0.0.0-unstable.99666aeb00",
|
|
31
|
+
"@webiny/handler-graphql": "0.0.0-unstable.99666aeb00",
|
|
32
|
+
"@webiny/plugins": "0.0.0-unstable.99666aeb00",
|
|
33
|
+
"@webiny/pubsub": "0.0.0-unstable.99666aeb00",
|
|
34
|
+
"@webiny/utils": "0.0.0-unstable.99666aeb00",
|
|
35
|
+
"@webiny/validation": "0.0.0-unstable.99666aeb00",
|
|
40
36
|
"code-frame": "5.0.0",
|
|
41
|
-
"
|
|
42
|
-
"dataloader": "2.1.0",
|
|
37
|
+
"dataloader": "2.2.1",
|
|
43
38
|
"dot-prop": "6.0.1",
|
|
44
39
|
"graphql-tag": "2.12.6",
|
|
45
40
|
"lodash": "4.17.21",
|
|
@@ -47,27 +42,26 @@
|
|
|
47
42
|
"p-reduce": "2.1.0",
|
|
48
43
|
"pluralize": "8.0.0",
|
|
49
44
|
"semver": "6.3.0",
|
|
50
|
-
"slugify": "1.6.5"
|
|
45
|
+
"slugify": "1.6.5",
|
|
46
|
+
"zod": "3.20.2"
|
|
51
47
|
},
|
|
52
48
|
"devDependencies": {
|
|
53
|
-
"@babel/cli": "
|
|
54
|
-
"@babel/core": "
|
|
55
|
-
"@babel/preset-env": "
|
|
56
|
-
"@webiny/api-
|
|
57
|
-
"@webiny/
|
|
58
|
-
"@webiny/
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"ttypescript": "^1.5.12",
|
|
70
|
-
"typescript": "4.7.4"
|
|
49
|
+
"@babel/cli": "7.20.7",
|
|
50
|
+
"@babel/core": "7.20.12",
|
|
51
|
+
"@babel/preset-env": "7.20.2",
|
|
52
|
+
"@webiny/api-wcp": "0.0.0-unstable.99666aeb00",
|
|
53
|
+
"@webiny/cli": "0.0.0-unstable.99666aeb00",
|
|
54
|
+
"@webiny/project-utils": "0.0.0-unstable.99666aeb00",
|
|
55
|
+
"apollo-graphql": "0.9.7",
|
|
56
|
+
"get-yarn-workspaces": "1.0.2",
|
|
57
|
+
"graphql": "15.8.0",
|
|
58
|
+
"jest": "29.5.0",
|
|
59
|
+
"prettier": "2.8.3",
|
|
60
|
+
"rimraf": "3.0.2",
|
|
61
|
+
"sinon": "9.2.4",
|
|
62
|
+
"ttypescript": "1.5.15",
|
|
63
|
+
"typescript": "4.7.4",
|
|
64
|
+
"write-json-file": "4.3.0"
|
|
71
65
|
},
|
|
72
66
|
"publishConfig": {
|
|
73
67
|
"access": "public",
|
|
@@ -77,5 +71,5 @@
|
|
|
77
71
|
"build": "yarn webiny run build",
|
|
78
72
|
"watch": "yarn webiny run watch"
|
|
79
73
|
},
|
|
80
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "99666aeb00056c56292eeb5dbb6aba7fda2439e2"
|
|
81
75
|
}
|
package/parameters/context.js
CHANGED
|
@@ -4,11 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.createContextParameterPlugin = void 0;
|
|
7
|
-
|
|
8
7
|
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
9
|
-
|
|
10
8
|
const DEFAULT_LOCALE_CODE = "en-US";
|
|
11
|
-
|
|
12
9
|
const createContextParameterPlugin = () => {
|
|
13
10
|
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
14
11
|
const locale = context.i18n.getContentLocale();
|
|
@@ -18,5 +15,4 @@ const createContextParameterPlugin = () => {
|
|
|
18
15
|
};
|
|
19
16
|
});
|
|
20
17
|
};
|
|
21
|
-
|
|
22
18
|
exports.createContextParameterPlugin = createContextParameterPlugin;
|
|
@@ -1 +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":"
|
|
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,OAAO;AAE5B,MAAMC,4BAA4B,GAAG,MAAM;EAC9C,OAAO,IAAIC,wCAAmB,CAAC,MAAMC,OAAO,IAAI;IAC5C,MAAMC,MAAM,GAAGD,OAAO,CAACE,IAAI,CAACC,gBAAgB,EAAE;IAC9C,OAAO;MACHF,MAAM,EAAE,CAAAA,MAAM,aAANA,MAAM,uBAANA,MAAM,CAAEG,IAAI,KAAIP,mBAAmB;MAC3CQ,IAAI,EAAE;IACV,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/parameters/header.js
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createHeaderParameterPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
9
|
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
13
|
-
|
|
14
10
|
var HeaderKeys;
|
|
15
|
-
|
|
16
11
|
(function (HeaderKeys) {
|
|
17
12
|
HeaderKeys["TYPE"] = "x-webiny-cms-endpoint";
|
|
18
13
|
HeaderKeys["LOCALE"] = "x-webiny-cms-locale";
|
|
19
14
|
})(HeaderKeys || (HeaderKeys = {}));
|
|
20
|
-
|
|
21
15
|
const createHeaderParameterPlugin = () => {
|
|
22
16
|
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
23
17
|
var _context$request;
|
|
24
|
-
|
|
25
18
|
/**
|
|
26
19
|
* If any of the properties is not defined, just ignore this plugin
|
|
27
20
|
*/
|
|
28
21
|
if (!((_context$request = context.request) !== null && _context$request !== void 0 && _context$request.headers)) {
|
|
29
22
|
return null;
|
|
30
23
|
}
|
|
31
|
-
|
|
32
24
|
const headers = context.request.headers;
|
|
33
25
|
const type = headers[HeaderKeys.TYPE];
|
|
34
26
|
const locale = headers[HeaderKeys.LOCALE];
|
|
35
|
-
|
|
36
27
|
if (!type && !locale) {
|
|
37
28
|
return null;
|
|
38
29
|
} else if (!locale || typeof locale !== "string") {
|
|
@@ -44,12 +35,10 @@ const createHeaderParameterPlugin = () => {
|
|
|
44
35
|
headers
|
|
45
36
|
});
|
|
46
37
|
}
|
|
47
|
-
|
|
48
38
|
return {
|
|
49
39
|
type: type,
|
|
50
40
|
locale
|
|
51
41
|
};
|
|
52
42
|
});
|
|
53
43
|
};
|
|
54
|
-
|
|
55
44
|
exports.createHeaderParameterPlugin = createHeaderParameterPlugin;
|
package/parameters/header.js.map
CHANGED
|
@@ -1 +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":"
|
|
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;AAAoE,IAG/DA,UAAU;AAAA,WAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;AAAA,GAAVA,UAAU,KAAVA,UAAU;AAKR,MAAMC,2BAA2B,GAAG,MAAM;EAC7C,OAAO,IAAIC,wCAAmB,CAAC,MAAMC,OAAO,IAAI;IAAA;IAC5C;AACR;AACA;IACQ,IAAI,sBAACA,OAAO,CAACC,OAAO,6CAAf,iBAAiBC,OAAO,GAAE;MAC3B,OAAO,IAAI;IACf;IAEA,MAAMA,OAAO,GAAGF,OAAO,CAACC,OAAO,CAACC,OAAO;IAEvC,MAAMC,IAAI,GAAGD,OAAO,CAACL,UAAU,CAACO,IAAI,CAAC;IACrC,MAAMC,MAAM,GAAGH,OAAO,CAACL,UAAU,CAACS,MAAM,CAAC;IAEzC,IAAI,CAACH,IAAI,IAAI,CAACE,MAAM,EAAE;MAClB,OAAO,IAAI;IACf,CAAC,MAAM,IAAI,CAACA,MAAM,IAAI,OAAOA,MAAM,KAAK,QAAQ,EAAE;MAC9C,MAAM,IAAIE,cAAW,CAChB,eAAcV,UAAU,CAACO,IAAK,oBAAmBP,UAAU,CAACS,MAAO,IAAG,EACvE,yBAAyB,EACzB;QACIJ;MACJ,CAAC,CACJ;IACL,CAAC,MAAM,IAAI,CAACC,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,EAAE;MAC1C,MAAM,IAAII,cAAW,CAChB,eAAcV,UAAU,CAACS,MAAO,oBAAmBT,UAAU,CAACO,IAAK,IAAG,EACvE,yBAAyB,EACzB;QACIF;MACJ,CAAC,CACJ;IACL;IAEA,OAAO;MACHC,IAAI,EAAEA,IAAmB;MACzBE;IACJ,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/parameters/index.js
CHANGED
|
@@ -3,9 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
|
|
7
6
|
var _manual = require("./manual");
|
|
8
|
-
|
|
9
7
|
Object.keys(_manual).forEach(function (key) {
|
|
10
8
|
if (key === "default" || key === "__esModule") return;
|
|
11
9
|
if (key in exports && exports[key] === _manual[key]) return;
|
|
@@ -16,9 +14,7 @@ Object.keys(_manual).forEach(function (key) {
|
|
|
16
14
|
}
|
|
17
15
|
});
|
|
18
16
|
});
|
|
19
|
-
|
|
20
17
|
var _path = require("./path");
|
|
21
|
-
|
|
22
18
|
Object.keys(_path).forEach(function (key) {
|
|
23
19
|
if (key === "default" || key === "__esModule") return;
|
|
24
20
|
if (key in exports && exports[key] === _path[key]) return;
|
|
@@ -29,9 +25,7 @@ Object.keys(_path).forEach(function (key) {
|
|
|
29
25
|
}
|
|
30
26
|
});
|
|
31
27
|
});
|
|
32
|
-
|
|
33
28
|
var _context = require("./context");
|
|
34
|
-
|
|
35
29
|
Object.keys(_context).forEach(function (key) {
|
|
36
30
|
if (key === "default" || key === "__esModule") return;
|
|
37
31
|
if (key in exports && exports[key] === _context[key]) return;
|
|
@@ -42,9 +36,7 @@ Object.keys(_context).forEach(function (key) {
|
|
|
42
36
|
}
|
|
43
37
|
});
|
|
44
38
|
});
|
|
45
|
-
|
|
46
39
|
var _header = require("./header");
|
|
47
|
-
|
|
48
40
|
Object.keys(_header).forEach(function (key) {
|
|
49
41
|
if (key === "default" || key === "__esModule") return;
|
|
50
42
|
if (key in exports && exports[key] === _header[key]) return;
|
package/parameters/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./manual\";\nexport * from \"./path\";\nexport * from \"./context\";\nexport * from \"./header\";\n"],"mappings":"
|
|
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"}
|
package/parameters/manual.js
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createManualPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
11
|
-
|
|
12
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
13
|
-
|
|
14
10
|
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
15
|
-
|
|
16
11
|
/**
|
|
17
12
|
* This would be used for custom Lambdas when there is no path or header information about the endpoint type and locale.
|
|
18
13
|
*/
|
|
14
|
+
|
|
19
15
|
const createManualPlugin = params => {
|
|
20
16
|
return new _CmsParametersPlugin.CmsParametersPlugin(async () => {
|
|
21
17
|
const {
|
|
@@ -25,7 +21,6 @@ const createManualPlugin = params => {
|
|
|
25
21
|
/**
|
|
26
22
|
* if both of parameters are not existing, just skip this plugin.
|
|
27
23
|
*/
|
|
28
|
-
|
|
29
24
|
if (!type && !locale) {
|
|
30
25
|
return null;
|
|
31
26
|
} else if (!type) {
|
|
@@ -33,12 +28,10 @@ const createManualPlugin = params => {
|
|
|
33
28
|
} else if (!locale) {
|
|
34
29
|
throw new _error.default(`There is defined "endpointType" CMS parameter but no "locale".`, "MALFORMED_LOCALE_TYPE", (0, _objectSpread2.default)({}, params));
|
|
35
30
|
}
|
|
36
|
-
|
|
37
31
|
return {
|
|
38
32
|
type,
|
|
39
33
|
locale
|
|
40
34
|
};
|
|
41
35
|
});
|
|
42
36
|
};
|
|
43
|
-
|
|
44
37
|
exports.createManualPlugin = createManualPlugin;
|
package/parameters/manual.js.map
CHANGED
|
@@ -1 +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":"
|
|
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,MAA0B,IAA0B;EACnF,OAAO,IAAIC,wCAAmB,CAAC,YAAY;IACvC,MAAM;MAAEC,YAAY,EAAEC,IAAI;MAAEC;IAAO,CAAC,GAAGJ,MAAM;IAC7C;AACR;AACA;IACQ,IAAI,CAACG,IAAI,IAAI,CAACC,MAAM,EAAE;MAClB,OAAO,IAAI;IACf,CAAC,MAAM,IAAI,CAACD,IAAI,EAAE;MACd,MAAM,IAAIE,cAAW,CAChB,gEAA+D,EAChE,yBAAyB,kCAElBL,MAAM,EAEhB;IACL,CAAC,MAAM,IAAI,CAACI,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CAChB,gEAA+D,EAChE,uBAAuB,kCAEhBL,MAAM,EAEhB;IACL;IAEA,OAAO;MACHG,IAAI;MACJC;IACJ,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAAC"}
|
package/parameters/path.js
CHANGED
|
@@ -1,38 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createPathParameterPlugin = void 0;
|
|
9
|
-
|
|
10
8
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
|
-
|
|
12
9
|
var _CmsParametersPlugin = require("../plugins/CmsParametersPlugin");
|
|
13
|
-
|
|
14
10
|
const allowedEndpoints = ["manage", "read", "preview"];
|
|
15
|
-
|
|
16
11
|
const createPathParameterPlugin = () => {
|
|
17
12
|
return new _CmsParametersPlugin.CmsParametersPlugin(async context => {
|
|
18
13
|
var _context$request;
|
|
19
|
-
|
|
20
14
|
/**
|
|
21
15
|
* If any of the properties is not defined, just ignore this plugin
|
|
22
16
|
*/
|
|
23
17
|
if (!((_context$request = context.request) !== null && _context$request !== void 0 && _context$request.params)) {
|
|
24
18
|
return null;
|
|
25
19
|
}
|
|
26
|
-
|
|
27
20
|
const {
|
|
28
21
|
type,
|
|
29
22
|
locale
|
|
30
23
|
} = context.request.params;
|
|
31
|
-
|
|
32
24
|
if (!type && !locale) {
|
|
33
25
|
return null;
|
|
34
26
|
}
|
|
35
|
-
|
|
36
27
|
if (!type) {
|
|
37
28
|
throw new _error.default(`Missing request parameter "type".`);
|
|
38
29
|
} else if (!locale) {
|
|
@@ -40,12 +31,10 @@ const createPathParameterPlugin = () => {
|
|
|
40
31
|
} else if (allowedEndpoints.includes(type) === false) {
|
|
41
32
|
throw new _error.default(`Endpoint "${type}" not allowed!`);
|
|
42
33
|
}
|
|
43
|
-
|
|
44
34
|
return {
|
|
45
35
|
type: type,
|
|
46
36
|
locale
|
|
47
37
|
};
|
|
48
38
|
});
|
|
49
39
|
};
|
|
50
|
-
|
|
51
40
|
exports.createPathParameterPlugin = createPathParameterPlugin;
|
package/parameters/path.js.map
CHANGED
|
@@ -1 +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":"
|
|
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,QAAQ,EAAE,MAAM,EAAE,SAAS,CAAC;AAE9D,MAAMC,yBAAyB,GAAG,MAAM;EAC3C,OAAO,IAAIC,wCAAmB,CAAC,MAAMC,OAAO,IAAI;IAAA;IAC5C;AACR;AACA;IACQ,IAAI,sBAACA,OAAO,CAACC,OAAO,6CAAf,iBAAiBC,MAAM,GAAE;MAC1B,OAAO,IAAI;IACf;IAEA,MAAM;MAAEC,IAAI;MAAEC;IAAO,CAAC,GAAGJ,OAAO,CAACC,OAAO,CAACC,MAAuC;IAChF,IAAI,CAACC,IAAI,IAAI,CAACC,MAAM,EAAE;MAClB,OAAO,IAAI;IACf;IAEA,IAAI,CAACD,IAAI,EAAE;MACP,MAAM,IAAIE,cAAW,CAAE,mCAAkC,CAAC;IAC9D,CAAC,MAAM,IAAI,CAACD,MAAM,EAAE;MAChB,MAAM,IAAIC,cAAW,CAAE,qCAAoC,CAAC;IAChE,CAAC,MAAM,IAAIR,gBAAgB,CAACS,QAAQ,CAACH,IAAI,CAAgB,KAAK,KAAK,EAAE;MACjE,MAAM,IAAIE,cAAW,CAAE,aAAYF,IAAK,gBAAe,CAAC;IAC5D;IAEA,OAAO;MACHA,IAAI,EAAEA,IAAmB;MACzBC;IACJ,CAAC;EACL,CAAC,CAAC;AACN,CAAC;AAAC"}
|