@directus/api 11.0.1 → 12.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 (283) hide show
  1. package/dist/app.js +3 -4
  2. package/dist/auth/auth.d.ts +4 -4
  3. package/dist/auth/auth.js +2 -2
  4. package/dist/auth/drivers/ldap.js +20 -17
  5. package/dist/auth/drivers/local.js +5 -5
  6. package/dist/auth/drivers/oauth2.js +16 -16
  7. package/dist/auth/drivers/openid.js +18 -17
  8. package/dist/auth/drivers/saml.js +6 -7
  9. package/dist/auth.js +3 -2
  10. package/dist/cache.js +3 -13
  11. package/dist/cli/utils/create-env/env-stub.liquid +5 -7
  12. package/dist/controllers/activity.js +7 -6
  13. package/dist/controllers/assets.js +25 -12
  14. package/dist/controllers/auth.js +8 -7
  15. package/dist/controllers/collections.js +4 -3
  16. package/dist/controllers/dashboards.js +5 -4
  17. package/dist/controllers/extensions.js +3 -3
  18. package/dist/controllers/fields.js +9 -8
  19. package/dist/controllers/files.js +11 -11
  20. package/dist/controllers/flows.js +5 -4
  21. package/dist/controllers/folders.js +5 -4
  22. package/dist/controllers/items.js +14 -13
  23. package/dist/controllers/not-found.js +2 -2
  24. package/dist/controllers/notifications.js +5 -4
  25. package/dist/controllers/operations.js +5 -4
  26. package/dist/controllers/panels.js +5 -4
  27. package/dist/controllers/permissions.js +5 -4
  28. package/dist/controllers/presets.js +5 -4
  29. package/dist/controllers/relations.js +6 -5
  30. package/dist/controllers/roles.js +5 -4
  31. package/dist/controllers/schema.js +8 -8
  32. package/dist/controllers/server.js +2 -2
  33. package/dist/controllers/settings.js +3 -2
  34. package/dist/controllers/shares.js +7 -6
  35. package/dist/controllers/translations.js +6 -5
  36. package/dist/controllers/users.js +22 -21
  37. package/dist/controllers/utils.js +10 -10
  38. package/dist/controllers/webhooks.js +5 -4
  39. package/dist/{exceptions/database → database/errors}/dialects/mssql.js +8 -18
  40. package/dist/{exceptions/database → database/errors}/dialects/mysql.js +9 -19
  41. package/dist/{exceptions/database → database/errors}/dialects/oracle.js +2 -2
  42. package/dist/{exceptions/database → database/errors}/dialects/postgres.js +7 -18
  43. package/dist/{exceptions/database → database/errors}/dialects/sqlite.js +7 -10
  44. package/dist/{exceptions/database → database/errors}/translate.js +1 -1
  45. package/dist/database/migrations/run.js +10 -1
  46. package/dist/emitter.d.ts +3 -2
  47. package/dist/emitter.js +12 -4
  48. package/dist/env.js +21 -17
  49. package/dist/errors/codes.d.ts +29 -0
  50. package/dist/errors/codes.js +30 -0
  51. package/dist/errors/contains-null-values.d.ts +7 -0
  52. package/dist/errors/contains-null-values.js +4 -0
  53. package/dist/errors/content-too-large.d.ts +1 -0
  54. package/dist/errors/content-too-large.js +3 -0
  55. package/dist/errors/forbidden.d.ts +1 -0
  56. package/dist/errors/forbidden.js +3 -0
  57. package/dist/errors/hit-rate-limit.d.ts +6 -0
  58. package/dist/errors/hit-rate-limit.js +8 -0
  59. package/dist/errors/illegal-asset-transformation.d.ts +4 -0
  60. package/dist/errors/illegal-asset-transformation.js +3 -0
  61. package/dist/errors/index.d.ts +28 -0
  62. package/dist/errors/index.js +28 -0
  63. package/dist/errors/invalid-credentials.d.ts +1 -0
  64. package/dist/errors/invalid-credentials.js +3 -0
  65. package/dist/errors/invalid-foreign-key.d.ts +6 -0
  66. package/dist/errors/invalid-foreign-key.js +14 -0
  67. package/dist/errors/invalid-ip.d.ts +1 -0
  68. package/dist/errors/invalid-ip.js +3 -0
  69. package/dist/errors/invalid-otp.d.ts +1 -0
  70. package/dist/errors/invalid-otp.js +3 -0
  71. package/dist/errors/invalid-payload.d.ts +5 -0
  72. package/dist/errors/invalid-payload.js +4 -0
  73. package/dist/errors/invalid-provider-config.d.ts +5 -0
  74. package/dist/errors/invalid-provider-config.js +3 -0
  75. package/dist/errors/invalid-provider.d.ts +1 -0
  76. package/dist/errors/invalid-provider.js +3 -0
  77. package/dist/errors/invalid-query.d.ts +5 -0
  78. package/dist/errors/invalid-query.js +4 -0
  79. package/dist/errors/invalid-token.d.ts +1 -0
  80. package/dist/errors/invalid-token.js +3 -0
  81. package/dist/errors/method-not-allowed.d.ts +6 -0
  82. package/dist/errors/method-not-allowed.js +6 -0
  83. package/dist/errors/not-null-violation.d.ts +6 -0
  84. package/dist/errors/not-null-violation.js +14 -0
  85. package/dist/errors/range-not-satisfiable.d.ts +7 -0
  86. package/dist/errors/range-not-satisfiable.js +7 -0
  87. package/dist/errors/record-not-unique.d.ts +6 -0
  88. package/dist/errors/record-not-unique.js +14 -0
  89. package/dist/errors/route-not-found.d.ts +5 -0
  90. package/dist/errors/route-not-found.js +4 -0
  91. package/dist/errors/service-unavailable.d.ts +7 -0
  92. package/dist/errors/service-unavailable.js +4 -0
  93. package/dist/errors/token-expired.d.ts +1 -0
  94. package/dist/errors/token-expired.js +3 -0
  95. package/dist/errors/unexpected-response.d.ts +1 -0
  96. package/dist/errors/unexpected-response.js +3 -0
  97. package/dist/errors/unprocessable-content.d.ts +5 -0
  98. package/dist/errors/unprocessable-content.js +4 -0
  99. package/dist/errors/unsupported-media-type.d.ts +6 -0
  100. package/dist/errors/unsupported-media-type.js +4 -0
  101. package/dist/errors/user-suspended.d.ts +1 -0
  102. package/dist/errors/user-suspended.js +3 -0
  103. package/dist/errors/value-out-of-range.d.ts +6 -0
  104. package/dist/errors/value-out-of-range.js +14 -0
  105. package/dist/errors/value-too-long.d.ts +6 -0
  106. package/dist/errors/value-too-long.js +14 -0
  107. package/dist/extensions.js +0 -4
  108. package/dist/flows.js +6 -8
  109. package/dist/index.d.ts +0 -2
  110. package/dist/index.js +0 -2
  111. package/dist/messenger.d.ts +3 -3
  112. package/dist/messenger.js +18 -9
  113. package/dist/middleware/authenticate.js +2 -38
  114. package/dist/middleware/check-ip.js +2 -2
  115. package/dist/middleware/collection-exists.js +2 -2
  116. package/dist/middleware/error-handler.js +7 -7
  117. package/dist/middleware/graphql.js +11 -9
  118. package/dist/middleware/rate-limiter-global.d.ts +2 -2
  119. package/dist/middleware/rate-limiter-global.js +2 -3
  120. package/dist/middleware/rate-limiter-ip.d.ts +2 -2
  121. package/dist/middleware/rate-limiter-ip.js +2 -3
  122. package/dist/middleware/validate-batch.js +3 -4
  123. package/dist/rate-limiter.js +2 -9
  124. package/dist/server.js +10 -0
  125. package/dist/services/activity.js +3 -2
  126. package/dist/services/assets.js +9 -10
  127. package/dist/services/authentication.js +12 -11
  128. package/dist/services/authorization.d.ts +1 -1
  129. package/dist/services/authorization.js +16 -16
  130. package/dist/services/collections.js +17 -16
  131. package/dist/services/fields.js +16 -14
  132. package/dist/services/files.js +7 -6
  133. package/dist/services/graphql/errors/execution.d.ts +6 -0
  134. package/dist/services/graphql/errors/execution.js +2 -0
  135. package/dist/services/graphql/errors/index.d.ts +2 -0
  136. package/dist/services/graphql/errors/index.js +2 -0
  137. package/dist/services/graphql/errors/validation.d.ts +6 -0
  138. package/dist/services/graphql/errors/validation.js +2 -0
  139. package/dist/services/graphql/index.d.ts +2 -8
  140. package/dist/services/graphql/index.js +125 -66
  141. package/dist/services/graphql/subscription.d.ts +16 -0
  142. package/dist/services/graphql/subscription.js +77 -0
  143. package/dist/services/graphql/utils/process-error.js +3 -3
  144. package/dist/services/import-export.js +7 -7
  145. package/dist/services/index.d.ts +1 -0
  146. package/dist/services/index.js +1 -0
  147. package/dist/services/items.js +14 -13
  148. package/dist/services/mail/index.js +3 -3
  149. package/dist/services/meta.js +3 -3
  150. package/dist/services/payload.js +11 -7
  151. package/dist/services/relations.js +32 -22
  152. package/dist/services/revisions.js +3 -3
  153. package/dist/services/roles.js +10 -9
  154. package/dist/services/schema.js +5 -5
  155. package/dist/services/server.js +24 -0
  156. package/dist/services/shares.js +4 -4
  157. package/dist/services/tfa.js +6 -6
  158. package/dist/services/translations.d.ts +2 -2
  159. package/dist/services/translations.js +4 -4
  160. package/dist/services/users.js +26 -29
  161. package/dist/services/utils.js +4 -4
  162. package/dist/services/websocket.d.ts +14 -0
  163. package/dist/services/websocket.js +26 -0
  164. package/dist/synchronization.js +3 -3
  165. package/dist/types/items.d.ts +2 -2
  166. package/dist/utils/apply-diff.js +13 -4
  167. package/dist/utils/apply-query.js +22 -13
  168. package/dist/utils/get-accountability-for-role.js +1 -2
  169. package/dist/utils/get-accountability-for-token.d.ts +2 -0
  170. package/dist/utils/get-accountability-for-token.js +50 -0
  171. package/dist/utils/get-column-path.js +5 -3
  172. package/dist/utils/get-column.js +3 -3
  173. package/dist/utils/get-service.d.ts +7 -0
  174. package/dist/utils/get-service.js +49 -0
  175. package/dist/utils/jwt.js +5 -5
  176. package/dist/utils/redact.d.ts +4 -0
  177. package/dist/utils/redact.js +15 -1
  178. package/dist/utils/to-boolean.d.ts +4 -0
  179. package/dist/utils/to-boolean.js +6 -0
  180. package/dist/utils/validate-diff.js +23 -9
  181. package/dist/utils/validate-keys.js +3 -3
  182. package/dist/utils/validate-query.d.ts +2 -0
  183. package/dist/utils/validate-query.js +27 -21
  184. package/dist/utils/validate-snapshot.js +11 -5
  185. package/dist/websocket/authenticate.d.ts +6 -0
  186. package/dist/websocket/authenticate.js +59 -0
  187. package/dist/websocket/controllers/base.d.ts +42 -0
  188. package/dist/websocket/controllers/base.js +279 -0
  189. package/dist/websocket/controllers/graphql.d.ts +12 -0
  190. package/dist/websocket/controllers/graphql.js +102 -0
  191. package/dist/websocket/controllers/hooks.d.ts +1 -0
  192. package/dist/websocket/controllers/hooks.js +122 -0
  193. package/dist/websocket/controllers/index.d.ts +10 -0
  194. package/dist/websocket/controllers/index.js +31 -0
  195. package/dist/websocket/controllers/rest.d.ts +9 -0
  196. package/dist/websocket/controllers/rest.js +47 -0
  197. package/dist/websocket/errors.d.ts +16 -0
  198. package/dist/websocket/errors.js +55 -0
  199. package/dist/websocket/handlers/heartbeat.d.ts +11 -0
  200. package/dist/websocket/handlers/heartbeat.js +72 -0
  201. package/dist/websocket/handlers/index.d.ts +4 -0
  202. package/dist/websocket/handlers/index.js +11 -0
  203. package/dist/websocket/handlers/items.d.ts +6 -0
  204. package/dist/websocket/handlers/items.js +103 -0
  205. package/dist/websocket/handlers/subscribe.d.ts +43 -0
  206. package/dist/websocket/handlers/subscribe.js +278 -0
  207. package/dist/websocket/messages.d.ts +311 -0
  208. package/dist/websocket/messages.js +96 -0
  209. package/dist/websocket/types.d.ts +34 -0
  210. package/dist/websocket/types.js +1 -0
  211. package/dist/websocket/utils/get-expires-at-for-token.d.ts +1 -0
  212. package/dist/websocket/utils/get-expires-at-for-token.js +8 -0
  213. package/dist/websocket/utils/message.d.ts +4 -0
  214. package/dist/websocket/utils/message.js +27 -0
  215. package/dist/websocket/utils/wait-for-message.d.ts +4 -0
  216. package/dist/websocket/utils/wait-for-message.js +45 -0
  217. package/package.json +21 -16
  218. package/dist/exceptions/content-too-large.d.ts +0 -4
  219. package/dist/exceptions/content-too-large.js +0 -6
  220. package/dist/exceptions/database/contains-null-values.d.ts +0 -9
  221. package/dist/exceptions/database/contains-null-values.js +0 -6
  222. package/dist/exceptions/database/invalid-foreign-key.d.ts +0 -10
  223. package/dist/exceptions/database/invalid-foreign-key.js +0 -11
  224. package/dist/exceptions/database/not-null-violation.d.ts +0 -9
  225. package/dist/exceptions/database/not-null-violation.js +0 -6
  226. package/dist/exceptions/database/record-not-unique.d.ts +0 -10
  227. package/dist/exceptions/database/record-not-unique.js +0 -11
  228. package/dist/exceptions/database/value-out-of-range.d.ts +0 -10
  229. package/dist/exceptions/database/value-out-of-range.js +0 -11
  230. package/dist/exceptions/database/value-too-long.d.ts +0 -9
  231. package/dist/exceptions/database/value-too-long.js +0 -11
  232. package/dist/exceptions/forbidden.d.ts +0 -6
  233. package/dist/exceptions/forbidden.js +0 -13
  234. package/dist/exceptions/graphql-validation.d.ts +0 -4
  235. package/dist/exceptions/graphql-validation.js +0 -6
  236. package/dist/exceptions/hit-rate-limit.d.ts +0 -9
  237. package/dist/exceptions/hit-rate-limit.js +0 -6
  238. package/dist/exceptions/illegal-asset-transformation.d.ts +0 -4
  239. package/dist/exceptions/illegal-asset-transformation.js +0 -6
  240. package/dist/exceptions/index.d.ts +0 -21
  241. package/dist/exceptions/index.js +0 -21
  242. package/dist/exceptions/invalid-config.d.ts +0 -4
  243. package/dist/exceptions/invalid-config.js +0 -6
  244. package/dist/exceptions/invalid-credentials.d.ts +0 -4
  245. package/dist/exceptions/invalid-credentials.js +0 -6
  246. package/dist/exceptions/invalid-ip.d.ts +0 -4
  247. package/dist/exceptions/invalid-ip.js +0 -6
  248. package/dist/exceptions/invalid-otp.d.ts +0 -4
  249. package/dist/exceptions/invalid-otp.js +0 -6
  250. package/dist/exceptions/invalid-payload.d.ts +0 -4
  251. package/dist/exceptions/invalid-payload.js +0 -6
  252. package/dist/exceptions/invalid-provider.d.ts +0 -4
  253. package/dist/exceptions/invalid-provider.js +0 -6
  254. package/dist/exceptions/invalid-query.d.ts +0 -4
  255. package/dist/exceptions/invalid-query.js +0 -6
  256. package/dist/exceptions/invalid-token.d.ts +0 -4
  257. package/dist/exceptions/invalid-token.js +0 -6
  258. package/dist/exceptions/method-not-allowed.d.ts +0 -8
  259. package/dist/exceptions/method-not-allowed.js +0 -6
  260. package/dist/exceptions/range-not-satisfiable.d.ts +0 -5
  261. package/dist/exceptions/range-not-satisfiable.js +0 -9
  262. package/dist/exceptions/route-not-found.d.ts +0 -4
  263. package/dist/exceptions/route-not-found.js +0 -6
  264. package/dist/exceptions/service-unavailable.d.ts +0 -9
  265. package/dist/exceptions/service-unavailable.js +0 -6
  266. package/dist/exceptions/token-expired.d.ts +0 -4
  267. package/dist/exceptions/token-expired.js +0 -6
  268. package/dist/exceptions/unexpected-response.d.ts +0 -4
  269. package/dist/exceptions/unexpected-response.js +0 -6
  270. package/dist/exceptions/unprocessable-entity.d.ts +0 -4
  271. package/dist/exceptions/unprocessable-entity.js +0 -6
  272. package/dist/exceptions/unsupported-media-type.d.ts +0 -4
  273. package/dist/exceptions/unsupported-media-type.js +0 -6
  274. package/dist/exceptions/user-suspended.d.ts +0 -4
  275. package/dist/exceptions/user-suspended.js +0 -6
  276. /package/dist/{exceptions/database → database/errors}/dialects/mssql.d.ts +0 -0
  277. /package/dist/{exceptions/database → database/errors}/dialects/mysql.d.ts +0 -0
  278. /package/dist/{exceptions/database → database/errors}/dialects/oracle.d.ts +0 -0
  279. /package/dist/{exceptions/database → database/errors}/dialects/postgres.d.ts +0 -0
  280. /package/dist/{exceptions/database → database/errors}/dialects/sqlite.d.ts +0 -0
  281. /package/dist/{exceptions/database → database/errors}/dialects/types.d.ts +0 -0
  282. /package/dist/{exceptions/database → database/errors}/dialects/types.js +0 -0
  283. /package/dist/{exceptions/database → database/errors}/translate.d.ts +0 -0
