@pierre/storage 1.2.2 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/index.cjs +199 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +161 -4
- package/dist/index.d.ts +161 -4
- package/dist/index.js +199 -4
- package/dist/index.js.map +1 -1
- package/package.json +43 -43
- package/src/index.ts +230 -3
- package/src/schemas.ts +27 -0
- package/src/types.ts +101 -3
package/dist/index.d.cts
CHANGED
|
@@ -702,6 +702,75 @@ declare const createBranchResponseSchema: z.ZodObject<{
|
|
|
702
702
|
target_is_ephemeral: boolean;
|
|
703
703
|
commit_sha?: string | null | undefined;
|
|
704
704
|
}>;
|
|
705
|
+
declare const tagInfoSchema: z.ZodObject<{
|
|
706
|
+
cursor: z.ZodString;
|
|
707
|
+
name: z.ZodString;
|
|
708
|
+
sha: z.ZodString;
|
|
709
|
+
}, "strip", z.ZodTypeAny, {
|
|
710
|
+
cursor: string;
|
|
711
|
+
name: string;
|
|
712
|
+
sha: string;
|
|
713
|
+
}, {
|
|
714
|
+
cursor: string;
|
|
715
|
+
name: string;
|
|
716
|
+
sha: string;
|
|
717
|
+
}>;
|
|
718
|
+
declare const listTagsResponseSchema: z.ZodObject<{
|
|
719
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
720
|
+
cursor: z.ZodString;
|
|
721
|
+
name: z.ZodString;
|
|
722
|
+
sha: z.ZodString;
|
|
723
|
+
}, "strip", z.ZodTypeAny, {
|
|
724
|
+
cursor: string;
|
|
725
|
+
name: string;
|
|
726
|
+
sha: string;
|
|
727
|
+
}, {
|
|
728
|
+
cursor: string;
|
|
729
|
+
name: string;
|
|
730
|
+
sha: string;
|
|
731
|
+
}>, "many">;
|
|
732
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
733
|
+
has_more: z.ZodBoolean;
|
|
734
|
+
}, "strip", z.ZodTypeAny, {
|
|
735
|
+
has_more: boolean;
|
|
736
|
+
tags: {
|
|
737
|
+
cursor: string;
|
|
738
|
+
name: string;
|
|
739
|
+
sha: string;
|
|
740
|
+
}[];
|
|
741
|
+
next_cursor?: string | null | undefined;
|
|
742
|
+
}, {
|
|
743
|
+
has_more: boolean;
|
|
744
|
+
tags: {
|
|
745
|
+
cursor: string;
|
|
746
|
+
name: string;
|
|
747
|
+
sha: string;
|
|
748
|
+
}[];
|
|
749
|
+
next_cursor?: string | null | undefined;
|
|
750
|
+
}>;
|
|
751
|
+
declare const createTagResponseSchema: z.ZodObject<{
|
|
752
|
+
name: z.ZodString;
|
|
753
|
+
sha: z.ZodString;
|
|
754
|
+
message: z.ZodString;
|
|
755
|
+
}, "strip", z.ZodTypeAny, {
|
|
756
|
+
message: string;
|
|
757
|
+
name: string;
|
|
758
|
+
sha: string;
|
|
759
|
+
}, {
|
|
760
|
+
message: string;
|
|
761
|
+
name: string;
|
|
762
|
+
sha: string;
|
|
763
|
+
}>;
|
|
764
|
+
declare const deleteTagResponseSchema: z.ZodObject<{
|
|
765
|
+
name: z.ZodString;
|
|
766
|
+
message: z.ZodString;
|
|
767
|
+
}, "strip", z.ZodTypeAny, {
|
|
768
|
+
message: string;
|
|
769
|
+
name: string;
|
|
770
|
+
}, {
|
|
771
|
+
message: string;
|
|
772
|
+
name: string;
|
|
773
|
+
}>;
|
|
705
774
|
type ListFilesResponseRaw = z.infer<typeof listFilesResponseSchema>;
|
|
706
775
|
type RawFileWithMetadata$1 = z.infer<typeof fileWithMetadataRawSchema>;
|
|
707
776
|
type RawCommitMetadata$1 = z.infer<typeof commitMetadataRawSchema>;
|
|
@@ -720,6 +789,10 @@ type RawFilteredFile$1 = z.infer<typeof filteredFileRawSchema>;
|
|
|
720
789
|
type GetBranchDiffResponseRaw = z.infer<typeof branchDiffResponseSchema>;
|
|
721
790
|
type GetCommitDiffResponseRaw = z.infer<typeof commitDiffResponseSchema>;
|
|
722
791
|
type CreateBranchResponseRaw = z.infer<typeof createBranchResponseSchema>;
|
|
792
|
+
type RawTagInfo$1 = z.infer<typeof tagInfoSchema>;
|
|
793
|
+
type ListTagsResponseRaw = z.infer<typeof listTagsResponseSchema>;
|
|
794
|
+
type CreateTagResponseRaw = z.infer<typeof createTagResponseSchema>;
|
|
795
|
+
type DeleteTagResponseRaw = z.infer<typeof deleteTagResponseSchema>;
|
|
723
796
|
|
|
724
797
|
/**
|
|
725
798
|
* Type definitions for Pierre Git Storage SDK
|
|
@@ -753,7 +826,10 @@ interface Repo {
|
|
|
753
826
|
listFiles(options?: ListFilesOptions): Promise<ListFilesResult>;
|
|
754
827
|
listFilesWithMetadata(options?: ListFilesWithMetadataOptions): Promise<ListFilesWithMetadataResult>;
|
|
755
828
|
listBranches(options?: ListBranchesOptions): Promise<ListBranchesResult>;
|
|
829
|
+
listTags(options?: ListTagsOptions): Promise<ListTagsResult>;
|
|
756
830
|
listCommits(options?: ListCommitsOptions): Promise<ListCommitsResult>;
|
|
831
|
+
createTag(options: CreateTagOptions): Promise<CreateTagResult>;
|
|
832
|
+
deleteTag(options: DeleteTagOptions): Promise<DeleteTagResult>;
|
|
757
833
|
getNote(options: GetNoteOptions): Promise<GetNoteResult>;
|
|
758
834
|
createNote(options: CreateNoteOptions): Promise<NoteWriteResult>;
|
|
759
835
|
appendNote(options: AppendNoteOptions): Promise<NoteWriteResult>;
|
|
@@ -786,7 +862,7 @@ interface RepoOptions {
|
|
|
786
862
|
defaultBranch?: string;
|
|
787
863
|
createdAt?: string;
|
|
788
864
|
}
|
|
789
|
-
type SupportedRepoProvider = 'github';
|
|
865
|
+
type SupportedRepoProvider = 'github' | 'gitlab' | 'bitbucket' | 'gitea' | 'forgejo' | 'codeberg' | 'sr.ht';
|
|
790
866
|
interface PublicGitHubBaseRepoAuth {
|
|
791
867
|
/**
|
|
792
868
|
* Force public GitHub mode (no GitHub App installation required).
|
|
@@ -797,18 +873,52 @@ interface GitHubBaseRepo {
|
|
|
797
873
|
/**
|
|
798
874
|
* @default github
|
|
799
875
|
*/
|
|
800
|
-
provider?:
|
|
876
|
+
provider?: 'github';
|
|
801
877
|
owner: string;
|
|
802
878
|
name: string;
|
|
803
879
|
defaultBranch?: string;
|
|
804
880
|
auth?: PublicGitHubBaseRepoAuth;
|
|
805
881
|
}
|
|
882
|
+
interface GenericGitBaseRepo {
|
|
883
|
+
/**
|
|
884
|
+
* The git host provider. Must be one of the supported generic git providers.
|
|
885
|
+
*/
|
|
886
|
+
provider: Exclude<SupportedRepoProvider, 'github'>;
|
|
887
|
+
owner: string;
|
|
888
|
+
name: string;
|
|
889
|
+
defaultBranch?: string;
|
|
890
|
+
/**
|
|
891
|
+
* Bare hostname for self-hosted instances (e.g. "gitlab.example.com").
|
|
892
|
+
* Falls back to the provider's default host when omitted.
|
|
893
|
+
*/
|
|
894
|
+
upstreamHost?: string;
|
|
895
|
+
}
|
|
806
896
|
interface ForkBaseRepo {
|
|
807
897
|
id: string;
|
|
808
898
|
ref?: string;
|
|
809
899
|
sha?: string;
|
|
810
900
|
}
|
|
811
|
-
type BaseRepo = GitHubBaseRepo | ForkBaseRepo;
|
|
901
|
+
type BaseRepo = GitHubBaseRepo | ForkBaseRepo | GenericGitBaseRepo;
|
|
902
|
+
interface CreateGitCredentialOptions {
|
|
903
|
+
repoId: string;
|
|
904
|
+
username?: string;
|
|
905
|
+
password: string;
|
|
906
|
+
ttl?: number;
|
|
907
|
+
}
|
|
908
|
+
interface UpdateGitCredentialOptions {
|
|
909
|
+
id: string;
|
|
910
|
+
username?: string;
|
|
911
|
+
password: string;
|
|
912
|
+
ttl?: number;
|
|
913
|
+
}
|
|
914
|
+
interface DeleteGitCredentialOptions {
|
|
915
|
+
id: string;
|
|
916
|
+
ttl?: number;
|
|
917
|
+
}
|
|
918
|
+
interface GitCredential {
|
|
919
|
+
id: string;
|
|
920
|
+
createdAt?: string;
|
|
921
|
+
}
|
|
812
922
|
interface ListReposOptions extends GitStorageInvocationOptions {
|
|
813
923
|
cursor?: string;
|
|
814
924
|
limit?: number;
|
|
@@ -924,6 +1034,40 @@ interface CreateBranchResult {
|
|
|
924
1034
|
targetIsEphemeral: boolean;
|
|
925
1035
|
commitSha?: string;
|
|
926
1036
|
}
|
|
1037
|
+
interface ListTagsOptions extends GitStorageInvocationOptions {
|
|
1038
|
+
cursor?: string;
|
|
1039
|
+
limit?: number;
|
|
1040
|
+
}
|
|
1041
|
+
type RawTagInfo = RawTagInfo$1;
|
|
1042
|
+
interface TagInfo {
|
|
1043
|
+
cursor: string;
|
|
1044
|
+
name: string;
|
|
1045
|
+
sha: string;
|
|
1046
|
+
}
|
|
1047
|
+
type ListTagsResponse = ListTagsResponseRaw;
|
|
1048
|
+
interface ListTagsResult {
|
|
1049
|
+
tags: TagInfo[];
|
|
1050
|
+
nextCursor?: string;
|
|
1051
|
+
hasMore: boolean;
|
|
1052
|
+
}
|
|
1053
|
+
interface CreateTagOptions extends GitStorageInvocationOptions {
|
|
1054
|
+
name: string;
|
|
1055
|
+
target: string;
|
|
1056
|
+
}
|
|
1057
|
+
type CreateTagResponse = CreateTagResponseRaw;
|
|
1058
|
+
interface CreateTagResult {
|
|
1059
|
+
name: string;
|
|
1060
|
+
sha: string;
|
|
1061
|
+
message: string;
|
|
1062
|
+
}
|
|
1063
|
+
interface DeleteTagOptions extends GitStorageInvocationOptions {
|
|
1064
|
+
name: string;
|
|
1065
|
+
}
|
|
1066
|
+
type DeleteTagResponse = DeleteTagResponseRaw;
|
|
1067
|
+
interface DeleteTagResult {
|
|
1068
|
+
name: string;
|
|
1069
|
+
message: string;
|
|
1070
|
+
}
|
|
927
1071
|
interface ListCommitsOptions extends GitStorageInvocationOptions {
|
|
928
1072
|
branch?: string;
|
|
929
1073
|
cursor?: string;
|
|
@@ -1373,6 +1517,19 @@ declare class GitStorage {
|
|
|
1373
1517
|
* @returns The deletion result
|
|
1374
1518
|
*/
|
|
1375
1519
|
deleteRepo(options: DeleteRepoOptions): Promise<DeleteRepoResult>;
|
|
1520
|
+
/**
|
|
1521
|
+
* Create a generic git credential for a repository.
|
|
1522
|
+
* Used to authenticate sync operations for non-GitHub providers (GitLab, Bitbucket, etc.)
|
|
1523
|
+
*/
|
|
1524
|
+
createGitCredential(options: CreateGitCredentialOptions): Promise<GitCredential>;
|
|
1525
|
+
/**
|
|
1526
|
+
* Update an existing generic git credential.
|
|
1527
|
+
*/
|
|
1528
|
+
updateGitCredential(options: UpdateGitCredentialOptions): Promise<GitCredential>;
|
|
1529
|
+
/**
|
|
1530
|
+
* Delete a generic git credential.
|
|
1531
|
+
*/
|
|
1532
|
+
deleteGitCredential(options: DeleteGitCredentialOptions): Promise<void>;
|
|
1376
1533
|
/**
|
|
1377
1534
|
* Get the current configuration
|
|
1378
1535
|
* @returns The client configuration
|
|
@@ -1388,4 +1545,4 @@ declare function createClient(options: GitStorageOptions): GitStorage;
|
|
|
1388
1545
|
|
|
1389
1546
|
type StorageOptions = GitStorageOptions;
|
|
1390
1547
|
|
|
1391
|
-
export { ApiError, type AppendNoteOptions, type ArchiveOptions, type BaseRepo, type BlobLike, type BranchInfo, GitStorage as CodeStorage, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitMetadata, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateBranchOptions, type CreateBranchResponse, type CreateBranchResult, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateNoteOptions, type CreateRepoOptions, type DeleteNoteOptions, type DeleteRepoOptions, type DeleteRepoResult, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FileWithMetadata, type FilteredFile, type FindOneOptions, type ForkBaseRepo, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetNoteOptions, type GetNoteResponse, type GetNoteResult, type GetRemoteURLOptions, type GitFileMode, type GitHubBaseRepo, GitStorage, type GitStorageOptions, type GrepFileMatch, type GrepLine, type GrepOptions, type GrepResult, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type ListFilesWithMetadataOptions, type ListFilesWithMetadataResponse, type ListFilesWithMetadataResult, type ListReposOptions, type ListReposResponse, type ListReposResult, type NoteWriteResponse, type NoteWriteResult, type NoteWriteResultPayload, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PublicGitHubBaseRepoAuth, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawCommitMetadata, type RawFileDiff, type RawFileWithMetadata, type RawFilteredFile, type RawRepoBaseInfo, type RawRepoInfo, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, type RepoBaseInfo, type RepoInfo, type RepoOptions, type RestoreCommitOptions, type RestoreCommitResult, type StorageOptions, type SupportedRepoProvider, type TextEncoding, type ValidAPIVersion, type ValidMethod, type ValidPath, type WebhookEventPayload, type WebhookPushEvent, type WebhookUnknownEvent, type WebhookValidationOptions, type WebhookValidationResult, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|
|
1548
|
+
export { ApiError, type AppendNoteOptions, type ArchiveOptions, type BaseRepo, type BlobLike, type BranchInfo, GitStorage as CodeStorage, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitMetadata, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateBranchOptions, type CreateBranchResponse, type CreateBranchResult, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateGitCredentialOptions, type CreateNoteOptions, type CreateRepoOptions, type CreateTagOptions, type CreateTagResponse, type CreateTagResult, type DeleteGitCredentialOptions, type DeleteNoteOptions, type DeleteRepoOptions, type DeleteRepoResult, type DeleteTagOptions, type DeleteTagResponse, type DeleteTagResult, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FileWithMetadata, type FilteredFile, type FindOneOptions, type ForkBaseRepo, type GenericGitBaseRepo, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetNoteOptions, type GetNoteResponse, type GetNoteResult, type GetRemoteURLOptions, type GitCredential, type GitFileMode, type GitHubBaseRepo, GitStorage, type GitStorageOptions, type GrepFileMatch, type GrepLine, type GrepOptions, type GrepResult, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type ListFilesWithMetadataOptions, type ListFilesWithMetadataResponse, type ListFilesWithMetadataResult, type ListReposOptions, type ListReposResponse, type ListReposResult, type ListTagsOptions, type ListTagsResponse, type ListTagsResult, type NoteWriteResponse, type NoteWriteResult, type NoteWriteResultPayload, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PublicGitHubBaseRepoAuth, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawCommitMetadata, type RawFileDiff, type RawFileWithMetadata, type RawFilteredFile, type RawRepoBaseInfo, type RawRepoInfo, type RawTagInfo, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, type RepoBaseInfo, type RepoInfo, type RepoOptions, type RestoreCommitOptions, type RestoreCommitResult, type StorageOptions, type SupportedRepoProvider, type TagInfo, type TextEncoding, type UpdateGitCredentialOptions, type ValidAPIVersion, type ValidMethod, type ValidPath, type WebhookEventPayload, type WebhookPushEvent, type WebhookUnknownEvent, type WebhookValidationOptions, type WebhookValidationResult, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|
package/dist/index.d.ts
CHANGED
|
@@ -702,6 +702,75 @@ declare const createBranchResponseSchema: z.ZodObject<{
|
|
|
702
702
|
target_is_ephemeral: boolean;
|
|
703
703
|
commit_sha?: string | null | undefined;
|
|
704
704
|
}>;
|
|
705
|
+
declare const tagInfoSchema: z.ZodObject<{
|
|
706
|
+
cursor: z.ZodString;
|
|
707
|
+
name: z.ZodString;
|
|
708
|
+
sha: z.ZodString;
|
|
709
|
+
}, "strip", z.ZodTypeAny, {
|
|
710
|
+
cursor: string;
|
|
711
|
+
name: string;
|
|
712
|
+
sha: string;
|
|
713
|
+
}, {
|
|
714
|
+
cursor: string;
|
|
715
|
+
name: string;
|
|
716
|
+
sha: string;
|
|
717
|
+
}>;
|
|
718
|
+
declare const listTagsResponseSchema: z.ZodObject<{
|
|
719
|
+
tags: z.ZodArray<z.ZodObject<{
|
|
720
|
+
cursor: z.ZodString;
|
|
721
|
+
name: z.ZodString;
|
|
722
|
+
sha: z.ZodString;
|
|
723
|
+
}, "strip", z.ZodTypeAny, {
|
|
724
|
+
cursor: string;
|
|
725
|
+
name: string;
|
|
726
|
+
sha: string;
|
|
727
|
+
}, {
|
|
728
|
+
cursor: string;
|
|
729
|
+
name: string;
|
|
730
|
+
sha: string;
|
|
731
|
+
}>, "many">;
|
|
732
|
+
next_cursor: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
733
|
+
has_more: z.ZodBoolean;
|
|
734
|
+
}, "strip", z.ZodTypeAny, {
|
|
735
|
+
has_more: boolean;
|
|
736
|
+
tags: {
|
|
737
|
+
cursor: string;
|
|
738
|
+
name: string;
|
|
739
|
+
sha: string;
|
|
740
|
+
}[];
|
|
741
|
+
next_cursor?: string | null | undefined;
|
|
742
|
+
}, {
|
|
743
|
+
has_more: boolean;
|
|
744
|
+
tags: {
|
|
745
|
+
cursor: string;
|
|
746
|
+
name: string;
|
|
747
|
+
sha: string;
|
|
748
|
+
}[];
|
|
749
|
+
next_cursor?: string | null | undefined;
|
|
750
|
+
}>;
|
|
751
|
+
declare const createTagResponseSchema: z.ZodObject<{
|
|
752
|
+
name: z.ZodString;
|
|
753
|
+
sha: z.ZodString;
|
|
754
|
+
message: z.ZodString;
|
|
755
|
+
}, "strip", z.ZodTypeAny, {
|
|
756
|
+
message: string;
|
|
757
|
+
name: string;
|
|
758
|
+
sha: string;
|
|
759
|
+
}, {
|
|
760
|
+
message: string;
|
|
761
|
+
name: string;
|
|
762
|
+
sha: string;
|
|
763
|
+
}>;
|
|
764
|
+
declare const deleteTagResponseSchema: z.ZodObject<{
|
|
765
|
+
name: z.ZodString;
|
|
766
|
+
message: z.ZodString;
|
|
767
|
+
}, "strip", z.ZodTypeAny, {
|
|
768
|
+
message: string;
|
|
769
|
+
name: string;
|
|
770
|
+
}, {
|
|
771
|
+
message: string;
|
|
772
|
+
name: string;
|
|
773
|
+
}>;
|
|
705
774
|
type ListFilesResponseRaw = z.infer<typeof listFilesResponseSchema>;
|
|
706
775
|
type RawFileWithMetadata$1 = z.infer<typeof fileWithMetadataRawSchema>;
|
|
707
776
|
type RawCommitMetadata$1 = z.infer<typeof commitMetadataRawSchema>;
|
|
@@ -720,6 +789,10 @@ type RawFilteredFile$1 = z.infer<typeof filteredFileRawSchema>;
|
|
|
720
789
|
type GetBranchDiffResponseRaw = z.infer<typeof branchDiffResponseSchema>;
|
|
721
790
|
type GetCommitDiffResponseRaw = z.infer<typeof commitDiffResponseSchema>;
|
|
722
791
|
type CreateBranchResponseRaw = z.infer<typeof createBranchResponseSchema>;
|
|
792
|
+
type RawTagInfo$1 = z.infer<typeof tagInfoSchema>;
|
|
793
|
+
type ListTagsResponseRaw = z.infer<typeof listTagsResponseSchema>;
|
|
794
|
+
type CreateTagResponseRaw = z.infer<typeof createTagResponseSchema>;
|
|
795
|
+
type DeleteTagResponseRaw = z.infer<typeof deleteTagResponseSchema>;
|
|
723
796
|
|
|
724
797
|
/**
|
|
725
798
|
* Type definitions for Pierre Git Storage SDK
|
|
@@ -753,7 +826,10 @@ interface Repo {
|
|
|
753
826
|
listFiles(options?: ListFilesOptions): Promise<ListFilesResult>;
|
|
754
827
|
listFilesWithMetadata(options?: ListFilesWithMetadataOptions): Promise<ListFilesWithMetadataResult>;
|
|
755
828
|
listBranches(options?: ListBranchesOptions): Promise<ListBranchesResult>;
|
|
829
|
+
listTags(options?: ListTagsOptions): Promise<ListTagsResult>;
|
|
756
830
|
listCommits(options?: ListCommitsOptions): Promise<ListCommitsResult>;
|
|
831
|
+
createTag(options: CreateTagOptions): Promise<CreateTagResult>;
|
|
832
|
+
deleteTag(options: DeleteTagOptions): Promise<DeleteTagResult>;
|
|
757
833
|
getNote(options: GetNoteOptions): Promise<GetNoteResult>;
|
|
758
834
|
createNote(options: CreateNoteOptions): Promise<NoteWriteResult>;
|
|
759
835
|
appendNote(options: AppendNoteOptions): Promise<NoteWriteResult>;
|
|
@@ -786,7 +862,7 @@ interface RepoOptions {
|
|
|
786
862
|
defaultBranch?: string;
|
|
787
863
|
createdAt?: string;
|
|
788
864
|
}
|
|
789
|
-
type SupportedRepoProvider = 'github';
|
|
865
|
+
type SupportedRepoProvider = 'github' | 'gitlab' | 'bitbucket' | 'gitea' | 'forgejo' | 'codeberg' | 'sr.ht';
|
|
790
866
|
interface PublicGitHubBaseRepoAuth {
|
|
791
867
|
/**
|
|
792
868
|
* Force public GitHub mode (no GitHub App installation required).
|
|
@@ -797,18 +873,52 @@ interface GitHubBaseRepo {
|
|
|
797
873
|
/**
|
|
798
874
|
* @default github
|
|
799
875
|
*/
|
|
800
|
-
provider?:
|
|
876
|
+
provider?: 'github';
|
|
801
877
|
owner: string;
|
|
802
878
|
name: string;
|
|
803
879
|
defaultBranch?: string;
|
|
804
880
|
auth?: PublicGitHubBaseRepoAuth;
|
|
805
881
|
}
|
|
882
|
+
interface GenericGitBaseRepo {
|
|
883
|
+
/**
|
|
884
|
+
* The git host provider. Must be one of the supported generic git providers.
|
|
885
|
+
*/
|
|
886
|
+
provider: Exclude<SupportedRepoProvider, 'github'>;
|
|
887
|
+
owner: string;
|
|
888
|
+
name: string;
|
|
889
|
+
defaultBranch?: string;
|
|
890
|
+
/**
|
|
891
|
+
* Bare hostname for self-hosted instances (e.g. "gitlab.example.com").
|
|
892
|
+
* Falls back to the provider's default host when omitted.
|
|
893
|
+
*/
|
|
894
|
+
upstreamHost?: string;
|
|
895
|
+
}
|
|
806
896
|
interface ForkBaseRepo {
|
|
807
897
|
id: string;
|
|
808
898
|
ref?: string;
|
|
809
899
|
sha?: string;
|
|
810
900
|
}
|
|
811
|
-
type BaseRepo = GitHubBaseRepo | ForkBaseRepo;
|
|
901
|
+
type BaseRepo = GitHubBaseRepo | ForkBaseRepo | GenericGitBaseRepo;
|
|
902
|
+
interface CreateGitCredentialOptions {
|
|
903
|
+
repoId: string;
|
|
904
|
+
username?: string;
|
|
905
|
+
password: string;
|
|
906
|
+
ttl?: number;
|
|
907
|
+
}
|
|
908
|
+
interface UpdateGitCredentialOptions {
|
|
909
|
+
id: string;
|
|
910
|
+
username?: string;
|
|
911
|
+
password: string;
|
|
912
|
+
ttl?: number;
|
|
913
|
+
}
|
|
914
|
+
interface DeleteGitCredentialOptions {
|
|
915
|
+
id: string;
|
|
916
|
+
ttl?: number;
|
|
917
|
+
}
|
|
918
|
+
interface GitCredential {
|
|
919
|
+
id: string;
|
|
920
|
+
createdAt?: string;
|
|
921
|
+
}
|
|
812
922
|
interface ListReposOptions extends GitStorageInvocationOptions {
|
|
813
923
|
cursor?: string;
|
|
814
924
|
limit?: number;
|
|
@@ -924,6 +1034,40 @@ interface CreateBranchResult {
|
|
|
924
1034
|
targetIsEphemeral: boolean;
|
|
925
1035
|
commitSha?: string;
|
|
926
1036
|
}
|
|
1037
|
+
interface ListTagsOptions extends GitStorageInvocationOptions {
|
|
1038
|
+
cursor?: string;
|
|
1039
|
+
limit?: number;
|
|
1040
|
+
}
|
|
1041
|
+
type RawTagInfo = RawTagInfo$1;
|
|
1042
|
+
interface TagInfo {
|
|
1043
|
+
cursor: string;
|
|
1044
|
+
name: string;
|
|
1045
|
+
sha: string;
|
|
1046
|
+
}
|
|
1047
|
+
type ListTagsResponse = ListTagsResponseRaw;
|
|
1048
|
+
interface ListTagsResult {
|
|
1049
|
+
tags: TagInfo[];
|
|
1050
|
+
nextCursor?: string;
|
|
1051
|
+
hasMore: boolean;
|
|
1052
|
+
}
|
|
1053
|
+
interface CreateTagOptions extends GitStorageInvocationOptions {
|
|
1054
|
+
name: string;
|
|
1055
|
+
target: string;
|
|
1056
|
+
}
|
|
1057
|
+
type CreateTagResponse = CreateTagResponseRaw;
|
|
1058
|
+
interface CreateTagResult {
|
|
1059
|
+
name: string;
|
|
1060
|
+
sha: string;
|
|
1061
|
+
message: string;
|
|
1062
|
+
}
|
|
1063
|
+
interface DeleteTagOptions extends GitStorageInvocationOptions {
|
|
1064
|
+
name: string;
|
|
1065
|
+
}
|
|
1066
|
+
type DeleteTagResponse = DeleteTagResponseRaw;
|
|
1067
|
+
interface DeleteTagResult {
|
|
1068
|
+
name: string;
|
|
1069
|
+
message: string;
|
|
1070
|
+
}
|
|
927
1071
|
interface ListCommitsOptions extends GitStorageInvocationOptions {
|
|
928
1072
|
branch?: string;
|
|
929
1073
|
cursor?: string;
|
|
@@ -1373,6 +1517,19 @@ declare class GitStorage {
|
|
|
1373
1517
|
* @returns The deletion result
|
|
1374
1518
|
*/
|
|
1375
1519
|
deleteRepo(options: DeleteRepoOptions): Promise<DeleteRepoResult>;
|
|
1520
|
+
/**
|
|
1521
|
+
* Create a generic git credential for a repository.
|
|
1522
|
+
* Used to authenticate sync operations for non-GitHub providers (GitLab, Bitbucket, etc.)
|
|
1523
|
+
*/
|
|
1524
|
+
createGitCredential(options: CreateGitCredentialOptions): Promise<GitCredential>;
|
|
1525
|
+
/**
|
|
1526
|
+
* Update an existing generic git credential.
|
|
1527
|
+
*/
|
|
1528
|
+
updateGitCredential(options: UpdateGitCredentialOptions): Promise<GitCredential>;
|
|
1529
|
+
/**
|
|
1530
|
+
* Delete a generic git credential.
|
|
1531
|
+
*/
|
|
1532
|
+
deleteGitCredential(options: DeleteGitCredentialOptions): Promise<void>;
|
|
1376
1533
|
/**
|
|
1377
1534
|
* Get the current configuration
|
|
1378
1535
|
* @returns The client configuration
|
|
@@ -1388,4 +1545,4 @@ declare function createClient(options: GitStorageOptions): GitStorage;
|
|
|
1388
1545
|
|
|
1389
1546
|
type StorageOptions = GitStorageOptions;
|
|
1390
1547
|
|
|
1391
|
-
export { ApiError, type AppendNoteOptions, type ArchiveOptions, type BaseRepo, type BlobLike, type BranchInfo, GitStorage as CodeStorage, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitMetadata, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateBranchOptions, type CreateBranchResponse, type CreateBranchResult, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateNoteOptions, type CreateRepoOptions, type DeleteNoteOptions, type DeleteRepoOptions, type DeleteRepoResult, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FileWithMetadata, type FilteredFile, type FindOneOptions, type ForkBaseRepo, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetNoteOptions, type GetNoteResponse, type GetNoteResult, type GetRemoteURLOptions, type GitFileMode, type GitHubBaseRepo, GitStorage, type GitStorageOptions, type GrepFileMatch, type GrepLine, type GrepOptions, type GrepResult, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type ListFilesWithMetadataOptions, type ListFilesWithMetadataResponse, type ListFilesWithMetadataResult, type ListReposOptions, type ListReposResponse, type ListReposResult, type NoteWriteResponse, type NoteWriteResult, type NoteWriteResultPayload, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PublicGitHubBaseRepoAuth, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawCommitMetadata, type RawFileDiff, type RawFileWithMetadata, type RawFilteredFile, type RawRepoBaseInfo, type RawRepoInfo, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, type RepoBaseInfo, type RepoInfo, type RepoOptions, type RestoreCommitOptions, type RestoreCommitResult, type StorageOptions, type SupportedRepoProvider, type TextEncoding, type ValidAPIVersion, type ValidMethod, type ValidPath, type WebhookEventPayload, type WebhookPushEvent, type WebhookUnknownEvent, type WebhookValidationOptions, type WebhookValidationResult, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|
|
1548
|
+
export { ApiError, type AppendNoteOptions, type ArchiveOptions, type BaseRepo, type BlobLike, type BranchInfo, GitStorage as CodeStorage, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitMetadata, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateBranchOptions, type CreateBranchResponse, type CreateBranchResult, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateGitCredentialOptions, type CreateNoteOptions, type CreateRepoOptions, type CreateTagOptions, type CreateTagResponse, type CreateTagResult, type DeleteGitCredentialOptions, type DeleteNoteOptions, type DeleteRepoOptions, type DeleteRepoResult, type DeleteTagOptions, type DeleteTagResponse, type DeleteTagResult, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FileWithMetadata, type FilteredFile, type FindOneOptions, type ForkBaseRepo, type GenericGitBaseRepo, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetNoteOptions, type GetNoteResponse, type GetNoteResult, type GetRemoteURLOptions, type GitCredential, type GitFileMode, type GitHubBaseRepo, GitStorage, type GitStorageOptions, type GrepFileMatch, type GrepLine, type GrepOptions, type GrepResult, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type ListFilesWithMetadataOptions, type ListFilesWithMetadataResponse, type ListFilesWithMetadataResult, type ListReposOptions, type ListReposResponse, type ListReposResult, type ListTagsOptions, type ListTagsResponse, type ListTagsResult, type NoteWriteResponse, type NoteWriteResult, type NoteWriteResultPayload, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PublicGitHubBaseRepoAuth, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawCommitMetadata, type RawFileDiff, type RawFileWithMetadata, type RawFilteredFile, type RawRepoBaseInfo, type RawRepoInfo, type RawTagInfo, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, type RepoBaseInfo, type RepoInfo, type RepoOptions, type RestoreCommitOptions, type RestoreCommitResult, type StorageOptions, type SupportedRepoProvider, type TagInfo, type TextEncoding, type UpdateGitCredentialOptions, type ValidAPIVersion, type ValidMethod, type ValidPath, type WebhookEventPayload, type WebhookPushEvent, type WebhookUnknownEvent, type WebhookValidationOptions, type WebhookValidationResult, createClient, parseSignatureHeader, validateWebhook, validateWebhookSignature };
|