@chisquare-tech/origine-ngx-apps-code 0.4.0 → 0.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chisquare-tech/origine-ngx-apps-code",
3
- "version": "0.4.0",
3
+ "version": "0.6.0",
4
4
  "description": "Origine's Code module screens: repositories, files, commits, branches, pull requests and review, repository settings.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -151,6 +151,27 @@ interface Blob {
151
151
  rawUrl?: string;
152
152
  downloadUrl?: string;
153
153
  lastCommit?: Commit;
154
+ /** The file as it is (asked for by the editor; UTF-8 text shown in full). */
155
+ text?: string;
156
+ }
157
+ interface CommitRequest {
158
+ branch: string;
159
+ from?: string;
160
+ expect?: string;
161
+ files?: Record<string, string>;
162
+ uploads?: Record<string, string>;
163
+ deletes?: string[];
164
+ pull?: {
165
+ title?: string;
166
+ body?: string;
167
+ };
168
+ message: string;
169
+ }
170
+ interface CommitResult {
171
+ branch: string;
172
+ commit: Commit;
173
+ created: boolean;
174
+ pull?: number;
154
175
  }
155
176
  interface BlameHunk {
156
177
  commit: string;
@@ -233,6 +254,7 @@ interface Protection {
233
254
  requiredApprovals: number;
234
255
  dismissStaleApprovals: boolean;
235
256
  requireUpToDate: boolean;
257
+ requireCodeOwnerReview?: boolean;
236
258
  requiredChecks: string[];
237
259
  }
238
260
  interface PullBrief {
@@ -400,7 +422,9 @@ declare class CodeApi {
400
422
  updateProtection(project: string, name: string, id: string, p: Partial<Protection>): Observable<Protection>;
401
423
  removeProtection(project: string, name: string, id: string): Observable<unknown>;
402
424
  tree(project: string, name: string, ref: string, path: string): Observable<Tree>;
403
- blob(project: string, name: string, ref: string, path: string): Observable<Blob>;
425
+ blob(project: string, name: string, ref: string, path: string, withText?: boolean): Observable<Blob>;
426
+ /** A commit from the browser (DEV-13): files, base64 uploads and deletes; from a new branch it can open a pull request. */
427
+ commitFiles(project: string, name: string, body: CommitRequest): Observable<CommitResult>;
404
428
  blame(project: string, name: string, ref: string, path: string): Observable<BlameHunk[]>;
405
429
  files(project: string, name: string, ref: string): Observable<{
406
430
  files: string[];
@@ -712,6 +736,7 @@ declare class RepoHomePage extends RepoPage {
712
736
  protected readonly path: _angular_core.WritableSignal<string>;
713
737
  protected readonly proto: _angular_core.WritableSignal<"https" | "ssh">;
714
738
  protected readonly cloneOpen: _angular_core.WritableSignal<boolean>;
739
+ protected readonly addOpen: _angular_core.WritableSignal<boolean>;
715
740
  protected readonly copied: _angular_core.WritableSignal<boolean>;
716
741
  protected readonly finding: _angular_core.WritableSignal<boolean>;
717
742
  protected readonly fq: _angular_core.WritableSignal<string>;
@@ -745,6 +770,34 @@ declare class RepoHomePage extends RepoPage {
745
770
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<RepoHomePage, "o-code-repo", never, {}, {}, never, never, true, never>;
746
771
  }
747
772
 
773
+ /** Where a web commit goes: onto the branch, or onto a new branch with a pull request. */
774
+ interface CommitChoice {
775
+ message: string;
776
+ /** Set for a new branch (with a pull request into the current one). */
777
+ newBranch?: string;
778
+ }
779
+ /** Whether a branch protection pattern names the branch (as code's protect.Match: * within a segment, ** across). */
780
+ declare function matchesPattern(pattern: string, branch: string): boolean;
781
+ declare class CommitBox {
782
+ private readonly api;
783
+ private readonly host;
784
+ readonly repo: _angular_core.InputSignal<string>;
785
+ readonly branch: _angular_core.InputSignal<string>;
786
+ readonly defaultMessage: _angular_core.InputSignal<string>;
787
+ readonly busy: _angular_core.InputSignal<boolean>;
788
+ readonly commit: _angular_core.OutputEmitterRef<CommitChoice>;
789
+ readonly cancel: _angular_core.OutputEmitterRef<void>;
790
+ protected readonly message: _angular_core.WritableSignal<string>;
791
+ protected readonly toNew: _angular_core.WritableSignal<boolean>;
792
+ protected readonly newBranch: _angular_core.WritableSignal<string>;
793
+ private readonly rules;
794
+ protected readonly blocked: _angular_core.Signal<boolean>;
795
+ constructor();
796
+ protected send(): void;
797
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CommitBox, never>;
798
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CommitBox, "o-commit-box", never, { "repo": { "alias": "repo"; "required": true; "isSignal": true; }; "branch": { "alias": "branch"; "required": true; "isSignal": true; }; "defaultMessage": { "alias": "defaultMessage"; "required": false; "isSignal": true; }; "busy": { "alias": "busy"; "required": false; "isSignal": true; }; }, { "commit": "commit"; "cancel": "cancel"; }, never, never, true, never>;
799
+ }
800
+
748
801
  declare class FilePage extends RepoPage {
749
802
  private readonly router;
750
803
  protected readonly blob: _angular_core.WritableSignal<Blob | null>;
@@ -762,8 +815,18 @@ declare class FilePage extends RepoPage {
762
815
  path: string;
763
816
  }[]>;
764
817
  protected readonly meta: _angular_core.Signal<string>;
818
+ protected readonly mode: _angular_core.WritableSignal<"" | "delete" | "edit">;
819
+ protected readonly text: _angular_core.WritableSignal<string | null>;
820
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
821
+ private readonly branches;
822
+ /** The branch the view is on ('' for a tag or a commit, which cannot take commits). */
823
+ protected readonly branch: _angular_core.Signal<string>;
824
+ protected readonly editable: _angular_core.Signal<boolean>;
765
825
  constructor();
766
826
  protected onRepo(r: Repo): void;
827
+ protected startEdit(): void;
828
+ /** Commits the edit (or the delete), onto the branch or onto a new branch with a pull request. */
829
+ protected save(c: CommitChoice, del?: boolean): void;
767
830
  protected pickRef(ref: string): void;
768
831
  protected pickLine(n: number): void;
769
832
  protected copyText(): void;
@@ -993,6 +1056,7 @@ interface RuleForm {
993
1056
  requiredApprovals: number;
994
1057
  dismissStaleApprovals: boolean;
995
1058
  requireUpToDate: boolean;
1059
+ requireCodeOwnerReview: boolean;
996
1060
  requiredChecks: string[];
997
1061
  }
998
1062
  declare class RepoSettingsPage extends RepoPage {
@@ -1017,7 +1081,7 @@ declare class RepoSettingsPage extends RepoPage {
1017
1081
  label: string;
1018
1082
  }[];
1019
1083
  protected readonly toggles: {
1020
- key: 'blockDirectPush' | 'blockForcePush' | 'blockDeletion' | 'dismissStaleApprovals' | 'requireUpToDate';
1084
+ key: 'blockDirectPush' | 'blockForcePush' | 'blockDeletion' | 'dismissStaleApprovals' | 'requireUpToDate' | 'requireCodeOwnerReview';
1021
1085
  label: string;
1022
1086
  hint: string;
1023
1087
  }[];
@@ -1098,5 +1162,33 @@ declare class ReleasesPage extends RepoPage {
1098
1162
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ReleasesPage, "o-code-releases", never, {}, {}, never, never, true, never>;
1099
1163
  }
1100
1164
 
1101
- export { BranchesPage, CodeApi, CodeHost, CommitPage, CommitsPage, CurrentRepo, CurrentRepoPage, DiffView, FilePage, NewRepoPage, People, PullPage, PullsPage, RefPicker, ReleasesPage, RepoHomePage, RepoPage, RepoSettingsPage, ReposPage, TOKEN_CSS, ago, apiMessage, checkDot, copy, dayLabel, initials, langColour, pair, shortDate, size };
1102
- export type { BlameHunk, Blob, CheckStatus, CodePerson, CodeProject, Collaborator, Commit, CommitDetail, Comparison, DiffHunk, DiffLine, Entry, FileChange, FileDiff, Gate, GateRow, GitPerson, Language, LineComment, NewComment, PRComment, Protection, Pull, PullBrief, Ref, Release, ReleaseAsset, ReleaseInput, Repo, Review, ReviewBrief, SplitRow, Thread, ThreadReply, Timeline, Tree };
1165
+ interface Upload {
1166
+ name: string;
1167
+ size: number;
1168
+ b64: string;
1169
+ }
1170
+ declare class NewFilePage extends RepoPage {
1171
+ private readonly router;
1172
+ protected readonly upload: _angular_core.WritableSignal<boolean>;
1173
+ protected readonly ref: _angular_core.WritableSignal<string>;
1174
+ protected readonly uploads: _angular_core.WritableSignal<Upload[]>;
1175
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
1176
+ protected filePath: string;
1177
+ protected content: string;
1178
+ protected dir: string;
1179
+ protected readonly branch: _angular_core.Signal<string>;
1180
+ protected readonly defaultMessage: _angular_core.Signal<"Add files via upload" | "Create a file">;
1181
+ protected readonly fmt: typeof size;
1182
+ constructor();
1183
+ protected onRepo(_: Repo): void;
1184
+ protected pick(ev: Event): Promise<void>;
1185
+ protected shown(name: string): string;
1186
+ protected drop(name: string): void;
1187
+ protected back(): void;
1188
+ protected save(c: CommitChoice): void;
1189
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NewFilePage, never>;
1190
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NewFilePage, "o-code-new-file", never, {}, {}, never, never, true, never>;
1191
+ }
1192
+
1193
+ export { BranchesPage, CodeApi, CodeHost, CommitBox, CommitPage, CommitsPage, CurrentRepo, CurrentRepoPage, DiffView, FilePage, NewFilePage, NewRepoPage, People, PullPage, PullsPage, RefPicker, ReleasesPage, RepoHomePage, RepoPage, RepoSettingsPage, ReposPage, TOKEN_CSS, ago, apiMessage, checkDot, copy, dayLabel, initials, langColour, matchesPattern, pair, shortDate, size };
1194
+ export type { BlameHunk, Blob, CheckStatus, CodePerson, CodeProject, Collaborator, Commit, CommitChoice, CommitDetail, CommitRequest, CommitResult, Comparison, DiffHunk, DiffLine, Entry, FileChange, FileDiff, Gate, GateRow, GitPerson, Language, LineComment, NewComment, PRComment, Protection, Pull, PullBrief, Ref, Release, ReleaseAsset, ReleaseInput, Repo, Review, ReviewBrief, SplitRow, Thread, ThreadReply, Timeline, Tree };