221 Commits

Author SHA1 Message Date
Nitwel
858892f73d Add a force option to schema apply to bypass hash check (#27136)
* added force option to schema apply

* Update api/src/controllers/schema.ts

Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/cute-rivers-mate.md

Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com>

* cleanup

* default to false

* adjust error message

* add test

* add jsdoc

* add new option to service type

* Update cute-rivers-mate.md

* Update cute-rivers-mate.md

---------

Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com>
2026-04-16 18:51:47 +00:00
Yogeshwaran C
2777bed8fd fix(sdk): reflect policies permission system in policy/user types (#27152)
* fix(sdk): reflect policies permission system in policy/user types

directus_policies.users, directus_policies.roles and directus_users.policies
are M2M relations through directus_access, but the SDK types had them typed
as direct arrays of DirectusUser / DirectusRole / DirectusPolicy. That meant
payloads built from these types didn't match the API at runtime (e.g.
creating a policy with users required each entry to be a { user: id } access
item, not a user id).

Retype them as DirectusAccess[] to match the schema.

Closes #25757

* Fix SDK types for user access relations

Updated SDK types to correctly link to the directus_access junction collection, reflecting the policies permission system.

---------

Co-authored-by: Nitwel <mail@nitwel.de>
2026-04-16 13:35:47 -04:00
Alex Gaillard
791f9b642d Revert "Improve configurability of health checks (#26987)" (#27131)
This reverts commit 41edb6c653.
2026-04-15 16:03:53 +00:00
judda
41edb6c653 Improve configurability of health checks (#26987)
* suffix file health checks with machine id

* add changeset

* add ttl support for local cache

* improve configurability of healthcheck and cache results

* add cahngesets

* restrict `/server/health` to authenticated users

* tweaks

* Ensure consistent bracket usage

* Apply suggestion from @ComfortablyCoding

* add notice for dropping cache/ratelimiter/ratelimiterglobal

* move unauthenticated check to service

* add bb tests

* improve server health return type

* Update shaggy-news-check.md

* fix vendor db check

* Update shaggy-news-check.md

* Fix bb tests
2026-04-10 19:29:19 -04:00
ian
32d5650f4f Release 11.17.1 (#27007)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Alex Gaillard <alex@directus.io>
2026-03-30 12:29:03 -04:00
John Costa
35be3e09c6 fix(sdk): include date and time in filter operator type guards (#26957)
* fix(sdk): include date and time types in filter operator type guards

The IsDateTime utility type only matched 'datetime', causing 'date' and
'time' fields to lose comparison operators (_gt, _lt, _between, etc.)
and incorrectly gain string operators (_contains, _starts_with, etc.).

Also adds 'date' and 'time' entries to FieldOutputMap so filter values
resolve to string instead of the literal type.

* test(sdk): add type-level tests for date and time filter operators

Add date_field and time_field to the test schema and verify that
comparison (_gt, _lt, _gte, _lte), range (_between, _nbetween),
and equality (_eq) filter operators compile for all three temporal
types.

* fix null on filters and add tests

* fmt

---------

Co-authored-by: Nitwel <mail@nitwel.de>
2026-03-25 11:27:43 -04:00
ian
dfb2db349f Release 11.17.0 (#26960)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-24 18:15:34 -04:00
John Costa
bc511a80de fix(sdk): distinguish date and time types in function mappings (#26936)
* fix(sdk): distinguish date and time types in function mappings

The SDK's QueryFunctions type only had a 'datetime' key that mapped
to all date and time functions. The API already correctly distinguishes
date (year/month/week/day/weekday), time (hour/minute/second), and
dateTime (all) types in getFunctionsForType().

Add 'date' and 'time' keys to QueryFunctions with their respective
function subsets, and update MappedFunctionFields, MappedFieldNames,
and GroupByFields to include the new type mappings.

Fixes #26931

* update changeset

---------

Co-authored-by: Nitwel <mail@nitwel.de>
2026-03-24 09:12:13 -04:00
Nitwel
3c2efc1fb6 Improve build times using tsdown’s oxc-transform (#26604)
* start supporting isolatedDeclarations

* add errors and storage package

* add utils, and storage-driver-local

* fix rest of packages

* fix types/collab import

* hardcode "isolatedDeclarations": true in all configs for now

* Revert "hardcode "isolatedDeclarations": true in all configs for now"

This reverts commit ac71582159.

* fix formatting

* undo readme change

* remove link

* fix lockfile

* dont do a js string cast here I guess

* use tsc over tsdown because of failing tests

* last fixes

* use tsdown --clean instead of rimraf

* fmt and fixes

* re add weird space

* add run as entry

* undo api using tsdown

* switch back to tsdown again now with unbundle 🥳

* more ts fixes

* build with tsdown in @directus/themes

* fix bb tests

* undo spaces

* another space

* fix collab import

* add changeset

* Apply suggestion from @ComfortablyCoding

* Apply suggestion from @ComfortablyCoding

* Update .changeset/hungry-yaks-enter.md

Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com>

---------

Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com>
2026-03-11 14:56:12 -04:00
ian
d273af9e3c Release 11.16.0 (#26810)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-03-04 15:48:22 -05:00
kheiner
6aba4b4cfe Update ReadProviderOutput type to include the label field (#26645)
* Add optional label property to ReadProviderOutput

* Add kheiner to contributors list

* add changeset

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
2026-03-02 14:15:57 -05:00
Gaetan SENN
920d452f12 Support provider webhooks for deployment real-time updates (#26683)
* feat(deployment): support netlify

feat(deployment): support netlify

fix(): style, format and tests

fix(netlify): filter by account slug

chore(): remove the need for siteId in deploy logs

wip

* test(): mock listSitesForAccount

* format

* test(): fix with account_slug test

* fix(): error handling + cancel deployment

* fix(deployLogs): new implementation

* chore: remove test data

* fix: use currentColor svg

* fix: fix some issues and improve code

* fix: wait until the end of the logs when build is finished

* refactor: format code

* Update changeset

* refactor: use tokenUrl as vercel does

* fix tooltip placement

* fix: provider change refresh

* feat: implement webhook sync

* feat: implement netlify webhook and refactor logic

* feat: implement netlify webhook and refactor logic

* refactor: clean up code

* test: update netlify tests

* build: add changeset

* build: clean up changeset

* refactor: clean up logs

* refactor: optimize status code error

* refactor: clean up code

* fix: change list project limit to 100

* fix: fix tests

* refactor: handle feedbacks

* fix: flash issue from runs

* refactor: avoid duplicated range schema

* feat: add missing cmd save

* fix: fix naming variable

* refactor: move logic to service

* refactor: optimize emitAction usage

* refactor: use drivers pagination for projects

* fix: fix pluralization

* fix: fix timestamp duration

* fix: fix dashboard i18n

* fix: add missing netlify test

* refactor: improve typing

* refactor: add runs stats and fix some issues

* fix: fix run build time issue

* refactor: fix typing

* Implement RBAC for deployment module (#26726)

* refactor: implement RBAC for deployment

* build: update build

* fix: linter

* refactor: clean up

* fix: fix naming variable

* Update app/src/modules/deployment/index.ts

Co-authored-by: Hugo Torzuoli <torzuoli.hugo@gmail.com>

* refactor: move logic to service

* refactor: optimize emitAction usage

* refactor: use drivers pagination for projects

* fix: scope null accountability to name-sync write only

* feat: restrict button actions and sections according to rights

---------

Co-authored-by: Hugo Torzuoli <torzuoli.hugo@gmail.com>

---------

Co-authored-by: Yasser Lahbibi <yasser.lahbibi@apenhet.com>
Co-authored-by: Florian C. Wachmann <dev@formfcw.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Alex Gaillard <alex@directus.io>
Co-authored-by: Hugo Torzuoli <torzuoli.hugo@gmail.com>
2026-03-02 11:57:30 -05:00
ian
47c60716b5 Release 11.15.0 (#26590)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-02-05 14:16:37 -05:00
Gaetan SENN
d8bd5d42f2 Add deployment module with Vercel provider support (#26473)
* feat: add deployment migration

* feat: add deployment and deployment projects collections with corresponding fields and relations

* build: add changeset

* feat: set type as unique

* build: set type to unique

* build: set type to unique

* feat: add missing run tables

* feat: add deployment module

* fix: add missing run migration

* refactor: remove local project

* refactor: use provider instead of type

* refactor: use provider instead of type

* Add database schema for deployment module with encrypted credentials support

* feat: add deployment migration

* feat: add deployment and deployment projects collections with corresponding fields and relations

* build: add changeset

* feat: set type as unique

* build: set type to unique

* feat: add missing run tables

* fix: add missing run migration

* refactor: use provider instead of type

* feat: add logs / runs routes

* refactor: remove project name for realtime from vercel

* feat: implement runs logs

* fix: formater

* refactor: clean up

* feat: add vercel

* build: mv types and add changeset

* refactor: register drivers once

* feat: add sdk implementation

* refactor: fix lint

* refactor: simplify runs status

* build: update changeset

* feat: clean up module

* fix: fix merge

* refactor: finalize implementation

* build: add changeset

* refactor: update cache logic and fix some issues

* fix: fix missing file

* refactor: merge changeset

* fix: move project selection logic in service

* refactor: removed dashboard stats

* fix: use snake case for deploy input for consistency

* refactor: avoid copy of req.body

* refactor: apply concurrency limit of 5 to provider

* refactor: remove extends of Item

* fix: export deployment for extensions

* fix: remove name from deployment project

* fix: fix spinner padding injected from button class

* fix: fix some feedbacks

* fix: duration size and redirect after first provider configuration

* Reorganize translation strings (#26533)

* Reorganize translation strings

* Remove artifact

* fix: restore name from projects

* fix: hide back button from settings if no projects

* fix(dashboad): use inline for url

* fix: refresh config value options on save

* fix: extend Deployment methods

* fix: export DeploymentConfig from types

* fix: first check the resource access and improve error

* refactor: batch updates

* refactor: clean up code

* refactor: optimize comments

* feat: improve js docs errors

* fix: check permission before connection test from provider

* refactor: use front end user extraction

* refactor: optimize code

* fix: fix avoid composable inside computed

* fix: fix i18n change

* fix: use dynamic provider name

* fix: remove unused class scope

* fix: fix credentials read and move logic into service

* feaet: display warning of team id change and add it to setup drawer

* refactor: remove comments

* refactor: handle feedback

* fix: snake case refactoring

* fix: fix clear cache variable

* Update app/src/lang/translations/en-US.yaml

Update i18n

Co-authored-by: Alex Gaillard <alex@directus.io>

* refactor: remove changeset

* refactor: remove meta from sdk

* fix: fix preview state

* fix: remove meta type injection

* refactor: change to pluralization

* refactor: update logic

* refactor: update changeset

* fix: optimize switch case

* fix: keep filter from query

* refactor: use directError type

* refactor: fix not used typing

* refactor: add new error code utility function

* refactor: add aria label for search input

* Potential fix for pull request finding 'Useless assignment to local variable'

Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>

* refactor: clean up unused import

* fix: fix feedbacks

* fix: fix switch case logic

* fix: use mergeFilter util function

* refactor: align with Judd preference

* refactor: rename cache variable and add in missing files

* refactor: clean up axios usage

* fix: assign data.options from parseValue

* refactor: update date of deployment migration file

* fix: lint

* fix: add missing package

* build: run formatter

* Fix stylint errors

* deploy ← design updates (#26585)

* use VBreadcrumb for VDrawer subtitle to match design

* use form-row-gap between notice and form to match the design

* style: enhance layout and styling for deployment settings page

* use global back button instead of custom one

* use PrivateViewHeaderBarActionButton instead of custom one

* fix: use dynamic provider var for back link

* use global back button instead of custom one

* ensure consistent appearance of more-options button

* use global back button instead of custom one

* use PrivateViewHeaderBarActionButton instead of custom one

* tests: add api side tests

* fix: prevent chip from using parent font-weight

* refactor: apply admin access middleware for deployment routes

* tests: add cache tests

* fix: fix loader alignment

---------

Co-authored-by: Alex Gaillard <alex@directus.io>
Co-authored-by: Alvaro Saburido <alvaro.saburido@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
Co-authored-by: Florian C. Wachmann <dev@formfcw.com>
2026-02-05 12:27:40 -05:00
Nitwel
76ea6db06e Fix race condition and allow accessing the connected state (#26511)
* fix race condition in sdk and allow accessing the connected state

* add changeset

* run prettier

* Update sdk/src/realtime/composable.ts

Co-authored-by: ian <licitdev@gmail.com>

* add try catch

* reject the connecting promise on error

* linter

* prettier

* add jsdoc

* Update .changeset/blue-houses-retire.md

Co-authored-by: ian <licitdev@gmail.com>

* dont use es2024

---------

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Brainslug <tim@brainslug.nl>
2026-01-28 18:52:58 +08:00
ian
2cb91fcc6a Release 11.14.1 (#26486)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-01-14 19:41:14 +02:00
Bryant Gillespie
36c3049f26 Add AI_ENABLED env var to opt out of AI Chat (#26458)
* feat: add AI_ENABLED env variable for opt-out

* feat: add AI/MCP disabled states to settings UI

* refactor: separate mcp_group from ai_group in settings

* add changeset

* fix the spread

* bring back type annotation

* Update app/src/modules/settings/routes/project/project.vue

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Update .changeset/silver-tigers-glow.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* add to server info type

* move AI server info behind auth

* fix changeset

* Update .changeset/silver-tigers-glow.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2026-01-08 17:02:48 -05:00
Florian C. Wachmann
79cd1b57d9 Add ESLint rules to enforce consistent import order (#26445)
* add eslint-plugin-import and configure import sorting rules

* apply `eslint . --fix`

* disable import order rule for test files

* enable import order rule for test files and disable it inline after mock imports

* prettier

* address failed tests by removing unused i18n mocks from test files

* reorder import statement for createApp to address failed test

* Remove disable/enable blocks

* Resolve conflict with VSCode organize imports functionality (#26461)

* Update to use default grouping and prevent adding newlines in between

Co-authored-by: ian <licitdev@gmail.com>

* apply eslint fix

* run prettier

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: ian <licitdev@gmail.com>
2026-01-07 10:04:54 -05:00
Oscar Murrieta
acf6d3d4ca Remove deprecated /webhooks route and related dead code (#26311)
* chore: remove deprecated /webhooks route code and related tests

* build: add changeset

* docs: add mobml to contributors list (CLA)

* Remove WebhooksService

* Remove other traces of webhooks

* Update last mentions

* Add migration to drop webhooks table completely

* Add changeset

* Clean up changesets

* Remove translations

* Remove webhooks from bb test tables

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2025-12-24 11:35:20 -05:00
Bruno Avelino Costa
e24605e876 Fix conversion of fields from object notation to dot syntax in SDK subscription queries (#26397)
* feat: Add `parseQueryParams` utility and apply it to realtime subscriptions for proper parsing of complex query parameters.

* chore: Add bruno-costa to contributors list

* refactor: move `query-to-params` utility to `utils` and export it directly from the SDK index.

* test: add comprehensive unit tests for `parseQueryParams` and streamline its internal implementation.

* refactor: Remove  utility and directly use  for realtime subscription queries.

* refactor: Move `formatFields` utility and its tests to a dedicated file and update imports.

* test: add tests for getRequestUrl utility function

* chore: Update  changeset to patch and refine description

* chore(lint --fix): remove unused `vi` and `queryToParamsModule` imports from `get-request-url.test.ts`.

* test: add `formatFields` literal and wildcard pattern tests and verify `formatFields` and `queryToParams` exports.

* Export extended query

* prefer truth check

* Reword changeset

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
2025-12-24 07:21:28 +08:00
ian
385d56c0cf Release 11.14.0 (#26352)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-12-09 15:43:44 -05:00
Nitwel
274fc44340 📂 Add support for downloading multiple files and entire folder trees (#26006)
* add files and folder download functionallity

* undo test

* deduplicate file names and add permission checks

* improve access handling

* fix filesService accountability

* fix app download

* add changeset

* use $t for script translation

* add Folder type

* prefer post for folder download

* add translated download folder

* rename admin filesService to sudo

* rename file deduper to name deduper

* add permissioned downloads and seperate zip for file/folder

* update lock

* default zipped name should be consistent

* remove dead code

* auto add extension for file name default

* update changeset

* update param naming for filesToZip

* only retrieve required fields

* Add faster dedupe lookup times

* add scope to sudo service

* files uses uuids, so ids should be strings

* prefer folder name as root over generic folder-

* update changeset

* update default app side file/folder names

* improve zip folder name format

* improve mime guess for fallback filename

* update package version

* rename `getDateFormatted` to `getDateTimeFormatted`

* do not limit file query to 100

* remove dead type

* move folderName from zipFolders under metadata

* Fix zip folder name

* auto sanitize names

* error if no files are in the tree

* add any empty folders to the tree

* rename tree to buildTree and add comment

* add test utils

* expose new methods to types

* Improve test coverage

* add comments

* remove dead type from name-deduper

* improve name-deduper tests

* dont restrict folder depth in tree

* remove unnecessary cast

* inline storage mock

* move mocked services to respective folder

* improve folders buildTree tests

* add comment for id restriction on child lookup

* add limit check to buildTree

* bring buildtree in zipfolder inline with other tests

* Update legal-streets-wonder.md

* Improve /assets/files/ error handling

* cleanup

* add sdk methods

* Update legal-streets-wonder.md

* correct key type in downloadFolderZip

* free URL memory after download

* rename type to output and improve return type

---------

Co-authored-by: Alex Gaillard <alex@directus.io>
Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
2025-12-10 04:11:38 +08:00
ian
15276cd55c Release 11.13.3 (#26225)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-19 11:44:19 -05:00
Gaetan SENN
ee30132778 Add support for CSV files export in UTF-8 encoding (Excel format) (#26177)
* feat: add utf8 csv support

* build: add changeset
2025-11-14 17:19:21 +08:00
ian
79b0648d4f Release 11.13.0 (#26114)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-11-04 20:14:16 +00:00
Brainslug
6312231c82 Add retention indexes (#25199)
* Added isSystemField helper

* Add some joi validation

* Fixed error list mapping

* merge edited system fields

* prettier

* updated merging logic

* Create rude-walls-add.md

* Removed silly unneeded merging logic

* Block creating a database record for system table

* removed obsolete filtering

* Added same check for graphql mutations

* fixed merge conflicts

* fixed incorrect collection usage in bulk update

* Add bb tests

* throw all errors for batch updates

* add early return/abort

* Fix graphql updateField

* return single error for graphql

* Adding system indexes to the system-data package

* Add system indexes to get-snapshot

* WIP adding indexes to schema diff

* WIP snapshot diffing system fields

* basic diffing

* WIP applying systemFields

* first working system field snapshot apply

* address some of the broken tests

* ran prettier

* ran eslint

* fixed remaining unit tests

* include snapshot type in bb test

* removed comment

* Add systemfields to cli output

* fixed bug in diffing

* fixed sorting systemFields

* simplified mapping

* removed temprorary index definition

* added diff validation

* fix validation strictness

* Add expected index definitions

* WIP index creation

* WIP index migration

* mssql enterprise concurrent constraint support

* Oracle concurrent indexes seem widely supported

* Added basic index fallback

* remove fallback for postgres

* Fix mysql index creation

* refactor create index function

* Side step knex for index creation

* support creating unique indexes concurrently

* fix unique index naming

* avoid knex for creating indexes and only alter column if something has changed

* remove failed optimization

* allow for unique indexes

* quick n dirty check for system collections

* explicit boolean casting

* add unique index test

* use zod instead of joi

* prettier

* undo scope creep

* undo unique scope creep

* passing down the concurrent toggle

* small cleanup

* added missing fallback

* prevent injection with bindings

* removed unused imports

* use old behavior as default

* add concurrent bb test

* Create warm-chefs-draw.md

* passthrough collection creation with fields

* update rest controllers

* Add concurrent option to graphql resolvers

* make sure old snapshots can be force applied

* fixed missed rename

* Update api/src/utils/get-snapshot-diff.ts

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update api/src/utils/get-snapshot-diff.ts

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* updated gql error formatting

* Fix accidental diff duplication

* rename to FieldMutationOptions

* skip unneeded db call

* simplify mysql index fallback

* fixed boolean check

* EXPERIMENT test if we get the BB error back

* updated query param bool logic

* Revert "EXPERIMENT test if we get the BB error back"

This reverts commit d145437a51.

* renamed to `attemptConcurrentIndex`

* fix merge errror

* fix merge

* missed type

* Add missing fields update implementations (#25331)

* Add support for concurrentIndexCreation in the SDK

* Add update_fields_items resolver

* Add concurrentIndex option the SDK createField command

* add changeset

* updated changeset

* format

* fixed duplicate function

* added test for missing systemfields in snapshot

* prefer the "test" function over "it"

* add tests for get-snapshot-diff

* prettier

* add tests for get-snapshot

* removed unused imports

* added sanitize schema tests

* add validate-diff tests

* added validate-snapshot tests

* added tests to the system-data package

* added tests for the system collections

* add apply-diff tests

* add tests for the collections controller

* added sql dialect tests

* prettier

* extra get-snapshot-diff tests

* export apply functions for testing

* add tests for the cli apply function

* prettier

* add correct migration date

* add changeset

* format

* more formatting

* add await

* add comment

* undo await

* remove async from addColumnToTable

* prettier

* account for existing primary key

* ensure trx is passed down

* Move indexes outside trx's

* make sure the old code path is taken by default

* remove additional cast

* simplified object access and merged if statements

* catch index error

* allow for both indexes

* directly use variable

* prettier

* dont hide potential errors

* remove unused import

* initial vibe coded service tests

* extract some shared mocking functions

* extract cache mocking

* extract emitter mocking

* extract ItemsService mocking

* extracted more knex helpers

* track all the system crud operations in the mock

* more comprehensive knex mocks

* extract the transaction mock

* fix knex mock

* update mock itemsService usage

* update naming

* rename schemabuilder

* comment out unused knex functions

* WIP service tests

* prettier

* added missing tests for the addColumnIndex function

* renamed __mocks__ folder to __test-utils__ so it doesnt automatically get picked up  by vitest

* remove underscores from test utils folder

---------

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
2025-10-31 15:18:33 -04:00
daedalus
e4089367bd searchable updates (#26082)
* move searchable to meta tab in field detail

* add new meta property to sdk fields type
2025-10-31 11:38:12 -04:00
Brainslug
f885b3c20f Fix skipping properties with undefined value in SDK query parsing (#25952)
* fixed issue of query params falling through to the custom param logic

* moved request test next to its the fille its testing

* added generic type defaults for queryToParams

* fixed extended query type and made query parsing edge cases more explicit

* added tests for the query parsing function

* prettier

* added changeset

* Update sdk/src/rest/utils/query-to-params.ts

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update sdk/src/rest/utils/query-to-params.ts

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update sdk/src/rest/utils/query-to-params.ts

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update sdk/src/rest/utils/query-to-params.ts

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* prettier

* Update sdk/src/rest/utils/query-to-params.ts

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* added test for undefined fields

* added version options to the util

* skip custom keys when `undefined` and using `JSON.stringify` for boolean and number types because they result in the same string as the String constructor

* combined similar tests

* extracted commonly used conditions to utilities and behave more like the old implementation when using strings

* combined direct string workaround tests

* prettier

* added version tests

* Update sdk/src/rest/utils/query-to-params.test.ts

* add versionraw string test

* the prettiest

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
2025-10-10 09:52:15 -04:00
daedalus
68942ab875 Add a connect timeout option to the sdk realtime options (#25349)
* Add default timeout on realtime connection requests

* Prefer reject or error inside promise

* add changeset

* refactoring: fix formating

* add ability to disable connect

---------

Co-authored-by: Gaetan SENN <gaetan.senn@gmail.com>
2025-10-03 16:06:18 +02:00
Hunter Paulson
0fce562087 Fix create and update nested relational items marked as required instead of optional (#25835)
* Changes createItem type to NestedPartial; fixes #21212

* Updates changeset

* Adds `NestedPartial` to more POST/PATCH functions

* Update .changeset/beige-lamps-relate.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/beige-lamps-relate.md

* Fixes sdk item type on additional `POST` and `PATCH` functions

* Update .changeset/beige-lamps-relate.md

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>

* Removes unintended non-nullish type for `data`

* Update sdk/src/rest/commands/update/singleton.ts

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2025-09-26 20:19:21 +02:00
Brainslug
b6a37ca9cb Add the updateFields function to the SDK (#25889)
* Add missing updateFields endpoint

* removed obsolete comment line

* changeset

* Update sdk/src/rest/commands/update/fields.ts

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update sdk/src/rest/commands/update/fields.ts

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
2025-09-26 10:11:33 -04:00
Brainslug
359dcb03a6 Added the updateCommentsBatch function to the SDK (#25866)
* added missing updateCommentsBatch

* do the changeset
2025-09-19 15:32:35 -04:00
ian
17665bf348 Release 11.12.0 (#25850)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2025-09-16 19:42:40 +00:00
daedalus
ca8bdff41f Add mcp support (#25578)
* init

* initial tool

* cleanup

* prefer server over mcpserver

* add admin tool check

* type defineTool

* update ping tool

* improve tool handling

* update tool definition

* rework typres and add initial tool

* add schema to input

* add schema to handler opts

* add system prompt

* rename defineTool types

* Update tool.ts

* handle zod errors

* return correct format

* fix tool list

* prefer names from tool definition

* continue items improv

* return zod as schema output

* pass data down from zod parse

* handle no input schema tool

* update response format

* add handler note

* Ensure collection exists before access

* prefer name in tool file

* remove redundant message

* fix type issue and typo

* sanitize query

* add singleton support

* add remaining item tool commands

* support validate schema

* remove single actions and deleteByQuery

* fix toarray import

* updated tool types

* add back missing rpc message import

* remove unnecessary input schema

* updated tool registration

* separate schema

* removed partial

* remove tool name prefix on schema

* file tool wip

* pass down correct collection for folders/files

* fix global list

* add base64 asset retrieval support

* enable files tool

* add multi tool result type support

* add schema tool

* add missing file schema to files tool

* add create singleton support

* fixed system tool missing inputSchema

* inputschema is not optional

* initial flows tools

* forgot to push the index

* fix closing the connection

* Update server.ts

* format

* revert

* inputSchema is not optional

* add notification handler

* fix tool handlers

* simplified express handler and fixed non-closing get requests from inspector

* add comment

* changed sse error code

* small tweaks

* auto sanitize query

* utilize relevant file/folder service over generic item

* prefer admin flag over explicit check

* add base description

* updated flows

* improve overview command

* dont include invalid field properties

* fix typings for schema overview

* add note to schema overview

* add schema overview interface choices

* reorg

* remove util and default opt out of mcp prevent delete

* fixed unreturned code paths

* fix service typing

* prevent delete should be opt in

* fix import

* fmt

* fix query

* added flows tool test

* added some tool util funcs for better testing

* return deleted keys on item delete

* add item tool tests

* Update items.test.ts

* fix delete for schema tool

* add schema tests

* export the transport class

* make handleRequest async

* await the handleREquest function

* reverted misleading async change

* Added awaiting to server tests

* added some files tests

* fmt

* fix mcp file test types

* move collection, field and relation to their own tools

* Add prompts

* enable trigger flow

* improve prompts

* test wip

* add prompts to build

* remove invalid args for schema tools

* finish collection and field tests

* finish relation tests

* add catalog for mcp sdk

* prefer zod builtin for json schema conversion

* Do not use custom types in json schema

* fix data extraction and validation process

* do not allow additional properties

* MCP -> Schema Tool and Prompt Updates (#25617)

* separate system prompt description and system prompt

* stop duplicating field names to save context

* fetch only collections list first - add keys to fetch detailed schema

* updated schema prompt

* add repeater support for schema tool

* add collection item dropdown support

* items prompt

* long form prompts (need to tighten and condense)

* simplified query schema

* fmt

* Improve typings

* add basic prompt support and add type file

* add query support

* Finalize prompt support

* remove outdata env values

* MCP settings page (#25687)

* Render MCP in all caps

* Bootstrap AI settings page

* Add migration for mcp settings

* Add translations for mcp settings

* Setup fields in system data

* Add more translations

* Add use-collection-validation composable

* Bootstrap mcp prompts validation interface

* Finish settings page

* Add changeset

* Run formatter and resolve stylelint warning

* remove changeset

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* remove unnecessary object strict changes

* revert import ordering

* designate specific file per tool

* default delete to disabled

* account for empty messages

* remove custom type for relation item

* MCP -> Schema Tool -> Add support for relationships (#25693)

* rough in relations for schema detail

* Update schema.ts

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* cleanup schemas

* MCP Settings -> Improvements (#25696)

* add sidebar component for consistency

* add the translations we can for mcp prompts schema

* fix icon for collection

* set proper order

* clean up interaction

* handle edge case where ai prompts collection is deleted but value still saved in settings

* Ignore AI settings in general settings (#25698)

* add system prompt override

* allow disabling system prompt

* add import from url option to files tool

* remove legacy type arg

* add url to result

* add url to flows

* add endpoint for read

* add url display to prompt

* add changeset

* fmt

* Do not utilize custom type in file import

* Improve appearance of v-notice components (in the MCP settings) (#25714)

* add indentContent prop to v-notice for improved alignment of slot content and change appearance of the button inside the v-notice

* add snapshot

* fix mcp system prompt note display

* Add dynamic mimetype and audio support

* Allow disabling mcp feature via env

* update changeset

* MCP -> Update Settings Labels and Notes (#25725)

* update copy for settings labels and descriptions

* add divider

* suggestions from mtkg team

* use success notice when validated

* update validation success msg

* add top notice

* just the endpoint and nothing but the endpoint

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* fix systemPrompt to system_prompt

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* utilize flow service for definition and limit to manual flows

* remove unnecessary check

* fmt

* ensure json expected fields are json

* Update folder tests

* prefer test

* add asset tool tests

* improve mcp test typing for folder and asset

* update collection tests

* prefer plural tool naming

* update field tests

* remove create action for files

* update file tests

* update flow tests

* update item tests

* update operation tests

* update relation tests

* add system tests

* Update trigger flow tests

* reorg asset error test to error handling

* add admin accountability for relation tests

* update schema tests

* prefer test over it

* add admin check

* prefer aftereach for clear mock

* improve protocol error

* MCP -> Possible Relations Tool Fix (#25754)

* remove extra try catch and switch to zod v4 built in errors

* replace custom schemas

* replace schemas

* resolve typing and format

* prefer discriminate union for actions

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* add json rpc error for invalid prompt

* prefer non protocol for tools and fix protocal errors for prompts

* promptsCollection should be optional

* fix server issues

* update server tests

* fix useCollectionValidation tests

* Remove remaining file create artifacts

* Remove custom types to allow proper validation

* restrict access to non public

* adjust schema tool to be non admin

* fix schema tool tests

* add non admin tool check in tests

* allow either field or data.field for relation create

* 405 to indicate no stream support

* ensure system accountability is not admin

* MCP Prompt Cleanup (#25745)

* asset-tool prompt

* trim files prompt

* remove tags example

* remove create from files prompt

* cleanup collection

* cleanup items

* add missing examples to operations

* add xml structure to improve comprehension

* flows and operations improvements

* remove create action from files tool

* fix query schema

* remove reused ref for OpenAI support

* update fields

* cleanup collections

* detailed field example

* cleanup folder

* update relations

* unconfuse folders and collection folders

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* fmt

* FlowItemInputSchema should be partial

* Fix operation tool input schema

* Fix schema tool tests

* MCP -> Improve collections tool prompts (#25781)

* Fix collection <> folder issue

* improve system fields handling

* Add asset downscaling

* fmt

* Add tool title annotation and prefix name with `directus`

* Fix tests for updated naming

* improve asset tests

* Update title to correct location

* Improve `inputSchema` for LLM ingestion (#25789)

* do not use top level unions

* support multi field create

* update prompt

* support transaction al calls on fieldsService methods

* cleanup

---------

Co-authored-by: bryantgillespie <hey@bryantgillespie.com>

* update field tests

* fix relations prompt

* Do not skip internal collections as long as permissions allow

* Update api/src/services/server.ts

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>

* Update app.ts

Co-Authored-By: Brainslug <br41nslug@users.noreply.github.com>

* whoops

* revert ws changes

---------

Co-authored-by: Brainslug <tim@brainslug.nl>
Co-authored-by: Bryant Gillespie <bryant@hireclockwork.com>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
Co-authored-by: Florian C. Wachmann <dev@formfcw.com>
Co-authored-by: bryantgillespie <hey@bryantgillespie.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2025-09-15 22:02:40 +02:00
daedalus
85902b51d0 Replace tsup with tsdown (#25750)
* migrate from tsup to tsdown

* add changeset

* update to latest
2025-09-02 18:02:00 +00:00
Alex Gaillard
f55913653b Release 11.11.0 (#25765) 2025-08-27 18:04:33 +00:00
daedalus
441f08698d Fix auth being cleared before login/refresh request succeeds (#25367)
* Do not clear sdk auth before request succeeds

* add changeset

---------

Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2025-08-20 15:13:50 +02:00
Alex Gaillard
3a561ad801 Release 11.10.1 (#25669) 2025-08-11 18:50:25 +00:00
Rijk van Zanten
21f85040ea Run formatter (#25604) 2025-08-05 14:52:35 -04:00
Rijk van Zanten
c9b81e51a4 Update and move 'simple' dependencies (#25580)
* Update and move 'simple' dependencies

* Add changeset
2025-08-01 14:36:51 -04:00
Matthew Rumery
17bf9be79e Add Services Type support for @directus/extensions (#25368)
* feat: add services type

* refactor: replace UserIntegrityCheckFlag from @directus/types

* refactor: replace AbstractServiceOptions from @directus/types

* refactor: replace MutationOptions from @directus/types

* refactor: replace ActionEventParams from @directus/types

* refactor: replace AbstractService from @directus/types

* refactor: replace Webhook from @directus/types

* refactor: replace Range, Stat, ReadOptions, & ChunkedUploadContent from @directus/types

* refactor: replace asset types from @directus/types

* refactor: replace LoginResult from @directus/types

* refactor: replace snapshot types from @directus/types

* refactor: replace Action & PayloadServiceProcessRelationResult from @directus/types

* refactor: replace ExportFormat from @directus/types

* refactor: replace database types from @directus/types

* feat: implement ExtensionsServices within @directus/extensions

* feat: replace QueryOptions from @directus/types

* fix: formatting issue

* fix: adjust extensions services type

* fix: generic type for each service

* fix: typescript errors for missing imports

* refactor: update ReadOptions & ChunkedUploadContext type exports to pull from @directus/types

* refactor: move DirectusError to @directus/types & add DirectusExtensionsError to @directus/types

* feat: add MailService, GraphQLService, SpecificationService, and move required exports to @directus/types

* refactor: move extension types to @directus/types

* refactor: move extension constants to @directus/constants

* refactor: adjust type imports for @directus/composables

* refactor: adjust imports for @directus/extensions-registry

* refactor: adjust import for @directus/errors

* refactor: adjust imports for @directus/themes

* refactor: adjust imports for @directus/extensions-sdk

* refactor: adjust imports for studio app

* feat: implement ExtensionService and migrate types to @directus/types

* fix: revert sdk type changes

* fix: reexport types moved from @directus/extensions to @directus/types

* fix: remove @directus/themes from @directus/extensions

* refactor: move AppField to fields file

* chore: remove @directus/themes from @directus/types

* chore: remove @directus/extensions from @directus/types

* fix: rebase issue with DirectusError generic

* chore: remove @directus/types from sdk

* fix: add missing exports to original packages

* fix: update getAppExtensionChunk return type

* chore: revert DirectusError changes

* chore: revert Collection fields key

* refactor: rename RawSchemaCollection to ApiCollection

* fix: add RawCollection from @directus/types

* fix: import GraphQLParams from @directus/types

* fix: formatting issue

* chore: add changeset

* chore: revert rename of ApiOutput

* Update .changeset/purple-crews-sink.md

* Update .changeset/purple-crews-sink.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/purple-crews-sink.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/purple-crews-sink.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/purple-crews-sink.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/purple-crews-sink.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/purple-crews-sink.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/purple-crews-sink.md

Co-authored-by: ian <licitdev@gmail.com>

* fix: rebase pnpm-lock error

---------

Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Alex Gaillard <alex@directus.io>
Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com>
2025-07-31 12:54:50 -04:00
Alex Gaillard
e109a6f2d6 Release 11.10.0 (#25557) 2025-07-30 17:12:15 +00:00
Jean Claveau
cc29b626ab Add message property to sdk error (#25474)
* feat(sdk): add a message entry on api error to be catchable normally

* feat(sdk): FetchInterface MUST return unknown to support alternative fetch implementations

* feat(sdk): empty default error message to match js Error spec

* Improve DirectusError type

* add tests

* account for non object reason in message

* add non object reason test

* simplify error message check

* add changeset

* Error result is not necessarily a directus error

* Remove unnecessary errors existence check

---------

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
2025-07-21 09:13:19 -04:00
Rijk van Zanten
e72483fb76 Add Codecov upload on test CI (#25470)
* Add consistent test:coverage scripts

* Add missing coverage deps

* Submit to codecov

* Update .github/workflows/check.yml

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Add codecov config

* Run formatter, remove branches

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2025-07-17 16:29:02 -04:00
Rijk van Zanten
2edbea9386 Move common dependencies to catalog (#25467)
* Update pnpm to v10

* Update package.json

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Allow builds

* Move common dependencies to catalog

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-15 14:40:28 -04:00
Brainslug
cca6ca05f4 Improved output types for relational fields in the SDK (#25428)
* Add type test for the issue

* improve relational output typing

* add more relations to tests

* prettier

* Create slow-toes-study.md
2025-07-11 11:27:59 -04:00
Alex Gaillard
b8a47c621a Release 11.9.0 (#25358) 2025-06-25 17:58:44 +00:00
Nitwel
0e532648e0 Added backlink query param (#25284)
* Added backlink query param

* add to sdk

* fmt

* fix and add more tests

* fmt

* Add check for boolean just in case

Query params should be strings, adding check since type is unknown

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Ensure no duplication

* small fix

* Create shaggy-bears-begin.md

* Update .changeset/shaggy-bears-begin.md

Co-authored-by: ian <licitdev@gmail.com>

---------

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-23 10:12:45 -04:00
daedalus
6258e44ec3 Add ldap support for sdk login and improve refresh/logout consistency (#25132)
* add custom email key support in sdk `login`

* add changeset

* Update login to accept a payload obj instead of email + password

* Improve logout and refresh consistency

* Update changeset

* Add logout/refresh command option param defaults

* Update changeset

* Update gold-frogs-yell.md

* Bring logout/refresh payload conditions inline with composable equivalent

* Add breaking change notes

* Update app sdk usage

* Improve LoginPayload type

* Remove old doc change

* Update changeset

* Update .changeset/gold-frogs-yell.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/gold-frogs-yell.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

* Update .changeset/gold-frogs-yell.md

Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>

---------

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Brainslug <br41nslug@users.noreply.github.com>
2025-06-19 21:59:41 +02:00
Rijk van Zanten
556f36fb42 Add anonymous project id to telemetry (#25300)
* Install uuid

* Add project id on migrate/install

* Include project id in telemetry

* Add changeset

* Fix snapshot

* Use migration timestamp for project_id UUID generation

Updated the migration to use the timestamp from 'directus_migrations' as the msecs value when generating the project_id UUID.

* Fix formatting

* Add into types and sdk

* update changeset

---------

Co-authored-by: ian <licitdev@gmail.com>
Co-authored-by: Connor Winston <connor@winston.guru>
Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com>
2025-06-19 14:48:59 -04:00