@pierre/storage 0.1.4 → 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 +576 -323
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +576 -323
- package/dist/index.js.map +1 -1
- package/package.json +38 -39
- package/src/commit-pack.ts +128 -0
- package/src/commit.ts +35 -360
- package/src/diff-commit.ts +300 -0
- package/src/index.ts +39 -4
- package/src/stream-utils.ts +255 -0
- package/src/types.ts +20 -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;
|
|
@@ -473,12 +474,14 @@ interface CreateRepoOptions extends GitStorageInvocationOptions {
|
|
|
473
474
|
interface GetFileOptions extends GitStorageInvocationOptions {
|
|
474
475
|
path: string;
|
|
475
476
|
ref?: string;
|
|
477
|
+
ephemeral?: boolean;
|
|
476
478
|
}
|
|
477
479
|
interface PullUpstreamOptions extends GitStorageInvocationOptions {
|
|
478
480
|
ref?: string;
|
|
479
481
|
}
|
|
480
482
|
interface ListFilesOptions extends GitStorageInvocationOptions {
|
|
481
483
|
ref?: string;
|
|
484
|
+
ephemeral?: boolean;
|
|
482
485
|
}
|
|
483
486
|
type ListFilesResponse = ListFilesResponseRaw;
|
|
484
487
|
interface ListFilesResult {
|
|
@@ -572,6 +575,8 @@ interface CreateCommitBaseOptions extends GitStorageInvocationOptions {
|
|
|
572
575
|
commitMessage: string;
|
|
573
576
|
expectedHeadSha?: string;
|
|
574
577
|
baseBranch?: string;
|
|
578
|
+
ephemeral?: boolean;
|
|
579
|
+
ephemeralBase?: boolean;
|
|
575
580
|
author: CommitSignature;
|
|
576
581
|
committer?: CommitSignature;
|
|
577
582
|
signal?: AbortSignal;
|
|
@@ -624,6 +629,19 @@ interface CommitBuilder {
|
|
|
624
629
|
deletePath(path: string): CommitBuilder;
|
|
625
630
|
send(): Promise<CommitResult>;
|
|
626
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
|
+
}
|
|
627
645
|
interface RefUpdate {
|
|
628
646
|
branch: string;
|
|
629
647
|
oldSha: string;
|
|
@@ -842,4 +860,4 @@ declare class GitStorage {
|
|
|
842
860
|
declare function createClient(options: GitStorageOptions): GitStorage;
|
|
843
861
|
type StorageOptions = GitStorageOptions;
|
|
844
862
|
|
|
845
|
-
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;
|
|
@@ -473,12 +474,14 @@ interface CreateRepoOptions extends GitStorageInvocationOptions {
|
|
|
473
474
|
interface GetFileOptions extends GitStorageInvocationOptions {
|
|
474
475
|
path: string;
|
|
475
476
|
ref?: string;
|
|
477
|
+
ephemeral?: boolean;
|
|
476
478
|
}
|
|
477
479
|
interface PullUpstreamOptions extends GitStorageInvocationOptions {
|
|
478
480
|
ref?: string;
|
|
479
481
|
}
|
|
480
482
|
interface ListFilesOptions extends GitStorageInvocationOptions {
|
|
481
483
|
ref?: string;
|
|
484
|
+
ephemeral?: boolean;
|
|
482
485
|
}
|
|
483
486
|
type ListFilesResponse = ListFilesResponseRaw;
|
|
484
487
|
interface ListFilesResult {
|
|
@@ -572,6 +575,8 @@ interface CreateCommitBaseOptions extends GitStorageInvocationOptions {
|
|
|
572
575
|
commitMessage: string;
|
|
573
576
|
expectedHeadSha?: string;
|
|
574
577
|
baseBranch?: string;
|
|
578
|
+
ephemeral?: boolean;
|
|
579
|
+
ephemeralBase?: boolean;
|
|
575
580
|
author: CommitSignature;
|
|
576
581
|
committer?: CommitSignature;
|
|
577
582
|
signal?: AbortSignal;
|
|
@@ -624,6 +629,19 @@ interface CommitBuilder {
|
|
|
624
629
|
deletePath(path: string): CommitBuilder;
|
|
625
630
|
send(): Promise<CommitResult>;
|
|
626
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
|
+
}
|
|
627
645
|
interface RefUpdate {
|
|
628
646
|
branch: string;
|
|
629
647
|
oldSha: string;
|
|
@@ -842,4 +860,4 @@ declare class GitStorage {
|
|
|
842
860
|
declare function createClient(options: GitStorageOptions): GitStorage;
|
|
843
861
|
type StorageOptions = GitStorageOptions;
|
|
844
862
|
|
|
845
|
-
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 };
|