@foss.global/interfaces 0.4.0 → 0.6.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 +18 -0
- package/dist_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/data/runner.d.ts +71 -1
- package/dist_ts/requests/public.d.ts +48 -0
- package/package.json +1 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/data/runner.ts +79 -1
- package/ts/requests/public.ts +68 -0
package/changelog.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 2026-07-21 - 0.6.0
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
- add repository CI artifact contracts (ci-artifacts)
|
|
8
|
+
- Add runner job artifact specification types and optional artifact definitions on job specs
|
|
9
|
+
- Expose artifact upload and repository artifact list view interfaces
|
|
10
|
+
- Add repositoryCiArtifacts typed request contract
|
|
11
|
+
|
|
12
|
+
## 2026-07-21 - 0.5.0
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
- add repository CI status and run request contracts (repository-ci)
|
|
17
|
+
- Add repository CI run, commit status, and run log view interfaces.
|
|
18
|
+
- Add public typed request contracts for CI status, run logs, and run cancellation.
|
|
19
|
+
- Add test coverage for exported repository CI interfaces and request types.
|
|
20
|
+
|
|
3
21
|
## 2026-07-20 - 0.4.0
|
|
4
22
|
|
|
5
23
|
### Features
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@foss.global/interfaces',
|
|
6
|
-
version: '0.
|
|
6
|
+
version: '0.6.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=
|
package/dist_ts/data/runner.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export type TRunnerProtocolVersion = typeof runnerProtocolVersion;
|
|
|
3
3
|
export type TOciRuntime = 'docker' | 'podman';
|
|
4
4
|
export type TJobNetwork = 'none' | 'bridge';
|
|
5
5
|
export type TLogStream = 'stdout' | 'stderr' | 'runner';
|
|
6
|
+
export type TJobArtifactWhen = 'always' | 'success' | 'failure';
|
|
6
7
|
export type TJobCompletionStatus = 'succeeded' | 'failed' | 'canceled' | 'timed_out' | 'system_error';
|
|
7
8
|
export type TCiJobState = 'queued' | 'running' | TJobCompletionStatus;
|
|
8
9
|
export interface IRunnerCredential {
|
|
@@ -15,7 +16,7 @@ export interface IRunnerCapabilities {
|
|
|
15
16
|
runtime: TOciRuntime;
|
|
16
17
|
networks: TJobNetwork[];
|
|
17
18
|
sourceArchives: ['tar.gz'];
|
|
18
|
-
artifacts:
|
|
19
|
+
artifacts: boolean;
|
|
19
20
|
caches: false;
|
|
20
21
|
serviceContainers: false;
|
|
21
22
|
}
|
|
@@ -63,6 +64,13 @@ export interface IJobSourceArchive {
|
|
|
63
64
|
url: string;
|
|
64
65
|
sha256: string;
|
|
65
66
|
}
|
|
67
|
+
export interface IJobArtifactSpec {
|
|
68
|
+
name: string;
|
|
69
|
+
path: string;
|
|
70
|
+
when?: TJobArtifactWhen;
|
|
71
|
+
required?: boolean;
|
|
72
|
+
retentionDays?: number;
|
|
73
|
+
}
|
|
66
74
|
export interface IJobSpec {
|
|
67
75
|
image: string;
|
|
68
76
|
command: string[];
|
|
@@ -72,6 +80,7 @@ export interface IJobSpec {
|
|
|
72
80
|
timeoutMs?: number;
|
|
73
81
|
resources?: IJobResources;
|
|
74
82
|
source?: IJobSourceArchive;
|
|
83
|
+
artifacts?: IJobArtifactSpec[];
|
|
75
84
|
}
|
|
76
85
|
export interface IJobLease {
|
|
77
86
|
jobId: string;
|
|
@@ -115,6 +124,17 @@ export interface ILogAcknowledgement {
|
|
|
115
124
|
serverTime: string;
|
|
116
125
|
nextSequence: number;
|
|
117
126
|
}
|
|
127
|
+
export interface ICiArtifactUploadResponse {
|
|
128
|
+
artifactId: string;
|
|
129
|
+
jobId: string;
|
|
130
|
+
attemptId: string;
|
|
131
|
+
name: string;
|
|
132
|
+
sha256: string;
|
|
133
|
+
sizeBytes: number;
|
|
134
|
+
contentType: string;
|
|
135
|
+
createdAt: string;
|
|
136
|
+
expiresAt: string;
|
|
137
|
+
}
|
|
118
138
|
export interface ICompleteJobRequest extends IJobMutationIdentity {
|
|
119
139
|
status: TJobCompletionStatus;
|
|
120
140
|
exitCode: number | null;
|
|
@@ -187,3 +207,53 @@ export interface ICiSetRunnerDrainResponse {
|
|
|
187
207
|
runnerId: string;
|
|
188
208
|
drainRequested: boolean;
|
|
189
209
|
}
|
|
210
|
+
export type TRepositoryCiTrigger = 'push' | 'manual';
|
|
211
|
+
export type TRepositoryCiRunState = 'dispatching' | TCiJobState;
|
|
212
|
+
export type TRepositoryCiCommitState = 'not_run' | TRepositoryCiRunState;
|
|
213
|
+
export interface IRepositoryCiRunStatus {
|
|
214
|
+
dispatchId: string;
|
|
215
|
+
trigger: TRepositoryCiTrigger;
|
|
216
|
+
refName: string;
|
|
217
|
+
objectId: string;
|
|
218
|
+
workflowRevision: number;
|
|
219
|
+
state: TRepositoryCiRunState;
|
|
220
|
+
jobId: string | null;
|
|
221
|
+
attemptNumber?: number;
|
|
222
|
+
cancelRequested?: boolean;
|
|
223
|
+
createdAt: string;
|
|
224
|
+
updatedAt: string;
|
|
225
|
+
startedAt?: string;
|
|
226
|
+
completedAt?: string;
|
|
227
|
+
exitCode?: number | null;
|
|
228
|
+
failureReason?: string;
|
|
229
|
+
}
|
|
230
|
+
export interface IRepositoryCiCommitStatus {
|
|
231
|
+
org: string;
|
|
232
|
+
repo: string;
|
|
233
|
+
objectId: string;
|
|
234
|
+
state: TRepositoryCiCommitState;
|
|
235
|
+
totalRuns: number;
|
|
236
|
+
counts: Partial<Record<TRepositoryCiRunState, number>>;
|
|
237
|
+
latestRun: IRepositoryCiRunStatus | null;
|
|
238
|
+
runs: IRepositoryCiRunStatus[];
|
|
239
|
+
}
|
|
240
|
+
export interface IRepositoryCiRunLogView {
|
|
241
|
+
run: IRepositoryCiRunStatus;
|
|
242
|
+
logs: ICiLogPage;
|
|
243
|
+
}
|
|
244
|
+
export interface IRepositoryCiArtifact {
|
|
245
|
+
artifactId: string;
|
|
246
|
+
dispatchId: string;
|
|
247
|
+
jobId: string;
|
|
248
|
+
attemptId: string;
|
|
249
|
+
name: string;
|
|
250
|
+
sha256: string;
|
|
251
|
+
sizeBytes: number;
|
|
252
|
+
contentType: string;
|
|
253
|
+
createdAt: string;
|
|
254
|
+
expiresAt: string;
|
|
255
|
+
}
|
|
256
|
+
export interface IRepositoryCiArtifactListView {
|
|
257
|
+
run: IRepositoryCiRunStatus;
|
|
258
|
+
artifacts: IRepositoryCiArtifact[];
|
|
259
|
+
}
|
|
@@ -83,3 +83,51 @@ export interface IReq_PublicCommits extends plugins.typedrequestInterfaces.imple
|
|
|
83
83
|
selectedCommit: data.IPublicCommitDetail | null;
|
|
84
84
|
};
|
|
85
85
|
}
|
|
86
|
+
export interface IReq_RepositoryCiStatus extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryCiStatus> {
|
|
87
|
+
method: 'repositoryCiStatus';
|
|
88
|
+
request: {
|
|
89
|
+
org: string;
|
|
90
|
+
repo: string;
|
|
91
|
+
objectId: string;
|
|
92
|
+
accessToken?: string;
|
|
93
|
+
};
|
|
94
|
+
response: {
|
|
95
|
+
available: boolean;
|
|
96
|
+
status: data.IRepositoryCiCommitStatus | null;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface IReq_RepositoryCiRunLogs extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryCiRunLogs> {
|
|
100
|
+
method: 'repositoryCiRunLogs';
|
|
101
|
+
request: {
|
|
102
|
+
org: string;
|
|
103
|
+
repo: string;
|
|
104
|
+
dispatchId: string;
|
|
105
|
+
accessToken: string;
|
|
106
|
+
attemptId?: string;
|
|
107
|
+
fromSequence?: number;
|
|
108
|
+
limit?: number;
|
|
109
|
+
};
|
|
110
|
+
response: data.IRepositoryCiRunLogView;
|
|
111
|
+
}
|
|
112
|
+
export interface IReq_RepositoryCiCancelRun extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryCiCancelRun> {
|
|
113
|
+
method: 'repositoryCiCancelRun';
|
|
114
|
+
request: {
|
|
115
|
+
org: string;
|
|
116
|
+
repo: string;
|
|
117
|
+
dispatchId: string;
|
|
118
|
+
accessToken: string;
|
|
119
|
+
};
|
|
120
|
+
response: {
|
|
121
|
+
run: data.IRepositoryCiRunStatus;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export interface IReq_RepositoryCiArtifacts extends plugins.typedrequestInterfaces.implementsTR<plugins.typedrequestInterfaces.ITypedRequest, IReq_RepositoryCiArtifacts> {
|
|
125
|
+
method: 'repositoryCiArtifacts';
|
|
126
|
+
request: {
|
|
127
|
+
org: string;
|
|
128
|
+
repo: string;
|
|
129
|
+
dispatchId: string;
|
|
130
|
+
accessToken: string;
|
|
131
|
+
};
|
|
132
|
+
response: data.IRepositoryCiArtifactListView;
|
|
133
|
+
}
|
package/package.json
CHANGED
package/ts/00_commitinfo_data.ts
CHANGED
package/ts/data/runner.ts
CHANGED
|
@@ -4,6 +4,7 @@ export type TRunnerProtocolVersion = typeof runnerProtocolVersion;
|
|
|
4
4
|
export type TOciRuntime = 'docker' | 'podman';
|
|
5
5
|
export type TJobNetwork = 'none' | 'bridge';
|
|
6
6
|
export type TLogStream = 'stdout' | 'stderr' | 'runner';
|
|
7
|
+
export type TJobArtifactWhen = 'always' | 'success' | 'failure';
|
|
7
8
|
export type TJobCompletionStatus =
|
|
8
9
|
| 'succeeded'
|
|
9
10
|
| 'failed'
|
|
@@ -23,7 +24,7 @@ export interface IRunnerCapabilities {
|
|
|
23
24
|
runtime: TOciRuntime;
|
|
24
25
|
networks: TJobNetwork[];
|
|
25
26
|
sourceArchives: ['tar.gz'];
|
|
26
|
-
artifacts:
|
|
27
|
+
artifacts: boolean;
|
|
27
28
|
caches: false;
|
|
28
29
|
serviceContainers: false;
|
|
29
30
|
}
|
|
@@ -80,6 +81,14 @@ export interface IJobSourceArchive {
|
|
|
80
81
|
sha256: string;
|
|
81
82
|
}
|
|
82
83
|
|
|
84
|
+
export interface IJobArtifactSpec {
|
|
85
|
+
name: string;
|
|
86
|
+
path: string;
|
|
87
|
+
when?: TJobArtifactWhen;
|
|
88
|
+
required?: boolean;
|
|
89
|
+
retentionDays?: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
83
92
|
export interface IJobSpec {
|
|
84
93
|
image: string;
|
|
85
94
|
command: string[];
|
|
@@ -89,6 +98,7 @@ export interface IJobSpec {
|
|
|
89
98
|
timeoutMs?: number;
|
|
90
99
|
resources?: IJobResources;
|
|
91
100
|
source?: IJobSourceArchive;
|
|
101
|
+
artifacts?: IJobArtifactSpec[];
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
export interface IJobLease {
|
|
@@ -140,6 +150,18 @@ export interface ILogAcknowledgement {
|
|
|
140
150
|
nextSequence: number;
|
|
141
151
|
}
|
|
142
152
|
|
|
153
|
+
export interface ICiArtifactUploadResponse {
|
|
154
|
+
artifactId: string;
|
|
155
|
+
jobId: string;
|
|
156
|
+
attemptId: string;
|
|
157
|
+
name: string;
|
|
158
|
+
sha256: string;
|
|
159
|
+
sizeBytes: number;
|
|
160
|
+
contentType: string;
|
|
161
|
+
createdAt: string;
|
|
162
|
+
expiresAt: string;
|
|
163
|
+
}
|
|
164
|
+
|
|
143
165
|
export interface ICompleteJobRequest extends IJobMutationIdentity {
|
|
144
166
|
status: TJobCompletionStatus;
|
|
145
167
|
exitCode: number | null;
|
|
@@ -223,3 +245,59 @@ export interface ICiSetRunnerDrainResponse {
|
|
|
223
245
|
runnerId: string;
|
|
224
246
|
drainRequested: boolean;
|
|
225
247
|
}
|
|
248
|
+
|
|
249
|
+
export type TRepositoryCiTrigger = 'push' | 'manual';
|
|
250
|
+
export type TRepositoryCiRunState = 'dispatching' | TCiJobState;
|
|
251
|
+
export type TRepositoryCiCommitState = 'not_run' | TRepositoryCiRunState;
|
|
252
|
+
|
|
253
|
+
export interface IRepositoryCiRunStatus {
|
|
254
|
+
dispatchId: string;
|
|
255
|
+
trigger: TRepositoryCiTrigger;
|
|
256
|
+
refName: string;
|
|
257
|
+
objectId: string;
|
|
258
|
+
workflowRevision: number;
|
|
259
|
+
state: TRepositoryCiRunState;
|
|
260
|
+
jobId: string | null;
|
|
261
|
+
attemptNumber?: number;
|
|
262
|
+
cancelRequested?: boolean;
|
|
263
|
+
createdAt: string;
|
|
264
|
+
updatedAt: string;
|
|
265
|
+
startedAt?: string;
|
|
266
|
+
completedAt?: string;
|
|
267
|
+
exitCode?: number | null;
|
|
268
|
+
failureReason?: string;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
export interface IRepositoryCiCommitStatus {
|
|
272
|
+
org: string;
|
|
273
|
+
repo: string;
|
|
274
|
+
objectId: string;
|
|
275
|
+
state: TRepositoryCiCommitState;
|
|
276
|
+
totalRuns: number;
|
|
277
|
+
counts: Partial<Record<TRepositoryCiRunState, number>>;
|
|
278
|
+
latestRun: IRepositoryCiRunStatus | null;
|
|
279
|
+
runs: IRepositoryCiRunStatus[];
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface IRepositoryCiRunLogView {
|
|
283
|
+
run: IRepositoryCiRunStatus;
|
|
284
|
+
logs: ICiLogPage;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
export interface IRepositoryCiArtifact {
|
|
288
|
+
artifactId: string;
|
|
289
|
+
dispatchId: string;
|
|
290
|
+
jobId: string;
|
|
291
|
+
attemptId: string;
|
|
292
|
+
name: string;
|
|
293
|
+
sha256: string;
|
|
294
|
+
sizeBytes: number;
|
|
295
|
+
contentType: string;
|
|
296
|
+
createdAt: string;
|
|
297
|
+
expiresAt: string;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
export interface IRepositoryCiArtifactListView {
|
|
301
|
+
run: IRepositoryCiRunStatus;
|
|
302
|
+
artifacts: IRepositoryCiArtifact[];
|
|
303
|
+
}
|
package/ts/requests/public.ts
CHANGED
|
@@ -113,3 +113,71 @@ export interface IReq_PublicCommits
|
|
|
113
113
|
selectedCommit: data.IPublicCommitDetail | null;
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
|
+
|
|
117
|
+
export interface IReq_RepositoryCiStatus
|
|
118
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
119
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
120
|
+
IReq_RepositoryCiStatus
|
|
121
|
+
> {
|
|
122
|
+
method: 'repositoryCiStatus';
|
|
123
|
+
request: {
|
|
124
|
+
org: string;
|
|
125
|
+
repo: string;
|
|
126
|
+
objectId: string;
|
|
127
|
+
accessToken?: string;
|
|
128
|
+
};
|
|
129
|
+
response: {
|
|
130
|
+
available: boolean;
|
|
131
|
+
status: data.IRepositoryCiCommitStatus | null;
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export interface IReq_RepositoryCiRunLogs
|
|
136
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
137
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
138
|
+
IReq_RepositoryCiRunLogs
|
|
139
|
+
> {
|
|
140
|
+
method: 'repositoryCiRunLogs';
|
|
141
|
+
request: {
|
|
142
|
+
org: string;
|
|
143
|
+
repo: string;
|
|
144
|
+
dispatchId: string;
|
|
145
|
+
accessToken: string;
|
|
146
|
+
attemptId?: string;
|
|
147
|
+
fromSequence?: number;
|
|
148
|
+
limit?: number;
|
|
149
|
+
};
|
|
150
|
+
response: data.IRepositoryCiRunLogView;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export interface IReq_RepositoryCiCancelRun
|
|
154
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
155
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
156
|
+
IReq_RepositoryCiCancelRun
|
|
157
|
+
> {
|
|
158
|
+
method: 'repositoryCiCancelRun';
|
|
159
|
+
request: {
|
|
160
|
+
org: string;
|
|
161
|
+
repo: string;
|
|
162
|
+
dispatchId: string;
|
|
163
|
+
accessToken: string;
|
|
164
|
+
};
|
|
165
|
+
response: {
|
|
166
|
+
run: data.IRepositoryCiRunStatus;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface IReq_RepositoryCiArtifacts
|
|
171
|
+
extends plugins.typedrequestInterfaces.implementsTR<
|
|
172
|
+
plugins.typedrequestInterfaces.ITypedRequest,
|
|
173
|
+
IReq_RepositoryCiArtifacts
|
|
174
|
+
> {
|
|
175
|
+
method: 'repositoryCiArtifacts';
|
|
176
|
+
request: {
|
|
177
|
+
org: string;
|
|
178
|
+
repo: string;
|
|
179
|
+
dispatchId: string;
|
|
180
|
+
accessToken: string;
|
|
181
|
+
};
|
|
182
|
+
response: data.IRepositoryCiArtifactListView;
|
|
183
|
+
}
|