| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
Fix WebSocket heartbeat leaking a listener on each ping when a client fails to respond in time (#28117) * deregister listener on timeout * remove redundant code and add no client check * add public handler counters on emitter * add tests * add changesets * ensure removed subscriptions dont persist * changeset adjustments | 2 个月前 | |
Add partial schema support and multi collection import (#27984) * Add support for partial schema snapshots (#27850) * support scoped schema snapshots * expose snapshot collection scoping to the api * add changeset * adjust changeset * error on invalid exclude and include for resolve * improve test coverage * Add a `mode` parameter and partial snapshot support to the schema diff (#27855) * support scoped schema snapshots * expose snapshot collection scoping to the api * add changeset * add support for partial schema and merge mode to schema diff * expose schema diff mode to api * account for system field scoping * add/improve test coverage * adjust changeset * error on invalid exclude and include for resolve * improve test coverage * Update thick-ads-throw.md * Update sdk/src/rest/commands/schema/diff.ts Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> * move to schema folder * add admin check to apply * remove deprecated tests * account for custom system fields in partial diff * Apply suggestion from @ComfortablyCoding --------- Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> * Add support for multi-collection flat data imports (#27852) * claude first shot * move into the existing import-export service * update batch import returned info * remove sdk and openapi changes for now * unify file upload handling * share import concurrency lock * split up import-export file * update references * split up the tests * some cleanup * implement data deletion * extract utils * moved error tracker * added sdk command, openapi spec and updated dry run arg * add changeset * add test coverage * update env var * normalize pk's * fix tests * simplify to deleteByQuery * Update .changeset/import-runs-slowly.md Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> * Update .changeset/import-runs-slowly.md Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> * replace joi with zod * remove redundant check * fix query flag evaluation * use fromZodError * use shouldCacheClear * share file upload and parsing logic * throw forbidden error to prevent enumeration * use getRelationType * moved types and updated service types * remove assertReferencesResolve * use an InvalidQueryError * use dedicated cyclical error * use while instead of for * extract mutation tracker * extract validate-data to util and add tests * update deferred structure * combine some loops * add mutation tracker tests * address o2m data remapping * deferredFields oopsie * Update api/src/utils/build-import-plan.ts Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> * remove sort * use normalizeKey * moved out util functions * use upsert * share queryFlag util * use queryflag and import limit for schema endpoints * add comment * fix duplicate collection error template * fix mssql/oracle FK errors * support singletons * fix no pk in import payload * update changeset * update openapi * update changeset * Update .changeset/import-runs-slowly.md Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> * prettier --------- Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> * unify import handling * prettier * update changeset * linting * Fix folders sanitized from partial schema snapshots (#27991) * account for folders in partial * adjust changeset * add diff mode type * refactor and simplify resolve scope * remove duplicate env definition * fix import path * Update packages/specs/src/paths/utils/import-batch.yaml Co-authored-by: kheiner <open-source-activity-for+directus@heiner.work> * Update packages/specs/src/paths/utils/import-batch.yaml Co-authored-by: kheiner <open-source-activity-for+directus@heiner.work> * Update api/src/utils/schema/is-indexed-system-field.ts Co-authored-by: kheiner <open-source-activity-for+directus@heiner.work> --------- Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> Co-authored-by: Brainslug <tim@brainslug.nl> Co-authored-by: kheiner <open-source-activity-for+directus@heiner.work> | 2 个月前 | |
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> | 9 个月前 | |
Update outdated type definitions for directus_notifications, directus_permissions, directus_extensions, directus_fields, directus_activity, directus_collections, and directus_revisions (#28072) * fix(sdk): narrow collection fields to keyof CompleteSchema<Schema> * fix(sdk): make db-specific fields optional ref: packages/schema/src/types/column.ts * fix(sdk): permissions are nullable * fix(sdk): update extensionSchema with entries * changeset * fix(sdk,types,app): update types for notifications * fix(sdk): permissions.policy is nullable * fix(sdk): handle keyOf in commands * fix(sdk): add missing asandbox options * fix(sdk): collection field typing * use StringLiteralUnion * use CollectionName * use CollectionName for table * use StringLiteralUnion for action * drop dead casts * add StringLiteralUnion to known string enums * add missing system field * add missing system field * schema is nullable * resolve todo's for FieldMeta * use filter operators for field rules * add tests for fields and filter rules * ExtensionSandboxOptions are optional * directus_collection.system is optional & true (never false on GET requests) * throwIfEmpty accepts string | number | unknown[] * drop unnecessary String() casts in notifications commands * drop unnecessary String() casts in permissions/activity/revisions commands * remove duplicate tests * reword changeset * update changeset with notice * drop casts in readNotification and readItemPermissions * trim field type tests * list remaining breaking changes in changeset * type schema.table as string, shorten comment --------- Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> | 20 天前 | |
JSON filtering (#26981) * adding the json operator * adding the json operator * naive implementation * fix array indexing issue * updated postgres tests * basic blackbox tests * fix issue with _in filtering * re-use parseJsonPath function * extract postgres path builder to own file * simplify postgres path building * moved mysql path builder to its own file * rename config properties * fix bug with multiple operators * add more tests * updated test * update test expectations * fixed missing operator exit * support conditional operators * add various edge cases to the bb tests * Adding some extra invalid path checks to parseJsonPath * add some tests to verify the _json operator is excluded from relational depth checks * ensure nested json paths error * bb test for nested json path errors * check to prevent sql injection * support dynamic variables with json filtering * basic json helper tests * fixed bb tests * fix parse-filter * revert for bb tests * updating tests * prettier * changeset * removed unnecessary check * add early return * use options object for better readability * validate json paths early * prettier * removing obsolete comments * JSON sorting and alias support (#26771) * setup basic json database helper stubs * added sqlite support detection * added cockroachdb support detection * added mssql support detection * added mysql support detection * added oracle support detection * added postgres support detection * persist the supported flag for later use * add parseJsonFunction util * fix parsing edge case * move utility function out * moved support logic over to the capabilities helper * adding some capability helper tests * added postgres function implementation * added mysql function implementation * added sqlite function implementation * added mssql function implementation * added oracle function implementation * attempt to make the initial query work * fix array access * parse potential objects returned from DB * adding BB tests * fix json function naming * some cleanup * fix polynomial regex issue, the replacement will not try and capture every parenthesis but only captures the inner one instead * update function syntax to accept colon separation * first attempt at array wildcards * first try at relational json access * adding some blackbox tests * regfactor to comma usage in the function * prettier * fixed field splitting * removed array wildcard support * many-to-any fixes * fixing relational json access * cleanup AST for relational json queries * removed some unused code * fix json payload parsing * added some parsing tests * prettier * parameterize the postgres query to prevent injection * throw an error when the database doesnt support json queries * update some comments * update comments * resolving comments * add test cases from comments * fix some bb test issues * add MAX_JSON_QUERY_DEPTH environment limit * Potential fix for pull request finding 'Unused variable, import, function or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * consistency in comments * update tests for parseFilterFunctionPath * update parseFilterFunctionPath to support multiple function arguments * refactored out `REGEX_BETWEEN_PARENS` usage * disable the max_depth check for now * Removed capabilities check * prettier * happy now cq bot? * throw an InvalidQueryError for better error handling and postgres parsing * update the buildPostgresJsonPath tests too * fix ordering in tests and consistent errors * use mysql and mariadb compatible json path formatting and add the 'cast-json' flag to the test seeding * Fix mssql and oracle non-scalar data querying * fix some incorrect test assertions * initial go at re-using parseFilterFunctionPath * enable depth check * simplify relational function parsing * move env var to top context * fix incorrect relational test assertions * apply pr comments * fix test ordering issue, can we get some green checkmarks * be prettier * fix unit tests for processJsonFunctionResults * pass down jsonPath instead of re-parsing the name * dont parse json for postgres dialects * ensure json casting * test json payload parsing * Update api/src/database/helpers/fn/json/parse-function.ts Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> * update tests with error message * removed obsolete math.min * make use of toPath * extracted splitfields util with tests * rename variable * add extra guards in function parsing * remove redundant extra variable * simplify fieldname parsing * add guards for unsupported syntax * prettier * changeset * update changeset * allow json function usage in aliasses * add blackbox tests for aliasses * fixed alias field parsing issue * initial implementation of json sorting * extracted function name parsing for consistent usage * re-use extractFunctionName util * validate sort functions earlier * adding some extra unit tests * unify json function bb tests * fix test consistency * refactor applyQuery signature * fixed issue with sorting json * correct changeset * fix bb tests attempt 1 * fix bb ordering issue * add sorting exception * merge added boolean flags added * add bb tests for the deep parameter --------- Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * JSON graphql and SDK support (#27080) * setup basic json database helper stubs * added sqlite support detection * added cockroachdb support detection * added mssql support detection * added mysql support detection * added oracle support detection * added postgres support detection * persist the supported flag for later use * add parseJsonFunction util * fix parsing edge case * move utility function out * moved support logic over to the capabilities helper * adding some capability helper tests * added postgres function implementation * added mysql function implementation * added sqlite function implementation * added mssql function implementation * added oracle function implementation * attempt to make the initial query work * fix array access * parse potential objects returned from DB * adding BB tests * fix json function naming * some cleanup * fix polynomial regex issue, the replacement will not try and capture every parenthesis but only captures the inner one instead * update function syntax to accept colon separation * first attempt at array wildcards * first try at relational json access * adding some blackbox tests * regfactor to comma usage in the function * prettier * fixed field splitting * removed array wildcard support * many-to-any fixes * fixing relational json access * cleanup AST for relational json queries * removed some unused code * fix json payload parsing * added some parsing tests * prettier * parameterize the postgres query to prevent injection * throw an error when the database doesnt support json queries * update some comments * update comments * resolving comments * add test cases from comments * fix some bb test issues * add MAX_JSON_QUERY_DEPTH environment limit * Potential fix for pull request finding 'Unused variable, import, function or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * consistency in comments * update tests for parseFilterFunctionPath * update parseFilterFunctionPath to support multiple function arguments * refactored out `REGEX_BETWEEN_PARENS` usage * disable the max_depth check for now * Removed capabilities check * prettier * happy now cq bot? * throw an InvalidQueryError for better error handling and postgres parsing * update the buildPostgresJsonPath tests too * fix ordering in tests and consistent errors * use mysql and mariadb compatible json path formatting and add the 'cast-json' flag to the test seeding * Fix mssql and oracle non-scalar data querying * fix some incorrect test assertions * initial go at re-using parseFilterFunctionPath * enable depth check * simplify relational function parsing * move env var to top context * fix incorrect relational test assertions * apply pr comments * fix test ordering issue, can we get some green checkmarks * be prettier * fix unit tests for processJsonFunctionResults * pass down jsonPath instead of re-parsing the name * dont parse json for postgres dialects * ensure json casting * test json payload parsing * Update api/src/database/helpers/fn/json/parse-function.ts Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> * update tests with error message * removed obsolete math.min * make use of toPath * extracted splitfields util with tests * rename variable * add extra guards in function parsing * remove redundant extra variable * simplify fieldname parsing * add guards for unsupported syntax * prettier * changeset * update changeset * allow json function usage in aliasses * add blackbox tests for aliasses * fixed alias field parsing issue * initial implementation of json sorting * extracted function name parsing for consistent usage * re-use extractFunctionName util * validate sort functions earlier * adding some extra unit tests * unify json function bb tests * fix test consistency * refactor applyQuery signature * fixed issue with sorting json * correct changeset * fix bb tests attempt 1 * fix bb ordering issue * add sorting exception * merge added boolean flags added * add json filter to graphql * add some bb tests * simple json filter type in the sdk * add sdk type tests * implement json function in graphql * add blackbox test for graphql json function * add json function sdk types and tests * add bb tests for the deep parameter * better integrate json function usage with other functions in gql * more specific json filter type in gql * added extra bb tests * fixing sdk output types with json fields * add json function type hinting * attempt to fix bb tests * fix bb test seed * add empty filter key check * prettier indentation * move type to switch case * removed obsolete null --------- Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Ignore eslint import/order in test file * Amend changeset * Delete unnecessary changeset * Potential fix for pull request finding 'Unused variable, import, function or class' Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> * Remove unused vars * Actually fix tests * Format --------- Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> Co-authored-by: Alex Gaillard <alex@directus.io> | 5 个月前 | |
Fix SDK nested relational filters losing type inference (#27815) A relational field typed as the standard array union (e.g. `o2m: number[] | Item[] | null`) made the nested filter permissive: the primitive foreign-key member polluted the mapped filter type, so filtering a related field silently accepted any value (e.g. a string on a numeric id). See #22746. Extract only the related collection type before recursing in NestedRelationalFilter, using the same `Extract<…, ItemType<Schema>>` pattern already used in output.ts/deep.ts. Nested filters now infer and type-check the related collection's fields. Co-authored-by: Brainslug <br41nslug@users.noreply.github.com> | 3 个月前 | |
fix sdk singleton core exclusion (#27196) * fix sdk singleton core exclusion * test: update merge-collection to use TestSchema - clarify that CollectionD is a user-defined singleton (and fixes declaration by removing []) - add test case to ensure core collection existing fields are not modified by user * refactor: prefer throwIfCoreCollection over isSystemCollection see comment https://github.com/directus/directus/pull/27196#issuecomment-4597887108 * style: prettier --write * test: unit tests for createItem | 4 个月前 | |
Update outdated type definitions for `directus_comments`, `directus_flows`, `directus_operations`, `directus_presets`, `directus_roles`, and `directus_versions` (#27956) * fix(api): fall back to empty object for null operation options * fix(types): widen OperationRaw.options to allow null * fix(app): allow null collection in preset FormattedPreset type * fix(types): widen Preset.collection to allow null * fix(api,app): accept null hash in version publish/verify flow * fix(types,sdk): widen ContentVersion.hash/DirectusVersion.hash to allow null * changeset * fix(app): guard against null operation.options in flow editor * fix(types): add null to nullable fields * fix(sdk): add nullable to role.parent * fix(sdk): add flow enums to replace generic string type * changeset * revert: drop directus_shares fix already covered by 27970 changeset: drop directus_shares mention * fix(sdk): narrow collection fields to keyof CompleteSchema<Schema> * Keep verifyHash/mainHash non-nullable, assert hash at guarded call sites * Fix collection field typing * allow non-enforced string in addition to literal * add stringliteralunion for auto-complete * apply StringLiteralUnion to trigger, status and accountability * add collectuinname type * fix(sdk): stop NestedPartial widening StringLiteralUnion fields to string * fix(sdk): simplify NestedUnion and remove dead tuple-union type helpers * fix(sdk): export NestedUnion * changeset * fix(sdk): stop NestedPartial widening StringLiteralUnion to Partial<String.prototype> * test(sdk): stop using request() for typechecking * fix(sdk): remove redundant NestedUnion distributive wrapper * test(sdk): add output-path regression test for flow StringLiteralUnion fields * prettier * improve tests * comment and version are relations via yaml * prefer primitive and builtin types over hardcode * adjust tests * adjust changeset --------- Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> | 1 个月前 | |
SDK Core Field type checking fails (#21089) * updated relational fields to use the complete schema * prettier * Create few-horses-join.md * Revert "updated relational fields to use the complete schema" This reverts commit ac839c0ec86cf75a623c0015f419c6e295ebd567. * Added type test for the core collection fallback * fixed core collection fallback * QoL set default schema for core collections * prettier * removed docs reference --------- Co-authored-by: Rijk van Zanten <rijkvanzanten@me.com> | 2 年前 | |
Update outdated type definitions for `directus_comments`, `directus_flows`, `directus_operations`, `directus_presets`, `directus_roles`, and `directus_versions` (#27956) * fix(api): fall back to empty object for null operation options * fix(types): widen OperationRaw.options to allow null * fix(app): allow null collection in preset FormattedPreset type * fix(types): widen Preset.collection to allow null * fix(api,app): accept null hash in version publish/verify flow * fix(types,sdk): widen ContentVersion.hash/DirectusVersion.hash to allow null * changeset * fix(app): guard against null operation.options in flow editor * fix(types): add null to nullable fields * fix(sdk): add nullable to role.parent * fix(sdk): add flow enums to replace generic string type * changeset * revert: drop directus_shares fix already covered by 27970 changeset: drop directus_shares mention * fix(sdk): narrow collection fields to keyof CompleteSchema<Schema> * Keep verifyHash/mainHash non-nullable, assert hash at guarded call sites * Fix collection field typing * allow non-enforced string in addition to literal * add stringliteralunion for auto-complete * apply StringLiteralUnion to trigger, status and accountability * add collectuinname type * fix(sdk): stop NestedPartial widening StringLiteralUnion fields to string * fix(sdk): simplify NestedUnion and remove dead tuple-union type helpers * fix(sdk): export NestedUnion * changeset * fix(sdk): stop NestedPartial widening StringLiteralUnion to Partial<String.prototype> * test(sdk): stop using request() for typechecking * fix(sdk): remove redundant NestedUnion distributive wrapper * test(sdk): add output-path regression test for flow StringLiteralUnion fields * prettier * improve tests * comment and version are relations via yaml * prefer primitive and builtin types over hardcode * adjust tests * adjust changeset --------- Co-authored-by: judda <44623501+ComfortablyCoding@users.noreply.github.com> | 1 个月前 | |
fix sdk singleton core exclusion (#27196) * fix sdk singleton core exclusion * test: update merge-collection to use TestSchema - clarify that CollectionD is a user-defined singleton (and fixes declaration by removing []) - add test case to ensure core collection existing fields are not modified by user * refactor: prefer throwIfCoreCollection over isSystemCollection see comment https://github.com/directus/directus/pull/27196#issuecomment-4597887108 * style: prettier --write * test: unit tests for createItem | 4 个月前 | |
Update `vitest` to v4 (#28249) * bump dompurify * bump fastify * bump joi * bump qs * override uuid * override @ai-sdk/provider-utils * bump diff and dropped diff types dep * bump express * bump pm2 * bump opentelemetry * changeset * fix broken dompurify unit tests * explicitly add dev jsdom dep * redo lockfile * bump unhead * code migration * add changeset * bump vitest * update v4 mocks * update mocking * fix mock function usage * fix remaining test failures * redo lockfile * fix unit tests * type import fixes * attempt to fix bb vistest pool * fix test nesting * remove blackbox change * add flaky test retries * add test command to ai package * exclude types/node for sdk src --------- Co-authored-by: Nitwel <mail@nitwel.de> Co-authored-by: daedalus <44623501+ComfortablyCoding@users.noreply.github.com> | 1 个月前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 2 个月前 | ||
| 2 个月前 | ||
| 9 个月前 | ||
| 20 天前 | ||
| 5 个月前 | ||
| 3 个月前 | ||
| 4 个月前 | ||
| 1 个月前 | ||
| 2 年前 | ||
| 1 个月前 | ||
| 4 个月前 | ||
| 1 个月前 |