@@ -1,11 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class InvalidForeignKeyException extends BaseException {
3
- constructor(field, extensions) {
4
- if (field) {
5
- super(`Invalid foreign key in field "${field}".`, 400, 'INVALID_FOREIGN_KEY', extensions);
6
- }
7
- else {
8
- super(`Invalid foreign key.`, 400, 'INVALID_FOREIGN_KEY', extensions);
9
- }
10
- }
11
- }
@@ -1,9 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- type Exceptions = {
3
- collection: string;
4
- field: string;
5
- };
6
- export declare class NotNullViolationException extends BaseException {
7
- constructor(field: string, exceptions?: Exceptions);
8
- }
9
- export {};
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class NotNullViolationException extends BaseException {
3
- constructor(field, exceptions) {
4
- super(`Value for field "${field}" can't be null.`, 400, 'NOT_NULL_VIOLATION', exceptions);
5
- }
6
- }
@@ -1,10 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- type Extensions = {
3
- collection: string;
4
- field: string | null;
5
- invalid?: string | undefined;
6
- };
7
- export declare class RecordNotUniqueException extends BaseException {
8
- constructor(field: string | null, extensions?: Extensions);
9
- }
10
- export {};
@@ -1,11 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class RecordNotUniqueException extends BaseException {
3
- constructor(field, extensions) {
4
- if (field) {
5
- super(`Field "${field}" has to be unique.`, 400, 'RECORD_NOT_UNIQUE', extensions);
6
- }
7
- else {
8
- super(`Field has to be unique.`, 400, 'RECORD_NOT_UNIQUE', extensions);
9
- }
10
- }
11
- }
@@ -1,10 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- type Exceptions = {
3
- collection: string;
4
- field: string | null;
5
- invalid?: string;
6
- };
7
- export declare class ValueOutOfRangeException extends BaseException {
8
- constructor(field: string | null, exceptions?: Exceptions);
9
- }
10
- export {};
@@ -1,11 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class ValueOutOfRangeException extends BaseException {
3
- constructor(field, exceptions) {
4
- if (field) {
5
- super(`Numeric value in field "${field ?? ''}" is out of range.`, 400, 'VALUE_OUT_OF_RANGE', exceptions);
6
- }
7
- else {
8
- super(`Numeric value is out of range.`, 400, 'VALUE_OUT_OF_RANGE', exceptions);
9
- }
10
- }
11
- }
@@ -1,9 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- type Extensions = {
3
- collection: string;
4
- field: string | null;
5
- };
6
- export declare class ValueTooLongException extends BaseException {
7
- constructor(field: string | null, extensions?: Extensions);
8
- }
9
- export {};
@@ -1,11 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class ValueTooLongException extends BaseException {
3
- constructor(field, extensions) {
4
- if (field) {
5
- super(`Value for field "${field}" is too long.`, 400, 'VALUE_TOO_LONG', extensions);
6
- }
7
- else {
8
- super(`Value is too long.`, 400, 'VALUE_TOO_LONG', extensions);
9
- }
10
- }
11
- }
@@ -1,6 +0,0 @@
1
- import * as exceptions from '@directus/exceptions';
2
- declare const BaseException: typeof exceptions.BaseException;
3
- export declare class ForbiddenException extends BaseException {
4
- constructor();
5
- }
6
- export {};
@@ -1,13 +0,0 @@
1
- import * as exceptions from '@directus/exceptions';
2
- const { BaseException } = exceptions;
3
- export class ForbiddenException extends BaseException {
4
- constructor() {
5
- super(`You don't have permission to access this.`, 403, 'FORBIDDEN');
6
- /**
7
- * We currently don't show the reason for a forbidden exception in the API output, as that
8
- * has the potential to leak schema information (eg a "No permission" vs "No permission to files"
9
- * would leak that a thing called "files" exists.
10
- * Ref https://github.com/directus/directus/discussions/4368
11
- */
12
- }
13
- }
@@ -1,4 +0,0 @@
1
- import * as sharedExceptions from '@directus/exceptions';
2
- export declare class GraphQLValidationException extends sharedExceptions.BaseException {
3
- constructor(extensions: Record<string, any>);
4
- }
@@ -1,6 +0,0 @@
1
- import * as sharedExceptions from '@directus/exceptions';
2
- export class GraphQLValidationException extends sharedExceptions.BaseException {
3
- constructor(extensions) {
4
- super('GraphQL validation error.', 400, 'GRAPHQL_VALIDATION_EXCEPTION', extensions);
5
- }
6
- }
@@ -1,9 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- type Extensions = {
3
- limit: number;
4
- reset: Date;
5
- };
6
- export declare class HitRateLimitException extends BaseException {
7
- constructor(message: string, extensions: Extensions);
8
- }
9
- export {};
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class HitRateLimitException extends BaseException {
3
- constructor(message, extensions) {
4
- super(message, 429, 'REQUESTS_EXCEEDED', extensions);
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class IllegalAssetTransformation extends BaseException {
3
- constructor(message: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class IllegalAssetTransformation extends BaseException {
3
- constructor(message) {
4
- super(message, 400, 'ILLEGAL_ASSET_TRANSFORMATION');
5
- }
6
- }
@@ -1,21 +0,0 @@
1
- export * from './forbidden.js';
2
- export * from './graphql-validation.js';
3
- export * from './hit-rate-limit.js';
4
- export * from './illegal-asset-transformation.js';
5
- export * from './invalid-config.js';
6
- export * from './invalid-credentials.js';
7
- export * from './invalid-ip.js';
8
- export * from './invalid-otp.js';
9
- export * from './invalid-payload.js';
10
- export * from './invalid-provider.js';
11
- export * from './invalid-query.js';
12
- export * from './invalid-token.js';
13
- export * from './method-not-allowed.js';
14
- export * from './range-not-satisfiable.js';
15
- export * from './route-not-found.js';
16
- export * from './service-unavailable.js';
17
- export * from './token-expired.js';
18
- export * from './unprocessable-entity.js';
19
- export * from './unsupported-media-type.js';
20
- export * from './user-suspended.js';
21
- export * from './unexpected-response.js';
@@ -1,21 +0,0 @@
1
- export * from './forbidden.js';
2
- export * from './graphql-validation.js';
3
- export * from './hit-rate-limit.js';
4
- export * from './illegal-asset-transformation.js';
5
- export * from './invalid-config.js';
6
- export * from './invalid-credentials.js';
7
- export * from './invalid-ip.js';
8
- export * from './invalid-otp.js';
9
- export * from './invalid-payload.js';
10
- export * from './invalid-provider.js';
11
- export * from './invalid-query.js';
12
- export * from './invalid-token.js';
13
- export * from './method-not-allowed.js';
14
- export * from './range-not-satisfiable.js';
15
- export * from './route-not-found.js';
16
- export * from './service-unavailable.js';
17
- export * from './token-expired.js';
18
- export * from './unprocessable-entity.js';
19
- export * from './unsupported-media-type.js';
20
- export * from './user-suspended.js';
21
- export * from './unexpected-response.js';
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class InvalidConfigException extends BaseException {
3
- constructor(message?: string, extensions?: Record<string, any>);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class InvalidConfigException extends BaseException {
3
- constructor(message = 'Invalid config', extensions) {
4
- super(message, 503, 'INVALID_CONFIG', extensions);
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class InvalidCredentialsException extends BaseException {
3
- constructor(message?: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class InvalidCredentialsException extends BaseException {
3
- constructor(message = 'Invalid user credentials.') {
4
- super(message, 401, 'INVALID_CREDENTIALS');
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class InvalidIPException extends BaseException {
3
- constructor(message?: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class InvalidIPException extends BaseException {
3
- constructor(message = 'Invalid IP address.') {
4
- super(message, 401, 'INVALID_IP');
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class InvalidOTPException extends BaseException {
3
- constructor(message?: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class InvalidOTPException extends BaseException {
3
- constructor(message = 'Invalid user OTP.') {
4
- super(message, 401, 'INVALID_OTP');
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class InvalidPayloadException extends BaseException {
3
- constructor(message: string, extensions?: Record<string, unknown>);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class InvalidPayloadException extends BaseException {
3
- constructor(message, extensions) {
4
- super(message, 400, 'INVALID_PAYLOAD', extensions);
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class InvalidProviderException extends BaseException {
3
- constructor(message?: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class InvalidProviderException extends BaseException {
3
- constructor(message = 'Invalid provider.') {
4
- super(message, 403, 'INVALID_PROVIDER');
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class InvalidQueryException extends BaseException {
3
- constructor(message: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class InvalidQueryException extends BaseException {
3
- constructor(message) {
4
- super(message, 400, 'INVALID_QUERY');
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class InvalidTokenException extends BaseException {
3
- constructor(message?: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class InvalidTokenException extends BaseException {
3
- constructor(message = 'Invalid token') {
4
- super(message, 403, 'INVALID_TOKEN');
5
- }
6
- }
@@ -1,8 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- type Extensions = {
3
- allow: string[];
4
- };
5
- export declare class MethodNotAllowedException extends BaseException {
6
- constructor(message: string | undefined, extensions: Extensions);
7
- }
8
- export {};
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class MethodNotAllowedException extends BaseException {
3
- constructor(message = 'Method not allowed.', extensions) {
4
- super(message, 405, 'METHOD_NOT_ALLOWED', extensions);
5
- }
6
- }
@@ -1,5 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- import type { Range } from '@directus/storage';
3
- export declare class RangeNotSatisfiableException extends BaseException {
4
- constructor(range?: Range);
5
- }
@@ -1,9 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class RangeNotSatisfiableException extends BaseException {
3
- constructor(range) {
4
- const rangeString = range && (range?.start !== undefined || range?.end !== undefined)
5
- ? `"${range.start ?? ''}-${range.end ?? ''}" `
6
- : '';
7
- super(`Range ${rangeString}is invalid or the file's size doesn't match the requested range.`, 416, 'RANGE_NOT_SATISFIABLE');
8
- }
9
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class RouteNotFoundException extends BaseException {
3
- constructor(path: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class RouteNotFoundException extends BaseException {
3
- constructor(path) {
4
- super(`Route ${path} doesn't exist.`, 404, 'ROUTE_NOT_FOUND');
5
- }
6
- }
@@ -1,9 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- type Extensions = {
3
- service: string;
4
- [key: string]: any;
5
- };
6
- export declare class ServiceUnavailableException extends BaseException {
7
- constructor(message: string, extensions: Extensions);
8
- }
9
- export {};
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class ServiceUnavailableException extends BaseException {
3
- constructor(message, extensions) {
4
- super(message, 503, 'SERVICE_UNAVAILABLE', extensions);
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class TokenExpiredException extends BaseException {
3
- constructor(message?: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class TokenExpiredException extends BaseException {
3
- constructor(message = 'Token expired.') {
4
- super(message, 401, 'TOKEN_EXPIRED');
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class UnexpectedResponseException extends BaseException {
3
- constructor(message: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class UnexpectedResponseException extends BaseException {
3
- constructor(message) {
4
- super(message, 503, 'UNEXPECTED_RESPONSE');
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class UnprocessableEntityException extends BaseException {
3
- constructor(message: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class UnprocessableEntityException extends BaseException {
3
- constructor(message) {
4
- super(message, 422, 'UNPROCESSABLE_ENTITY');
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class UnsupportedMediaTypeException extends BaseException {
3
- constructor(message: string, extensions?: Record<string, unknown>);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class UnsupportedMediaTypeException extends BaseException {
3
- constructor(message, extensions) {
4
- super(message, 415, 'UNSUPPORTED_MEDIA_TYPE', extensions);
5
- }
6
- }
@@ -1,4 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export declare class UserSuspendedException extends BaseException {
3
- constructor(message?: string);
4
- }
@@ -1,6 +0,0 @@
1
- import { BaseException } from '@directus/exceptions';
2
- export class UserSuspendedException extends BaseException {
3
- constructor(message = 'User suspended.') {
4
- super(message, 401, 'USER_SUSPENDED');
5
- }
6
- }