@pierre/storage 0.2.0 → 0.2.2

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/src/types.ts CHANGED
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import type {
6
+ CreateBranchResponseRaw,
6
7
  GetBranchDiffResponseRaw,
7
8
  GetCommitDiffResponseRaw,
8
9
  ListBranchesResponseRaw,
@@ -44,9 +45,11 @@ export interface Repo {
44
45
  listCommits(options?: ListCommitsOptions): Promise<ListCommitsResult>;
45
46
  getBranchDiff(options: GetBranchDiffOptions): Promise<GetBranchDiffResult>;
46
47
  getCommitDiff(options: GetCommitDiffOptions): Promise<GetCommitDiffResult>;
47
- pullUpstream(options: PullUpstreamOptions): Promise<void>;
48
+ pullUpstream(options?: PullUpstreamOptions): Promise<void>;
48
49
  restoreCommit(options: RestoreCommitOptions): Promise<RestoreCommitResult>;
50
+ createBranch(options: CreateBranchOptions): Promise<CreateBranchResult>;
49
51
  createCommit(options: CreateCommitOptions): CommitBuilder;
52
+ createCommitFromDiff(options: CreateCommitFromDiffOptions): Promise<CommitResult>;
50
53
  }
51
54
 
52
55
  export type ValidMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
@@ -131,6 +134,23 @@ export interface ListBranchesResult {
131
134
  hasMore: boolean;
132
135
  }
133
136
 
137
+ // Create Branch API types
138
+ export interface CreateBranchOptions extends GitStorageInvocationOptions {
139
+ baseBranch: string;
140
+ targetBranch: string;
141
+ baseIsEphemeral?: boolean;
142
+ targetIsEphemeral?: boolean;
143
+ }
144
+
145
+ export type CreateBranchResponse = CreateBranchResponseRaw;
146
+
147
+ export interface CreateBranchResult {
148
+ message: string;
149
+ targetBranch: string;
150
+ targetIsEphemeral: boolean;
151
+ commitSha?: string;
152
+ }
153
+
134
154
  // List Commits API types
135
155
  export interface ListCommitsOptions extends GitStorageInvocationOptions {
136
156
  branch?: string;
@@ -316,6 +336,21 @@ export interface CommitBuilder {
316
336
  send(): Promise<CommitResult>;
317
337
  }
318
338
 
339
+ export type DiffSource = CommitFileSource;
340
+
341
+ export interface CreateCommitFromDiffOptions extends GitStorageInvocationOptions {
342
+ targetBranch: string;
343
+ commitMessage: string;
344
+ diff: DiffSource;
345
+ expectedHeadSha?: string;
346
+ baseBranch?: string;
347
+ ephemeral?: boolean;
348
+ ephemeralBase?: boolean;
349
+ author: CommitSignature;
350
+ committer?: CommitSignature;
351
+ signal?: AbortSignal;
352
+ }
353
+
319
354
  export interface RefUpdate {
320
355
  branch: string;
321
356
  oldSha: string;