@directus/api 15.0.0 → 17.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/dist/app.js +6 -4
  2. package/dist/auth/drivers/ldap.js +7 -4
  3. package/dist/auth/drivers/local.js +3 -2
  4. package/dist/auth/drivers/oauth2.js +9 -2
  5. package/dist/auth/drivers/openid.js +9 -2
  6. package/dist/auth/drivers/saml.js +6 -4
  7. package/dist/auth.js +7 -4
  8. package/dist/bus/index.d.ts +1 -0
  9. package/dist/bus/index.js +1 -0
  10. package/dist/bus/lib/use-bus.d.ts +9 -0
  11. package/dist/bus/lib/use-bus.js +21 -0
  12. package/dist/cache.js +9 -9
  13. package/dist/cli/commands/bootstrap/index.js +6 -2
  14. package/dist/cli/commands/count/index.js +2 -1
  15. package/dist/cli/commands/database/install.js +2 -1
  16. package/dist/cli/commands/database/migrate.js +2 -1
  17. package/dist/cli/commands/roles/create.js +2 -1
  18. package/dist/cli/commands/schema/apply.js +2 -1
  19. package/dist/cli/commands/schema/snapshot.js +6 -5
  20. package/dist/cli/commands/users/create.js +4 -3
  21. package/dist/cli/commands/users/passwd.js +5 -4
  22. package/dist/cli/load-extensions.js +4 -2
  23. package/dist/cli/utils/create-env/env-stub.liquid +1 -1
  24. package/dist/constants.d.ts +1 -1
  25. package/dist/constants.js +4 -1
  26. package/dist/controllers/assets.js +5 -3
  27. package/dist/controllers/auth.js +5 -4
  28. package/dist/controllers/extensions.js +18 -6
  29. package/dist/controllers/files.js +3 -3
  30. package/dist/controllers/permissions.js +11 -2
  31. package/dist/controllers/schema.js +3 -2
  32. package/dist/controllers/shares.js +3 -3
  33. package/dist/controllers/utils.js +13 -32
  34. package/dist/database/helpers/index.d.ts +1 -1
  35. package/dist/database/index.js +9 -2
  36. package/dist/database/migrations/20210518A-add-foreign-key-constraints.js +3 -1
  37. package/dist/database/migrations/20210519A-add-system-fk-triggers.js +3 -1
  38. package/dist/database/migrations/20210802A-replace-groups.js +2 -1
  39. package/dist/database/migrations/20230721A-require-shares-fields.js +2 -1
  40. package/dist/database/migrations/20231215A-add-focalpoints.d.ts +3 -0
  41. package/dist/database/migrations/20231215A-add-focalpoints.js +12 -0
  42. package/dist/database/migrations/run.js +2 -1
  43. package/dist/database/run-ast.js +5 -2
  44. package/dist/database/system-data/app-access-permissions/app-access-permissions.yaml +0 -7
  45. package/dist/database/system-data/fields/files.yaml +16 -0
  46. package/dist/emitter.js +3 -1
  47. package/dist/extensions/lib/get-extensions-path.d.ts +1 -1
  48. package/dist/extensions/lib/get-extensions-path.js +2 -1
  49. package/dist/extensions/lib/get-extensions.d.ts +1 -1
  50. package/dist/extensions/lib/get-extensions.js +32 -8
  51. package/dist/extensions/lib/get-shared-deps-mapping.js +6 -4
  52. package/dist/extensions/lib/sandbox/register/call-reference.js +4 -2
  53. package/dist/extensions/lib/sandbox/sdk/generators/log.js +2 -1
  54. package/dist/extensions/lib/sync-extensions.js +6 -4
  55. package/dist/extensions/manager.js +43 -19
  56. package/dist/flows.js +13 -7
  57. package/dist/logger.d.ts +7 -7
  58. package/dist/logger.js +116 -92
  59. package/dist/mailer.js +4 -2
  60. package/dist/middleware/cache.js +4 -2
  61. package/dist/middleware/check-ip.js +25 -6
  62. package/dist/middleware/cors.js +2 -1
  63. package/dist/middleware/error-handler.js +5 -5
  64. package/dist/middleware/rate-limiter-global.js +4 -2
  65. package/dist/middleware/rate-limiter-ip.js +2 -1
  66. package/dist/middleware/respond.js +5 -3
  67. package/dist/operations/log/index.js +2 -1
  68. package/dist/rate-limiter.d.ts +2 -1
  69. package/dist/rate-limiter.js +5 -2
  70. package/dist/redis/index.d.ts +3 -2
  71. package/dist/redis/index.js +3 -2
  72. package/dist/redis/{create-redis.js → lib/create-redis.js} +2 -2
  73. package/dist/redis/utils/redis-config-available.d.ts +4 -0
  74. package/dist/redis/utils/redis-config-available.js +8 -0
  75. package/dist/request/request-interceptor.js +7 -5
  76. package/dist/request/response-interceptor.js +2 -2
  77. package/dist/request/validate-ip.d.ts +1 -1
  78. package/dist/request/validate-ip.js +23 -7
  79. package/dist/server.js +11 -7
  80. package/dist/services/activity.js +5 -4
  81. package/dist/services/assets.d.ts +2 -0
  82. package/dist/services/assets.js +9 -6
  83. package/dist/services/authentication.js +17 -9
  84. package/dist/services/authorization.d.ts +1 -1
  85. package/dist/services/authorization.js +15 -3
  86. package/dist/services/collections.js +5 -4
  87. package/dist/services/extensions.d.ts +15 -9
  88. package/dist/services/extensions.js +74 -39
  89. package/dist/services/fields.js +9 -4
  90. package/dist/services/files.d.ts +2 -2
  91. package/dist/services/files.js +22 -14
  92. package/dist/services/graphql/index.js +46 -3
  93. package/dist/services/graphql/subscription.js +2 -2
  94. package/dist/services/graphql/types/bigint.js +16 -5
  95. package/dist/services/graphql/utils/process-error.d.ts +4 -1
  96. package/dist/services/graphql/utils/process-error.js +10 -8
  97. package/dist/services/{import-export/index.d.ts → import-export.d.ts} +1 -1
  98. package/dist/services/{import-export/index.js → import-export.js} +14 -12
  99. package/dist/services/index.d.ts +1 -1
  100. package/dist/services/index.js +1 -1
  101. package/dist/services/items.js +12 -8
  102. package/dist/services/mail/index.js +4 -2
  103. package/dist/services/notifications.js +7 -3
  104. package/dist/services/permissions.d.ts +3 -2
  105. package/dist/services/permissions.js +76 -1
  106. package/dist/services/relations.js +19 -10
  107. package/dist/services/roles.js +83 -15
  108. package/dist/services/server.js +7 -5
  109. package/dist/services/shares.js +3 -2
  110. package/dist/services/specifications.js +2 -1
  111. package/dist/services/users.js +20 -9
  112. package/dist/services/versions.js +6 -5
  113. package/dist/services/webhooks.d.ts +2 -2
  114. package/dist/services/webhooks.js +2 -2
  115. package/dist/services/websocket.d.ts +1 -1
  116. package/dist/services/websocket.js +4 -3
  117. package/dist/storage/register-drivers.js +2 -1
  118. package/dist/storage/register-locations.js +2 -1
  119. package/dist/synchronization.js +3 -1
  120. package/dist/telemetry/lib/get-report.js +1 -1
  121. package/dist/telemetry/lib/init-telemetry.js +2 -2
  122. package/dist/telemetry/lib/send-report.js +1 -1
  123. package/dist/telemetry/lib/track.js +2 -3
  124. package/dist/telemetry/utils/get-user-count.js +1 -1
  125. package/dist/types/assets.d.ts +2 -0
  126. package/dist/types/items.d.ts +4 -12
  127. package/dist/types/items.js +0 -4
  128. package/dist/utils/apply-diff.js +2 -1
  129. package/dist/utils/apply-query.js +0 -11
  130. package/dist/utils/delete-from-require-cache.js +2 -1
  131. package/dist/utils/get-accountability-for-token.js +3 -2
  132. package/dist/utils/get-auth-providers.js +2 -1
  133. package/dist/utils/get-cache-headers.js +5 -2
  134. package/dist/utils/get-config-from-env.js +2 -1
  135. package/dist/utils/get-default-value.js +4 -3
  136. package/dist/utils/get-ip-from-req.js +4 -2
  137. package/dist/utils/get-permissions.js +5 -3
  138. package/dist/utils/get-schema.js +5 -2
  139. package/dist/utils/get-snapshot-diff.js +7 -9
  140. package/dist/utils/get-snapshot.js +4 -4
  141. package/dist/utils/ip-in-networks.d.ts +6 -0
  142. package/dist/utils/ip-in-networks.js +13 -0
  143. package/dist/utils/is-url-allowed.js +2 -1
  144. package/dist/utils/job-queue.d.ts +1 -0
  145. package/dist/utils/job-queue.js +3 -0
  146. package/dist/utils/sanitize-query.js +7 -2
  147. package/dist/utils/sanitize-schema.d.ts +1 -1
  148. package/dist/utils/should-clear-cache.js +2 -1
  149. package/dist/utils/should-skip-cache.js +2 -1
  150. package/dist/utils/transformations.js +95 -12
  151. package/dist/utils/validate-env.js +4 -2
  152. package/dist/utils/validate-query.js +7 -3
  153. package/dist/utils/validate-storage.js +4 -2
  154. package/dist/webhooks.js +4 -3
  155. package/dist/websocket/controllers/base.js +12 -6
  156. package/dist/websocket/controllers/graphql.js +4 -2
  157. package/dist/websocket/controllers/hooks.js +3 -2
  158. package/dist/websocket/controllers/index.js +4 -2
  159. package/dist/websocket/controllers/rest.js +4 -2
  160. package/dist/websocket/errors.js +2 -1
  161. package/dist/websocket/handlers/heartbeat.js +4 -3
  162. package/dist/websocket/handlers/subscribe.d.ts +2 -2
  163. package/dist/websocket/handlers/subscribe.js +5 -4
  164. package/package.json +57 -57
  165. package/dist/__utils__/items-utils.d.ts +0 -2
  166. package/dist/__utils__/items-utils.js +0 -31
  167. package/dist/__utils__/mock-env.d.ts +0 -18
  168. package/dist/__utils__/mock-env.js +0 -41
  169. package/dist/__utils__/schemas.d.ts +0 -13
  170. package/dist/__utils__/schemas.js +0 -301
  171. package/dist/__utils__/snapshots.d.ts +0 -5
  172. package/dist/__utils__/snapshots.js +0 -903
  173. package/dist/env.d.ts +0 -14
  174. package/dist/env.js +0 -511
  175. package/dist/messenger.d.ts +0 -24
  176. package/dist/messenger.js +0 -64
  177. package/dist/services/import-export/import-worker.d.ts +0 -9
  178. package/dist/services/import-export/import-worker.js +0 -9
  179. package/dist/utils/to-boolean.d.ts +0 -4
  180. package/dist/utils/to-boolean.js +0 -6
  181. package/dist/worker-pool.d.ts +0 -2
  182. package/dist/worker-pool.js +0 -19
  183. /package/dist/redis/{create-redis.d.ts → lib/create-redis.d.ts} +0 -0
  184. /package/dist/redis/{use-redis.d.ts → lib/use-redis.d.ts} +0 -0
  185. /package/dist/redis/{use-redis.js → lib/use-redis.js} +0 -0
