@webiny/api-headless-cms 0.0.0-unstable.99666aeb00 → 0.0.0-unstable.a9593f74dd
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 +31 -0
- package/constants.js +51 -2
- package/constants.js.map +1 -1
- package/context.js +50 -45
- package/context.js.map +1 -1
- package/crud/contentEntry/afterDelete.js +3 -1
- package/crud/contentEntry/afterDelete.js.map +1 -1
- package/crud/contentEntry/beforeCreate.js +3 -1
- package/crud/contentEntry/beforeCreate.js.map +1 -1
- package/crud/contentEntry/beforeUpdate.js +3 -1
- package/crud/contentEntry/beforeUpdate.js.map +1 -1
- package/crud/contentEntry/entryDataFactories/createEntryData.d.ts +20 -0
- package/crud/contentEntry/entryDataFactories/createEntryData.js +228 -0
- package/crud/contentEntry/entryDataFactories/createEntryData.js.map +1 -0
- package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.d.ts +21 -0
- package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.js +114 -0
- package/crud/contentEntry/entryDataFactories/createEntryRevisionFromData.js.map +1 -0
- package/crud/contentEntry/entryDataFactories/createPublishEntryData.d.ts +13 -0
- package/crud/contentEntry/entryDataFactories/createPublishEntryData.js +61 -0
- package/crud/contentEntry/entryDataFactories/createPublishEntryData.js.map +1 -0
- package/crud/contentEntry/entryDataFactories/createRepublishEntryData.d.ts +12 -0
- package/crud/contentEntry/entryDataFactories/createRepublishEntryData.js +57 -0
- package/crud/contentEntry/entryDataFactories/createRepublishEntryData.js.map +1 -0
- package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.d.ts +12 -0
- package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.js +38 -0
- package/crud/contentEntry/entryDataFactories/createUnpublishEntryData.js.map +1 -0
- package/crud/contentEntry/entryDataFactories/createUpdateEntryData.d.ts +20 -0
- package/crud/contentEntry/entryDataFactories/createUpdateEntryData.js +122 -0
- package/crud/contentEntry/entryDataFactories/createUpdateEntryData.js.map +1 -0
- package/crud/contentEntry/entryDataFactories/index.d.ts +8 -0
- package/crud/contentEntry/entryDataFactories/index.js +95 -0
- package/crud/contentEntry/entryDataFactories/index.js.map +1 -0
- package/crud/contentEntry/entryDataFactories/mapAndCleanUpdatedInputData.d.ts +5 -0
- package/crud/contentEntry/entryDataFactories/mapAndCleanUpdatedInputData.js +36 -0
- package/crud/contentEntry/entryDataFactories/mapAndCleanUpdatedInputData.js.map +1 -0
- package/crud/contentEntry/entryDataFactories/statuses.d.ts +4 -0
- package/crud/contentEntry/entryDataFactories/statuses.js +15 -0
- package/crud/contentEntry/entryDataFactories/statuses.js.map +1 -0
- package/crud/contentEntry/entryDataValidation.d.ts +4 -2
- package/crud/contentEntry/entryDataValidation.js +223 -45
- package/crud/contentEntry/entryDataValidation.js.map +1 -1
- package/crud/contentEntry/markLockedFields.js +17 -10
- package/crud/contentEntry/markLockedFields.js.map +1 -1
- package/crud/contentEntry/referenceFieldsMapping.d.ts +6 -0
- package/crud/contentEntry/referenceFieldsMapping.js +134 -111
- package/crud/contentEntry/referenceFieldsMapping.js.map +1 -1
- package/crud/contentEntry/searchableFields.js +5 -4
- package/crud/contentEntry/searchableFields.js.map +1 -1
- package/crud/contentEntry.crud.d.ts +1 -4
- package/crud/contentEntry.crud.js +295 -466
- package/crud/contentEntry.crud.js.map +1 -1
- package/crud/contentModel/beforeCreate.d.ts +1 -1
- package/crud/contentModel/beforeCreate.js +11 -9
- package/crud/contentModel/beforeCreate.js.map +1 -1
- package/crud/contentModel/beforeDelete.js +3 -1
- package/crud/contentModel/beforeDelete.js.map +1 -1
- package/crud/contentModel/beforeUpdate.d.ts +1 -1
- package/crud/contentModel/beforeUpdate.js +3 -6
- package/crud/contentModel/beforeUpdate.js.map +1 -1
- package/crud/contentModel/compatibility/modelApiName.js +3 -1
- package/crud/contentModel/compatibility/modelApiName.js.map +1 -1
- package/crud/contentModel/contentModelManagerFactory.js +3 -1
- package/crud/contentModel/contentModelManagerFactory.js.map +1 -1
- package/crud/contentModel/createFieldStorageId.js +3 -1
- package/crud/contentModel/createFieldStorageId.js.map +1 -1
- package/crud/contentModel/defaultFields.js +3 -1
- package/crud/contentModel/defaultFields.js.map +1 -1
- package/crud/contentModel/ensureTypeTag.d.ts +5 -0
- package/crud/contentModel/ensureTypeTag.js +21 -0
- package/crud/contentModel/ensureTypeTag.js.map +1 -0
- package/crud/contentModel/fields/descriptionField.js +4 -2
- package/crud/contentModel/fields/descriptionField.js.map +1 -1
- package/crud/contentModel/fields/imageField.js +6 -8
- package/crud/contentModel/fields/imageField.js.map +1 -1
- package/crud/contentModel/fields/titleField.js +4 -2
- package/crud/contentModel/fields/titleField.js.map +1 -1
- package/crud/contentModel/listModelsFromDatabase.d.ts +10 -0
- package/crud/contentModel/listModelsFromDatabase.js +38 -0
- package/crud/contentModel/listModelsFromDatabase.js.map +1 -0
- package/crud/contentModel/validate/endingAllowed.js +3 -1
- package/crud/contentModel/validate/endingAllowed.js.map +1 -1
- package/crud/contentModel/validate/isModelEndingAllowed.js +4 -2
- package/crud/contentModel/validate/isModelEndingAllowed.js.map +1 -1
- package/crud/contentModel/validate/modelId.js +3 -1
- package/crud/contentModel/validate/modelId.js.map +1 -1
- package/crud/contentModel/validate/pluralApiName.js +3 -1
- package/crud/contentModel/validate/pluralApiName.js.map +1 -1
- package/crud/contentModel/validate/singularApiName.js +3 -1
- package/crud/contentModel/validate/singularApiName.js.map +1 -1
- package/crud/contentModel/validateModel.js +3 -1
- package/crud/contentModel/validateModel.js.map +1 -1
- package/crud/contentModel/validateModelFields.js +7 -6
- package/crud/contentModel/validateModelFields.js.map +1 -1
- package/crud/contentModel/validation.d.ts +531 -210
- package/crud/contentModel/validation.js +71 -11
- package/crud/contentModel/validation.js.map +1 -1
- package/crud/contentModel.crud.js +137 -182
- package/crud/contentModel.crud.js.map +1 -1
- package/crud/contentModelGroup/beforeCreate.d.ts +1 -1
- package/crud/contentModelGroup/beforeCreate.js +15 -1
- package/crud/contentModelGroup/beforeCreate.js.map +1 -1
- package/crud/contentModelGroup/beforeDelete.js +3 -1
- package/crud/contentModelGroup/beforeDelete.js.map +1 -1
- package/crud/contentModelGroup/beforeUpdate.js +3 -1
- package/crud/contentModelGroup/beforeUpdate.js.map +1 -1
- package/crud/contentModelGroup/listGroupsFromDatabase.d.ts +8 -0
- package/crud/contentModelGroup/listGroupsFromDatabase.js +22 -0
- package/crud/contentModelGroup/listGroupsFromDatabase.js.map +1 -0
- package/crud/contentModelGroup/validation.d.ts +9 -6
- package/crud/contentModelGroup/validation.js +5 -2
- package/crud/contentModelGroup/validation.js.map +1 -1
- package/crud/contentModelGroup.crud.d.ts +1 -1
- package/crud/contentModelGroup.crud.js +113 -112
- package/crud/contentModelGroup.crud.js.map +1 -1
- package/crud/system.crud.js +8 -11
- package/crud/system.crud.js.map +1 -1
- package/export/crud/exporting.d.ts +3 -0
- package/export/crud/exporting.js +49 -0
- package/export/crud/exporting.js.map +1 -0
- package/export/crud/importing.d.ts +3 -0
- package/export/crud/importing.js +79 -0
- package/export/crud/importing.js.map +1 -0
- package/export/crud/imports/importData.d.ts +14 -0
- package/export/crud/imports/importData.js +52 -0
- package/export/crud/imports/importData.js.map +1 -0
- package/export/crud/imports/importGroups.d.ts +8 -0
- package/export/crud/imports/importGroups.js +104 -0
- package/export/crud/imports/importGroups.js.map +1 -0
- package/export/crud/imports/importModels.d.ts +8 -0
- package/export/crud/imports/importModels.js +136 -0
- package/export/crud/imports/importModels.js.map +1 -0
- package/export/crud/imports/validateGroups.d.ts +8 -0
- package/export/crud/imports/validateGroups.js +112 -0
- package/export/crud/imports/validateGroups.js.map +1 -0
- package/export/crud/imports/validateInput.d.ts +19 -0
- package/export/crud/imports/validateInput.js +55 -0
- package/export/crud/imports/validateInput.js.map +1 -0
- package/export/crud/imports/validateModels.d.ts +12 -0
- package/export/crud/imports/validateModels.js +203 -0
- package/export/crud/imports/validateModels.js.map +1 -0
- package/export/crud/index.d.ts +4 -0
- package/export/crud/index.js +15 -0
- package/export/crud/index.js.map +1 -0
- package/export/crud/sanitize.d.ts +4 -0
- package/export/crud/sanitize.js +35 -0
- package/export/crud/sanitize.js.map +1 -0
- package/export/graphql/index.d.ts +3 -0
- package/export/graphql/index.js +188 -0
- package/export/graphql/index.js.map +1 -0
- package/export/index.d.ts +2 -0
- package/export/index.js +29 -0
- package/export/index.js.map +1 -0
- package/export/types.d.ts +113 -0
- package/export/types.js +22 -0
- package/export/types.js.map +1 -0
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js +4 -7
- package/fieldConverters/CmsModelDefaultFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js +5 -8
- package/fieldConverters/CmsModelDynamicZoneFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js +47 -38
- package/fieldConverters/CmsModelObjectFieldConverterPlugin.js.map +1 -1
- package/fieldConverters/index.js +3 -1
- package/fieldConverters/index.js.map +1 -1
- package/graphql/buildSchemaPlugins.js +7 -1
- package/graphql/buildSchemaPlugins.js.map +1 -1
- package/graphql/checkEndpointAccess.js +3 -1
- package/graphql/checkEndpointAccess.js.map +1 -1
- package/graphql/createExecutableSchema.js +3 -1
- package/graphql/createExecutableSchema.js.map +1 -1
- package/graphql/createRequestBody.js +3 -1
- package/graphql/createRequestBody.js.map +1 -1
- package/graphql/formatErrorPayload.js +3 -1
- package/graphql/formatErrorPayload.js.map +1 -1
- package/graphql/generateSchema.js +3 -1
- package/graphql/generateSchema.js.map +1 -1
- package/graphql/getSchema.d.ts +0 -1
- package/graphql/getSchema.js +34 -18
- package/graphql/getSchema.js.map +1 -1
- package/graphql/graphQLHandlerFactory.js +3 -1
- package/graphql/graphQLHandlerFactory.js.map +1 -1
- package/graphql/handleRequest.js +3 -5
- package/graphql/handleRequest.js.map +1 -1
- package/graphql/index.d.ts +1 -1
- package/graphql/index.js +4 -2
- package/graphql/index.js.map +1 -1
- package/graphql/schema/baseContentSchema.js +9 -8
- package/graphql/schema/baseContentSchema.js.map +1 -1
- package/graphql/schema/baseSchema.d.ts +2 -3
- package/graphql/schema/baseSchema.js +64 -2
- package/graphql/schema/baseSchema.js.map +1 -1
- package/graphql/schema/contentEntries.js +51 -18
- package/graphql/schema/contentEntries.js.map +1 -1
- package/graphql/schema/contentModelGroups.js +5 -2
- package/graphql/schema/contentModelGroups.js.map +1 -1
- package/graphql/schema/contentModels.js +10 -10
- package/graphql/schema/contentModels.js.map +1 -1
- package/graphql/schema/createFieldResolvers.js +14 -12
- package/graphql/schema/createFieldResolvers.js.map +1 -1
- package/graphql/schema/createFieldTypePluginRecords.js +3 -1
- package/graphql/schema/createFieldTypePluginRecords.js.map +1 -1
- package/graphql/schema/createManageResolvers.js +13 -10
- package/graphql/schema/createManageResolvers.js.map +1 -1
- package/graphql/schema/createManageSDL.js +37 -19
- package/graphql/schema/createManageSDL.js.map +1 -1
- package/graphql/schema/createPreviewResolvers.js +7 -6
- package/graphql/schema/createPreviewResolvers.js.map +1 -1
- package/graphql/schema/createReadResolvers.js +7 -6
- package/graphql/schema/createReadResolvers.js.map +1 -1
- package/graphql/schema/createReadSDL.js +12 -5
- package/graphql/schema/createReadSDL.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreate.d.ts +2 -1
- package/graphql/schema/resolvers/manage/resolveCreate.js +4 -2
- package/graphql/schema/resolvers/manage/resolveCreate.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveCreateFrom.d.ts +2 -1
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js +4 -2
- package/graphql/schema/resolvers/manage/resolveCreateFrom.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDelete.js +4 -2
- package/graphql/schema/resolvers/manage/resolveDelete.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js +4 -2
- package/graphql/schema/resolvers/manage/resolveDeleteMultiple.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGet.js +12 -5
- package/graphql/schema/resolvers/manage/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetByIds.js +3 -1
- package/graphql/schema/resolvers/manage/resolveGetByIds.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js +3 -1
- package/graphql/schema/resolvers/manage/resolveGetRevisions.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js +3 -1
- package/graphql/schema/resolvers/manage/resolveGetUniqueFieldValues.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveList.js +3 -1
- package/graphql/schema/resolvers/manage/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveMove.js +7 -10
- package/graphql/schema/resolvers/manage/resolveMove.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolvePublish.js +3 -1
- package/graphql/schema/resolvers/manage/resolvePublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveRepublish.js +3 -1
- package/graphql/schema/resolvers/manage/resolveRepublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUnpublish.js +3 -1
- package/graphql/schema/resolvers/manage/resolveUnpublish.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveUpdate.d.ts +2 -1
- package/graphql/schema/resolvers/manage/resolveUpdate.js +4 -2
- package/graphql/schema/resolvers/manage/resolveUpdate.js.map +1 -1
- package/graphql/schema/resolvers/manage/resolveValidate.d.ts +8 -0
- package/graphql/schema/resolvers/manage/resolveValidate.js +20 -0
- package/graphql/schema/resolvers/manage/resolveValidate.js.map +1 -0
- package/graphql/schema/resolvers/preview/resolveGet.js +6 -5
- package/graphql/schema/resolvers/preview/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/preview/resolveList.js +3 -1
- package/graphql/schema/resolvers/preview/resolveList.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveGet.js +6 -5
- package/graphql/schema/resolvers/read/resolveGet.js.map +1 -1
- package/graphql/schema/resolvers/read/resolveList.js +3 -1
- package/graphql/schema/resolvers/read/resolveList.js.map +1 -1
- package/graphql/schema/schemaPlugins.js +3 -1
- package/graphql/schema/schemaPlugins.js.map +1 -1
- package/graphql/system.js +3 -1
- package/graphql/system.js.map +1 -1
- package/graphqlFields/boolean.js +3 -1
- package/graphqlFields/boolean.js.map +1 -1
- package/graphqlFields/datetime.js +5 -5
- package/graphqlFields/datetime.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneField.js +42 -19
- package/graphqlFields/dynamicZone/dynamicZoneField.js.map +1 -1
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js +60 -12
- package/graphqlFields/dynamicZone/dynamicZoneStorage.js.map +1 -1
- package/graphqlFields/dynamicZone/index.js +3 -1
- package/graphqlFields/dynamicZone/index.js.map +1 -1
- package/graphqlFields/file.js +3 -1
- package/graphqlFields/file.js.map +1 -1
- package/graphqlFields/helpers.d.ts +0 -1
- package/graphqlFields/helpers.js +6 -18
- package/graphqlFields/helpers.js.map +1 -1
- package/graphqlFields/index.js +5 -2
- package/graphqlFields/index.js.map +1 -1
- package/graphqlFields/json.d.ts +2 -0
- package/graphqlFields/json.js +49 -0
- package/graphqlFields/json.js.map +1 -0
- package/graphqlFields/longText.js +14 -3
- package/graphqlFields/longText.js.map +1 -1
- package/graphqlFields/number.js +3 -1
- package/graphqlFields/number.js.map +1 -1
- package/graphqlFields/object.js +24 -44
- package/graphqlFields/object.js.map +1 -1
- package/graphqlFields/ref.js +28 -16
- package/graphqlFields/ref.js.map +1 -1
- package/graphqlFields/richText/RichTextPluginsProcessor.d.ts +6 -0
- package/graphqlFields/richText/RichTextPluginsProcessor.js +34 -0
- package/graphqlFields/richText/RichTextPluginsProcessor.js.map +1 -0
- package/graphqlFields/richText/richTextResolver.d.ts +7 -0
- package/graphqlFields/richText/richTextResolver.js +39 -0
- package/graphqlFields/richText/richTextResolver.js.map +1 -0
- package/graphqlFields/richText.js +11 -3
- package/graphqlFields/richText.js.map +1 -1
- package/graphqlFields/text.js +3 -1
- package/graphqlFields/text.js.map +1 -1
- package/htmlRenderer/LexicalRenderer.d.ts +5 -0
- package/htmlRenderer/LexicalRenderer.js +28 -0
- package/htmlRenderer/LexicalRenderer.js.map +1 -0
- package/htmlRenderer/createLexicalHTMLRenderer.d.ts +2 -0
- package/htmlRenderer/createLexicalHTMLRenderer.js +31 -0
- package/htmlRenderer/createLexicalHTMLRenderer.js.map +1 -0
- package/index.d.ts +2 -1
- package/index.js +20 -5
- package/index.js.map +1 -1
- package/modelManager/DefaultCmsModelManager.js +3 -5
- package/modelManager/DefaultCmsModelManager.js.map +1 -1
- package/modelManager/index.js +3 -1
- package/modelManager/index.js.map +1 -1
- package/package.json +27 -26
- package/parameters/context.js +4 -2
- package/parameters/context.js.map +1 -1
- package/parameters/header.js +7 -6
- package/parameters/header.js.map +1 -1
- package/parameters/index.js +3 -1
- package/parameters/index.js.map +1 -1
- package/parameters/manual.js +9 -4
- package/parameters/manual.js.map +1 -1
- package/parameters/path.js +4 -3
- package/parameters/path.js.map +1 -1
- package/plugins/CmsGraphQLSchemaPlugin.js +5 -4
- package/plugins/CmsGraphQLSchemaPlugin.js.map +1 -1
- package/plugins/CmsGraphQLSchemaSorterPlugin.js +4 -5
- package/plugins/CmsGraphQLSchemaSorterPlugin.js.map +1 -1
- package/plugins/CmsGroupPlugin.d.ts +6 -3
- package/plugins/CmsGroupPlugin.js +8 -6
- package/plugins/CmsGroupPlugin.js.map +1 -1
- package/plugins/CmsModelFieldConverterPlugin.js +5 -4
- package/plugins/CmsModelFieldConverterPlugin.js.map +1 -1
- package/plugins/CmsModelPlugin.d.ts +6 -4
- package/plugins/CmsModelPlugin.js +56 -27
- package/plugins/CmsModelPlugin.js.map +1 -1
- package/plugins/CmsParametersPlugin.js +7 -4
- package/plugins/CmsParametersPlugin.js.map +1 -1
- package/plugins/CmsRichTextRendererPlugin.d.ts +24 -0
- package/plugins/CmsRichTextRendererPlugin.js +28 -0
- package/plugins/CmsRichTextRendererPlugin.js.map +1 -0
- package/plugins/StorageOperationsCmsModelPlugin.js +5 -6
- package/plugins/StorageOperationsCmsModelPlugin.js.map +1 -1
- package/plugins/StorageTransformPlugin.d.ts +2 -2
- package/plugins/StorageTransformPlugin.js +3 -4
- package/plugins/StorageTransformPlugin.js.map +1 -1
- package/plugins/index.d.ts +1 -0
- package/plugins/index.js +14 -1
- package/plugins/index.js.map +1 -1
- package/storage/default.js +3 -1
- package/storage/default.js.map +1 -1
- package/storage/index.d.ts +1 -0
- package/storage/index.js +15 -0
- package/storage/index.js.map +1 -0
- package/storage/json.d.ts +2 -0
- package/storage/json.js +27 -0
- package/storage/json.js.map +1 -0
- package/storage/object.js +8 -8
- package/storage/object.js.map +1 -1
- package/types.d.ts +300 -260
- package/types.js +9 -20
- package/types.js.map +1 -1
- package/utils/access.d.ts +9 -0
- package/utils/access.js +26 -0
- package/utils/access.js.map +1 -0
- package/utils/caching/Cache.d.ts +2 -0
- package/utils/caching/Cache.js +51 -0
- package/utils/caching/Cache.js.map +1 -0
- package/utils/caching/CacheKey.d.ts +2 -0
- package/utils/caching/CacheKey.js +40 -0
- package/utils/caching/CacheKey.js.map +1 -0
- package/utils/caching/index.d.ts +2 -0
- package/utils/caching/index.js +29 -0
- package/utils/caching/index.js.map +1 -0
- package/utils/caching/types.d.ts +11 -0
- package/utils/caching/types.js +7 -0
- package/utils/caching/types.js.map +1 -0
- package/utils/converters/Converter.js +4 -5
- package/utils/converters/Converter.js.map +1 -1
- package/utils/converters/ConverterCollection.js +13 -7
- package/utils/converters/ConverterCollection.js.map +1 -1
- package/utils/converters/valueKeyStorageConverter.js +11 -4
- package/utils/converters/valueKeyStorageConverter.js.map +1 -1
- package/utils/createTypeFromFields.js +6 -1
- package/utils/createTypeFromFields.js.map +1 -1
- package/utils/createTypeName.js +3 -1
- package/utils/createTypeName.js.map +1 -1
- package/utils/date.d.ts +10 -0
- package/utils/date.js +36 -0
- package/utils/date.js.map +1 -0
- package/utils/entryStorage.d.ts +4 -4
- package/utils/entryStorage.js +6 -4
- package/utils/entryStorage.js.map +1 -1
- package/utils/filterAsync.js +9 -8
- package/utils/filterAsync.js.map +1 -1
- package/utils/getBaseFieldType.js +3 -1
- package/utils/getBaseFieldType.js.map +1 -1
- package/utils/getEntryDescription.js +3 -1
- package/utils/getEntryDescription.js.map +1 -1
- package/utils/getEntryImage.js +3 -1
- package/utils/getEntryImage.js.map +1 -1
- package/utils/getEntryTitle.js +3 -1
- package/utils/getEntryTitle.js.map +1 -1
- package/utils/getSchemaFromFieldPlugins.d.ts +13 -2
- package/utils/getSchemaFromFieldPlugins.js +22 -4
- package/utils/getSchemaFromFieldPlugins.js.map +1 -1
- package/utils/identity.d.ts +2 -0
- package/utils/identity.js +20 -0
- package/utils/identity.js.map +1 -0
- package/utils/incrementEntryIdVersion.js +3 -1
- package/utils/incrementEntryIdVersion.js.map +1 -1
- package/utils/index.d.ts +1 -0
- package/utils/index.js +18 -0
- package/utils/index.js.map +1 -0
- package/utils/permissions/EntriesPermissions.js +3 -1
- package/utils/permissions/EntriesPermissions.js.map +1 -1
- package/utils/permissions/ModelGroupsPermissions.d.ts +3 -5
- package/utils/permissions/ModelGroupsPermissions.js +8 -6
- package/utils/permissions/ModelGroupsPermissions.js.map +1 -1
- package/utils/permissions/ModelsPermissions.d.ts +9 -7
- package/utils/permissions/ModelsPermissions.js +5 -6
- package/utils/permissions/ModelsPermissions.js.map +1 -1
- package/utils/renderFields.js +3 -1
- package/utils/renderFields.js.map +1 -1
- package/utils/renderGetFilterFields.js +5 -4
- package/utils/renderGetFilterFields.js.map +1 -1
- package/utils/renderInputFields.js +3 -1
- package/utils/renderInputFields.js.map +1 -1
- package/utils/renderListFilterFields.js +12 -4
- package/utils/renderListFilterFields.js.map +1 -1
- package/utils/renderSortEnum.js +5 -2
- package/utils/renderSortEnum.js.map +1 -1
- package/utils/toSlug.js +3 -1
- package/utils/toSlug.js.map +1 -1
- package/validators/dateGte.js +3 -1
- package/validators/dateGte.js.map +1 -1
- package/validators/dateLte.js +3 -1
- package/validators/dateLte.js.map +1 -1
- package/validators/gte.js +4 -3
- package/validators/gte.js.map +1 -1
- package/validators/in.js +4 -3
- package/validators/in.js.map +1 -1
- package/validators/index.js +4 -3
- package/validators/index.js.map +1 -1
- package/validators/lte.js +4 -3
- package/validators/lte.js.map +1 -1
- package/validators/maxLength.js +4 -3
- package/validators/maxLength.js.map +1 -1
- package/validators/minLength.js +4 -3
- package/validators/minLength.js.map +1 -1
- package/validators/pattern.js +5 -3
- package/validators/pattern.js.map +1 -1
- package/validators/patternPlugins/email.js +3 -1
- package/validators/patternPlugins/email.js.map +1 -1
- package/validators/patternPlugins/index.js +3 -1
- package/validators/patternPlugins/index.js.map +1 -1
- package/validators/patternPlugins/lowerCase.js +3 -1
- package/validators/patternPlugins/lowerCase.js.map +1 -1
- package/validators/patternPlugins/lowerCaseSpace.js +3 -1
- package/validators/patternPlugins/lowerCaseSpace.js.map +1 -1
- package/validators/patternPlugins/upperCase.js +3 -1
- package/validators/patternPlugins/upperCase.js.map +1 -1
- package/validators/patternPlugins/upperCaseSpace.js +3 -1
- package/validators/patternPlugins/upperCaseSpace.js.map +1 -1
- package/validators/patternPlugins/url.js +3 -1
- package/validators/patternPlugins/url.js.map +1 -1
- package/validators/required.js +3 -1
- package/validators/required.js.map +1 -1
- package/validators/timeGte.js +4 -3
- package/validators/timeGte.js.map +1 -1
- package/validators/timeLte.js +4 -3
- package/validators/timeLte.js.map +1 -1
- package/validators/unique.js +4 -2
- package/validators/unique.js.map +1 -1
- package/crud/contentModel/afterCreate.d.ts +0 -8
- package/crud/contentModel/afterCreate.js +0 -16
- package/crud/contentModel/afterCreate.js.map +0 -1
- package/crud/contentModel/afterCreateFrom.d.ts +0 -8
- package/crud/contentModel/afterCreateFrom.js +0 -16
- package/crud/contentModel/afterCreateFrom.js.map +0 -1
- package/crud/contentModel/afterDelete.d.ts +0 -8
- package/crud/contentModel/afterDelete.js +0 -16
- package/crud/contentModel/afterDelete.js.map +0 -1
- package/crud/contentModel/afterUpdate.d.ts +0 -8
- package/crud/contentModel/afterUpdate.js +0 -16
- package/crud/contentModel/afterUpdate.js.map +0 -1
- package/crud/contentModel/validateLayout.d.ts +0 -2
- package/crud/contentModel/validateLayout.js +0 -28
- package/crud/contentModel/validateLayout.js.map +0 -1
- package/crud/settings.crud.d.ts +0 -12
- package/crud/settings.crud.js +0 -62
- package/crud/settings.crud.js.map +0 -1
- package/graphql/schema/resolvers/commonFieldResolvers.d.ts +0 -7
- package/graphql/schema/resolvers/commonFieldResolvers.js +0 -13
- package/graphql/schema/resolvers/commonFieldResolvers.js.map +0 -1
- package/utils/permissions/SettingsPermissions.d.ts +0 -4
- package/utils/permissions/SettingsPermissions.js +0 -9
- package/utils/permissions/SettingsPermissions.js.map +0 -1
- package/validators/dynamicZone.d.ts +0 -2
- package/validators/dynamicZone.js +0 -20
- package/validators/dynamicZone.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createExecutableSchema","params","plugins","typeDefs","resolvers","plugin","push","schema","makeExecutableSchema"],"sources":["createExecutableSchema.ts"],"sourcesContent":["import { makeExecutableSchema } from \"@graphql-tools/schema\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\n\ninterface Params {\n plugins: CmsGraphQLSchemaPlugin[];\n}\n\nexport const createExecutableSchema = (params: Params) => {\n const { plugins } = params;\n /**\n * Really hard to type this to satisfy the makeExecutableSchema\n */\n // TODO @ts-refactor\n const typeDefs: any = [];\n const resolvers: any = [];\n\n // Get schema definitions from plugins\n for (const plugin of plugins) {\n typeDefs.push(plugin.schema.typeDefs);\n resolvers.push(plugin.schema.resolvers);\n }\n\n return makeExecutableSchema({\n typeDefs,\n resolvers\n });\n};\n"],"mappings":";;;;;;AAAA;AAOO,
|
|
1
|
+
{"version":3,"names":["_schema","require","createExecutableSchema","params","plugins","typeDefs","resolvers","plugin","push","schema","makeExecutableSchema","exports"],"sources":["createExecutableSchema.ts"],"sourcesContent":["import { makeExecutableSchema } from \"@graphql-tools/schema\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\n\ninterface Params {\n plugins: CmsGraphQLSchemaPlugin[];\n}\n\nexport const createExecutableSchema = (params: Params) => {\n const { plugins } = params;\n /**\n * Really hard to type this to satisfy the makeExecutableSchema\n */\n // TODO @ts-refactor\n const typeDefs: any = [];\n const resolvers: any = [];\n\n // Get schema definitions from plugins\n for (const plugin of plugins) {\n typeDefs.push(plugin.schema.typeDefs);\n resolvers.push(plugin.schema.resolvers);\n }\n\n return makeExecutableSchema({\n typeDefs,\n resolvers\n });\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAOO,MAAMC,sBAAsB,GAAIC,MAAc,IAAK;EACtD,MAAM;IAAEC;EAAQ,CAAC,GAAGD,MAAM;EAC1B;AACJ;AACA;EACI;EACA,MAAME,QAAa,GAAG,EAAE;EACxB,MAAMC,SAAc,GAAG,EAAE;;EAEzB;EACA,KAAK,MAAMC,MAAM,IAAIH,OAAO,EAAE;IAC1BC,QAAQ,CAACG,IAAI,CAACD,MAAM,CAACE,MAAM,CAACJ,QAAQ,CAAC;IACrCC,SAAS,CAACE,IAAI,CAACD,MAAM,CAACE,MAAM,CAACH,SAAS,CAAC;EAC3C;EAEA,OAAO,IAAAI,4BAAoB,EAAC;IACxBL,QAAQ;IACRC;EACJ,CAAC,CAAC;AACN,CAAC;AAACK,OAAA,CAAAT,sBAAA,GAAAA,sBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createRequestBody","body","JSON","parse"],"sources":["createRequestBody.ts"],"sourcesContent":["import { GraphQLRequestBody } from \"@webiny/handler-graphql/types\";\n\nexport const createRequestBody = (body: unknown): GraphQLRequestBody | GraphQLRequestBody[] => {\n /**\n * We are trusting that the body payload is correct.\n * The `processRequestBody` will fail if it is not.\n */\n return typeof body === \"string\" ? JSON.parse(body) : body;\n};\n"],"mappings":";;;;;;AAEO,MAAMA,iBAAiB,GAAIC,IAAa,IAAgD;EAC3F;AACJ;AACA;AACA;EACI,OAAO,OAAOA,IAAI,KAAK,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACF,IAAI,CAAC,GAAGA,IAAI;AAC7D,CAAC;
|
|
1
|
+
{"version":3,"names":["createRequestBody","body","JSON","parse","exports"],"sources":["createRequestBody.ts"],"sourcesContent":["import { GraphQLRequestBody } from \"@webiny/handler-graphql/types\";\n\nexport const createRequestBody = (body: unknown): GraphQLRequestBody | GraphQLRequestBody[] => {\n /**\n * We are trusting that the body payload is correct.\n * The `processRequestBody` will fail if it is not.\n */\n return typeof body === \"string\" ? JSON.parse(body) : body;\n};\n"],"mappings":";;;;;;AAEO,MAAMA,iBAAiB,GAAIC,IAAa,IAAgD;EAC3F;AACJ;AACA;AACA;EACI,OAAO,OAAOA,IAAI,KAAK,QAAQ,GAAGC,IAAI,CAACC,KAAK,CAACF,IAAI,CAAC,GAAGA,IAAI;AAC7D,CAAC;AAACG,OAAA,CAAAJ,iBAAA,GAAAA,iBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["formatErrorPayload","error","WebinyError","JSON","stringify","type","message","code","data","name","stack"],"sources":["formatErrorPayload.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nexport const formatErrorPayload = (error: Error): string => {\n if (error instanceof WebinyError) {\n return JSON.stringify({\n type: \"CmsGraphQLWebinyError\",\n message: error.message,\n code: error.code,\n data: error.data\n });\n }\n\n return JSON.stringify({\n type: \"Error\",\n name: error.name,\n message: error.message,\n stack: error.stack\n });\n};\n"],"mappings":";;;;;;;AAAA;AAEO,
|
|
1
|
+
{"version":3,"names":["_error","_interopRequireDefault","require","formatErrorPayload","error","WebinyError","JSON","stringify","type","message","code","data","name","stack","exports"],"sources":["formatErrorPayload.ts"],"sourcesContent":["import WebinyError from \"@webiny/error\";\n\nexport const formatErrorPayload = (error: Error): string => {\n if (error instanceof WebinyError) {\n return JSON.stringify({\n type: \"CmsGraphQLWebinyError\",\n message: error.message,\n code: error.code,\n data: error.data\n });\n }\n\n return JSON.stringify({\n type: \"Error\",\n name: error.name,\n message: error.message,\n stack: error.stack\n });\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEO,MAAMC,kBAAkB,GAAIC,KAAY,IAAa;EACxD,IAAIA,KAAK,YAAYC,cAAW,EAAE;IAC9B,OAAOC,IAAI,CAACC,SAAS,CAAC;MAClBC,IAAI,EAAE,uBAAuB;MAC7BC,OAAO,EAAEL,KAAK,CAACK,OAAO;MACtBC,IAAI,EAAEN,KAAK,CAACM,IAAI;MAChBC,IAAI,EAAEP,KAAK,CAACO;IAChB,CAAC,CAAC;EACN;EAEA,OAAOL,IAAI,CAACC,SAAS,CAAC;IAClBC,IAAI,EAAE,OAAO;IACbI,IAAI,EAAER,KAAK,CAACQ,IAAI;IAChBH,OAAO,EAAEL,KAAK,CAACK,OAAO;IACtBI,KAAK,EAAET,KAAK,CAACS;EACjB,CAAC,CAAC;AACN,CAAC;AAACC,OAAA,CAAAX,kBAAA,GAAAA,kBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["generateSchema","params","context","models","generatedSchemaPlugins","buildSchemaPlugins","ex","console","log","plugins","register","schemaPlugins","byType","CmsGraphQLSchemaPlugin","type","createExecutableSchema"],"sources":["generateSchema.ts"],"sourcesContent":["import { CmsContext, CmsModel } from \"~/types\";\nimport { buildSchemaPlugins } from \"./buildSchemaPlugins\";\nimport { createExecutableSchema } from \"./createExecutableSchema\";\nimport { GraphQLSchema } from \"graphql/type\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\n\ninterface GenerateSchemaParams {\n context: CmsContext;\n models: CmsModel[];\n}\nexport const generateSchema = async (params: GenerateSchemaParams): Promise<GraphQLSchema> => {\n const { context, models } = params;\n\n let generatedSchemaPlugins: CmsGraphQLSchemaPlugin[] = [];\n try {\n generatedSchemaPlugins = await buildSchemaPlugins({ context, models });\n } catch (ex) {\n console.log(`Error while building schema plugins.`);\n throw ex;\n }\n\n context.plugins.register(generatedSchemaPlugins);\n\n const schemaPlugins = context.plugins.byType<CmsGraphQLSchemaPlugin>(\n CmsGraphQLSchemaPlugin.type\n );\n return createExecutableSchema({\n plugins: schemaPlugins\n });\n};\n"],"mappings":";;;;;;AACA;AACA;AAEA;AAMO,
|
|
1
|
+
{"version":3,"names":["_buildSchemaPlugins","require","_createExecutableSchema","_plugins","generateSchema","params","context","models","generatedSchemaPlugins","buildSchemaPlugins","ex","console","log","plugins","register","schemaPlugins","byType","CmsGraphQLSchemaPlugin","type","createExecutableSchema","exports"],"sources":["generateSchema.ts"],"sourcesContent":["import { CmsContext, CmsModel } from \"~/types\";\nimport { buildSchemaPlugins } from \"./buildSchemaPlugins\";\nimport { createExecutableSchema } from \"./createExecutableSchema\";\nimport { GraphQLSchema } from \"graphql/type\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\n\ninterface GenerateSchemaParams {\n context: CmsContext;\n models: CmsModel[];\n}\nexport const generateSchema = async (params: GenerateSchemaParams): Promise<GraphQLSchema> => {\n const { context, models } = params;\n\n let generatedSchemaPlugins: CmsGraphQLSchemaPlugin[] = [];\n try {\n generatedSchemaPlugins = await buildSchemaPlugins({ context, models });\n } catch (ex) {\n console.log(`Error while building schema plugins.`);\n throw ex;\n }\n\n context.plugins.register(generatedSchemaPlugins);\n\n const schemaPlugins = context.plugins.byType<CmsGraphQLSchemaPlugin>(\n CmsGraphQLSchemaPlugin.type\n );\n return createExecutableSchema({\n plugins: schemaPlugins\n });\n};\n"],"mappings":";;;;;;AACA,IAAAA,mBAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAF,OAAA;AAMO,MAAMG,cAAc,GAAG,MAAOC,MAA4B,IAA6B;EAC1F,MAAM;IAAEC,OAAO;IAAEC;EAAO,CAAC,GAAGF,MAAM;EAElC,IAAIG,sBAAgD,GAAG,EAAE;EACzD,IAAI;IACAA,sBAAsB,GAAG,MAAM,IAAAC,sCAAkB,EAAC;MAAEH,OAAO;MAAEC;IAAO,CAAC,CAAC;EAC1E,CAAC,CAAC,OAAOG,EAAE,EAAE;IACTC,OAAO,CAACC,GAAG,CAAE,sCAAqC,CAAC;IACnD,MAAMF,EAAE;EACZ;EAEAJ,OAAO,CAACO,OAAO,CAACC,QAAQ,CAACN,sBAAsB,CAAC;EAEhD,MAAMO,aAAa,GAAGT,OAAO,CAACO,OAAO,CAACG,MAAM,CACxCC,+BAAsB,CAACC,IAC3B,CAAC;EACD,OAAO,IAAAC,8CAAsB,EAAC;IAC1BN,OAAO,EAAEE;EACb,CAAC,CAAC;AACN,CAAC;AAACK,OAAA,CAAAhB,cAAA,GAAAA,cAAA"}
|
package/graphql/getSchema.d.ts
CHANGED
package/graphql/getSchema.js
CHANGED
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.getSchema = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
8
|
var _codeFrame = _interopRequireDefault(require("code-frame"));
|
|
10
9
|
var _error = _interopRequireDefault(require("@webiny/error"));
|
|
11
10
|
var _generateSchema = require("./generateSchema");
|
|
12
|
-
|
|
11
|
+
var _crypto = _interopRequireDefault(require("crypto"));
|
|
12
|
+
// @ts-expect-error `code-frame` has no types
|
|
13
13
|
|
|
14
14
|
const schemaList = new Map();
|
|
15
15
|
|
|
@@ -35,13 +35,22 @@ const generateCacheId = params => {
|
|
|
35
35
|
|
|
36
36
|
const generateCacheKey = async params => {
|
|
37
37
|
const {
|
|
38
|
-
|
|
38
|
+
models
|
|
39
39
|
} = params;
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const keys = [];
|
|
41
|
+
for (const model of models) {
|
|
42
|
+
const savedOn = model.savedOn;
|
|
43
|
+
const value =
|
|
44
|
+
// @ts-expect-error
|
|
45
|
+
savedOn instanceof Date || savedOn?.toISOString ?
|
|
46
|
+
// @ts-expect-error
|
|
47
|
+
savedOn.toISOString() : savedOn || "unknown";
|
|
48
|
+
keys.push(model.modelId, model.singularApiName, model.pluralApiName, value);
|
|
43
49
|
}
|
|
44
|
-
|
|
50
|
+
const key = keys.join("#");
|
|
51
|
+
const hash = _crypto.default.createHash("sha1");
|
|
52
|
+
hash.update(key);
|
|
53
|
+
return hash.digest("hex");
|
|
45
54
|
};
|
|
46
55
|
|
|
47
56
|
/**
|
|
@@ -52,12 +61,6 @@ const getSchema = async params => {
|
|
|
52
61
|
const {
|
|
53
62
|
context
|
|
54
63
|
} = params;
|
|
55
|
-
const cacheId = generateCacheId(params);
|
|
56
|
-
const cacheKey = await generateCacheKey(params);
|
|
57
|
-
const cachedSchema = schemaList.get(cacheId);
|
|
58
|
-
if ((cachedSchema === null || cachedSchema === void 0 ? void 0 : cachedSchema.key) === cacheKey) {
|
|
59
|
-
return cachedSchema.schema;
|
|
60
|
-
}
|
|
61
64
|
|
|
62
65
|
/**
|
|
63
66
|
* We need all the API models.
|
|
@@ -68,10 +71,20 @@ const getSchema = async params => {
|
|
|
68
71
|
return model.isPrivate !== true;
|
|
69
72
|
});
|
|
70
73
|
});
|
|
74
|
+
const cacheId = generateCacheId(params);
|
|
75
|
+
const cacheKey = await generateCacheKey({
|
|
76
|
+
...params,
|
|
77
|
+
models
|
|
78
|
+
});
|
|
79
|
+
const cachedSchema = schemaList.get(cacheId);
|
|
80
|
+
if (cachedSchema?.key === cacheKey) {
|
|
81
|
+
return cachedSchema.schema;
|
|
82
|
+
}
|
|
71
83
|
try {
|
|
72
|
-
const schema = await (0, _generateSchema.generateSchema)(
|
|
84
|
+
const schema = await (0, _generateSchema.generateSchema)({
|
|
85
|
+
...params,
|
|
73
86
|
models
|
|
74
|
-
})
|
|
87
|
+
});
|
|
75
88
|
schemaList.set(cacheId, {
|
|
76
89
|
key: cacheKey,
|
|
77
90
|
schema
|
|
@@ -82,9 +95,10 @@ const getSchema = async params => {
|
|
|
82
95
|
throw new _error.default({
|
|
83
96
|
message: err.message,
|
|
84
97
|
code: err.code || "INVALID_GRAPHQL_SCHEMA_LOCATIONS",
|
|
85
|
-
data:
|
|
98
|
+
data: {
|
|
99
|
+
...(err.data || {}),
|
|
86
100
|
endpoint: context.cms.type
|
|
87
|
-
}
|
|
101
|
+
}
|
|
88
102
|
});
|
|
89
103
|
}
|
|
90
104
|
const [location] = err.locations;
|
|
@@ -99,4 +113,6 @@ const getSchema = async params => {
|
|
|
99
113
|
});
|
|
100
114
|
}
|
|
101
115
|
};
|
|
102
|
-
exports.getSchema = getSchema;
|
|
116
|
+
exports.getSchema = getSchema;
|
|
117
|
+
|
|
118
|
+
//# sourceMappingURL=getSchema.js.map
|
package/graphql/getSchema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["schemaList","Map","generateCacheId","params","getTenant","type","getLocale","id","code","join","generateCacheKey","
|
|
1
|
+
{"version":3,"names":["_codeFrame","_interopRequireDefault","require","_error","_generateSchema","_crypto","schemaList","Map","generateCacheId","params","getTenant","type","getLocale","id","code","join","generateCacheKey","models","keys","model","savedOn","value","Date","toISOString","push","modelId","singularApiName","pluralApiName","key","hash","crypto","createHash","update","digest","getSchema","context","security","withoutAuthorization","cms","listModels","filter","isPrivate","cacheId","cacheKey","cachedSchema","get","schema","generateSchema","set","err","Array","isArray","locations","WebinyError","message","data","endpoint","location","invalidSegment","codeFrame","source","body","line","column","frameSize","exports"],"sources":["getSchema.ts"],"sourcesContent":["// @ts-expect-error `code-frame` has no types\nimport codeFrame from \"code-frame\";\nimport WebinyError from \"@webiny/error\";\nimport { generateSchema } from \"./generateSchema\";\nimport { ApiEndpoint, CmsContext, CmsModel } from \"~/types\";\nimport { Tenant } from \"@webiny/api-tenancy/types\";\nimport { I18NLocale } from \"@webiny/api-i18n/types\";\nimport { GraphQLSchema } from \"graphql\";\nimport crypto from \"crypto\";\n\ninterface SchemaCache {\n key: string;\n schema: GraphQLSchema;\n}\n\ninterface GetSchemaParams {\n context: CmsContext;\n type: ApiEndpoint;\n getTenant: () => Tenant;\n getLocale: () => I18NLocale;\n}\n\nconst schemaList = new Map<string, SchemaCache>();\n\n/**\n * Method generates cache ID based on:\n * - tenant\n * - endpoint type\n * - locale\n */\ntype GenerateCacheIdParams = Pick<GetSchemaParams, \"getTenant\" | \"getLocale\" | \"type\">;\nconst generateCacheId = (params: GenerateCacheIdParams): string => {\n const { getTenant, type, getLocale } = params;\n return [`tenant:${getTenant().id}`, `endpoint:${type}`, `locale:${getLocale().code}`].join(\"#\");\n};\n/**\n * Method generates cache key based on last model change time.\n * Or sets \"unknown\" - possible when no models in database.\n */\ninterface GenerateCacheKeyParams {\n models: Pick<CmsModel, \"modelId\" | \"singularApiName\" | \"pluralApiName\" | \"savedOn\">[];\n}\nconst generateCacheKey = async (params: GenerateCacheKeyParams): Promise<string> => {\n const { models } = params;\n\n const keys: string[] = [];\n for (const model of models) {\n const savedOn = model.savedOn;\n const value =\n // @ts-expect-error\n savedOn instanceof Date || savedOn?.toISOString\n ? // @ts-expect-error\n savedOn.toISOString()\n : savedOn || \"unknown\";\n keys.push(model.modelId, model.singularApiName, model.pluralApiName, value);\n }\n const key = keys.join(\"#\");\n\n const hash = crypto.createHash(\"sha1\");\n hash.update(key);\n return hash.digest(\"hex\");\n};\n\n/**\n * Gets an existing schema or rewrites existing one or creates a completely new one\n * depending on the schemaId created from type and locale parameters\n */\nexport const getSchema = async (params: GetSchemaParams): Promise<GraphQLSchema> => {\n const { context } = params;\n\n /**\n * We need all the API models.\n * Private models are hidden in the GraphQL, so filter them out.\n */\n const models = await context.security.withoutAuthorization(async () => {\n return (await context.cms.listModels()).filter(model => {\n return model.isPrivate !== true;\n });\n });\n\n const cacheId = generateCacheId(params);\n\n const cacheKey = await generateCacheKey({ ...params, models });\n const cachedSchema = schemaList.get(cacheId);\n if (cachedSchema?.key === cacheKey) {\n return cachedSchema.schema;\n }\n\n try {\n const schema = await generateSchema({\n ...params,\n models\n });\n schemaList.set(cacheId, {\n key: cacheKey,\n schema\n });\n return schema;\n } catch (err) {\n if (!Array.isArray(err.locations)) {\n throw new WebinyError({\n message: err.message,\n code: err.code || \"INVALID_GRAPHQL_SCHEMA_LOCATIONS\",\n data: {\n ...(err.data || {}),\n endpoint: context.cms.type\n }\n });\n }\n const [location] = err.locations;\n\n throw new WebinyError({\n code: \"INVALID_GRAPHQL_SCHEMA\",\n message: err.message,\n data: {\n invalidSegment: codeFrame(err.source.body, location.line, location.column, {\n frameSize: 15\n })\n }\n });\n }\n};\n"],"mappings":";;;;;;;AACA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,eAAA,GAAAF,OAAA;AAKA,IAAAG,OAAA,GAAAJ,sBAAA,CAAAC,OAAA;AARA;;AAsBA,MAAMI,UAAU,GAAG,IAAIC,GAAG,CAAsB,CAAC;;AAEjD;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,eAAe,GAAIC,MAA6B,IAAa;EAC/D,MAAM;IAAEC,SAAS;IAAEC,IAAI;IAAEC;EAAU,CAAC,GAAGH,MAAM;EAC7C,OAAO,CAAE,UAASC,SAAS,CAAC,CAAC,CAACG,EAAG,EAAC,EAAG,YAAWF,IAAK,EAAC,EAAG,UAASC,SAAS,CAAC,CAAC,CAACE,IAAK,EAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;AACnG,CAAC;AACD;AACA;AACA;AACA;;AAIA,MAAMC,gBAAgB,GAAG,MAAOP,MAA8B,IAAsB;EAChF,MAAM;IAAEQ;EAAO,CAAC,GAAGR,MAAM;EAEzB,MAAMS,IAAc,GAAG,EAAE;EACzB,KAAK,MAAMC,KAAK,IAAIF,MAAM,EAAE;IACxB,MAAMG,OAAO,GAAGD,KAAK,CAACC,OAAO;IAC7B,MAAMC,KAAK;IACP;IACAD,OAAO,YAAYE,IAAI,IAAIF,OAAO,EAAEG,WAAW;IACzC;IACAH,OAAO,CAACG,WAAW,CAAC,CAAC,GACrBH,OAAO,IAAI,SAAS;IAC9BF,IAAI,CAACM,IAAI,CAACL,KAAK,CAACM,OAAO,EAAEN,KAAK,CAACO,eAAe,EAAEP,KAAK,CAACQ,aAAa,EAAEN,KAAK,CAAC;EAC/E;EACA,MAAMO,GAAG,GAAGV,IAAI,CAACH,IAAI,CAAC,GAAG,CAAC;EAE1B,MAAMc,IAAI,GAAGC,eAAM,CAACC,UAAU,CAAC,MAAM,CAAC;EACtCF,IAAI,CAACG,MAAM,CAACJ,GAAG,CAAC;EAChB,OAAOC,IAAI,CAACI,MAAM,CAAC,KAAK,CAAC;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACO,MAAMC,SAAS,GAAG,MAAOzB,MAAuB,IAA6B;EAChF,MAAM;IAAE0B;EAAQ,CAAC,GAAG1B,MAAM;;EAE1B;AACJ;AACA;AACA;EACI,MAAMQ,MAAM,GAAG,MAAMkB,OAAO,CAACC,QAAQ,CAACC,oBAAoB,CAAC,YAAY;IACnE,OAAO,CAAC,MAAMF,OAAO,CAACG,GAAG,CAACC,UAAU,CAAC,CAAC,EAAEC,MAAM,CAACrB,KAAK,IAAI;MACpD,OAAOA,KAAK,CAACsB,SAAS,KAAK,IAAI;IACnC,CAAC,CAAC;EACN,CAAC,CAAC;EAEF,MAAMC,OAAO,GAAGlC,eAAe,CAACC,MAAM,CAAC;EAEvC,MAAMkC,QAAQ,GAAG,MAAM3B,gBAAgB,CAAC;IAAE,GAAGP,MAAM;IAAEQ;EAAO,CAAC,CAAC;EAC9D,MAAM2B,YAAY,GAAGtC,UAAU,CAACuC,GAAG,CAACH,OAAO,CAAC;EAC5C,IAAIE,YAAY,EAAEhB,GAAG,KAAKe,QAAQ,EAAE;IAChC,OAAOC,YAAY,CAACE,MAAM;EAC9B;EAEA,IAAI;IACA,MAAMA,MAAM,GAAG,MAAM,IAAAC,8BAAc,EAAC;MAChC,GAAGtC,MAAM;MACTQ;IACJ,CAAC,CAAC;IACFX,UAAU,CAAC0C,GAAG,CAACN,OAAO,EAAE;MACpBd,GAAG,EAAEe,QAAQ;MACbG;IACJ,CAAC,CAAC;IACF,OAAOA,MAAM;EACjB,CAAC,CAAC,OAAOG,GAAG,EAAE;IACV,IAAI,CAACC,KAAK,CAACC,OAAO,CAACF,GAAG,CAACG,SAAS,CAAC,EAAE;MAC/B,MAAM,IAAIC,cAAW,CAAC;QAClBC,OAAO,EAAEL,GAAG,CAACK,OAAO;QACpBxC,IAAI,EAAEmC,GAAG,CAACnC,IAAI,IAAI,kCAAkC;QACpDyC,IAAI,EAAE;UACF,IAAIN,GAAG,CAACM,IAAI,IAAI,CAAC,CAAC,CAAC;UACnBC,QAAQ,EAAErB,OAAO,CAACG,GAAG,CAAC3B;QAC1B;MACJ,CAAC,CAAC;IACN;IACA,MAAM,CAAC8C,QAAQ,CAAC,GAAGR,GAAG,CAACG,SAAS;IAEhC,MAAM,IAAIC,cAAW,CAAC;MAClBvC,IAAI,EAAE,wBAAwB;MAC9BwC,OAAO,EAAEL,GAAG,CAACK,OAAO;MACpBC,IAAI,EAAE;QACFG,cAAc,EAAE,IAAAC,kBAAS,EAACV,GAAG,CAACW,MAAM,CAACC,IAAI,EAAEJ,QAAQ,CAACK,IAAI,EAAEL,QAAQ,CAACM,MAAM,EAAE;UACvEC,SAAS,EAAE;QACf,CAAC;MACL;IACJ,CAAC,CAAC;EACN;AACJ,CAAC;AAACC,OAAA,CAAA/B,SAAA,GAAAA,SAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["cmsRoutes","RoutePlugin","onPost","onOptions","context","request","reply","handleRequest","_","status","send","hijack","name","graphQLHandlerFactory","debug","debugPlugins","type"],"sources":["graphQLHandlerFactory.ts"],"sourcesContent":["import debugPlugins from \"@webiny/handler-graphql/debugPlugins\";\nimport { CmsContext } from \"~/types\";\nimport { PluginCollection } from \"@webiny/plugins/types\";\nimport { RoutePlugin } from \"@webiny/handler\";\nimport { handleRequest } from \"./handleRequest\";\n\nexport interface GraphQLHandlerFactoryParams {\n debug?: boolean;\n}\n\nconst cmsRoutes = new RoutePlugin<CmsContext>(({ onPost, onOptions, context }) => {\n onPost(\"/cms/:type(^manage|preview|read$)/:locale\", async (request, reply) => {\n return handleRequest({ context, request, reply });\n });\n\n onOptions(\"/cms/:type(^manage|preview|read$)/:locale\", async (_, reply) => {\n return reply.status(204).send({}).hijack();\n });\n});\n\ncmsRoutes.name = \"headless-cms.graphql.route.default\";\n\nexport const graphQLHandlerFactory = ({ debug }: GraphQLHandlerFactoryParams): PluginCollection => {\n return [\n ...(debug ? debugPlugins() : []),\n cmsRoutes,\n {\n type: \"wcp-telemetry-tracker\"\n }\n ];\n};\n"],"mappings":";;;;;;;AAAA;AAGA;AACA;AAMA,
|
|
1
|
+
{"version":3,"names":["_debugPlugins","_interopRequireDefault","require","_handler","_handleRequest","cmsRoutes","RoutePlugin","onPost","onOptions","context","request","reply","handleRequest","_","status","send","hijack","name","graphQLHandlerFactory","debug","debugPlugins","type","exports"],"sources":["graphQLHandlerFactory.ts"],"sourcesContent":["import debugPlugins from \"@webiny/handler-graphql/debugPlugins\";\nimport { CmsContext } from \"~/types\";\nimport { PluginCollection } from \"@webiny/plugins/types\";\nimport { RoutePlugin } from \"@webiny/handler\";\nimport { handleRequest } from \"./handleRequest\";\n\nexport interface GraphQLHandlerFactoryParams {\n debug?: boolean;\n}\n\nconst cmsRoutes = new RoutePlugin<CmsContext>(({ onPost, onOptions, context }) => {\n onPost(\"/cms/:type(^manage|preview|read$)/:locale\", async (request, reply) => {\n return handleRequest({ context, request, reply });\n });\n\n onOptions(\"/cms/:type(^manage|preview|read$)/:locale\", async (_, reply) => {\n return reply.status(204).send({}).hijack();\n });\n});\n\ncmsRoutes.name = \"headless-cms.graphql.route.default\";\n\nexport const graphQLHandlerFactory = ({ debug }: GraphQLHandlerFactoryParams): PluginCollection => {\n return [\n ...(debug ? debugPlugins() : []),\n cmsRoutes,\n {\n type: \"wcp-telemetry-tracker\"\n }\n ];\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,aAAA,GAAAC,sBAAA,CAAAC,OAAA;AAGA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAMA,MAAMG,SAAS,GAAG,IAAIC,oBAAW,CAAa,CAAC;EAAEC,MAAM;EAAEC,SAAS;EAAEC;AAAQ,CAAC,KAAK;EAC9EF,MAAM,CAAC,2CAA2C,EAAE,OAAOG,OAAO,EAAEC,KAAK,KAAK;IAC1E,OAAO,IAAAC,4BAAa,EAAC;MAAEH,OAAO;MAAEC,OAAO;MAAEC;IAAM,CAAC,CAAC;EACrD,CAAC,CAAC;EAEFH,SAAS,CAAC,2CAA2C,EAAE,OAAOK,CAAC,EAAEF,KAAK,KAAK;IACvE,OAAOA,KAAK,CAACG,MAAM,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC,CAAC,CAAC,CAAC,CAACC,MAAM,CAAC,CAAC;EAC9C,CAAC,CAAC;AACN,CAAC,CAAC;AAEFX,SAAS,CAACY,IAAI,GAAG,oCAAoC;AAE9C,MAAMC,qBAAqB,GAAGA,CAAC;EAAEC;AAAmC,CAAC,KAAuB;EAC/F,OAAO,CACH,IAAIA,KAAK,GAAG,IAAAC,qBAAY,EAAC,CAAC,GAAG,EAAE,CAAC,EAChCf,SAAS,EACT;IACIgB,IAAI,EAAE;EACV,CAAC,CACJ;AACL,CAAC;AAACC,OAAA,CAAAJ,qBAAA,GAAAA,qBAAA"}
|
package/graphql/handleRequest.js
CHANGED
|
@@ -34,15 +34,11 @@ const handleRequest = async params => {
|
|
|
34
34
|
const getLocale = () => {
|
|
35
35
|
return context.cms.getLocale();
|
|
36
36
|
};
|
|
37
|
-
const getLastModifiedTime = async () => {
|
|
38
|
-
return context.cms.getModelLastChange();
|
|
39
|
-
};
|
|
40
37
|
const schema = await context.benchmark.measure("headlessCms.graphql.getSchema", async () => {
|
|
41
38
|
try {
|
|
42
39
|
return await (0, _getSchema.getSchema)({
|
|
43
40
|
context,
|
|
44
41
|
getTenant,
|
|
45
|
-
getLastModifiedTime,
|
|
46
42
|
getLocale,
|
|
47
43
|
type: context.cms.type
|
|
48
44
|
});
|
|
@@ -78,4 +74,6 @@ const handleRequest = async params => {
|
|
|
78
74
|
});
|
|
79
75
|
return reply.code(200).send(result);
|
|
80
76
|
};
|
|
81
|
-
exports.handleRequest = handleRequest;
|
|
77
|
+
exports.handleRequest = handleRequest;
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=handleRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["handleRequest","params","context","request","reply","checkEndpointAccess","ex","code","send","data","error","message","stack","getTenant","tenancy","getCurrentTenant","getLocale","cms","
|
|
1
|
+
{"version":3,"names":["_checkEndpointAccess","require","_createRequestBody","_formatErrorPayload","_getSchema","_handlerGraphql","handleRequest","params","context","request","reply","checkEndpointAccess","ex","code","send","data","error","message","stack","getTenant","tenancy","getCurrentTenant","getLocale","cms","schema","benchmark","measure","getSchema","type","console","formatErrorPayload","body","createRequestBody","result","processRequestBody","exports"],"sources":["handleRequest.ts"],"sourcesContent":["import { ApiEndpoint, CmsContext } from \"~/types\";\nimport { checkEndpointAccess } from \"./checkEndpointAccess\";\nimport { createRequestBody } from \"./createRequestBody\";\nimport { formatErrorPayload } from \"./formatErrorPayload\";\nimport { getSchema } from \"./getSchema\";\nimport { Reply, Request } from \"@webiny/handler/types\";\nimport { processRequestBody } from \"@webiny/handler-graphql\";\nimport { ExecutionResult } from \"graphql\";\n\nexport interface HandleRequestParams {\n context: CmsContext;\n request: Request;\n reply: Reply;\n}\n\nexport interface HandleRequest {\n (params: HandleRequestParams): Promise<Reply>;\n}\n\nexport const handleRequest: HandleRequest = async params => {\n const { context, request, reply } = params;\n try {\n await checkEndpointAccess(context);\n } catch (ex) {\n return reply.code(401).send({\n data: null,\n error: {\n message: ex.message || \"Not authorized!\",\n code: ex.code || \"SECURITY_NOT_AUTHORIZED\",\n data: ex.data || null,\n stack: null\n }\n });\n }\n\n const getTenant = () => {\n return context.tenancy.getCurrentTenant();\n };\n\n const getLocale = () => {\n return context.cms.getLocale();\n };\n\n const schema = await context.benchmark.measure(\"headlessCms.graphql.getSchema\", async () => {\n try {\n return await getSchema({\n context,\n getTenant,\n getLocale,\n type: context.cms.type as ApiEndpoint\n });\n } catch (ex) {\n console.error(`Error while generating the schema.`);\n console.error(formatErrorPayload(ex));\n throw ex;\n }\n });\n\n const body = await context.benchmark.measure(\n \"headlessCms.graphql.createRequestBody\",\n async () => {\n try {\n return createRequestBody(request.body);\n } catch (ex) {\n console.error(`Error while creating the body request.`);\n console.error(formatErrorPayload(ex));\n throw ex;\n }\n }\n );\n\n /**\n * We need to store the processRequestBody result in a variable and output it after the measurement.\n * Otherwise, the measurement will not be shown in the output.\n */\n let result: ExecutionResult[] | ExecutionResult | null = null;\n\n await context.benchmark.measure(\"headlessCms.graphql.processRequestBody\", async () => {\n try {\n result = await processRequestBody(body, schema, context);\n } catch (ex) {\n console.error(`Error while processing the body request.`);\n console.error(formatErrorPayload(ex));\n throw ex;\n }\n });\n\n return reply.code(200).send(result);\n};\n"],"mappings":";;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AACA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,mBAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,eAAA,GAAAJ,OAAA;AAaO,MAAMK,aAA4B,GAAG,MAAMC,MAAM,IAAI;EACxD,MAAM;IAAEC,OAAO;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGH,MAAM;EAC1C,IAAI;IACA,MAAM,IAAAI,wCAAmB,EAACH,OAAO,CAAC;EACtC,CAAC,CAAC,OAAOI,EAAE,EAAE;IACT,OAAOF,KAAK,CAACG,IAAI,CAAC,GAAG,CAAC,CAACC,IAAI,CAAC;MACxBC,IAAI,EAAE,IAAI;MACVC,KAAK,EAAE;QACHC,OAAO,EAAEL,EAAE,CAACK,OAAO,IAAI,iBAAiB;QACxCJ,IAAI,EAAED,EAAE,CAACC,IAAI,IAAI,yBAAyB;QAC1CE,IAAI,EAAEH,EAAE,CAACG,IAAI,IAAI,IAAI;QACrBG,KAAK,EAAE;MACX;IACJ,CAAC,CAAC;EACN;EAEA,MAAMC,SAAS,GAAGA,CAAA,KAAM;IACpB,OAAOX,OAAO,CAACY,OAAO,CAACC,gBAAgB,CAAC,CAAC;EAC7C,CAAC;EAED,MAAMC,SAAS,GAAGA,CAAA,KAAM;IACpB,OAAOd,OAAO,CAACe,GAAG,CAACD,SAAS,CAAC,CAAC;EAClC,CAAC;EAED,MAAME,MAAM,GAAG,MAAMhB,OAAO,CAACiB,SAAS,CAACC,OAAO,CAAC,+BAA+B,EAAE,YAAY;IACxF,IAAI;MACA,OAAO,MAAM,IAAAC,oBAAS,EAAC;QACnBnB,OAAO;QACPW,SAAS;QACTG,SAAS;QACTM,IAAI,EAAEpB,OAAO,CAACe,GAAG,CAACK;MACtB,CAAC,CAAC;IACN,CAAC,CAAC,OAAOhB,EAAE,EAAE;MACTiB,OAAO,CAACb,KAAK,CAAE,oCAAmC,CAAC;MACnDa,OAAO,CAACb,KAAK,CAAC,IAAAc,sCAAkB,EAAClB,EAAE,CAAC,CAAC;MACrC,MAAMA,EAAE;IACZ;EACJ,CAAC,CAAC;EAEF,MAAMmB,IAAI,GAAG,MAAMvB,OAAO,CAACiB,SAAS,CAACC,OAAO,CACxC,uCAAuC,EACvC,YAAY;IACR,IAAI;MACA,OAAO,IAAAM,oCAAiB,EAACvB,OAAO,CAACsB,IAAI,CAAC;IAC1C,CAAC,CAAC,OAAOnB,EAAE,EAAE;MACTiB,OAAO,CAACb,KAAK,CAAE,wCAAuC,CAAC;MACvDa,OAAO,CAACb,KAAK,CAAC,IAAAc,sCAAkB,EAAClB,EAAE,CAAC,CAAC;MACrC,MAAMA,EAAE;IACZ;EACJ,CACJ,CAAC;;EAED;AACJ;AACA;AACA;EACI,IAAIqB,MAAkD,GAAG,IAAI;EAE7D,MAAMzB,OAAO,CAACiB,SAAS,CAACC,OAAO,CAAC,wCAAwC,EAAE,YAAY;IAClF,IAAI;MACAO,MAAM,GAAG,MAAM,IAAAC,kCAAkB,EAACH,IAAI,EAAEP,MAAM,EAAEhB,OAAO,CAAC;IAC5D,CAAC,CAAC,OAAOI,EAAE,EAAE;MACTiB,OAAO,CAACb,KAAK,CAAE,0CAAyC,CAAC;MACzDa,OAAO,CAACb,KAAK,CAAC,IAAAc,sCAAkB,EAAClB,EAAE,CAAC,CAAC;MACrC,MAAMA,EAAE;IACZ;EACJ,CAAC,CAAC;EAEF,OAAOF,KAAK,CAACG,IAAI,CAAC,GAAG,CAAC,CAACC,IAAI,CAACmB,MAAM,CAAC;AACvC,CAAC;AAACE,OAAA,CAAA7B,aAAA,GAAAA,aAAA"}
|
package/graphql/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { GraphQLHandlerFactoryParams } from "./graphQLHandlerFactory";
|
|
2
2
|
export declare type CreateGraphQLParams = GraphQLHandlerFactoryParams;
|
|
3
|
-
export declare const createGraphQL: (params: CreateGraphQLParams) => (import("@webiny/plugins/types").PluginCollection | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("../types").CmsContext>)[];
|
|
3
|
+
export declare const createGraphQL: (params: CreateGraphQLParams) => (import("@webiny/plugins/types").PluginCollection | import("@webiny/handler-graphql").GraphQLSchemaPlugin<import("../types").CmsContext> | import("@webiny/api").ContextPlugin<import("@webiny/api/types").Context>)[];
|
package/graphql/index.js
CHANGED
|
@@ -8,6 +8,8 @@ var _system = require("./system");
|
|
|
8
8
|
var _graphQLHandlerFactory = require("./graphQLHandlerFactory");
|
|
9
9
|
var _baseSchema = require("./schema/baseSchema");
|
|
10
10
|
const createGraphQL = params => {
|
|
11
|
-
return [
|
|
11
|
+
return [(0, _baseSchema.createBaseSchema)(), (0, _system.createSystemSchemaPlugin)(), (0, _graphQLHandlerFactory.graphQLHandlerFactory)(params)];
|
|
12
12
|
};
|
|
13
|
-
exports.createGraphQL = createGraphQL;
|
|
13
|
+
exports.createGraphQL = createGraphQL;
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=index.js.map
|
package/graphql/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createGraphQL","params","createBaseSchema","createSystemSchemaPlugin","graphQLHandlerFactory"],"sources":["index.ts"],"sourcesContent":["import { createSystemSchemaPlugin } from \"./system\";\nimport { graphQLHandlerFactory, GraphQLHandlerFactoryParams } from \"./graphQLHandlerFactory\";\nimport { createBaseSchema } from \"~/graphql/schema/baseSchema\";\n\nexport type CreateGraphQLParams = GraphQLHandlerFactoryParams;\nexport const createGraphQL = (params: CreateGraphQLParams) => {\n return [
|
|
1
|
+
{"version":3,"names":["_system","require","_graphQLHandlerFactory","_baseSchema","createGraphQL","params","createBaseSchema","createSystemSchemaPlugin","graphQLHandlerFactory","exports"],"sources":["index.ts"],"sourcesContent":["import { createSystemSchemaPlugin } from \"./system\";\nimport { graphQLHandlerFactory, GraphQLHandlerFactoryParams } from \"./graphQLHandlerFactory\";\nimport { createBaseSchema } from \"~/graphql/schema/baseSchema\";\n\nexport type CreateGraphQLParams = GraphQLHandlerFactoryParams;\nexport const createGraphQL = (params: CreateGraphQLParams) => {\n return [createBaseSchema(), createSystemSchemaPlugin(), graphQLHandlerFactory(params)];\n};\n"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AAGO,MAAMG,aAAa,GAAIC,MAA2B,IAAK;EAC1D,OAAO,CAAC,IAAAC,4BAAgB,EAAC,CAAC,EAAE,IAAAC,gCAAwB,EAAC,CAAC,EAAE,IAAAC,4CAAqB,EAACH,MAAM,CAAC,CAAC;AAC1F,CAAC;AAACI,OAAA,CAAAL,aAAA,GAAAA,aAAA"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
3
|
Object.defineProperty(exports, "__esModule", {
|
|
5
4
|
value: true
|
|
6
5
|
});
|
|
7
6
|
exports.createBaseContentSchema = void 0;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
7
|
var _builtInTypes = require("@webiny/handler-graphql/builtInTypes");
|
|
10
8
|
var _plugins = require("../../plugins");
|
|
11
9
|
const createBaseContentSchema = ({
|
|
@@ -42,10 +40,11 @@ const createBaseContentSchema = ({
|
|
|
42
40
|
published
|
|
43
41
|
}
|
|
44
42
|
`,
|
|
45
|
-
resolvers:
|
|
46
|
-
acc
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
resolvers: {
|
|
44
|
+
...scalars.reduce((acc, s) => {
|
|
45
|
+
acc[s.name] = s;
|
|
46
|
+
return acc;
|
|
47
|
+
}, {}),
|
|
49
48
|
JSON: _builtInTypes.JsonScalar,
|
|
50
49
|
Long: _builtInTypes.LongScalar,
|
|
51
50
|
RefInput: _builtInTypes.RefInputScalar,
|
|
@@ -58,9 +57,11 @@ const createBaseContentSchema = ({
|
|
|
58
57
|
Mutation: {
|
|
59
58
|
_empty: () => "_empty"
|
|
60
59
|
}
|
|
61
|
-
}
|
|
60
|
+
}
|
|
62
61
|
});
|
|
63
62
|
plugin.name = `headless-cms.graphql.schema.baseContentSchema`;
|
|
64
63
|
return plugin;
|
|
65
64
|
};
|
|
66
|
-
exports.createBaseContentSchema = createBaseContentSchema;
|
|
65
|
+
exports.createBaseContentSchema = createBaseContentSchema;
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=baseContentSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createBaseContentSchema","context","scalars","plugins","byType","map","item","scalar","plugin","CmsGraphQLSchemaPlugin","typeDefs","name","join","resolvers","reduce","acc","s","JSON","JsonScalar","Long","LongScalar","RefInput","RefInputScalar","Number","NumberScalar","Any","AnyScalar","DateTime","DateTimeScalar","DateTimeZ","DateTimeZScalar","Date","DateScalar","Time","TimeScalar","Mutation","_empty"],"sources":["baseContentSchema.ts"],"sourcesContent":["import { GraphQLScalarPlugin } from \"@webiny/handler-graphql/types\";\nimport { CmsContext } from \"~/types\";\nimport {\n RefInputScalar,\n NumberScalar,\n AnyScalar,\n DateTimeScalar,\n DateScalar,\n TimeScalar,\n LongScalar,\n JsonScalar,\n DateTimeZScalar\n} from \"@webiny/handler-graphql/builtInTypes\";\nimport { GraphQLScalarType } from \"graphql\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\n\ninterface Params {\n context: CmsContext;\n}\nexport const createBaseContentSchema = ({ context }: Params): CmsGraphQLSchemaPlugin => {\n const scalars = context.plugins\n .byType<GraphQLScalarPlugin>(\"graphql-scalar\")\n .map(item => item.scalar);\n\n const plugin = new CmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n ${scalars.map(scalar => `scalar ${scalar.name}`).join(\" \")}\n scalar JSON\n scalar Long\n scalar RefInput\n scalar Number\n scalar Any\n scalar Date\n scalar DateTime\n scalar DateTimeZ\n scalar Time\n\n type Query\n\n type Mutation {\n _empty: String\n }\n\n type CmsIdentity {\n id: String\n displayName: String\n type: String\n }\n\n enum CmsEntryStatusType {\n latest\n published\n }\n `,\n resolvers: {\n ...scalars.reduce<Record<string, GraphQLScalarType>>((acc, s) => {\n acc[s.name] = s;\n return acc;\n }, {}),\n JSON: JsonScalar,\n Long: LongScalar,\n RefInput: RefInputScalar,\n Number: NumberScalar,\n Any: AnyScalar,\n DateTime: DateTimeScalar,\n DateTimeZ: DateTimeZScalar,\n Date: DateScalar,\n Time: TimeScalar,\n Mutation: {\n _empty: () => \"_empty\"\n }\n }\n });\n plugin.name = `headless-cms.graphql.schema.baseContentSchema`;\n\n return plugin;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"names":["_builtInTypes","require","_plugins","createBaseContentSchema","context","scalars","plugins","byType","map","item","scalar","plugin","CmsGraphQLSchemaPlugin","typeDefs","name","join","resolvers","reduce","acc","s","JSON","JsonScalar","Long","LongScalar","RefInput","RefInputScalar","Number","NumberScalar","Any","AnyScalar","DateTime","DateTimeScalar","DateTimeZ","DateTimeZScalar","Date","DateScalar","Time","TimeScalar","Mutation","_empty","exports"],"sources":["baseContentSchema.ts"],"sourcesContent":["import { GraphQLScalarPlugin } from \"@webiny/handler-graphql/types\";\nimport { CmsContext } from \"~/types\";\nimport {\n RefInputScalar,\n NumberScalar,\n AnyScalar,\n DateTimeScalar,\n DateScalar,\n TimeScalar,\n LongScalar,\n JsonScalar,\n DateTimeZScalar\n} from \"@webiny/handler-graphql/builtInTypes\";\nimport { GraphQLScalarType } from \"graphql\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\n\ninterface Params {\n context: CmsContext;\n}\nexport const createBaseContentSchema = ({ context }: Params): CmsGraphQLSchemaPlugin => {\n const scalars = context.plugins\n .byType<GraphQLScalarPlugin>(\"graphql-scalar\")\n .map(item => item.scalar);\n\n const plugin = new CmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n ${scalars.map(scalar => `scalar ${scalar.name}`).join(\" \")}\n scalar JSON\n scalar Long\n scalar RefInput\n scalar Number\n scalar Any\n scalar Date\n scalar DateTime\n scalar DateTimeZ\n scalar Time\n\n type Query\n\n type Mutation {\n _empty: String\n }\n\n type CmsIdentity {\n id: String\n displayName: String\n type: String\n }\n\n enum CmsEntryStatusType {\n latest\n published\n }\n `,\n resolvers: {\n ...scalars.reduce<Record<string, GraphQLScalarType>>((acc, s) => {\n acc[s.name] = s;\n return acc;\n }, {}),\n JSON: JsonScalar,\n Long: LongScalar,\n RefInput: RefInputScalar,\n Number: NumberScalar,\n Any: AnyScalar,\n DateTime: DateTimeScalar,\n DateTimeZ: DateTimeZScalar,\n Date: DateScalar,\n Time: TimeScalar,\n Mutation: {\n _empty: () => \"_empty\"\n }\n }\n });\n plugin.name = `headless-cms.graphql.schema.baseContentSchema`;\n\n return plugin;\n};\n"],"mappings":";;;;;;AAEA,IAAAA,aAAA,GAAAC,OAAA;AAYA,IAAAC,QAAA,GAAAD,OAAA;AAKO,MAAME,uBAAuB,GAAGA,CAAC;EAAEC;AAAgB,CAAC,KAA6B;EACpF,MAAMC,OAAO,GAAGD,OAAO,CAACE,OAAO,CAC1BC,MAAM,CAAsB,gBAAgB,CAAC,CAC7CC,GAAG,CAACC,IAAI,IAAIA,IAAI,CAACC,MAAM,CAAC;EAE7B,MAAMC,MAAM,GAAG,IAAIC,+BAAsB,CAAC;IACtCC,QAAQ,EAAE,aAAe;AACjC,cAAcR,OAAO,CAACG,GAAG,CAACE,MAAM,IAAK,UAASA,MAAM,CAACI,IAAK,EAAC,CAAC,CAACC,IAAI,CAAC,GAAG,CAAE;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;IACDC,SAAS,EAAE;MACP,GAAGX,OAAO,CAACY,MAAM,CAAoC,CAACC,GAAG,EAAEC,CAAC,KAAK;QAC7DD,GAAG,CAACC,CAAC,CAACL,IAAI,CAAC,GAAGK,CAAC;QACf,OAAOD,GAAG;MACd,CAAC,EAAE,CAAC,CAAC,CAAC;MACNE,IAAI,EAAEC,wBAAU;MAChBC,IAAI,EAAEC,wBAAU;MAChBC,QAAQ,EAAEC,4BAAc;MACxBC,MAAM,EAAEC,0BAAY;MACpBC,GAAG,EAAEC,uBAAS;MACdC,QAAQ,EAAEC,4BAAc;MACxBC,SAAS,EAAEC,6BAAe;MAC1BC,IAAI,EAAEC,wBAAU;MAChBC,IAAI,EAAEC,wBAAU;MAChBC,QAAQ,EAAE;QACNC,MAAM,EAAEA,CAAA,KAAM;MAClB;IACJ;EACJ,CAAC,CAAC;EACF5B,MAAM,CAACG,IAAI,GAAI,+CAA8C;EAE7D,OAAOH,MAAM;AACjB,CAAC;AAAC6B,OAAA,CAAArC,uBAAA,GAAAA,uBAAA"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export declare const createBaseSchema: () => GraphQLSchemaPlugin<CmsContext>[];
|
|
1
|
+
import { ContextPlugin } from "@webiny/api";
|
|
2
|
+
export declare const createBaseSchema: () => ContextPlugin<import("@webiny/api/types").Context>;
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.createBaseSchema = void 0;
|
|
7
8
|
var _plugins = require("../../plugins");
|
|
8
9
|
var _handlerGraphql = require("@webiny/handler-graphql");
|
|
9
|
-
|
|
10
|
+
var _api = require("@webiny/api");
|
|
11
|
+
var _camelCase = _interopRequireDefault(require("lodash/camelCase"));
|
|
12
|
+
const createSkipValidatorEnum = plugins => {
|
|
13
|
+
const validators = plugins.byType("cms-model-field-validator").reduce((collection, validator) => {
|
|
14
|
+
const name = (0, _camelCase.default)(validator.validator.name);
|
|
15
|
+
if (collection.includes(name)) {
|
|
16
|
+
return collection;
|
|
17
|
+
}
|
|
18
|
+
collection.push(name);
|
|
19
|
+
return collection;
|
|
20
|
+
}, []);
|
|
21
|
+
if (validators.length === 0) {
|
|
22
|
+
validators.push("_empty");
|
|
23
|
+
}
|
|
24
|
+
return (/* GraphQL */`
|
|
25
|
+
enum SkipValidatorEnum {
|
|
26
|
+
${validators.join("\n")}
|
|
27
|
+
}
|
|
28
|
+
`
|
|
29
|
+
);
|
|
30
|
+
};
|
|
31
|
+
const createSchema = plugins => {
|
|
32
|
+
const skipValidatorEnum = createSkipValidatorEnum(plugins);
|
|
10
33
|
const cmsPlugin = new _plugins.CmsGraphQLSchemaPlugin({
|
|
11
34
|
typeDefs: /* GraphQL */`
|
|
12
35
|
type CmsError {
|
|
@@ -67,6 +90,38 @@ const createBaseSchema = () => {
|
|
|
67
90
|
folderId_not: ID
|
|
68
91
|
folderId_not_in: [ID!]
|
|
69
92
|
}
|
|
93
|
+
|
|
94
|
+
${skipValidatorEnum}
|
|
95
|
+
|
|
96
|
+
input CreateCmsEntryOptionsInput {
|
|
97
|
+
skipValidators: [SkipValidatorEnum!]
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
input CreateRevisionCmsEntryOptionsInput {
|
|
101
|
+
skipValidators: [SkipValidatorEnum!]
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
input UpdateCmsEntryOptionsInput {
|
|
105
|
+
skipValidators: [SkipValidatorEnum!]
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
input CmsIdentityInput {
|
|
109
|
+
id: String!
|
|
110
|
+
displayName: String!
|
|
111
|
+
type: String!
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
type CmsEntryValidationResponseData {
|
|
115
|
+
error: String!
|
|
116
|
+
id: String!
|
|
117
|
+
fieldId: String!
|
|
118
|
+
parents: [String!]!
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
type CmsEntryValidationResponse {
|
|
122
|
+
data: [CmsEntryValidationResponseData!]
|
|
123
|
+
error: CmsError
|
|
124
|
+
}
|
|
70
125
|
`,
|
|
71
126
|
resolvers: {}
|
|
72
127
|
});
|
|
@@ -81,4 +136,11 @@ const createBaseSchema = () => {
|
|
|
81
136
|
*/
|
|
82
137
|
return [cmsPlugin, corePlugin];
|
|
83
138
|
};
|
|
84
|
-
|
|
139
|
+
const createBaseSchema = () => {
|
|
140
|
+
return new _api.ContextPlugin(async context => {
|
|
141
|
+
context.plugins.register(...createSchema(context.plugins));
|
|
142
|
+
});
|
|
143
|
+
};
|
|
144
|
+
exports.createBaseSchema = createBaseSchema;
|
|
145
|
+
|
|
146
|
+
//# sourceMappingURL=baseSchema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_plugins","require","_handlerGraphql","_api","_camelCase","_interopRequireDefault","createSkipValidatorEnum","plugins","validators","byType","reduce","collection","validator","name","camelCase","includes","push","length","join","createSchema","skipValidatorEnum","cmsPlugin","CmsGraphQLSchemaPlugin","typeDefs","resolvers","corePlugin","GraphQLSchemaPlugin","schema","createBaseSchema","ContextPlugin","context","register","exports"],"sources":["baseSchema.ts"],"sourcesContent":["import { CmsContext, CmsModelFieldValidatorPlugin } from \"~/types\";\nimport { CmsGraphQLSchemaPlugin } from \"~/plugins\";\nimport { GraphQLSchemaPlugin } from \"@webiny/handler-graphql\";\nimport { PluginsContainer } from \"@webiny/plugins\";\nimport { ContextPlugin } from \"@webiny/api\";\nimport camelCase from \"lodash/camelCase\";\n\nconst createSkipValidatorEnum = (plugins: PluginsContainer) => {\n const validators = plugins\n .byType<CmsModelFieldValidatorPlugin>(\"cms-model-field-validator\")\n .reduce<string[]>((collection, validator) => {\n const name = camelCase(validator.validator.name);\n if (collection.includes(name)) {\n return collection;\n }\n collection.push(name);\n return collection;\n }, []);\n\n if (validators.length === 0) {\n validators.push(\"_empty\");\n }\n return /* GraphQL */ `\n enum SkipValidatorEnum {\n ${validators.join(\"\\n\")}\n }\n `;\n};\n\nconst createSchema = (plugins: PluginsContainer): GraphQLSchemaPlugin<CmsContext>[] => {\n const skipValidatorEnum = createSkipValidatorEnum(plugins);\n\n const cmsPlugin = new CmsGraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type CmsError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type CmsCursors {\n next: String\n previous: String\n }\n\n type CmsListMeta {\n cursor: String\n hasMoreItems: Boolean\n totalCount: Int\n }\n\n input CmsDeleteEntryOptions {\n # force delete an entry that might have some records left behind in the database\n # see CmsDeleteEntryOptions in types.ts\n force: Boolean\n }\n\n type CmsDeleteResponse {\n data: Boolean\n error: CmsError\n }\n\n type CmsDeleteMultipleDataResponse {\n id: ID!\n }\n\n type CmsDeleteMultipleResponse {\n data: [CmsDeleteMultipleDataResponse!]\n error: CmsError\n }\n\n type CmsBooleanResponse {\n data: Boolean\n error: CmsError\n }\n\n # Advanced Content Organization\n type WbyAcoLocation {\n folderId: ID\n }\n\n input WbyAcoLocationInput {\n folderId: ID!\n }\n\n input WbyAcoLocationWhereInput {\n folderId: ID\n folderId_in: [ID!]\n folderId_not: ID\n folderId_not_in: [ID!]\n }\n\n ${skipValidatorEnum}\n\n input CreateCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input CreateRevisionCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input UpdateCmsEntryOptionsInput {\n skipValidators: [SkipValidatorEnum!]\n }\n\n input CmsIdentityInput {\n id: String!\n displayName: String!\n type: String!\n }\n\n type CmsEntryValidationResponseData {\n error: String!\n id: String!\n fieldId: String!\n parents: [String!]!\n }\n\n type CmsEntryValidationResponse {\n data: [CmsEntryValidationResponseData!]\n error: CmsError\n }\n `,\n resolvers: {}\n });\n cmsPlugin.name = \"headless-cms.graphql.schema.base\";\n const corePlugin = new GraphQLSchemaPlugin<CmsContext>({\n typeDefs: cmsPlugin.schema.typeDefs,\n resolvers: cmsPlugin.schema.resolvers\n });\n corePlugin.name = \"headless-cms.graphql.core.schema.base\";\n /**\n * Due to splitting of CMS and Core schema plugins, we must have both defined for CMS to work.\n */\n return [cmsPlugin, corePlugin];\n};\n\nexport const createBaseSchema = () => {\n return new ContextPlugin(async context => {\n context.plugins.register(...createSchema(context.plugins));\n });\n};\n"],"mappings":";;;;;;;AACA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AAEA,IAAAE,IAAA,GAAAF,OAAA;AACA,IAAAG,UAAA,GAAAC,sBAAA,CAAAJ,OAAA;AAEA,MAAMK,uBAAuB,GAAIC,OAAyB,IAAK;EAC3D,MAAMC,UAAU,GAAGD,OAAO,CACrBE,MAAM,CAA+B,2BAA2B,CAAC,CACjEC,MAAM,CAAW,CAACC,UAAU,EAAEC,SAAS,KAAK;IACzC,MAAMC,IAAI,GAAG,IAAAC,kBAAS,EAACF,SAAS,CAACA,SAAS,CAACC,IAAI,CAAC;IAChD,IAAIF,UAAU,CAACI,QAAQ,CAACF,IAAI,CAAC,EAAE;MAC3B,OAAOF,UAAU;IACrB;IACAA,UAAU,CAACK,IAAI,CAACH,IAAI,CAAC;IACrB,OAAOF,UAAU;EACrB,CAAC,EAAE,EAAE,CAAC;EAEV,IAAIH,UAAU,CAACS,MAAM,KAAK,CAAC,EAAE;IACzBT,UAAU,CAACQ,IAAI,CAAC,QAAQ,CAAC;EAC7B;EACA,OAAO,cAAe;AAC1B;AACA,UAAUR,UAAU,CAACU,IAAI,CAAC,IAAI,CAAE;AAChC;AACA;EAAK;AACL,CAAC;AAED,MAAMC,YAAY,GAAIZ,OAAyB,IAAwC;EACnF,MAAMa,iBAAiB,GAAGd,uBAAuB,CAACC,OAAO,CAAC;EAE1D,MAAMc,SAAS,GAAG,IAAIC,+BAAsB,CAAC;IACzCC,QAAQ,EAAE,aAAe;AACjC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAcH,iBAAkB;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;IACDI,SAAS,EAAE,CAAC;EAChB,CAAC,CAAC;EACFH,SAAS,CAACR,IAAI,GAAG,kCAAkC;EACnD,MAAMY,UAAU,GAAG,IAAIC,mCAAmB,CAAa;IACnDH,QAAQ,EAAEF,SAAS,CAACM,MAAM,CAACJ,QAAQ;IACnCC,SAAS,EAAEH,SAAS,CAACM,MAAM,CAACH;EAChC,CAAC,CAAC;EACFC,UAAU,CAACZ,IAAI,GAAG,uCAAuC;EACzD;AACJ;AACA;EACI,OAAO,CAACQ,SAAS,EAAEI,UAAU,CAAC;AAClC,CAAC;AAEM,MAAMG,gBAAgB,GAAGA,CAAA,KAAM;EAClC,OAAO,IAAIC,kBAAa,CAAC,MAAMC,OAAO,IAAI;IACtCA,OAAO,CAACvB,OAAO,CAACwB,QAAQ,CAAC,GAAGZ,YAAY,CAACW,OAAO,CAACvB,OAAO,CAAC,CAAC;EAC9D,CAAC,CAAC;AACN,CAAC;AAACyB,OAAA,CAAAJ,gBAAA,GAAAA,gBAAA"}
|