@chisquare-tech/origine-ngx-apps-code 0.9.0 → 0.11.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.9.0",
3
+ "version": "0.11.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",
@@ -125,12 +125,20 @@ interface Comparison {
125
125
  commits: Commit[];
126
126
  files: FileChange[];
127
127
  }
128
+ /** A file Git keeps as a Git LFS pointer (DEV-02): the object it names. */
129
+ interface LfsObject {
130
+ oid: string;
131
+ size: number;
132
+ /** Whether the object was uploaded (a pointer can name one that never was). */
133
+ stored: boolean;
134
+ }
128
135
  interface Entry {
129
136
  name: string;
130
137
  path: string;
131
138
  type: 'tree' | 'blob' | 'commit';
132
139
  size?: number;
133
140
  lastCommit?: Commit;
141
+ lfs?: LfsObject;
134
142
  }
135
143
  interface Tree {
136
144
  ref: string;
@@ -162,6 +170,8 @@ interface Blob {
162
170
  lastCommit?: Commit;
163
171
  /** The file as it is (asked for by the editor; UTF-8 text shown in full). */
164
172
  text?: string;
173
+ /** Set for a Git LFS file: the view (size, lines, links) is of the object. */
174
+ lfs?: LfsObject;
165
175
  }
166
176
  interface CommitRequest {
167
177
  branch: string;
@@ -207,6 +217,19 @@ interface Ref {
207
217
  merged: boolean;
208
218
  canDelete: boolean;
209
219
  }
220
+ /** One file a code search found, with its matching lines (DEV-11). */
221
+ interface CodeHit {
222
+ repoId: string;
223
+ repo: string;
224
+ projectKey: string;
225
+ path: string;
226
+ nameMatch?: boolean;
227
+ lines: {
228
+ number: number;
229
+ text: string;
230
+ ranges: [number, number][] | null;
231
+ }[];
232
+ }
210
233
  /** A repository collaborator (DEV-06): access beyond the project role, for one repository. */
211
234
  interface Collaborator {
212
235
  repoId: string;
@@ -465,6 +488,11 @@ declare class CodeApi {
465
488
  }): Observable<FileDiff>;
466
489
  compare(project: string, name: string, base: string, head: string): Observable<Comparison>;
467
490
  refs(project: string, name: string, kind?: 'branch' | 'tag', q?: string): Observable<Ref[]>;
491
+ /** Searches the repository's default branch (text, or a regular expression). */
492
+ searchCode(project: string, name: string, q: string, regex?: boolean): Observable<{
493
+ hits: CodeHit[];
494
+ repos: number;
495
+ }>;
468
496
  collaborators(project: string, name: string): Observable<Collaborator[]>;
469
497
  setCollaborator(project: string, name: string, userId: string, permission: string): Observable<Collaborator>;
470
498
  removeCollaborator(project: string, name: string, userId: string): Observable<unknown>;
@@ -775,6 +803,8 @@ declare class RepoHomePage extends RepoPage {
775
803
  protected readonly proto: _angular_core.WritableSignal<"https" | "ssh">;
776
804
  protected readonly cloneOpen: _angular_core.WritableSignal<boolean>;
777
805
  protected readonly addOpen: _angular_core.WritableSignal<boolean>;
806
+ protected codeQuery: string;
807
+ protected searchCode(): void;
778
808
  protected readonly copied: _angular_core.WritableSignal<boolean>;
779
809
  protected readonly finding: _angular_core.WritableSignal<boolean>;
780
810
  protected readonly fq: _angular_core.WritableSignal<string>;
@@ -845,16 +875,17 @@ declare class FilePage extends RepoPage {
845
875
  protected readonly ref: _angular_core.WritableSignal<string>;
846
876
  protected readonly path: _angular_core.WritableSignal<string>;
847
877
  protected readonly line: _angular_core.WritableSignal<number>;
848
- protected readonly view: _angular_core.WritableSignal<"code" | "preview">;
878
+ protected readonly view: _angular_core.WritableSignal<"preview" | "code">;
849
879
  protected readonly copied: _angular_core.WritableSignal<boolean>;
850
880
  protected readonly ago: (s?: string) => string;
851
881
  protected readonly initials: typeof initials;
882
+ protected readonly size: typeof size;
852
883
  protected readonly crumbs: _angular_core.Signal<{
853
884
  name: string;
854
885
  path: string;
855
886
  }[]>;
856
887
  protected readonly meta: _angular_core.Signal<string>;
857
- protected readonly mode: _angular_core.WritableSignal<"" | "delete" | "edit">;
888
+ protected readonly mode: _angular_core.WritableSignal<"" | "edit" | "delete">;
858
889
  protected readonly text: _angular_core.WritableSignal<string | null>;
859
890
  protected readonly busy: _angular_core.WritableSignal<boolean>;
860
891
  private readonly branches;
@@ -1029,7 +1060,7 @@ declare class PullPage extends RepoPage {
1029
1060
  label: string;
1030
1061
  n: number | undefined;
1031
1062
  }[]>;
1032
- protected readonly badge: _angular_core.Signal<"" | "Open" | "Merged" | "Closed" | "Draft">;
1063
+ protected readonly badge: _angular_core.Signal<"" | "Merged" | "Closed" | "Draft" | "Open">;
1033
1064
  protected readonly badgeBg: _angular_core.Signal<string>;
1034
1065
  protected readonly approvedByMe: _angular_core.Signal<boolean>;
1035
1066
  protected readonly reviewKinds: _angular_core.Signal<({
@@ -1244,5 +1275,25 @@ declare class NewFilePage extends RepoPage {
1244
1275
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NewFilePage, "o-code-new-file", never, {}, {}, never, never, true, never>;
1245
1276
  }
1246
1277
 
1247
- 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, verifyWhy };
1248
- 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 };
1278
+ interface Piece {
1279
+ text: string;
1280
+ hit: boolean;
1281
+ }
1282
+ declare class CodeSearchPage extends RepoPage {
1283
+ private readonly router;
1284
+ protected readonly hits: _angular_core.WritableSignal<CodeHit[]>;
1285
+ protected readonly searched: _angular_core.WritableSignal<boolean>;
1286
+ protected text: string;
1287
+ protected regex: boolean;
1288
+ constructor();
1289
+ protected onRepo(r: Repo): void;
1290
+ protected go(): void;
1291
+ private load;
1292
+ /** A line cut into plain and matched pieces (ranges are byte offsets; the text is UTF-8). */
1293
+ protected pieces(text: string, ranges: [number, number][] | null): Piece[];
1294
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CodeSearchPage, never>;
1295
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CodeSearchPage, "o-code-search", never, {}, {}, never, never, true, never>;
1296
+ }
1297
+
1298
+ export { BranchesPage, CodeApi, CodeHost, CodeSearchPage, 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, verifyWhy };
1299
+ export type { BlameHunk, Blob, CheckStatus, CodeHit, CodePerson, CodeProject, Collaborator, Commit, CommitChoice, CommitDetail, CommitRequest, CommitResult, Comparison, DiffHunk, DiffLine, Entry, FileChange, FileDiff, Gate, GateRow, GitPerson, Language, LfsObject, LineComment, NewComment, PRComment, Protection, Pull, PullBrief, Ref, Release, ReleaseAsset, ReleaseInput, Repo, Review, ReviewBrief, SplitRow, Thread, ThreadReply, Timeline, Tree };