polen 0.11.0-next.24 → 0.11.0-next.26
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/build/api/config/input.d.ts +259 -77
- package/build/api/config/input.d.ts.map +1 -1
- package/build/api/config/input.js +2 -0
- package/build/api/config/input.js.map +1 -1
- package/build/api/config/normalized.d.ts +433 -143
- package/build/api/config/normalized.d.ts.map +1 -1
- package/build/api/config/normalized.js +47 -0
- package/build/api/config/normalized.js.map +1 -1
- package/build/api/config-template/template.d.ts +191 -121
- package/build/api/config-template/template.d.ts.map +1 -1
- package/build/api/config-template/template.js +18 -1
- package/build/api/config-template/template.js.map +1 -1
- package/build/api/examples/diagnostic/diagnostic.d.ts +0 -23
- package/build/api/examples/diagnostic/diagnostic.d.ts.map +1 -1
- package/build/api/examples/diagnostic/diagnostic.js +1 -3
- package/build/api/examples/diagnostic/diagnostic.js.map +1 -1
- package/build/api/examples/scanner.d.ts +27 -1
- package/build/api/examples/scanner.d.ts.map +1 -1
- package/build/api/examples/scanner.js +30 -17
- package/build/api/examples/scanner.js.map +1 -1
- package/build/api/examples/schemas/catalog.d.ts +56 -12
- package/build/api/examples/schemas/catalog.d.ts.map +1 -1
- package/build/api/examples/schemas/example/example.d.ts +54 -11
- package/build/api/examples/schemas/example/example.d.ts.map +1 -1
- package/build/api/examples/schemas/example/example.js +5 -0
- package/build/api/examples/schemas/example/example.js.map +1 -1
- package/build/api/reference/$.d.ts +4 -0
- package/build/api/reference/$.d.ts.map +1 -0
- package/build/api/reference/$.js +4 -0
- package/build/api/reference/$.js.map +1 -0
- package/build/api/reference/catalog.d.ts +69 -0
- package/build/api/reference/catalog.d.ts.map +1 -0
- package/build/api/reference/catalog.js +44 -0
- package/build/api/reference/catalog.js.map +1 -0
- package/build/api/reference/config.d.ts +616 -0
- package/build/api/reference/config.d.ts.map +1 -0
- package/build/api/reference/config.js +162 -0
- package/build/api/reference/config.js.map +1 -0
- package/build/api/reference/scanner.d.ts +26 -0
- package/build/api/reference/scanner.d.ts.map +1 -0
- package/build/api/reference/scanner.js +27 -0
- package/build/api/reference/scanner.js.map +1 -0
- package/build/api/schema/augmentations/$$.d.ts +7 -0
- package/build/api/schema/augmentations/$$.d.ts.map +1 -0
- package/build/api/schema/augmentations/$$.js +7 -0
- package/build/api/schema/augmentations/$$.js.map +1 -0
- package/build/api/schema/augmentations/$.d.ts +1 -1
- package/build/api/schema/augmentations/$.d.ts.map +1 -1
- package/build/api/schema/augmentations/$.js +1 -1
- package/build/api/schema/augmentations/$.js.map +1 -1
- package/build/api/schema/augmentations/apply.d.ts +29 -0
- package/build/api/schema/augmentations/apply.d.ts.map +1 -0
- package/build/api/schema/augmentations/apply.js +181 -0
- package/build/api/schema/augmentations/apply.js.map +1 -0
- package/build/api/schema/augmentations/augmentation.d.ts +31 -0
- package/build/api/schema/augmentations/augmentation.d.ts.map +1 -0
- package/build/api/schema/augmentations/augmentation.js +22 -0
- package/build/api/schema/augmentations/augmentation.js.map +1 -0
- package/build/api/schema/augmentations/config.d.ts +24 -0
- package/build/api/schema/augmentations/config.d.ts.map +1 -0
- package/build/api/schema/augmentations/config.js +9 -0
- package/build/api/schema/augmentations/config.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts +67 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.js +13 -0
- package/build/api/schema/augmentations/diagnostics/diagnostic.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts +45 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.js +17 -0
- package/build/api/schema/augmentations/diagnostics/duplicate-version.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts +46 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.js +18 -0
- package/build/api/schema/augmentations/diagnostics/invalid-path.js.map +1 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts +46 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.d.ts.map +1 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.js +18 -0
- package/build/api/schema/augmentations/diagnostics/version-mismatch.js.map +1 -0
- package/build/api/schema/augmentations/input.d.ts +145 -0
- package/build/api/schema/augmentations/input.d.ts.map +1 -0
- package/build/api/schema/augmentations/input.js +191 -0
- package/build/api/schema/augmentations/input.js.map +1 -0
- package/build/api/schema/augmentations/placement.d.ts +8 -0
- package/build/api/schema/augmentations/placement.d.ts.map +1 -0
- package/build/api/schema/augmentations/placement.js +7 -0
- package/build/api/schema/augmentations/placement.js.map +1 -0
- package/build/api/schema/config-schema.d.ts +66 -66
- package/build/api/schema/config-schema.d.ts.map +1 -1
- package/build/api/schema/config-schema.js +2 -2
- package/build/api/schema/config-schema.js.map +1 -1
- package/build/api/schema/input-source/load.d.ts +2 -0
- package/build/api/schema/input-source/load.d.ts.map +1 -1
- package/build/api/schema/input-source/load.js.map +1 -1
- package/build/api/schema/input-sources/directory.d.ts +39 -39
- package/build/api/schema/input-sources/file.d.ts +39 -39
- package/build/api/schema/input-sources/introspection-file.d.ts +39 -39
- package/build/api/schema/input-sources/introspection.d.ts +39 -39
- package/build/api/schema/input-sources/memory.d.ts +39 -39
- package/build/api/schema/input-sources/versioned-directory.d.ts +79 -79
- package/build/api/schema/load.d.ts.map +1 -1
- package/build/api/schema/load.js +9 -2
- package/build/api/schema/load.js.map +1 -1
- package/build/lib/catalog/catalog.d.ts +1181 -1181
- package/build/lib/catalog/unversioned.d.ts +312 -312
- package/build/lib/catalog/versioned.d.ts +634 -634
- package/build/lib/change/change.d.ts +238 -238
- package/build/lib/document/document.d.ts +14 -8
- package/build/lib/document/document.d.ts.map +1 -1
- package/build/lib/document/versioned.d.ts +17 -10
- package/build/lib/document/versioned.d.ts.map +1 -1
- package/build/lib/grafaid/schema/KindMap/_.d.ts +1 -1
- package/build/lib/grafaid/schema/format-default-value.d.ts +11 -0
- package/build/lib/grafaid/schema/format-default-value.d.ts.map +1 -0
- package/build/lib/grafaid/schema/format-default-value.js +20 -0
- package/build/lib/grafaid/schema/format-default-value.js.map +1 -0
- package/build/lib/grafaid/schema/schema.d.ts +1 -0
- package/build/lib/grafaid/schema/schema.d.ts.map +1 -1
- package/build/lib/grafaid/schema/schema.js +1 -0
- package/build/lib/grafaid/schema/schema.js.map +1 -1
- package/build/lib/graphql-path/$$.d.ts +7 -13
- package/build/lib/graphql-path/$$.d.ts.map +1 -1
- package/build/lib/graphql-path/$$.js +7 -13
- package/build/lib/graphql-path/$$.js.map +1 -1
- package/build/lib/graphql-path/definition.d.ts +104 -94
- package/build/lib/graphql-path/definition.d.ts.map +1 -1
- package/build/lib/graphql-path/definition.js +126 -125
- package/build/lib/graphql-path/definition.js.map +1 -1
- package/build/lib/graphql-path/query.d.ts +25 -57
- package/build/lib/graphql-path/query.d.ts.map +1 -1
- package/build/lib/graphql-path/query.js +15 -93
- package/build/lib/graphql-path/query.js.map +1 -1
- package/build/lib/graphql-path/schema.d.ts +49 -0
- package/build/lib/graphql-path/schema.d.ts.map +1 -0
- package/build/lib/graphql-path/schema.js +89 -0
- package/build/lib/graphql-path/schema.js.map +1 -0
- package/build/lib/graphql-path/types.d.ts +76 -28
- package/build/lib/graphql-path/types.d.ts.map +1 -1
- package/build/lib/graphql-path/types.js +101 -2
- package/build/lib/graphql-path/types.js.map +1 -1
- package/build/lib/revision/revision.d.ts +1170 -1170
- package/build/lib/schema/schema.d.ts +708 -708
- package/build/lib/schema/unversioned.d.ts +1092 -1092
- package/build/lib/schema/versioned.d.ts +634 -634
- package/build/lib/semver/official-release.d.ts +10 -10
- package/build/lib/semver/pre-release.d.ts +10 -10
- package/build/lib/semver/semver.d.ts +50 -50
- package/build/lib/version-coverage/version-coverage.d.ts +43 -11
- package/build/lib/version-coverage/version-coverage.d.ts.map +1 -1
- package/build/lib/version-coverage/version-coverage.js +40 -6
- package/build/lib/version-coverage/version-coverage.js.map +1 -1
- package/build/template/components/ArgumentAnnotation.d.ts +2 -1
- package/build/template/components/ArgumentAnnotation.d.ts.map +1 -1
- package/build/template/components/ArgumentAnnotation.js +14 -4
- package/build/template/components/ArgumentAnnotation.js.map +1 -1
- package/build/template/components/ArgumentListAnnotation.d.ts +1 -0
- package/build/template/components/ArgumentListAnnotation.d.ts.map +1 -1
- package/build/template/components/ArgumentListAnnotation.js +21 -8
- package/build/template/components/ArgumentListAnnotation.js.map +1 -1
- package/build/template/components/Changelog/groups/FieldArgument.d.ts.map +1 -1
- package/build/template/components/Changelog/groups/FieldArgument.js +0 -1
- package/build/template/components/Changelog/groups/FieldArgument.js.map +1 -1
- package/build/template/components/CodeBlock.d.ts.map +1 -1
- package/build/template/components/CodeBlock.js +1 -1
- package/build/template/components/CodeBlock.js.map +1 -1
- package/build/template/components/Description.js +1 -1
- package/build/template/components/Description.js.map +1 -1
- package/build/template/components/ExampleLink.d.ts.map +1 -1
- package/build/template/components/ExampleLink.js +2 -1
- package/build/template/components/ExampleLink.js.map +1 -1
- package/build/template/components/Field.d.ts +2 -0
- package/build/template/components/Field.d.ts.map +1 -1
- package/build/template/components/Field.js +42 -4
- package/build/template/components/Field.js.map +1 -1
- package/build/template/components/FieldList.d.ts +2 -1
- package/build/template/components/FieldList.d.ts.map +1 -1
- package/build/template/components/FieldList.js +14 -3
- package/build/template/components/FieldList.js.map +1 -1
- package/build/template/components/FieldListSection.d.ts.map +1 -1
- package/build/template/components/FieldListSection.js +6 -1
- package/build/template/components/FieldListSection.js.map +1 -1
- package/build/template/components/GraphQLDocument.d.ts.map +1 -1
- package/build/template/components/GraphQLDocument.js +2 -1
- package/build/template/components/GraphQLDocument.js.map +1 -1
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts +2 -0
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.js +4 -3
- package/build/template/components/GraphQLInteractive/GraphQLInteractive.js.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts +2 -2
- package/build/template/components/GraphQLInteractive/lib/parser.d.ts.map +1 -1
- package/build/template/components/GraphQLInteractive/lib/parser.js +17 -12
- package/build/template/components/GraphQLInteractive/lib/parser.js.map +1 -1
- package/build/template/components/IAPIndicator.d.ts +12 -0
- package/build/template/components/IAPIndicator.d.ts.map +1 -0
- package/build/template/components/IAPIndicator.js +21 -0
- package/build/template/components/IAPIndicator.js.map +1 -0
- package/build/template/components/Link.d.ts +1 -2
- package/build/template/components/Link.d.ts.map +1 -1
- package/build/template/components/Link.js +5 -2
- package/build/template/components/Link.js.map +1 -1
- package/build/template/components/NamedType.d.ts.map +1 -1
- package/build/template/components/NamedType.js +9 -5
- package/build/template/components/NamedType.js.map +1 -1
- package/build/template/components/ReferenceLink.d.ts +2 -2
- package/build/template/components/ReferenceLink.d.ts.map +1 -1
- package/build/template/components/ReferenceLink.js +5 -3
- package/build/template/components/ReferenceLink.js.map +1 -1
- package/build/template/components/TypeAnnotation.d.ts +2 -0
- package/build/template/components/TypeAnnotation.d.ts.map +1 -1
- package/build/template/components/TypeAnnotation.js +4 -4
- package/build/template/components/TypeAnnotation.js.map +1 -1
- package/build/template/components/ViewModeToggle.d.ts +3 -0
- package/build/template/components/ViewModeToggle.d.ts.map +1 -0
- package/build/template/components/ViewModeToggle.js +9 -0
- package/build/template/components/ViewModeToggle.js.map +1 -0
- package/build/template/components/graphql/type-link.d.ts +2 -0
- package/build/template/components/graphql/type-link.d.ts.map +1 -1
- package/build/template/components/graphql/type-link.js +15 -3
- package/build/template/components/graphql/type-link.js.map +1 -1
- package/build/template/components/home/PlaygroundPreview.d.ts.map +1 -1
- package/build/template/components/home/PlaygroundPreview.js +3 -2
- package/build/template/components/home/PlaygroundPreview.js.map +1 -1
- package/build/template/components/sidebar/SidebarItem.d.ts.map +1 -1
- package/build/template/components/sidebar/SidebarItem.js +18 -5
- package/build/template/components/sidebar/SidebarItem.js.map +1 -1
- package/build/template/contexts/ReferenceConfigContext.d.ts +16 -0
- package/build/template/contexts/ReferenceConfigContext.d.ts.map +1 -0
- package/build/template/contexts/ReferenceConfigContext.js +14 -0
- package/build/template/contexts/ReferenceConfigContext.js.map +1 -0
- package/build/template/contexts/ViewModeContext.d.ts +14 -0
- package/build/template/contexts/ViewModeContext.d.ts.map +1 -0
- package/build/template/contexts/ViewModeContext.js +40 -0
- package/build/template/contexts/ViewModeContext.js.map +1 -0
- package/build/template/hooks/use-examples.d.ts +4 -1
- package/build/template/hooks/use-examples.d.ts.map +1 -1
- package/build/template/hooks/useAlignedColumns.d.ts +10 -0
- package/build/template/hooks/useAlignedColumns.d.ts.map +1 -0
- package/build/template/hooks/useAlignedColumns.js +17 -0
- package/build/template/hooks/useAlignedColumns.js.map +1 -0
- package/build/template/routes/changelog/ChangelogSidebar.d.ts +2 -2
- package/build/template/routes/changelog/ChangelogSidebar.d.ts.map +1 -1
- package/build/template/routes/changelog/ChangelogSidebar.js +4 -4
- package/build/template/routes/changelog/ChangelogSidebar.js.map +1 -1
- package/build/template/routes/examples/_.d.ts +12 -3
- package/build/template/routes/examples/_.d.ts.map +1 -1
- package/build/template/routes/examples/_index.d.ts +8 -2
- package/build/template/routes/examples/_index.d.ts.map +1 -1
- package/build/template/routes/examples/name.d.ts +12 -3
- package/build/template/routes/examples/name.d.ts.map +1 -1
- package/build/template/routes/examples/name.js +6 -2
- package/build/template/routes/examples/name.js.map +1 -1
- package/build/template/routes/reference.d.ts.map +1 -1
- package/build/template/routes/reference.js +37 -10
- package/build/template/routes/reference.js.map +1 -1
- package/build/template/stores/changelog.d.ts +39 -39
- package/build/vite/plugins/core.d.ts.map +1 -1
- package/build/vite/plugins/core.js +6 -0
- package/build/vite/plugins/core.js.map +1 -1
- package/build/vite/plugins/examples.d.ts.map +1 -1
- package/build/vite/plugins/examples.js +10 -3
- package/build/vite/plugins/examples.js.map +1 -1
- package/build/vite/plugins/index.d.ts +1 -0
- package/build/vite/plugins/index.d.ts.map +1 -1
- package/build/vite/plugins/index.js +1 -0
- package/build/vite/plugins/index.js.map +1 -1
- package/build/vite/plugins/navbar.d.ts.map +1 -1
- package/build/vite/plugins/navbar.js +3 -1
- package/build/vite/plugins/navbar.js.map +1 -1
- package/build/vite/plugins/reference.d.ts +19 -0
- package/build/vite/plugins/reference.d.ts.map +1 -0
- package/build/vite/plugins/reference.js +96 -0
- package/build/vite/plugins/reference.js.map +1 -0
- package/build/vite/plugins/schemas.d.ts.map +1 -1
- package/build/vite/plugins/schemas.js +38 -2
- package/build/vite/plugins/schemas.js.map +1 -1
- package/package.json +1 -1
- package/src/api/config/input.ts +2 -0
- package/src/api/config/normalized.ts +54 -0
- package/src/api/config-template/template.ts +18 -1
- package/src/api/examples/diagnostic/diagnostic.ts +0 -3
- package/src/api/examples/scanner.test.ts +83 -0
- package/src/api/examples/scanner.ts +31 -21
- package/src/api/examples/schemas/example/example.ts +6 -0
- package/src/api/reference/$.ts +3 -0
- package/src/api/reference/catalog.ts +55 -0
- package/src/api/reference/config.ts +193 -0
- package/src/api/reference/scanner.ts +53 -0
- package/src/api/schema/augmentations/$$.ts +6 -0
- package/src/api/schema/augmentations/$.ts +1 -1
- package/src/api/schema/augmentations/apply.test.ts +89 -0
- package/src/api/schema/augmentations/apply.ts +277 -0
- package/src/api/schema/augmentations/augmentation.ts +24 -0
- package/src/api/schema/augmentations/config.ts +11 -0
- package/src/api/schema/augmentations/diagnostics/diagnostic.ts +20 -0
- package/src/api/schema/augmentations/diagnostics/duplicate-version.ts +20 -0
- package/src/api/schema/augmentations/diagnostics/invalid-path.ts +21 -0
- package/src/api/schema/augmentations/diagnostics/version-mismatch.ts +21 -0
- package/src/api/schema/augmentations/input.test.ts +144 -0
- package/src/api/schema/augmentations/input.ts +215 -0
- package/src/api/schema/augmentations/placement.ts +11 -0
- package/src/api/schema/config-schema.ts +2 -2
- package/src/api/schema/input-source/load.ts +2 -0
- package/src/api/schema/load.ts +19 -2
- package/src/lib/grafaid/schema/format-default-value.ts +22 -0
- package/src/lib/grafaid/schema/schema.ts +2 -0
- package/src/lib/graphql-path/$$.ts +7 -13
- package/src/lib/graphql-path/$.test.ts +175 -0
- package/src/lib/graphql-path/definition.ts +162 -162
- package/src/lib/graphql-path/query.ts +15 -98
- package/src/lib/graphql-path/schema.ts +136 -0
- package/src/lib/graphql-path/types.ts +108 -28
- package/src/lib/version-coverage/version-coverage.ts +48 -6
- package/src/template/components/ArgumentAnnotation.tsx +58 -9
- package/src/template/components/ArgumentListAnnotation.tsx +50 -17
- package/src/template/components/Changelog/groups/FieldArgument.tsx +0 -1
- package/src/template/components/CodeBlock.tsx +1 -0
- package/src/template/components/Description.tsx +1 -1
- package/src/template/components/ExampleLink.tsx +2 -1
- package/src/template/components/Field.tsx +148 -20
- package/src/template/components/FieldList.tsx +28 -13
- package/src/template/components/FieldListSection.tsx +12 -2
- package/src/template/components/GraphQLDocument.tsx +2 -0
- package/src/template/components/GraphQLInteractive/GraphQLInteractive.tsx +6 -1
- package/src/template/components/GraphQLInteractive/lib/parser.ts +16 -3
- package/src/template/components/IAPIndicator.tsx +73 -0
- package/src/template/components/Link.tsx +9 -3
- package/src/template/components/NamedType.tsx +54 -28
- package/src/template/components/ReferenceLink.tsx +16 -10
- package/src/template/components/TypeAnnotation.tsx +17 -5
- package/src/template/components/ViewModeToggle.tsx +27 -0
- package/src/template/components/graphql/type-link.tsx +34 -3
- package/src/template/components/home/PlaygroundPreview.tsx +3 -0
- package/src/template/components/sidebar/SidebarItem.tsx +21 -5
- package/src/template/contexts/ReferenceConfigContext.tsx +37 -0
- package/src/template/contexts/ViewModeContext.tsx +64 -0
- package/src/template/hooks/useAlignedColumns.ts +19 -0
- package/src/template/routes/changelog/ChangelogSidebar.tsx +4 -4
- package/src/template/routes/examples/name.tsx +13 -1
- package/src/template/routes/reference.tsx +67 -23
- package/src/types/virtual-modules.d.ts +5 -0
- package/src/vite/plugins/core.ts +6 -0
- package/src/vite/plugins/examples.ts +12 -2
- package/src/vite/plugins/index.ts +1 -0
- package/src/vite/plugins/navbar.ts +4 -1
- package/src/vite/plugins/reference.ts +130 -0
- package/src/vite/plugins/schemas.ts +51 -2
- package/build/api/examples/diagnostic/unused-default.d.ts +0 -49
- package/build/api/examples/diagnostic/unused-default.d.ts.map +0 -1
- package/build/api/examples/diagnostic/unused-default.js +0 -19
- package/build/api/examples/diagnostic/unused-default.js.map +0 -1
- package/build/api/schema/augmentations/augmentations/description.d.ts +0 -26
- package/build/api/schema/augmentations/augmentations/description.d.ts.map +0 -1
- package/build/api/schema/augmentations/augmentations/description.js +0 -55
- package/build/api/schema/augmentations/augmentations/description.js.map +0 -1
- package/build/api/schema/augmentations/schema-augmentation.d.ts +0 -20
- package/build/api/schema/augmentations/schema-augmentation.d.ts.map +0 -1
- package/build/api/schema/augmentations/schema-augmentation.js +0 -22
- package/build/api/schema/augmentations/schema-augmentation.js.map +0 -1
- package/build/api/schema/augmentations/target.d.ts +0 -25
- package/build/api/schema/augmentations/target.d.ts.map +0 -1
- package/build/api/schema/augmentations/target.js +0 -39
- package/build/api/schema/augmentations/target.js.map +0 -1
- package/build/lib/graphql-path/constructors.d.ts +0 -57
- package/build/lib/graphql-path/constructors.d.ts.map +0 -1
- package/build/lib/graphql-path/constructors.js +0 -73
- package/build/lib/graphql-path/constructors.js.map +0 -1
- package/build/template/components/ArgumentList.d.ts +0 -6
- package/build/template/components/ArgumentList.d.ts.map +0 -1
- package/build/template/components/ArgumentList.js +0 -9
- package/build/template/components/ArgumentList.js.map +0 -1
- package/src/api/examples/diagnostic/unused-default.ts +0 -22
- package/src/api/schema/augmentations/augmentations/description.ts +0 -69
- package/src/api/schema/augmentations/schema-augmentation.ts +0 -32
- package/src/api/schema/augmentations/target.ts +0 -61
- package/src/lib/graphql-path/constructors.ts +0 -81
- package/src/template/components/ArgumentList.tsx +0 -22
@@ -0,0 +1,162 @@
|
|
1
|
+
import { Diagnostic } from '#lib/diagnostic/$';
|
2
|
+
import { S } from '#lib/kit-temp/effect';
|
3
|
+
// ============================================================================
|
4
|
+
// Schema - Reference Diagnostics
|
5
|
+
// ============================================================================
|
6
|
+
/**
|
7
|
+
* Diagnostic controls for reference documentation.
|
8
|
+
*/
|
9
|
+
export const ReferenceDiagnostics = S.Struct({
|
10
|
+
/**
|
11
|
+
* Control diagnostics for missing or invalid reference content.
|
12
|
+
*
|
13
|
+
* @default true (info in dev, warning in build)
|
14
|
+
*/
|
15
|
+
validation: S.optional(S.Union(S.Boolean, Diagnostic.Control)),
|
16
|
+
}).annotations({
|
17
|
+
identifier: 'ReferenceDiagnostics',
|
18
|
+
description: 'Diagnostic controls for reference documentation',
|
19
|
+
});
|
20
|
+
// ============================================================================
|
21
|
+
// Schema - Descriptions View
|
22
|
+
// ============================================================================
|
23
|
+
/**
|
24
|
+
* Configuration for how descriptions are displayed in reference documentation.
|
25
|
+
*/
|
26
|
+
export const DescriptionsView = S.Struct({
|
27
|
+
/**
|
28
|
+
* Default view mode for descriptions.
|
29
|
+
* - 'expanded': Show full descriptions (default)
|
30
|
+
* - 'compact': Show condensed view
|
31
|
+
*
|
32
|
+
* @default 'expanded'
|
33
|
+
*/
|
34
|
+
defaultMode: S.optional(S.Literal('compact', 'expanded')),
|
35
|
+
/**
|
36
|
+
* Whether to show the view mode toggle control.
|
37
|
+
* Allows users to switch between compact and expanded views.
|
38
|
+
*
|
39
|
+
* @default true
|
40
|
+
*/
|
41
|
+
showControl: S.optional(S.Boolean),
|
42
|
+
}).annotations({
|
43
|
+
identifier: 'DescriptionsView',
|
44
|
+
description: 'Configuration for descriptions display in reference documentation',
|
45
|
+
});
|
46
|
+
// ============================================================================
|
47
|
+
// Schema - Reference Config
|
48
|
+
// ============================================================================
|
49
|
+
export const ReferenceConfigObject = S.Struct({
|
50
|
+
/**
|
51
|
+
* Control whether the reference documentation is enabled.
|
52
|
+
* - true: Always enabled (show in nav even if no schema exists)
|
53
|
+
* - false: Always disabled (hide even if schema exists)
|
54
|
+
* - undefined: Auto-detect based on schema presence (default behavior)
|
55
|
+
*
|
56
|
+
* @default undefined (auto-detect based on schema presence)
|
57
|
+
* @example
|
58
|
+
* // Always show reference section
|
59
|
+
* reference: { enabled: true }
|
60
|
+
*
|
61
|
+
* @example
|
62
|
+
* // Never show reference
|
63
|
+
* reference: { enabled: false }
|
64
|
+
*
|
65
|
+
* @example
|
66
|
+
* // Auto-detect based on schema (default)
|
67
|
+
* reference: { }
|
68
|
+
*/
|
69
|
+
enabled: S.optional(S.Boolean),
|
70
|
+
/**
|
71
|
+
* Configuration for how descriptions are displayed.
|
72
|
+
*
|
73
|
+
* @example
|
74
|
+
* // Use compact mode by default
|
75
|
+
* descriptionsView: {
|
76
|
+
* defaultMode: 'compact'
|
77
|
+
* }
|
78
|
+
*
|
79
|
+
* @example
|
80
|
+
* // Hide the view mode toggle
|
81
|
+
* descriptionsView: {
|
82
|
+
* showControl: false
|
83
|
+
* }
|
84
|
+
*/
|
85
|
+
descriptionsView: S.optional(DescriptionsView),
|
86
|
+
/**
|
87
|
+
* Configuration for how field nullability is rendered.
|
88
|
+
* - 'bangMark': Show '!' after non-nullable types (GraphQL style)
|
89
|
+
* - 'questionMark': Show '?' after nullable field names (TypeScript style)
|
90
|
+
*
|
91
|
+
* @default 'bangMark'
|
92
|
+
* @example
|
93
|
+
* // Use TypeScript-style nullability rendering
|
94
|
+
* nullabilityRendering: 'questionMark'
|
95
|
+
*/
|
96
|
+
nullabilityRendering: S.optional(S.Literal('questionMark', 'bangMark')),
|
97
|
+
/**
|
98
|
+
* Diagnostic controls for reference documentation.
|
99
|
+
*
|
100
|
+
* @example
|
101
|
+
* // Enable all diagnostics with defaults
|
102
|
+
* diagnostics: {
|
103
|
+
* validation: true
|
104
|
+
* }
|
105
|
+
*
|
106
|
+
* @example
|
107
|
+
* // Fine-grained control
|
108
|
+
* diagnostics: {
|
109
|
+
* validation: {
|
110
|
+
* enabled: true,
|
111
|
+
* dev: { severity: 'error' },
|
112
|
+
* build: { severity: 'warning' }
|
113
|
+
* }
|
114
|
+
* }
|
115
|
+
*/
|
116
|
+
diagnostics: S.optional(ReferenceDiagnostics),
|
117
|
+
}).annotations({
|
118
|
+
identifier: 'ReferenceConfigObject',
|
119
|
+
title: 'Reference Configuration',
|
120
|
+
description: 'Configuration for reference documentation feature',
|
121
|
+
});
|
122
|
+
/**
|
123
|
+
* Reference configuration with boolean shorthand support.
|
124
|
+
* - true: Enable with defaults
|
125
|
+
* - false: Disable completely
|
126
|
+
* - object: Fine-grained control
|
127
|
+
*/
|
128
|
+
export const ReferenceConfig = S.transform(S.Union(S.Boolean, ReferenceConfigObject), ReferenceConfigObject, {
|
129
|
+
strict: false,
|
130
|
+
decode: (input) => {
|
131
|
+
if (typeof input === 'boolean') {
|
132
|
+
return {
|
133
|
+
enabled: input,
|
134
|
+
descriptionsView: {},
|
135
|
+
nullabilityRendering: undefined,
|
136
|
+
diagnostics: {},
|
137
|
+
};
|
138
|
+
}
|
139
|
+
return input;
|
140
|
+
},
|
141
|
+
encode: (config) => config,
|
142
|
+
}).annotations({
|
143
|
+
identifier: 'ReferenceConfig',
|
144
|
+
title: 'Reference Configuration',
|
145
|
+
description: 'Reference documentation configuration with boolean shortcuts',
|
146
|
+
});
|
147
|
+
// ============================================================================
|
148
|
+
// Constructors
|
149
|
+
// ============================================================================
|
150
|
+
export const make = ReferenceConfigObject.make;
|
151
|
+
// ============================================================================
|
152
|
+
// Type Guards
|
153
|
+
// ============================================================================
|
154
|
+
export const is = S.is(ReferenceConfig);
|
155
|
+
// ============================================================================
|
156
|
+
// Codecs
|
157
|
+
// ============================================================================
|
158
|
+
export const decode = S.decode(ReferenceConfig);
|
159
|
+
export const decodeSync = S.decodeSync(ReferenceConfig);
|
160
|
+
export const encode = S.encode(ReferenceConfig);
|
161
|
+
export const encodeSync = S.encodeSync(ReferenceConfig);
|
162
|
+
//# sourceMappingURL=config.js.map
|
@@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AEvC,+EAA+E;AAC/E,SAAS;AACT,+EAA+E;AAE/E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;AACvD,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,eAAe,CAAC,CAAA;AAC/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { Diagnostic } from '#lib/diagnostic/$';
|
2
|
+
import { FileSystem } from '@effect/platform';
|
3
|
+
import { Effect } from 'effect';
|
4
|
+
import * as Catalog from './catalog.js';
|
5
|
+
export interface ScanOptions {
|
6
|
+
/**
|
7
|
+
* The directory to scan for reference content
|
8
|
+
*/
|
9
|
+
dir: string;
|
10
|
+
}
|
11
|
+
export interface ScanResult {
|
12
|
+
/**
|
13
|
+
* The reference catalog with index metadata
|
14
|
+
*/
|
15
|
+
catalog: Catalog.Catalog;
|
16
|
+
/**
|
17
|
+
* Any diagnostics generated during scanning
|
18
|
+
*/
|
19
|
+
diagnostics: Diagnostic.Diagnostic[];
|
20
|
+
}
|
21
|
+
/**
|
22
|
+
* Scan for reference documentation content.
|
23
|
+
* Currently looks for index.md or index.mdx files for custom landing pages.
|
24
|
+
*/
|
25
|
+
export declare const scan: (options: ScanOptions) => Effect.Effect<ScanResult, Error, FileSystem.FileSystem>;
|
26
|
+
//# sourceMappingURL=scanner.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"scanner.d.ts","sourceRoot":"","sources":["../../../src/api/reference/scanner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AAE/B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAEvC,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,UAAU;IACzB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC,OAAO,CAAA;IACxB;;OAEG;IACH,WAAW,EAAE,UAAU,CAAC,UAAU,EAAE,CAAA;CACrC;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,GACf,SAAS,WAAW,KACnB,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAsBrD,CAAA"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import { Diagnostic } from '#lib/diagnostic/$';
|
2
|
+
import { FileSystem } from '@effect/platform';
|
3
|
+
import { Effect } from 'effect';
|
4
|
+
import * as Path from 'node:path';
|
5
|
+
import * as Catalog from './catalog.js';
|
6
|
+
/**
|
7
|
+
* Scan for reference documentation content.
|
8
|
+
* Currently looks for index.md or index.mdx files for custom landing pages.
|
9
|
+
*/
|
10
|
+
export const scan = (options) => Effect.gen(function* () {
|
11
|
+
const fs = yield* FileSystem.FileSystem;
|
12
|
+
const diagnostics = [];
|
13
|
+
// Check for index.md or index.mdx file
|
14
|
+
const indexMdPath = Path.join(options.dir, 'reference', 'index.md');
|
15
|
+
const indexMdxPath = Path.join(options.dir, 'reference', 'index.mdx');
|
16
|
+
// Try index.md first, then index.mdx
|
17
|
+
const indexPath = (yield* fs.exists(indexMdPath))
|
18
|
+
? indexMdPath
|
19
|
+
: (yield* fs.exists(indexMdxPath))
|
20
|
+
? indexMdxPath
|
21
|
+
: null;
|
22
|
+
const catalog = Catalog.make({
|
23
|
+
index: indexPath ? { path: indexPath } : undefined,
|
24
|
+
});
|
25
|
+
return { catalog, diagnostics };
|
26
|
+
});
|
27
|
+
//# sourceMappingURL=scanner.js.map
|
@@ -0,0 +1 @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,EAAE,CAAA;AACjC,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$$.d.ts","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/$$.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"$$.js","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/$$.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,mBAAmB,CAAA;AACjC,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * as Augmentations from '
|
1
|
+
export * as Augmentations from './$$.js';
|
2
2
|
//# sourceMappingURL=$.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"$.d.ts","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,
|
1
|
+
{"version":3,"file":"$.d.ts","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,SAAS,CAAA"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
export * as Augmentations from '
|
1
|
+
export * as Augmentations from './$$.js';
|
2
2
|
//# sourceMappingURL=$.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"$.js","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,
|
1
|
+
{"version":3,"file":"$.js","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/$.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,aAAa,MAAM,SAAS,CAAA"}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import type { Augmentation } from '#api/schema/augmentations/augmentation';
|
2
|
+
import type { AugmentationConfig } from '#api/schema/augmentations/config';
|
3
|
+
import { Diagnostic } from '#api/schema/augmentations/diagnostics/diagnostic';
|
4
|
+
import type { AugmentationInput } from '#api/schema/augmentations/input';
|
5
|
+
import type { GrafaidOld } from '#lib/grafaid-old';
|
6
|
+
import { Version } from '#lib/version/$';
|
7
|
+
/**
|
8
|
+
* Apply version-aware augmentations to a schema.
|
9
|
+
*
|
10
|
+
* @param schema - The GraphQL schema to augment (mutated in place)
|
11
|
+
* @param augmentations - The input augmentations (may include version specifications)
|
12
|
+
* @param version - The specific version to apply augmentations for (null for unversioned)
|
13
|
+
* @returns Diagnostics generated during augmentation application
|
14
|
+
*/
|
15
|
+
export declare const applyAll: (schema: GrafaidOld.Schema.Schema, augmentations: readonly AugmentationInput[], version?: Version.Version | null) => {
|
16
|
+
diagnostics: Diagnostic[];
|
17
|
+
};
|
18
|
+
export declare const apply: (schema: GrafaidOld.Schema.Schema, augmentation: AugmentationConfig) => Diagnostic[];
|
19
|
+
/**
|
20
|
+
* Apply a version-aware augmentation to a schema.
|
21
|
+
*
|
22
|
+
* @param schema - The GraphQL schema to augment
|
23
|
+
* @param augmentation - The normalized augmentation with version coverage
|
24
|
+
* @param version - The specific version to apply augmentations for (null for unversioned)
|
25
|
+
* @returns Diagnostics generated during augmentation application
|
26
|
+
*/
|
27
|
+
export declare const applyVersioned: (schema: GrafaidOld.Schema.Schema, augmentation: Augmentation, version: Version.Version | null) => Diagnostic[];
|
28
|
+
export declare const mutateDescription: (type: GrafaidOld.Groups.Describable, augmentation: AugmentationConfig) => void;
|
29
|
+
//# sourceMappingURL=apply.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"apply.d.ts","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/apply.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wCAAwC,CAAA;AAC1E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAC1E,OAAO,EACL,UAAU,EAIX,MAAM,kDAAkD,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAA;AAExE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAGxC;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,GACnB,QAAQ,UAAU,CAAC,MAAM,CAAC,MAAM,EAChC,eAAe,SAAS,iBAAiB,EAAE,EAC3C,UAAS,OAAO,CAAC,OAAO,GAAG,IAAW,KACrC;IAAE,WAAW,EAAE,UAAU,EAAE,CAAA;CAqC7B,CAAA;AAED,eAAO,MAAM,KAAK,GAChB,QAAQ,UAAU,CAAC,MAAM,CAAC,MAAM,EAChC,cAAc,kBAAkB,KAC/B,UAAU,EA2DZ,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,GACzB,QAAQ,UAAU,CAAC,MAAM,CAAC,MAAM,EAChC,cAAc,YAAY,EAC1B,SAAS,OAAO,CAAC,OAAO,GAAG,IAAI,KAC9B,UAAU,EAiHZ,CAAA;AAED,eAAO,MAAM,iBAAiB,GAC5B,MAAM,UAAU,CAAC,MAAM,CAAC,WAAW,EACnC,cAAc,kBAAkB,SAgBjC,CAAA"}
|
@@ -0,0 +1,181 @@
|
|
1
|
+
import { Diagnostic, makeDiagnosticDuplicateVersion, makeDiagnosticInvalidPath, makeDiagnosticVersionMismatch, } from '#api/schema/augmentations/diagnostics/diagnostic';
|
2
|
+
import { normalizeAugmentationInput } from '#api/schema/augmentations/input';
|
3
|
+
import { GraphQLPath } from '#lib/graphql-path';
|
4
|
+
import { VersionCoverage } from '#lib/version-coverage';
|
5
|
+
import { Version } from '#lib/version/$';
|
6
|
+
import { Either, HashMap, Match, Option, pipe } from 'effect';
|
7
|
+
/**
|
8
|
+
* Apply version-aware augmentations to a schema.
|
9
|
+
*
|
10
|
+
* @param schema - The GraphQL schema to augment (mutated in place)
|
11
|
+
* @param augmentations - The input augmentations (may include version specifications)
|
12
|
+
* @param version - The specific version to apply augmentations for (null for unversioned)
|
13
|
+
* @returns Diagnostics generated during augmentation application
|
14
|
+
*/
|
15
|
+
export const applyAll = (schema, augmentations, version = null) => {
|
16
|
+
const diagnostics = [];
|
17
|
+
// Track versions to detect duplicates
|
18
|
+
const seenVersions = new Map();
|
19
|
+
for (const augmentationInput of augmentations) {
|
20
|
+
// Check for duplicate versions
|
21
|
+
const versionKey = augmentationInput.versions
|
22
|
+
? Object.keys(augmentationInput.versions).sort().join(',')
|
23
|
+
: 'unversioned';
|
24
|
+
if (seenVersions.has(versionKey) && versionKey !== 'unversioned') {
|
25
|
+
const firstInput = seenVersions.get(versionKey);
|
26
|
+
diagnostics.push(makeDiagnosticDuplicateVersion({
|
27
|
+
message: `Duplicate version '${versionKey}' found in augmentation configuration`,
|
28
|
+
version: versionKey,
|
29
|
+
firstPath: firstInput.on ?? 'unknown',
|
30
|
+
duplicatePath: augmentationInput.on ?? 'unknown',
|
31
|
+
}));
|
32
|
+
continue;
|
33
|
+
}
|
34
|
+
seenVersions.set(versionKey, augmentationInput);
|
35
|
+
// Transform input to normalized format
|
36
|
+
const normalized = normalizeAugmentationInput(augmentationInput);
|
37
|
+
if (!normalized) {
|
38
|
+
console.warn('Skipping invalid augmentation configuration');
|
39
|
+
continue;
|
40
|
+
}
|
41
|
+
const applyDiagnostics = applyVersioned(schema, normalized, version);
|
42
|
+
diagnostics.push(...applyDiagnostics);
|
43
|
+
}
|
44
|
+
return { diagnostics };
|
45
|
+
};
|
46
|
+
export const apply = (schema, augmentation) => {
|
47
|
+
const diagnostics = [];
|
48
|
+
pipe(augmentation.on, Match.value, Match.when(GraphQLPath.Definition.isTypeDefinitionPath, (path) => {
|
49
|
+
pipe(GraphQLPath.Schema.locateType(schema, path), Either.match({
|
50
|
+
onLeft: (error) => {
|
51
|
+
diagnostics.push(makeDiagnosticInvalidPath({
|
52
|
+
message: `Type '${error.typeName}' not found in schema`,
|
53
|
+
path: error.path,
|
54
|
+
version: null,
|
55
|
+
error: `Type '${error.typeName}' not found`,
|
56
|
+
}));
|
57
|
+
},
|
58
|
+
onRight: (type) => {
|
59
|
+
mutateDescription(type, augmentation);
|
60
|
+
},
|
61
|
+
}));
|
62
|
+
}), Match.when(GraphQLPath.Definition.isFieldDefinitionPath, (path) => {
|
63
|
+
pipe(GraphQLPath.Schema.locateField(schema, path), Either.match({
|
64
|
+
onLeft: (error) => {
|
65
|
+
diagnostics.push(makeDiagnosticInvalidPath({
|
66
|
+
message: `Field '${error.fieldName}' not found on type '${error.typeName}'`,
|
67
|
+
path: error.path,
|
68
|
+
version: null,
|
69
|
+
error: `Field '${error.fieldName}' not found on type '${error.typeName}'`,
|
70
|
+
}));
|
71
|
+
},
|
72
|
+
onRight: (field) => {
|
73
|
+
mutateDescription(field, augmentation);
|
74
|
+
},
|
75
|
+
}));
|
76
|
+
}), Match.orElse(() => {
|
77
|
+
diagnostics.push(makeDiagnosticInvalidPath({
|
78
|
+
message: `Unsupported path type for augmentations: ${GraphQLPath.Definition.encodeSync(augmentation.on)}`,
|
79
|
+
path: GraphQLPath.Definition.encodeSync(augmentation.on),
|
80
|
+
version: null,
|
81
|
+
error: 'Unsupported path type for augmentations',
|
82
|
+
}));
|
83
|
+
}));
|
84
|
+
return diagnostics;
|
85
|
+
};
|
86
|
+
/**
|
87
|
+
* Apply a version-aware augmentation to a schema.
|
88
|
+
*
|
89
|
+
* @param schema - The GraphQL schema to augment
|
90
|
+
* @param augmentation - The normalized augmentation with version coverage
|
91
|
+
* @param version - The specific version to apply augmentations for (null for unversioned)
|
92
|
+
* @returns Diagnostics generated during augmentation application
|
93
|
+
*/
|
94
|
+
export const applyVersioned = (schema, augmentation, version) => {
|
95
|
+
const diagnostics = [];
|
96
|
+
// Try to find augmentation for this specific version
|
97
|
+
let config;
|
98
|
+
if (version) {
|
99
|
+
// First try exact version match
|
100
|
+
const versionCoverage = VersionCoverage.single(version);
|
101
|
+
const maybeConfig = HashMap.get(augmentation.versionAugmentations, versionCoverage);
|
102
|
+
if (Option.isSome(maybeConfig)) {
|
103
|
+
config = maybeConfig.value;
|
104
|
+
}
|
105
|
+
// If not found, check if any coverage matches this version
|
106
|
+
if (!config) {
|
107
|
+
for (const [coverage, cfg] of augmentation.versionAugmentations) {
|
108
|
+
if (VersionCoverage.matches(coverage, version)) {
|
109
|
+
config = cfg;
|
110
|
+
break;
|
111
|
+
}
|
112
|
+
}
|
113
|
+
}
|
114
|
+
}
|
115
|
+
else {
|
116
|
+
// For unversioned schemas, only apply unversioned augmentations
|
117
|
+
const unversionedCoverage = VersionCoverage.unversioned();
|
118
|
+
const maybeConfig = HashMap.get(augmentation.versionAugmentations, unversionedCoverage);
|
119
|
+
if (Option.isSome(maybeConfig)) {
|
120
|
+
config = maybeConfig.value;
|
121
|
+
}
|
122
|
+
}
|
123
|
+
// Apply the augmentation if found
|
124
|
+
if (config) {
|
125
|
+
pipe(config.on, Match.value, Match.when(GraphQLPath.Definition.isTypeDefinitionPath, (path) => {
|
126
|
+
pipe(GraphQLPath.Schema.locateType(schema, path), Either.match({
|
127
|
+
onLeft: (error) => {
|
128
|
+
diagnostics.push(makeDiagnosticInvalidPath({
|
129
|
+
message: `Type '${error.typeName}' not found in schema`,
|
130
|
+
path: error.path,
|
131
|
+
version: version,
|
132
|
+
error: `Type '${error.typeName}' not found`,
|
133
|
+
}));
|
134
|
+
},
|
135
|
+
onRight: (type) => {
|
136
|
+
mutateDescription(type, config);
|
137
|
+
},
|
138
|
+
}));
|
139
|
+
}), Match.when(GraphQLPath.Definition.isFieldDefinitionPath, (path) => {
|
140
|
+
pipe(GraphQLPath.Schema.locateField(schema, path), Either.match({
|
141
|
+
onLeft: (error) => {
|
142
|
+
diagnostics.push(makeDiagnosticInvalidPath({
|
143
|
+
message: `Field '${error.fieldName}' not found on type '${error.typeName}'`,
|
144
|
+
path: error.path,
|
145
|
+
version: version,
|
146
|
+
error: `Field '${error.fieldName}' not found on type '${error.typeName}'`,
|
147
|
+
}));
|
148
|
+
},
|
149
|
+
onRight: (field) => {
|
150
|
+
mutateDescription(field, config);
|
151
|
+
},
|
152
|
+
}));
|
153
|
+
}), Match.orElse(() => {
|
154
|
+
diagnostics.push(makeDiagnosticInvalidPath({
|
155
|
+
message: `Unsupported path type for augmentations: ${GraphQLPath.Definition.encodeSync(config.on)}`,
|
156
|
+
path: GraphQLPath.Definition.encodeSync(config.on),
|
157
|
+
version: version,
|
158
|
+
error: 'Unsupported path type for augmentations',
|
159
|
+
}));
|
160
|
+
}));
|
161
|
+
}
|
162
|
+
else if (version && HashMap.size(augmentation.versionAugmentations) > 0) {
|
163
|
+
// No matching version coverage found - generate version mismatch diagnostic
|
164
|
+
// Get first config from HashMap
|
165
|
+
const firstEntry = pipe(augmentation.versionAugmentations, HashMap.values, (iter) => Array.from(iter)[0]);
|
166
|
+
if (firstEntry) {
|
167
|
+
diagnostics.push(makeDiagnosticVersionMismatch({
|
168
|
+
message: `No augmentation found for version '${version}' on path '${GraphQLPath.Definition.encodeSync(firstEntry.on)}'`,
|
169
|
+
path: GraphQLPath.Definition.encodeSync(firstEntry.on),
|
170
|
+
requestedVersion: version,
|
171
|
+
availableVersions: pipe(augmentation.versionAugmentations, HashMap.keys, (iter) => Array.from(iter).map(VersionCoverage.toLabel)),
|
172
|
+
}));
|
173
|
+
}
|
174
|
+
}
|
175
|
+
return diagnostics;
|
176
|
+
};
|
177
|
+
export const mutateDescription = (type, augmentation) => {
|
178
|
+
const existingDescription = type.description?.trim() ?? '';
|
179
|
+
type.description = Match.value(augmentation.placement).pipe(Match.when('before', () => existingDescription ? `${augmentation.content}\n\n${existingDescription}` : augmentation.content), Match.when('after', () => existingDescription ? `${existingDescription}\n\n${augmentation.content}` : augmentation.content), Match.when('over', () => augmentation.content), Match.exhaustive);
|
180
|
+
};
|
181
|
+
//# sourceMappingURL=apply.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/apply.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,UAAU,EACV,8BAA8B,EAC9B,yBAAyB,EACzB,6BAA6B,GAC9B,MAAM,kDAAkD,CAAA;AAEzD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA;AAE5E,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAE7D;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,MAAgC,EAChC,aAA2C,EAC3C,UAAkC,IAAI,EACP,EAAE;IACjC,MAAM,WAAW,GAAiB,EAAE,CAAA;IAEpC,sCAAsC;IACtC,MAAM,YAAY,GAAG,IAAI,GAAG,EAA6B,CAAA;IAEzD,KAAK,MAAM,iBAAiB,IAAI,aAAa,EAAE,CAAC;QAC9C,+BAA+B;QAC/B,MAAM,UAAU,GAAG,iBAAiB,CAAC,QAAQ;YAC3C,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC;YAC1D,CAAC,CAAC,aAAa,CAAA;QAEjB,IAAI,YAAY,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,UAAU,KAAK,aAAa,E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,EAAE,OAAO;gBACzB,iBAAiB,EAAE,IAAI,CACrB,YAAY,CAAC,oBAAoB,EACjC,OAAO,CAAC,IAAI,EACZ,CAAC,IAAI,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,OAAO,CAAC,CACxD;aACF,CAAC,CAAC,CAAA;QACL,CAAC;IACH,CAAC;IAED,OAAO,WAAW,CAAA;AACpB,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAAmC,EACnC,YAAgC,EAChC,EAAE;IACF,MAAM,mBAAmB,GAAG,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,EAAE,CAAA;IAE1D,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,IAAI,CACzD,KAAK,CAAC,IAAI,CACR,QAAQ,EACR,GAAG,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC,GAAG,YAAY,CAAC,OAAO,OAAO,mBAAmB,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CACvG,EACD,KAAK,CAAC,IAAI,CACR,OAAO,EACP,GAAG,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC,GAAG,mBAAmB,OAAO,YAAY,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,OAAO,CACvG,EACD,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,EAC9C,KAAK,CAAC,UAAU,CACjB,CAAA;AACH,CAAC,CAAA"}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
import { S } from '#lib/kit-temp/effect';
|
2
|
+
import { VersionCoverage } from '#lib/version-coverage';
|
3
|
+
/**
|
4
|
+
* Internal normalized schema for description augmentations.
|
5
|
+
* Uses VersionCoverage as keys to support unversioned (all versions) and version-specific augmentations.
|
6
|
+
*/
|
7
|
+
export declare const Augmentation: S.Struct<{
|
8
|
+
versionAugmentations: S.HashMap<S.Union<[typeof VersionCoverage.VersionCoverageUnversioned, S.transformOrFail<S.Union<[typeof S.String, typeof S.Number]>, S.Union<[typeof import("../../../lib/version/integer.js").Integer, typeof import("../../../lib/version/semver.js").Semver, typeof import("../../../lib/version/date.js").Date, typeof import("../../../lib/version/custom.js").Custom]>, never>, S.HashSet<S.transformOrFail<S.Union<[typeof S.String, typeof S.Number]>, S.Union<[typeof import("../../../lib/version/integer.js").Integer, typeof import("../../../lib/version/semver.js").Semver, typeof import("../../../lib/version/date.js").Date, typeof import("../../../lib/version/custom.js").Custom]>, never>>]>, S.Struct<{
|
9
|
+
on: S.Union<[S.transformOrFail<typeof S.String, S.Tuple<[S.TaggedStruct<"TypeSegment", {
|
10
|
+
type: typeof S.String;
|
11
|
+
}>, S.TaggedStruct<"FieldSegment", {
|
12
|
+
field: typeof S.String;
|
13
|
+
}>, S.TaggedStruct<"ArgumentSegment", {
|
14
|
+
argument: typeof S.String;
|
15
|
+
}>]>, never>, S.transformOrFail<typeof S.String, S.Tuple2<S.TaggedStruct<"TypeSegment", {
|
16
|
+
type: typeof S.String;
|
17
|
+
}>, S.TaggedStruct<"FieldSegment", {
|
18
|
+
field: typeof S.String;
|
19
|
+
}>>, never>, S.transformOrFail<typeof S.String, S.Tuple<[S.TaggedStruct<"TypeSegment", {
|
20
|
+
type: typeof S.String;
|
21
|
+
}>]>, never>]>;
|
22
|
+
placement: S.Enums<{
|
23
|
+
readonly before: "before";
|
24
|
+
readonly after: "after";
|
25
|
+
readonly over: "over";
|
26
|
+
}>;
|
27
|
+
content: typeof S.String;
|
28
|
+
}>>;
|
29
|
+
}>;
|
30
|
+
export type Augmentation = S.Schema.Type<typeof Augmentation>;
|
31
|
+
//# sourceMappingURL=augmentation.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"augmentation.d.ts","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/augmentation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;EAavB,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,YAAY,CAAC,CAAA"}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { AugmentationConfig } from '#api/schema/augmentations/config';
|
2
|
+
import { S } from '#lib/kit-temp/effect';
|
3
|
+
import { VersionCoverage } from '#lib/version-coverage';
|
4
|
+
/**
|
5
|
+
* Internal normalized schema for description augmentations.
|
6
|
+
* Uses VersionCoverage as keys to support unversioned (all versions) and version-specific augmentations.
|
7
|
+
*/
|
8
|
+
export const Augmentation = S.Struct({
|
9
|
+
// Map from VersionCoverage to augmentation config
|
10
|
+
// Key can be:
|
11
|
+
// - VersionCoverageUnversioned: applies to all versions
|
12
|
+
// - VersionCoverageOne: applies to a specific version
|
13
|
+
// - VersionCoverageSet: applies to a set of versions (future enhancement)
|
14
|
+
versionAugmentations: S.HashMap({
|
15
|
+
key: VersionCoverage.VersionCoverage,
|
16
|
+
value: AugmentationConfig,
|
17
|
+
}),
|
18
|
+
}).annotations({
|
19
|
+
identifier: 'AugmentationNormalized',
|
20
|
+
description: 'Internal normalized description augmentation with version coverage support',
|
21
|
+
});
|
22
|
+
//# sourceMappingURL=augmentation.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"augmentation.js","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/augmentation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AACrE,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAA;AAEvD;;;GAGG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,kDAAkD;IAClD,cAAc;IACd,wDAAwD;IACxD,sDAAsD;IACtD,0EAA0E;IAC1E,oBAAoB,EAAE,CAAC,CAAC,OAAO,CAAC;QAC9B,GAAG,EAAE,eAAe,CAAC,eAAe;QACpC,KAAK,EAAE,kBAAkB;KAC1B,CAAC;CACH,CAAC,CAAC,WAAW,CAAC;IACb,UAAU,EAAE,wBAAwB;IACpC,WAAW,EAAE,4EAA4E;CAC1F,CAAC,CAAA"}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import { S } from '#lib/kit-temp/effect';
|
2
|
+
export declare const AugmentationConfig: S.Struct<{
|
3
|
+
on: S.Union<[S.transformOrFail<typeof S.String, S.Tuple<[S.TaggedStruct<"TypeSegment", {
|
4
|
+
type: typeof S.String;
|
5
|
+
}>, S.TaggedStruct<"FieldSegment", {
|
6
|
+
field: typeof S.String;
|
7
|
+
}>, S.TaggedStruct<"ArgumentSegment", {
|
8
|
+
argument: typeof S.String;
|
9
|
+
}>]>, never>, S.transformOrFail<typeof S.String, S.Tuple2<S.TaggedStruct<"TypeSegment", {
|
10
|
+
type: typeof S.String;
|
11
|
+
}>, S.TaggedStruct<"FieldSegment", {
|
12
|
+
field: typeof S.String;
|
13
|
+
}>>, never>, S.transformOrFail<typeof S.String, S.Tuple<[S.TaggedStruct<"TypeSegment", {
|
14
|
+
type: typeof S.String;
|
15
|
+
}>]>, never>]>;
|
16
|
+
placement: S.Enums<{
|
17
|
+
readonly before: "before";
|
18
|
+
readonly after: "after";
|
19
|
+
readonly over: "over";
|
20
|
+
}>;
|
21
|
+
content: typeof S.String;
|
22
|
+
}>;
|
23
|
+
export type AugmentationConfig = S.Schema.Type<typeof AugmentationConfig>;
|
24
|
+
//# sourceMappingURL=config.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAExC,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;EAI7B,CAAA;AAEF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAA"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { Placement } from '#api/schema/augmentations/placement';
|
2
|
+
import { GraphQLPath } from '#lib/graphql-path';
|
3
|
+
import { S } from '#lib/kit-temp/effect';
|
4
|
+
export const AugmentationConfig = S.Struct({
|
5
|
+
on: GraphQLPath.Definition.DefinitionPath,
|
6
|
+
placement: Placement,
|
7
|
+
content: S.String,
|
8
|
+
});
|
9
|
+
//# sourceMappingURL=config.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/api/schema/augmentations/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qCAAqC,CAAA;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,sBAAsB,CAAA;AAExC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,EAAE,EAAE,WAAW,CAAC,UAAU,CAAC,cAAc;IACzC,SAAS,EAAE,SAAS;IACpB,OAAO,EAAE,CAAC,CAAC,MAAM;CAClB,CAAC,CAAA"}
|