package/dist/webhooks.js CHANGED
@@ -1,7 +1,7 @@
1
+ import { useBus } from './bus/index.js';
1
2
  import getDatabase from './database/index.js';
2
3
  import emitter from './emitter.js';
3
- import logger from './logger.js';
4
- import { getMessenger } from './messenger.js';
4
+ import { useLogger } from './logger.js';
5
5
  import { getAxios } from './request/index.js';
6
6
  import { WebhooksService } from './services/webhooks.js';
7
7
  import { getSchema } from './utils/get-schema.js';
@@ -10,7 +10,7 @@ let registered = [];
10
10
  const reloadQueue = new JobQueue();
11
11
  export async function init() {
12
12
  await register();
13
- const messenger = getMessenger();
13
+ const messenger = useBus();
14
14
  messenger.subscribe('webhooks', (event) => {
15
15
  if (event['type'] === 'reload') {
16
16
  reloadQueue.enqueue(async () => {
@@ -42,6 +42,7 @@ export function unregister() {
42
42
  registered = [];
43
43
  }
44
44
  function createHandler(webhook, event) {
45
+ const logger = useLogger();
45
46
  return async (meta, context) => {
46
47
  if (webhook.collections.includes(meta['collection']) === false)
47
48
  return;
@@ -1,15 +1,14 @@
1
- import { parseJSON } from '@directus/utils';
1
+ import { useEnv } from '@directus/env';
2
+ import { InvalidProviderConfigError, TokenExpiredError } from '@directus/errors';
3
+ import { parseJSON, toBoolean } from '@directus/utils';
2
4
  import { parse } from 'url';
3
5
  import { v4 as uuid } from 'uuid';
4
6
  import WebSocket, { WebSocketServer } from 'ws';
5
7
  import { fromZodError } from 'zod-validation-error';
6
8
  import emitter from '../../emitter.js';
7
- import env from '../../env.js';
8
- import { InvalidProviderConfigError, TokenExpiredError } from '@directus/errors';
9
- import logger from '../../logger.js';
9
+ import { useLogger } from '../../logger.js';
10
10
  import { createRateLimiter } from '../../rate-limiter.js';
11
11
  import { getAccountabilityForToken } from '../../utils/get-accountability-for-token.js';
12
- import { toBoolean } from '../../utils/to-boolean.js';
13
12
  import { authenticateConnection, authenticationSuccess } from '../authenticate.js';
14
13
  import { WebSocketError, handleWebSocketError } from '../errors.js';
15
14
  import { AuthMode, WebSocketAuthMessage, WebSocketMessage } from '../messages.js';
@@ -18,6 +17,7 @@ import { getMessageType } from '../utils/message.js';
18
17
  import { waitForAnyMessage, waitForMessageType } from '../utils/wait-for-message.js';
19
18
  import { registerWebSocketEvents } from './hooks.js';
20
19
  const TOKEN_CHECK_INTERVAL = 15 * 60 * 1000; // 15 minutes
20
+ const logger = useLogger();
21
21
  export default class SocketController {
22
22
  server;
23
23
  clients;
@@ -27,7 +27,11 @@ export default class SocketController {
27
27
  rateLimiter;
28
28
  authInterval;
29
29
  constructor(httpServer, configPrefix) {
30
- this.server = new WebSocketServer({ noServer: true });
30
+ this.server = new WebSocketServer({
31
+ noServer: true,
32
+ // @ts-ignore TODO Remove once @types/ws has been updated
33
+ autoPong: false,
34
+ });
31
35
  this.clients = new Set();
32
36
  this.authInterval = null;
33
37
  const { endpoint, authentication, maxConnections } = this.getEnvironmentConfig(configPrefix);
@@ -40,6 +44,7 @@ export default class SocketController {
40
44
  registerWebSocketEvents();
41
45
  }
42
46
  getEnvironmentConfig(configPrefix) {
47
+ const env = useEnv();
43
48
  const endpoint = String(env[`${configPrefix}_PATH`]);
44
49
  const authMode = AuthMode.safeParse(String(env[`${configPrefix}_AUTH`]).toLowerCase());
45
50
  const authTimeout = Number(env[`${configPrefix}_AUTH_TIMEOUT`]) * 1000;
@@ -60,6 +65,7 @@ export default class SocketController {
60
65
  };
61
66
  }
62
67
  getRateLimiter() {
68
+ const env = useEnv();
63
69
  if (toBoolean(env['RATE_LIMITER_ENABLED']) === true) {
64
70
  return createRateLimiter('RATE_LIMITER', {
65
71
  keyPrefix: 'websocket',
@@ -1,6 +1,6 @@
1
+ import { useEnv } from '@directus/env';
1
2
  import { CloseCode, MessageType, makeServer } from 'graphql-ws';
2
- import env from '../../env.js';
3
- import logger from '../../logger.js';
3
+ import { useLogger } from '../../logger.js';
4
4
  import { bindPubSub } from '../../services/graphql/subscription.js';
5
5
  import { GraphQLService } from '../../services/index.js';
6
6
  import { getSchema } from '../../utils/get-schema.js';
@@ -9,10 +9,12 @@ import { handleWebSocketError } from '../errors.js';
9
9
  import { ConnectionParams, WebSocketMessage } from '../messages.js';
10
10
  import { getMessageType } from '../utils/message.js';
11
11
  import SocketController from './base.js';
12
+ const logger = useLogger();
12
13
  export class GraphQLSubscriptionController extends SocketController {
13
14
  gql;
14
15
  constructor(httpServer) {
15
16
  super(httpServer, 'WEBSOCKETS_GRAPHQL');
17
+ const env = useEnv();
16
18
  this.server.on('connection', (ws, auth) => {
17
19
  this.bindEvents(this.createClient(ws, auth));
18
20
  });
@@ -1,5 +1,5 @@
1
+ import { useBus } from '../../bus/index.js';
1
2
  import emitter from '../../emitter.js';
2
- import { getMessenger } from '../../messenger.js';
3
3
  let actionsRegistered = false;
4
4
  export function registerWebSocketEvents() {
5
5
  if (actionsRegistered)
@@ -21,6 +21,7 @@ export function registerWebSocketEvents() {
21
21
  'settings',
22
22
  'shares',
23
23
  'users',
24
+ 'versions',
24
25
  'webhooks',
25
26
  ]);
26
27
  registerFieldsHooks();
@@ -128,7 +129,7 @@ function registerSortHooks() {
128
129
  * @param transform Transformer function
129
130
  */
130
131
  function registerAction(event, transform) {
131
- const messenger = getMessenger();
132
+ const messenger = useBus();
132
133
  emitter.onAction(event, async (data) => {
133
134
  // push the event through the Redis pub/sub
134
135
  messenger.publish('websocket.event', transform(data));
@@ -1,10 +1,11 @@
1
- import env from '../../env.js';
2
- import { toBoolean } from '../../utils/to-boolean.js';
1
+ import { useEnv } from '@directus/env';
2
+ import { toBoolean } from '@directus/utils';
3
3
  import { GraphQLSubscriptionController } from './graphql.js';
4
4
  import { WebSocketController } from './rest.js';
5
5
  let websocketController;
6
6
  let subscriptionController;
7
7
  export function createWebSocketController(server) {
8
+ const env = useEnv();
8
9
  if (toBoolean(env['WEBSOCKETS_REST_ENABLED'])) {
9
10
  websocketController = new WebSocketController(server);
10
11
  }
@@ -13,6 +14,7 @@ export function getWebSocketController() {
13
14
  return websocketController;
14
15
  }
15
16
  export function createSubscriptionController(server) {
17
+ const env = useEnv();
16
18
  if (toBoolean(env['WEBSOCKETS_GRAPHQL_ENABLED'])) {
17
19
  subscriptionController = new GraphQLSubscriptionController(server);
18
20
  }
@@ -1,14 +1,16 @@
1
+ import { useEnv } from '@directus/env';
1
2
  import { parseJSON } from '@directus/utils';
2
3
  import emitter from '../../emitter.js';
3
- import env from '../../env.js';
4
- import logger from '../../logger.js';
4
+ import { useLogger } from '../../logger.js';
5
5
  import { refreshAccountability } from '../authenticate.js';
6
6
  import { WebSocketError, handleWebSocketError } from '../errors.js';
7
7
  import { WebSocketMessage } from '../messages.js';
8
8
  import SocketController from './base.js';
9
+ const logger = useLogger();
9
10
  export class WebSocketController extends SocketController {
10
11
  constructor(httpServer) {
11
12
  super(httpServer, 'WEBSOCKETS_REST');
13
+ const env = useEnv();
12
14
  this.server.on('connection', (ws, auth) => {
13
15
  this.bindEvents(this.createClient(ws, auth));
14
16
  });
@@ -1,7 +1,7 @@
1
1
  import { isDirectusError } from '@directus/errors';
2
2
  import { ZodError } from 'zod';
3
3
  import { fromZodError } from 'zod-validation-error';
4
- import logger from '../logger.js';
4
+ import { useLogger } from '../logger.js';
5
5
  export class WebSocketError extends Error {
6
6
  type;
7
7
  code;
@@ -38,6 +38,7 @@ export class WebSocketError extends Error {
38
38
  }
39
39
  }
40
40
  export function handleWebSocketError(client, error, type) {
41
+ const logger = useLogger();
41
42
  if (isDirectusError(error)) {
42
43
  client.send(WebSocketError.fromError(error, type).toMessage());
43
44
  return;
@@ -1,10 +1,11 @@
1
+ import { useEnv } from '@directus/env';
2
+ import { ServiceUnavailableError } from '@directus/errors';
3
+ import { toBoolean } from '@directus/utils';
1
4
  import emitter from '../../emitter.js';
2
- import env from '../../env.js';
3
- import { toBoolean } from '../../utils/to-boolean.js';
4
5
  import { WebSocketController, getWebSocketController } from '../controllers/index.js';
5
6
  import { WebSocketMessage } from '../messages.js';
6
7
  import { fmtMessage, getMessageType } from '../utils/message.js';
7
- import { ServiceUnavailableError } from '@directus/errors';
8
+ const env = useEnv();
8
9
  const HEARTBEAT_FREQUENCY = Number(env['WEBSOCKETS_HEARTBEAT_PERIOD']) * 1000;
9
10
  export class HeartbeatHandler {
10
11
  pulse;
@@ -1,4 +1,4 @@
1
- import type { Messenger } from '../../messenger.js';
1
+ import { type Bus } from '@directus/memory';
2
2
  import type { WebSocketEvent } from '../messages.js';
3
3
  import { WebSocketSubscribeMessage } from '../messages.js';
4
4
  import type { Subscription, WebSocketClient } from '../types.js';
@@ -7,7 +7,7 @@ import type { Subscription, WebSocketClient } from '../types.js';
7
7
  */
8
8
  export declare class SubscribeHandler {
9
9
  subscriptions: Record<string, Set<Subscription>>;
10
- protected messenger: Messenger;
10
+ protected messenger: Bus;
11
11
  /**
12
12
  * Initialize the handler
13
13
  */
@@ -1,13 +1,14 @@
1
- import emitter from '../../emitter.js';
2
1
  import { InvalidPayloadError } from '@directus/errors';
3
- import { getMessenger } from '../../messenger.js';
2
+ import {} from '@directus/memory';
3
+ import { useBus } from '../../bus/index.js';
4
+ import emitter from '../../emitter.js';
4
5
  import { getSchema } from '../../utils/get-schema.js';
5
6
  import { sanitizeQuery } from '../../utils/sanitize-query.js';
6
7
  import { refreshAccountability } from '../authenticate.js';
7
8
  import { WebSocketError, handleWebSocketError } from '../errors.js';
8
9
  import { WebSocketSubscribeMessage } from '../messages.js';
9
- import { fmtMessage, getMessageType } from '../utils/message.js';
10
10
  import { getPayload } from '../utils/items.js';
11
+ import { fmtMessage, getMessageType } from '../utils/message.js';
11
12
  /**
12
13
  * Handler responsible for subscriptions
13
14
  */
@@ -21,7 +22,7 @@ export class SubscribeHandler {
21
22
  */
22
23
  constructor() {
23
24
  this.subscriptions = {};
24
- this.messenger = getMessenger();
25
+ this.messenger = useBus();
25
26
  this.bindWebSocket();
26
27
  // listen to the Redis pub/sub and dispatch
27
28
  this.messenger.subscribe('websocket.event', (message) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@directus/api",
3
- "version": "15.0.0",
3
+ "version": "17.0.0",
4
4
  "description": "Directus is a real-time API and App dashboard for managing SQL database content",
5
5
  "keywords": [
6
6
  "directus",
@@ -59,7 +59,7 @@
59
59
  ],
60
60
  "dependencies": {
61
61
  "@authenio/samlify-node-xmllint": "2.0.0",
62
- "@aws-sdk/client-ses": "3.478.0",
62
+ "@aws-sdk/client-ses": "3.511.0",
63
63
  "@directus/format-title": "10.1.0",
64
64
  "@godaddy/terminus": "4.12.1",
65
65
  "@rollup/plugin-alias": "5.1.0",
@@ -67,7 +67,7 @@
67
67
  "@rollup/plugin-virtual": "3.0.2",
68
68
  "argon2": "0.31.2",
69
69
  "async": "3.2.5",
70
- "axios": "1.6.2",
70
+ "axios": "1.6.7",
71
71
  "busboy": "1.6.0",
72
72
  "bytes": "3.1.2",
73
73
  "camelcase": "8.0.0",
@@ -78,27 +78,28 @@
78
78
  "cookie-parser": "1.4.6",
79
79
  "cors": "2.8.5",
80
80
  "cron-parser": "4.9.0",
81
- "date-fns": "3.0.1",
81
+ "date-fns": "3.3.1",
82
82
  "deep-diff": "1.0.2",
83
83
  "destroy": "1.2.0",
84
- "dotenv": "16.3.1",
84
+ "dotenv": "16.4.1",
85
85
  "encodeurl": "1.0.2",
86
86
  "eventemitter2": "6.4.9",
87
87
  "execa": "8.0.1",
88
- "exif-reader": "1.2.0",
88
+ "exif-reader": "2.0.1",
89
89
  "express": "4.18.2",
90
90
  "flat": "6.0.1",
91
91
  "fs-extra": "11.2.0",
92
92
  "glob-to-regexp": "0.4.1",
93
93
  "graphql": "16.8.1",
94
94
  "graphql-compose": "9.0.10",
95
- "graphql-ws": "5.14.2",
95
+ "graphql-ws": "5.14.3",
96
96
  "helmet": "7.1.0",
97
97
  "icc": "3.0.0",
98
- "inquirer": "9.2.12",
98
+ "inquirer": "9.2.14",
99
99
  "ioredis": "5.3.2",
100
- "isolated-vm": "4.6.0",
101
- "joi": "17.11.0",
100
+ "ip-matching": "2.1.2",
101
+ "isolated-vm": "4.7.2",
102
+ "joi": "17.12.0",
102
103
  "js-yaml": "4.1.0",
103
104
  "js2xmlparser": "5.0.0",
104
105
  "json2csv": "5.0.7",
@@ -108,61 +109,62 @@
108
109
  "ldapjs": "2.3.3",
109
110
  "liquidjs": "10.10.0",
110
111
  "lodash-es": "4.17.21",
111
- "marked": "11.1.0",
112
+ "marked": "11.2.0",
112
113
  "micromustache": "8.0.3",
113
114
  "mime-types": "2.1.35",
114
115
  "minimatch": "9.0.3",
115
116
  "ms": "2.1.3",
116
- "nanoid": "5.0.4",
117
+ "nanoid": "5.0.5",
117
118
  "node-machine-id": "1.1.12",
118
119
  "node-schedule": "2.1.1",
119
- "nodemailer": "6.9.7",
120
+ "nodemailer": "6.9.9",
120
121
  "object-hash": "3.0.0",
121
- "openapi3-ts": "4.2.0",
122
- "openid-client": "5.6.1",
123
- "ora": "7.0.1",
122
+ "openapi3-ts": "4.2.1",
123
+ "openid-client": "5.6.4",
124
+ "ora": "8.0.1",
124
125
  "otplib": "12.0.1",
125
126
  "p-limit": "5.0.0",
126
127
  "p-queue": "8.0.1",
127
128
  "papaparse": "5.4.1",
128
- "pino": "8.17.1",
129
- "pino-http": "8.6.0",
129
+ "pino": "8.18.0",
130
+ "pino-http": "9.0.0",
130
131
  "pino-http-print": "3.1.0",
131
- "pino-pretty": "10.3.0",
132
+ "pino-pretty": "10.3.1",
132
133
  "qs": "6.11.2",
133
- "rate-limiter-flexible": "4.0.0",
134
- "rollup": "4.9.1",
134
+ "rate-limiter-flexible": "4.0.1",
135
+ "rollup": "4.9.6",
135
136
  "samlify": "2.8.10",
136
137
  "sanitize-html": "2.11.0",
137
- "sharp": "0.33.1",
138
+ "sharp": "0.33.2",
138
139
  "snappy": "7.2.2",
139
140
  "stream-json": "1.8.0",
140
- "tinypool": "0.8.1",
141
141
  "tsx": "4.7.0",
142
142
  "uuid": "9.0.1",
143
143
  "uuid-validate": "0.0.3",
144
144
  "wellknown": "0.5.0",
145
- "ws": "8.15.1",
145
+ "ws": "8.16.0",
146
146
  "zod": "3.22.4",
147
- "zod-validation-error": "2.1.0",
148
- "@directus/constants": "11.0.2",
149
- "@directus/extensions": "0.2.1",
150
- "@directus/errors": "0.2.1",
151
- "@directus/app": "10.13.3",
152
- "@directus/extensions-sdk": "10.3.0",
153
- "@directus/pressure": "1.0.14",
154
- "@directus/specs": "10.2.5",
155
- "@directus/storage": "10.0.8",
156
- "@directus/storage-driver-azure": "10.0.15",
147
+ "zod-validation-error": "3.0.0",
148
+ "@directus/app": "10.15.0",
149
+ "@directus/env": "1.0.1",
150
+ "@directus/extensions": "0.3.1",
151
+ "@directus/errors": "0.2.2",
152
+ "@directus/constants": "11.0.3",
153
+ "@directus/extensions-sdk": "10.3.2",
154
+ "@directus/memory": "1.0.1",
155
+ "@directus/pressure": "1.0.15",
157
156
  "@directus/schema": "11.0.1",
158
- "@directus/storage-driver-cloudinary": "10.0.15",
159
- "@directus/storage-driver-gcs": "10.0.15",
160
- "@directus/storage-driver-local": "10.0.15",
161
- "@directus/validation": "0.0.10",
162
- "@directus/utils": "11.0.3",
163
- "@directus/storage-driver-s3": "10.0.15",
164
- "@directus/storage-driver-supabase": "1.0.7",
165
- "directus": "10.8.3"
157
+ "@directus/specs": "10.2.6",
158
+ "@directus/storage": "10.0.9",
159
+ "@directus/storage-driver-azure": "10.0.16",
160
+ "@directus/storage-driver-cloudinary": "10.0.16",
161
+ "@directus/storage-driver-gcs": "10.0.16",
162
+ "@directus/storage-driver-local": "10.0.16",
163
+ "@directus/storage-driver-supabase": "1.0.8",
164
+ "@directus/storage-driver-s3": "10.0.16",
165
+ "@directus/validation": "0.0.11",
166
+ "@directus/utils": "11.0.4",
167
+ "directus": "10.9.1"
166
168
  },
167
169
  "devDependencies": {
168
170
  "@ngneat/falso": "7.1.1",
@@ -175,9 +177,8 @@
175
177
  "@types/deep-diff": "1.0.5",
176
178
  "@types/destroy": "1.0.3",
177
179
  "@types/encodeurl": "1.0.2",
178
- "@types/exif-reader": "1.0.0",
179
180
  "@types/express": "4.17.21",
180
- "@types/express-serve-static-core": "4.17.41",
181
+ "@types/express-serve-static-core": "4.17.43",
181
182
  "@types/fs-extra": "11.0.4",
182
183
  "@types/glob-to-regexp": "0.4.4",
183
184
  "@types/inquirer": "9.0.7",
@@ -188,37 +189,36 @@
188
189
  "@types/lodash-es": "4.17.12",
189
190
  "@types/mime-types": "2.1.4",
190
191
  "@types/ms": "0.7.34",
191
- "@types/node": "18.19.3",
192
- "@types/node-schedule": "2.1.5",
192
+ "@types/node": "18.19.14",
193
+ "@types/node-schedule": "2.1.6",
193
194
  "@types/nodemailer": "6.4.14",
194
195
  "@types/object-hash": "3.0.6",
195
196
  "@types/papaparse": "5.3.14",
196
- "@types/qs": "6.9.10",
197
- "@types/sanitize-html": "2.9.5",
197
+ "@types/qs": "6.9.11",
198
+ "@types/sanitize-html": "2.11.0",
198
199
  "@types/stream-json": "1.7.7",
199
- "@types/supertest": "2.0.16",
200
- "@types/uuid": "9.0.7",
200
+ "@types/uuid": "9.0.8",
201
201
  "@types/uuid-validate": "0.0.3",
202
202
  "@types/wellknown": "0.5.8",
203
203
  "@types/ws": "8.5.10",
204
- "@vitest/coverage-v8": "1.1.0",
204
+ "@vitest/coverage-v8": "1.2.2",
205
205
  "copyfiles": "2.4.1",
206
206
  "form-data": "4.0.0",
207
207
  "knex-mock-client": "2.0.1",
208
- "supertest": "6.3.3",
209
208
  "typescript": "5.3.3",
210
- "vitest": "1.1.0",
209
+ "vitest": "1.2.2",
210
+ "@directus/random": "0.2.5",
211
211
  "@directus/tsconfig": "1.0.1",
212
- "@directus/types": "11.0.3"
212
+ "@directus/types": "11.0.5"
213
213
  },
214
214
  "optionalDependencies": {
215
- "@keyv/redis": "2.8.1",
215
+ "@keyv/redis": "2.8.4",
216
216
  "mysql": "2.18.1",
217
217
  "nodemailer-mailgun-transport": "2.1.5",
218
218
  "nodemailer-sendgrid": "1.0.3",
219
- "oracledb": "6.2.0",
219
+ "oracledb": "6.3.0",
220
220
  "pg": "8.11.3",
221
- "sqlite3": "5.1.6",
221
+ "sqlite3": "5.1.7",
222
222
  "tedious": "16.6.1"
223
223
  },
224
224
  "engines": {
@@ -1,2 +0,0 @@
1
- export declare const sqlFieldFormatter: (schema: Record<string, any>, table: string) => string;
2
- export declare const sqlFieldList: (schema: Record<string, any>, table: string) => string;
@@ -1,31 +0,0 @@
1
- // dynamically adds fields to the sql strings as the schema grows
2
- export const sqlFieldFormatter = (schema, table) => {
3
- const fields = [];
4
- // Exclude alias fields, unable to selected in DB
5
- for (const field of Object.keys(schema['collections'][table].fields)) {
6
- if (schema['collections'][table].fields[field].type !== 'alias') {
7
- fields.push(field);
8
- }
9
- }
10
- let sql = '';
11
- for (const field of fields.slice(0, fields.length - 1)) {
12
- sql += `"${table}"."${field}", `;
13
- }
14
- sql += `"${table}"."${fields[fields.length - 1]}"`;
15
- return sql;
16
- };
17
- export const sqlFieldList = (schema, table) => {
18
- const fields = [];
19
- // Exclude alias fields, unable to selected in DB
20
- for (const field of Object.keys(schema['collections'][table].fields)) {
21
- if (schema['collections'][table].fields[field].type !== 'alias') {
22
- fields.push(field);
23
- }
24
- }
25
- let sql = '';
26
- for (const field of fields.slice(0, fields.length - 1)) {
27
- sql += `"${field}", `;
28
- }
29
- sql += `"${fields[fields.length - 1]}"`;
30
- return sql;
31
- };
@@ -1,18 +0,0 @@
1
- export declare function setEnv(newEnv: Record<string, string>): void;
2
- /** Static env mock - to be used inside `vi.mock` */
3
- export declare function mockEnv(options?: {
4
- env?: Record<string, string>;
5
- withDefaults?: boolean;
6
- }): Promise<{
7
- readonly default: Record<string, any>;
8
- }>;
9
- /** Dynamic env mock */
10
- export declare function doMockEnv(options?: {
11
- env?: Record<string, string>;
12
- withDefaults?: boolean;
13
- }): {
14
- env: {
15
- [x: string]: string;
16
- };
17
- setEnv: (newEnv: Record<string, string>) => void;
18
- };
@@ -1,41 +0,0 @@
1
- import { afterEach, vi } from 'vitest';
2
- let env = {};
3
- export function setEnv(newEnv) {
4
- env = { ...env, ...newEnv };
5
- }
6
- /** Static env mock - to be used inside `vi.mock` */
7
- export async function mockEnv(options) {
8
- const initialEnv = options?.env ?? {};
9
- const withDefaults = options && 'withDefaults' in options ? options.withDefaults : true;
10
- env = { ...initialEnv };
11
- afterEach(() => {
12
- env = { ...initialEnv };
13
- });
14
- const { defaults, processValues } = await vi.importActual('../env.js');
15
- return {
16
- get default() {
17
- return processValues({ ...(withDefaults && defaults), ...env });
18
- },
19
- };
20
- }
21
- /** Dynamic env mock */
22
- export function doMockEnv(options) {
23
- const initialEnv = options?.env ?? {};
24
- const withDefaults = options && 'withDefaults' in options ? options.withDefaults : true;
25
- let env = { ...initialEnv };
26
- vi.doMock('../env.js', async () => {
27
- const { defaults, processValues } = await vi.importActual('../env.js');
28
- return {
29
- get default() {
30
- return processValues({ ...(withDefaults && defaults), ...env });
31
- },
32
- };
33
- });
34
- afterEach(() => {
35
- env = { ...initialEnv };
36
- });
37
- return { env, setEnv };
38
- function setEnv(newEnv) {
39
- env = { ...env, ...newEnv };
40
- }
41
- }
@@ -1,13 +0,0 @@
1
- import type { CollectionsOverview, Relation } from '@directus/types';
2
- export declare const systemSchema: {
3
- collections: CollectionsOverview;
4
- relations: Relation[];
5
- };
6
- export declare const userSchema: {
7
- collections: CollectionsOverview;
8
- relations: Relation[];
9
- };
10
- export declare const snapshotApplyTestSchema: {
11
- collections: CollectionsOverview;
12
- relations: Relation[];
13
- };