laranex-schema-viewer-ui 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/NOTICE +11 -0
- package/README.md +20 -2
- package/contract/allowlist.schema.json +62 -0
- package/contract/check.mjs +7 -3
- package/contract/conformance/comparison/column-fields-same-driver.json +387 -0
- package/contract/conformance/comparison/combined-declared-only.json +275 -0
- package/contract/conformance/comparison/constraints.json +356 -0
- package/contract/conformance/comparison/cross-driver-types.json +453 -0
- package/contract/conformance/comparison/foreign-key-matching.json +615 -0
- package/contract/conformance/comparison/incomplete-coverage.json +214 -0
- package/contract/conformance/comparison/incomplete-limit.json +249 -0
- package/contract/conformance/comparison/index-matching.json +588 -0
- package/contract/conformance/comparison/primary-key.json +443 -0
- package/contract/conformance/comparison/referential-actions-mysql.json +321 -0
- package/contract/conformance/comparison/severity-overrides.json +283 -0
- package/contract/conformance/comparison/tables-missing-extra.json +306 -0
- package/contract/conformance/comparison/tenant-schemas-equal.json +329 -0
- package/contract/conformance/comparison/unnamed-duplicates.json +268 -0
- package/contract/conformance/comparison-diagnostics/both-sides-and-omitted.json +330 -0
- package/contract/conformance/comparison-diagnostics/complete.json +390 -0
- package/contract/conformance/comparison-diagnostics/coverage.json +405 -0
- package/contract/conformance/comparison-diagnostics/limit-zero.json +335 -0
- package/contract/conformance/comparison-diagnostics/omitted.json +370 -0
- package/contract/conformance/comparison-diagnostics/tenant-schema-label.json +162 -0
- package/contract/conformance/coverage-gaps/combined-document.json +71 -0
- package/contract/conformance/coverage-gaps/complete.json +53 -0
- package/contract/conformance/coverage-gaps/coverage-unknown.json +33 -0
- package/contract/conformance/coverage-gaps/declared-document.json +56 -0
- package/contract/conformance/coverage-gaps/default-schema-not-read.json +57 -0
- package/contract/conformance/coverage-gaps/default-schema-unknown.json +52 -0
- package/contract/conformance/coverage-gaps/feature-states.json +65 -0
- package/contract/conformance/coverage-gaps/features-then-schema.json +67 -0
- package/contract/conformance/coverage-gaps/not-applicable.json +50 -0
- package/contract/conformance/coverage-gaps/schema-not-read.json +58 -0
- package/contract/conformance/coverage-gaps/schemas-unknown.json +50 -0
- package/contract/conformance/gate/comparison-drift.json +346 -0
- package/contract/conformance/gate/diagnostics-only.json +257 -0
- package/contract/conformance/gate/extraction-warning-only.json +176 -0
- package/contract/conformance/gate/failed-inspection.json +183 -0
- package/contract/conformance/gate/incomplete-comparison.json +310 -0
- package/contract/conformance/gate/incomplete-coverage.json +355 -0
- package/contract/conformance/gate/incomplete-required-coverage.json +233 -0
- package/contract/conformance/gate/invalid-document.json +52 -0
- package/contract/conformance/gate/migration-only.json +650 -0
- package/contract/conformance/gate/migration-unknown.json +315 -0
- package/contract/conformance/gate/newer-minor.json +352 -0
- package/contract/conformance/gate/not-a-document.json +37 -0
- package/contract/conformance/gate/partial-coverage.json +242 -0
- package/contract/conformance/gate/precedence.json +431 -0
- package/contract/conformance/gate/requested-missing.json +417 -0
- package/contract/conformance/gate/requested-none.json +245 -0
- package/contract/conformance/gate/requested-wildcard-empty.json +189 -0
- package/contract/conformance/gate/requested-wildcard.json +387 -0
- package/contract/conformance/gate/threshold-below-severity.json +312 -0
- package/contract/conformance/gate/threshold-likely-at-certainty.json +312 -0
- package/contract/conformance/gate/threshold-likely-below-certainty.json +312 -0
- package/contract/conformance/gate/unsupported-version.json +269 -0
- package/contract/conformance/gate/zero-comparisons.json +242 -0
- package/contract/conformance/graph/composite-unordered-pairs.json +1 -1
- package/contract/conformance/graph/cross-connection-foreign-key.json +1 -1
- package/contract/conformance/graph/cross-connection-relationship.json +1 -1
- package/contract/conformance/graph/duplicate-foreign-keys.json +1 -1
- package/contract/conformance/graph/duplicate-table-names.json +1 -1
- package/contract/conformance/graph/foreign-key-and-relationships.json +1 -1
- package/contract/conformance/graph/foreign-key-only.json +1 -1
- package/contract/conformance/graph/link-note.json +1 -1
- package/contract/conformance/graph/multiple-between-tables.json +1 -1
- package/contract/conformance/graph/pivot.json +1 -1
- package/contract/conformance/graph/polymorphic.json +1 -1
- package/contract/conformance/graph/relationship-only.json +1 -1
- package/contract/conformance/graph/self-reference.json +1 -1
- package/contract/conformance/graph/through.json +1 -1
- package/contract/conformance/graph/unresolved-endpoint.json +1 -1
- package/contract/conformance/inference/association-table-without-key.json +283 -0
- package/contract/conformance/inference/association-table.json +314 -0
- package/contract/conformance/inference/composite-foreign-key.json +295 -0
- package/contract/conformance/inference/covered-by-relationship.json +224 -0
- package/contract/conformance/inference/many-to-one.json +223 -0
- package/contract/conformance/inference/multiple-foreign-keys.json +318 -0
- package/contract/conformance/inference/multiple-models.json +241 -0
- package/contract/conformance/inference/one-to-one-unique-constraint.json +241 -0
- package/contract/conformance/inference/one-to-one-unique-index.json +423 -0
- package/contract/conformance/inference/self-reference.json +169 -0
- package/contract/conformance/inference/unconfirmed-foreign-key.json +223 -0
- package/contract/conformance/inference/unmapped-tables.json +273 -0
- package/contract/conformance/migrations/behind.json +64 -0
- package/contract/conformance/migrations/diverged.json +62 -0
- package/contract/conformance/migrations/history-unavailable.json +15 -0
- package/contract/conformance/migrations/merge-behind.json +80 -0
- package/contract/conformance/migrations/missing-parent-recorded.json +55 -0
- package/contract/conformance/migrations/multiple-heads-behind.json +68 -0
- package/contract/conformance/migrations/multiple-heads-up-to-date.json +67 -0
- package/contract/conformance/migrations/partial-history-behind.json +55 -0
- package/contract/conformance/migrations/partial-history-missing-pending.json +69 -0
- package/contract/conformance/migrations/uninitialized-without-history.json +13 -0
- package/contract/conformance/migrations/uninitialized.json +63 -0
- package/contract/conformance/migrations/unknown-revision.json +64 -0
- package/contract/conformance/migrations/up-to-date.json +61 -0
- package/contract/conformance/migrations/version-table-unreadable.json +59 -0
- package/contract/conformance/overrides/empty.json +9 -0
- package/contract/conformance/overrides/every-field.json +262 -0
- package/contract/conformance/overrides/field-of-another-type.json +32 -0
- package/contract/conformance/overrides/field-on-missing-or-extra.json +25 -0
- package/contract/conformance/overrides/malformed.json +37 -0
- package/contract/conformance/overrides/not-an-array.json +15 -0
- package/contract/conformance/overrides/repeated.json +41 -0
- package/contract/conformance/overrides/unknown-field.json +18 -0
- package/contract/conformance/overrides/unknown-values.json +32 -0
- package/contract/conformance/requests/duplicates.json +271 -0
- package/contract/conformance/requests/explicit-over-wildcard.json +212 -0
- package/contract/conformance/requests/explicit-pairs.json +192 -0
- package/contract/conformance/requests/no-requests.json +130 -0
- package/contract/conformance/requests/ordering.json +271 -0
- package/contract/conformance/requests/unknown-connection.json +218 -0
- package/contract/conformance/requests/wildcard-baseline-is-a-name.json +162 -0
- package/contract/conformance/requests/wildcard-declared-coverage.json +82 -0
- package/contract/conformance/requests/wildcard-default-schema.json +202 -0
- package/contract/conformance/requests/wildcard-no-match.json +180 -0
- package/contract/conformance/requests/wildcard-no-schemas.json +180 -0
- package/contract/conformance/requests/wildcard-other-connection.json +222 -0
- package/contract/conformance/requests/wildcard-tenants.json +202 -0
- package/contract/conformance/scan/allowlist-crlf.json +61 -0
- package/contract/conformance/scan/allowlist-exact.json +61 -0
- package/contract/conformance/scan/allowlist-include-cycle.json +72 -0
- package/contract/conformance/scan/allowlist-include-root.json +72 -0
- package/contract/conformance/scan/allowlist-invalid.json +66 -0
- package/contract/conformance/scan/allowlist-missing-include.json +67 -0
- package/contract/conformance/scan/allowlist-moved.json +76 -0
- package/contract/conformance/scan/allowlist-stale-entry.json +74 -0
- package/contract/conformance/scan/allowlist-tampered.json +61 -0
- package/contract/conformance/scan/embedded-json-parse-bundle.json +50 -0
- package/contract/conformance/scan/embedded-object-literal-bundle.json +50 -0
- package/contract/conformance/scan/embedded-offline-html.json +50 -0
- package/contract/conformance/scan/embedded-source-map.json +50 -0
- package/contract/conformance/scan/embedded-viewer-global.json +50 -0
- package/contract/conformance/scan/history-path-at-commit.json +108 -0
- package/contract/conformance/scan/near-miss-contract-format.json +46 -0
- package/contract/conformance/scan/near-miss-depth-7.json +40 -0
- package/contract/conformance/scan/near-miss-gate-format.json +46 -0
- package/contract/conformance/scan/near-miss-javascript-in-tree.json +40 -0
- package/contract/conformance/scan/near-miss-no-connections-json.json +40 -0
- package/contract/conformance/scan/near-miss-numeric-version.json +40 -0
- package/contract/conformance/scan/near-miss-viewer-global-without-schema.json +40 -0
- package/contract/conformance/scan/negative-gate-report.json +40 -0
- package/contract/conformance/scan/negative-json-schemas.json +46 -0
- package/contract/conformance/scan/negative-package-manifests.json +64 -0
- package/contract/conformance/scan/negative-validator-code.json +40 -0
- package/contract/conformance/scan/negative-viewer-manifest.json +46 -0
- package/contract/conformance/scan/positive-byte-order-mark.json +50 -0
- package/contract/conformance/scan/positive-canonical.json +50 -0
- package/contract/conformance/scan/positive-compact.json +50 -0
- package/contract/conformance/scan/positive-legacy-laravel-envelope.json +50 -0
- package/contract/conformance/scan/positive-legacy-node-v1.json +50 -0
- package/contract/conformance/scan/positive-legacy-python-v1.json +50 -0
- package/contract/conformance/scan/positive-nested-depth-3.json +50 -0
- package/contract/conformance/scan/positive-nested-depth-6.json +50 -0
- package/contract/conformance/scan/positive-nested-in-array.json +50 -0
- package/contract/conformance/scan/positive-nested-legacy.json +50 -0
- package/contract/conformance/scan/positive-version-1-0.json +50 -0
- package/contract/conformance/scan/positive-version-3-0.json +50 -0
- package/contract/conformance/scan/precedence-clean.json +40 -0
- package/contract/conformance/scan/precedence-confirmed-over-uncertain.json +65 -0
- package/contract/conformance/scan/precedence-incomplete-over-confirmed.json +67 -0
- package/contract/conformance/scan/uncertain-html-fragment.json +65 -0
- package/contract/conformance/scan/uncertain-truncated-format.json +50 -0
- package/contract/conformance/scan/uncertain-truncated-json.json +50 -0
- package/contract/conformance/store/add-to-empty.json +596 -0
- package/contract/conformance/store/complete-drops-diagnostic.json +516 -0
- package/contract/conformance/store/idempotent.json +701 -0
- package/contract/conformance/store/replace.json +639 -0
- package/contract/fixtures/gate/invalid/checked-comparisons-unsorted.json +265 -0
- package/contract/fixtures/gate/invalid/comparison-finding-kind.json +264 -0
- package/contract/fixtures/gate/invalid/counts-mismatch.json +264 -0
- package/contract/fixtures/gate/invalid/exit-code-out-of-range.json +84 -0
- package/contract/fixtures/gate/invalid/finding-wrong-id.json +264 -0
- package/contract/fixtures/gate/invalid/findings-unsorted.json +264 -0
- package/contract/fixtures/gate/invalid/incomplete-reported-as-drift.json +84 -0
- package/contract/fixtures/gate/invalid/invalid-document-with-findings.json +34 -0
- package/contract/fixtures/gate/invalid/migration-finding-severity.json +264 -0
- package/contract/fixtures/gate/invalid/passed-flag-mismatch.json +264 -0
- package/contract/fixtures/gate/invalid/passed-with-qualifying-findings.json +264 -0
- package/contract/fixtures/gate/invalid/requested-unsorted.json +285 -0
- package/contract/fixtures/gate/invalid/unknown-error-kind.json +84 -0
- package/contract/fixtures/gate/valid/drift.json +258 -0
- package/contract/fixtures/gate/valid/incomplete.json +78 -0
- package/contract/fixtures/gate/valid/invalid.json +26 -0
- package/contract/fixtures/gate/valid/migrations.json +102 -0
- package/contract/fixtures/gate/valid/passed.json +58 -0
- package/contract/fixtures/gate/valid/requested.json +269 -0
- package/contract/fixtures/invalid/backs-check-constraint.json +5 -53
- package/contract/fixtures/invalid/column-subject-without-columns.json +642 -0
- package/contract/fixtures/invalid/comparison-omitted-but-complete.json +2232 -0
- package/contract/fixtures/invalid/comparison-same-scope.json +2749 -0
- package/contract/fixtures/invalid/comparison-summary-mismatch.json +2749 -0
- package/contract/fixtures/invalid/comparison-unknown-connection.json +2749 -0
- package/contract/fixtures/invalid/comparison-wrong-id.json +2749 -0
- package/contract/fixtures/invalid/coverage-claims-complete.json +12 -17
- package/contract/fixtures/invalid/coverage-for-wrong-source.json +4 -32
- package/contract/fixtures/invalid/diagnostic-unknown-subject.json +12 -17
- package/contract/fixtures/invalid/diagnostic-wrong-id.json +644 -0
- package/contract/fixtures/invalid/difference-changed-without-fields.json +2743 -0
- package/contract/fixtures/invalid/difference-key-names-schema.json +2749 -0
- package/contract/fixtures/invalid/difference-key-unknown-column.json +2749 -0
- package/contract/fixtures/invalid/difference-missing-with-target.json +2753 -0
- package/contract/fixtures/invalid/difference-side-outside-scope.json +2749 -0
- package/contract/fixtures/invalid/difference-side-wrong-entity.json +2749 -0
- package/contract/fixtures/invalid/difference-wrong-id.json +2749 -0
- package/contract/fixtures/invalid/differences-unsorted.json +2749 -0
- package/contract/fixtures/invalid/drift-without-both-sources.json +12 -17
- package/contract/fixtures/invalid/{index-columns-out-of-order.json → driver-alias.json} +6 -54
- package/contract/fixtures/invalid/duplicate-ids.json +5 -29
- package/contract/fixtures/invalid/foreign-key-across-connections.json +8 -26
- package/contract/fixtures/invalid/foreign-key-column-counts.json +5 -11
- package/contract/fixtures/invalid/foreign-key-unknown-target.json +5 -53
- package/contract/fixtures/invalid/index-part-column-and-expression.json +5 -53
- package/contract/fixtures/invalid/inferred-covered-foreign-key.json +2176 -0
- package/contract/fixtures/invalid/inferred-kind-mismatch.json +2191 -0
- package/contract/fixtures/invalid/inferred-model-not-mapping-table.json +2191 -0
- package/contract/fixtures/invalid/inferred-unknown-foreign-key.json +2191 -0
- package/contract/fixtures/invalid/inferred-wrong-id.json +2191 -0
- package/contract/fixtures/invalid/inferred-wrong-links.json +2191 -0
- package/contract/fixtures/invalid/link-state-mismatch.json +44 -97
- package/contract/fixtures/invalid/migration-coverage-wrong-table.json +1699 -0
- package/contract/fixtures/invalid/migration-revisions-without-version-table.json +1699 -0
- package/contract/fixtures/invalid/migration-unknown-coverage-certain.json +1699 -0
- package/contract/fixtures/invalid/migration-unlisted-unknown-revision.json +1697 -0
- package/contract/fixtures/invalid/migration-version-table-outside-scope.json +1699 -0
- package/contract/fixtures/invalid/migration-wrong-heads.json +1698 -0
- package/contract/fixtures/invalid/migration-wrong-id.json +1699 -0
- package/contract/fixtures/invalid/migration-wrong-missing.json +1697 -0
- package/contract/fixtures/invalid/migration-wrong-status.json +1695 -0
- package/contract/fixtures/invalid/missing-field.json +5 -15
- package/contract/fixtures/invalid/pivot-unknown-column.json +44 -97
- package/contract/fixtures/invalid/predicate-without-partial.json +5 -15
- package/contract/fixtures/invalid/primary-index-not-unique.json +6 -54
- package/contract/fixtures/invalid/primary-index-other-columns.json +811 -0
- package/contract/fixtures/invalid/provenance-outside-source.json +5 -15
- package/contract/fixtures/invalid/related-model-missing.json +12 -17
- package/contract/fixtures/invalid/strict-other-minor.json +301 -0
- package/contract/fixtures/invalid/unknown-property-strict.json +6 -16
- package/contract/fixtures/invalid/unsupported-major.json +7 -17
- package/contract/fixtures/invalid/wrong-format.json +5 -15
- package/contract/fixtures/valid/combined-drift.json +12 -17
- package/contract/fixtures/valid/combined-eloquent.json +44 -97
- package/contract/fixtures/valid/combined-multi-connection.json +8 -26
- package/contract/fixtures/valid/comparison-incomplete.json +2225 -0
- package/contract/fixtures/valid/comparison-multi-connection.json +889 -0
- package/contract/fixtures/valid/comparison-schema-named-tables.json +381 -0
- package/contract/fixtures/valid/comparison-tenant-schemas.json +2742 -0
- package/contract/fixtures/valid/database-mysql-indexes.json +4 -32
- package/contract/fixtures/valid/database-postgresql-indexes.json +5 -53
- package/contract/fixtures/valid/database-sqlite-indexes.json +5 -15
- package/contract/fixtures/valid/declared-multi-connection.json +4 -1
- package/contract/fixtures/valid/declared-sqlalchemy.json +5 -11
- package/contract/fixtures/valid/inferred-associations.json +2184 -0
- package/contract/fixtures/valid/migrations-alembic.json +1692 -0
- package/contract/gate-report.schema.json +242 -0
- package/contract/scan-report.schema.json +218 -0
- package/contract/scan.mjs +355 -0
- package/contract/schema.json +636 -18
- package/contract/synthetic.json +370 -0
- package/dist/lib/contract-ZsLKbScP.js +803 -0
- package/dist/lib/contract-ZsLKbScP.js.map +1 -0
- package/dist/lib/contract.js +3 -1
- package/dist/lib/export-oCZEaixp.js +651 -0
- package/dist/lib/export-oCZEaixp.js.map +1 -0
- package/dist/lib/export.js +1 -0
- package/dist/lib/index.js +4373 -1821
- package/dist/lib/index.js.map +1 -1
- package/dist/lib/styles.css +1 -1
- package/dist/lib/validate-B1oz49AC.js +1784 -0
- package/dist/lib/validate-B1oz49AC.js.map +1 -0
- package/dist/types/contract/comparison.d.ts +65 -0
- package/dist/types/contract/document.d.ts +2 -2
- package/dist/types/contract/gate.d.ts +63 -0
- package/dist/types/contract/ids.d.ts +10 -0
- package/dist/types/contract/index.d.ts +6 -0
- package/dist/types/contract/inference.d.ts +10 -0
- package/dist/types/contract/migration.d.ts +8 -0
- package/dist/types/contract/scan.d.ts +114 -0
- package/dist/types/contract/serialize.d.ts +1 -0
- package/dist/types/contract/sha256.d.ts +1 -0
- package/dist/types/contract/types.d.ts +122 -5
- package/dist/types/export/common.d.ts +44 -0
- package/dist/types/export/dbml.d.ts +3 -0
- package/dist/types/export/index.d.ts +10 -0
- package/dist/types/export/json.d.ts +7 -0
- package/dist/types/export/markdown.d.ts +4 -0
- package/dist/types/export/mermaid.d.ts +4 -0
- package/dist/types/export/types.d.ts +28 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/viewer/Browse.d.ts +6 -2
- package/dist/types/viewer/Compare.d.ts +39 -0
- package/dist/types/viewer/Details.d.ts +40 -7
- package/dist/types/viewer/DownloadDialog.d.ts +16 -0
- package/dist/types/viewer/Inferred.d.ts +20 -0
- package/dist/types/viewer/Migrations.d.ts +14 -0
- package/dist/types/viewer/SchemaEdge.d.ts +3 -1
- package/dist/types/viewer/SchemaViewer.d.ts +2 -0
- package/dist/types/viewer/TableNode.d.ts +6 -0
- package/dist/types/viewer/brand.d.ts +32 -0
- package/dist/types/viewer/exportImage.d.ts +21 -2
- package/dist/types/viewer/graph.d.ts +16 -2
- package/dist/types/viewer/icons.d.ts +96 -0
- package/dist/types/viewer/intelligence.d.ts +55 -0
- package/dist/types/viewer/layout.d.ts +5 -0
- package/dist/types/viewer/offline.d.ts +9 -0
- package/dist/types/viewer/ui.d.ts +7 -29
- package/dist/viewer/app.css +1 -1
- package/dist/viewer/app.js +36 -8
- package/dist/viewer/favicon.ico +0 -0
- package/dist/viewer/favicon.svg +1 -1
- package/dist/viewer/index.html +2 -2
- package/dist/viewer/manifest.json +19 -13
- package/dist/viewer/offline.js +67 -0
- package/docs/contract.md +646 -26
- package/docs/integration.md +16 -8
- package/package.json +7 -2
- package/dist/lib/contract-N4axHCW3.js +0 -774
- package/dist/lib/contract-N4axHCW3.js.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
import type { Diagnostic, Extensions, Provenance, SchemaDocument, Table } from '../contract/types';
|
|
2
|
+
import type { Diagnostic, Extensions, Provenance, SchemaDocument, Source, Table } from '../contract/types';
|
|
3
3
|
import type { ViewerChange } from '../contract/viewer-config';
|
|
4
4
|
import { type GraphEdge, type Lookup } from './graph';
|
|
5
5
|
export type ExtensionRenderers = Record<string, (value: Extensions[string]) => ReactNode>;
|
|
@@ -22,40 +22,73 @@ export declare function ProvenanceBadge({ provenance, kind, ctx }: {
|
|
|
22
22
|
kind: Kind;
|
|
23
23
|
ctx: DetailContext;
|
|
24
24
|
}): import("react").JSX.Element | null;
|
|
25
|
+
export declare function editorHref(editor: string | null, source: Source): string | null;
|
|
25
26
|
export declare function ExtensionsView({ extensions, renderers }: {
|
|
26
27
|
extensions: Extensions | undefined;
|
|
27
28
|
renderers: ExtensionRenderers;
|
|
28
29
|
}): import("react").JSX.Element | null;
|
|
29
|
-
export declare function DiagnosticList({ diagnostics }: {
|
|
30
|
+
export declare function DiagnosticList({ diagnostics, renderers }: {
|
|
30
31
|
diagnostics: Diagnostic[];
|
|
32
|
+
renderers?: ExtensionRenderers;
|
|
31
33
|
}): import("react").JSX.Element;
|
|
32
34
|
export declare const diagnosticTitle: (kind: string) => string;
|
|
33
|
-
export declare function Overview({ ctx, onShortcuts, onTour }: {
|
|
35
|
+
export declare function Overview({ ctx, onShortcuts, onTour, onCompare, onMigrations, onInferred, }: {
|
|
34
36
|
ctx: DetailContext;
|
|
35
37
|
onShortcuts: () => void;
|
|
36
38
|
onTour: () => void;
|
|
39
|
+
onCompare?: () => void;
|
|
40
|
+
onMigrations?: () => void;
|
|
41
|
+
onInferred?: () => void;
|
|
37
42
|
}): import("react").JSX.Element;
|
|
38
|
-
export
|
|
43
|
+
export type SubjectActions = {
|
|
44
|
+
comparison: (id: string) => void;
|
|
45
|
+
migration: (id: string) => void;
|
|
46
|
+
inferredAssociation: (id: string) => void;
|
|
47
|
+
};
|
|
48
|
+
export declare function DiagnosticsPanel({ doc, diagnostics, connection, documentWide, lookup, tableOf, onShow, onSubject, renderers, }: {
|
|
39
49
|
doc: SchemaDocument;
|
|
50
|
+
diagnostics?: Diagnostic[];
|
|
51
|
+
connection?: string | null;
|
|
52
|
+
documentWide?: (d: Diagnostic) => boolean;
|
|
40
53
|
lookup: Lookup;
|
|
41
54
|
tableOf: (d: Diagnostic) => string | undefined;
|
|
42
55
|
onShow: (table: string) => void;
|
|
56
|
+
onSubject?: SubjectActions;
|
|
57
|
+
renderers?: ExtensionRenderers;
|
|
43
58
|
}): import("react").JSX.Element;
|
|
44
|
-
export declare function ChangesPanel({ changes }: {
|
|
59
|
+
export declare function ChangesPanel({ changes, connection, onSubject, }: {
|
|
45
60
|
changes: ViewerChange[];
|
|
61
|
+
connection?: string | null;
|
|
62
|
+
onSubject?: (subject: string) => (() => void) | null;
|
|
46
63
|
}): import("react").JSX.Element;
|
|
47
|
-
export declare function TableDetails({ ctx, table, edges, onFocus, onClear, onCopyLink, onSelectEdge, onSelectTable, }: {
|
|
64
|
+
export declare function TableDetails({ ctx, table, edges, onFocus, onClear, onCopyLink, onSelectEdge, onSelectTable, onCompare, onInferred, onMigration, onColumn, }: {
|
|
48
65
|
ctx: DetailContext;
|
|
49
66
|
table: Table;
|
|
50
67
|
edges: GraphEdge[];
|
|
68
|
+
onColumn?: (name: string) => void;
|
|
51
69
|
onFocus: () => void;
|
|
52
70
|
onClear: () => void;
|
|
53
71
|
onCopyLink: () => void;
|
|
54
72
|
onSelectEdge: (edge: GraphEdge) => void;
|
|
55
73
|
onSelectTable: (id: string) => void;
|
|
74
|
+
onCompare?: (comparison: string, difference: string) => void;
|
|
75
|
+
onInferred?: (id: string) => void;
|
|
76
|
+
onMigration?: (id: string) => void;
|
|
56
77
|
}): import("react").JSX.Element;
|
|
57
|
-
export declare
|
|
78
|
+
export declare const usesColumn: (edge: GraphEdge, table: string, column: string) => boolean;
|
|
79
|
+
export declare function ColumnDetails({ ctx, table, column: name, edges, onBack, onSelectEdge, onSelectTable, }: {
|
|
80
|
+
ctx: DetailContext;
|
|
81
|
+
table: Table;
|
|
82
|
+
column: string;
|
|
83
|
+
edges: GraphEdge[];
|
|
84
|
+
onBack: () => void;
|
|
85
|
+
onSelectEdge: (edge: GraphEdge) => void;
|
|
86
|
+
onSelectTable: (id: string) => void;
|
|
87
|
+
}): import("react").JSX.Element | null;
|
|
88
|
+
export declare function EdgeDetails({ edge, ctx, onSelectTable, onInferred, onFocus }: {
|
|
58
89
|
edge: GraphEdge;
|
|
59
90
|
ctx: DetailContext;
|
|
60
91
|
onSelectTable: (id: string) => void;
|
|
92
|
+
onInferred?: (id: string) => void;
|
|
93
|
+
onFocus?: () => void;
|
|
61
94
|
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { SchemaDocument } from '../contract/types';
|
|
2
|
+
import type { ViewerDownload } from '../contract/viewer-config';
|
|
3
|
+
export type ImageArea = 'whole' | 'screen';
|
|
4
|
+
type Props = {
|
|
5
|
+
open: boolean;
|
|
6
|
+
onClose: () => void;
|
|
7
|
+
doc: SchemaDocument;
|
|
8
|
+
initialConnection: string;
|
|
9
|
+
shownTables: number;
|
|
10
|
+
onImage: (format: 'svg' | 'png', area: ImageArea) => Promise<string>;
|
|
11
|
+
onOffline: (() => Promise<string>) | null;
|
|
12
|
+
onWholeDocument: (() => void) | null;
|
|
13
|
+
downloads: ViewerDownload[];
|
|
14
|
+
};
|
|
15
|
+
export declare function DownloadDialog({ open, onClose, doc, initialConnection, shownTables, onImage, onOffline, onWholeDocument, downloads }: Props): import("react").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { InferredAssociation, SchemaDocument } from '../contract/types';
|
|
2
|
+
import type { GraphEdge, Lookup } from './graph';
|
|
3
|
+
export declare const NO_ATTRIBUTE = "No ORM relationship attribute is declared for it: this is an inference from foreign keys, not a relationship. Even high confidence never means one exists.";
|
|
4
|
+
export declare function InferredTag(): import("react").JSX.Element;
|
|
5
|
+
export declare function ConfidenceBadge({ confidence }: {
|
|
6
|
+
confidence: InferredAssociation['confidence'];
|
|
7
|
+
}): import("react").JSX.Element;
|
|
8
|
+
export declare function InferredDetails({ association: a, doc, lookup, edges, onSelectTable, onSelectEdge, }: {
|
|
9
|
+
association: InferredAssociation;
|
|
10
|
+
doc: SchemaDocument;
|
|
11
|
+
lookup: Lookup;
|
|
12
|
+
edges: GraphEdge[];
|
|
13
|
+
onSelectTable: (id: string) => void;
|
|
14
|
+
onSelectEdge: (edge: GraphEdge) => void;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export declare function InferredItem({ association: a, lookup, onOpen }: {
|
|
17
|
+
association: InferredAssociation;
|
|
18
|
+
lookup: Lookup;
|
|
19
|
+
onOpen: (id: string) => void;
|
|
20
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type MigrationStatus, type SchemaDocument } from '../contract/types';
|
|
2
|
+
import type { Lookup } from './graph';
|
|
3
|
+
export declare function StatusBadge({ status }: {
|
|
4
|
+
status: MigrationStatus;
|
|
5
|
+
}): import("react").JSX.Element;
|
|
6
|
+
type Props = {
|
|
7
|
+
doc: SchemaDocument;
|
|
8
|
+
lookup: Lookup;
|
|
9
|
+
selected: string | null;
|
|
10
|
+
onSelect: (id: string | null) => void;
|
|
11
|
+
onShowTable: (id: string) => void;
|
|
12
|
+
};
|
|
13
|
+
export declare function MigrationsPanel({ doc, lookup, selected, onSelect, onShowTable }: Props): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { type Edge, type EdgeProps } from '@xyflow/react';
|
|
2
|
-
import type
|
|
2
|
+
import { type EdgeKind } from './graph';
|
|
3
3
|
import { type Route } from './routing';
|
|
4
4
|
export type SchemaEdgeData = {
|
|
5
5
|
kind: EdgeKind;
|
|
6
6
|
declaredOnly: boolean;
|
|
7
7
|
polymorphic: boolean;
|
|
8
8
|
crossConnection: boolean;
|
|
9
|
+
inferred: boolean;
|
|
9
10
|
label: string;
|
|
10
11
|
chip: string;
|
|
11
12
|
route: Route | null;
|
|
12
13
|
showLabel: boolean;
|
|
13
14
|
state: 'selected' | 'related' | 'none';
|
|
15
|
+
many: boolean;
|
|
14
16
|
};
|
|
15
17
|
export type SchemaEdgeType = Edge<SchemaEdgeData, 'schema'>;
|
|
16
18
|
declare function SchemaEdge({ id, sourceX, sourceY, targetX, targetY, data }: EdgeProps<SchemaEdgeType>): import("react").JSX.Element | null;
|
|
@@ -2,6 +2,7 @@ import { type ReactNode } from 'react';
|
|
|
2
2
|
import type { SchemaDocument } from '../contract/types';
|
|
3
3
|
import type { ViewerChange, ViewerDownload } from '../contract/viewer-config';
|
|
4
4
|
import { type ExtensionRenderers } from './Details';
|
|
5
|
+
import { type OfflineBundle } from './offline';
|
|
5
6
|
import { type LayoutRequest, type Positions } from './layout';
|
|
6
7
|
import { type Theme } from './theme';
|
|
7
8
|
export type { ExtensionRenderers } from './Details';
|
|
@@ -21,5 +22,6 @@ export type SchemaViewerProps = {
|
|
|
21
22
|
downloadHref?: string | null;
|
|
22
23
|
className?: string;
|
|
23
24
|
layout?: (request: LayoutRequest) => Promise<Positions>;
|
|
25
|
+
offlineBundle?: (() => Promise<OfflineBundle>) | null;
|
|
24
26
|
};
|
|
25
27
|
export declare function SchemaViewer(props: SchemaViewerProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type Node, type NodeProps } from '@xyflow/react';
|
|
2
2
|
import type { Table } from '../contract/types';
|
|
3
|
+
import { type TableMark } from './intelligence';
|
|
3
4
|
export type TableNodeData = {
|
|
4
5
|
table: Table;
|
|
5
6
|
connection: string | null;
|
|
@@ -12,9 +13,12 @@ export type TableNodeData = {
|
|
|
12
13
|
pivot: boolean;
|
|
13
14
|
collapsed: boolean;
|
|
14
15
|
highlighted: Set<string>;
|
|
16
|
+
mark: TableMark | null;
|
|
15
17
|
onSelect: (id: string) => void;
|
|
16
18
|
onFocus: (id: string) => void;
|
|
17
19
|
onToggle: (id: string) => void;
|
|
20
|
+
onColumn: (id: string, column: string) => void;
|
|
21
|
+
changed: 'new' | 'changed' | null;
|
|
18
22
|
};
|
|
19
23
|
export type TableNodeType = Node<TableNodeData, 'table'>;
|
|
20
24
|
export declare const PICTURE_ZOOM = 0.4;
|
|
@@ -36,7 +40,9 @@ export type RegionNodeData = {
|
|
|
36
40
|
connection: string;
|
|
37
41
|
driver: string | null;
|
|
38
42
|
tables: number;
|
|
43
|
+
diagnostics: number;
|
|
39
44
|
};
|
|
45
|
+
export declare const frameMeta: (driver: string | null, tables: number, diagnostics: number) => string;
|
|
40
46
|
export type RegionNodeType = Node<RegionNodeData, 'region'>;
|
|
41
47
|
declare function RegionNode({ data }: NodeProps<RegionNodeType>): import("react").JSX.Element;
|
|
42
48
|
export declare const RegionNodeView: import("react").MemoExoticComponent<typeof RegionNode>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const BRAND_VIEWBOX = "0 0 24 24";
|
|
2
|
+
export declare const BRAND_STROKE = 1.8;
|
|
3
|
+
export declare const BRAND_RECTS: readonly [{
|
|
4
|
+
readonly x: 2.5;
|
|
5
|
+
readonly y: 3.5;
|
|
6
|
+
readonly width: 8;
|
|
7
|
+
readonly height: 7;
|
|
8
|
+
readonly rx: 1.5;
|
|
9
|
+
}, {
|
|
10
|
+
readonly x: 13.5;
|
|
11
|
+
readonly y: 13.5;
|
|
12
|
+
readonly width: 8;
|
|
13
|
+
readonly height: 7;
|
|
14
|
+
readonly rx: 1.5;
|
|
15
|
+
}];
|
|
16
|
+
export declare const BRAND_PATH = "M10.5 7 H14 a2 2 0 0 1 2 2 V13.5";
|
|
17
|
+
export declare const FAVICON_COLORS: {
|
|
18
|
+
readonly light: {
|
|
19
|
+
readonly tile: "#ffffff";
|
|
20
|
+
readonly edge: "#e4e4e7";
|
|
21
|
+
readonly mark: "#1e3a8a";
|
|
22
|
+
};
|
|
23
|
+
readonly dark: {
|
|
24
|
+
readonly tile: "#141417";
|
|
25
|
+
readonly edge: "#2a2a30";
|
|
26
|
+
readonly mark: "#6d8dff";
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
export declare const FAVICON_SVG: string;
|
|
30
|
+
export declare const FAVICON_DATA_URI: string;
|
|
31
|
+
export declare const brandMarkSvg: (stroke: string) => string;
|
|
32
|
+
export declare function faviconPixels(size: number): Uint8Array;
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
-
import { type EdgeKind } from './graph';
|
|
1
|
+
import { type EdgeKind, type LineEnd } from './graph';
|
|
2
|
+
export type Change = 'missing' | 'extra' | 'changed';
|
|
3
|
+
export type ImageMark = {
|
|
4
|
+
change: Change;
|
|
5
|
+
likely: boolean;
|
|
6
|
+
};
|
|
2
7
|
export type ImageRow = {
|
|
3
8
|
note: boolean;
|
|
4
9
|
key: string;
|
|
5
10
|
name: string;
|
|
6
11
|
type: string;
|
|
7
12
|
flag: 'drift' | 'declared-only' | null;
|
|
13
|
+
mark?: ImageMark | null;
|
|
8
14
|
};
|
|
9
15
|
export type ImageNode = {
|
|
10
16
|
x: number;
|
|
@@ -17,6 +23,11 @@ export type ImageNode = {
|
|
|
17
23
|
more: number;
|
|
18
24
|
declaredOnly: boolean;
|
|
19
25
|
external?: boolean;
|
|
26
|
+
issues?: number;
|
|
27
|
+
pivot?: boolean;
|
|
28
|
+
chip?: (ImageMark & {
|
|
29
|
+
text: string;
|
|
30
|
+
}) | null;
|
|
20
31
|
};
|
|
21
32
|
export type ImageFrame = {
|
|
22
33
|
x: number;
|
|
@@ -26,9 +37,11 @@ export type ImageFrame = {
|
|
|
26
37
|
title: string;
|
|
27
38
|
meta: string;
|
|
28
39
|
};
|
|
40
|
+
export type EdgeEnd = LineEnd | null;
|
|
29
41
|
export type ImageEdge = {
|
|
30
42
|
kind: EdgeKind;
|
|
31
43
|
declaredOnly: boolean;
|
|
44
|
+
inferred?: boolean;
|
|
32
45
|
sx: number;
|
|
33
46
|
sy: number;
|
|
34
47
|
cx: number;
|
|
@@ -38,7 +51,10 @@ export type ImageEdge = {
|
|
|
38
51
|
x: number;
|
|
39
52
|
y: number;
|
|
40
53
|
text: string;
|
|
54
|
+
chip?: string;
|
|
41
55
|
} | null;
|
|
56
|
+
start?: EdgeEnd;
|
|
57
|
+
end?: EdgeEnd;
|
|
42
58
|
};
|
|
43
59
|
export type Bounds = {
|
|
44
60
|
x: number;
|
|
@@ -51,8 +67,9 @@ export type ImageModel = {
|
|
|
51
67
|
edges: ImageEdge[];
|
|
52
68
|
frames?: ImageFrame[];
|
|
53
69
|
bounds: Bounds;
|
|
70
|
+
fonts?: string;
|
|
54
71
|
};
|
|
55
|
-
export declare const COLOR_TOKENS: readonly ["bg", "surface", "surface-2", "line", "line-strong", "fg", "muted", "accent", "accent-ink", "accent-soft", "fk", "both", "declared", "warning"];
|
|
72
|
+
export declare const COLOR_TOKENS: readonly ["bg", "surface", "surface-2", "line", "line-strong", "fg", "muted", "accent", "accent-ink", "accent-soft", "fk", "both", "declared", "warning", "inferred", "missing", "extra", "changed"];
|
|
56
73
|
export type Colors = Record<(typeof COLOR_TOKENS)[number], string>;
|
|
57
74
|
export declare function colorsOf(element: Element): Colors;
|
|
58
75
|
export declare function boundsOf(nodes: Bounds[], padding?: number): Bounds;
|
|
@@ -63,3 +80,5 @@ export declare const pngScale: (width: number, height: number, wanted: number, a
|
|
|
63
80
|
export declare function toCanvas(model: ImageModel, c: Colors, wanted?: number): HTMLCanvasElement;
|
|
64
81
|
export declare function save(blob: Blob, filename: string): void;
|
|
65
82
|
export declare const toPngBlob: (canvas: HTMLCanvasElement) => Promise<Blob>;
|
|
83
|
+
export declare function dataUrl(url: string, mediaType?: string): Promise<string>;
|
|
84
|
+
export declare function fontFaces(): Promise<string>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Connection, DerivedLink, Link, Model, Relationship, SchemaDocument, Table } from '../contract/types';
|
|
1
|
+
import type { Connection, DerivedLink, Diagnostic, Link, Model, Relationship, SchemaDocument, Table } from '../contract/types';
|
|
2
2
|
export type EdgeKind = 'both' | 'foreign_key' | 'relationship' | 'through';
|
|
3
3
|
export type GraphEdge = {
|
|
4
4
|
id: string;
|
|
@@ -14,6 +14,7 @@ export type GraphEdge = {
|
|
|
14
14
|
crossConnection: boolean;
|
|
15
15
|
link: Link | null;
|
|
16
16
|
derived: DerivedLink | null;
|
|
17
|
+
many: boolean;
|
|
17
18
|
};
|
|
18
19
|
export declare const CARD_WIDTH = 300;
|
|
19
20
|
export declare const HEADER_HEIGHT = 54;
|
|
@@ -31,11 +32,24 @@ export type Lookup = {
|
|
|
31
32
|
foreignKeys: Map<string, Table['foreignKeys'][number]>;
|
|
32
33
|
};
|
|
33
34
|
export declare function lookup(doc: SchemaDocument): Lookup;
|
|
35
|
+
export type DiagnosticScope = {
|
|
36
|
+
tableOf: (d: Diagnostic) => string | undefined;
|
|
37
|
+
connectionsOf: (d: Diagnostic) => string[];
|
|
38
|
+
tableOfId: (id: string) => string | undefined;
|
|
39
|
+
};
|
|
40
|
+
export declare function diagnosticScope(doc: SchemaDocument, l: Lookup): DiagnosticScope;
|
|
41
|
+
export declare function isUnique(table: Pick<Table, 'primaryKey' | 'indexes' | 'constraints'> | undefined, columns: string[]): boolean;
|
|
42
|
+
export type LineEnd = 'many' | 'one' | 'parent' | 'arrow';
|
|
43
|
+
export declare const lineEnds: (e: Pick<GraphEdge, "kind" | "many">) => {
|
|
44
|
+
start: LineEnd | null;
|
|
45
|
+
end: LineEnd;
|
|
46
|
+
};
|
|
47
|
+
export declare const END_SHAPES: Record<LineEnd, [number, number][][]>;
|
|
34
48
|
export declare function edgesFor(doc: SchemaDocument, l?: Lookup): GraphEdge[];
|
|
35
49
|
export declare const EDGE_KINDS: EdgeKind[];
|
|
36
50
|
export declare const edgeShown: (edge: GraphEdge, foreignKeys: boolean, orm: boolean) => boolean;
|
|
37
51
|
export declare function neighbors(id: string, edges: GraphEdge[]): Set<string>;
|
|
38
|
-
export declare function within(
|
|
52
|
+
export declare function within(seed: string | string[], edges: GraphEdge[], depth: number): Set<string>;
|
|
39
53
|
export declare function matchesTable(table: Table, connection: string, query: string, models: Model[]): boolean;
|
|
40
54
|
export declare function keyColumns(doc: SchemaDocument): Map<string, Set<string>>;
|
|
41
55
|
export type Fold = 'all' | 'keys' | 'none';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
export declare const ICONS: {
|
|
2
|
+
search: {
|
|
3
|
+
box: [number, number];
|
|
4
|
+
strokeWidth: number;
|
|
5
|
+
body: import("react").JSX.Element;
|
|
6
|
+
};
|
|
7
|
+
minus: {
|
|
8
|
+
body: import("react").JSX.Element;
|
|
9
|
+
};
|
|
10
|
+
plus: {
|
|
11
|
+
body: import("react").JSX.Element;
|
|
12
|
+
};
|
|
13
|
+
fit: {
|
|
14
|
+
body: import("react").JSX.Element;
|
|
15
|
+
};
|
|
16
|
+
hand: {
|
|
17
|
+
body: import("react").JSX.Element;
|
|
18
|
+
};
|
|
19
|
+
select: {
|
|
20
|
+
body: import("react").JSX.Element;
|
|
21
|
+
};
|
|
22
|
+
relationships: {
|
|
23
|
+
body: import("react").JSX.Element;
|
|
24
|
+
};
|
|
25
|
+
tables: {
|
|
26
|
+
body: import("react").JSX.Element;
|
|
27
|
+
};
|
|
28
|
+
eye: {
|
|
29
|
+
body: import("react").JSX.Element;
|
|
30
|
+
};
|
|
31
|
+
help: {
|
|
32
|
+
body: import("react").JSX.Element;
|
|
33
|
+
};
|
|
34
|
+
download: {
|
|
35
|
+
body: import("react").JSX.Element;
|
|
36
|
+
};
|
|
37
|
+
keyboard: {
|
|
38
|
+
box: [number, number];
|
|
39
|
+
body: import("react").JSX.Element;
|
|
40
|
+
};
|
|
41
|
+
moon: {
|
|
42
|
+
body: import("react").JSX.Element;
|
|
43
|
+
};
|
|
44
|
+
sun: {
|
|
45
|
+
body: import("react").JSX.Element;
|
|
46
|
+
};
|
|
47
|
+
more: {
|
|
48
|
+
box: [number, number];
|
|
49
|
+
fill: true;
|
|
50
|
+
body: import("react").JSX.Element;
|
|
51
|
+
};
|
|
52
|
+
close: {
|
|
53
|
+
body: import("react").JSX.Element;
|
|
54
|
+
};
|
|
55
|
+
chevron: {
|
|
56
|
+
body: import("react").JSX.Element;
|
|
57
|
+
};
|
|
58
|
+
check: {
|
|
59
|
+
body: import("react").JSX.Element;
|
|
60
|
+
};
|
|
61
|
+
warning: {
|
|
62
|
+
body: import("react").JSX.Element;
|
|
63
|
+
};
|
|
64
|
+
external: {
|
|
65
|
+
body: import("react").JSX.Element;
|
|
66
|
+
};
|
|
67
|
+
note: {
|
|
68
|
+
body: import("react").JSX.Element;
|
|
69
|
+
};
|
|
70
|
+
details: {
|
|
71
|
+
body: import("react").JSX.Element;
|
|
72
|
+
};
|
|
73
|
+
changes: {
|
|
74
|
+
body: import("react").JSX.Element;
|
|
75
|
+
};
|
|
76
|
+
compare: {
|
|
77
|
+
body: import("react").JSX.Element;
|
|
78
|
+
};
|
|
79
|
+
migrations: {
|
|
80
|
+
body: import("react").JSX.Element;
|
|
81
|
+
};
|
|
82
|
+
behind: {
|
|
83
|
+
body: import("react").JSX.Element;
|
|
84
|
+
};
|
|
85
|
+
branch: {
|
|
86
|
+
body: import("react").JSX.Element;
|
|
87
|
+
};
|
|
88
|
+
circle: {
|
|
89
|
+
body: import("react").JSX.Element;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export type IconName = keyof typeof ICONS;
|
|
93
|
+
export declare function Icon({ name, size }: {
|
|
94
|
+
name: IconName;
|
|
95
|
+
size?: number;
|
|
96
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Change, Comparison, Difference, InferredAssociation, JsonValue, MigrationStatus, MigrationTrack, ObjectType, Scope, SchemaDocument } from '../contract/types';
|
|
2
|
+
import type { Lookup } from './graph';
|
|
3
|
+
export declare const scopeKey: (scope: Scope) => string;
|
|
4
|
+
export declare function scopeLabel(lookup: Lookup, scope: Scope): string;
|
|
5
|
+
export declare const comparisonLabel: (lookup: Lookup, c: Comparison) => string;
|
|
6
|
+
export declare const CHANGE_TEXT: Record<Change, {
|
|
7
|
+
symbol: string;
|
|
8
|
+
label: string;
|
|
9
|
+
meaning: string;
|
|
10
|
+
group: string;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const OBJECT_TEXT: Record<ObjectType, string>;
|
|
13
|
+
export declare const CERTAINTY_TEXT: {
|
|
14
|
+
readonly certain: {
|
|
15
|
+
readonly label: "certain";
|
|
16
|
+
readonly long: "Certain: compared exactly as read from metadata";
|
|
17
|
+
};
|
|
18
|
+
readonly likely: {
|
|
19
|
+
readonly label: "likely";
|
|
20
|
+
readonly long: "Likely: compared through normalized types or SQL text, a heuristic";
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
export declare function valueText(value: JsonValue): string;
|
|
24
|
+
export type TableMark = {
|
|
25
|
+
comparison: Comparison;
|
|
26
|
+
side: 'baseline' | 'target';
|
|
27
|
+
table: Difference | null;
|
|
28
|
+
differences: Difference[];
|
|
29
|
+
columns: Map<string, Difference>;
|
|
30
|
+
entities: Map<string, Difference>;
|
|
31
|
+
likely: number;
|
|
32
|
+
};
|
|
33
|
+
export declare function comparisonMarks(comparison: Comparison | undefined): Map<string, TableMark>;
|
|
34
|
+
export declare function tableMarks(doc: SchemaDocument, tableId: string): TableMark[];
|
|
35
|
+
export declare function markSummary(mark: TableMark): {
|
|
36
|
+
change: Change;
|
|
37
|
+
text: string;
|
|
38
|
+
short: string;
|
|
39
|
+
rest: string;
|
|
40
|
+
title: string;
|
|
41
|
+
};
|
|
42
|
+
export declare function inferredByLink(doc: SchemaDocument): Map<string, InferredAssociation[]>;
|
|
43
|
+
export declare const inferredOfTable: (doc: SchemaDocument, tableId: string) => InferredAssociation[];
|
|
44
|
+
export declare const modelName: (lookup: Lookup, id: string) => string;
|
|
45
|
+
export declare const inferredLabel: (lookup: Lookup, a: InferredAssociation) => string;
|
|
46
|
+
export declare const CONFIDENCE_TEXT: Record<InferredAssociation['confidence'], string>;
|
|
47
|
+
export declare const AMBIGUITY_TEXT: Record<string, string>;
|
|
48
|
+
export declare const EVIDENCE_TEXT: Record<InferredAssociation['evidence'][number]['kind'], string>;
|
|
49
|
+
export declare const STATUS_TEXT: Record<MigrationStatus, {
|
|
50
|
+
label: string;
|
|
51
|
+
tone: 'fact' | 'warning' | 'error' | 'plain';
|
|
52
|
+
meaning: string;
|
|
53
|
+
}>;
|
|
54
|
+
export declare function unknownReason(track: MigrationTrack): string | null;
|
|
55
|
+
export declare const trackLabel: (lookup: Lookup, t: MigrationTrack) => string;
|
|
@@ -26,6 +26,11 @@ export type Region = {
|
|
|
26
26
|
width: number;
|
|
27
27
|
height: number;
|
|
28
28
|
};
|
|
29
|
+
export declare function frameAround(connection: string, boxes: {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
height: number;
|
|
33
|
+
}[]): Region;
|
|
29
34
|
export declare function packRegions(blocks: {
|
|
30
35
|
connection: string;
|
|
31
36
|
positions: Positions;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { ViewerConfig } from '../contract/viewer-config';
|
|
2
|
+
export type OfflineBundle = {
|
|
3
|
+
script: string;
|
|
4
|
+
style: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function bundleFromPage(): OfflineBundle | null;
|
|
7
|
+
export declare function fetchOfflineBundle(base: string | URL): Promise<OfflineBundle>;
|
|
8
|
+
export type OfflineConfig = Pick<ViewerConfig, 'document' | 'changes' | 'defaultConnection'>;
|
|
9
|
+
export declare function offlineHtml(bundle: OfflineBundle, config: OfflineConfig, title?: string): string;
|
|
@@ -1,32 +1,9 @@
|
|
|
1
1
|
import { type ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import { type IconName } from './icons';
|
|
3
|
+
export { Icon, ICONS, type IconName } from './icons';
|
|
4
|
+
export declare function Ident({ text }: {
|
|
5
|
+
text: string;
|
|
5
6
|
}): import("react").JSX.Element;
|
|
6
|
-
declare const PATHS: {
|
|
7
|
-
readonly search: import("react").JSX.Element;
|
|
8
|
-
readonly minus: import("react").JSX.Element;
|
|
9
|
-
readonly plus: import("react").JSX.Element;
|
|
10
|
-
readonly fit: import("react").JSX.Element;
|
|
11
|
-
readonly hand: import("react").JSX.Element;
|
|
12
|
-
readonly select: import("react").JSX.Element;
|
|
13
|
-
readonly relationships: import("react").JSX.Element;
|
|
14
|
-
readonly tables: import("react").JSX.Element;
|
|
15
|
-
readonly eye: import("react").JSX.Element;
|
|
16
|
-
readonly arrange: import("react").JSX.Element;
|
|
17
|
-
readonly help: import("react").JSX.Element;
|
|
18
|
-
readonly download: import("react").JSX.Element;
|
|
19
|
-
readonly keyboard: import("react").JSX.Element;
|
|
20
|
-
readonly moon: import("react").JSX.Element;
|
|
21
|
-
readonly sun: import("react").JSX.Element;
|
|
22
|
-
readonly more: import("react").JSX.Element;
|
|
23
|
-
readonly close: import("react").JSX.Element;
|
|
24
|
-
readonly chevron: import("react").JSX.Element;
|
|
25
|
-
readonly check: import("react").JSX.Element;
|
|
26
|
-
readonly warning: import("react").JSX.Element;
|
|
27
|
-
readonly focus: import("react").JSX.Element;
|
|
28
|
-
readonly link: import("react").JSX.Element;
|
|
29
|
-
};
|
|
30
7
|
type MenuProps = {
|
|
31
8
|
label: string;
|
|
32
9
|
trigger: ReactNode;
|
|
@@ -66,9 +43,11 @@ export declare function MenuItem({ onSelect, children, hint, shortcut, disabled
|
|
|
66
43
|
}): import("react").JSX.Element;
|
|
67
44
|
export type TabSpec<T extends string> = {
|
|
68
45
|
value: T;
|
|
69
|
-
label:
|
|
46
|
+
label: string;
|
|
47
|
+
icon?: IconName;
|
|
70
48
|
count?: number;
|
|
71
49
|
tone?: 'warning';
|
|
50
|
+
badge?: ReactNode;
|
|
72
51
|
};
|
|
73
52
|
export declare function TabList<T extends string>({ tabs, value, onChange, label, className, idPrefix }: {
|
|
74
53
|
tabs: TabSpec<T>[];
|
|
@@ -78,4 +57,3 @@ export declare function TabList<T extends string>({ tabs, value, onChange, label
|
|
|
78
57
|
className?: string;
|
|
79
58
|
idPrefix: string;
|
|
80
59
|
}): import("react").JSX.Element;
|
|
81
|
-
export {};
|