@sourceaxis/contracts 0.1.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/README.md +33 -0
- package/dist/cjs/authentication/index.js +3 -0
- package/dist/cjs/authentication/index.js.map +1 -0
- package/dist/cjs/cache/index.js +3 -0
- package/dist/cjs/cache/index.js.map +1 -0
- package/dist/cjs/capabilities/index.js +3 -0
- package/dist/cjs/capabilities/index.js.map +1 -0
- package/dist/cjs/diagnostics/index.js +3 -0
- package/dist/cjs/diagnostics/index.js.map +1 -0
- package/dist/cjs/domain/index.js +3 -0
- package/dist/cjs/domain/index.js.map +1 -0
- package/dist/cjs/index.js +3 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/metadata/index.js +3 -0
- package/dist/cjs/metadata/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/pagination/index.js +3 -0
- package/dist/cjs/pagination/index.js.map +1 -0
- package/dist/cjs/provider/index.js +3 -0
- package/dist/cjs/provider/index.js.map +1 -0
- package/dist/cjs/transport/index.js +3 -0
- package/dist/cjs/transport/index.js.map +1 -0
- package/dist/cjs/types/index.js +3 -0
- package/dist/cjs/types/index.js.map +1 -0
- package/dist/esm/authentication/index.d.ts +48 -0
- package/dist/esm/authentication/index.d.ts.map +1 -0
- package/dist/esm/authentication/index.js +1 -0
- package/dist/esm/cache/index.d.ts +26 -0
- package/dist/esm/cache/index.d.ts.map +1 -0
- package/dist/esm/cache/index.js +1 -0
- package/dist/esm/capabilities/index.d.ts +145 -0
- package/dist/esm/capabilities/index.d.ts.map +1 -0
- package/dist/esm/capabilities/index.js +1 -0
- package/dist/esm/diagnostics/index.d.ts +28 -0
- package/dist/esm/diagnostics/index.d.ts.map +1 -0
- package/dist/esm/diagnostics/index.js +1 -0
- package/dist/esm/domain/index.d.ts +235 -0
- package/dist/esm/domain/index.d.ts.map +1 -0
- package/dist/esm/domain/index.js +1 -0
- package/dist/esm/index.d.ts +11 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/metadata/index.d.ts +39 -0
- package/dist/esm/metadata/index.d.ts.map +1 -0
- package/dist/esm/metadata/index.js +1 -0
- package/dist/esm/pagination/index.d.ts +22 -0
- package/dist/esm/pagination/index.d.ts.map +1 -0
- package/dist/esm/pagination/index.js +1 -0
- package/dist/esm/provider/index.d.ts +64 -0
- package/dist/esm/provider/index.d.ts.map +1 -0
- package/dist/esm/provider/index.js +1 -0
- package/dist/esm/transport/index.d.ts +26 -0
- package/dist/esm/transport/index.d.ts.map +1 -0
- package/dist/esm/transport/index.js +1 -0
- package/dist/esm/types/index.d.ts +64 -0
- package/dist/esm/types/index.d.ts.map +1 -0
- package/dist/esm/types/index.js +1 -0
- package/package.json +111 -0
package/README.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# @sourceaxis/contracts
|
|
2
|
+
|
|
3
|
+
Stable provider-neutral TypeScript contracts for SourceAxis.
|
|
4
|
+
|
|
5
|
+
## Responsibilities
|
|
6
|
+
|
|
7
|
+
- Define repository domain models.
|
|
8
|
+
- Define capability interfaces for files, tree, history, search, branches, tags, releases, issues,
|
|
9
|
+
and pull requests.
|
|
10
|
+
- Define provider, session, authentication, transport, cache, diagnostics, pagination, metadata, and
|
|
11
|
+
JSON-safe value contracts.
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
pnpm add @sourceaxis/contracts
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Most applications consume these types transitively through `@sourceaxis/core` and provider packages.
|
|
20
|
+
Provider authors import this package directly.
|
|
21
|
+
|
|
22
|
+
## Usage
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import type { RepositoryInfo } from "@sourceaxis/contracts";
|
|
26
|
+
|
|
27
|
+
function printRepository(info: RepositoryInfo): string {
|
|
28
|
+
return `${info.fullName} (${info.visibility})`;
|
|
29
|
+
}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Contracts are the compatibility boundary. Runtime packages may implement them, but applications
|
|
33
|
+
should not rely on package internals.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"commonjs"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ProviderId } from "../metadata/index.js";
|
|
2
|
+
import type { DeepReadonly, JsonValue, OperationOptions } from "../types/index.js";
|
|
3
|
+
export type AuthenticationType = "anonymous" | "token" | "oauth" | "application" | "custom";
|
|
4
|
+
export type CredentialKind = "anonymous" | "access-token" | "oauth-token" | "application-token";
|
|
5
|
+
export type CredentialScope = string;
|
|
6
|
+
export type CredentialMetadata = DeepReadonly<{
|
|
7
|
+
scopes?: readonly CredentialScope[];
|
|
8
|
+
expiresAt?: string;
|
|
9
|
+
issuedAt?: string;
|
|
10
|
+
extra?: Readonly<Record<string, JsonValue>>;
|
|
11
|
+
}>;
|
|
12
|
+
export type Credentials = DeepReadonly<{
|
|
13
|
+
kind: CredentialKind;
|
|
14
|
+
provider?: ProviderId;
|
|
15
|
+
metadata?: CredentialMetadata;
|
|
16
|
+
}>;
|
|
17
|
+
export type TokenCredentials = Credentials & DeepReadonly<{
|
|
18
|
+
kind: "access-token" | "oauth-token" | "application-token";
|
|
19
|
+
token: string;
|
|
20
|
+
}>;
|
|
21
|
+
export type AnonymousCredentials = Credentials & DeepReadonly<{
|
|
22
|
+
kind: "anonymous";
|
|
23
|
+
}>;
|
|
24
|
+
export type AuthenticationContext = DeepReadonly<{
|
|
25
|
+
type: AuthenticationType;
|
|
26
|
+
provider?: ProviderId;
|
|
27
|
+
credentials: Credentials;
|
|
28
|
+
scopes?: readonly CredentialScope[];
|
|
29
|
+
expiresAt?: string;
|
|
30
|
+
metadata?: CredentialMetadata;
|
|
31
|
+
}>;
|
|
32
|
+
export type AuthenticationRequest = OperationOptions & DeepReadonly<{
|
|
33
|
+
provider?: ProviderId;
|
|
34
|
+
requiredScopes?: readonly CredentialScope[];
|
|
35
|
+
}>;
|
|
36
|
+
export interface AuthenticationStrategy {
|
|
37
|
+
readonly type: AuthenticationType;
|
|
38
|
+
authenticate(request?: AuthenticationRequest): Promise<AuthenticationContext>;
|
|
39
|
+
refresh?(context: AuthenticationContext, request?: AuthenticationRequest): Promise<AuthenticationContext>;
|
|
40
|
+
}
|
|
41
|
+
export interface CredentialResolver {
|
|
42
|
+
resolve(request?: AuthenticationRequest): Promise<Credentials>;
|
|
43
|
+
}
|
|
44
|
+
export interface TokenProvider {
|
|
45
|
+
getToken(request?: AuthenticationRequest): Promise<TokenCredentials>;
|
|
46
|
+
refreshToken?(credentials: TokenCredentials, request?: AuthenticationRequest): Promise<TokenCredentials>;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/authentication/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,OAAO,GAAG,OAAO,GAAG,aAAa,GAAG,QAAQ,CAAC;AAC5F,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,cAAc,GAAG,aAAa,GAAG,mBAAmB,CAAC;AAEhG,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC;AAErC,MAAM,MAAM,kBAAkB,GAAG,YAAY,CAAC;IAC5C,MAAM,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;IACpC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC;IACrC,IAAI,EAAE,cAAc,CAAC;IACrB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,WAAW,GACxC,YAAY,CAAC;IACX,IAAI,EA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AO,CAAC,gBAAgB,CAAC,CAAC;CAC9B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Metadata } from "../metadata/index.js";
|
|
2
|
+
import type { DeepReadonly, JsonValue } from "../types/index.js";
|
|
3
|
+
export type CacheNamespace = "repository" | "reference" | "tree" | "blob" | "commit" | "search" | "release" | "issue" | "pull-request";
|
|
4
|
+
export type CacheKey = DeepReadonly<{
|
|
5
|
+
namespace: CacheNamespace;
|
|
6
|
+
parts: readonly string[];
|
|
7
|
+
}>;
|
|
8
|
+
export type CacheEntry<TValue = JsonValue> = DeepReadonly<{
|
|
9
|
+
key: CacheKey;
|
|
10
|
+
value: TValue;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
expiresAt?: string;
|
|
13
|
+
metadata?: Metadata;
|
|
14
|
+
}>;
|
|
15
|
+
export type CachePolicy = DeepReadonly<{
|
|
16
|
+
enabled: boolean;
|
|
17
|
+
ttlMs?: number;
|
|
18
|
+
staleWhileRevalidateMs?: number;
|
|
19
|
+
}>;
|
|
20
|
+
export interface CacheProvider<TValue = JsonValue> {
|
|
21
|
+
get(key: CacheKey): Promise<CacheEntry<TValue> | undefined>;
|
|
22
|
+
set(entry: CacheEntry<TValue>): Promise<void>;
|
|
23
|
+
delete(key: CacheKey): Promise<void>;
|
|
24
|
+
clear(namespace?: CacheNamespace): Promise<void>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cache/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,MAAM,cAAc,GACtB,YAAY,GACZ,WAAW,GACX,MAAM,GACN,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,SAAS,GACT,OAAO,GACP,cAAc,CAAC;AAEnB,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;IAClC,SAAS,EAAE,cAAc,CAAC;IAC1B,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,MAAM,UAAU,CAAC,MAAM,GAAG,SAAS,IAAI,YAAY,CAAC;IACxD,GAAG,EAAE,QAAQ,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC;IACrC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC,CAAC;AAEH,MAAM,WAAW,aAAa,CAAC,MAAM,GAAG,SAAS;IAC/C,GAAG,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,GAAG,SAAS,CAAC,CAAC;IAC5D,GAAG,CAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9C,MAAM,CAAC,GAAG,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,KAAK,CAAC,SAAS,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import type { Blob, Branch, BranchFilter, Commit, CommitFilter, FileInfo, Issue, IssueFilter, PullRequest, PullRequestFilter, Reference, Release, ReleaseFilter, RepositoryIdentity, RepositoryInfo, Tag, Tree, TreeNode } from "../domain/index.js";
|
|
2
|
+
import type { FilePath, ReferenceName, TagName } from "../metadata/index.js";
|
|
3
|
+
import type { ListOptions, PagedResult } from "../pagination/index.js";
|
|
4
|
+
import type { DeepReadonly, JsonValue, OperationOptions } from "../types/index.js";
|
|
5
|
+
export type CapabilityStatus = "supported" | "unsupported" | "partial";
|
|
6
|
+
export type CapabilityDescriptor = DeepReadonly<{
|
|
7
|
+
name: string;
|
|
8
|
+
status: CapabilityStatus;
|
|
9
|
+
version?: string;
|
|
10
|
+
operations?: readonly string[];
|
|
11
|
+
limitations?: readonly string[];
|
|
12
|
+
}>;
|
|
13
|
+
export type CapabilityMap = DeepReadonly<{
|
|
14
|
+
files?: CapabilityDescriptor;
|
|
15
|
+
tree?: CapabilityDescriptor;
|
|
16
|
+
history?: CapabilityDescriptor;
|
|
17
|
+
search?: CapabilityDescriptor;
|
|
18
|
+
branches?: CapabilityDescriptor;
|
|
19
|
+
tags?: CapabilityDescriptor;
|
|
20
|
+
releases?: CapabilityDescriptor;
|
|
21
|
+
issues?: CapabilityDescriptor;
|
|
22
|
+
pullRequests?: CapabilityDescriptor;
|
|
23
|
+
}>;
|
|
24
|
+
export type ReadFileOptions = OperationOptions & DeepReadonly<{
|
|
25
|
+
encoding?: "utf-8";
|
|
26
|
+
}>;
|
|
27
|
+
export type ReadBinaryOptions = OperationOptions;
|
|
28
|
+
export type DownloadOptions = OperationOptions;
|
|
29
|
+
export type StreamOptions = OperationOptions;
|
|
30
|
+
export type TreeListOptions = OperationOptions & DeepReadonly<{
|
|
31
|
+
recursive?: boolean;
|
|
32
|
+
}>;
|
|
33
|
+
export type TreeWalkOptions = TreeListOptions;
|
|
34
|
+
export type TextSearchOptions = OperationOptions & DeepReadonly<{
|
|
35
|
+
caseSensitive?: boolean;
|
|
36
|
+
regex?: boolean;
|
|
37
|
+
limit?: number;
|
|
38
|
+
path?: FilePath;
|
|
39
|
+
}>;
|
|
40
|
+
export type SearchQuery = TextSearchOptions & DeepReadonly<{
|
|
41
|
+
text: string;
|
|
42
|
+
}>;
|
|
43
|
+
export type SearchMatch = DeepReadonly<{
|
|
44
|
+
lineNumber: number;
|
|
45
|
+
text: string;
|
|
46
|
+
before?: readonly string[];
|
|
47
|
+
after?: readonly string[];
|
|
48
|
+
}>;
|
|
49
|
+
export type SearchResultKind = "file" | "commit" | "issue" | "pull-request" | "release";
|
|
50
|
+
export type SearchResult<TItem = FileInfo> = DeepReadonly<{
|
|
51
|
+
kind: SearchResultKind;
|
|
52
|
+
item: TItem;
|
|
53
|
+
score?: number;
|
|
54
|
+
matches?: readonly SearchMatch[];
|
|
55
|
+
}>;
|
|
56
|
+
export type FileHistoryOptions = ListOptions<"date">;
|
|
57
|
+
export type CommitListOptions = ListOptions<"date"> & DeepReadonly<{
|
|
58
|
+
filter?: CommitFilter;
|
|
59
|
+
}>;
|
|
60
|
+
export type BranchListOptions = ListOptions<"name"> & DeepReadonly<{
|
|
61
|
+
filter?: BranchFilter;
|
|
62
|
+
}>;
|
|
63
|
+
export type TagListOptions = ListOptions<"name" | "date">;
|
|
64
|
+
export type ReleaseListOptions = ListOptions<"date" | "name"> & DeepReadonly<{
|
|
65
|
+
filter?: ReleaseFilter;
|
|
66
|
+
}>;
|
|
67
|
+
export type IssueListOptions = ListOptions<"date" | "number"> & DeepReadonly<{
|
|
68
|
+
filter?: IssueFilter;
|
|
69
|
+
}>;
|
|
70
|
+
export type PullRequestListOptions = ListOptions<"date" | "number"> & DeepReadonly<{
|
|
71
|
+
filter?: PullRequestFilter;
|
|
72
|
+
}>;
|
|
73
|
+
export interface FilesCapability {
|
|
74
|
+
readText(path: FilePath, options?: ReadFileOptions): Promise<string>;
|
|
75
|
+
readJson<TValue extends JsonValue = JsonValue>(path: FilePath, options?: ReadFileOptions): Promise<TValue>;
|
|
76
|
+
readBinary(path: FilePath, options?: ReadBinaryOptions): Promise<Uint8Array>;
|
|
77
|
+
download(path: FilePath, options?: DownloadOptions): Promise<Blob>;
|
|
78
|
+
stream(path: FilePath, options?: StreamOptions): Promise<AsyncIterable<Uint8Array>>;
|
|
79
|
+
exists(path: FilePath, options?: OperationOptions): Promise<boolean>;
|
|
80
|
+
metadata(path: FilePath, options?: OperationOptions): Promise<FileInfo>;
|
|
81
|
+
getMetadata(path: FilePath, options?: OperationOptions): Promise<FileInfo>;
|
|
82
|
+
}
|
|
83
|
+
export interface TreeCapability {
|
|
84
|
+
list(path?: FilePath, options?: TreeListOptions): Promise<readonly TreeNode[]>;
|
|
85
|
+
walk(options?: TreeWalkOptions): AsyncIterable<TreeNode>;
|
|
86
|
+
get(path: FilePath, options?: OperationOptions): Promise<TreeNode>;
|
|
87
|
+
tree(path?: FilePath, options?: TreeListOptions): Promise<Tree>;
|
|
88
|
+
}
|
|
89
|
+
export interface SearchCapability {
|
|
90
|
+
text(query: string, options?: TextSearchOptions): Promise<PagedResult<SearchResult<FileInfo>>>;
|
|
91
|
+
query<TItem = FileInfo>(query: SearchQuery): Promise<PagedResult<SearchResult<TItem>>>;
|
|
92
|
+
}
|
|
93
|
+
export interface HistoryCapability {
|
|
94
|
+
list(options?: CommitListOptions): Promise<PagedResult<Commit>>;
|
|
95
|
+
get(sha: string, options?: OperationOptions): Promise<Commit>;
|
|
96
|
+
file(path: FilePath, options?: FileHistoryOptions): Promise<PagedResult<Commit>>;
|
|
97
|
+
}
|
|
98
|
+
export interface BranchesCapability {
|
|
99
|
+
list(options?: BranchListOptions): Promise<PagedResult<Branch>>;
|
|
100
|
+
get(name: string, options?: OperationOptions): Promise<Branch>;
|
|
101
|
+
}
|
|
102
|
+
export interface TagsCapability {
|
|
103
|
+
list(options?: TagListOptions): Promise<PagedResult<Tag>>;
|
|
104
|
+
get(name: TagName, options?: OperationOptions): Promise<Tag>;
|
|
105
|
+
}
|
|
106
|
+
export interface ReleasesCapability {
|
|
107
|
+
list(options?: ReleaseListOptions): Promise<PagedResult<Release>>;
|
|
108
|
+
get(tagName: TagName, options?: OperationOptions): Promise<Release>;
|
|
109
|
+
}
|
|
110
|
+
export interface IssuesCapability {
|
|
111
|
+
list(options?: IssueListOptions): Promise<PagedResult<Issue>>;
|
|
112
|
+
get(number: number, options?: OperationOptions): Promise<Issue>;
|
|
113
|
+
}
|
|
114
|
+
export interface PullRequestsCapability {
|
|
115
|
+
list(options?: PullRequestListOptions): Promise<PagedResult<PullRequest>>;
|
|
116
|
+
get(number: number, options?: OperationOptions): Promise<PullRequest>;
|
|
117
|
+
}
|
|
118
|
+
export interface Repository {
|
|
119
|
+
readonly identity: RepositoryIdentity;
|
|
120
|
+
readonly info: RepositoryInfo;
|
|
121
|
+
readonly capabilities: CapabilityMap;
|
|
122
|
+
readonly extensions: Readonly<Record<string, unknown>>;
|
|
123
|
+
ref(reference: ReferenceName | Reference): RepositoryRef;
|
|
124
|
+
defaultRef(): RepositoryRef;
|
|
125
|
+
readText(path: FilePath, options?: ReadFileOptions): Promise<string>;
|
|
126
|
+
readJson<TValue extends JsonValue = JsonValue>(path: FilePath, options?: ReadFileOptions): Promise<TValue>;
|
|
127
|
+
exists(path: FilePath, options?: OperationOptions): Promise<boolean>;
|
|
128
|
+
dispose(): Promise<void>;
|
|
129
|
+
}
|
|
130
|
+
export interface RepositoryRef {
|
|
131
|
+
readonly repository: RepositoryIdentity;
|
|
132
|
+
readonly reference: Reference;
|
|
133
|
+
readonly files: FilesCapability;
|
|
134
|
+
readonly tree: TreeCapability;
|
|
135
|
+
readonly history: HistoryCapability;
|
|
136
|
+
readonly commits: HistoryCapability;
|
|
137
|
+
readonly search: SearchCapability;
|
|
138
|
+
readonly branches: BranchesCapability;
|
|
139
|
+
readonly tags: TagsCapability;
|
|
140
|
+
readonly releases: ReleasesCapability;
|
|
141
|
+
readonly issues?: IssuesCapability;
|
|
142
|
+
readonly pullRequests?: PullRequestsCapability;
|
|
143
|
+
readme(options?: OperationOptions): Promise<string>;
|
|
144
|
+
}
|
|
145
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":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Q,CAAC,UAAU,EAAE,kBAAkB,CAAC;IACxC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,QAAQ,CAAC,KAAK,EAAE,eAAe,CAAC;IAChC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,QAAQ,CAAC,MAAM,EAAE,gBAAgB,CAAC;IAClC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,CAAC;IACtC,QAAQ,CAAC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IACnC,QAAQ,CAAC,YAAY,CAAC,EAAE,sBAAsB,CAAC;IAC/C,MAAM,CAAC,OAAO,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;CACrD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Metadata, ProviderId, RepositoryName } from "../metadata/index.js";
|
|
2
|
+
import type { DeepReadonly, JsonValue } from "../types/index.js";
|
|
3
|
+
export type DiagnosticEventKind = "repository" | "transport" | "authentication" | "cache" | "error" | "provider";
|
|
4
|
+
export type DiagnosticContext = DeepReadonly<{
|
|
5
|
+
operation?: string;
|
|
6
|
+
capability?: string;
|
|
7
|
+
provider?: ProviderId;
|
|
8
|
+
repository?: RepositoryName;
|
|
9
|
+
reference?: string;
|
|
10
|
+
path?: string;
|
|
11
|
+
correlationId?: string;
|
|
12
|
+
metadata?: Metadata;
|
|
13
|
+
}>;
|
|
14
|
+
export type DiagnosticEvent = DeepReadonly<{
|
|
15
|
+
id: string;
|
|
16
|
+
kind: DiagnosticEventKind;
|
|
17
|
+
name: string;
|
|
18
|
+
schemaVersion: string;
|
|
19
|
+
timestamp: string;
|
|
20
|
+
context?: DiagnosticContext;
|
|
21
|
+
data?: Readonly<Record<string, JsonValue>>;
|
|
22
|
+
}>;
|
|
23
|
+
export type DiagnosticSubscriber = (event: DiagnosticEvent) => void | Promise<void>;
|
|
24
|
+
export interface DiagnosticsService {
|
|
25
|
+
publish(event: DiagnosticEvent): Promise<void>;
|
|
26
|
+
subscribe(subscriber: DiagnosticSubscriber): Promise<() => Promise<void>>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/diagnostics/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,MAAM,mBAAmB,GAC7B,YAAY,GAAG,WAAW,GAAG,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,CAAC;AAEjF,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;IAC3C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,UAAU,CAAC,EAAE,cAAc,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,iBAAiB,CAAC;IAC5B,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CAC5C,CAAC,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,KAAK,EAAE,eAAe,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AAEpF,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/C,SAAS,CAAC,UAAU,EAAE,oBAAoB,GAAG,OAAO,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;CAC3E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import type { BlobSha, BranchName, CommitSha, DateRange, FilePath, IssueId, Metadata, OrganizationId, OrganizationName, OwnerName, ProviderId, PullRequestId, ReleaseId, RepositoryName, RepositoryUrl, TagName, Timestamp, TreeSha, UserId } from "../metadata/index.js";
|
|
2
|
+
import type { DeepReadonly, JsonValue } from "../types/index.js";
|
|
3
|
+
export type RepositoryVisibility = "public" | "private" | "internal" | "unknown";
|
|
4
|
+
export type RepositoryOwnerType = "user" | "organization" | "unknown";
|
|
5
|
+
export type ReferenceType = "branch" | "tag" | "commit" | "pull-request" | "detached";
|
|
6
|
+
export type TreeNodeType = "file" | "directory" | "symlink" | "submodule";
|
|
7
|
+
export type BlobEncoding = "utf-8" | "base64" | "binary";
|
|
8
|
+
export type CommitVerificationStatus = "verified" | "unverified" | "unknown";
|
|
9
|
+
export type PullRequestState = "open" | "closed" | "merged";
|
|
10
|
+
export type IssueState = "open" | "closed";
|
|
11
|
+
export type ReleaseState = "draft" | "prerelease" | "published";
|
|
12
|
+
export type MergeStatus = "clean" | "dirty" | "blocked" | "unknown";
|
|
13
|
+
export type User = DeepReadonly<{
|
|
14
|
+
id?: UserId;
|
|
15
|
+
username: string;
|
|
16
|
+
displayName?: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
avatarUrl?: string;
|
|
19
|
+
url?: string;
|
|
20
|
+
metadata?: Metadata;
|
|
21
|
+
}>;
|
|
22
|
+
export type Organization = DeepReadonly<{
|
|
23
|
+
id?: OrganizationId;
|
|
24
|
+
name: OrganizationName;
|
|
25
|
+
displayName?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
avatarUrl?: string;
|
|
28
|
+
url?: string;
|
|
29
|
+
metadata?: Metadata;
|
|
30
|
+
}>;
|
|
31
|
+
export type RepositoryOwner = User | Organization;
|
|
32
|
+
export type License = DeepReadonly<{
|
|
33
|
+
key: string;
|
|
34
|
+
name: string;
|
|
35
|
+
spdxId?: string;
|
|
36
|
+
url?: string;
|
|
37
|
+
}>;
|
|
38
|
+
export type RepositoryIdentity = DeepReadonly<{
|
|
39
|
+
provider: ProviderId;
|
|
40
|
+
owner: OwnerName;
|
|
41
|
+
name: RepositoryName;
|
|
42
|
+
}>;
|
|
43
|
+
export type RepositoryInfo = DeepReadonly<{
|
|
44
|
+
identity: RepositoryIdentity;
|
|
45
|
+
name: RepositoryName;
|
|
46
|
+
fullName: string;
|
|
47
|
+
owner: RepositoryOwner;
|
|
48
|
+
url: RepositoryUrl;
|
|
49
|
+
defaultBranch?: BranchName;
|
|
50
|
+
description?: string;
|
|
51
|
+
visibility: RepositoryVisibility;
|
|
52
|
+
isArchived?: boolean;
|
|
53
|
+
isFork?: boolean;
|
|
54
|
+
license?: License;
|
|
55
|
+
createdAt?: Timestamp;
|
|
56
|
+
updatedAt?: Timestamp;
|
|
57
|
+
metadata?: Metadata;
|
|
58
|
+
}>;
|
|
59
|
+
export type Workspace = DeepReadonly<{
|
|
60
|
+
provider: ProviderId;
|
|
61
|
+
name: string;
|
|
62
|
+
owner?: RepositoryOwner;
|
|
63
|
+
repositoriesUrl?: string;
|
|
64
|
+
metadata?: Metadata;
|
|
65
|
+
}>;
|
|
66
|
+
export type Reference = DeepReadonly<{
|
|
67
|
+
name: string;
|
|
68
|
+
type: ReferenceType;
|
|
69
|
+
target: CommitSha;
|
|
70
|
+
repository: RepositoryIdentity;
|
|
71
|
+
metadata?: Metadata;
|
|
72
|
+
}>;
|
|
73
|
+
export type Branch = Reference & DeepReadonly<{
|
|
74
|
+
type: "branch";
|
|
75
|
+
name: BranchName;
|
|
76
|
+
protected?: boolean;
|
|
77
|
+
default?: boolean;
|
|
78
|
+
}>;
|
|
79
|
+
export type Tag = Reference & DeepReadonly<{
|
|
80
|
+
type: "tag";
|
|
81
|
+
name: TagName;
|
|
82
|
+
message?: string;
|
|
83
|
+
tagger?: GitActor;
|
|
84
|
+
taggedAt?: Timestamp;
|
|
85
|
+
}>;
|
|
86
|
+
export type GitActor = DeepReadonly<{
|
|
87
|
+
name: string;
|
|
88
|
+
email?: string;
|
|
89
|
+
date?: Timestamp;
|
|
90
|
+
user?: User;
|
|
91
|
+
}>;
|
|
92
|
+
export type CommitParent = DeepReadonly<{
|
|
93
|
+
sha: CommitSha;
|
|
94
|
+
url?: string;
|
|
95
|
+
}>;
|
|
96
|
+
export type CommitVerification = DeepReadonly<{
|
|
97
|
+
status: CommitVerificationStatus;
|
|
98
|
+
reason?: string;
|
|
99
|
+
signature?: string;
|
|
100
|
+
}>;
|
|
101
|
+
export type Commit = DeepReadonly<{
|
|
102
|
+
sha: CommitSha;
|
|
103
|
+
message: string;
|
|
104
|
+
author: GitActor;
|
|
105
|
+
committer?: GitActor;
|
|
106
|
+
parents: readonly CommitParent[];
|
|
107
|
+
tree: TreeSha;
|
|
108
|
+
url?: string;
|
|
109
|
+
verification?: CommitVerification;
|
|
110
|
+
metadata?: Metadata;
|
|
111
|
+
}>;
|
|
112
|
+
export type Tree = DeepReadonly<{
|
|
113
|
+
sha: TreeSha;
|
|
114
|
+
path: FilePath;
|
|
115
|
+
nodes: readonly TreeNode[];
|
|
116
|
+
truncated?: boolean;
|
|
117
|
+
metadata?: Metadata;
|
|
118
|
+
}>;
|
|
119
|
+
export type TreeNode = DeepReadonly<{
|
|
120
|
+
path: FilePath;
|
|
121
|
+
name: string;
|
|
122
|
+
type: TreeNodeType;
|
|
123
|
+
sha?: TreeSha | BlobSha | CommitSha;
|
|
124
|
+
size?: number;
|
|
125
|
+
mode?: string;
|
|
126
|
+
metadata?: Metadata;
|
|
127
|
+
}>;
|
|
128
|
+
export type Blob = DeepReadonly<{
|
|
129
|
+
sha: BlobSha;
|
|
130
|
+
path: FilePath;
|
|
131
|
+
size: number;
|
|
132
|
+
encoding: BlobEncoding;
|
|
133
|
+
content?: string | Uint8Array;
|
|
134
|
+
metadata?: Metadata;
|
|
135
|
+
}>;
|
|
136
|
+
export type FileInfo = DeepReadonly<{
|
|
137
|
+
path: FilePath;
|
|
138
|
+
name: string;
|
|
139
|
+
sha?: BlobSha;
|
|
140
|
+
size?: number;
|
|
141
|
+
contentType?: string;
|
|
142
|
+
lastModified?: Timestamp;
|
|
143
|
+
downloadUrl?: string;
|
|
144
|
+
metadata?: Metadata;
|
|
145
|
+
}>;
|
|
146
|
+
export type ReleaseAsset = DeepReadonly<{
|
|
147
|
+
name: string;
|
|
148
|
+
size?: number;
|
|
149
|
+
contentType?: string;
|
|
150
|
+
downloadUrl?: string;
|
|
151
|
+
createdAt?: Timestamp;
|
|
152
|
+
metadata?: Metadata;
|
|
153
|
+
}>;
|
|
154
|
+
export type Release = DeepReadonly<{
|
|
155
|
+
id?: ReleaseId;
|
|
156
|
+
tagName: TagName;
|
|
157
|
+
name?: string;
|
|
158
|
+
state: ReleaseState;
|
|
159
|
+
body?: string;
|
|
160
|
+
author?: User;
|
|
161
|
+
createdAt?: Timestamp;
|
|
162
|
+
publishedAt?: Timestamp;
|
|
163
|
+
assets?: readonly ReleaseAsset[];
|
|
164
|
+
metadata?: Metadata;
|
|
165
|
+
}>;
|
|
166
|
+
export type PullRequestRef = DeepReadonly<{
|
|
167
|
+
repository: RepositoryIdentity;
|
|
168
|
+
branch: BranchName;
|
|
169
|
+
sha?: CommitSha;
|
|
170
|
+
}>;
|
|
171
|
+
export type PullRequest = DeepReadonly<{
|
|
172
|
+
id?: PullRequestId;
|
|
173
|
+
number: number;
|
|
174
|
+
title: string;
|
|
175
|
+
body?: string;
|
|
176
|
+
state: PullRequestState;
|
|
177
|
+
author?: User;
|
|
178
|
+
source: PullRequestRef;
|
|
179
|
+
target: PullRequestRef;
|
|
180
|
+
mergeStatus?: MergeStatus;
|
|
181
|
+
createdAt?: Timestamp;
|
|
182
|
+
updatedAt?: Timestamp;
|
|
183
|
+
closedAt?: Timestamp;
|
|
184
|
+
mergedAt?: Timestamp;
|
|
185
|
+
metadata?: Metadata;
|
|
186
|
+
}>;
|
|
187
|
+
export type Issue = DeepReadonly<{
|
|
188
|
+
id?: IssueId;
|
|
189
|
+
number: number;
|
|
190
|
+
title: string;
|
|
191
|
+
body?: string;
|
|
192
|
+
state: IssueState;
|
|
193
|
+
author?: User;
|
|
194
|
+
labels?: readonly string[];
|
|
195
|
+
assignees?: readonly User[];
|
|
196
|
+
createdAt?: Timestamp;
|
|
197
|
+
updatedAt?: Timestamp;
|
|
198
|
+
closedAt?: Timestamp;
|
|
199
|
+
metadata?: Metadata;
|
|
200
|
+
}>;
|
|
201
|
+
export type RepositoryFilter = DeepReadonly<{
|
|
202
|
+
owner?: OwnerName;
|
|
203
|
+
visibility?: RepositoryVisibility;
|
|
204
|
+
archived?: boolean;
|
|
205
|
+
fork?: boolean;
|
|
206
|
+
updated?: DateRange;
|
|
207
|
+
}>;
|
|
208
|
+
export type BranchFilter = DeepReadonly<{
|
|
209
|
+
name?: BranchName;
|
|
210
|
+
protected?: boolean;
|
|
211
|
+
}>;
|
|
212
|
+
export type CommitFilter = DeepReadonly<{
|
|
213
|
+
author?: string;
|
|
214
|
+
path?: FilePath;
|
|
215
|
+
date?: DateRange;
|
|
216
|
+
}>;
|
|
217
|
+
export type ReleaseFilter = DeepReadonly<{
|
|
218
|
+
state?: ReleaseState;
|
|
219
|
+
tagName?: TagName;
|
|
220
|
+
}>;
|
|
221
|
+
export type IssueFilter = DeepReadonly<{
|
|
222
|
+
state?: IssueState;
|
|
223
|
+
author?: string;
|
|
224
|
+
labels?: readonly string[];
|
|
225
|
+
}>;
|
|
226
|
+
export type PullRequestFilter = DeepReadonly<{
|
|
227
|
+
state?: PullRequestState;
|
|
228
|
+
author?: string;
|
|
229
|
+
target?: BranchName;
|
|
230
|
+
source?: BranchName;
|
|
231
|
+
}>;
|
|
232
|
+
export type JsonDocument = DeepReadonly<{
|
|
233
|
+
value: JsonValue;
|
|
234
|
+
}>;
|
|
235
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/domain/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,UAAU,EACV,SAAS,EACT,SAAS,EACT,QAAQ,EACR,OAAO,EACP,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,UAAU,EACV,aAAa,EACb,SAAS,EACT,cAAc,EACd,aAAa,EACb,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACP,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAEjE,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AACjF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,cAAc,GAAG,SAAS,CAAC;AACtE,MAAM,MAAM,aAAa,GAAG,QAAQ,GAAG,KAAK,GAAG,QAAQ,GAAG,cAAc,GAAG,UAAU,CAAC;AACtF,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAC;AAC1E,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,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AC;CACnB,CAAC,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,YAAY,CAAC;IACrC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC5B,CAAC,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;IAC3C,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,MAAM,YAAY,GAAG,YAAY,CAAC;IACtC,KAAK,EAAE,SAAS,CAAC;CAClB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type * from "./authentication/index.js";
|
|
2
|
+
export type * from "./cache/index.js";
|
|
3
|
+
export type * from "./capabilities/index.js";
|
|
4
|
+
export type * from "./diagnostics/index.js";
|
|
5
|
+
export type * from "./domain/index.js";
|
|
6
|
+
export type * from "./metadata/index.js";
|
|
7
|
+
export type * from "./pagination/index.js";
|
|
8
|
+
export type * from "./provider/index.js";
|
|
9
|
+
export type * from "./transport/index.js";
|
|
10
|
+
export type * from "./types/index.js";
|
|
11
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,2BAA2B,CAAC;AAC/C,mBAAmB,kBAAkB,CAAC;AACtC,mBAAmB,yBAAyB,CAAC;AAC7C,mBAAmB,wBAAwB,CAAC;AAC5C,mBAAmB,mBAAmB,CAAC;AACvC,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,uBAAuB,CAAC;AAC3C,mBAAmB,qBAAqB,CAAC;AACzC,mBAAmB,sBAAsB,CAAC;AAC1C,mBAAmB,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { DeepReadonly, JsonValue } from "../types/index.js";
|
|
2
|
+
export type ProviderId = string;
|
|
3
|
+
export type RepositoryName = string;
|
|
4
|
+
export type OwnerName = string;
|
|
5
|
+
export type OrganizationName = string;
|
|
6
|
+
export type BranchName = string;
|
|
7
|
+
export type TagName = string;
|
|
8
|
+
export type ReferenceName = string;
|
|
9
|
+
export type CommitSha = string;
|
|
10
|
+
export type TreeSha = string;
|
|
11
|
+
export type BlobSha = string;
|
|
12
|
+
export type FilePath = string;
|
|
13
|
+
export type RepositoryUrl = string;
|
|
14
|
+
export type UserId = string;
|
|
15
|
+
export type OrganizationId = string;
|
|
16
|
+
export type ReleaseId = string;
|
|
17
|
+
export type IssueId = string;
|
|
18
|
+
export type PullRequestId = string;
|
|
19
|
+
export type CapabilityName = string;
|
|
20
|
+
export type Timestamp = string;
|
|
21
|
+
export type LinkRelation = "self" | "repository" | "owner" | "tree" | "blob" | "download" | "html" | "next" | "previous";
|
|
22
|
+
export type Link = DeepReadonly<{
|
|
23
|
+
rel: LinkRelation;
|
|
24
|
+
href: string;
|
|
25
|
+
mediaType?: string;
|
|
26
|
+
}>;
|
|
27
|
+
export type Metadata = DeepReadonly<{
|
|
28
|
+
provider?: ProviderId;
|
|
29
|
+
links?: readonly Link[];
|
|
30
|
+
etag?: string;
|
|
31
|
+
lastModified?: Timestamp;
|
|
32
|
+
requestId?: string;
|
|
33
|
+
extra?: Readonly<Record<string, JsonValue>>;
|
|
34
|
+
}>;
|
|
35
|
+
export type DateRange = DeepReadonly<{
|
|
36
|
+
since?: Timestamp;
|
|
37
|
+
until?: Timestamp;
|
|
38
|
+
}>;
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"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pB,CAAC,CAAC;AAEH,MAAM,MAAM,QAAQ,GAAG,YAAY,CAAC;IAClC,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,KAAK,CAAC,EAAE,SAAS,IAAI,EAAE,CAAC;IACxB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;CAC7C,CAAC,CAAC;AAEH,MAAM,MAAM,SAAS,GAAG,YAAY,CAAC;IACnC,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,KAAK,CAAC,EAAE,SAAS,CAAC;CACnB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { DeepReadonly, OperationOptions, SortDirection } from "../types/index.js";
|
|
2
|
+
export type PageCursor = string;
|
|
3
|
+
export type PaginationRequest = DeepReadonly<{
|
|
4
|
+
cursor?: PageCursor;
|
|
5
|
+
limit?: number;
|
|
6
|
+
}>;
|
|
7
|
+
export type PaginationInfo = DeepReadonly<{
|
|
8
|
+
hasNextPage: boolean;
|
|
9
|
+
hasPreviousPage: boolean;
|
|
10
|
+
startCursor?: PageCursor;
|
|
11
|
+
endCursor?: PageCursor;
|
|
12
|
+
totalCount?: number;
|
|
13
|
+
}>;
|
|
14
|
+
export type PagedResult<TItem> = DeepReadonly<{
|
|
15
|
+
items: readonly TItem[];
|
|
16
|
+
pageInfo: PaginationInfo;
|
|
17
|
+
}>;
|
|
18
|
+
export type ListOptions<TSort extends string = string> = OperationOptions & PaginationRequest & DeepReadonly<{
|
|
19
|
+
sortBy?: TSort;
|
|
20
|
+
sortDirection?: SortDirection;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/pagination/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC;AAEhC,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC;IAC3C,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,YAAY,CAAC;IACxC,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,MAAM,WAAW,CAAC,KAAK,IAAI,YAAY,CAAC;IAC5C,KAAK,EAAE,SAAS,KAAK,EAAE,CAAC;IACxB,QAAQ,EAAE,cAAc,CAAC;CAC1B,CAAC,CAAC;AAEH,MAAM,MAAM,WAAW,CAAC,KAAK,SAAS,MAAM,GAAG,MAAM,IAAI,gBAAgB,GACvE,iBAAiB,GACjB,YAAY,CAAC;IACX,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,aAAa,CAAC,EAAE,aAAa,CAAC;CAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { CapabilityDescriptor, CapabilityMap, BranchesCapability, FilesCapability, HistoryCapability, IssuesCapability, PullRequestsCapability, ReleasesCapability, SearchCapability, TagsCapability, TreeCapability } from "../capabilities/index.js";
|
|
2
|
+
import type { AuthenticationContext, AuthenticationStrategy } from "../authentication/index.js";
|
|
3
|
+
import type { CacheProvider } from "../cache/index.js";
|
|
4
|
+
import type { DiagnosticsService } from "../diagnostics/index.js";
|
|
5
|
+
import type { RepositoryIdentity, RepositoryInfo } from "../domain/index.js";
|
|
6
|
+
import type { Metadata, ProviderId, RepositoryUrl } from "../metadata/index.js";
|
|
7
|
+
import type { Transport } from "../transport/index.js";
|
|
8
|
+
import type { DeepReadonly, OperationOptions } from "../types/index.js";
|
|
9
|
+
export type ProviderLifecycleState = "registered" | "resolved" | "active" | "disposed";
|
|
10
|
+
export type ProviderInfo = DeepReadonly<{
|
|
11
|
+
id: ProviderId;
|
|
12
|
+
name: string;
|
|
13
|
+
version?: string;
|
|
14
|
+
priority?: number;
|
|
15
|
+
capabilities: CapabilityMap;
|
|
16
|
+
metadata?: Metadata;
|
|
17
|
+
}>;
|
|
18
|
+
export type RepositoryLocator = DeepReadonly<{
|
|
19
|
+
url: RepositoryUrl;
|
|
20
|
+
}>;
|
|
21
|
+
export type ProviderMatch = DeepReadonly<{
|
|
22
|
+
provider: ProviderId;
|
|
23
|
+
confidence: "exact" | "probable" | "none";
|
|
24
|
+
repository?: RepositoryIdentity;
|
|
25
|
+
metadata?: Metadata;
|
|
26
|
+
}>;
|
|
27
|
+
export type ProviderContext = DeepReadonly<{
|
|
28
|
+
provider: ProviderInfo;
|
|
29
|
+
authentication?: AuthenticationStrategy;
|
|
30
|
+
authenticationContext?: AuthenticationContext;
|
|
31
|
+
cache?: CacheProvider;
|
|
32
|
+
diagnostics?: DiagnosticsService;
|
|
33
|
+
metadata?: Metadata;
|
|
34
|
+
transport?: Transport;
|
|
35
|
+
}>;
|
|
36
|
+
export type CreateSessionRequest = OperationOptions & DeepReadonly<{
|
|
37
|
+
repository: RepositoryLocator | RepositoryIdentity;
|
|
38
|
+
context: ProviderContext;
|
|
39
|
+
}>;
|
|
40
|
+
export type ProviderSessionCapabilities = DeepReadonly<{
|
|
41
|
+
files: FilesCapability;
|
|
42
|
+
tree: TreeCapability;
|
|
43
|
+
history: HistoryCapability;
|
|
44
|
+
search: SearchCapability;
|
|
45
|
+
branches?: BranchesCapability;
|
|
46
|
+
tags?: TagsCapability;
|
|
47
|
+
releases?: ReleasesCapability;
|
|
48
|
+
issues?: IssuesCapability;
|
|
49
|
+
pullRequests?: PullRequestsCapability;
|
|
50
|
+
}>;
|
|
51
|
+
export interface Provider {
|
|
52
|
+
readonly info: ProviderInfo;
|
|
53
|
+
supports(locator: RepositoryLocator): Promise<ProviderMatch>;
|
|
54
|
+
createSession(request: CreateSessionRequest): Promise<ProviderSession>;
|
|
55
|
+
}
|
|
56
|
+
export interface ProviderSession {
|
|
57
|
+
readonly provider: ProviderInfo;
|
|
58
|
+
readonly repository: RepositoryInfo;
|
|
59
|
+
readonly capabilities: ProviderSessionCapabilities;
|
|
60
|
+
readonly state: ProviderLifecycleState;
|
|
61
|
+
getCapabilities(): Promise<readonly CapabilityDescriptor[]>;
|
|
62
|
+
dispose(): Promise<void>;
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/provider/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,cAAc,EACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAChG,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAChF,OAA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AC;CAC1B,CAAC,CAAC;AAEL,MAAM,MAAM,2BAA2B,GAAG,YAAY,CAAC;IACrD,KAAK,EAAE,eAAe,CAAC;IACvB,IAAI,EAAE,cAAc,CAAC;IACrB,OAAO,EAAE,iBAAiB,CAAC;IAC3B,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,IAAI,CAAC,EAAE,cAAc,CAAC;IACtB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,YAAY,CAAC,EAAE,sBAAsB,CAAC;CACvC,CAAC,CAAC;AAEH,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,IAAI,EAAE,YAAY,CAAC;IAC5B,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IAC7D,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;CACxE;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,sBAAsB,CAAC;IACvC,eAAe,IAAI,OAAO,CAAC,SAAS,oBAAoB,EAAE,CAAC,CAAC;IAC5D,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC1B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { Metadata } from "../metadata/index.js";
|
|
2
|
+
import type { DeepReadonly, JsonValue, OperationOptions } from "../types/index.js";
|
|
3
|
+
export type TransportMethod = "read" | "write" | "delete" | "stream";
|
|
4
|
+
export type TransportBody = string | Uint8Array | JsonValue | AsyncIterable<Uint8Array>;
|
|
5
|
+
export type TransportRequest = OperationOptions & DeepReadonly<{
|
|
6
|
+
id?: string;
|
|
7
|
+
method: TransportMethod;
|
|
8
|
+
target: string;
|
|
9
|
+
headers?: Readonly<Record<string, string>>;
|
|
10
|
+
body?: TransportBody;
|
|
11
|
+
stream?: boolean;
|
|
12
|
+
metadata?: Metadata;
|
|
13
|
+
}>;
|
|
14
|
+
export type TransportResponse<TBody = unknown> = DeepReadonly<{
|
|
15
|
+
status: number;
|
|
16
|
+
body?: TBody;
|
|
17
|
+
headers?: Readonly<Record<string, string>>;
|
|
18
|
+
metadata?: Metadata;
|
|
19
|
+
}>;
|
|
20
|
+
export type TransportContext = DeepReadonly<{
|
|
21
|
+
metadata?: Metadata;
|
|
22
|
+
}>;
|
|
23
|
+
export interface Transport {
|
|
24
|
+
execute<TBody = unknown>(request: TransportRequest, context?: TransportContext): Promise<TransportResponse<TBody>>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/transport/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAEnF,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACrE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,GAAG,aAAa,CAAC,UAAU,CAAC,CAAC;AAExF,MAAM,MAAM,gBAAgB,GAAG,gBAAgB,GAC7C,YAAY,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,eAAe,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEL,MAAM,MAAM,iBAAiB,CAAC,KAAK,GAAG,OAAO,IAAI,YAAY,CAAC;IAC5D,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,KAAK,CAAC;IACb,OAAO,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC3C,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC;IAC1C,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB,CAAC,CAAC;AAEH,MAAM,WAAW,SAAS;IACxB,OAAO,CAAC,KAAK,GAAG,OAAO,EACrB,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,gBAAgB,GACzB,OAAO,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,CAAC;CACtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A value that may be undefined.
|
|
3
|
+
*/
|
|
4
|
+
export type Maybe<T> = T | undefined;
|
|
5
|
+
/**
|
|
6
|
+
* A readonly array with at least one item.
|
|
7
|
+
*/
|
|
8
|
+
export type NonEmptyArray<T> = readonly [T, ...T[]];
|
|
9
|
+
/**
|
|
10
|
+
* Recursively makes every property optional.
|
|
11
|
+
*/
|
|
12
|
+
export type DeepPartial<T> = T extends JsonPrimitive | Uint8Array | ((...args: never[]) => unknown) ? T : T extends readonly (infer Item)[] ? readonly DeepPartial<Item>[] : {
|
|
13
|
+
readonly [Key in keyof T]?: DeepPartial<T[Key]>;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Recursively makes every property readonly.
|
|
17
|
+
*/
|
|
18
|
+
export type DeepReadonly<T> = T extends JsonPrimitive | Uint8Array | ((...args: never[]) => unknown) ? T : T extends readonly (infer Item)[] ? readonly DeepReadonly<Item>[] : {
|
|
19
|
+
readonly [Key in keyof T]: DeepReadonly<T[Key]>;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Provider-neutral JSON primitives accepted by public serialized models.
|
|
23
|
+
*/
|
|
24
|
+
export type JsonPrimitive = string | number | boolean | null;
|
|
25
|
+
/**
|
|
26
|
+
* Provider-neutral JSON value accepted by metadata and serialized models.
|
|
27
|
+
*/
|
|
28
|
+
export type JsonValue = JsonPrimitive | readonly JsonValue[] | {
|
|
29
|
+
readonly [key: string]: JsonValue;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Domain result wrapper for capability internals and future extension contracts.
|
|
33
|
+
*/
|
|
34
|
+
export type CapabilityResult<TValue, TMetadata extends object = EmptyMetadata> = DeepReadonly<{
|
|
35
|
+
value: TValue;
|
|
36
|
+
metadata?: TMetadata;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* Immutable record with string keys.
|
|
40
|
+
*/
|
|
41
|
+
export type ImmutableRecord<TValue> = Readonly<Record<string, TValue>>;
|
|
42
|
+
/**
|
|
43
|
+
* Empty immutable metadata marker.
|
|
44
|
+
*/
|
|
45
|
+
export type EmptyMetadata = Readonly<Record<string, never>>;
|
|
46
|
+
/**
|
|
47
|
+
* Common operation options accepted by long-running public operations.
|
|
48
|
+
*/
|
|
49
|
+
export type OperationOptions = DeepReadonly<{
|
|
50
|
+
signal?: AbortSignal;
|
|
51
|
+
timeoutMs?: number;
|
|
52
|
+
correlationId?: string;
|
|
53
|
+
}>;
|
|
54
|
+
/**
|
|
55
|
+
* Additional operation options that may carry provider-neutral metadata.
|
|
56
|
+
*/
|
|
57
|
+
export type MetadataOptions<TMetadata extends object = EmptyMetadata> = OperationOptions & DeepReadonly<{
|
|
58
|
+
metadata?: TMetadata;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Provider-neutral sort direction.
|
|
62
|
+
*/
|
|
63
|
+
export type SortDirection = "asc" | "desc";
|
|
64
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC;AAErC;;GAEG;AACH,MAAM,MAAM,aAAa,CAAC,CAAC,IAAI,SAAS,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC;AAEpD;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,GAAG,UAAU,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,GAC/F,CAAC,GACD,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GAC/B,SAAS,WAAW,CAAC,IAAI,CAAC,EAAE,GAC5B;IAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,CAAC;AAE1D;;GAEG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS,aAAa,GAAG,UAAU,GAAG,CAAC,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,GAChG,CAAC,GACD,CAAC,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GAC/B,SAAS,YAAY,CAAC,IAAI,CAAC,EAAE,GAC7B;IAAE,QAAQ,EAAE,GAAG,IAAI,MAAM,CAAC,GAAG,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAAE,CAAC;AAE1D;;GAEG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and immutable domain models for SourceAxis.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"sideEffects": false,
|
|
8
|
+
"files": [
|
|
9
|
+
"dist",
|
|
10
|
+
"README.md"
|
|
11
|
+
],
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/esm/index.d.ts",
|
|
15
|
+
"import": "./dist/esm/index.js",
|
|
16
|
+
"require": "./dist/cjs/index.js",
|
|
17
|
+
"default": "./dist/esm/index.js"
|
|
18
|
+
},
|
|
19
|
+
"./authentication": {
|
|
20
|
+
"types": "./dist/esm/authentication/index.d.ts",
|
|
21
|
+
"import": "./dist/esm/authentication/index.js",
|
|
22
|
+
"require": "./dist/cjs/authentication/index.js",
|
|
23
|
+
"default": "./dist/esm/authentication/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./cache": {
|
|
26
|
+
"types": "./dist/esm/cache/index.d.ts",
|
|
27
|
+
"import": "./dist/esm/cache/index.js",
|
|
28
|
+
"require": "./dist/cjs/cache/index.js",
|
|
29
|
+
"default": "./dist/esm/cache/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./capabilities": {
|
|
32
|
+
"types": "./dist/esm/capabilities/index.d.ts",
|
|
33
|
+
"import": "./dist/esm/capabilities/index.js",
|
|
34
|
+
"require": "./dist/cjs/capabilities/index.js",
|
|
35
|
+
"default": "./dist/esm/capabilities/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./diagnostics": {
|
|
38
|
+
"types": "./dist/esm/diagnostics/index.d.ts",
|
|
39
|
+
"import": "./dist/esm/diagnostics/index.js",
|
|
40
|
+
"require": "./dist/cjs/diagnostics/index.js",
|
|
41
|
+
"default": "./dist/esm/diagnostics/index.js"
|
|
42
|
+
},
|
|
43
|
+
"./domain": {
|
|
44
|
+
"types": "./dist/esm/domain/index.d.ts",
|
|
45
|
+
"import": "./dist/esm/domain/index.js",
|
|
46
|
+
"require": "./dist/cjs/domain/index.js",
|
|
47
|
+
"default": "./dist/esm/domain/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./metadata": {
|
|
50
|
+
"types": "./dist/esm/metadata/index.d.ts",
|
|
51
|
+
"import": "./dist/esm/metadata/index.js",
|
|
52
|
+
"require": "./dist/cjs/metadata/index.js",
|
|
53
|
+
"default": "./dist/esm/metadata/index.js"
|
|
54
|
+
},
|
|
55
|
+
"./pagination": {
|
|
56
|
+
"types": "./dist/esm/pagination/index.d.ts",
|
|
57
|
+
"import": "./dist/esm/pagination/index.js",
|
|
58
|
+
"require": "./dist/cjs/pagination/index.js",
|
|
59
|
+
"default": "./dist/esm/pagination/index.js"
|
|
60
|
+
},
|
|
61
|
+
"./provider": {
|
|
62
|
+
"types": "./dist/esm/provider/index.d.ts",
|
|
63
|
+
"import": "./dist/esm/provider/index.js",
|
|
64
|
+
"require": "./dist/cjs/provider/index.js",
|
|
65
|
+
"default": "./dist/esm/provider/index.js"
|
|
66
|
+
},
|
|
67
|
+
"./transport": {
|
|
68
|
+
"types": "./dist/esm/transport/index.d.ts",
|
|
69
|
+
"import": "./dist/esm/transport/index.js",
|
|
70
|
+
"require": "./dist/cjs/transport/index.js",
|
|
71
|
+
"default": "./dist/esm/transport/index.js"
|
|
72
|
+
},
|
|
73
|
+
"./types": {
|
|
74
|
+
"types": "./dist/esm/types/index.d.ts",
|
|
75
|
+
"import": "./dist/esm/types/index.js",
|
|
76
|
+
"require": "./dist/cjs/types/index.js",
|
|
77
|
+
"default": "./dist/esm/types/index.js"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
"types": "./dist/esm/index.d.ts",
|
|
81
|
+
"scripts": {
|
|
82
|
+
"build": "tsc -p tsconfig.esm.json && node ../../scripts/build/build-cjs.mjs .",
|
|
83
|
+
"test": "vitest run",
|
|
84
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
85
|
+
},
|
|
86
|
+
"main": "./dist/cjs/index.js",
|
|
87
|
+
"module": "./dist/esm/index.js",
|
|
88
|
+
"engines": {
|
|
89
|
+
"node": ">=20.19.0"
|
|
90
|
+
},
|
|
91
|
+
"repository": {
|
|
92
|
+
"type": "git",
|
|
93
|
+
"url": "git+https://github.com/mriduldey/source-axis.git",
|
|
94
|
+
"directory": "packages/contracts"
|
|
95
|
+
},
|
|
96
|
+
"bugs": {
|
|
97
|
+
"url": "https://github.com/mriduldey/source-axis/issues"
|
|
98
|
+
},
|
|
99
|
+
"homepage": "https://github.com/mriduldey/source-axis#readme",
|
|
100
|
+
"keywords": [
|
|
101
|
+
"git",
|
|
102
|
+
"github",
|
|
103
|
+
"sdk",
|
|
104
|
+
"typescript",
|
|
105
|
+
"provider-neutral"
|
|
106
|
+
],
|
|
107
|
+
"publishConfig": {
|
|
108
|
+
"access": "public",
|
|
109
|
+
"provenance": true
|
|
110
|
+
}
|
|
111
|
+
}
|