@opensoftware/contracts 1.6.0 → 1.7.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/README.md +5 -2
- package/dist/formats.js +2 -0
- package/dist/formats.js.map +1 -1
- package/dist/generated/types.d.ts +542 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js.map +1 -1
- package/events/asyncapi.yaml +42 -0
- package/events/issue-labeled/issue-labeled.schema.json +128 -0
- package/events/run-started/run-started.schema.json +139 -0
- package/openapi/openapi.json +789 -2
- package/package.json +2 -2
- package/typespec/events.tsp +47 -0
- package/typespec/foreman-api.tsp +45 -0
- package/typespec/foreman.tsp +84 -0
- package/typespec/intake-api.tsp +40 -0
- package/typespec/intake.tsp +52 -0
- package/typespec/main.tsp +4 -0
package/events/asyncapi.yaml
CHANGED
|
@@ -19,6 +19,12 @@ channels:
|
|
|
19
19
|
messages:
|
|
20
20
|
WorkReceived:
|
|
21
21
|
$ref: '#/components/messages/WorkReceived'
|
|
22
|
+
run-started:
|
|
23
|
+
address: osf.run.started.v1
|
|
24
|
+
description: A run started.
|
|
25
|
+
messages:
|
|
26
|
+
RunStarted:
|
|
27
|
+
$ref: '#/components/messages/RunStarted'
|
|
22
28
|
run-completed:
|
|
23
29
|
address: osf.run.completed.v1
|
|
24
30
|
description: A run ended.
|
|
@@ -61,6 +67,12 @@ channels:
|
|
|
61
67
|
messages:
|
|
62
68
|
PrClosed:
|
|
63
69
|
$ref: '#/components/messages/PrClosed'
|
|
70
|
+
issue-labeled:
|
|
71
|
+
address: osf.issue.labeled.v1
|
|
72
|
+
description: A label was added to an issue.
|
|
73
|
+
messages:
|
|
74
|
+
IssueLabeled:
|
|
75
|
+
$ref: '#/components/messages/IssueLabeled'
|
|
64
76
|
operations:
|
|
65
77
|
publishWorkReceived:
|
|
66
78
|
action: send
|
|
@@ -69,6 +81,13 @@ operations:
|
|
|
69
81
|
$ref: '#/channels/work-received'
|
|
70
82
|
messages:
|
|
71
83
|
- $ref: '#/channels/work-received/messages/WorkReceived'
|
|
84
|
+
publishRunStarted:
|
|
85
|
+
action: send
|
|
86
|
+
summary: Published by foreman.
|
|
87
|
+
channel:
|
|
88
|
+
$ref: '#/channels/run-started'
|
|
89
|
+
messages:
|
|
90
|
+
- $ref: '#/channels/run-started/messages/RunStarted'
|
|
72
91
|
publishRunCompleted:
|
|
73
92
|
action: send
|
|
74
93
|
summary: Published by foreman.
|
|
@@ -118,6 +137,13 @@ operations:
|
|
|
118
137
|
$ref: '#/channels/pr-closed'
|
|
119
138
|
messages:
|
|
120
139
|
- $ref: '#/channels/pr-closed/messages/PrClosed'
|
|
140
|
+
publishIssueLabeled:
|
|
141
|
+
action: send
|
|
142
|
+
summary: Published by forge adapters.
|
|
143
|
+
channel:
|
|
144
|
+
$ref: '#/channels/issue-labeled'
|
|
145
|
+
messages:
|
|
146
|
+
- $ref: '#/channels/issue-labeled/messages/IssueLabeled'
|
|
121
147
|
components:
|
|
122
148
|
messages:
|
|
123
149
|
WorkReceived:
|
|
@@ -128,6 +154,14 @@ components:
|
|
|
128
154
|
schemaFormat: application/schema+json;version=draft-2020-12
|
|
129
155
|
schema:
|
|
130
156
|
$ref: './work-received/work-received.schema.json'
|
|
157
|
+
RunStarted:
|
|
158
|
+
name: run.started@v1
|
|
159
|
+
title: run.started@v1
|
|
160
|
+
contentType: application/cloudevents+json
|
|
161
|
+
payload:
|
|
162
|
+
schemaFormat: application/schema+json;version=draft-2020-12
|
|
163
|
+
schema:
|
|
164
|
+
$ref: './run-started/run-started.schema.json'
|
|
131
165
|
RunCompleted:
|
|
132
166
|
name: run.completed@v1
|
|
133
167
|
title: run.completed@v1
|
|
@@ -184,3 +218,11 @@ components:
|
|
|
184
218
|
schemaFormat: application/schema+json;version=draft-2020-12
|
|
185
219
|
schema:
|
|
186
220
|
$ref: './pr-closed/pr-closed.schema.json'
|
|
221
|
+
IssueLabeled:
|
|
222
|
+
name: issue.labeled@v1
|
|
223
|
+
title: issue.labeled@v1
|
|
224
|
+
contentType: application/cloudevents+json
|
|
225
|
+
payload:
|
|
226
|
+
schemaFormat: application/schema+json;version=draft-2020-12
|
|
227
|
+
schema:
|
|
228
|
+
$ref: './issue-labeled/issue-labeled.schema.json'
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/sesigl/open-software-factory/main/contracts/events/issue-labeled/issue-labeled.schema.json",
|
|
4
|
+
"title": "IssueLabeled",
|
|
5
|
+
"$comment": "Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"specversion": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "1.0"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"maxLength": 128,
|
|
16
|
+
"description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
|
|
17
|
+
},
|
|
18
|
+
"source": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"description": "The producing module, for example \"/osf/intake\"."
|
|
22
|
+
},
|
|
23
|
+
"type": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"const": "issue.labeled@v1"
|
|
26
|
+
},
|
|
27
|
+
"time": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"format": "date-time"
|
|
30
|
+
},
|
|
31
|
+
"subject": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
|
|
34
|
+
},
|
|
35
|
+
"datacontenttype": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"const": "application/json"
|
|
38
|
+
},
|
|
39
|
+
"dataschema": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "uri"
|
|
42
|
+
},
|
|
43
|
+
"traceparent": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "W3C trace context (CloudEvents distributed tracing extension)."
|
|
46
|
+
},
|
|
47
|
+
"data": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"url": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"format": "uri",
|
|
53
|
+
"description": "The issue."
|
|
54
|
+
},
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "string",
|
|
57
|
+
"format": "uri"
|
|
58
|
+
},
|
|
59
|
+
"number": {
|
|
60
|
+
"type": "integer",
|
|
61
|
+
"minimum": 1
|
|
62
|
+
},
|
|
63
|
+
"title": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"minLength": 1
|
|
66
|
+
},
|
|
67
|
+
"body": {
|
|
68
|
+
"type": "string"
|
|
69
|
+
},
|
|
70
|
+
"author": {
|
|
71
|
+
"type": "object",
|
|
72
|
+
"properties": {
|
|
73
|
+
"kind": {
|
|
74
|
+
"type": "string",
|
|
75
|
+
"enum": [
|
|
76
|
+
"person",
|
|
77
|
+
"trigger"
|
|
78
|
+
],
|
|
79
|
+
"description": "Who caused something: a person, or an automated trigger such as a cron rule or an alert."
|
|
80
|
+
},
|
|
81
|
+
"id": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"minLength": 1,
|
|
84
|
+
"description": "Stable ID in the source system, prefixed with the source, for example \"slack:U024BE7LH\"."
|
|
85
|
+
},
|
|
86
|
+
"displayName": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Shown to people, for example \"Varun\"."
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
"required": [
|
|
92
|
+
"kind",
|
|
93
|
+
"id"
|
|
94
|
+
],
|
|
95
|
+
"description": "The person who opened the issue."
|
|
96
|
+
},
|
|
97
|
+
"labels": {
|
|
98
|
+
"type": "array",
|
|
99
|
+
"items": {
|
|
100
|
+
"type": "string"
|
|
101
|
+
},
|
|
102
|
+
"description": "Every label of the issue after the change."
|
|
103
|
+
},
|
|
104
|
+
"label": {
|
|
105
|
+
"type": "string",
|
|
106
|
+
"description": "The label that was added, when the forge names it."
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
"required": [
|
|
110
|
+
"url",
|
|
111
|
+
"repository",
|
|
112
|
+
"number",
|
|
113
|
+
"title",
|
|
114
|
+
"author",
|
|
115
|
+
"labels"
|
|
116
|
+
]
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"required": [
|
|
120
|
+
"specversion",
|
|
121
|
+
"id",
|
|
122
|
+
"source",
|
|
123
|
+
"type",
|
|
124
|
+
"time",
|
|
125
|
+
"data"
|
|
126
|
+
],
|
|
127
|
+
"description": "forge adapters: a label was added to an issue."
|
|
128
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://raw.githubusercontent.com/sesigl/open-software-factory/main/contracts/events/run-started/run-started.schema.json",
|
|
4
|
+
"title": "RunStarted",
|
|
5
|
+
"$comment": "Generated by `pnpm build` in contracts/ from typespec/. Do not edit.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"specversion": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"const": "1.0"
|
|
11
|
+
},
|
|
12
|
+
"id": {
|
|
13
|
+
"type": "string",
|
|
14
|
+
"minLength": 1,
|
|
15
|
+
"maxLength": 128,
|
|
16
|
+
"description": "Unique per source. A consumer that sees the same source and id twice handles the event once."
|
|
17
|
+
},
|
|
18
|
+
"source": {
|
|
19
|
+
"type": "string",
|
|
20
|
+
"minLength": 1,
|
|
21
|
+
"description": "The producing module, for example \"/osf/intake\"."
|
|
22
|
+
},
|
|
23
|
+
"type": {
|
|
24
|
+
"type": "string",
|
|
25
|
+
"const": "run.started@v1"
|
|
26
|
+
},
|
|
27
|
+
"time": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"format": "date-time"
|
|
30
|
+
},
|
|
31
|
+
"subject": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "The ID of the thing the event is about: work item, gate, run, score or pull request."
|
|
34
|
+
},
|
|
35
|
+
"datacontenttype": {
|
|
36
|
+
"type": "string",
|
|
37
|
+
"const": "application/json"
|
|
38
|
+
},
|
|
39
|
+
"dataschema": {
|
|
40
|
+
"type": "string",
|
|
41
|
+
"format": "uri"
|
|
42
|
+
},
|
|
43
|
+
"traceparent": {
|
|
44
|
+
"type": "string",
|
|
45
|
+
"description": "W3C trace context (CloudEvents distributed tracing extension)."
|
|
46
|
+
},
|
|
47
|
+
"data": {
|
|
48
|
+
"type": "object",
|
|
49
|
+
"properties": {
|
|
50
|
+
"runId": {
|
|
51
|
+
"type": "string",
|
|
52
|
+
"minLength": 1,
|
|
53
|
+
"maxLength": 128,
|
|
54
|
+
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
55
|
+
},
|
|
56
|
+
"workItemId": {
|
|
57
|
+
"type": "string",
|
|
58
|
+
"minLength": 1,
|
|
59
|
+
"maxLength": 128,
|
|
60
|
+
"description": "An identifier chosen by the producer. ULIDs are recommended; consumers treat it as opaque."
|
|
61
|
+
},
|
|
62
|
+
"factory": {
|
|
63
|
+
"type": "string",
|
|
64
|
+
"pattern": "^[a-z][a-z0-9-]{0,62}$",
|
|
65
|
+
"description": "The name of the factory."
|
|
66
|
+
},
|
|
67
|
+
"factoryVersion": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"pattern": "^[0-9a-f]{7,40}$",
|
|
70
|
+
"description": "A Git commit hash, abbreviated (7+) or full. The factory version is the commit of the factory definition."
|
|
71
|
+
},
|
|
72
|
+
"stages": {
|
|
73
|
+
"type": "array",
|
|
74
|
+
"items": {
|
|
75
|
+
"type": "string",
|
|
76
|
+
"pattern": "^[a-z][a-z0-9-]{0,62}$",
|
|
77
|
+
"description": "A lowercase name: letters, digits and hyphens, starting with a letter. Agents, stages, adapters, sources."
|
|
78
|
+
},
|
|
79
|
+
"description": "The stages of the run's workflow, in order."
|
|
80
|
+
},
|
|
81
|
+
"startedAt": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"format": "date-time"
|
|
84
|
+
},
|
|
85
|
+
"requester": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"properties": {
|
|
88
|
+
"kind": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"enum": [
|
|
91
|
+
"person",
|
|
92
|
+
"trigger"
|
|
93
|
+
],
|
|
94
|
+
"description": "Who caused something: a person, or an automated trigger such as a cron rule or an alert."
|
|
95
|
+
},
|
|
96
|
+
"id": {
|
|
97
|
+
"type": "string",
|
|
98
|
+
"minLength": 1,
|
|
99
|
+
"description": "Stable ID in the source system, prefixed with the source, for example \"slack:U024BE7LH\"."
|
|
100
|
+
},
|
|
101
|
+
"displayName": {
|
|
102
|
+
"type": "string",
|
|
103
|
+
"description": "Shown to people, for example \"Varun\"."
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"required": [
|
|
107
|
+
"kind",
|
|
108
|
+
"id"
|
|
109
|
+
],
|
|
110
|
+
"description": "A person or trigger. RUNTIME-008: every run is attributed to one."
|
|
111
|
+
},
|
|
112
|
+
"source": {
|
|
113
|
+
"type": "string",
|
|
114
|
+
"pattern": "^[a-z][a-z0-9-]{0,62}$",
|
|
115
|
+
"description": "A lowercase name: letters, digits and hyphens, starting with a letter. Agents, stages, adapters, sources."
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": [
|
|
119
|
+
"runId",
|
|
120
|
+
"workItemId",
|
|
121
|
+
"factory",
|
|
122
|
+
"factoryVersion",
|
|
123
|
+
"stages",
|
|
124
|
+
"startedAt",
|
|
125
|
+
"requester",
|
|
126
|
+
"source"
|
|
127
|
+
]
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
"required": [
|
|
131
|
+
"specversion",
|
|
132
|
+
"id",
|
|
133
|
+
"source",
|
|
134
|
+
"type",
|
|
135
|
+
"time",
|
|
136
|
+
"data"
|
|
137
|
+
],
|
|
138
|
+
"description": "foreman: a run started (ADR 0067)."
|
|
139
|
+
}
|