Skip to content

Commit 203d2ab

Browse files
authored
chore: Update OpenAPI specs (#141)
1 parent 0e1f25e commit 203d2ab

File tree

6 files changed

+219
-30
lines changed

6 files changed

+219
-30
lines changed

.github/workflows/changelog.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
- name: Get current date
1313
id: date
1414
run: echo "::set-output name=date::$(date +'%Y-%m-%d')"
15+
- name: Check out repository content
16+
uses: actions/checkout@v2
17+
with:
18+
ref: ${{ github.event.pull_request.head.ref }}
1519
- name: Check out HEAD rev
1620
uses: actions/checkout@v2
1721
with:
@@ -38,17 +42,26 @@ jobs:
3842
base: 'base/fern/apis/beta/openapi-beta.yaml'
3943
revision: 'head/fern/apis/beta/openapi-beta.yaml'
4044
format: text
41-
output-to-file: 'changelog/beta/${{ steps.date.outputs.date }}_oasdiff.md'
42-
- name: Prompt
43-
run: |
44-
python changelog.py --date ${{ steps.date.outputs.date }}
45-
git config user.name github-actions
46-
git config user.email github-actions@github.com
47-
git add fern/apis/*/changelog
48-
git commit -m "generated by Claude"
49-
git push
45+
output-to-file: 'temp/beta/${{ steps.date.outputs.date }}_oasdiff.md'
5046
- name: Archive changelogs
5147
uses: actions/upload-artifact@v4
5248
with:
5349
name: changelog-${{ steps.date.outputs.date }}
5450
path: temp/**
51+
- name: Prompt
52+
env:
53+
LLM_JWT: ${{ secrets.LLM_JWT }}
54+
run: |
55+
logfiles="fern/apis/*/changelog/${{ steps.date.outputs.date }}.md"
56+
57+
if ls $logfiles >/dev/null 2>&1; then
58+
logfiles=($logfiles)
59+
echo "${logfiles[@]} already exist."
60+
else
61+
python changelog.py --date ${{ steps.date.outputs.date }}
62+
git config user.name github-actions
63+
git config user.email github-actions@github.com
64+
git add fern/apis/*/changelog/${{ steps.date.outputs.date }}.md
65+
git commit -m "generated by Claude"
66+
git push
67+
fi

changelog.py

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,31 @@ def main(vrn, d):
2727

2828
def gen_log(prompt):
2929

30-
log = None
3130
auth = os.environ.get('LLM_JWT')
32-
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {auth}"}
33-
payload = {
34-
"model": "us.anthropic.claude-3-5-sonnet-20241022-v2:0",
35-
"messages": [
36-
{
37-
"role": "user",
38-
"content": prompt
39-
}
40-
]
41-
}
42-
43-
try:
44-
r = requests.post('https://openwebui.dev.devrev-eng.ai/api/chat/completions', json=payload,
45-
headers=headers)
46-
log = r.json()['choices'][0]['message']['content']
47-
log = re.sub(r"^Here's.*\n?", '', log, flags=re.MULTILINE)
48-
log = re.sub(r"^Let me know.*\n?", '', log, flags=re.MULTILINE)
49-
except Exception as e:
50-
print(
51-
f"Failed to generate changelog. Error: {type(e)} {e} {r}")
31+
if auth:
32+
headers = {"Content-Type": "application/json", "Authorization": f"Bearer {auth}"}
33+
payload = {
34+
"model": "us.anthropic.claude-3-5-sonnet-20241022-v2:0",
35+
"messages": [
36+
{
37+
"role": "user",
38+
"content": prompt
39+
}
40+
]
41+
}
42+
43+
try:
44+
r = requests.post('https://openwebui.dev.devrev-eng.ai/api/chat/completions', json=payload,
45+
headers=headers)
46+
log = r.json()['choices'][0]['message']['content']
47+
log = re.sub(r"^Here's.*\n?", '', log, flags=re.MULTILINE)
48+
log = re.sub(r"^Let me know.*\n?", '', log, flags=re.MULTILINE)
49+
except Exception as e:
50+
print(
51+
f"Failed to generate changelog. Error: {type(e)} {e} {r}")
52+
else:
53+
log = "No auth token"
54+
5255
return log
5356

5457

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
# API Changelog
3+
4+
## Links
5+
- Added support for meetings in link objects - `type` enum now includes `meeting` value
6+
- This affects the following endpoints:
7+
- [`/links.create`](/beta/api-reference/links/create)
8+
- [`/links.get`](/beta/api-reference/links/get-post)
9+
- [`/links.list`](/beta/api-reference/links/list-post)
10+
11+
## SLA
12+
### SLA Trackers
13+
- Added new property `applies_to_type` to SLA tracker objects
14+
- Added new property `completed_at` to metric target summaries
15+
- This affects the following endpoints:
16+
- [`/sla-trackers.get`](/beta/api-reference/slas/sla-trackers-get-post)
17+
- [`/sla-trackers.list`](/beta/api-reference/slas/sla-trackers-list-post)
18+
19+
### SLAs
20+
- Added new property `account_filter` to SLA objects
21+
- This affects the following endpoints:
22+
- [`/slas.create`](/beta/api-reference/slas/create)
23+
- [`/slas.get`](/beta/api-reference/slas/get-post)
24+
- [`/slas.list`](/beta/api-reference/slas/list-post)
25+
- [`/slas.transition`](/beta/api-reference/slas/transition)
26+
- [`/slas.update`](/beta/api-reference/slas/update)
27+
28+
## Works
29+
- Added new query parameter `state` for filtering works
30+
- This affects the following endpoints:
31+
- [`/works.export`](/beta/api-reference/works/export-post)
32+
- [`/works.list`](/beta/api-reference/works/list-post)
33+
34+
The changes are primarily focused on:
35+
1. Adding support for meetings in link objects
36+
2. Enhancing SLA tracking capabilities with new properties
37+
3. Adding account filtering to SLAs
38+
4. Adding state filtering capability for works endpoints
39+
40+
All modified endpoints continue to maintain backward compatibility while adding these new capabilities.

fern/apis/beta/openapi-beta.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -891,6 +891,11 @@ components:
891891
a different policy starting to apply.
892892
example: "2023-01-01T12:00:00.000Z"
893893
format: date-time
894+
completed_at:
895+
type: string
896+
description: The time at which the metric completed at.
897+
example: "2023-01-01T12:00:00.000Z"
898+
format: date-time
894899
completed_in:
895900
type: integer
896901
description: |
@@ -9923,6 +9928,7 @@ components:
99239928
feature: '#/components/schemas/feature-summary'
99249929
incident: '#/components/schemas/incident-summary'
99259930
issue: '#/components/schemas/issue-summary'
9931+
meeting: '#/components/schemas/meeting-summary'
99269932
opportunity: '#/components/schemas/opportunity-summary'
99279933
product: '#/components/schemas/product-summary'
99289934
rev_org: '#/components/schemas/rev-org-summary'
@@ -9939,6 +9945,7 @@ components:
99399945
- $ref: '#/components/schemas/feature-summary'
99409946
- $ref: '#/components/schemas/incident-summary'
99419947
- $ref: '#/components/schemas/issue-summary'
9948+
- $ref: '#/components/schemas/meeting-summary'
99429949
- $ref: '#/components/schemas/opportunity-summary'
99439950
- $ref: '#/components/schemas/product-summary'
99449951
- $ref: '#/components/schemas/rev-org-summary'
@@ -9962,6 +9969,7 @@ components:
99629969
- feature
99639970
- incident
99649971
- issue
9972+
- meeting
99659973
- opportunity
99669974
- product
99679975
- rev_org
@@ -15013,6 +15021,11 @@ components:
1501315021
- $ref: '#/components/schemas/atom-base'
1501415022
- type: object
1501515023
properties:
15024+
account_filter:
15025+
type: object
15026+
description: |
15027+
A set of account attributes that must be satisfied for the SLA to
15028+
apply. AND applies between each field.
1501615029
compensation:
1501715030
$ref: '#/components/schemas/sla-compensation'
1501815031
description:
@@ -15166,6 +15179,8 @@ components:
1516615179
applies_to_id:
1516715180
type: string
1516815181
description: Details of the object on which the SLA is being tracked.
15182+
applies_to_type:
15183+
$ref: '#/components/schemas/sla-tracker-applies-to-type'
1516915184
metric_target_summaries:
1517015185
type: array
1517115186
description: |
@@ -15196,9 +15211,20 @@ components:
1519615211
required:
1519715212
- metric_target_summaries
1519815213
title: sla-tracker
15214+
sla-tracker-applies-to-type:
15215+
type: string
15216+
description: The type of the object on which the SLA is being tracked.
15217+
enum:
15218+
- conversation
15219+
- issue
15220+
- ticket
1519915221
sla-tracker-summary:
1520015222
allOf:
1520115223
- $ref: '#/components/schemas/atom-base-summary'
15224+
- type: object
15225+
properties:
15226+
applies_to_type:
15227+
$ref: '#/components/schemas/sla-tracker-applies-to-type'
1520215228
title: sla-tracker-summary
1520315229
sla-trackers-get-request:
1520415230
type: object
@@ -19483,6 +19509,11 @@ components:
1948319509
$ref: '#/components/schemas/stage-filter'
1948419510
staged_info:
1948519511
$ref: '#/components/schemas/staged-info-filter'
19512+
state:
19513+
type: array
19514+
description: Filters for work with any of the provided states.
19515+
items:
19516+
type: string
1948619517
sync_metadata:
1948719518
$ref: '#/components/schemas/sync-metadata-filter'
1948819519
tags:
@@ -19728,6 +19759,11 @@ components:
1972819759
$ref: '#/components/schemas/stage-filter'
1972919760
staged_info:
1973019761
$ref: '#/components/schemas/staged-info-filter'
19762+
state:
19763+
type: array
19764+
description: Filters for work with any of the provided states.
19765+
items:
19766+
type: string
1973119767
sync_metadata:
1973219768
$ref: '#/components/schemas/sync-metadata-filter'
1973319769
tags:
@@ -35638,6 +35674,14 @@ paths:
3563835674
name: staged_info.is_staged
3563935675
schema:
3564035676
type: boolean
35677+
- description: Filters for work with any of the provided states.
35678+
explode: false
35679+
in: query
35680+
name: state
35681+
schema:
35682+
type: array
35683+
items:
35684+
type: string
3564135685
- description: Filters for issues with this specific external reference.
3564235686
explode: false
3564335687
in: query
@@ -36113,6 +36157,14 @@ paths:
3611336157
name: staged_info.is_staged
3611436158
schema:
3611536159
type: boolean
36160+
- description: Filters for work with any of the provided states.
36161+
explode: false
36162+
in: query
36163+
name: state
36164+
schema:
36165+
type: array
36166+
items:
36167+
type: string
3611636168
- description: Filters for issues with this specific external reference.
3611736169
explode: false
3611836170
in: query
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
2+
# API Changes
3+
4+
## SLA Trackers
5+
The following endpoints have been updated with new properties in the SLA tracker schema:
6+
- [`/sla-trackers.get`](/public/api-reference/slas/sla-trackers-get-post)
7+
- [`/sla-trackers.list`](/public/api-reference/slas/sla-trackers-list-post)
8+
9+
Changes:
10+
- Added `applies_to_type` property to SLA tracker schema
11+
- Added `completed_at` property to metric target summaries
12+
13+
## SLAs
14+
The following endpoints have been updated with new properties in the SLA schema:
15+
- [`/slas.create`](/public/api-reference/slas/create)
16+
- [`/slas.get`](/public/api-reference/slas/get-post)
17+
- [`/slas.list`](/public/api-reference/slas/list-post)
18+
- [`/slas.transition`](/public/api-reference/slas/transition)
19+
- [`/slas.update`](/public/api-reference/slas/update)
20+
21+
Changes:
22+
- Added `account_filter` property to SLA schema
23+
24+
## Works
25+
The following endpoints have been updated:
26+
- [`/works.export`](/public/api-reference/works/export-post)
27+
- [`/works.list`](/public/api-reference/works/list-post)
28+
29+
Changes:
30+
- Added new query parameter `state` to filter works
31+
32+
All work-related endpoints have also been updated to include the new SLA tracker schema changes mentioned above in their responses.

0 commit comments

Comments
 (0)