@canon-protocol/types 8.0.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.
Files changed (93) hide show
  1. package/dist/ctl/models/enums.d.ts +58 -0
  2. package/dist/ctl/models/enums.js +64 -0
  3. package/dist/ctl/models/types.d.ts +169 -0
  4. package/dist/ctl/models/types.js +5 -0
  5. package/dist/ctl/parsing/enums.d.ts +38 -0
  6. package/dist/ctl/parsing/enums.js +44 -0
  7. package/dist/ctl/parsing/types.d.ts +89 -0
  8. package/dist/ctl/parsing/types.js +5 -0
  9. package/dist/ctl/rendering/types.d.ts +39 -0
  10. package/dist/ctl/rendering/types.js +5 -0
  11. package/dist/ctl/resolution/enums.d.ts +34 -0
  12. package/dist/ctl/resolution/enums.js +40 -0
  13. package/dist/ctl/resolution/types.d.ts +156 -0
  14. package/dist/ctl/resolution/types.js +5 -0
  15. package/dist/ctl/validation/types.d.ts +10 -0
  16. package/dist/ctl/validation/types.js +5 -0
  17. package/dist/document/constants/types.d.ts +5 -0
  18. package/dist/document/constants/types.js +5 -0
  19. package/dist/document/filtering/index.d.ts +13 -0
  20. package/dist/document/filtering/index.js +5 -0
  21. package/dist/document/filtering/types.d.ts +14 -0
  22. package/dist/document/filtering/types.js +5 -0
  23. package/dist/document/models/enums.d.ts +21 -0
  24. package/dist/document/models/enums.js +26 -0
  25. package/dist/document/models/index.d.ts +47 -0
  26. package/dist/document/models/index.js +5 -0
  27. package/dist/document/models/types.d.ts +194 -0
  28. package/dist/document/models/types.js +5 -0
  29. package/dist/document/parsing/index.d.ts +19 -0
  30. package/dist/document/parsing/index.js +5 -0
  31. package/dist/document/parsing/types.d.ts +10 -0
  32. package/dist/document/parsing/types.js +5 -0
  33. package/dist/document/repositories/enums.d.ts +17 -0
  34. package/dist/document/repositories/enums.js +22 -0
  35. package/dist/document/repositories/types.d.ts +103 -0
  36. package/dist/document/repositories/types.js +5 -0
  37. package/dist/document/storage/index.d.ts +25 -0
  38. package/dist/document/storage/index.js +5 -0
  39. package/dist/document/storage/types.d.ts +5 -0
  40. package/dist/document/storage/types.js +5 -0
  41. package/dist/exporters/ctl/markdown/types.d.ts +10 -0
  42. package/dist/exporters/ctl/markdown/types.js +5 -0
  43. package/dist/object/canons/types.d.ts +17 -0
  44. package/dist/object/canons/types.js +5 -0
  45. package/dist/object/parsing/index.d.ts +21 -0
  46. package/dist/object/parsing/index.js +5 -0
  47. package/dist/object/parsing/types.d.ts +43 -0
  48. package/dist/object/parsing/types.js +5 -0
  49. package/dist/object/resolution/types.d.ts +116 -0
  50. package/dist/object/resolution/types.js +5 -0
  51. package/dist/object/statements/index.d.ts +2 -0
  52. package/dist/object/statements/index.js +5 -0
  53. package/dist/object/statements/types.d.ts +20 -0
  54. package/dist/object/statements/types.js +5 -0
  55. package/dist/object/uris/types.d.ts +17 -0
  56. package/dist/object/uris/types.js +5 -0
  57. package/dist/object/validation/enums.d.ts +13 -0
  58. package/dist/object/validation/enums.js +18 -0
  59. package/dist/object/validation/index.d.ts +19 -0
  60. package/dist/object/validation/index.js +5 -0
  61. package/dist/object/validation/rules/document/index.d.ts +17 -0
  62. package/dist/object/validation/rules/document/index.js +5 -0
  63. package/dist/object/validation/rules/document/types.d.ts +52 -0
  64. package/dist/object/validation/rules/document/types.js +5 -0
  65. package/dist/object/validation/rules/repository/index.d.ts +19 -0
  66. package/dist/object/validation/rules/repository/index.js +5 -0
  67. package/dist/object/validation/rules/repository/types.d.ts +148 -0
  68. package/dist/object/validation/rules/repository/types.js +5 -0
  69. package/dist/object/validation/types.d.ts +134 -0
  70. package/dist/object/validation/types.js +5 -0
  71. package/dist/registry/models/types.d.ts +253 -0
  72. package/dist/registry/models/types.js +5 -0
  73. package/dist/registry/oauth/types.d.ts +192 -0
  74. package/dist/registry/oauth/types.js +5 -0
  75. package/dist/registry/providers/enums.d.ts +8 -0
  76. package/dist/registry/providers/enums.js +13 -0
  77. package/dist/registry/providers/git/types.d.ts +43 -0
  78. package/dist/registry/providers/git/types.js +5 -0
  79. package/dist/registry/providers/github/models/types.d.ts +35 -0
  80. package/dist/registry/providers/github/models/types.js +5 -0
  81. package/dist/registry/providers/github/types.d.ts +30 -0
  82. package/dist/registry/providers/github/types.js +5 -0
  83. package/dist/registry/providers/index.d.ts +29 -0
  84. package/dist/registry/providers/index.js +5 -0
  85. package/dist/registry/providers/oci/types.d.ts +17 -0
  86. package/dist/registry/providers/oci/types.js +5 -0
  87. package/dist/registry/providers/types.d.ts +15 -0
  88. package/dist/registry/providers/types.js +5 -0
  89. package/dist/registry/services/index.d.ts +9 -0
  90. package/dist/registry/services/index.js +5 -0
  91. package/dist/registry/services/types.d.ts +153 -0
  92. package/dist/registry/services/types.js +5 -0
  93. package/package.json +99 -0
