Skip to content

Commit 94cff8a

Browse files
committed
fixup! feat(schema): Add approval events
Signed-off-by: xibz <bjp@apple.com>
1 parent 16f11f5 commit 94cff8a

6 files changed

Lines changed: 178 additions & 6 deletions

File tree

‎conformance/approval_closed.json‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"context": {
3+
"specversion": "0.6.0-draft",
4+
"id": "471069a8-fc18-44f1-b38f-9d70a1695821",
5+
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
6+
"source": "/event/source/123",
7+
"type": "dev.cdevents.approval.closed.0.1.0",
8+
"timestamp": "2023-03-20T14:29:05.315384Z",
9+
"schemaUri": "https://myorg.com/schema/custom",
10+
"links": [
11+
{
12+
"linkType": "RELATION",
13+
"linkKind": "TRIGGER",
14+
"target": {
15+
"contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce"
16+
},
17+
"tags": {
18+
"foo1": "bar",
19+
"foo2": "bar"
20+
}
21+
}, {
22+
"linkType": "PATH",
23+
"from": {
24+
"contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce"
25+
},
26+
"tags": {
27+
"foo1": "bar",
28+
"foo2": "bar"
29+
}
30+
}, {
31+
"linkType": "END",
32+
"from": {
33+
"contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce"
34+
},
35+
"tags": {
36+
"foo1": "bar",
37+
"foo2": "bar"
38+
}
39+
}
40+
]
41+
},
42+
"subject": {
43+
"id": "approval-123",
44+
"source": "/event/source/123",
45+
"content": {
46+
"approvalDetailsUrl": "https://approvals.example.com/approval-123",
47+
"resourceTargetUrl": "https://deployments.example.com/myapp/prod",
48+
"responder": "urn:user:bob",
49+
"decision": "approved",
50+
"status": "approved"
51+
}
52+
}
53+
}

‎conformance/approval_created.json‎

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
{
2+
"context": {
3+
"specversion": "0.6.0-draft",
4+
"id": "271069a8-fc18-44f1-b38f-9d70a1695819",
5+
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
6+
"source": "/event/source/123",
7+
"type": "dev.cdevents.approval.created.0.1.0",
8+
"timestamp": "2023-03-20T14:27:05.315384Z",
9+
"schemaUri": "https://myorg.com/schema/custom",
10+
"links": [
11+
{
12+
"linkType": "RELATION",
13+
"linkKind": "TRIGGER",
14+
"target": {
15+
"contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce"
16+
},
17+
"tags": {
18+
"foo1": "bar",
19+
"foo2": "bar"
20+
}
21+
}, {
22+
"linkType": "PATH",
23+
"from": {
24+
"contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce"
25+
},
26+
"tags": {
27+
"foo1": "bar",
28+
"foo2": "bar"
29+
}
30+
}, {
31+
"linkType": "END",
32+
"from": {
33+
"contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce"
34+
},
35+
"tags": {
36+
"foo1": "bar",
37+
"foo2": "bar"
38+
}
39+
}
40+
]
41+
},
42+
"subject": {
43+
"id": "approval-123",
44+
"source": "/event/source/123",
45+
"content": {
46+
"approvalDetailsUrl": "https://approvals.example.com/approval-123",
47+
"resourceTargetUrl": "https://deployments.example.com/myapp/prod",
48+
"requestor": "urn:user:alice"
49+
}
50+
}
51+
}

‎conformance/approval_updated.json‎

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"context": {
3+
"specversion": "0.6.0-draft",
4+
"id": "371069a8-fc18-44f1-b38f-9d70a1695820",
5+
"chainId": "4c8cb7dd-3448-41de-8768-eec704e2829b",
6+
"source": "/event/source/123",
7+
"type": "dev.cdevents.approval.updated.0.1.0",
8+
"timestamp": "2023-03-20T14:28:05.315384Z",
9+
"schemaUri": "https://myorg.com/schema/custom",
10+
"links": [
11+
{
12+
"linkType": "RELATION",
13+
"linkKind": "TRIGGER",
14+
"target": {
15+
"contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce"
16+
},
17+
"tags": {
18+
"foo1": "bar",
19+
"foo2": "bar"
20+
}
21+
}, {
22+
"linkType": "PATH",
23+
"from": {
24+
"contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce"
25+
},
26+
"tags": {
27+
"foo1": "bar",
28+
"foo2": "bar"
29+
}
30+
}, {
31+
"linkType": "END",
32+
"from": {
33+
"contextId": "5328c37f-bb7e-4bb7-84ea-9f5f85e4a7ce"
34+
},
35+
"tags": {
36+
"foo1": "bar",
37+
"foo2": "bar"
38+
}
39+
}
40+
]
41+
},
42+
"subject": {
43+
"id": "approval-123",
44+
"source": "/event/source/123",
45+
"content": {
46+
"approvalDetailsUrl": "https://approvals.example.com/approval-123",
47+
"resourceTargetUrl": "https://deployments.example.com/myapp/prod",
48+
"responder": "urn:user:bob",
49+
"decision": "approved"
50+
}
51+
}
52+
}

‎schemas/approvalclosed.json‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"type": {
2424
"type": "string",
2525
"enum": [
26-
"dev.cdevents.approval.closed.0.1.0"
26+
"dev.cdevents.approval.closed.0.1.0"
2727
],
2828
"default": "dev.cdevents.approval.closed.0.1.0"
2929
},
@@ -84,7 +84,15 @@
8484
},
8585
"decision": {
8686
"type": "string",
87-
"description": "The final decision recorded by the responder that resolved this approval."
87+
"enum": [
88+
"escalated",
89+
"delegate",
90+
"deferred",
91+
"requestChanges",
92+
"approved",
93+
"rejected"
94+
],
95+
"description": "The decision made by the responder. This field represents the action taken on the approval request and does not indicate the final approval state. The terminal state is captured by the status field in approval.closed."
8896
},
8997
"status": {
9098
"type": "string",

‎schemas/approvalcreated.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"type": {
2424
"type": "string",
2525
"enum": [
26-
"dev.cdevents.approval.created.0.1.0"
26+
"dev.cdevents.approval.created.0.1.0"
2727
],
2828
"default": "dev.cdevents.approval.created.0.1.0"
2929
},

‎schemas/approvalupdated.json‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://json-schema.org/draft/2020-12/schema",
3-
"$id": "https://cdevents.dev/1.0.0/schema/approval-updated-event",
3+
"$id": "https://cdevents.dev/0.6.0-draft/schema/approval-updated-event",
44
"x-cdevents-semantics": {
55
"subject": "cdevents/_defs/approval"
66
},
@@ -23,7 +23,7 @@
2323
"type": {
2424
"type": "string",
2525
"enum": [
26-
"dev.cdevents.approval.updated.0.1.0"
26+
"dev.cdevents.approval.updated.0.1.0"
2727
],
2828
"default": "dev.cdevents.approval.updated.0.1.0"
2929
},
@@ -84,7 +84,15 @@
8484
},
8585
"decision": {
8686
"type": "string",
87-
"description": "The decision recorded by the responder. Non-terminal status, and does not resolve the approval. The terminal decision and final status are captured in approval.closed."
87+
"enum": [
88+
"escalated",
89+
"delegate",
90+
"deferred",
91+
"requestChanges",
92+
"approved",
93+
"rejected"
94+
],
95+
"description": "The decision made by the responder. This field represents the action taken on the approval request and does not indicate the final approval state. The terminal state is captured by the status field in approval.closed."
8896
}
8997
},
9098
"additionalProperties": false,

0 commit comments

Comments
 (0)