Skip to content

Commit 2ecdc99

Browse files
feat: new endpoint /instances/recent (#501)
* feat: new endpoint /instances/recent * feat: add instances/recent paramaters * refactor: split Locations from instances * refactor: WorldID/InstanceID/LocationID * fix: typo * Clarify LocationID description Updated description to clarify the meaning of LocationID. --------- Co-authored-by: Aries <me@ariesclark.com>
1 parent 4adb26c commit 2ecdc99

10 files changed

Lines changed: 39 additions & 12 deletions

File tree

openapi/components/paths.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@
281281

282282
"/instances":
283283
$ref: "./paths/instances.yaml#/paths/~1instances"
284+
"/instances/recent":
285+
$ref: "./paths/instances.yaml#/paths/~1instances~1recent"
284286
"/instances/{worldId}:{instanceId}":
285287
$ref: "./paths/instances.yaml#/paths/~1instances~1{worldId}:{instanceId}"
286288
"/instances/{worldId}:{instanceId}/shortName":

openapi/components/paths/instances.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,24 @@ paths:
2424
$ref: ../responses/instances/InstanceResponse.yaml
2525
'401':
2626
$ref: ../responses/MissingCredentialsError.yaml
27+
'/instances/recent':
28+
get:
29+
summary: List Recent Locations
30+
tags:
31+
- instances
32+
parameters:
33+
- $ref: ../parameters.yaml#/number
34+
- $ref: ../parameters.yaml#/offset
35+
operationId: getRecentLocations
36+
security:
37+
- authCookie: []
38+
description: |-
39+
Returns a list of recently visited locations.
40+
responses:
41+
'200':
42+
$ref: ../responses/instances/LocationIDListResponse.yaml
43+
'401':
44+
$ref: ../responses/MissingCredentialsError.yaml
2745
'/instances/{worldId}:{instanceId}':
2846
parameters:
2947
- $ref: ../parameters.yaml#/worldId
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
description: Returns a list of LocationIDs.
2+
content:
3+
application/json:
4+
schema:
5+
type: array
6+
items:
7+
$ref: ../../schemas/LocationID.yaml

openapi/components/schemas/CurrentUserPresence.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ properties:
4242
type: string
4343
nullable: true
4444
travelingToWorld:
45-
$ref: ./WorldID.yaml
45+
$ref: ./LocationID.yaml
4646
nullable: true
4747
userIcon:
4848
type: string

openapi/components/schemas/GroupInstance.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ title: GroupInstance
22
type: object
33
properties:
44
instanceId:
5-
type: string
6-
minLength: 1
7-
example: 12345~hidden(usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469)~region(eu)~nonce(27e8414a-59a0-4f3d-af1f-f27557eb49a2)
8-
location:
95
$ref: ./InstanceID.yaml
6+
location:
7+
$ref: ./LocationID.yaml
108
world:
119
$ref: ./World.yaml
1210
memberCount:

openapi/components/schemas/Instance.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,12 @@ properties:
3838
id:
3939
$ref: ./InstanceID.yaml
4040
instanceId:
41-
type: string
42-
minLength: 1
43-
example: 12345~hidden(usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469)~region(eu)~nonce(27e8414a-59a0-4f3d-af1f-f27557eb49a2)
41+
$ref: ./InstanceID.yaml
4442
instancePersistenceEnabled:
4543
type: string
4644
nullable: true
4745
location:
48-
$ref: ./InstanceID.yaml
46+
$ref: ./LocationID.yaml
4947
n_users:
5048
type: integer
5149
minimum: 0
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
type: string
2+
example: 'wrld_4432ea9b-729c-46e3-8eaf-846aa0a37fdd:12345~hidden(usr_c1644b5b-3ca4-45b4-97c6-a2a0de70d469)~region(eu)~nonce(27e8414a-59a0-4f3d-af1f-f27557eb49a2)'
3+
title: LocationID
4+
description: Represents a unique location, consisting of a world identifier and an instance identifier, or "offline" if the user is not on your friends list.

openapi/components/schemas/NotificationDetailInvite.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ properties:
22
inviteMessage:
33
type: string
44
worldId:
5-
$ref: ./WorldID.yaml
5+
$ref: ./LocationID.yaml
66
worldName:
77
type: string
88
required:

openapi/components/schemas/User.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ properties:
6060
last_platform:
6161
$ref: ./Platform.yaml
6262
location:
63-
$ref: ./WorldID.yaml
63+
$ref: ./LocationID.yaml
6464
note:
6565
type: string
6666
platform:
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
example: wrld_ba913a96-fac4-4048-a062-9aa5db092812
1+
example: wrld_4432ea9b-729c-46e3-8eaf-846aa0a37fdd
22
title: WorldID
33
type: string
44
description: WorldID be "offline" on User profiles if you are not friends with that user.

0 commit comments

Comments
 (0)