@directus/api 13.1.1 → 13.2.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.
- package/dist/app.js +4 -4
- package/dist/auth/drivers/ldap.js +3 -2
- package/dist/auth/drivers/local.js +1 -1
- package/dist/auth/drivers/oauth2.js +1 -1
- package/dist/auth/drivers/openid.js +1 -1
- package/dist/auth/drivers/saml.js +1 -1
- package/dist/auth.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/controllers/activity.js +1 -1
- package/dist/controllers/assets.js +2 -2
- package/dist/controllers/auth.js +1 -1
- package/dist/controllers/collections.js +1 -1
- package/dist/controllers/dashboards.js +1 -1
- package/dist/controllers/extensions.js +11 -7
- package/dist/controllers/fields.js +1 -1
- package/dist/controllers/files.js +1 -1
- package/dist/controllers/flows.js +1 -1
- package/dist/controllers/folders.js +1 -1
- package/dist/controllers/items.js +1 -1
- package/dist/controllers/not-found.js +1 -1
- package/dist/controllers/notifications.js +1 -1
- package/dist/controllers/operations.js +1 -1
- package/dist/controllers/panels.js +1 -1
- package/dist/controllers/permissions.js +1 -1
- package/dist/controllers/presets.js +1 -1
- package/dist/controllers/relations.js +1 -1
- package/dist/controllers/roles.js +1 -1
- package/dist/controllers/schema.js +1 -1
- package/dist/controllers/server.js +1 -1
- package/dist/controllers/settings.js +1 -1
- package/dist/controllers/shares.js +1 -1
- package/dist/controllers/translations.js +1 -1
- package/dist/controllers/users.js +1 -1
- package/dist/controllers/utils.js +37 -18
- package/dist/controllers/webhooks.js +1 -1
- package/dist/database/errors/dialects/mssql.js +1 -1
- package/dist/database/errors/dialects/mysql.js +1 -1
- package/dist/database/errors/dialects/oracle.js +1 -1
- package/dist/database/errors/dialects/postgres.js +1 -1
- package/dist/database/errors/dialects/sqlite.js +1 -1
- package/dist/database/helpers/schema/dialects/mysql.js +1 -1
- package/dist/database/helpers/sequence/dialects/postgres.d.ts +5 -2
- package/dist/database/helpers/sequence/dialects/postgres.js +6 -3
- package/dist/database/migrations/20231009A-update-csv-fields-to-text.d.ts +3 -0
- package/dist/database/migrations/20231009A-update-csv-fields-to-text.js +44 -0
- package/dist/database/run-ast.js +1 -1
- package/dist/database/seeds/run.js +1 -1
- package/dist/extensions/get-extensions.d.ts +47 -0
- package/dist/extensions/get-extensions.js +9 -0
- package/dist/extensions/get-shared-deps-mapping.d.ts +1 -0
- package/dist/extensions/get-shared-deps-mapping.js +26 -0
- package/dist/extensions/index.d.ts +2 -0
- package/dist/extensions/index.js +9 -0
- package/dist/{extensions.d.ts → extensions/manager.d.ts} +4 -11
- package/dist/{extensions.js → extensions/manager.js} +28 -86
- package/dist/extensions/normalize-extension-info.d.ts +5 -0
- package/dist/extensions/normalize-extension-info.js +30 -0
- package/dist/extensions/types.d.ts +23 -0
- package/dist/extensions/wrap-embeds.d.ts +4 -0
- package/dist/extensions/wrap-embeds.js +8 -0
- package/dist/flows.d.ts +1 -1
- package/dist/flows.js +1 -1
- package/dist/middleware/check-ip.js +1 -1
- package/dist/middleware/collection-exists.js +1 -1
- package/dist/middleware/error-handler.js +1 -1
- package/dist/middleware/graphql.js +1 -1
- package/dist/middleware/rate-limiter-global.js +1 -1
- package/dist/middleware/rate-limiter-ip.js +1 -1
- package/dist/middleware/respond.js +1 -1
- package/dist/middleware/validate-batch.js +1 -1
- package/dist/operations/condition/index.d.ts +1 -1
- package/dist/operations/condition/index.js +2 -1
- package/dist/operations/exec/index.d.ts +1 -1
- package/dist/operations/exec/index.js +1 -1
- package/dist/operations/item-create/index.d.ts +1 -1
- package/dist/operations/item-create/index.js +2 -1
- package/dist/operations/item-delete/index.d.ts +1 -1
- package/dist/operations/item-delete/index.js +2 -1
- package/dist/operations/item-read/index.d.ts +1 -1
- package/dist/operations/item-read/index.js +2 -1
- package/dist/operations/item-update/index.d.ts +1 -1
- package/dist/operations/item-update/index.js +2 -1
- package/dist/operations/json-web-token/index.d.ts +1 -1
- package/dist/operations/json-web-token/index.js +2 -1
- package/dist/operations/log/index.d.ts +1 -1
- package/dist/operations/log/index.js +2 -1
- package/dist/operations/mail/index.d.ts +1 -1
- package/dist/operations/mail/index.js +1 -1
- package/dist/operations/notification/index.d.ts +1 -1
- package/dist/operations/notification/index.js +2 -1
- package/dist/operations/request/index.d.ts +1 -1
- package/dist/operations/request/index.js +3 -2
- package/dist/operations/sleep/index.d.ts +1 -1
- package/dist/operations/sleep/index.js +1 -1
- package/dist/operations/transform/index.d.ts +1 -1
- package/dist/operations/transform/index.js +2 -1
- package/dist/operations/trigger/index.d.ts +1 -1
- package/dist/operations/trigger/index.js +2 -1
- package/dist/services/activity.js +1 -1
- package/dist/services/assets.d.ts +1 -1
- package/dist/services/assets.js +2 -2
- package/dist/services/authentication.js +2 -2
- package/dist/services/authorization.js +1 -1
- package/dist/services/collections.js +3 -3
- package/dist/services/fields.d.ts +2 -2
- package/dist/services/fields.js +4 -4
- package/dist/services/files.d.ts +4 -1
- package/dist/services/files.js +5 -5
- package/dist/services/graphql/index.js +2 -2
- package/dist/services/graphql/subscription.js +3 -3
- package/dist/services/import-export/import-worker.d.ts +9 -0
- package/dist/services/import-export/import-worker.js +9 -0
- package/dist/services/{import-export.d.ts → import-export/index.d.ts} +2 -2
- package/dist/services/{import-export.js → import-export/index.js} +51 -42
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +1 -1
- package/dist/services/items.js +2 -2
- package/dist/services/mail/index.js +1 -1
- package/dist/services/meta.js +1 -1
- package/dist/services/payload.js +1 -1
- package/dist/services/permissions.d.ts +2 -2
- package/dist/services/permissions.js +1 -1
- package/dist/services/relations.js +1 -1
- package/dist/services/revisions.js +1 -1
- package/dist/services/roles.js +1 -1
- package/dist/services/schema.js +1 -1
- package/dist/services/shares.js +1 -1
- package/dist/services/tfa.js +1 -1
- package/dist/services/translations.js +1 -1
- package/dist/services/users.js +2 -2
- package/dist/services/utils.d.ts +1 -0
- package/dist/services/utils.js +8 -2
- package/dist/services/websocket.js +11 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.js +0 -1
- package/dist/utils/apply-query.js +1 -1
- package/dist/utils/get-accountability-for-token.js +1 -1
- package/dist/utils/get-ast-from-query.js +1 -1
- package/dist/utils/get-column-path.js +1 -1
- package/dist/utils/get-column.js +1 -1
- package/dist/utils/get-default-value.d.ts +1 -2
- package/dist/utils/get-permissions.js +1 -1
- package/dist/utils/jwt.js +1 -1
- package/dist/utils/redact-object.js +9 -3
- package/dist/utils/transformations.d.ts +2 -1
- package/dist/utils/validate-diff.js +1 -1
- package/dist/utils/validate-keys.js +1 -1
- package/dist/utils/validate-query.js +1 -1
- package/dist/utils/validate-snapshot.js +1 -1
- package/dist/websocket/controllers/base.js +1 -1
- package/dist/websocket/controllers/index.d.ts +1 -1
- package/dist/websocket/controllers/index.js +0 -7
- package/dist/websocket/handlers/heartbeat.js +6 -1
- package/dist/websocket/handlers/subscribe.js +11 -16
- package/dist/websocket/utils/items.d.ts +4 -14
- package/dist/websocket/utils/items.js +59 -64
- package/dist/worker-pool.d.ts +2 -0
- package/dist/worker-pool.js +11 -0
- package/package.json +24 -22
- package/dist/errors/codes.d.ts +0 -29
- package/dist/errors/codes.js +0 -30
- package/dist/errors/contains-null-values.d.ts +0 -7
- package/dist/errors/contains-null-values.js +0 -4
- package/dist/errors/content-too-large.d.ts +0 -1
- package/dist/errors/content-too-large.js +0 -3
- package/dist/errors/forbidden.d.ts +0 -1
- package/dist/errors/forbidden.js +0 -3
- package/dist/errors/hit-rate-limit.d.ts +0 -6
- package/dist/errors/hit-rate-limit.js +0 -8
- package/dist/errors/illegal-asset-transformation.d.ts +0 -4
- package/dist/errors/illegal-asset-transformation.js +0 -3
- package/dist/errors/index.d.ts +0 -28
- package/dist/errors/index.js +0 -28
- package/dist/errors/invalid-credentials.d.ts +0 -1
- package/dist/errors/invalid-credentials.js +0 -3
- package/dist/errors/invalid-foreign-key.d.ts +0 -6
- package/dist/errors/invalid-foreign-key.js +0 -14
- package/dist/errors/invalid-ip.d.ts +0 -1
- package/dist/errors/invalid-ip.js +0 -3
- package/dist/errors/invalid-otp.d.ts +0 -1
- package/dist/errors/invalid-otp.js +0 -3
- package/dist/errors/invalid-payload.d.ts +0 -5
- package/dist/errors/invalid-payload.js +0 -4
- package/dist/errors/invalid-provider-config.d.ts +0 -5
- package/dist/errors/invalid-provider-config.js +0 -3
- package/dist/errors/invalid-provider.d.ts +0 -1
- package/dist/errors/invalid-provider.js +0 -3
- package/dist/errors/invalid-query.d.ts +0 -5
- package/dist/errors/invalid-query.js +0 -4
- package/dist/errors/invalid-token.d.ts +0 -1
- package/dist/errors/invalid-token.js +0 -3
- package/dist/errors/method-not-allowed.d.ts +0 -6
- package/dist/errors/method-not-allowed.js +0 -6
- package/dist/errors/not-null-violation.d.ts +0 -6
- package/dist/errors/not-null-violation.js +0 -14
- package/dist/errors/range-not-satisfiable.d.ts +0 -7
- package/dist/errors/range-not-satisfiable.js +0 -7
- package/dist/errors/record-not-unique.d.ts +0 -6
- package/dist/errors/record-not-unique.js +0 -14
- package/dist/errors/route-not-found.d.ts +0 -5
- package/dist/errors/route-not-found.js +0 -4
- package/dist/errors/service-unavailable.d.ts +0 -7
- package/dist/errors/service-unavailable.js +0 -4
- package/dist/errors/token-expired.d.ts +0 -1
- package/dist/errors/token-expired.js +0 -3
- package/dist/errors/unexpected-response.d.ts +0 -1
- package/dist/errors/unexpected-response.js +0 -3
- package/dist/errors/unprocessable-content.d.ts +0 -5
- package/dist/errors/unprocessable-content.js +0 -4
- package/dist/errors/unsupported-media-type.d.ts +0 -6
- package/dist/errors/unsupported-media-type.js +0 -4
- package/dist/errors/user-suspended.d.ts +0 -1
- package/dist/errors/user-suspended.js +0 -3
- package/dist/errors/value-out-of-range.d.ts +0 -6
- package/dist/errors/value-out-of-range.js +0 -14
- package/dist/errors/value-too-long.d.ts +0 -6
- package/dist/errors/value-too-long.js +0 -14
- package/dist/types/files.d.ts +0 -29
- /package/dist/{types/files.js → extensions/types.js} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@directus/api",
|
|
3
|
-
"version": "13.
|
|
3
|
+
"version": "13.2.0",
|
|
4
4
|
"description": "Directus is a real-time API and App dashboard for managing SQL database content",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"directus",
|
|
@@ -78,7 +78,6 @@
|
|
|
78
78
|
"cookie-parser": "1.4.6",
|
|
79
79
|
"cors": "2.8.5",
|
|
80
80
|
"cron-parser": "4.8.1",
|
|
81
|
-
"csv-parser": "3.0.0",
|
|
82
81
|
"date-fns": "2.30.0",
|
|
83
82
|
"deep-diff": "1.0.2",
|
|
84
83
|
"destroy": "1.2.0",
|
|
@@ -122,6 +121,7 @@
|
|
|
122
121
|
"openid-client": "5.4.2",
|
|
123
122
|
"ora": "6.3.1",
|
|
124
123
|
"otplib": "12.0.1",
|
|
124
|
+
"papaparse": "5.4.1",
|
|
125
125
|
"pino": "8.14.1",
|
|
126
126
|
"pino-http": "8.3.3",
|
|
127
127
|
"pino-http-print": "3.1.0",
|
|
@@ -135,7 +135,7 @@
|
|
|
135
135
|
"snappy": "7.2.2",
|
|
136
136
|
"stream-json": "1.7.5",
|
|
137
137
|
"strip-bom-stream": "5.0.0",
|
|
138
|
-
"
|
|
138
|
+
"tinypool": "0.8.1",
|
|
139
139
|
"tsx": "3.12.7",
|
|
140
140
|
"uuid": "9.0.0",
|
|
141
141
|
"uuid-validate": "0.0.3",
|
|
@@ -143,22 +143,23 @@
|
|
|
143
143
|
"ws": "8.12.1",
|
|
144
144
|
"zod": "3.21.4",
|
|
145
145
|
"zod-validation-error": "1.0.1",
|
|
146
|
-
"@directus/app": "10.9.
|
|
147
|
-
"@directus/constants": "
|
|
148
|
-
"@directus/errors": "0.0
|
|
149
|
-
"@directus/extensions
|
|
150
|
-
"@directus/
|
|
151
|
-
"@directus/
|
|
146
|
+
"@directus/app": "10.9.1",
|
|
147
|
+
"@directus/constants": "11.0.0",
|
|
148
|
+
"@directus/errors": "0.1.0",
|
|
149
|
+
"@directus/extensions": "0.0.1",
|
|
150
|
+
"@directus/extensions-sdk": "10.1.12",
|
|
151
|
+
"@directus/pressure": "1.0.11",
|
|
152
|
+
"@directus/schema": "11.0.0",
|
|
152
153
|
"@directus/specs": "10.2.0",
|
|
153
|
-
"@directus/storage": "10.0.
|
|
154
|
-
"@directus/storage-driver-azure": "10.0.
|
|
155
|
-
"@directus/storage-driver-cloudinary": "10.0.
|
|
156
|
-
"@directus/storage-driver-gcs": "10.0.
|
|
157
|
-
"@directus/storage-driver-local": "10.0.
|
|
158
|
-
"@directus/storage-driver-s3": "10.0.
|
|
159
|
-
"@directus/storage-driver-supabase": "1.0.
|
|
160
|
-
"@directus/utils": "
|
|
161
|
-
"@directus/validation": "0.0.
|
|
154
|
+
"@directus/storage": "10.0.6",
|
|
155
|
+
"@directus/storage-driver-azure": "10.0.12",
|
|
156
|
+
"@directus/storage-driver-cloudinary": "10.0.12",
|
|
157
|
+
"@directus/storage-driver-gcs": "10.0.12",
|
|
158
|
+
"@directus/storage-driver-local": "10.0.12",
|
|
159
|
+
"@directus/storage-driver-s3": "10.0.12",
|
|
160
|
+
"@directus/storage-driver-supabase": "1.0.4",
|
|
161
|
+
"@directus/utils": "11.0.0",
|
|
162
|
+
"@directus/validation": "0.0.7"
|
|
162
163
|
},
|
|
163
164
|
"devDependencies": {
|
|
164
165
|
"@ngneat/falso": "6.4.0",
|
|
@@ -190,6 +191,7 @@
|
|
|
190
191
|
"@types/node-schedule": "2.1.0",
|
|
191
192
|
"@types/nodemailer": "6.4.7",
|
|
192
193
|
"@types/object-hash": "3.0.2",
|
|
194
|
+
"@types/papaparse": "5.3.9",
|
|
193
195
|
"@types/qs": "6.9.7",
|
|
194
196
|
"@types/sanitize-html": "2.9.0",
|
|
195
197
|
"@types/stream-json": "1.7.3",
|
|
@@ -203,11 +205,11 @@
|
|
|
203
205
|
"form-data": "4.0.0",
|
|
204
206
|
"knex-mock-client": "2.0.0",
|
|
205
207
|
"supertest": "6.3.3",
|
|
206
|
-
"typescript": "5.
|
|
208
|
+
"typescript": "5.2.2",
|
|
207
209
|
"vitest": "0.31.1",
|
|
208
|
-
"@directus/random": "0.2.
|
|
209
|
-
"@directus/tsconfig": "1.0.
|
|
210
|
-
"@directus/types": "
|
|
210
|
+
"@directus/random": "0.2.3",
|
|
211
|
+
"@directus/tsconfig": "1.0.1",
|
|
212
|
+
"@directus/types": "11.0.0"
|
|
211
213
|
},
|
|
212
214
|
"optionalDependencies": {
|
|
213
215
|
"@keyv/redis": "2.5.8",
|
package/dist/errors/codes.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export declare enum ErrorCode {
|
|
2
|
-
ContainsNullValues = "CONTAINS_NULL_VALUES",
|
|
3
|
-
ContentTooLarge = "CONTENT_TOO_LARGE",
|
|
4
|
-
Forbidden = "FORBIDDEN",
|
|
5
|
-
IllegalAssetTransformation = "ILLEGAL_ASSET_TRANSFORMATION",
|
|
6
|
-
InvalidCredentials = "INVALID_CREDENTIALS",
|
|
7
|
-
InvalidForeignKey = "INVALID_FOREIGN_KEY",
|
|
8
|
-
InvalidIp = "INVALID_IP",
|
|
9
|
-
InvalidOtp = "INVALID_OTP",
|
|
10
|
-
InvalidPayload = "INVALID_PAYLOAD",
|
|
11
|
-
InvalidProvider = "INVALID_PROVIDER",
|
|
12
|
-
InvalidProviderConfig = "INVALID_PROVIDER_CONFIG",
|
|
13
|
-
InvalidQuery = "INVALID_QUERY",
|
|
14
|
-
InvalidToken = "INVALID_TOKEN",
|
|
15
|
-
MethodNotAllowed = "METHOD_NOT_ALLOWED",
|
|
16
|
-
NotNullViolation = "NOT_NULL_VIOLATION",
|
|
17
|
-
RangeNotSatisfiable = "RANGE_NOT_SATISFIABLE",
|
|
18
|
-
RecordNotUnique = "RECORD_NOT_UNIQUE",
|
|
19
|
-
RequestsExceeded = "REQUESTS_EXCEEDED",
|
|
20
|
-
RouteNotFound = "ROUTE_NOT_FOUND",
|
|
21
|
-
ServiceUnavailable = "SERVICE_UNAVAILABLE",
|
|
22
|
-
TokenExpired = "TOKEN_EXPIRED",
|
|
23
|
-
UnexpectedResponse = "UNEXPECTED_RESPONSE",
|
|
24
|
-
UnprocessableContent = "UNPROCESSABLE_CONTENT",
|
|
25
|
-
UnsupportedMediaType = "UNSUPPORTED_MEDIA_TYPE",
|
|
26
|
-
UserSuspended = "USER_SUSPENDED",
|
|
27
|
-
ValueOutOfRange = "VALUE_OUT_OF_RANGE",
|
|
28
|
-
ValueTooLong = "VALUE_TOO_LONG"
|
|
29
|
-
}
|
package/dist/errors/codes.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
export var ErrorCode;
|
|
2
|
-
(function (ErrorCode) {
|
|
3
|
-
ErrorCode["ContainsNullValues"] = "CONTAINS_NULL_VALUES";
|
|
4
|
-
ErrorCode["ContentTooLarge"] = "CONTENT_TOO_LARGE";
|
|
5
|
-
ErrorCode["Forbidden"] = "FORBIDDEN";
|
|
6
|
-
ErrorCode["IllegalAssetTransformation"] = "ILLEGAL_ASSET_TRANSFORMATION";
|
|
7
|
-
ErrorCode["InvalidCredentials"] = "INVALID_CREDENTIALS";
|
|
8
|
-
ErrorCode["InvalidForeignKey"] = "INVALID_FOREIGN_KEY";
|
|
9
|
-
ErrorCode["InvalidIp"] = "INVALID_IP";
|
|
10
|
-
ErrorCode["InvalidOtp"] = "INVALID_OTP";
|
|
11
|
-
ErrorCode["InvalidPayload"] = "INVALID_PAYLOAD";
|
|
12
|
-
ErrorCode["InvalidProvider"] = "INVALID_PROVIDER";
|
|
13
|
-
ErrorCode["InvalidProviderConfig"] = "INVALID_PROVIDER_CONFIG";
|
|
14
|
-
ErrorCode["InvalidQuery"] = "INVALID_QUERY";
|
|
15
|
-
ErrorCode["InvalidToken"] = "INVALID_TOKEN";
|
|
16
|
-
ErrorCode["MethodNotAllowed"] = "METHOD_NOT_ALLOWED";
|
|
17
|
-
ErrorCode["NotNullViolation"] = "NOT_NULL_VIOLATION";
|
|
18
|
-
ErrorCode["RangeNotSatisfiable"] = "RANGE_NOT_SATISFIABLE";
|
|
19
|
-
ErrorCode["RecordNotUnique"] = "RECORD_NOT_UNIQUE";
|
|
20
|
-
ErrorCode["RequestsExceeded"] = "REQUESTS_EXCEEDED";
|
|
21
|
-
ErrorCode["RouteNotFound"] = "ROUTE_NOT_FOUND";
|
|
22
|
-
ErrorCode["ServiceUnavailable"] = "SERVICE_UNAVAILABLE";
|
|
23
|
-
ErrorCode["TokenExpired"] = "TOKEN_EXPIRED";
|
|
24
|
-
ErrorCode["UnexpectedResponse"] = "UNEXPECTED_RESPONSE";
|
|
25
|
-
ErrorCode["UnprocessableContent"] = "UNPROCESSABLE_CONTENT";
|
|
26
|
-
ErrorCode["UnsupportedMediaType"] = "UNSUPPORTED_MEDIA_TYPE";
|
|
27
|
-
ErrorCode["UserSuspended"] = "USER_SUSPENDED";
|
|
28
|
-
ErrorCode["ValueOutOfRange"] = "VALUE_OUT_OF_RANGE";
|
|
29
|
-
ErrorCode["ValueTooLong"] = "VALUE_TOO_LONG";
|
|
30
|
-
})(ErrorCode || (ErrorCode = {}));
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface ContainsNullValuesErrorExtensions {
|
|
2
|
-
collection: string;
|
|
3
|
-
field: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: ({ collection, field }: ContainsNullValuesErrorExtensions) => string;
|
|
6
|
-
export declare const ContainsNullValuesError: import("@directus/errors").DirectusErrorConstructor<ContainsNullValuesErrorExtensions>;
|
|
7
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = ({ collection, field }) => `Field "${field}" in collection "${collection}" contains null values.`;
|
|
4
|
-
export const ContainsNullValuesError = createError(ErrorCode.ContainsNullValues, messageConstructor, 400);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ContentTooLargeError: import("@directus/errors").DirectusErrorConstructor<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const ForbiddenError: import("@directus/errors").DirectusErrorConstructor<void>;
|
package/dist/errors/forbidden.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface HitRateLimitErrorExtensions {
|
|
2
|
-
limit: number;
|
|
3
|
-
reset: Date;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: (extensions: HitRateLimitErrorExtensions) => string;
|
|
6
|
-
export declare const HitRateLimitError: import("@directus/errors").DirectusErrorConstructor<HitRateLimitErrorExtensions>;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import ms from 'ms';
|
|
3
|
-
import { ErrorCode } from './codes.js';
|
|
4
|
-
export const messageConstructor = (extensions) => {
|
|
5
|
-
const msBeforeNext = extensions.reset.getTime() - Date.now();
|
|
6
|
-
return `Too many requests, retry after ${ms(msBeforeNext)}.`;
|
|
7
|
-
};
|
|
8
|
-
export const HitRateLimitError = createError(ErrorCode.RequestsExceeded, messageConstructor, 429);
|
package/dist/errors/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export { ErrorCode } from './codes.js';
|
|
2
|
-
export { ContainsNullValuesError } from './contains-null-values.js';
|
|
3
|
-
export { ContentTooLargeError } from './content-too-large.js';
|
|
4
|
-
export { ForbiddenError } from './forbidden.js';
|
|
5
|
-
export { HitRateLimitError } from './hit-rate-limit.js';
|
|
6
|
-
export { IllegalAssetTransformationError } from './illegal-asset-transformation.js';
|
|
7
|
-
export { InvalidCredentialsError } from './invalid-credentials.js';
|
|
8
|
-
export { InvalidForeignKeyError } from './invalid-foreign-key.js';
|
|
9
|
-
export { InvalidIpError } from './invalid-ip.js';
|
|
10
|
-
export { InvalidOtpError } from './invalid-otp.js';
|
|
11
|
-
export { InvalidPayloadError } from './invalid-payload.js';
|
|
12
|
-
export { InvalidProviderError } from './invalid-provider.js';
|
|
13
|
-
export { InvalidProviderConfigError } from './invalid-provider-config.js';
|
|
14
|
-
export { InvalidQueryError } from './invalid-query.js';
|
|
15
|
-
export { InvalidTokenError } from './invalid-token.js';
|
|
16
|
-
export { MethodNotAllowedError } from './method-not-allowed.js';
|
|
17
|
-
export { NotNullViolationError } from './not-null-violation.js';
|
|
18
|
-
export { RangeNotSatisfiableError } from './range-not-satisfiable.js';
|
|
19
|
-
export { RecordNotUniqueError } from './record-not-unique.js';
|
|
20
|
-
export { RouteNotFoundError } from './route-not-found.js';
|
|
21
|
-
export { ServiceUnavailableError } from './service-unavailable.js';
|
|
22
|
-
export { TokenExpiredError } from './token-expired.js';
|
|
23
|
-
export { UnexpectedResponseError } from './unexpected-response.js';
|
|
24
|
-
export { UnprocessableContentError } from './unprocessable-content.js';
|
|
25
|
-
export { UnsupportedMediaTypeError } from './unsupported-media-type.js';
|
|
26
|
-
export { UserSuspendedError } from './user-suspended.js';
|
|
27
|
-
export { ValueOutOfRangeError } from './value-out-of-range.js';
|
|
28
|
-
export { ValueTooLongError } from './value-too-long.js';
|
package/dist/errors/index.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
export { ErrorCode } from './codes.js';
|
|
2
|
-
export { ContainsNullValuesError } from './contains-null-values.js';
|
|
3
|
-
export { ContentTooLargeError } from './content-too-large.js';
|
|
4
|
-
export { ForbiddenError } from './forbidden.js';
|
|
5
|
-
export { HitRateLimitError } from './hit-rate-limit.js';
|
|
6
|
-
export { IllegalAssetTransformationError } from './illegal-asset-transformation.js';
|
|
7
|
-
export { InvalidCredentialsError } from './invalid-credentials.js';
|
|
8
|
-
export { InvalidForeignKeyError } from './invalid-foreign-key.js';
|
|
9
|
-
export { InvalidIpError } from './invalid-ip.js';
|
|
10
|
-
export { InvalidOtpError } from './invalid-otp.js';
|
|
11
|
-
export { InvalidPayloadError } from './invalid-payload.js';
|
|
12
|
-
export { InvalidProviderError } from './invalid-provider.js';
|
|
13
|
-
export { InvalidProviderConfigError } from './invalid-provider-config.js';
|
|
14
|
-
export { InvalidQueryError } from './invalid-query.js';
|
|
15
|
-
export { InvalidTokenError } from './invalid-token.js';
|
|
16
|
-
export { MethodNotAllowedError } from './method-not-allowed.js';
|
|
17
|
-
export { NotNullViolationError } from './not-null-violation.js';
|
|
18
|
-
export { RangeNotSatisfiableError } from './range-not-satisfiable.js';
|
|
19
|
-
export { RecordNotUniqueError } from './record-not-unique.js';
|
|
20
|
-
export { RouteNotFoundError } from './route-not-found.js';
|
|
21
|
-
export { ServiceUnavailableError } from './service-unavailable.js';
|
|
22
|
-
export { TokenExpiredError } from './token-expired.js';
|
|
23
|
-
export { UnexpectedResponseError } from './unexpected-response.js';
|
|
24
|
-
export { UnprocessableContentError } from './unprocessable-content.js';
|
|
25
|
-
export { UnsupportedMediaTypeError } from './unsupported-media-type.js';
|
|
26
|
-
export { UserSuspendedError } from './user-suspended.js';
|
|
27
|
-
export { ValueOutOfRangeError } from './value-out-of-range.js';
|
|
28
|
-
export { ValueTooLongError } from './value-too-long.js';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const InvalidCredentialsError: import("@directus/errors").DirectusErrorConstructor<void>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface InvalidForeignKeyErrorExtensions {
|
|
2
|
-
collection: string | null;
|
|
3
|
-
field: string | null;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: ({ collection, field }: InvalidForeignKeyErrorExtensions) => string;
|
|
6
|
-
export declare const InvalidForeignKeyError: import("@directus/errors").DirectusErrorConstructor<InvalidForeignKeyErrorExtensions>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = ({ collection, field }) => {
|
|
4
|
-
let message = 'Invalid foreign key';
|
|
5
|
-
if (field) {
|
|
6
|
-
message += ` for field "${field}"`;
|
|
7
|
-
}
|
|
8
|
-
if (collection) {
|
|
9
|
-
message += ` in collection "${collection}"`;
|
|
10
|
-
}
|
|
11
|
-
message += `.`;
|
|
12
|
-
return message;
|
|
13
|
-
};
|
|
14
|
-
export const InvalidForeignKeyError = createError(ErrorCode.InvalidForeignKey, messageConstructor, 400);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const InvalidIpError: import("@directus/errors").DirectusErrorConstructor<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const InvalidOtpError: import("@directus/errors").DirectusErrorConstructor<void>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export interface InvalidPayloadErrorExtensions {
|
|
2
|
-
reason: string;
|
|
3
|
-
}
|
|
4
|
-
export declare const messageConstructor: ({ reason }: InvalidPayloadErrorExtensions) => string;
|
|
5
|
-
export declare const InvalidPayloadError: import("@directus/errors").DirectusErrorConstructor<InvalidPayloadErrorExtensions>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const InvalidProviderError: import("@directus/errors").DirectusErrorConstructor<void>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export interface InvalidQueryErrorExtensions {
|
|
2
|
-
reason: string;
|
|
3
|
-
}
|
|
4
|
-
export declare const messageConstructor: ({ reason }: InvalidQueryErrorExtensions) => string;
|
|
5
|
-
export declare const InvalidQueryError: import("@directus/errors").DirectusErrorConstructor<InvalidQueryErrorExtensions>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const InvalidTokenError: import("@directus/errors").DirectusErrorConstructor<void>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface MethodNotAllowedErrorExtensions {
|
|
2
|
-
allowed: string[];
|
|
3
|
-
current: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: (extensions: MethodNotAllowedErrorExtensions) => string;
|
|
6
|
-
export declare const MethodNotAllowedError: import("@directus/errors").DirectusErrorConstructor<MethodNotAllowedErrorExtensions>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = (extensions) => `Invalid method "${extensions.current}" used. Should be one of ${extensions.allowed
|
|
4
|
-
.map((method) => `"${method}"`)
|
|
5
|
-
.join(', ')}.`;
|
|
6
|
-
export const MethodNotAllowedError = createError(ErrorCode.MethodNotAllowed, messageConstructor, 405);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface NotNullViolationErrorExtensions {
|
|
2
|
-
collection: string | null;
|
|
3
|
-
field: string | null;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: ({ collection, field }: NotNullViolationErrorExtensions) => string;
|
|
6
|
-
export declare const NotNullViolationError: import("@directus/errors").DirectusErrorConstructor<NotNullViolationErrorExtensions>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = ({ collection, field }) => {
|
|
4
|
-
let message = 'Value ';
|
|
5
|
-
if (field) {
|
|
6
|
-
message += `for field "${field}" `;
|
|
7
|
-
}
|
|
8
|
-
if (collection) {
|
|
9
|
-
message += `in collection "${collection}" `;
|
|
10
|
-
}
|
|
11
|
-
message += `can't be null.`;
|
|
12
|
-
return message;
|
|
13
|
-
};
|
|
14
|
-
export const NotNullViolationError = createError(ErrorCode.NotNullViolation, messageConstructor, 400);
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Range } from '@directus/storage';
|
|
2
|
-
interface RangeNotSatisfiableErrorExtensions {
|
|
3
|
-
range: Range;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: ({ range }: RangeNotSatisfiableErrorExtensions) => string;
|
|
6
|
-
export declare const RangeNotSatisfiableError: import("@directus/errors").DirectusErrorConstructor<RangeNotSatisfiableErrorExtensions>;
|
|
7
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = ({ range }) => {
|
|
4
|
-
const rangeString = `"${range.start ?? ''}-${range.end ?? ''}"`;
|
|
5
|
-
return `Range ${rangeString} is invalid or the file's size doesn't match the requested range.`;
|
|
6
|
-
};
|
|
7
|
-
export const RangeNotSatisfiableError = createError(ErrorCode.RangeNotSatisfiable, messageConstructor, 416);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface RecordNotUniqueErrorExtensions {
|
|
2
|
-
collection: string | null;
|
|
3
|
-
field: string | null;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: ({ collection, field }: RecordNotUniqueErrorExtensions) => string;
|
|
6
|
-
export declare const RecordNotUniqueError: import("@directus/errors").DirectusErrorConstructor<RecordNotUniqueErrorExtensions>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = ({ collection, field }) => {
|
|
4
|
-
let message = 'Value ';
|
|
5
|
-
if (field) {
|
|
6
|
-
message += `for field "${field}" `;
|
|
7
|
-
}
|
|
8
|
-
if (collection) {
|
|
9
|
-
message += `in collection "${collection}" `;
|
|
10
|
-
}
|
|
11
|
-
message += `has to be unique.`;
|
|
12
|
-
return message;
|
|
13
|
-
};
|
|
14
|
-
export const RecordNotUniqueError = createError(ErrorCode.RecordNotUnique, messageConstructor, 400);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export interface RouteNotFoundErrorExtensions {
|
|
2
|
-
path: string;
|
|
3
|
-
}
|
|
4
|
-
export declare const messageConstructor: ({ path }: RouteNotFoundErrorExtensions) => string;
|
|
5
|
-
export declare const RouteNotFoundError: import("@directus/errors").DirectusErrorConstructor<RouteNotFoundErrorExtensions>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface ServiceUnavailableErrorExtensions {
|
|
2
|
-
service: string;
|
|
3
|
-
reason: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: ({ service, reason }: ServiceUnavailableErrorExtensions) => string;
|
|
6
|
-
export declare const ServiceUnavailableError: import("@directus/errors").DirectusErrorConstructor<ServiceUnavailableErrorExtensions>;
|
|
7
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = ({ service, reason }) => `Service "${service}" is unavailable. ${reason}.`;
|
|
4
|
-
export const ServiceUnavailableError = createError(ErrorCode.ServiceUnavailable, messageConstructor, 503);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const TokenExpiredError: import("@directus/errors").DirectusErrorConstructor<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const UnexpectedResponseError: import("@directus/errors").DirectusErrorConstructor<void>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
const messageConstructor = (extensions) => `Can't process content. ${extensions.reason}.`;
|
|
4
|
-
export const UnprocessableContentError = createError(ErrorCode.UnprocessableContent, messageConstructor, 422);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface UnsupportedMediaTypeErrorExtensions {
|
|
2
|
-
mediaType: string;
|
|
3
|
-
where: string;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: (extensions: UnsupportedMediaTypeErrorExtensions) => string;
|
|
6
|
-
export declare const UnsupportedMediaTypeError: import("@directus/errors").DirectusErrorConstructor<UnsupportedMediaTypeErrorExtensions>;
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = (extensions) => `Unsupported media type "${extensions.mediaType}" in ${extensions.where}.`;
|
|
4
|
-
export const UnsupportedMediaTypeError = createError(ErrorCode.UnsupportedMediaType, messageConstructor, 415);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const UserSuspendedError: import("@directus/errors").DirectusErrorConstructor<void>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface ValueOutOfRangeErrorExtensions {
|
|
2
|
-
collection: string | null;
|
|
3
|
-
field: string | null;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: ({ collection, field }: ValueOutOfRangeErrorExtensions) => string;
|
|
6
|
-
export declare const ValueOutOfRangeError: import("@directus/errors").DirectusErrorConstructor<ValueOutOfRangeErrorExtensions>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = ({ collection, field }) => {
|
|
4
|
-
let message = 'Numeric value ';
|
|
5
|
-
if (field) {
|
|
6
|
-
message += `for field "${field}" `;
|
|
7
|
-
}
|
|
8
|
-
if (collection) {
|
|
9
|
-
message += `in collection "${collection}" `;
|
|
10
|
-
}
|
|
11
|
-
message += `is out of range.`;
|
|
12
|
-
return message;
|
|
13
|
-
};
|
|
14
|
-
export const ValueOutOfRangeError = createError(ErrorCode.ValueOutOfRange, messageConstructor, 400);
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export interface ValueTooLongErrorExtensions {
|
|
2
|
-
collection: string | null;
|
|
3
|
-
field: string | null;
|
|
4
|
-
}
|
|
5
|
-
export declare const messageConstructor: ({ collection, field }: ValueTooLongErrorExtensions) => string;
|
|
6
|
-
export declare const ValueTooLongError: import("@directus/errors").DirectusErrorConstructor<ValueTooLongErrorExtensions>;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createError } from '@directus/errors';
|
|
2
|
-
import { ErrorCode } from './codes.js';
|
|
3
|
-
export const messageConstructor = ({ collection, field }) => {
|
|
4
|
-
let message = 'Value ';
|
|
5
|
-
if (field) {
|
|
6
|
-
message += `for field "${field}" `;
|
|
7
|
-
}
|
|
8
|
-
if (collection) {
|
|
9
|
-
message += `in collection "${collection}" `;
|
|
10
|
-
}
|
|
11
|
-
message += `is too long.`;
|
|
12
|
-
return message;
|
|
13
|
-
};
|
|
14
|
-
export const ValueTooLongError = createError(ErrorCode.ValueTooLong, messageConstructor, 400);
|