Skip to content

Update outdated type definitions for directus_notifications, directus_permissions, directus_extensions, directus_fields, directus_activity, directus_collections, and directus_revisions - #28072

Draft
kheiner wants to merge 15 commits into
directus:mainfrom
kheiner:fix/28065

Conversation

@kheiner

@kheiner kheiner commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Caution

BLOCKED: Uses a pattern for StringLiteralUnion and CollectionName that are introduced in #27956

What's Changed

  • directus_notifications: id typed number (was string) in @directus/types and @directus/sdk; status/timestamp in @directus/types now match the DB (status not-nullable, timestamp nullable)
  • directus_permissions: policy stays nullable in @directus/sdk (Thanks Judda!)
  • directus_extensions: DirectusExtension['schema'] in @directus/sdk expanded to match ApiOutput.schema, including the entries array shape
  • directus_fields: schema.schema, schema.comment, and schema.foreign_key_schema marked optional in @directus/sdk (DB-specific, not always present); generation_expression corrected to string | null and made optional
  • Collection-name FK fields (notification.ts, permission.ts, field.ts, collection.ts, revision.ts, activity.ts) narrowed from bare string to keyof CompleteSchema<Schema>
  • Fixed fallout in @directus/sdk REST commands

Tested Scenarios

  • pnpm --filter @directus/sdk test
  • Verified each finding against the relevant migration and, for directus_permissions, against api/src/services/permissions.ts + api/src/permissions/lib/with-app-minimal-permissions.ts

Review Notes / Questions / Concerns

  • Type-only changes, no runtime behavior affected
  • Permission.policy in @directus/types was intentionally left untouched (nullable) it's shared with synthetic permission objects built in memory, unrelated to this SDK fix

Checklist

Leave unchecked where not applicable

  • Tests added/updated
  • Documentation PR created in directus/docs
  • OpenAPI updated
  • SDK (@directus/sdk) updated to reflect the changes
  • Types (@directus/types) updated to reflect the changes
  • GraphQL schema updated to reflect the changes
  • System data (@directus/system-data) updated for changes to system collections/fields/relations
  • Database migration added for schema/system changes
  • Environment variables documented for new/changed config
  • App translations added for new user-facing strings
  • Security implications apply

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@directus/sdk/@directus/types shape drift across directus_notifications, directus_permissions, directus_extensions, and directus_fields

1 participant