@chisquare-tech/origine-ngx-apps-code 0.1.0 → 0.3.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.1.0",
3
+ "version": "0.3.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",
@@ -1,7 +1,8 @@
1
1
  import * as _angular_core from '@angular/core';
2
- import { Signal } from '@angular/core';
2
+ import { Signal, AfterViewInit } from '@angular/core';
3
3
  import { Observable } from 'rxjs';
4
4
  import { ActivatedRoute } from '@angular/router';
5
+ import * as _chisquare_tech_origine_ngx_apps_code from '@chisquare-tech/origine-ngx-apps-code';
5
6
 
6
7
  /** A person in the organization, as the host knows them (identity's members). */
7
8
  interface CodePerson {
@@ -174,6 +175,43 @@ interface Ref {
174
175
  merged: boolean;
175
176
  canDelete: boolean;
176
177
  }
178
+ /** A file on a release (DEV-15). */
179
+ interface ReleaseAsset {
180
+ id: string;
181
+ releaseId: string;
182
+ name: string;
183
+ size: number;
184
+ mediaType: string;
185
+ createdBy: string;
186
+ createdAt: string;
187
+ }
188
+ /** A release: a tag with a title, Markdown notes and files; a draft until published. */
189
+ interface Release {
190
+ id: string;
191
+ repoId: string;
192
+ tag: string;
193
+ targetSha: string;
194
+ short: string;
195
+ title: string;
196
+ notes: string;
197
+ draft: boolean;
198
+ prerelease: boolean;
199
+ latest: boolean;
200
+ createdBy: string;
201
+ createdAt: string;
202
+ publishedAt: string | null;
203
+ version: number;
204
+ assets: ReleaseAsset[];
205
+ }
206
+ interface ReleaseInput {
207
+ tag?: string;
208
+ target?: string;
209
+ title?: string;
210
+ notes?: string;
211
+ draft?: boolean;
212
+ prerelease?: boolean;
213
+ version?: number;
214
+ }
177
215
  interface Protection {
178
216
  id: string;
179
217
  repoId: string;
@@ -367,9 +405,24 @@ declare class CodeApi {
367
405
  }): Observable<Commit[]>;
368
406
  commit(project: string, name: string, sha: string): Observable<CommitDetail>;
369
407
  /** One file's hunks from base to head ("" base: the head's first parent). */
370
- diff(project: string, name: string, head: string, path: string, base?: string): Observable<FileDiff>;
408
+ diff(project: string, name: string, head: string, path: string, base?: string, opts?: {
409
+ context?: number;
410
+ ignoreSpace?: boolean;
411
+ }): Observable<FileDiff>;
371
412
  compare(project: string, name: string, base: string, head: string): Observable<Comparison>;
372
413
  refs(project: string, name: string, kind?: 'branch' | 'tag', q?: string): Observable<Ref[]>;
414
+ createTag(project: string, name: string, tag: string, target: string): Observable<Ref>;
415
+ deleteTag(project: string, name: string, tag: string): Observable<unknown>;
416
+ releases(project: string, name: string): Observable<Release[]>;
417
+ createRelease(project: string, name: string, r: ReleaseInput): Observable<Release>;
418
+ updateRelease(project: string, name: string, id: string, r: ReleaseInput): Observable<Release>;
419
+ deleteRelease(project: string, name: string, id: string, deleteTag: boolean): Observable<unknown>;
420
+ /** Notes drafted from the done issues and merged pull requests since the previous release. */
421
+ releaseNotes(project: string, name: string, target: string, tag?: string): Observable<string>;
422
+ addAsset(project: string, name: string, id: string, file: File): Observable<ReleaseAsset>;
423
+ /** A release file's bytes (the download needs the session, so no plain link works). */
424
+ assetBlob(project: string, name: string, id: string, asset: string): Observable<globalThis.Blob>;
425
+ deleteAsset(project: string, name: string, id: string, asset: string): Observable<unknown>;
373
426
  createBranch(project: string, name: string, branch: string, from: string): Observable<unknown>;
374
427
  deleteBranch(project: string, name: string, branch: string): Observable<unknown>;
375
428
  deleteMerged(project: string, name: string): Observable<{
@@ -412,6 +465,8 @@ declare class CodeApi {
412
465
  }): Observable<Pull>;
413
466
  conversation(project: string, name: string, n: number): Observable<Timeline>;
414
467
  comment(project: string, name: string, n: number, c: NewComment): Observable<PRComment>;
468
+ /** Discards one of the caller's pending review comments. */
469
+ discardComment(project: string, name: string, n: number, id: string): Observable<unknown>;
415
470
  review(project: string, name: string, n: number, state: 'commented' | 'approved' | 'changes_requested', body?: string): Observable<Review>;
416
471
  resolve(project: string, name: string, n: number, thread: string, on: boolean): Observable<unknown>;
417
472
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<CodeApi, never>;
@@ -504,27 +559,47 @@ interface LineComment {
504
559
  side: 'old' | 'new';
505
560
  line: number;
506
561
  body: string;
562
+ /** Part of the caller's review, posted when it is submitted. */
563
+ pending: boolean;
507
564
  }
508
565
  interface ThreadReply {
509
566
  threadId: string;
510
567
  body: string;
511
568
  }
512
- declare class DiffView {
569
+ /** One row of the split view: the old side and the new side. */
570
+ interface SplitRow {
571
+ left?: DiffLine;
572
+ right?: DiffLine;
573
+ }
574
+ declare class DiffView implements AfterViewInit {
513
575
  private readonly api;
514
576
  private readonly host;
577
+ private readonly el;
578
+ private readonly destroyRef;
515
579
  readonly repo: _angular_core.InputSignal<string>;
516
580
  readonly file: _angular_core.InputSignal<FileChange>;
517
581
  readonly head: _angular_core.InputSignal<string>;
518
582
  readonly base: _angular_core.InputSignal<string>;
519
583
  readonly threads: _angular_core.InputSignal<Thread[]>;
520
584
  readonly canComment: _angular_core.InputSignal<boolean>;
585
+ readonly mode: _angular_core.InputSignal<"unified" | "split">;
586
+ readonly ignoreSpace: _angular_core.InputSignal<boolean>;
587
+ /** The file is marked viewed (pull requests); null hides the Viewed button. */
588
+ readonly viewed: _angular_core.InputSignal<boolean | null>;
589
+ /** The caller has a pending review on this pull request. */
590
+ readonly reviewing: _angular_core.InputSignal<boolean>;
521
591
  readonly comment: _angular_core.OutputEmitterRef<LineComment>;
522
592
  readonly reply: _angular_core.OutputEmitterRef<ThreadReply>;
523
593
  readonly resolve: _angular_core.OutputEmitterRef<{
524
594
  threadId: string;
525
595
  resolved: boolean;
526
596
  }>;
597
+ readonly discard: _angular_core.OutputEmitterRef<string>;
598
+ readonly viewedChange: _angular_core.OutputEmitterRef<boolean>;
527
599
  protected readonly open: _angular_core.WritableSignal<boolean>;
600
+ protected readonly visible: _angular_core.WritableSignal<boolean>;
601
+ protected readonly waiting: _angular_core.WritableSignal<boolean>;
602
+ protected readonly context: _angular_core.WritableSignal<number>;
528
603
  protected readonly diff: _angular_core.WritableSignal<FileDiff | null>;
529
604
  protected readonly error: _angular_core.WritableSignal<string>;
530
605
  protected readonly drafting: _angular_core.WritableSignal<string>;
@@ -532,18 +607,30 @@ declare class DiffView {
532
607
  protected readonly replies: _angular_core.WritableSignal<Record<string, string>>;
533
608
  protected readonly people: _angular_core.Signal<People>;
534
609
  protected readonly threadsHere: _angular_core.Signal<Thread[]>;
610
+ protected readonly viewable: _angular_core.Signal<boolean>;
611
+ protected readonly me: _angular_core.Signal<string>;
612
+ protected readonly splitRows: _angular_core.Signal<SplitRow[][]>;
535
613
  protected readonly ago: (s?: string) => string;
614
+ private asked;
536
615
  constructor();
616
+ ngAfterViewInit(): void;
617
+ protected load(): void;
618
+ protected toggleOpen(): void;
619
+ protected moreContext(): void;
537
620
  protected key(l: DiffLine): string;
538
621
  protected lineOf(l: DiffLine): number;
622
+ /** The lines of a split row that threads and drafts hang from (a context line once). */
623
+ protected rowLines(r: SplitRow): DiffLine[];
539
624
  protected threadsAt(l: DiffLine): Thread[];
540
625
  protected startComment(l: DiffLine): void;
541
- protected send(l: DiffLine): void;
626
+ protected send(l: DiffLine, pending: boolean): void;
542
627
  protected setReply(id: string, v: string): void;
543
628
  protected sendReply(id: string): void;
544
629
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<DiffView, never>;
545
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<DiffView, "o-diff", never, { "repo": { "alias": "repo"; "required": true; "isSignal": true; }; "file": { "alias": "file"; "required": true; "isSignal": true; }; "head": { "alias": "head"; "required": true; "isSignal": true; }; "base": { "alias": "base"; "required": false; "isSignal": true; }; "threads": { "alias": "threads"; "required": false; "isSignal": true; }; "canComment": { "alias": "canComment"; "required": false; "isSignal": true; }; }, { "comment": "comment"; "reply": "reply"; "resolve": "resolve"; }, never, ["*"], true, never>;
630
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DiffView, "o-diff", never, { "repo": { "alias": "repo"; "required": true; "isSignal": true; }; "file": { "alias": "file"; "required": true; "isSignal": true; }; "head": { "alias": "head"; "required": true; "isSignal": true; }; "base": { "alias": "base"; "required": false; "isSignal": true; }; "threads": { "alias": "threads"; "required": false; "isSignal": true; }; "canComment": { "alias": "canComment"; "required": false; "isSignal": true; }; "mode": { "alias": "mode"; "required": false; "isSignal": true; }; "ignoreSpace": { "alias": "ignoreSpace"; "required": false; "isSignal": true; }; "viewed": { "alias": "viewed"; "required": false; "isSignal": true; }; "reviewing": { "alias": "reviewing"; "required": false; "isSignal": true; }; }, { "comment": "comment"; "reply": "reply"; "resolve": "resolve"; "discard": "discard"; "viewedChange": "viewedChange"; }, never, ["*"], true, never>;
546
631
  }
632
+ /** Pairs a hunk's lines side by side: context on both sides, a run of removals beside the run of additions that follows it. */
633
+ declare function pair(lines: DiffLine[]): SplitRow[];
547
634
 
548
635
  declare class ReposPage {
549
636
  protected readonly host: CodeHost;
@@ -783,7 +870,7 @@ declare class PullsPage {
783
870
  }
784
871
 
785
872
  type Tab = 'conversation' | 'commits' | 'files' | 'checks';
786
- interface Event {
873
+ interface Event$1 {
787
874
  at: string;
788
875
  kind: 'comment' | 'review' | 'thread';
789
876
  who: string;
@@ -811,6 +898,13 @@ declare class PullPage extends RepoPage {
811
898
  protected readonly initials: typeof initials;
812
899
  protected readonly dot: typeof checkDot;
813
900
  protected readonly threads: _angular_core.Signal<Thread[]>;
901
+ protected readonly mode: _angular_core.WritableSignal<"unified" | "split">;
902
+ protected readonly hideWs: _angular_core.WritableSignal<boolean>;
903
+ /** Files marked viewed, kept per pull request head in this browser (a new push resets them). */
904
+ protected readonly viewed: _angular_core.WritableSignal<Record<string, boolean>>;
905
+ protected readonly viewedCount: _angular_core.Signal<number>;
906
+ /** The caller's pending review comments (shown only to them until the review is submitted). */
907
+ protected readonly myPending: _angular_core.Signal<_chisquare_tech_origine_ngx_apps_code.PRComment[]>;
814
908
  protected readonly openThreads: _angular_core.Signal<number>;
815
909
  protected readonly tabs: _angular_core.Signal<{
816
910
  id: Tab;
@@ -838,7 +932,7 @@ declare class PullPage extends RepoPage {
838
932
  label: string;
839
933
  colour: string;
840
934
  }[]>;
841
- protected readonly events: _angular_core.Signal<Event[]>;
935
+ protected readonly events: _angular_core.Signal<Event$1[]>;
842
936
  constructor();
843
937
  protected onRepo(_: Repo): void;
844
938
  protected md(s: string): string;
@@ -852,6 +946,12 @@ declare class PullPage extends RepoPage {
852
946
  protected submitReview(): void;
853
947
  protected addComment(): void;
854
948
  protected lineComment(c: LineComment): void;
949
+ protected discard(id: string): void;
950
+ protected setMode(m: 'unified' | 'split'): void;
951
+ private viewedKey;
952
+ protected isViewed(path: string): boolean;
953
+ protected setViewed(path: string, on: boolean): void;
954
+ protected jump(path: string): void;
855
955
  protected reply(r: ThreadReply): void;
856
956
  protected resolve(e: {
857
957
  threadId: string;
@@ -924,5 +1024,51 @@ declare class RepoSettingsPage extends RepoPage {
924
1024
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<RepoSettingsPage, "o-code-settings", never, {}, {}, never, never, true, never>;
925
1025
  }
926
1026
 
927
- export { BranchesPage, CodeApi, CodeHost, CommitPage, CommitsPage, CurrentRepo, CurrentRepoPage, DiffView, FilePage, NewRepoPage, People, PullPage, PullsPage, RefPicker, RepoHomePage, RepoPage, RepoSettingsPage, ReposPage, TOKEN_CSS, ago, apiMessage, checkDot, copy, dayLabel, initials, langColour, shortDate, size };
928
- export type { BlameHunk, Blob, CheckStatus, CodePerson, CodeProject, Commit, CommitDetail, Comparison, DiffHunk, DiffLine, Entry, FileChange, FileDiff, Gate, GateRow, GitPerson, Language, LineComment, NewComment, PRComment, Protection, Pull, PullBrief, Ref, Repo, Review, ReviewBrief, Thread, ThreadReply, Timeline, Tree };
1027
+ interface Draft {
1028
+ id?: string;
1029
+ version?: number;
1030
+ tag: string;
1031
+ newTag: boolean;
1032
+ target: string;
1033
+ title: string;
1034
+ notes: string;
1035
+ prerelease: boolean;
1036
+ draft: boolean;
1037
+ }
1038
+ declare class ReleasesPage extends RepoPage {
1039
+ protected readonly releases: _angular_core.WritableSignal<Release[]>;
1040
+ protected readonly tags: _angular_core.WritableSignal<Ref[]>;
1041
+ protected readonly loaded: _angular_core.WritableSignal<boolean>;
1042
+ protected readonly tagging: _angular_core.WritableSignal<boolean>;
1043
+ protected readonly draft: _angular_core.WritableSignal<Draft | null>;
1044
+ protected readonly busy: _angular_core.WritableSignal<boolean>;
1045
+ protected readonly confirming: _angular_core.WritableSignal<string>;
1046
+ protected readonly freeTags: _angular_core.Signal<Ref[]>;
1047
+ protected readonly ago: (s?: string) => string;
1048
+ protected tagName: string;
1049
+ protected tagFrom: string;
1050
+ protected alsoTag: boolean;
1051
+ protected onRepo(r: Repo): void;
1052
+ protected md(s: string): string;
1053
+ protected used(tag: string): boolean;
1054
+ private load;
1055
+ private run;
1056
+ protected createTag(): void;
1057
+ protected removeTag(t: Ref): void;
1058
+ protected startRelease(): void;
1059
+ protected setTag(d: Draft, tag: string): void;
1060
+ protected generate(d: Draft): void;
1061
+ protected edit(r: Release): void;
1062
+ protected save(d: Draft, asDraft: boolean): void;
1063
+ protected remove(rel: Release): void;
1064
+ protected upload(rel: Release, ev: Event): void;
1065
+ protected removeAsset(rel: Release, id: string): void;
1066
+ protected download(rel: Release, id: string, filename: string): void;
1067
+ protected archive(rel: Release, format: 'zip' | 'tar.gz'): void;
1068
+ private save_;
1069
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<ReleasesPage, never>;
1070
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<ReleasesPage, "o-code-releases", never, {}, {}, never, never, true, never>;
1071
+ }
1072
+
1073
+ 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 };
1074
+ export type { BlameHunk, Blob, CheckStatus, CodePerson, CodeProject, 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 };