@pierre/storage 0.2.0 → 0.2.1
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 +28 -0
- package/dist/index.cjs +560 -330
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +560 -330
- package/dist/index.js.map +1 -1
- package/package.json +38 -39
- package/src/commit-pack.ts +128 -0
- package/src/commit.ts +18 -362
- package/src/diff-commit.ts +300 -0
- package/src/index.ts +25 -0
- package/src/stream-utils.ts +255 -0
- package/src/types.ts +16 -0
package/dist/index.d.cts
CHANGED
|
@@ -440,6 +440,7 @@ interface Repo {
|
|
|
440
440
|
pullUpstream(options: PullUpstreamOptions): Promise<void>;
|
|
441
441
|
restoreCommit(options: RestoreCommitOptions): Promise<RestoreCommitResult>;
|
|
442
442
|
createCommit(options: CreateCommitOptions): CommitBuilder;
|
|
443
|
+
createCommitFromDiff(options: CreateCommitFromDiffOptions): Promise<CommitResult>;
|
|
443
444
|
}
|
|
444
445
|
type ValidMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
445
446
|
type SimplePath = string;
|
|
@@ -628,6 +629,19 @@ interface CommitBuilder {
|
|
|
628
629
|
deletePath(path: string): CommitBuilder;
|
|
629
630
|
send(): Promise<CommitResult>;
|
|
630
631
|
}
|
|
632
|
+
type DiffSource = CommitFileSource;
|
|
633
|
+
interface CreateCommitFromDiffOptions extends GitStorageInvocationOptions {
|
|
634
|
+
targetBranch: string;
|
|
635
|
+
commitMessage: string;
|
|
636
|
+
diff: DiffSource;
|
|
637
|
+
expectedHeadSha?: string;
|
|
638
|
+
baseBranch?: string;
|
|
639
|
+
ephemeral?: boolean;
|
|
640
|
+
ephemeralBase?: boolean;
|
|
641
|
+
author: CommitSignature;
|
|
642
|
+
committer?: CommitSignature;
|
|
643
|
+
signal?: AbortSignal;
|
|
644
|
+
}
|
|
631
645
|
interface RefUpdate {
|
|
632
646
|
branch: string;
|
|
633
647
|
oldSha: string;
|
|
@@ -846,4 +860,4 @@ declare class GitStorage {
|
|
|
846
860
|
declare function createClient(options: GitStorageOptions): GitStorage;
|
|
847
861
|
type StorageOptions = GitStorageOptions;
|
|
848
862
|
|
|
849
|
-
export { ApiError, type BaseRepo, type BlobLike, type BranchInfo, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateCommitBranchOptions, type CreateCommitOptions, type CreateRepoOptions, type DiffFileBase, type DiffFileState, type DiffStats, type FileDiff, type FileLike, type FilteredFile, type FindOneOptions, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetRemoteURLOptions, type GitFileMode, GitStorage, type GitStorageOptions, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawFileDiff, type RawFilteredFile, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, 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 };
|
|
863
|
+
export { ApiError, type BaseRepo, type BlobLike, type BranchInfo, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateRepoOptions, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FilteredFile, type FindOneOptions, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetRemoteURLOptions, type GitFileMode, GitStorage, type GitStorageOptions, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawFileDiff, type RawFilteredFile, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -440,6 +440,7 @@ interface Repo {
|
|
|
440
440
|
pullUpstream(options: PullUpstreamOptions): Promise<void>;
|
|
441
441
|
restoreCommit(options: RestoreCommitOptions): Promise<RestoreCommitResult>;
|
|
442
442
|
createCommit(options: CreateCommitOptions): CommitBuilder;
|
|
443
|
+
createCommitFromDiff(options: CreateCommitFromDiffOptions): Promise<CommitResult>;
|
|
443
444
|
}
|
|
444
445
|
type ValidMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
445
446
|
type SimplePath = string;
|
|
@@ -628,6 +629,19 @@ interface CommitBuilder {
|
|
|
628
629
|
deletePath(path: string): CommitBuilder;
|
|
629
630
|
send(): Promise<CommitResult>;
|
|
630
631
|
}
|
|
632
|
+
type DiffSource = CommitFileSource;
|
|
633
|
+
interface CreateCommitFromDiffOptions extends GitStorageInvocationOptions {
|
|
634
|
+
targetBranch: string;
|
|
635
|
+
commitMessage: string;
|
|
636
|
+
diff: DiffSource;
|
|
637
|
+
expectedHeadSha?: string;
|
|
638
|
+
baseBranch?: string;
|
|
639
|
+
ephemeral?: boolean;
|
|
640
|
+
ephemeralBase?: boolean;
|
|
641
|
+
author: CommitSignature;
|
|
642
|
+
committer?: CommitSignature;
|
|
643
|
+
signal?: AbortSignal;
|
|
644
|
+
}
|
|
631
645
|
interface RefUpdate {
|
|
632
646
|
branch: string;
|
|
633
647
|
oldSha: string;
|
|
@@ -846,4 +860,4 @@ declare class GitStorage {
|
|
|
846
860
|
declare function createClient(options: GitStorageOptions): GitStorage;
|
|
847
861
|
type StorageOptions = GitStorageOptions;
|
|
848
862
|
|
|
849
|
-
export { ApiError, type BaseRepo, type BlobLike, type BranchInfo, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateCommitBranchOptions, type CreateCommitOptions, type CreateRepoOptions, type DiffFileBase, type DiffFileState, type DiffStats, type FileDiff, type FileLike, type FilteredFile, type FindOneOptions, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetRemoteURLOptions, type GitFileMode, GitStorage, type GitStorageOptions, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawFileDiff, type RawFilteredFile, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, 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 };
|
|
863
|
+
export { ApiError, type BaseRepo, type BlobLike, type BranchInfo, type CommitBuilder, type CommitFileOptions, type CommitFileSource, type CommitInfo, type CommitResult, type CommitSignature, type CommitTextFileOptions, type CreateCommitBranchOptions, type CreateCommitFromDiffOptions, type CreateCommitOptions, type CreateRepoOptions, type DiffFileBase, type DiffFileState, type DiffSource, type DiffStats, type FileDiff, type FileLike, type FilteredFile, type FindOneOptions, type GetBranchDiffOptions, type GetBranchDiffResponse, type GetBranchDiffResult, type GetCommitDiffOptions, type GetCommitDiffResponse, type GetCommitDiffResult, type GetFileOptions, type GetRemoteURLOptions, type GitFileMode, GitStorage, type GitStorageOptions, type LegacyCreateCommitOptions, type ListBranchesOptions, type ListBranchesResponse, type ListBranchesResult, type ListCommitsOptions, type ListCommitsResponse, type ListCommitsResult, type ListFilesOptions, type ListFilesResponse, type ListFilesResult, type OverrideableGitStorageOptions, type ParsedWebhookSignature, type PullUpstreamOptions, type RawBranchInfo, type RawCommitInfo, type RawFileDiff, type RawFilteredFile, type RawWebhookPushEvent, type ReadableStreamLike, type ReadableStreamReaderLike, type RefUpdate, RefUpdateError, type RefUpdateReason, type Repo, 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 };
|