Skip to content

Commit 6eb088a

Browse files
authored
chore: add webhooks schemas (#779)
1 parent 7456bd5 commit 6eb088a

File tree

83 files changed

+8730
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+8730
-0
lines changed

webhook_schemas/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Webhook Schemas
2+
3+
JSON schemas for the Phrase Strings webhooks
4+
5+
https://support.phrase.com/hc/en-us/articles/5784125630620-Webhooks-Strings
6+
7+
Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-04/schema#",
3+
"type": "object",
4+
"properties": {
5+
"event": {
6+
"type": "string"
7+
},
8+
"message": {
9+
"type": "string"
10+
},
11+
"user": {
12+
"type": "object",
13+
"properties": {
14+
"id": {
15+
"type": "string"
16+
},
17+
"username": {
18+
"type": "string"
19+
},
20+
"name": {
21+
"type": [
22+
"string",
23+
"null"
24+
]
25+
},
26+
"gravatar_uid": {
27+
"type": [
28+
"string",
29+
"null"
30+
]
31+
}
32+
},
33+
"required": [
34+
"id",
35+
"username",
36+
"name",
37+
"gravatar_uid"
38+
]
39+
},
40+
"project": {
41+
"type": "object",
42+
"properties": {
43+
"id": {
44+
"type": "string"
45+
},
46+
"name": {
47+
"type": "string"
48+
},
49+
"main_format": {
50+
"type": [
51+
"string",
52+
"null"
53+
]
54+
},
55+
"created_at": {
56+
"type": "string",
57+
"format": "date-time"
58+
},
59+
"updated_at": {
60+
"type": "string",
61+
"format": "date-time"
62+
}
63+
},
64+
"required": [
65+
"id",
66+
"name",
67+
"main_format",
68+
"created_at",
69+
"updated_at"
70+
]
71+
},
72+
"branch": {
73+
"type": "object",
74+
"properties": {
75+
"base_project_id": {
76+
"type": [
77+
"string",
78+
"null"
79+
]
80+
},
81+
"branch_project_id": {
82+
"type": [
83+
"string",
84+
"null"
85+
]
86+
},
87+
"name": {
88+
"type": "string"
89+
},
90+
"created_at": {
91+
"type": "string",
92+
"format": "date-time"
93+
},
94+
"updated_at": {
95+
"type": "string",
96+
"format": "date-time"
97+
},
98+
"merged_at": {
99+
"type": [
100+
"string",
101+
"null"
102+
],
103+
"format": "date-time"
104+
},
105+
"merged_by": {
106+
"type": [
107+
"object",
108+
"null"
109+
],
110+
"properties": {
111+
"id": {
112+
"type": "string"
113+
},
114+
"username": {
115+
"type": "string"
116+
},
117+
"name": {
118+
"type": [
119+
"string",
120+
"null"
121+
]
122+
},
123+
"gravatar_uid": {
124+
"type": [
125+
"string",
126+
"null"
127+
]
128+
}
129+
},
130+
"required": [
131+
"id",
132+
"username",
133+
"name",
134+
"gravatar_uid"
135+
]
136+
},
137+
"created_by": {
138+
"type": [
139+
"object",
140+
"null"
141+
],
142+
"properties": {
143+
"id": {
144+
"type": "string"
145+
},
146+
"username": {
147+
"type": "string"
148+
},
149+
"name": {
150+
"type": [
151+
"string",
152+
"null"
153+
]
154+
},
155+
"gravatar_uid": {
156+
"type": [
157+
"string",
158+
"null"
159+
]
160+
}
161+
},
162+
"required": [
163+
"id",
164+
"username",
165+
"name",
166+
"gravatar_uid"
167+
]
168+
},
169+
"state": {
170+
"type": "string"
171+
}
172+
},
173+
"required": [
174+
"name",
175+
"base_project_id",
176+
"branch_project_id",
177+
"created_at",
178+
"updated_at",
179+
"merged_at",
180+
"state",
181+
"created_by",
182+
"merged_by"
183+
]
184+
}
185+
},
186+
"required": [
187+
"event",
188+
"message",
189+
"user",
190+
"project",
191+
"branch"
192+
]
193+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"event": "branches:create",
3+
"message": "john.smith created branch new-feature-1 in project Translation Project",
4+
"user": {
5+
"id": "24b9a53ad72e198ca332fba91bb95f57",
6+
"username": "john.smith",
7+
"name": "John Smith",
8+
"gravatar_uid": "1bc5edb4799fd8eec67c66122f47eb73"
9+
},
10+
"project": {
11+
"id": "b2abd3bd2c23ff0ac546e0a2d9aa0be1",
12+
"name": "Translation Project",
13+
"slug": "translation-project",
14+
"main_format": "yml",
15+
"project_image_url": null,
16+
"created_at": "2025-02-07 16:18:13 UTC",
17+
"updated_at": "2025-02-07 16:18:13 UTC",
18+
"point_of_contact": null
19+
},
20+
"branch": {
21+
"name": "new-feature-1",
22+
"base_project_id": "b2abd3bd2c23ff0ac546e0a2d9aa0be1",
23+
"branch_project_id": "8228978fc13f5eb3c4cbbe8ac9882b64",
24+
"created_at": "2025-02-07 16:18:13 UTC",
25+
"updated_at": "2025-02-07 16:44:04 UTC",
26+
"merged_at": null,
27+
"state": "initialized",
28+
"created_by": {
29+
"id": "24b9a53ad72e198ca332fba91bb95f57",
30+
"username": "john.smith",
31+
"name": "John Smith",
32+
"gravatar_uid": "1bc5edb4799fd8eec67c66122f47eb73"
33+
},
34+
"merged_by": null
35+
}
36+
}

0 commit comments

Comments
 (0)