@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.
- package/dist/ctl/models/enums.d.ts +58 -0
- package/dist/ctl/models/enums.js +64 -0
- package/dist/ctl/models/types.d.ts +169 -0
- package/dist/ctl/models/types.js +5 -0
- package/dist/ctl/parsing/enums.d.ts +38 -0
- package/dist/ctl/parsing/enums.js +44 -0
- package/dist/ctl/parsing/types.d.ts +89 -0
- package/dist/ctl/parsing/types.js +5 -0
- package/dist/ctl/rendering/types.d.ts +39 -0
- package/dist/ctl/rendering/types.js +5 -0
- package/dist/ctl/resolution/enums.d.ts +34 -0
- package/dist/ctl/resolution/enums.js +40 -0
- package/dist/ctl/resolution/types.d.ts +156 -0
- package/dist/ctl/resolution/types.js +5 -0
- package/dist/ctl/validation/types.d.ts +10 -0
- package/dist/ctl/validation/types.js +5 -0
- package/dist/document/constants/types.d.ts +5 -0
- package/dist/document/constants/types.js +5 -0
- package/dist/document/filtering/index.d.ts +13 -0
- package/dist/document/filtering/index.js +5 -0
- package/dist/document/filtering/types.d.ts +14 -0
- package/dist/document/filtering/types.js +5 -0
- package/dist/document/models/enums.d.ts +21 -0
- package/dist/document/models/enums.js +26 -0
- package/dist/document/models/index.d.ts +47 -0
- package/dist/document/models/index.js +5 -0
- package/dist/document/models/types.d.ts +194 -0
- package/dist/document/models/types.js +5 -0
- package/dist/document/parsing/index.d.ts +19 -0
- package/dist/document/parsing/index.js +5 -0
- package/dist/document/parsing/types.d.ts +10 -0
- package/dist/document/parsing/types.js +5 -0
- package/dist/document/repositories/enums.d.ts +17 -0
- package/dist/document/repositories/enums.js +22 -0
- package/dist/document/repositories/types.d.ts +103 -0
- package/dist/document/repositories/types.js +5 -0
- package/dist/document/storage/index.d.ts +25 -0
- package/dist/document/storage/index.js +5 -0
- package/dist/document/storage/types.d.ts +5 -0
- package/dist/document/storage/types.js +5 -0
- package/dist/exporters/ctl/markdown/types.d.ts +10 -0
- package/dist/exporters/ctl/markdown/types.js +5 -0
- package/dist/object/canons/types.d.ts +17 -0
- package/dist/object/canons/types.js +5 -0
- package/dist/object/parsing/index.d.ts +21 -0
- package/dist/object/parsing/index.js +5 -0
- package/dist/object/parsing/types.d.ts +43 -0
- package/dist/object/parsing/types.js +5 -0
- package/dist/object/resolution/types.d.ts +116 -0
- package/dist/object/resolution/types.js +5 -0
- package/dist/object/statements/index.d.ts +2 -0
- package/dist/object/statements/index.js +5 -0
- package/dist/object/statements/types.d.ts +20 -0
- package/dist/object/statements/types.js +5 -0
- package/dist/object/uris/types.d.ts +17 -0
- package/dist/object/uris/types.js +5 -0
- package/dist/object/validation/enums.d.ts +13 -0
- package/dist/object/validation/enums.js +18 -0
- package/dist/object/validation/index.d.ts +19 -0
- package/dist/object/validation/index.js +5 -0
- package/dist/object/validation/rules/document/index.d.ts +17 -0
- package/dist/object/validation/rules/document/index.js +5 -0
- package/dist/object/validation/rules/document/types.d.ts +52 -0
- package/dist/object/validation/rules/document/types.js +5 -0
- package/dist/object/validation/rules/repository/index.d.ts +19 -0
- package/dist/object/validation/rules/repository/index.js +5 -0
- package/dist/object/validation/rules/repository/types.d.ts +148 -0
- package/dist/object/validation/rules/repository/types.js +5 -0
- package/dist/object/validation/types.d.ts +134 -0
- package/dist/object/validation/types.js +5 -0
- package/dist/registry/models/types.d.ts +253 -0
- package/dist/registry/models/types.js +5 -0
- package/dist/registry/oauth/types.d.ts +192 -0
- package/dist/registry/oauth/types.js +5 -0
- package/dist/registry/providers/enums.d.ts +8 -0
- package/dist/registry/providers/enums.js +13 -0
- package/dist/registry/providers/git/types.d.ts +43 -0
- package/dist/registry/providers/git/types.js +5 -0
- package/dist/registry/providers/github/models/types.d.ts +35 -0
- package/dist/registry/providers/github/models/types.js +5 -0
- package/dist/registry/providers/github/types.d.ts +30 -0
- package/dist/registry/providers/github/types.js +5 -0
- package/dist/registry/providers/index.d.ts +29 -0
- package/dist/registry/providers/index.js +5 -0
- package/dist/registry/providers/oci/types.d.ts +17 -0
- package/dist/registry/providers/oci/types.js +5 -0
- package/dist/registry/providers/types.d.ts +15 -0
- package/dist/registry/providers/types.js +5 -0
- package/dist/registry/services/index.d.ts +9 -0
- package/dist/registry/services/index.js +5 -0
- package/dist/registry/services/types.d.ts +153 -0
- package/dist/registry/services/types.js +5 -0
- package/package.json +99 -0
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OAuth callback result.
|
|
3
|
+
*/
|
|
4
|
+
export interface CallbackResult {
|
|
5
|
+
code?: string | null | undefined;
|
|
6
|
+
state?: string | null | undefined;
|
|
7
|
+
error?: string | null | undefined;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Dynamic client registration response (RFC 7591).
|
|
11
|
+
*/
|
|
12
|
+
export interface ClientRegistration {
|
|
13
|
+
clientId?: string | null | undefined;
|
|
14
|
+
clientSecret?: string | null | undefined;
|
|
15
|
+
clientIdIssuedAt?: number | null | undefined;
|
|
16
|
+
clientSecretExpiresAt?: number | null | undefined;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Local HTTP server for OAuth callback.
|
|
20
|
+
*/
|
|
21
|
+
export interface LocalCallbackServer {
|
|
22
|
+
startAsync(ct: AbortSignal): Promise<[string, number]>;
|
|
23
|
+
waitForCallbackAsync(ct: AbortSignal): Promise<CallbackResult | null>;
|
|
24
|
+
dispose(): void;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Stores OAuth credentials per domain in ~/.canon/credentials.json. Vendor-agnostic - works with any OAuth-enabled Git registry.
|
|
28
|
+
*/
|
|
29
|
+
export interface OAuthCredentialStore {
|
|
30
|
+
/**
|
|
31
|
+
* Get stored credentials for a host.
|
|
32
|
+
*/
|
|
33
|
+
getAsync(host: string, ct?: AbortSignal): Promise<StoredCredential | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Store credentials for a host.
|
|
36
|
+
*/
|
|
37
|
+
storeAsync(host: string, credential: StoredCredential, ct?: AbortSignal): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Remove credentials for a host.
|
|
40
|
+
*/
|
|
41
|
+
removeAsync(host: string, ct?: AbortSignal): Promise<void>;
|
|
42
|
+
/**
|
|
43
|
+
* List all hosts with stored credentials.
|
|
44
|
+
*/
|
|
45
|
+
listHostsAsync(ct?: AbortSignal): Promise<readonly string[]>;
|
|
46
|
+
/**
|
|
47
|
+
* Check if credentials exist and are valid for a host.
|
|
48
|
+
*/
|
|
49
|
+
hasValidCredentialAsync(host: string, ct?: AbortSignal): Promise<boolean>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Discovers OAuth server metadata using RFC 8414. Vendor-agnostic - works with any OAuth 2.0 compliant server.
|
|
53
|
+
*/
|
|
54
|
+
export interface OAuthDiscoveryService {
|
|
55
|
+
/**
|
|
56
|
+
* Discover OAuth server metadata for a host. Tries RFC 8414 .well-known/oauth-authorization-server first.
|
|
57
|
+
*/
|
|
58
|
+
discoverAsync(host: string, ct?: AbortSignal): Promise<OAuthServerMetadata | null>;
|
|
59
|
+
/**
|
|
60
|
+
* Check if a host supports OAuth discovery.
|
|
61
|
+
*/
|
|
62
|
+
supportsOAuthAsync(host: string, ct?: AbortSignal): Promise<boolean>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* OAuth 2.0 Authorization Code Flow with PKCE. Supports dynamic client registration (RFC 7591). Vendor-agnostic - works with any OAuth 2.0 compliant server.
|
|
66
|
+
*/
|
|
67
|
+
export interface OAuthFlowService {
|
|
68
|
+
/**
|
|
69
|
+
* Perform the full OAuth authorization flow for a host. 1. Discover OAuth endpoints 2. Register client dynamically (if supported) 3. Open browser for authorization 4. Receive callback with authorization code 5. Exchange code for tokens 6. Store credentials
|
|
70
|
+
*/
|
|
71
|
+
authorizeAsync(host: string, scopes: Array<string>, ct?: AbortSignal): Promise<OAuthResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Refresh an expired access token.
|
|
74
|
+
*/
|
|
75
|
+
refreshTokenAsync(host: string, ct?: AbortSignal): Promise<OAuthResult>;
|
|
76
|
+
/**
|
|
77
|
+
* Revoke tokens and remove credentials for a host.
|
|
78
|
+
*/
|
|
79
|
+
logoutAsync(host: string, ct?: AbortSignal): Promise<OAuthResult>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Result of an OAuth operation.
|
|
83
|
+
*/
|
|
84
|
+
export interface OAuthResult {
|
|
85
|
+
isSuccess: boolean;
|
|
86
|
+
host?: string | null | undefined;
|
|
87
|
+
errorMessage?: string | null | undefined;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* OAuth 2.0 Authorization Server Metadata (RFC 8414).
|
|
91
|
+
*/
|
|
92
|
+
export interface OAuthServerMetadata {
|
|
93
|
+
/**
|
|
94
|
+
* Authorization server's issuer identifier.
|
|
95
|
+
*/
|
|
96
|
+
issuer?: string | null | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* URL of the authorization endpoint.
|
|
99
|
+
*/
|
|
100
|
+
authorizationEndpoint?: string | null | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* URL of the token endpoint.
|
|
103
|
+
*/
|
|
104
|
+
tokenEndpoint?: string | null | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* URL of the dynamic client registration endpoint (RFC 7591).
|
|
107
|
+
*/
|
|
108
|
+
registrationEndpoint?: string | null | undefined;
|
|
109
|
+
/**
|
|
110
|
+
* URL of the token revocation endpoint (RFC 7009).
|
|
111
|
+
*/
|
|
112
|
+
revocationEndpoint?: string | null | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* JSON array of supported scopes.
|
|
115
|
+
*/
|
|
116
|
+
scopesSupported?: Array<string> | null | undefined;
|
|
117
|
+
/**
|
|
118
|
+
* JSON array of supported response types.
|
|
119
|
+
*/
|
|
120
|
+
responseTypesSupported?: Array<string> | null | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* JSON array of supported grant types.
|
|
123
|
+
*/
|
|
124
|
+
grantTypesSupported?: Array<string> | null | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* JSON array of supported PKCE code challenge methods.
|
|
127
|
+
*/
|
|
128
|
+
codeChallengeMethodsSupported?: Array<string> | null | undefined;
|
|
129
|
+
/**
|
|
130
|
+
* JSON array of supported token endpoint auth methods.
|
|
131
|
+
*/
|
|
132
|
+
tokenEndpointAuthMethodsSupported?: Array<string> | null | undefined;
|
|
133
|
+
/**
|
|
134
|
+
* Check if PKCE with S256 is supported.
|
|
135
|
+
*/
|
|
136
|
+
readonly supportsPkceS256: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Check if dynamic client registration is supported.
|
|
139
|
+
*/
|
|
140
|
+
readonly supportsDynamicRegistration: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Check if authorization code flow is supported.
|
|
143
|
+
*/
|
|
144
|
+
readonly supportsAuthorizationCode: boolean;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* OAuth credential stored per host.
|
|
148
|
+
*/
|
|
149
|
+
export interface StoredCredential {
|
|
150
|
+
/**
|
|
151
|
+
* OAuth client ID (from dynamic registration or pre-configured).
|
|
152
|
+
*/
|
|
153
|
+
clientId?: string | null | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* OAuth client secret (optional, for confidential clients).
|
|
156
|
+
*/
|
|
157
|
+
clientSecret?: string | null | undefined;
|
|
158
|
+
/**
|
|
159
|
+
* OAuth access token for API calls.
|
|
160
|
+
*/
|
|
161
|
+
accessToken?: string | null | undefined;
|
|
162
|
+
/**
|
|
163
|
+
* OAuth refresh token for obtaining new access tokens.
|
|
164
|
+
*/
|
|
165
|
+
refreshToken?: string | null | undefined;
|
|
166
|
+
/**
|
|
167
|
+
* When the access token expires.
|
|
168
|
+
*/
|
|
169
|
+
expiresAt?: unknown | null | undefined;
|
|
170
|
+
/**
|
|
171
|
+
* OAuth server metadata (cached for refresh).
|
|
172
|
+
*/
|
|
173
|
+
tokenEndpoint?: string | null | undefined;
|
|
174
|
+
/**
|
|
175
|
+
* Check if the access token is expired (with 5 minute buffer).
|
|
176
|
+
*/
|
|
177
|
+
readonly isExpired: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* Check if the credential has a valid access token.
|
|
180
|
+
*/
|
|
181
|
+
readonly hasValidToken: boolean;
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* OAuth token response.
|
|
185
|
+
*/
|
|
186
|
+
export interface TokenResponse {
|
|
187
|
+
accessToken?: string | null | undefined;
|
|
188
|
+
tokenType?: string | null | undefined;
|
|
189
|
+
expiresIn?: number | null | undefined;
|
|
190
|
+
refreshToken?: string | null | undefined;
|
|
191
|
+
scope?: string | null | undefined;
|
|
192
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: canon-sdk-csharp\Canon.Registry\Providers\RegistryProviderFactory.cs
|
|
3
|
+
// SourceHash: sha256-cfb33111d59978a1e256ca2c7bf71fad0f9bbc60b8a173d9580d92455ebd4458
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
/**
|
|
6
|
+
* Registry operations
|
|
7
|
+
*/
|
|
8
|
+
export var RegistryOperation;
|
|
9
|
+
(function (RegistryOperation) {
|
|
10
|
+
RegistryOperation[RegistryOperation["Install"] = 0] = "Install";
|
|
11
|
+
RegistryOperation[RegistryOperation["Publish"] = 1] = "Publish";
|
|
12
|
+
RegistryOperation[RegistryOperation["Delete"] = 2] = "Delete";
|
|
13
|
+
})(RegistryOperation || (RegistryOperation = {}));
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { IRegistryProvider } from '../../../registry/providers/index';
|
|
2
|
+
import { ICanonRegistryService } from '../../../registry/services/index';
|
|
3
|
+
/**
|
|
4
|
+
* Git credential (username + password/token).
|
|
5
|
+
*/
|
|
6
|
+
export interface GitCredential {
|
|
7
|
+
readonly username: string;
|
|
8
|
+
readonly password: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Generic credential provider for Git registries. Supports OAuth tokens, environment variables, and git credential helpers. Vendor-agnostic - no hardcoded registry names.
|
|
12
|
+
*/
|
|
13
|
+
export interface GitCredentialProvider {
|
|
14
|
+
/**
|
|
15
|
+
* Get credentials for a Git host. Tries multiple sources in order: OAuth store, environment, git credential helper.
|
|
16
|
+
*/
|
|
17
|
+
getCredentialAsync(gitHost: string, ct?: AbortSignal): Promise<GitCredential | null>;
|
|
18
|
+
/**
|
|
19
|
+
* Check if credentials exist for a host.
|
|
20
|
+
*/
|
|
21
|
+
hasCredentialAsync(gitHost: string, ct?: AbortSignal): Promise<boolean>;
|
|
22
|
+
}
|
|
23
|
+
export interface GitPackageReference {
|
|
24
|
+
registry: string;
|
|
25
|
+
publisher: string;
|
|
26
|
+
package_: string;
|
|
27
|
+
version?: string | null | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Git-based registry provider. Uses Git Smart HTTP protocol to clone/fetch Canon packages. Vendor-agnostic - works with any Git registry supporting Smart HTTP.
|
|
31
|
+
*/
|
|
32
|
+
export interface GitRegistryProvider extends IRegistryProvider {
|
|
33
|
+
readonly name: string;
|
|
34
|
+
/**
|
|
35
|
+
* Set the registry service for transitive dependency installation.
|
|
36
|
+
*/
|
|
37
|
+
setRegistryService(registryService: ICanonRegistryService): void;
|
|
38
|
+
supportsRegistry(registryUrl: string): boolean;
|
|
39
|
+
installPackageAsync(packageRef: string, publisherDomain: string, workspaceRoot: string): Promise<string>;
|
|
40
|
+
publishPackageAsync(filePath: string, registry: string, publisher?: string | null): Promise<void>;
|
|
41
|
+
deletePackageVersionAsync(publisher: string, package_: string, version: string, registry: string): Promise<void>;
|
|
42
|
+
deleteEntirePackageAsync(publisher: string, package_: string, registry: string): Promise<void>;
|
|
43
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container metadata including tags
|
|
3
|
+
*/
|
|
4
|
+
export interface GitHubContainerMetadata {
|
|
5
|
+
/**
|
|
6
|
+
* List of tags associated with this version
|
|
7
|
+
*/
|
|
8
|
+
tags?: Array<string> | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Metadata for a GitHub package version
|
|
12
|
+
*/
|
|
13
|
+
export interface GitHubPackageMetadata {
|
|
14
|
+
/**
|
|
15
|
+
* Container-specific metadata
|
|
16
|
+
*/
|
|
17
|
+
container?: GitHubContainerMetadata | null | undefined;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Represents a package version in GitHub Container Registry
|
|
21
|
+
*/
|
|
22
|
+
export interface GitHubPackageVersion {
|
|
23
|
+
/**
|
|
24
|
+
* Numeric ID used for deletion operations
|
|
25
|
+
*/
|
|
26
|
+
id: number;
|
|
27
|
+
/**
|
|
28
|
+
* Version name (usually the digest)
|
|
29
|
+
*/
|
|
30
|
+
name: string;
|
|
31
|
+
/**
|
|
32
|
+
* Package metadata including tags
|
|
33
|
+
*/
|
|
34
|
+
metadata?: GitHubPackageMetadata | null | undefined;
|
|
35
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: canon-sdk-csharp\Canon.Registry\Providers\GitHub\Models\GitHubPackageVersion.cs
|
|
3
|
+
// SourceHash: sha256-ce62f79169af02dc81facbedd7e5b28a9d68c8f83dd8dc6c5fbc548288535a23
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GitHubPackageVersion } from '../../../registry/providers/github/models/types';
|
|
2
|
+
import { IRegistryProvider } from '../../../registry/providers/index';
|
|
3
|
+
/**
|
|
4
|
+
* HTTP client for GitHub Container Registry API operations
|
|
5
|
+
*/
|
|
6
|
+
export interface GitHubApiClient {
|
|
7
|
+
/**
|
|
8
|
+
* Get all versions of a package
|
|
9
|
+
*/
|
|
10
|
+
getPackageVersionsAsync(owner: string, packageName: string): Promise<Array<GitHubPackageVersion>>;
|
|
11
|
+
/**
|
|
12
|
+
* Delete a specific package version by ID
|
|
13
|
+
*/
|
|
14
|
+
deletePackageVersionAsync(owner: string, packageName: string, versionId: number): Promise<void>;
|
|
15
|
+
/**
|
|
16
|
+
* Delete an entire package (all versions)
|
|
17
|
+
*/
|
|
18
|
+
deleteEntirePackageAsync(owner: string, packageName: string): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* GitHub Container Registry (ghcr.io) provider using GitHub REST API for operations not supported by OCI spec (like deletions)
|
|
22
|
+
*/
|
|
23
|
+
export interface GitHubRegistryProvider extends IRegistryProvider {
|
|
24
|
+
readonly name: string;
|
|
25
|
+
supportsRegistry(registryUrl: string): boolean;
|
|
26
|
+
installPackageAsync(packageRef: string, publisherDomain: string, workspaceRoot: string): Promise<string>;
|
|
27
|
+
publishPackageAsync(filePath: string, registry: string, publisher?: string | null): Promise<void>;
|
|
28
|
+
deletePackageVersionAsync(publisher: string, package_: string, version: string, registry: string): Promise<void>;
|
|
29
|
+
deleteEntirePackageAsync(publisher: string, package_: string, registry: string): Promise<void>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for registry-specific operations. Implementations handle provider-specific logic (GitHub, Azure, Docker Hub, etc.)
|
|
3
|
+
*/
|
|
4
|
+
export interface IRegistryProvider {
|
|
5
|
+
/**
|
|
6
|
+
* Provider name for logging/debugging
|
|
7
|
+
*/
|
|
8
|
+
readonly name: string;
|
|
9
|
+
/**
|
|
10
|
+
* Check if this provider supports the given registry URL
|
|
11
|
+
*/
|
|
12
|
+
supportsRegistry(registryUrl: string): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Install package from registry
|
|
15
|
+
*/
|
|
16
|
+
installPackageAsync(packageRef: string, publisherDomain: string, workspaceRoot: string): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Publish package to registry
|
|
19
|
+
*/
|
|
20
|
+
publishPackageAsync(filePath: string, registry: string, publisher?: string | null): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Delete a specific version of a package from registry
|
|
23
|
+
*/
|
|
24
|
+
deletePackageVersionAsync(publisher: string, package_: string, version: string, registry: string): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Delete entire package (all versions) from registry
|
|
27
|
+
*/
|
|
28
|
+
deleteEntirePackageAsync(publisher: string, package_: string, registry: string): Promise<void>;
|
|
29
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: canon-sdk-csharp\Canon.Registry\Providers\IRegistryProvider.cs
|
|
3
|
+
// SourceHash: sha256-9bad4233a6719d66dea52c35066504078425d0aff708c996e4658aef98ef0454
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IRegistryProvider } from '../../../registry/providers/index';
|
|
2
|
+
import { ICanonRegistryService } from '../../../registry/services/index';
|
|
3
|
+
/**
|
|
4
|
+
* OCI registry provider using ORAS library. Works with any OCI-compliant registry (Docker Hub, Azure ACR, Harbor, etc.)
|
|
5
|
+
*/
|
|
6
|
+
export interface OciRegistryProvider extends IRegistryProvider {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
/**
|
|
9
|
+
* Set the registry service for transitive dependency installation. This is a setter injection to avoid circular dependency during construction.
|
|
10
|
+
*/
|
|
11
|
+
setRegistryService(registryService: ICanonRegistryService): void;
|
|
12
|
+
supportsRegistry(registryUrl: string): boolean;
|
|
13
|
+
installPackageAsync(packageRef: string, publisherDomain: string, workspaceRoot: string): Promise<string>;
|
|
14
|
+
publishPackageAsync(filePath: string, registry: string, publisher?: string | null): Promise<void>;
|
|
15
|
+
deletePackageVersionAsync(publisher: string, package_: string, version: string, registry: string): Promise<void>;
|
|
16
|
+
deleteEntirePackageAsync(publisher: string, package_: string, registry: string): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: canon-sdk-csharp\Canon.Registry\Providers\Oci\OciRegistryProvider.cs
|
|
3
|
+
// SourceHash: sha256-fa1c626733549449b574312cd33774ac63a685241861808c53600e8fc4202dc0
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { RegistryOperation } from '../../registry/providers/enums';
|
|
2
|
+
import { IRegistryProvider } from '../../registry/providers/index';
|
|
3
|
+
/**
|
|
4
|
+
* Factory for creating the appropriate registry provider based on registry URL. Uses strategy pattern to select provider-specific implementations.
|
|
5
|
+
*/
|
|
6
|
+
export interface RegistryProviderFactory {
|
|
7
|
+
/**
|
|
8
|
+
* Get the appropriate provider for the given registry URL. Returns the first provider that supports the registry, or falls back to OCI provider for all other registries.
|
|
9
|
+
*/
|
|
10
|
+
getProvider(registryUrl: string): IRegistryProvider;
|
|
11
|
+
/**
|
|
12
|
+
* Get a provider for a specific operation type. Some providers only support certain operations (e.g., GitHub only supports delete).
|
|
13
|
+
*/
|
|
14
|
+
getProviderForOperation(registryUrl: string, operation: RegistryOperation): IRegistryProvider;
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: canon-sdk-csharp\Canon.Registry\Providers\RegistryProviderFactory.cs
|
|
3
|
+
// SourceHash: sha256-cfb33111d59978a1e256ca2c7bf71fad0f9bbc60b8a173d9580d92455ebd4458
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for Canon package registry operations. Enables dependency injection and prevents circular dependencies.
|
|
3
|
+
*/
|
|
4
|
+
export interface ICanonRegistryService {
|
|
5
|
+
/**
|
|
6
|
+
* Install a Canon package from a registry. Downloads the package to .canon/ directory and updates canon.lock. Uses domain-based discovery for all publishers (all publishers are domains).
|
|
7
|
+
*/
|
|
8
|
+
installPackageAsync(packageRef: string, workspaceRoot: string): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// This file was auto-generated by Canon SDK Transpiler v1.0.0
|
|
2
|
+
// Source: canon-sdk-csharp\Canon.Registry\Services\ICanonRegistryService.cs
|
|
3
|
+
// SourceHash: sha256-2568f0a7b7c7b330c8b6893cc523b687fa34fe368a7b811fa2bfb42c2905d500
|
|
4
|
+
// DO NOT EDIT - changes will be overwritten
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { CanonConfiguration, CanonLockEntry, CanonLockFile, RegistryMetadata, RegistryOverride } from '../../registry/models/types';
|
|
2
|
+
import { ICanonRegistryService } from '../../registry/services/index';
|
|
3
|
+
/**
|
|
4
|
+
* Provides credentials for OCI registry authentication. Supports multiple auth methods: GitHub tokens, Docker config, environment variables, etc.
|
|
5
|
+
*/
|
|
6
|
+
export interface CanonCredentialProvider {
|
|
7
|
+
/**
|
|
8
|
+
* Resolve credentials for the given registry hostname. Returns empty credential if no credentials are found (public/anonymous access).
|
|
9
|
+
*/
|
|
10
|
+
resolveCredentialAsync(registry: string): Promise<any>;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Main service for interacting with Canon package registries. Uses provider pattern to delegate operations to registry-specific implementations. Supports domain-based publisher discovery via .well-known/canon-registry.json
|
|
14
|
+
*/
|
|
15
|
+
export interface CanonRegistryService extends ICanonRegistryService {
|
|
16
|
+
/**
|
|
17
|
+
* Install a Canon package from a registry. Downloads the package to .canon/ directory and updates canon.lock. Uses domain-based discovery for all publishers (all publishers are domains).
|
|
18
|
+
*/
|
|
19
|
+
installPackageAsync(packageRef: string, workspaceRoot: string): Promise<string>;
|
|
20
|
+
/**
|
|
21
|
+
* Publish a Canon package to a registry. Uses domain-based discovery to determine target registry and OCI-safe namespace.
|
|
22
|
+
*/
|
|
23
|
+
publishPackageAsync(canonFilePath: string): Promise<void>;
|
|
24
|
+
/**
|
|
25
|
+
* Delete a specific version of a Canon package from a registry. Uses domain-based discovery to determine target registry.
|
|
26
|
+
*/
|
|
27
|
+
deletePackageVersionAsync(publisher: string, package_: string, version: string): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Delete an entire Canon package (all versions) from a registry. Uses domain-based discovery to determine target registry. Uses registry-specific provider to handle deletion (e.g., GitHub API for ghcr.io).
|
|
30
|
+
*/
|
|
31
|
+
deleteEntirePackageAsync(publisher: string, package_: string): Promise<void>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Loads and merges Canon configuration from multiple sources Precedence: User config > System config > Defaults
|
|
35
|
+
*/
|
|
36
|
+
export interface ConfigurationService {
|
|
37
|
+
/**
|
|
38
|
+
* Get the merged configuration
|
|
39
|
+
*/
|
|
40
|
+
readonly configuration: CanonConfiguration;
|
|
41
|
+
/**
|
|
42
|
+
* Check if discovery is enabled globally
|
|
43
|
+
*/
|
|
44
|
+
isDiscoveryEnabled(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Get discovery timeout in seconds
|
|
47
|
+
*/
|
|
48
|
+
getDiscoveryTimeout(): number;
|
|
49
|
+
/**
|
|
50
|
+
* Get registry override for a domain (supports wildcards)
|
|
51
|
+
*/
|
|
52
|
+
getOverride(domain: string): RegistryOverride | null;
|
|
53
|
+
/**
|
|
54
|
+
* Check if an override exists for a domain
|
|
55
|
+
*/
|
|
56
|
+
hasOverride(domain: string): boolean;
|
|
57
|
+
}
|
|
58
|
+
export interface DockerAuthEntry {
|
|
59
|
+
auth?: string | null | undefined;
|
|
60
|
+
username?: string | null | undefined;
|
|
61
|
+
password?: string | null | undefined;
|
|
62
|
+
identityToken?: string | null | undefined;
|
|
63
|
+
}
|
|
64
|
+
export interface DockerConfig {
|
|
65
|
+
auths?: Record<string, DockerAuthEntry> | undefined;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Service for reading and writing canon.lock files. Ensures reproducible package installations across machines.
|
|
69
|
+
*/
|
|
70
|
+
export interface LockFileService {
|
|
71
|
+
/**
|
|
72
|
+
* Load canon.lock from the specified workspace root. Returns null if the file doesn't exist.
|
|
73
|
+
*/
|
|
74
|
+
loadAsync(workspaceRoot: string): Promise<CanonLockFile | null>;
|
|
75
|
+
/**
|
|
76
|
+
* Save canon.lock to the specified workspace root.
|
|
77
|
+
*/
|
|
78
|
+
saveAsync(lockFile: CanonLockFile, workspaceRoot: string): Promise<void>;
|
|
79
|
+
/**
|
|
80
|
+
* Update or add a package entry in the lock file.
|
|
81
|
+
*/
|
|
82
|
+
updatePackageAsync(workspaceRoot: string, packageKey: string, entry: CanonLockEntry): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Get the locked version for a package, if it exists. Returns null if not locked.
|
|
85
|
+
*/
|
|
86
|
+
getLockedVersionAsync(workspaceRoot: string, packageKey: string): Promise<CanonLockEntry | null>;
|
|
87
|
+
/**
|
|
88
|
+
* Check if a package is locked and get its version.
|
|
89
|
+
*/
|
|
90
|
+
getLockedPackageVersionAsync(workspaceRoot: string, publisher: string, package_: string): Promise<string | null>;
|
|
91
|
+
/**
|
|
92
|
+
* Remove a package from the lock file.
|
|
93
|
+
*/
|
|
94
|
+
removePackageAsync(workspaceRoot: string, packageKey: string): Promise<void>;
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Service for building and maintaining an index of namespace → file path mappings. This enables resolving imports by namespace (e.g., "canon-protocol.org/core-rdf" → ".canon/canon-protocol.org/core-rdf@1.0.1.can.yml").
|
|
98
|
+
*/
|
|
99
|
+
export interface NamespaceIndexService {
|
|
100
|
+
/**
|
|
101
|
+
* Build the namespace index by scanning all Canon documents in the repository. This includes both workspace files and .canon/ dependencies.
|
|
102
|
+
*/
|
|
103
|
+
buildIndexAsync(workspaceRoot: string): Promise<number>;
|
|
104
|
+
/**
|
|
105
|
+
* Add a single file to the namespace index. Parses the file to extract its namespace and maps it to the file path.
|
|
106
|
+
*/
|
|
107
|
+
addFileToIndexAsync(filePath: string): Promise<boolean>;
|
|
108
|
+
/**
|
|
109
|
+
* Remove a file from the namespace index.
|
|
110
|
+
*/
|
|
111
|
+
removeFile(filePath: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Resolve a namespace to a file path. Returns null if the namespace is not found.
|
|
114
|
+
*/
|
|
115
|
+
resolveNamespace(namespaceName: string): string | null;
|
|
116
|
+
/**
|
|
117
|
+
* Check if a namespace exists in the index.
|
|
118
|
+
*/
|
|
119
|
+
hasNamespace(namespaceName: string): boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Get all indexed namespaces.
|
|
122
|
+
*/
|
|
123
|
+
getAllNamespaces(): Array<string>;
|
|
124
|
+
/**
|
|
125
|
+
* Get the file path for a namespace.
|
|
126
|
+
*/
|
|
127
|
+
getFilePath(namespaceName: string): string | null;
|
|
128
|
+
/**
|
|
129
|
+
* Get statistics about the namespace index.
|
|
130
|
+
*/
|
|
131
|
+
getStats(): NamespaceIndexStats;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Statistics about the namespace index.
|
|
135
|
+
*/
|
|
136
|
+
export interface NamespaceIndexStats {
|
|
137
|
+
totalNamespaces: number;
|
|
138
|
+
workspaceNamespaces: number;
|
|
139
|
+
dependencyNamespaces: number;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Discovers OCI registry information from domain-based publishers Fetches .well-known/canon-registry.can.yml and caches results
|
|
143
|
+
*/
|
|
144
|
+
export interface RegistryDiscoveryService {
|
|
145
|
+
/**
|
|
146
|
+
* Discover registry metadata for a domain-based publisher Checks configuration overrides first, then falls back to .well-known discovery
|
|
147
|
+
*/
|
|
148
|
+
discoverAsync(domain: string): Promise<RegistryMetadata>;
|
|
149
|
+
/**
|
|
150
|
+
* Clear cached metadata for a domain (or all domains if null)
|
|
151
|
+
*/
|
|
152
|
+
clearCacheAsync(domain?: string | null): Promise<void>;
|
|
153
|
+
}
|