@chisquare-tech/origine-ngx-apps-code 0.8.0 → 0.10.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.8.0",
3
+ "version": "0.10.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",
@@ -74,6 +74,13 @@ interface Commit {
74
74
  committer: GitPerson;
75
75
  parents: string[];
76
76
  keys: string[];
77
+ signed?: boolean;
78
+ /** The signature checked against the committer's signing keys (DEV-31); absent when unsigned. */
79
+ verification?: {
80
+ verified: boolean;
81
+ reason: string;
82
+ signer?: string;
83
+ };
77
84
  }
78
85
  interface FileChange {
79
86
  status: string;
@@ -200,6 +207,19 @@ interface Ref {
200
207
  merged: boolean;
201
208
  canDelete: boolean;
202
209
  }
210
+ /** One file a code search found, with its matching lines (DEV-11). */
211
+ interface CodeHit {
212
+ repoId: string;
213
+ repo: string;
214
+ projectKey: string;
215
+ path: string;
216
+ nameMatch?: boolean;
217
+ lines: {
218
+ number: number;
219
+ text: string;
220
+ ranges: [number, number][] | null;
221
+ }[];
222
+ }
203
223
  /** A repository collaborator (DEV-06): access beyond the project role, for one repository. */
204
224
  interface Collaborator {
205
225
  repoId: string;
@@ -257,6 +277,10 @@ interface Protection {
257
277
  dismissStaleApprovals: boolean;
258
278
  requireUpToDate: boolean;
259
279
  requireCodeOwnerReview?: boolean;
280
+ requireSignedCommits?: boolean;
281
+ requireLinearHistory?: boolean;
282
+ /** Roles that may bypass the rule: owner, admin, maintainer. */
283
+ bypass?: string[];
260
284
  requiredChecks: string[];
261
285
  }
262
286
  interface PullBrief {
@@ -454,6 +478,11 @@ declare class CodeApi {
454
478
  }): Observable<FileDiff>;
455
479
  compare(project: string, name: string, base: string, head: string): Observable<Comparison>;
456
480
  refs(project: string, name: string, kind?: 'branch' | 'tag', q?: string): Observable<Ref[]>;
481
+ /** Searches the repository's default branch (text, or a regular expression). */
482
+ searchCode(project: string, name: string, q: string, regex?: boolean): Observable<{
483
+ hits: CodeHit[];
484
+ repos: number;
485
+ }>;
457
486
  collaborators(project: string, name: string): Observable<Collaborator[]>;
458
487
  setCollaborator(project: string, name: string, userId: string, permission: string): Observable<Collaborator>;
459
488
  removeCollaborator(project: string, name: string, userId: string): Observable<unknown>;
@@ -556,6 +585,8 @@ declare class CurrentRepo {
556
585
  * component's encapsulation, hence ::ng-deep.
557
586
  */
558
587
  declare const TOKEN_CSS = "\n :host ::ng-deep [class^=\"tk-k\"]{color:var(--o-tk-k)}\n :host ::ng-deep [class^=\"tk-s\"], :host ::ng-deep [class^=\"tk-l\"]{color:var(--o-tk-s)}\n :host ::ng-deep [class^=\"tk-c\"]{color:var(--o-tk-c);font-style:italic}\n :host ::ng-deep [class^=\"tk-m\"]{color:var(--o-tk-n)}\n :host ::ng-deep .tk-nf, :host ::ng-deep .tk-nx, :host ::ng-deep .tk-fm{color:var(--o-tk-f)}\n :host ::ng-deep .tk-nb, :host ::ng-deep .tk-nt, :host ::ng-deep .tk-bp{color:var(--o-tk-p)}\n :host ::ng-deep .tk-gi{color:var(--o-add)} :host ::ng-deep .tk-gd{color:var(--o-bad-tx)}\n";
588
+ /** Why a signed commit is not verified (DEV-31). */
589
+ declare function verifyWhy(reason: string): string;
559
590
 
560
591
  /**
561
592
  * What every page under /code/:repo shares: the project, the repository named in the URL (loaded
@@ -572,6 +603,7 @@ declare abstract class RepoPage {
572
603
  protected readonly error: _angular_core.WritableSignal<string>;
573
604
  protected readonly note: _angular_core.WritableSignal<string>;
574
605
  protected readonly people: _angular_core.Signal<People>;
606
+ protected readonly verifyWhy: typeof verifyWhy;
575
607
  protected readonly canWrite: _angular_core.Signal<boolean>;
576
608
  protected readonly canAdmin: _angular_core.Signal<boolean>;
577
609
  /** Repository settings short of a rename, the visibility and deletion: Maintainers, and maintain collaborators. */
@@ -761,6 +793,8 @@ declare class RepoHomePage extends RepoPage {
761
793
  protected readonly proto: _angular_core.WritableSignal<"https" | "ssh">;
762
794
  protected readonly cloneOpen: _angular_core.WritableSignal<boolean>;
763
795
  protected readonly addOpen: _angular_core.WritableSignal<boolean>;
796
+ protected codeQuery: string;
797
+ protected searchCode(): void;
764
798
  protected readonly copied: _angular_core.WritableSignal<boolean>;
765
799
  protected readonly finding: _angular_core.WritableSignal<boolean>;
766
800
  protected readonly fq: _angular_core.WritableSignal<string>;
@@ -815,6 +849,7 @@ declare class CommitBox {
815
849
  protected readonly toNew: _angular_core.WritableSignal<boolean>;
816
850
  protected readonly newBranch: _angular_core.WritableSignal<string>;
817
851
  private readonly rules;
852
+ /** Direct commits are refused: the rules block direct pushes, or require signed commits (a browser commit is unsigned). */
818
853
  protected readonly blocked: _angular_core.Signal<boolean>;
819
854
  constructor();
820
855
  protected send(): void;
@@ -1087,6 +1122,9 @@ interface RuleForm {
1087
1122
  dismissStaleApprovals: boolean;
1088
1123
  requireUpToDate: boolean;
1089
1124
  requireCodeOwnerReview: boolean;
1125
+ requireSignedCommits: boolean;
1126
+ requireLinearHistory: boolean;
1127
+ bypass: string[];
1090
1128
  requiredChecks: string[];
1091
1129
  }
1092
1130
  declare class RepoSettingsPage extends RepoPage {
@@ -1112,10 +1150,14 @@ declare class RepoSettingsPage extends RepoPage {
1112
1150
  label: string;
1113
1151
  }[];
1114
1152
  protected readonly toggles: {
1115
- key: 'blockDirectPush' | 'blockForcePush' | 'blockDeletion' | 'dismissStaleApprovals' | 'requireUpToDate' | 'requireCodeOwnerReview';
1153
+ key: 'blockDirectPush' | 'blockForcePush' | 'blockDeletion' | 'dismissStaleApprovals' | 'requireUpToDate' | 'requireCodeOwnerReview' | 'requireSignedCommits' | 'requireLinearHistory';
1116
1154
  label: string;
1117
1155
  hint: string;
1118
1156
  }[];
1157
+ protected readonly bypassRoles: {
1158
+ id: string;
1159
+ label: string;
1160
+ }[];
1119
1161
  constructor();
1120
1162
  protected readonly collabs: _angular_core.WritableSignal<Collaborator[]>;
1121
1163
  protected readonly perms: {
@@ -1135,6 +1177,7 @@ declare class RepoSettingsPage extends RepoPage {
1135
1177
  protected flipMethod(id: string): void;
1136
1178
  protected summary(p: Protection): string;
1137
1179
  protected edit(p: Protection | null): void;
1180
+ protected flipBypass(f: RuleForm, role: string): void;
1138
1181
  protected flip(f: RuleForm, k: (typeof this.toggles)[number]['key']): void;
1139
1182
  protected addCheck(f: RuleForm): void;
1140
1183
  protected removeCheck(f: RuleForm, c: string): void;
@@ -1221,5 +1264,25 @@ declare class NewFilePage extends RepoPage {
1221
1264
  static ɵcmp: _angular_core.ɵɵComponentDeclaration<NewFilePage, "o-code-new-file", never, {}, {}, never, never, true, never>;
1222
1265
  }
1223
1266
 
1224
- 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 };
1225
- 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 };
1267
+ interface Piece {
1268
+ text: string;
1269
+ hit: boolean;
1270
+ }
1271
+ declare class CodeSearchPage extends RepoPage {
1272
+ private readonly router;
1273
+ protected readonly hits: _angular_core.WritableSignal<CodeHit[]>;
1274
+ protected readonly searched: _angular_core.WritableSignal<boolean>;
1275
+ protected text: string;
1276
+ protected regex: boolean;
1277
+ constructor();
1278
+ protected onRepo(r: Repo): void;
1279
+ protected go(): void;
1280
+ private load;
1281
+ /** A line cut into plain and matched pieces (ranges are byte offsets; the text is UTF-8). */
1282
+ protected pieces(text: string, ranges: [number, number][] | null): Piece[];
1283
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<CodeSearchPage, never>;
1284
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<CodeSearchPage, "o-code-search", never, {}, {}, never, never, true, never>;
1285
+ }
1286
+
1287
+ 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 };
1288
+ export type { BlameHunk, Blob, CheckStatus, CodeHit, 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 };