@@ -0,0 +1,103 @@
1
+ import { ICanonDocumentRepository } from '../../document/models/index';
2
+ import { CanonDocument, CanonMetadata, DocumentReference, Import } from '../../document/models/types';
3
+ import { DocumentLocation } from '../../document/repositories/enums';
4
+ /**
5
+ * Composite repository that separates package cache from workspace. Follows npm/cargo model: .canon/ is gitignored cache, workspace contains user files.
6
+ */
7
+ export interface CompositeCanonDocumentRepository extends ICanonDocumentRepository {
8
+ /**
9
+ * Gets the cache repository (read-only for user operations)
10
+ */
11
+ readonly cache: FileSystemCanonDocumentRepository;
12
+ /**
13
+ * Gets the workspace repository (read-write for user operations)
14
+ */
15
+ readonly workspace: FileSystemCanonDocumentRepository;
16
+ /**
17
+ * Gets combined parsing errors from both cache and workspace repositories. Key is file path, value is error message.
18
+ */
19
+ readonly parsingErrors: Record<string, string>;
20
+ getAllDocumentsAsync(): Promise<Array<CanonDocument>>;
21
+ getDocumentAsync(identifier: string): Promise<CanonDocument | null>;
22
+ getDocumentsByNamespaceAsync(publisher: string, package_: string): Promise<Array<CanonDocument>>;
23
+ getHighestCompatibleVersionAsync(publisher: string, import_: Import): Promise<CanonDocument | null>;
24
+ saveDocumentAsync(document: CanonDocument, identifier: string): Promise<void>;
25
+ /**
26
+ * Saves a document to the package cache. This is ONLY used by the package installer - user operations use SaveDocumentAsync().
27
+ */
28
+ saveToCacheAsync(document: CanonDocument, identifier: string): Promise<void>;
29
+ deleteDocumentAsync(identifier: string): Promise<void>;
30
+ clearNamespaceAsync(publisher: string, package_: string): Promise<void>;
31
+ getAllDocumentReferencesAsync(): Promise<Array<DocumentReference>>;
32
+ getDocumentContentAsync(identifier: string): Promise<string | null>;
33
+ getDocumentUriAsync(identifier: string): Promise<string | null>;
34
+ /**
35
+ * Determines if a document is in the cache (external package) or workspace (user file).
36
+ */
37
+ getDocumentLocationAsync(identifier: string): Promise<DocumentLocation>;
38
+ }
39
+ /**
40
+ * File system-based repository for Canon documents Scans directories for .yml files and parses them as Canon documents
41
+ */
42
+ export interface FileSystemCanonDocumentRepository extends ICanonDocumentRepository {
43
+ /**
44
+ * Gets any parsing errors encountered during document loading
45
+ */
46
+ parsingErrors: Record<string, string>;
47
+ getAllDocumentsAsync(): Promise<Array<CanonDocument>>;
48
+ getDocumentAsync(identifier: string): Promise<CanonDocument | null>;
49
+ getDocumentsByNamespaceAsync(publisher: string, package_: string): Promise<Array<CanonDocument>>;
50
+ getHighestCompatibleVersionAsync(publisher: string, import_: Import): Promise<CanonDocument | null>;
51
+ saveDocumentAsync(document: CanonDocument, identifier: string): Promise<void>;
52
+ deleteDocumentAsync(identifier: string): Promise<void>;
53
+ clearNamespaceAsync(publisher: string, package_: string): Promise<void>;
54
+ getAllDocumentReferencesAsync(): Promise<Array<DocumentReference>>;
55
+ getDocumentContentAsync(identifier: string): Promise<string | null>;
56
+ getDocumentUriAsync(identifier: string): Promise<string | null>;
57
+ /**
58
+ * Refreshes the cache by rescanning the file system
59
+ */
60
+ refreshAsync(): Promise<void>;
61
+ /**
62
+ * Gets the metadata for all documents without loading full content
63
+ */
64
+ getAllMetadataAsync(): Promise<Record<string, CanonMetadata>>;
65
+ /**
66
+ * Gets the file system path for a document by namespace (File-system specific - not part of ICanonDocumentRepository interface)
67
+ */
68
+ getDocumentFilePath(namespaceStr: string): string | null;
69
+ /**
70
+ * Gets statistics about the loaded documents
71
+ */
72
+ getStatistics(): RepositoryStatistics;
73
+ }
74
+ /**
75
+ * In-memory repository for Canon documents Useful for testing and scenarios where persistence is not required
76
+ */
77
+ export interface InMemoryCanonDocumentRepository extends ICanonDocumentRepository {
78
+ getAllDocumentsAsync(): Promise<Array<CanonDocument>>;
79
+ getDocumentAsync(identifier: string): Promise<CanonDocument | null>;
80
+ getDocumentsByNamespaceAsync(publisher: string, package_: string): Promise<Array<CanonDocument>>;
81
+ getHighestCompatibleVersionAsync(publisher: string, import_: Import): Promise<CanonDocument | null>;
82
+ saveDocumentAsync(document: CanonDocument, identifier: string): Promise<void>;
83
+ deleteDocumentAsync(identifier: string): Promise<void>;
84
+ clearNamespaceAsync(publisher: string, package_: string): Promise<void>;
85
+ getAllDocumentReferencesAsync(): Promise<Array<DocumentReference>>;
86
+ getDocumentContentAsync(identifier: string): Promise<string | null>;
87
+ getDocumentUriAsync(identifier: string): Promise<string | null>;
88
+ }
89
+ /**
90
+ * Factory for creating Canon document repository instances. Now uses composite repository pattern separating package cache from workspace.
91
+ */
92
+ export interface RepositoryFactory {
93
+ }
94
+ /**
95
+ * Statistics about a Canon document repository
96
+ */
97
+ export interface RepositoryStatistics {
98
+ totalDocuments: number;
99
+ documentsByNamespace: Record<string, number>;
100
+ parsingErrors: number;
101
+ rootPath: string;
102
+ isRecursive: boolean;
103
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: 4 files in namespace
3
+ // SourceHash: sha256-2937b91f6143adca1d0626f6bf3bdaa958422fec938c82c7aae37c848e8e75cc
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Simple key-value store interface for Canon package storage. Lower-level than ICanonDocumentRepository - just raw string storage. Implementations: Cloudflare KV, Postgres, Redis, etc.
3
+ */
4
+ export interface ICanonStore {
5
+ /**
6
+ * Gets a value by key.
7
+ */
8
+ getAsync(key: string): Promise<string | null>;
9
+ /**
10
+ * Stores a value by key.
11
+ */
12
+ putAsync(key: string, value: string): Promise<void>;
13
+ /**
14
+ * Deletes a value by key.
15
+ */
16
+ deleteAsync(key: string): Promise<void>;
17
+ /**
18
+ * Checks if a key exists.
19
+ */
20
+ existsAsync(key: string): Promise<boolean>;
21
+ /**
22
+ * Lists keys with optional prefix filter.
23
+ */
24
+ listKeysAsync(prefix?: string | null): Promise<Array<string>>;
25
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Canon.Document\Storage\ICanonStore.cs
3
+ // SourceHash: sha256-16ae7e9c17e46579c2523dc3a74f60202fc937e2982d79e3df09410868fa283e
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Provides access to the default Canon store instance. Applications should register their store implementation at startup.
3
+ */
4
+ export interface CanonStoreProvider {
5
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Canon.Document\Storage\CanonStoreProvider.cs
3
+ // SourceHash: sha256-83c25da5d226bd536c9bb45dce55c76280d6994703f687a30e3aec47082aa15a
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,10 @@
1
+ import { ResolvedResourceGraph } from '../../../ctl/resolution/types';
2
+ /**
3
+ * Renders a resolved entity graph to a self-contained Markdown document. The output includes the original template content plus full documentation of all referenced Canon entities, organized by tier. Features: - Internal anchor links for navigation - Quick reference summary tables - Mermaid inheritance diagram - Multi-value field support (RDF union types)
4
+ */
5
+ export interface CtlMarkdownRenderer {
6
+ /**
7
+ * Renders the resolved entity graph to Markdown.
8
+ */
9
+ render(graph: ResolvedResourceGraph): string;
10
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Exporters\Canon.Exporters.CTL.Markdown\CtlMarkdownRenderer.cs
3
+ // SourceHash: sha256-5a846c5345553db34d25759fb036387815277beeaa45be3dcf574ed767785164
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,17 @@
1
+ import { IStatement } from '../../object/statements/index';
2
+ import { CanonUri } from '../../object/uris/types';
3
+ export interface Canon {
4
+ }
5
+ export interface DefinedCanon extends Canon {
6
+ statement: Array<IStatement>;
7
+ }
8
+ export interface EmbeddedCanon extends DefinedCanon {
9
+ }
10
+ export interface ReferenceCanon extends Canon {
11
+ subject: CanonUri;
12
+ }
13
+ export interface SubjectCanon extends DefinedCanon {
14
+ namespace_: string;
15
+ name: string;
16
+ icon?: string | null | undefined;
17
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: 5 files in namespace
3
+ // SourceHash: sha256-0c24d9f07e57eac90ea8138a4b742fcdf7aa5c5a15c5ce59c71bca6764d0f43f
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,21 @@
1
+ import { ICanonDocumentRepository } from '../../document/models/index';
2
+ import { Canon } from '../../object/canons/types';
3
+ export { ICanonDocumentRepository };
4
+ export { Canon };
5
+ /**
6
+ * Interface for parsing and saving Canon objects
7
+ */
8
+ export interface ICanonObjectParser {
9
+ /**
10
+ * Parses Canon documents from a repository into Canon objects
11
+ */
12
+ parseCanons(documentRepository: ICanonDocumentRepository): Promise<Array<Canon>>;
13
+ /**
14
+ * Saves Canon objects back to a document repository
15
+ */
16
+ saveCanons(canons: Array<Canon>, documentRepository: ICanonDocumentRepository): Promise<void>;
17
+ /**
18
+ * Serializes Canon objects to YAML string format
19
+ */
20
+ serializeToYaml(canons: Array<Canon>, namespaceString: string): Promise<string>;
21
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Canon.Object\Parsing\ICanonObjectParser.cs
3
+ // SourceHash: sha256-b551c1537019a04cb90f58039e74440a8e2bf6a3ebdf17bde1068eca3ada297e
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,43 @@
1
+ import { ICanonDocumentRepository } from '../../document/models/index';
2
+ import { CanonDocument } from '../../document/models/types';
3
+ import { Canon } from '../../object/canons/types';
4
+ import { ICanonObjectParser } from '../../object/parsing/index';
5
+ import { CanonUri } from '../../object/uris/types';
6
+ export interface CanonObjectParser extends ICanonObjectParser {
7
+ parseCanons(documentRepository: ICanonDocumentRepository): Promise<Array<Canon>>;
8
+ saveCanons(canons: Array<Canon>, documentRepository: ICanonDocumentRepository): Promise<void>;
9
+ serializeToYaml(canons: Array<Canon>, namespaceString: string): Promise<string>;
10
+ }
11
+ /**
12
+ * Metadata about a property definition, including fully resolved URIs for type checking
13
+ */
14
+ export interface PropertyMetadata {
15
+ /**
16
+ * The property type classification (Property, DatatypeProperty, ObjectProperty, AnnotationProperty)
17
+ */
18
+ propertyType: string;
19
+ /**
20
+ * Fully resolved URI for the property itself
21
+ */
22
+ propertyUri: CanonUri;
23
+ /**
24
+ * Fully resolved URI for the range (expected type/class of values)
25
+ */
26
+ rangeUri?: CanonUri | null | undefined;
27
+ /**
28
+ * Fully resolved URI for the domain (class this property applies to)
29
+ */
30
+ domainUri?: CanonUri | null | undefined;
31
+ /**
32
+ * Original range value as a string (used by validation for error messages and type inference)
33
+ */
34
+ range?: string | null | undefined;
35
+ /**
36
+ * Original domain value as a string (used by validation for error messages)
37
+ */
38
+ domain?: string | null | undefined;
39
+ /**
40
+ * Document where this property is defined
41
+ */
42
+ sourceDocument: CanonDocument;
43
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: 2 files in namespace
3
+ // SourceHash: sha256-2fae0736d78061226504f3e3caa511370756ab263fd738196c1388495647cf5e
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,116 @@
1
+ import { CanonDocument, Version } from '../../document/models/types';
2
+ import { CanonUri } from '../../object/uris/types';
3
+ /**
4
+ * Builds CanonUri instances from resource names, handling alias resolution and version resolution through imports.
5
+ */
6
+ export interface CanonUriBuilder {
7
+ /**
8
+ * Builds a CanonUri from a resource name, resolving aliases and versions
9
+ */
10
+ buildFromNameAsync(resourceName: string, currentDocument: CanonDocument): Promise<CanonUri | null>;
11
+ /**
12
+ * Builds a CanonUri from a resource name using a pre-built resource index
13
+ */
14
+ buildFromName(resourceName: string, resourceIndex: Record<string, ResourceResolutionResult>, currentDocument: CanonDocument): CanonUri | null;
15
+ /**
16
+ * Creates a CanonUri directly from known components (for when resource is already resolved)
17
+ */
18
+ create(publisher: string, package_: string, name: string, version?: Version | null): CanonUri;
19
+ }
20
+ /**
21
+ * Result of resolving a resource across namespace boundaries
22
+ */
23
+ export interface ResourceResolutionResult {
24
+ /**
25
+ * Name of the resource
26
+ */
27
+ resourceName: string;
28
+ /**
29
+ * Full Canon URI identifying this resource uniquely
30
+ */
31
+ uri: CanonUri;
32
+ /**
33
+ * The actual resource dictionary from the YAML document
34
+ */
35
+ resource: Map<any, any>;
36
+ /**
37
+ * Full namespace where this resource is defined (e.g., "healthcare.org/clinical@1.0.0")
38
+ */
39
+ definedInNamespace: string;
40
+ /**
41
+ * True if this resource was found in an imported namespace (vs the current document)
42
+ */
43
+ isImported: boolean;
44
+ /**
45
+ * Import chain showing how we got to this resource (for debugging/education) Example: "example.com/app@1.0.0 → healthcare.org/clinical@1.0.0"
46
+ */
47
+ importPath?: string | null | undefined;
48
+ }
49
+ /**
50
+ * Resolves resources across namespace boundaries by following import chains transitively. Provides robust type checking that works across imported ontologies. Core component of the Canon.Object ontology engine - used by parser, validator, and all clients.
51
+ */
52
+ export interface ResourceResolver {
53
+ /**
54
+ * Finds a resource in the current document or any transitively imported documents
55
+ */
56
+ resolveResourceAsync(resourceName: string, currentDocument: CanonDocument): Promise<ResourceResolutionResult | null>;
57
+ /**
58
+ * Finds ALL matching resources across all namespaces (supports ambiguity detection and multi-definition navigation)
59
+ */
60
+ resolveAllResourcesAsync(resourceName: string, currentDocument: CanonDocument): Promise<Array<ResourceResolutionResult>>;
61
+ /**
62
+ * Builds a complete resource index from current document and all transitive imports
63
+ */
64
+ buildResourceIndexAsync(document: CanonDocument): Promise<Record<string, ResourceResolutionResult>>;
65
+ /** C# method 'ClearCache' has 2 overloads. Using overload with most parameters. */
66
+ /**
67
+ * Clears cache for a specific document.
68
+ */
69
+ clearCache(documentKey: string): void;
70
+ /**
71
+ * Checks if a class is a subclass of another class (direct or transitive)
72
+ */
73
+ isSubclassOfAsync(className: string, parentClassName: string, document: CanonDocument): Promise<boolean>;
74
+ /**
75
+ * Checks if a property is a subproperty of another property (direct or transitive)
76
+ */
77
+ isSubpropertyOfAsync(propertyName: string, parentPropertyName: string, document: CanonDocument): Promise<boolean>;
78
+ }
79
+ /**
80
+ * Classifies Canon resources by their semantic type (Class, Property, Instance, etc.). This is the canonical source of truth for resource type classification. Uses resolved CanonUri, NOT document-scoped aliases.
81
+ */
82
+ export interface ResourceTypeClassifier {
83
+ }
84
+ /**
85
+ * Resolves and validates types in Canon ontologies. Determines if a type is a datatype vs class, validates type references.
86
+ */
87
+ export interface TypeResolver {
88
+ /**
89
+ * Checks if a CanonUri refers to an XSD datatype
90
+ */
91
+ isXsdDatatype(uri: CanonUri | null): boolean;
92
+ /**
93
+ * Checks if a CanonUri refers to rdfs:Literal (the superclass of all literal datatypes)
94
+ */
95
+ isLiteralType(uri: CanonUri | null): boolean;
96
+ /**
97
+ * Checks if a type name refers to a known XSD datatype (string name check)
98
+ */
99
+ isKnownXsdDatatypeName(typeName: string): boolean;
100
+ /**
101
+ * Checks if a type name refers to a class (vs a datatype)
102
+ */
103
+ isClassTypeAsync(typeName: string, currentDocument: CanonDocument): Promise<boolean>;
104
+ /**
105
+ * Gets the property type classification (DatatypeProperty, ObjectProperty, or Property)
106
+ */
107
+ getPropertyTypeClassification(propertyType: string | null): string;
108
+ /**
109
+ * Determines if a property should be treated as a datatype property based on its type and range
110
+ */
111
+ isEffectiveDatatypeProperty(propertyTypeClassification: string, rangeUri: CanonUri | null): boolean;
112
+ /**
113
+ * Determines if a property should be treated as an object property based on its type and range
114
+ */
115
+ isEffectiveObjectProperty(propertyTypeClassification: string, rangeUri: CanonUri | null): boolean;
116
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: 5 files in namespace
3
+ // SourceHash: sha256-6f01d98a1f51f1cb5efff8ed417bccca268801f3ddd1a626f7bfee2aa4a6523b
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,2 @@
1
+ export interface IStatement {
2
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Canon.Object\Statements\IStatement.cs
3
+ // SourceHash: sha256-b7a30ea98e387f7ba7248901e99e86f69052405a224a40804850a3834a7f6d0f
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,20 @@
1
+ import { Canon, EmbeddedCanon, ReferenceCanon } from '../../object/canons/types';
2
+ import { IStatement } from '../../object/statements/index';
3
+ export interface Statement<TObject> extends IStatement {
4
+ predicate: ReferenceCanon;
5
+ object_: TObject;
6
+ }
7
+ export interface ScalarStatement<TScalar> extends Statement<TScalar> {
8
+ }
9
+ export interface BooleanStatement extends ScalarStatement<boolean> {
10
+ }
11
+ export interface EmbeddedStatement extends Statement<EmbeddedCanon> {
12
+ }
13
+ export interface ListStatement extends Statement<Array<Canon>> {
14
+ }
15
+ export interface NumberStatement extends ScalarStatement<number> {
16
+ }
17
+ export interface ReferenceStatement extends Statement<ReferenceCanon> {
18
+ }
19
+ export interface StringStatement extends ScalarStatement<string> {
20
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: 8 files in namespace
3
+ // SourceHash: sha256-6343ed5847c4a9c24c1417b922db8f81d222a9563f1041adda86f53a50acac8d
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,17 @@
1
+ import { Version } from '../../document/models/types';
2
+ /**
3
+ * Represents a Canon Resource URI that uniquely identifies a resource within a package. Format: publisher/package[@version]/resource Examples: - stories.org/characters@1.0.0/romeo-montague (specific version) - stories.org/characters/romeo-montague (latest version) Note: This is distinct from a Canon Package URI (publisher/package[@version]) which identifies a package but not a specific resource within it.
4
+ */
5
+ export interface CanonUri {
6
+ publisher: string;
7
+ package_: string;
8
+ name: string;
9
+ /**
10
+ * The version of the package. If null, represents "latest" version.
11
+ */
12
+ version?: Version | null | undefined;
13
+ /**
14
+ * Converts the Canon URI to its string representation.
15
+ */
16
+ toString(): string;
17
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Canon.Object\Uris\CanonUri.cs
3
+ // SourceHash: sha256-b50c5f821de9bc1ca2e8609623352e99f2b71a530e6f34274f162c9d3371d2f4
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Severity levels for validation issues
3
+ */
4
+ export declare enum ValidationSeverity {
5
+ /**
6
+ * Non-critical issue that should be addressed
7
+ */
8
+ Warning = 0,
9
+ /**
10
+ * Critical issue that must be fixed
11
+ */
12
+ Error = 1
13
+ }
@@ -0,0 +1,18 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Canon.Object\Validation\OntologyValidationError.cs
3
+ // SourceHash: sha256-4b3ed206d262bad4887e6fadf1a0a1d75cd7ba1c9c06cc41ab794a9793e5e1be
4
+ // DO NOT EDIT - changes will be overwritten
5
+ /**
6
+ * Severity levels for validation issues
7
+ */
8
+ export var ValidationSeverity;
9
+ (function (ValidationSeverity) {
10
+ /**
11
+ * Non-critical issue that should be addressed
12
+ */
13
+ ValidationSeverity[ValidationSeverity["Warning"] = 0] = "Warning";
14
+ /**
15
+ * Critical issue that must be fixed
16
+ */
17
+ ValidationSeverity[ValidationSeverity["Error"] = 1] = "Error";
18
+ })(ValidationSeverity || (ValidationSeverity = {}));
@@ -0,0 +1,19 @@
1
+ import { ICanonDocumentRepository } from '../../document/models/index';
2
+ import { CanonDocument } from '../../document/models/types';
3
+ import { OntologyValidationResult } from '../../object/validation/types';
4
+ export { ICanonDocumentRepository };
5
+ export { CanonDocument };
6
+ export { OntologyValidationResult };
7
+ /**
8
+ * Interface for validating Canon documents at the ontology level
9
+ */
10
+ export interface ICanonObjectValidator {
11
+ /**
12
+ * Validates a Canon document for ontological correctness
13
+ */
14
+ validateAsync(document: CanonDocument, repository?: ICanonDocumentRepository | null): Promise<OntologyValidationResult>;
15
+ /**
16
+ * Validates a Canon document from YAML text
17
+ */
18
+ validateYamlAsync(yamlText: string, repository?: ICanonDocumentRepository | null): Promise<OntologyValidationResult>;
19
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Canon.Object\Validation\ICanonObjectValidator.cs
3
+ // SourceHash: sha256-5019c2fc59881bf9539fe1a6443d856e9c150c4d8b5823a49b1fa73984a3a961
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,17 @@
1
+ import { CanonDocument } from '../../../../document/models/types';
2
+ import { OntologyValidationError } from '../../../../object/validation/types';
3
+ export { CanonDocument };
4
+ export { OntologyValidationError };
5
+ /**
6
+ * Interface for validation rules that operate on a document in isolation without needing external dependencies like repositories
7
+ */
8
+ export interface IDocumentValidationRule {
9
+ /**
10
+ * The name of this validation rule
11
+ */
12
+ readonly ruleName: string;
13
+ /**
14
+ * Validates a Canon document against this rule
15
+ */
16
+ validate(document: CanonDocument): Array<OntologyValidationError>;
17
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Canon.Object\Validation\Rules\Document\IDocumentValidationRule.cs
3
+ // SourceHash: sha256-63a95a3c5e8f9fc7edfe81ec148e8927796741114c1702d7e8f9daa01118ebe3
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,52 @@
1
+ import { CanonDocument } from '../../../../document/models/types';
2
+ import { IDocumentValidationRule } from '../../../../object/validation/rules/document/index';
3
+ import { OntologyValidationError } from '../../../../object/validation/types';
4
+ /**
5
+ * Validates that embedded Canon objects (nested objects within properties) do NOT have explicit 'type' properties. Embedded objects automatically infer their type from the parent property's range. This enforces proper ontology modeling and prevents redundant type declarations.
6
+ */
7
+ export interface EmbeddedCanonNoExplicitTypeRule extends IDocumentValidationRule {
8
+ readonly ruleName: string;
9
+ validate(document: CanonDocument): Array<OntologyValidationError>;
10
+ }
11
+ /**
12
+ * Validates that namespace prefixes with colons are not used in Canon YAML Canon uses dot notation for namespace aliases, not colon notation
13
+ */
14
+ export interface NamespacePrefixRule extends IDocumentValidationRule {
15
+ readonly ruleName: string;
16
+ validate(document: CanonDocument): Array<OntologyValidationError>;
17
+ }
18
+ /**
19
+ * Validates that Package declarations have required properties: publisher, version. This rule applies to documents using the new Package format (type: Package).
20
+ */
21
+ export interface PackagePropertiesRule extends IDocumentValidationRule {
22
+ readonly ruleName: string;
23
+ validate(document: CanonDocument): Array<OntologyValidationError>;
24
+ }
25
+ /**
26
+ * Validates that a Canon document contains exactly one Package declaration. The Package entry is identified by having 'type: Package'.
27
+ */
28
+ export interface PackageRequiredRule extends IDocumentValidationRule {
29
+ readonly ruleName: string;
30
+ validate(document: CanonDocument): Array<OntologyValidationError>;
31
+ }
32
+ /**
33
+ * Validates that properties use specific types (DatatypeProperty, ObjectProperty, etc.) rather than generic Property type
34
+ */
35
+ export interface PropertyTypeSpecificityRule extends IDocumentValidationRule {
36
+ readonly ruleName: string;
37
+ validate(document: CanonDocument): Array<OntologyValidationError>;
38
+ }
39
+ /**
40
+ * Validates that resource names follow Canon naming conventions Resource names must start with a letter and can only contain letters, numbers, and underscores
41
+ */
42
+ export interface ResourceNamingRule extends IDocumentValidationRule {
43
+ readonly ruleName: string;
44
+ validate(document: CanonDocument): Array<OntologyValidationError>;
45
+ }
46
+ /**
47
+ * Validates that all Subject Canons (top-level entities) have an explicit 'type' property. Subject Canons must declare their type since there is no parent property to infer from.
48
+ */
49
+ export interface SubjectCanonTypeRequiredRule extends IDocumentValidationRule {
50
+ readonly ruleName: string;
51
+ validate(document: CanonDocument): Array<OntologyValidationError>;
52
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: 7 files in namespace
3
+ // SourceHash: sha256-212f3415c1dcc9b1103a09da7bc84d2dea86bd9710dfc8133e8cca55ae32f1fd
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};
@@ -0,0 +1,19 @@
1
+ import { ICanonDocumentRepository } from '../../../../document/models/index';
2
+ import { CanonDocument } from '../../../../document/models/types';
3
+ import { OntologyValidationError } from '../../../../object/validation/types';
4
+ export { ICanonDocumentRepository };
5
+ export { CanonDocument };
6
+ export { OntologyValidationError };
7
+ /**
8
+ * Interface for validation rules that require repository access to validate external dependencies and imports
9
+ */
10
+ export interface IRepositoryValidationRule {
11
+ /**
12
+ * The name of this validation rule
13
+ */
14
+ readonly ruleName: string;
15
+ /**
16
+ * Validates a Canon document against this rule using repository for external lookups
17
+ */
18
+ validateAsync(document: CanonDocument, repository: ICanonDocumentRepository): Promise<Array<OntologyValidationError>>;
19
+ }
@@ -0,0 +1,5 @@
1
+ // This file was auto-generated by Canon SDK Transpiler v1.0.0
2
+ // Source: canon-sdk-csharp\Canon.Object\Validation\Rules\Repository\IRepositoryValidationRule.cs
3
+ // SourceHash: sha256-a66884267443a69f8af8aef3807bf2eddd14066e5ee15678307745dd865658bc
4
+ // DO NOT EDIT - changes will be overwritten
5
+ export {};