@foss.global/interfaces 1.1.0 → 2.0.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/changelog.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## 2026-10-13 - 2.0.0
4
+
5
+ ### Features
6
+
7
+ - add GitManager remote transfer options and the repository size contract (gitmanager)
8
+ - `IGitManagerRemoteTransferOptions` on `IGitManagerImportMirrorRequest` and the new `IGitManagerRefreshMirrorRequest`: an HTTP Basic `credential` carried outside the URL, command line and Git config, `caCertificates` for a private CA, and a `timeoutMs` up to six hours.
9
+ - `IGitManagerRepositorySize`: object count, uncompressed object bytes and object database storage bytes.
10
+
11
+ ### Breaking Changes
12
+
13
+ - measure Git objects and LFS presence in the forge source inventory (data)
14
+ - `IForgeSourceGitCounts` gains the required measures `objects` and `objectBytes`, and `IForgeSourceLfsCounts` gains `missingObjects`; producers must fill them. LFS `objects` and `bytes` now count only the referenced objects the forge holds.
15
+
16
+ ### Maintenance
17
+
18
+ - update release tooling: pnpm 12.10.1 (deps)
19
+
3
20
  ## 2026-10-13 - 1.1.0
4
21
 
5
22
  ### Features
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@foss.global/interfaces',
6
- version: '1.1.0',
6
+ version: '2.0.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the foss.global Git platform ecosystem.'
8
8
  };
9
9
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiMDBfY29tbWl0aW5mb19kYXRhLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvMDBfY29tbWl0aW5mb19kYXRhLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sVUFBVSxHQUFHO0lBQ3hCLElBQUksRUFBRSx5QkFBeUI7SUFDL0IsT0FBTyxFQUFFLE9BQU87SUFDaEIsV0FBVyxFQUFFLHFHQUFxRztDQUNuSCxDQUFBIn0=
@@ -118,6 +118,10 @@ export interface IForgeSourceOwnerTotals {
118
118
  sshKeys: TForgeSourceMeasure;
119
119
  gpgKeys: TForgeSourceMeasure;
120
120
  }
