@chisquare-tech/origine-ngx-apps-code 0.4.0 → 0.5.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.5.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;
@@ -400,7 +421,9 @@ declare class CodeApi {
400
421
  updateProtection(project: string, name: string, id: string, p: Partial<Protection>): Observable<Protection>;
401
422
  removeProtection(project: string, name: string, id: string): Observable<unknown>;
402
423
  tree(project: string, name: string, ref: string, path: string): Observable<Tree>;
403
- blob(project: string, name: string, ref: string, path: string): Observable<Blob>;
424
+ blob(project: string, name: string, ref: string, path: string, withText?: boolean): Observable<Blob>;
425
+ /** A commit from the browser (DEV-13): files, base64 uploads and deletes; from a new branch it can open a pull request. */
426
+ commitFiles(project: string, name: string, body: CommitRequest): Observable<CommitResult>;
404
427
  blame(project: string, name: string, ref: string, path: string): Observable<BlameHunk[]>;
405
428
  files(project: string, name: string, ref: string): Observable<{
406
429
  files: string[];
@@ -712,6 +735,7 @@ declare class RepoHomePage extends RepoPage {
712
735
  protected readonly path: _angular_core.WritableSignal<string>;
713
736
  protected readonly proto: _angular_core.WritableSignal<"https" | "ssh">;
714
737
  protected readonly cloneOpen: _angular_core.WritableSignal<boolean>;
738
+ protected readonly addOpen: _angular_core.WritableSignal<boolean>;
715
739
  protected readonly copied: _angular_core.WritableSignal<boolean>;
716
740
  protected readonly finding: _angular_core.WritableSignal<boolean>;
717
741
  protected readonly fq: _angular_core.WritableSignal<string>;
@@ -745,6 +769,34 @@ declare class RepoHomePage extends RepoPage {
745
769
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<RepoHomePage, "o-code-repo", never, {}, {}, never, never, true, never>;
746
770
  }
747
771
 
772
+ /** Where a web commit goes: onto the branch, or onto a new branch with a pull request. */
773
+ interface CommitChoice {
774
+ message: string;
775
+ /** Set for a new branch (with a pull request into the current one). */
776
+ newBranch?: string;
777
+ }
778
+ /** Whether a branch protection pattern names the branch (as code's protect.Match: * within a segment, ** across). */
779
+ declare function matchesPattern(pattern: string, branch: string): boolean;
780
+ declare class CommitBox {
781
+ private readonly api;
782
+ private readonly host;
783
+ readonly repo: _angular_core.InputSignal<string>;
784
+ readonly branch: _angular_core.InputSignal<string>;
785
+ readonly defaultMessage: _angular_core.InputSignal<string>;
786
+ readonly busy: _angular_core.InputSignal<boolean>;
787
+ readonly commit: _angular_core.OutputEmitterRef<CommitChoice>;
788
+ readonly cancel: _angular_core.OutputEmitterRef<void>;
789
+ protected readonly message: _angular_core.WritableSignal<string>;
790
+ protected readonly toNew: _angular_core.WritableSignal<boolean>;
791
+ protected readonly newBranch: _angular_core.WritableSignal<string>;
792
+ private readonly rules;
793
+ protected readonly blocked: _angular_core.Signal<boolean>;
794
+ constructor();
795
+ protected send(): void;
796
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CommitBox, never>;
797
+ 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>;
798
+ }
799
+
748
800
  declare class FilePage extends RepoPage {
749
801
  private readonly router;
750
802
  protected readonly blob: _angular_core.WritableSignal<Blob | null>;
@@ -762,8 +814,18 @@ declare class FilePage extends RepoPage {
762
814
  path: string;
763
815
  }[]>;
764
816
  protected readonly meta: _angular_core.Signal<string>;
817
+ protected readonly mode: _angular_core.WritableSignal<"" | "delete" | "edit">;
818
+ protected readonly text: _angular_core.WritableSignal<string | null>;
819
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
820
+ private readonly branches;
821
+ /** The branch the view is on ('' for a tag or a commit, which cannot take commits). */
822
+ protected readonly branch: _angular_core.Signal<string>;
823
+ protected readonly editable: _angular_core.Signal<boolean>;
765
824
  constructor();
766
825
  protected onRepo(r: Repo): void;
826
+ protected startEdit(): void;
827
+ /** Commits the edit (or the delete), onto the branch or onto a new branch with a pull request. */
828
+ protected save(c: CommitChoice, del?: boolean): void;
767
829
  protected pickRef(ref: string): void;
768
830
  protected pickLine(n: number): void;
769
831
  protected copyText(): void;
@@ -1098,5 +1160,33 @@ declare class ReleasesPage extends RepoPage {
1098
1160
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<ReleasesPage, "o-code-releases", never, {}, {}, never, never, true, never>;
1099
1161
  }
1100
1162
 
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 };
1163
+ interface Upload {
1164
+ name: string;
1165
+ size: number;
1166
+ b64: string;
1167
+ }
1168
+ declare class NewFilePage extends RepoPage {
1169
+ private readonly router;
1170
+ protected readonly upload: _angular_core.WritableSignal<boolean>;
1171
+ protected readonly ref: _angular_core.WritableSignal<string>;
1172
+ protected readonly uploads: _angular_core.WritableSignal<Upload[]>;
1173
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
1174
+ protected filePath: string;
1175
+ protected content: string;
1176
+ protected dir: string;
1177
+ protected readonly branch: _angular_core.Signal<string>;
1178
+ protected readonly defaultMessage: _angular_core.Signal<"Add files via upload" | "Create a file">;
1179
+ protected readonly fmt: typeof size;
1180
+ constructor();
1181
+ protected onRepo(_: Repo): void;
1182
+ protected pick(ev: Event): Promise<void>;
1183
+ protected shown(name: string): string;
1184
+ protected drop(name: string): void;
1185
+ protected back(): void;
1186
+ protected save(c: CommitChoice): void;
1187
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<NewFilePage, never>;
1188
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<NewFilePage, "o-code-new-file", never, {}, {}, never, never, true, never>;
1189
+ }
1190
+
1191
+ 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 };
1192
+ 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 };