@directus/api 13.1.0 → 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 +2 -2
- 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/env.js +2 -2
- 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 +6 -6
- 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.d.ts +4 -0
- package/dist/services/users.js +21 -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
|
@@ -1,34 +1,5 @@
|
|
|
1
1
|
import { getService } from '../../utils/get-service.js';
|
|
2
2
|
import { CollectionsService, FieldsService, MetaService } from '../../services/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Get a single item from a collection using the appropriate service
|
|
5
|
-
*
|
|
6
|
-
* @param subscription Subscription object
|
|
7
|
-
* @param accountability Accountability object
|
|
8
|
-
* @param schema Schema object
|
|
9
|
-
* @param event Event data
|
|
10
|
-
* @returns the fetched item
|
|
11
|
-
*/
|
|
12
|
-
export async function getSinglePayload(subscription, accountability, schema, event) {
|
|
13
|
-
const metaService = new MetaService({ schema, accountability });
|
|
14
|
-
const query = subscription.query ?? {};
|
|
15
|
-
const id = subscription.item;
|
|
16
|
-
const result = {
|
|
17
|
-
event: event?.action ?? 'init',
|
|
18
|
-
};
|
|
19
|
-
if (subscription.collection === 'directus_collections') {
|
|
20
|
-
const service = new CollectionsService({ schema, accountability });
|
|
21
|
-
result['data'] = await service.readOne(String(id));
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const service = getService(subscription.collection, { schema, accountability });
|
|
25
|
-
result['data'] = await service.readOne(id, query);
|
|
26
|
-
}
|
|
27
|
-
if ('meta' in query) {
|
|
28
|
-
result['meta'] = await metaService.getMetaForQuery(subscription.collection, query);
|
|
29
|
-
}
|
|
30
|
-
return result;
|
|
31
|
-
}
|
|
32
3
|
/**
|
|
33
4
|
* Get items from a collection using the appropriate service
|
|
34
5
|
*
|
|
@@ -38,17 +9,17 @@ export async function getSinglePayload(subscription, accountability, schema, eve
|
|
|
38
9
|
* @param event Event data
|
|
39
10
|
* @returns the fetched items
|
|
40
11
|
*/
|
|
41
|
-
export async function
|
|
12
|
+
export async function getPayload(subscription, accountability, schema, event) {
|
|
42
13
|
const metaService = new MetaService({ schema, accountability });
|
|
43
14
|
const result = {
|
|
44
15
|
event: event?.action ?? 'init',
|
|
45
16
|
};
|
|
46
17
|
switch (subscription.collection) {
|
|
47
18
|
case 'directus_collections':
|
|
48
|
-
result['data'] = await getCollectionPayload(accountability, schema, event);
|
|
19
|
+
result['data'] = await getCollectionPayload(subscription, accountability, schema, event);
|
|
49
20
|
break;
|
|
50
21
|
case 'directus_fields':
|
|
51
|
-
result['data'] = await getFieldsPayload(accountability, schema, event);
|
|
22
|
+
result['data'] = await getFieldsPayload(subscription, accountability, schema, event);
|
|
52
23
|
break;
|
|
53
24
|
case 'directus_relations':
|
|
54
25
|
result['data'] = event?.payload;
|
|
@@ -71,19 +42,27 @@ export async function getMultiPayload(subscription, accountability, schema, even
|
|
|
71
42
|
* @param event Event data
|
|
72
43
|
* @returns the fetched collection data
|
|
73
44
|
*/
|
|
74
|
-
export async function getCollectionPayload(accountability, schema, event) {
|
|
45
|
+
export async function getCollectionPayload(subscription, accountability, schema, event) {
|
|
75
46
|
const service = new CollectionsService({ schema, accountability });
|
|
76
|
-
if (
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
|
|
47
|
+
if ('item' in subscription) {
|
|
48
|
+
if (event?.action === 'delete') {
|
|
49
|
+
// return only the subscribed id in case a bulk delete was done
|
|
50
|
+
return subscription.item;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
return await service.readOne(String(subscription.item));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
switch (event?.action) {
|
|
57
|
+
case 'create':
|
|
58
|
+
return await service.readMany([String(event.key)]);
|
|
59
|
+
case 'update':
|
|
60
|
+
return await service.readMany(event.keys.map((key) => String(key)));
|
|
61
|
+
case 'delete':
|
|
62
|
+
return event.keys;
|
|
63
|
+
case undefined:
|
|
64
|
+
default:
|
|
65
|
+
return await service.readByQuery();
|
|
87
66
|
}
|
|
88
67
|
}
|
|
89
68
|
/**
|
|
@@ -94,16 +73,24 @@ export async function getCollectionPayload(accountability, schema, event) {
|
|
|
94
73
|
* @param event Event data
|
|
95
74
|
* @returns the fetched field data
|
|
96
75
|
*/
|
|
97
|
-
export async function getFieldsPayload(accountability, schema, event) {
|
|
76
|
+
export async function getFieldsPayload(subscription, accountability, schema, event) {
|
|
98
77
|
const service = new FieldsService({ schema, accountability });
|
|
99
|
-
if (
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
78
|
+
if ('item' in subscription) {
|
|
79
|
+
if (event?.action === 'delete') {
|
|
80
|
+
// return only the subscribed id in case a bluk delete was done
|
|
81
|
+
return subscription.item;
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
return await service.readOne(subscription.collection, String(subscription.item));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
switch (event?.action) {
|
|
88
|
+
case undefined:
|
|
89
|
+
return await service.readAll();
|
|
90
|
+
case 'delete':
|
|
91
|
+
return event.keys;
|
|
92
|
+
default:
|
|
93
|
+
return await service.readOne(event?.payload?.['collection'], event?.payload?.['field']);
|
|
107
94
|
}
|
|
108
95
|
}
|
|
109
96
|
/**
|
|
@@ -118,16 +105,24 @@ export async function getFieldsPayload(accountability, schema, event) {
|
|
|
118
105
|
export async function getItemsPayload(subscription, accountability, schema, event) {
|
|
119
106
|
const query = subscription.query ?? {};
|
|
120
107
|
const service = getService(subscription.collection, { schema, accountability });
|
|
121
|
-
if (
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
|
|
108
|
+
if ('item' in subscription) {
|
|
109
|
+
if (event?.action === 'delete') {
|
|
110
|
+
// return only the subscribed id in case a bluk delete was done
|
|
111
|
+
return subscription.item;
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
return await service.readOne(subscription.item, query);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
switch (event?.action) {
|
|
118
|
+
case 'create':
|
|
119
|
+
return await service.readMany([event.key], query);
|
|
120
|
+
case 'update':
|
|
121
|
+
return await service.readMany(event.keys, query);
|
|
122
|
+
case 'delete':
|
|
123
|
+
return event.keys;
|
|
124
|
+
case undefined:
|
|
125
|
+
default:
|
|
126
|
+
return await service.readByQuery(query);
|
|
132
127
|
}
|
|
133
128
|
}
|
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.
|
|
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>;
|