121
+ /**
122
+ * Ref and object counts read at the Git level, from a mirror clone of every
123
+ * ref the forge advertises, except `reportedSizeKiB`.
124
+ */
121
125
  export interface IForgeSourceGitCounts {
122
126
  /** As reported by the forge, in KiB; not a transfer size. */
123
127
  reportedSizeKiB: TForgeSourceMeasure;
@@ -126,10 +130,22 @@ export interface IForgeSourceGitCounts {
126
130
  /** Hidden refs that preserve pull request heads. */
127
131
  pullRequestRefs: TForgeSourceMeasure;
128
132
  otherRefs: TForgeSourceMeasure;
133
+ /** Distinct Git objects reachable from those refs. */
134
+ objects: TForgeSourceMeasure;
135
+ /** Sum of the uncompressed sizes of those objects; independent of how the forge packs them. */
136
+ objectBytes: TForgeSourceMeasure;
129
137
  }
138
+ /**
139
+ * LFS objects that pointers in any reachable revision reference, by distinct
140
+ * object ID, checked for presence through the forge's LFS batch API.
141
+ */
130
142
  export interface IForgeSourceLfsCounts {
143
+ /** Referenced objects the forge holds. */
131
144
  objects: TForgeSourceMeasure;
145
+ /** Sizes of the objects the forge holds. */
132
146
  bytes: TForgeSourceMeasure;
147
+ /** Referenced objects the forge does not hold; they cannot be migrated. */
148
+ missingObjects: TForgeSourceMeasure;
133
149
  }
134
150
  export interface IForgeSourceCollaborationCounts {
135
151
  issues: TForgeSourceMeasure;
@@ -14,9 +14,65 @@ export interface IGitManagerRepositoryInfo extends IGitManagerRepositorySelector
14
14
  export interface IGitManagerInitBareRepositoryRequest extends IGitManagerRepositorySelector {
15
15
  defaultBranch?: string;
16
16
  }
17
- export interface IGitManagerImportMirrorRequest extends IGitManagerRepositorySelector {
17
+ /**
18
+ * HTTP Basic credentials for a remote Git transfer, such as a forge user name
19
+ * with an access token as the password. Neither part may contain control
20
+ * characters, and the user name may not contain `:`.
21
+ */
22
+ export interface IGitManagerRemoteBasicCredential {
23
+ kind: 'basic';
24
+ username: string;
25
+ password: string;
26
+ }
27
+ export type TGitManagerRemoteCredential = IGitManagerRemoteBasicCredential;
28
+ /**
29
+ * Options for one transfer from a remote repository.
30
+ *
31
+ * A credential reaches Git only through the Git process environment, as an
32
+ * `Authorization` header. It never appears in the remote URL, on a command
33
+ * line, in the repository's Git config, or in an error. A credential requires
34
+ * an `https` remote URL without user information, and Git does not follow
35
+ * HTTP redirects while it carries one.
36
+ */
37
+ export interface IGitManagerRemoteTransferOptions {
38
+ credential?: TGitManagerRemoteCredential;
39
+ /**
40
+ * PEM certificates that Git uses as its CA bundle for this transfer, in
41
+ * place of the default bundle file, for a remote behind a private CA.
42
+ */
43
+ caCertificates?: string[];
44
+ /** Wall-clock limit for the transfer in milliseconds; defaults to 120000, at most 21600000 (six hours). */
45
+ timeoutMs?: number;
46
+ }
47
+ /**
48
+ * Clones every ref of a remote into a new mirror repository. The stored
49
+ * `remote.origin.url` is `remoteUrl`, so it must never carry credentials;
50
+ * pass them as `credential`.
51
+ */
52
+ export interface IGitManagerImportMirrorRequest extends IGitManagerRepositorySelector, IGitManagerRemoteTransferOptions {
18
53
  remoteUrl: string;
19
54
  }
55
+ /** Fetches every ref of an imported mirror's remote again, pruning refs the remote no longer has. */
56
+ export interface IGitManagerRefreshMirrorRequest extends IGitManagerRepositorySelector, IGitManagerRemoteTransferOptions {
57
+ }
58
+ /**
59
+ * The object database of one repository when it was measured. Objects of
60
+ * alternate object stores are not counted.
61
+ */
62
+ export interface IGitManagerRepositorySize extends IGitManagerRepositorySelector {
63
+ /** Distinct commits, trees, blobs and annotated tags, reachable or not. */
64
+ objectCount: number;
65
+ /**
66
+ * Sum of the uncompressed sizes of those objects. It does not depend on
67
+ * how the objects are packed, so equal object sets give equal values.
68
+ */
69
+ objectBytes: number;
70
+ /**
71
+ * Bytes of every file in the object database: loose objects, packs, their
72
+ * indexes and other pack metadata. It depends on packing.
73
+ */
74
+ storageBytes: number;
75
+ }
20
76
  /**
21
77
  * One page request of a repository's complete ref inventory.
22
78
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@foss.global/interfaces",
3
- "version": "1.1.0",
3
+ "version": "2.0.0",
4
4
  "private": false,
5
5
  "description": "Shared TypeScript interfaces and TypedRequest contracts for the foss.global Git platform ecosystem.",
6
6
  "exports": {
package/readme.md CHANGED
@@ -153,6 +153,24 @@ instead of a page that would mix two states; the caller restarts without a
153
153
  cursor. A cursor is a transport continuation, not a durable replication
154
154
  checkpoint.
155
155
 
156
+ ### GitManager remote transfer and size contracts
157
+
158
+ `IGitManagerImportMirrorRequest` and `IGitManagerRefreshMirrorRequest` take
159
+ `IGitManagerRemoteTransferOptions`: an optional `credential`
160
+ (`TGitManagerRemoteCredential`, HTTP Basic), optional `caCertificates` (PEM,
161
+ used as Git's CA bundle for that transfer) and an optional `timeoutMs`
162
+ (default 120000, at most 21600000). A credential reaches Git only through the
163
+ Git process environment as an `Authorization` header, so it never appears in
164
+ the remote URL, on a command line, in the repository's Git config, or in an
165
+ error. It requires an `https` remote without user information, and Git does
166
+ not follow redirects while it carries one. A refresh reuses the mirror's stored
167
+ remote URL.
168
+
169
+ `IGitManagerRepositorySize` measures a repository's object database:
170
+ `objectCount` distinct objects, `objectBytes` (their uncompressed sizes, which
171
+ do not depend on packing) and `storageBytes` (every file of the object
172
+ database, which does).
173
+
156
174
  ### Forge inventory contracts
157
175
 
158
176
  `IForgeInventoryReport`, `IForgeInventoryPage<TItem>`, `IForgeInventoryNamespace`,
@@ -194,7 +212,7 @@ import fidelity, checksummed manifests, or durable recovery checkpoints.
194
212
  `IForgeSourceInventoryReport` is the authenticated, read-only measurement of a
195
213
  source forge before its one-time migration, read with a site administrator's
196
214
  token. It counts users, organizations, teams, memberships, keys, packages by
197
- type, and per repository the Git refs, LFS objects, issues, pull requests,
215
+ type, and per repository the Git refs and objects, LFS objects, issues, pull requests,
198
216
  comments, reviews, reactions, attachments, releases (drafts included) with
199
217
  asset bytes, wiki pages, access settings, webhooks, push mirrors, Actions
200
218
  settings, and the Actions runs and artifacts that are archived rather than
@@ -209,6 +227,13 @@ administrator read and that is reissued rather than migrated, such as Gitea's
209
227
  user-scoped Actions secrets; everything readable is a measure instead.
210
228
  Reasons are sanitized text, never raw response bodies or URLs.
211
229
 
230
+ Git counts other than the forge-reported size, and LFS counts, are read at the
231
+ Git level from a mirror clone of every advertised ref: refs by namespace,
232
+ distinct objects and their uncompressed bytes, and the LFS objects that
233
+ pointers in any reachable revision reference. LFS objects are checked through
234
+ the forge's LFS batch API and split into held objects with their bytes and
235
+ `missingObjects`, which cannot be migrated.
236
+
212
237
  Owners are a `TForgeSourceOwnerInventory` union: an organization carries its
213
238
  members, teams, team memberships and repository grants, labels and Actions
214
239
  secret count; a user carries its account flags and SSH and GPG key counts.
@@ -3,6 +3,6 @@
3
3
  */
4
4
  export const commitinfo = {
5
5
  name: '@foss.global/interfaces',
6
- version: '1.1.0',
6
+ version: '2.0.0',
7
7
  description: 'Shared TypeScript interfaces and TypedRequest contracts for the foss.global Git platform ecosystem.'
8
8
  }
@@ -126,6 +126,10 @@ export interface IForgeSourceOwnerTotals {
126
126
  gpgKeys: TForgeSourceMeasure;
127
127
  }
128
128
 
129
+ /**
130
+ * Ref and object counts read at the Git level, from a mirror clone of every
131
+ * ref the forge advertises, except `reportedSizeKiB`.
132
+ */
129
133
  export interface IForgeSourceGitCounts {
130
134
  /** As reported by the forge, in KiB; not a transfer size. */
131
135
  reportedSizeKiB: TForgeSourceMeasure;
@@ -134,11 +138,23 @@ export interface IForgeSourceGitCounts {
134
138
  /** Hidden refs that preserve pull request heads. */
135
139
  pullRequestRefs: TForgeSourceMeasure;
136
140
  otherRefs: TForgeSourceMeasure;
141
+ /** Distinct Git objects reachable from those refs. */
142
+ objects: TForgeSourceMeasure;
143
+ /** Sum of the uncompressed sizes of those objects; independent of how the forge packs them. */
144
+ objectBytes: TForgeSourceMeasure;
137
145
  }
138
146
 
147
+ /**
148
+ * LFS objects that pointers in any reachable revision reference, by distinct
149
+ * object ID, checked for presence through the forge's LFS batch API.
150
+ */
139
151
  export interface IForgeSourceLfsCounts {
152
+ /** Referenced objects the forge holds. */
140
153
  objects: TForgeSourceMeasure;
154
+ /** Sizes of the objects the forge holds. */
141
155
  bytes: TForgeSourceMeasure;
156
+ /** Referenced objects the forge does not hold; they cannot be migrated. */
157
+ missingObjects: TForgeSourceMeasure;
142
158
  }
143
159
 
144
160
  export interface IForgeSourceCollaborationCounts {
@@ -29,10 +29,70 @@ export interface IGitManagerInitBareRepositoryRequest extends IGitManagerReposit
29
29
  defaultBranch?: string;
30
30
  }
31
31
 
32
- export interface IGitManagerImportMirrorRequest extends IGitManagerRepositorySelector {
32
+ /**
33
+ * HTTP Basic credentials for a remote Git transfer, such as a forge user name
34
+ * with an access token as the password. Neither part may contain control
35
+ * characters, and the user name may not contain `:`.
36
+ */
37
+ export interface IGitManagerRemoteBasicCredential {
38
+ kind: 'basic';
39
+ username: string;
40
+ password: string;
41
+ }
42
+
43
+ export type TGitManagerRemoteCredential = IGitManagerRemoteBasicCredential;
44
+
45
+ /**
46
+ * Options for one transfer from a remote repository.
47
+ *
48
+ * A credential reaches Git only through the Git process environment, as an
49
+ * `Authorization` header. It never appears in the remote URL, on a command
50
+ * line, in the repository's Git config, or in an error. A credential requires
51
+ * an `https` remote URL without user information, and Git does not follow
52
+ * HTTP redirects while it carries one.
53
+ */
54
+ export interface IGitManagerRemoteTransferOptions {
55
+ credential?: TGitManagerRemoteCredential;
56
+ /**
57
+ * PEM certificates that Git uses as its CA bundle for this transfer, in
58
+ * place of the default bundle file, for a remote behind a private CA.
59
+ */
60
+ caCertificates?: string[];
61
+ /** Wall-clock limit for the transfer in milliseconds; defaults to 120000, at most 21600000 (six hours). */
62
+ timeoutMs?: number;
63
+ }
64
+
65
+ /**
66
+ * Clones every ref of a remote into a new mirror repository. The stored
67
+ * `remote.origin.url` is `remoteUrl`, so it must never carry credentials;
68
+ * pass them as `credential`.
69
+ */
70
+ export interface IGitManagerImportMirrorRequest extends IGitManagerRepositorySelector, IGitManagerRemoteTransferOptions {
33
71
  remoteUrl: string;
34
72
  }
35
73
 
74
+ /** Fetches every ref of an imported mirror's remote again, pruning refs the remote no longer has. */
75
+ export interface IGitManagerRefreshMirrorRequest extends IGitManagerRepositorySelector, IGitManagerRemoteTransferOptions {}
76
+
77
+ /**
78
+ * The object database of one repository when it was measured. Objects of
79
+ * alternate object stores are not counted.
80
+ */
81
+ export interface IGitManagerRepositorySize extends IGitManagerRepositorySelector {
82
+ /** Distinct commits, trees, blobs and annotated tags, reachable or not. */
83
+ objectCount: number;
84
+ /**
85
+ * Sum of the uncompressed sizes of those objects. It does not depend on
86
+ * how the objects are packed, so equal object sets give equal values.
87
+ */
88
+ objectBytes: number;
89
+ /**
90
+ * Bytes of every file in the object database: loose objects, packs, their
91
+ * indexes and other pack metadata. It depends on packing.
92
+ */
93
+ storageBytes: number;
94
+ }
95
+
36
96
  /**
37
97
  * One page request of a repository's complete ref inventory.
38
98
  *