Skip to content

Commit 56466bf

Browse files
kheinergaetansennComfortablyCodingrijkvanzanten
authored
Update API reference to Directus 11.17.4 (#66)
* feat: update swagger * fix: fix format * feat: optimize params * fix: add missing graphQL singleton update * Fix path for OAuth endpoint in index.yaml * Update 'data' type in oauth.yaml from array to object Changed 'data' type from array to object with properties for name, label, driver, and icon. * Add code samples to oauthProvider.yaml Added details explaining that oath is not available in Directus SDK and GraphQL. Fixes #42 This should also enable the REST endpoint to display. * Rename OAuth endpoint to login in index.yaml * fix: request body in utils Resolves #16 Add `type: object` to schema for: - Export Data to a File - Generate a Hash - Verify a Hash - Manually Sort Items in Collection * docs: remove punctuation from summary utils/hash/generate and utils/hash/verify contained a `.` at the end of summary which is inconsistent with the rest of the project. * feat: add `/access` to API reference Adds Schema reference as well as the applicable CRUD options. NOTE: I opted to clarify in filenames that they reference accessRules rather than trying to figure out how to pluralize accesses in a way that makes sense. Fixes #40 * fix(deployments): add deployments wip * fix(files): add assets and files * fix(extensions): add support for extensions (release tag v10.10.0) TODO: the SDK examples need to be revisited after the following issues are resolved in the monorepo directus/directus#27310 directus/directus#27311 directus/directus#27312 * fix(utils): add revert and translations Revert has been around a while, looks like it was just missed in previous spec. Translations was added in v.11.17.x * fix(schema): add `force` parameter An enhancement to #61 commit 2ac6094 : - Add more details to explain conditions that bypass might be necessary - Version updated, force is introduced in 8c4df17bb6463d0678bff985c161d1376b980325 but there's not a tagged release. 11.17.3 is at least closest active release right now. * fix(settings): add ai_ and mcp_ properties Fixes #65 * fix(ai): add ai endpoint * feat(mcp): add mcp endpoint * fix(auth): format graphql code-sample to match standards in project * Merge origin/pr-26006 (zip download endpoints) Resolved conflicts by keeping POST method and application/zip responses (matching API implementation) over pr-26006's incorrect GET variants. Also fixed duplicate YAML key in oauth.yaml introduced by prior merge. Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> * Apply suggestion from @kheiner respecting 73b9821 intent * fix(items): separate mutiple, singular, and singeton operations into distinct entries - restore singleton as it's own path with PATCH and GET only => I had to double up the ghost RTL character to make that happen (see #64) - fix request body schemas for updateItems and deleteItems (keys and query forms) - fix title casing * standardize example url to directus_project_url * fix(schemas): add missing type field to nullable access schema properties * fix(utils): add 4xx responses create ignore file for redocly to supress warnings regarding ping and health * fix(health): updated response to explain auth vs no-auth May change as a result of directus/directus#27160 * formatting * Update openapi/index.yaml * Update openapi/index.yaml Co-authored-by: kheiner <heiner@heiner.work> --------- Co-authored-by: Gaetan SENN <gaetan.senn@gmail.com> Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
1 parent 0c4f3fa commit 56466bf

104 files changed

Lines changed: 3070 additions & 179 deletions

File tree

Some content is hidden

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

.redocly.lint-ignore.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# This file instructs Redocly's linter to ignore the rules contained for specific parts of your API.
2+
# See https://redocly.com/docs/cli/ for more information.
3+
dist/oas.yaml:
4+
operation-4xx-response:
5+
- '#/paths/~1server~1ping/get/responses'
6+
- '#/paths/~1server~1health/get/responses'

openapi/components/parameters.yaml

Lines changed: 139 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,7 @@ Export:
103103
- yaml
104104
Version:
105105
name: version
106-
description: >-
107-
Retrieve an item's state from a specific Content Version. The value corresponds to the "key" of the Content Version.
106+
description: Retrieve an item's state from a specific Content Version. The value corresponds to the "key" of the Content Version.
108107
in: query
109108
required: false
110109
schema:
@@ -118,11 +117,148 @@ ConcurrentIndexCreation:
118117
type: boolean
119118
default: false
120119
Backlink:
121-
name: backlink
122120
description: >-
123121
Retrieve relational items excluding reverse relations when using wildcard fields.
122+
name: backlink
124123
in: query
125124
required: false
126125
schema:
127126
type: boolean
128127
default: true
128+
Aggregate:
129+
description: >-
130+
Aggregate functions allow you to perform calculations on a set of values. Accepts one or more of `count`, `countDistinct`, `countAll`, `sum`, `sumDistinct`, `avg`, `avgDistinct`, `min`, `max`.
131+
name: aggregate
132+
in: query
133+
required: false
134+
content:
135+
application/json:
136+
schema:
137+
type: object
138+
properties:
139+
count:
140+
type: array
141+
items:
142+
type: string
143+
description: Count the number of items. Use `['*']` to count all items.
144+
countDistinct:
145+
type: array
146+
items:
147+
type: string
148+
description: Count the number of unique values in the specified fields.
149+
countAll:
150+
type: array
151+
items:
152+
type: string
153+
description: Count all items including related items (used with groupBy).
154+
sum:
155+
type: array
156+
items:
157+
type: string
158+
description: Sum the values of the specified fields.
159+
sumDistinct:
160+
type: array
161+
items:
162+
type: string
163+
description: Sum the unique values of the specified fields.
164+
avg:
165+
type: array
166+
items:
167+
type: string
168+
description: Calculate the average of the specified fields.
169+
avgDistinct:
170+
type: array
171+
items:
172+
type: string
173+
description: Calculate the average of unique values in the specified fields.
174+
min:
175+
type: array
176+
items:
177+
type: string
178+
description: Find the minimum value of the specified fields.
179+
max:
180+
type: array
181+
items:
182+
type: string
183+
description: Find the maximum value of the specified fields.
184+
example:
185+
count: ['*']
186+
sum: ['price']
187+
avg: ['rating']
188+
Deep:
189+
description: Deep allows you to set any of the other query parameters on a nested relational dataset. Use underscore-prefixed parameter names.
190+
name: deep
191+
in: query
192+
required: false
193+
content:
194+
application/json:
195+
schema:
196+
type: object
197+
additionalProperties:
198+
type: object
199+
description: Query parameters for the related field (prefixed with underscore).
200+
properties:
201+
_fields:
202+
type: array
203+
items:
204+
type: string
205+
_sort:
206+
type: array
207+
items:
208+
type: string
209+
_filter:
210+
type: object
211+
_limit:
212+
type: integer
213+
_offset:
214+
type: integer
215+
_page:
216+
type: integer
217+
_search:
218+
type: string
219+
_group:
220+
type: array
221+
items:
222+
type: string
223+
_aggregate:
224+
type: object
225+
example:
226+
related_articles:
227+
_limit: 3
228+
_sort: ['-date_created']
229+
_filter:
230+
status:
231+
_eq: 'published'
232+
Alias:
233+
description: Alias allows you to rename fields in the response payload. The key is the new name, the value is the original field name.
234+
name: alias
235+
in: query
236+
required: false
237+
content:
238+
application/json:
239+
schema:
240+
type: object
241+
additionalProperties:
242+
type: string
243+
example:
244+
display_name: full_name
245+
creation_date: date_created
246+
Group:
247+
description: >-
248+
Grouping allows for running the aggregation functions based on a shared value. Accepts an array of field names.
249+
name: group
250+
in: query
251+
required: false
252+
explode: false
253+
schema:
254+
type: array
255+
items:
256+
type: string
257+
VersionRaw:
258+
description: Retrieve the raw delta of a Content Version item instead of the full merged item.
259+
name: versionRaw
260+
in: query
261+
required: false
262+
schema:
263+
type: boolean
264+
default: false

openapi/components/responses.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,33 @@
1+
BadRequestError:
2+
description: "Error: Bad request."
3+
content:
4+
application/json:
5+
schema:
6+
type: object
7+
properties:
8+
error:
9+
type: object
10+
properties:
11+
code:
12+
type: integer
13+
format: int64
14+
message:
15+
type: string
16+
ForbiddenError:
17+
description: "Error: Forbidden."
18+
content:
19+
application/json:
20+
schema:
21+
type: object
22+
properties:
23+
error:
24+
type: object
25+
properties:
26+
code:
27+
type: integer
28+
format: int64
29+
message:
30+
type: string
131
NotFoundError:
232
description: "Error: Not found."
333
content:

openapi/components/schemas/_index.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
x-metadata:
22
$ref: x-metadata.yaml
3+
Access:
4+
$ref: access.yaml
35
Activity:
46
$ref: activity.yaml
57
Collections:
@@ -8,6 +10,8 @@ Comments:
810
$ref: comments.yaml
911
Dashboards:
1012
$ref: dashboards.yaml
13+
Deployments:
14+
$ref: deployments.yaml
1115
Diff:
1216
$ref: diff.yaml
1317
Extensions:
@@ -22,6 +26,10 @@ Folders:
2226
$ref: folders.yaml
2327
Items:
2428
$ref: items.yaml
29+
JsonRpcRequest:
30+
$ref: jsonrpc-request.yaml
31+
JsonRpcResponse:
32+
$ref: jsonrpc-response.yaml
2533
Notifications:
2634
$ref: notifications.yaml
2735
Operations:
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
type: object
2+
properties:
3+
id:
4+
description: Primary key of the access rule.
5+
example: 8cbb43fe-4cdf-4991-8352-c461779cec02
6+
type: string
7+
format: uuid
8+
role:
9+
description: The role this access rule applies to. Nullable if the rule applies directly to a user. Many-to-one to roles.
10+
example: 8b4474c0-288d-4bb8-b62e-8330646bb6aa
11+
nullable: true
12+
type: string
13+
oneOf:
14+
- type: string
15+
format: uuid
16+
- $ref: roles.yaml
17+
user:
18+
description: The user this access rule applies to. Nullable if the rule applies to a role. Many-to-one to users.
19+
example: 0bc7b36a-9ba9-4ce0-83f0-0a526f354e07
20+
nullable: true
21+
type: string
22+
oneOf:
23+
- type: string
24+
format: uuid
25+
- $ref: users.yaml
26+
policy:
27+
description: The policy associated with this access rule. Many-to-one to policies.
28+
example: 22640672-eef0-4ee9-ab04-591f3afb2886
29+
oneOf:
30+
- type: string
31+
format: uuid
32+
- $ref: policies.yaml
33+
sort:
34+
description: Sort order of this access rule.
35+
example: 1
36+
nullable: true
37+
type: integer
38+
x-collection: directus_access
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
type: object
2+
properties:
3+
id:
4+
description: Unique identifier for the deployment configuration.
5+
example: 8cbb43fe-4cdf-4991-8352-c461779cec02
6+
type: string
7+
format: uuid
8+
provider:
9+
description: The deployment provider. One of `vercel` or `netlify`.
10+
example: vercel
11+
type: string
12+
enum:
13+
- vercel
14+
- netlify
15+
credentials:
16+
description: Provider-specific credentials (e.g. API token). Stored encrypted.
17+
type: object
18+
example:
19+
token: abc123
20+
options:
21+
description: Provider-specific configuration options.
22+
nullable: true
23+
type: object
24+
example:
25+
team_id: team_abc123
26+
webhook_ids:
27+
description: IDs of webhooks registered with the provider for this config.
28+
nullable: true
29+
type: array
30+
items:
31+
type: string
32+
webhook_secret:
33+
description: Secret used to verify webhook payloads from the provider.
34+
nullable: true
35+
type: string
36+
last_synced_at:
37+
description: Timestamp of the last provider sync.
38+
nullable: true
39+
type: string
40+
format: date-time
41+
date_created:
42+
description: When this deployment config was created.
43+
type: string
44+
format: date-time
45+
x-collection: directus_deployments
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
type: object
2+
description: A JSON-RPC 2.0 request or notification message.
3+
required:
4+
- jsonrpc
5+
- method
6+
properties:
7+
jsonrpc:
8+
description: JSON-RPC protocol version. Must be `"2.0"`.
9+
type: string
10+
enum:
11+
- '2.0'
12+
id:
13+
description: >-
14+
Request identifier. May be a string, integer, or null; omit for notifications.
15+
oneOf:
16+
- type: string
17+
- type: integer
18+
method:
19+
description: MCP method name (e.g. `tools/list`, `tools/call`, `prompts/list`, `prompts/get`, `notifications/initialized`).
20+
type: string
21+
params:
22+
description: Method-specific parameters.
23+
type: object
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
type: object
2+
description: A JSON-RPC 2.0 response message.
3+
required:
4+
- jsonrpc
5+
properties:
6+
jsonrpc:
7+
description: JSON-RPC protocol version. Always `"2.0"`.
8+
type: string
9+
enum:
10+
- '2.0'
11+
id:
12+
description: Echoes the `id` from the corresponding request.
13+
oneOf:
14+
- type: string
15+
- type: integer
16+
result:
17+
description: Method-specific result. Present on success.
18+
type: object
19+
error:
20+
description: Error details. Present on failure.
21+
type: object
22+
properties:
23+
code:
24+
type: integer
25+
message:
26+
type: string
27+
data:
28+
type: object

0 commit comments

Comments
 (0)