@directus/api 29.0.0 → 29.1.1
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/auth/drivers/openid.js +12 -6
- package/dist/cli/commands/init/index.js +2 -2
- package/dist/cli/commands/init/questions.d.ts +1 -1
- package/dist/cli/commands/schema/apply.js +1 -1
- package/dist/cli/index.js +1 -0
- package/dist/cli/utils/create-db-connection.d.ts +1 -1
- package/dist/cli/utils/create-env/index.d.ts +1 -1
- package/dist/cli/utils/drivers.d.ts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/controllers/assets.js +1 -1
- package/dist/controllers/extensions.js +1 -1
- package/dist/database/helpers/index.d.ts +4 -4
- package/dist/database/helpers/schema/types.d.ts +1 -2
- package/dist/database/index.d.ts +1 -1
- package/dist/database/migrations/20210225A-add-relations-sort-field.js +1 -1
- package/dist/database/migrations/20240924B-populate-versioning-deltas.js +1 -1
- package/dist/database/run-ast/lib/apply-query/filter/get-filter-type.d.ts +2 -2
- package/dist/extensions/lib/get-extensions-settings.d.ts +1 -1
- package/dist/extensions/lib/sandbox/generate-api-extensions-sandbox-entrypoint.d.ts +1 -1
- package/dist/extensions/manager.d.ts +1 -2
- package/dist/extensions/manager.js +3 -2
- package/dist/flows.d.ts +1 -2
- package/dist/operations/throw-error/index.d.ts +7 -0
- package/dist/operations/throw-error/index.js +11 -0
- package/dist/permissions/utils/fetch-share-info.d.ts +1 -1
- package/dist/services/access.d.ts +1 -2
- package/dist/services/access.js +1 -1
- package/dist/services/activity.d.ts +1 -1
- package/dist/services/assets.d.ts +1 -3
- package/dist/services/authentication.d.ts +1 -2
- package/dist/services/collections.d.ts +3 -10
- package/dist/services/comments.d.ts +1 -2
- package/dist/services/dashboards.d.ts +1 -1
- package/dist/services/extensions.d.ts +2 -4
- package/dist/services/fields.d.ts +1 -2
- package/dist/services/files.d.ts +2 -3
- package/dist/services/flows.d.ts +1 -2
- package/dist/services/folders.d.ts +1 -1
- package/dist/services/graphql/errors/format.d.ts +1 -1
- package/dist/services/graphql/errors/format.js +0 -1
- package/dist/services/graphql/index.d.ts +1 -3
- package/dist/services/graphql/resolvers/system-admin.d.ts +1 -1
- package/dist/services/graphql/resolvers/system-global.d.ts +1 -1
- package/dist/services/graphql/resolvers/system.d.ts +1 -1
- package/dist/services/graphql/schema/get-types.d.ts +1 -1
- package/dist/services/graphql/schema/get-types.js +0 -1
- package/dist/services/import-export.d.ts +2 -4
- package/dist/services/items.d.ts +2 -12
- package/dist/services/items.js +2 -1
- package/dist/services/mail/index.d.ts +2 -4
- package/dist/services/mail/index.js +11 -5
- package/dist/services/meta.d.ts +1 -2
- package/dist/services/notifications.d.ts +1 -2
- package/dist/services/operations.d.ts +1 -2
- package/dist/services/panels.d.ts +1 -1
- package/dist/services/payload.d.ts +9 -17
- package/dist/services/payload.js +1 -1
- package/dist/services/permissions.d.ts +1 -3
- package/dist/services/policies.d.ts +1 -2
- package/dist/services/policies.js +1 -1
- package/dist/services/presets.d.ts +1 -1
- package/dist/services/relations.d.ts +2 -3
- package/dist/services/revisions.d.ts +1 -2
- package/dist/services/roles.d.ts +1 -2
- package/dist/services/roles.js +1 -1
- package/dist/services/schema.d.ts +1 -2
- package/dist/services/server.d.ts +1 -2
- package/dist/services/settings.d.ts +1 -1
- package/dist/services/shares.d.ts +1 -2
- package/dist/services/specifications.d.ts +1 -2
- package/dist/services/tfa.d.ts +1 -2
- package/dist/services/translations.d.ts +1 -3
- package/dist/services/users.d.ts +1 -2
- package/dist/services/users.js +1 -1
- package/dist/services/utils.d.ts +1 -2
- package/dist/services/versions.d.ts +1 -2
- package/dist/services/webhooks.d.ts +1 -2
- package/dist/services/websocket.d.ts +1 -3
- package/dist/types/auth.d.ts +0 -6
- package/dist/types/index.d.ts +0 -7
- package/dist/types/index.js +0 -7
- package/dist/utils/apply-diff.d.ts +1 -2
- package/dist/utils/apply-diff.js +1 -1
- package/dist/utils/apply-snapshot.d.ts +1 -2
- package/dist/utils/get-ip-from-req.js +1 -1
- package/dist/utils/get-service.d.ts +1 -1
- package/dist/utils/get-snapshot-diff.d.ts +1 -1
- package/dist/utils/get-snapshot-diff.js +1 -1
- package/dist/utils/get-snapshot.d.ts +1 -2
- package/dist/utils/schedule.js +4 -1
- package/dist/utils/should-clear-cache.d.ts +1 -1
- package/dist/utils/transformations.d.ts +1 -2
- package/dist/utils/validate-diff.d.ts +1 -1
- package/dist/utils/validate-diff.js +1 -1
- package/dist/utils/validate-snapshot.d.ts +1 -1
- package/dist/utils/validate-snapshot.js +1 -1
- package/dist/utils/validate-user-count-integrity.d.ts +1 -8
- package/dist/utils/validate-user-count-integrity.js +1 -9
- package/dist/websocket/controllers/base.d.ts +2 -1
- package/dist/websocket/controllers/base.js +2 -1
- package/dist/websocket/controllers/graphql.js +1 -1
- package/dist/websocket/controllers/logs.js +1 -1
- package/dist/websocket/controllers/rest.d.ts +1 -1
- package/dist/websocket/controllers/rest.js +1 -1
- package/dist/websocket/errors.d.ts +1 -1
- package/dist/websocket/handlers/heartbeat.d.ts +1 -1
- package/dist/websocket/handlers/heartbeat.js +1 -1
- package/dist/websocket/messages.d.ts +57 -308
- package/dist/websocket/messages.js +5 -10
- package/dist/websocket/utils/items.d.ts +1 -1
- package/dist/websocket/utils/wait-for-message.d.ts +1 -1
- package/dist/websocket/utils/wait-for-message.js +1 -1
- package/package.json +80 -81
- package/dist/extensions/types.d.ts +0 -19
- package/dist/extensions/types.js +0 -1
- package/dist/types/assets.d.ts +0 -22
- package/dist/types/assets.js +0 -51
- package/dist/types/database.d.ts +0 -3
- package/dist/types/database.js +0 -1
- package/dist/types/graphql.d.ts +0 -14
- package/dist/types/graphql.js +0 -1
- package/dist/types/items.d.ts +0 -52
- package/dist/types/items.js +0 -1
- package/dist/types/services.d.ts +0 -22
- package/dist/types/services.js +0 -1
- package/dist/types/snapshot.d.ts +0 -55
- package/dist/types/snapshot.js +0 -13
- package/dist/types/webhooks.d.ts +0 -15
- package/dist/types/webhooks.js +0 -1
|
@@ -32,8 +32,9 @@ export class OpenIDAuthDriver extends LocalAuthDriver {
|
|
|
32
32
|
super(options, config);
|
|
33
33
|
const env = useEnv();
|
|
34
34
|
const logger = useLogger();
|
|
35
|
-
const { issuerUrl, clientId, clientSecret, provider, issuerDiscoveryMustSucceed } = config;
|
|
36
|
-
|
|
35
|
+
const { issuerUrl, clientId, clientSecret, clientPrivateKeys, clientTokenEndpointAuthMethod, provider, issuerDiscoveryMustSucceed, } = config;
|
|
36
|
+
const isPrivateKeyJwtAuthMethod = clientTokenEndpointAuthMethod === 'private_key_jwt';
|
|
37
|
+
if (!issuerUrl || !clientId || !(clientSecret || (isPrivateKeyJwtAuthMethod && clientPrivateKeys)) || !provider) {
|
|
37
38
|
logger.error('Invalid provider config');
|
|
38
39
|
throw new InvalidProviderConfigError({ provider });
|
|
39
40
|
}
|
|
@@ -66,7 +67,8 @@ export class OpenIDAuthDriver extends LocalAuthDriver {
|
|
|
66
67
|
if (this.client)
|
|
67
68
|
return this.client;
|
|
68
69
|
const logger = useLogger();
|
|
69
|
-
const { issuerUrl, clientId, clientSecret, provider } = this.config;
|
|
70
|
+
const { issuerUrl, clientId, clientSecret, clientPrivateKeys, clientTokenEndpointAuthMethod, provider } = this.config;
|
|
71
|
+
const isPrivateKeyJwtAuthMethod = clientTokenEndpointAuthMethod === 'private_key_jwt';
|
|
70
72
|
// extract client http overrides/options
|
|
71
73
|
const clientHttpOptions = getConfigFromEnv(`AUTH_${provider.toUpperCase()}_CLIENT_HTTP_`);
|
|
72
74
|
if (clientHttpOptions) {
|
|
@@ -87,17 +89,21 @@ export class OpenIDAuthDriver extends LocalAuthDriver {
|
|
|
87
89
|
}
|
|
88
90
|
// extract client overrides/options excluding CLIENT_ID and CLIENT_SECRET as they are passed directly
|
|
89
91
|
const clientOptionsOverrides = getConfigFromEnv(`AUTH_${provider.toUpperCase()}_CLIENT_`, {
|
|
90
|
-
omitKey: [
|
|
92
|
+
omitKey: [
|
|
93
|
+
`AUTH_${provider.toUpperCase()}_CLIENT_ID`,
|
|
94
|
+
`AUTH_${provider.toUpperCase()}_CLIENT_SECRET`,
|
|
95
|
+
`AUTH_${provider.toUpperCase()}_CLIENT_PRIVATE_KEYS`,
|
|
96
|
+
],
|
|
91
97
|
omitPrefix: [`AUTH_${provider.toUpperCase()}_CLIENT_HTTP_`],
|
|
92
98
|
type: 'underscore',
|
|
93
99
|
});
|
|
94
100
|
const client = new issuer.Client({
|
|
95
101
|
client_id: clientId,
|
|
96
|
-
client_secret: clientSecret,
|
|
102
|
+
...(!isPrivateKeyJwtAuthMethod && { client_secret: clientSecret }),
|
|
97
103
|
redirect_uris: [this.redirectUrl],
|
|
98
104
|
response_types: ['code'],
|
|
99
105
|
...clientOptionsOverrides,
|
|
100
|
-
});
|
|
106
|
+
}, isPrivateKeyJwtAuthMethod ? { keys: clientPrivateKeys } : undefined);
|
|
101
107
|
if (clientHttpOptions) {
|
|
102
108
|
client[custom.http_options] = (_, options) => {
|
|
103
109
|
return {
|
|
@@ -60,7 +60,7 @@ export default async function init() {
|
|
|
60
60
|
default: 'admin@example.com',
|
|
61
61
|
validate: (input) => {
|
|
62
62
|
const emailSchema = Joi.string().email().required();
|
|
63
|
-
const { error } = emailSchema.validate(input);
|
|
63
|
+
const { error } = emailSchema.validate(input.trim());
|
|
64
64
|
if (error)
|
|
65
65
|
throw new Error('The email entered is not a valid email address!');
|
|
66
66
|
return true;
|
|
@@ -87,7 +87,7 @@ export default async function init() {
|
|
|
87
87
|
await db('directus_users').insert({
|
|
88
88
|
...defaultAdminUser,
|
|
89
89
|
id: randomUUID(),
|
|
90
|
-
email: firstUser.email,
|
|
90
|
+
email: firstUser.email.trim(),
|
|
91
91
|
password: firstUser.password,
|
|
92
92
|
role,
|
|
93
93
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { parseJSON } from '@directus/utils';
|
|
2
|
+
import { DiffKind } from '@directus/types';
|
|
2
3
|
import chalk from 'chalk';
|
|
3
4
|
import { promises as fs } from 'fs';
|
|
4
5
|
import inquirer from 'inquirer';
|
|
@@ -6,7 +7,6 @@ import { load as loadYaml } from 'js-yaml';
|
|
|
6
7
|
import path from 'path';
|
|
7
8
|
import getDatabase, { isInstalled, validateDatabaseConnection } from '../../../database/index.js';
|
|
8
9
|
import { useLogger } from '../../../logger/index.js';
|
|
9
|
-
import { DiffKind } from '../../../types/index.js';
|
|
10
10
|
import { isNestedMetaUpdate } from '../../../utils/apply-diff.js';
|
|
11
11
|
import { applySnapshot } from '../../../utils/apply-snapshot.js';
|
|
12
12
|
import { getSnapshotDiff } from '../../../utils/get-snapshot-diff.js';
|
package/dist/cli/index.js
CHANGED
|
@@ -17,6 +17,7 @@ import usersPasswd from './commands/users/passwd.js';
|
|
|
17
17
|
import { loadExtensions } from './load-extensions.js';
|
|
18
18
|
export async function createCli() {
|
|
19
19
|
const program = new Command();
|
|
20
|
+
program.allowExcessArguments();
|
|
20
21
|
await loadExtensions();
|
|
21
22
|
await emitter.emitInit('cli.before', { program });
|
|
22
23
|
program.name('directus').usage('[command] [options]');
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { Driver } from '
|
|
1
|
+
import type { Driver } from '@directus/types';
|
|
2
2
|
import type { Credentials } from '../create-db-connection.js';
|
|
3
3
|
export default function createEnv(client: Driver, credentials: Credentials, directory: string): Promise<void>;
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { CookieOptions } from 'express';
|
|
2
|
-
import type { TransformationParams } from '
|
|
2
|
+
import type { TransformationParams } from '@directus/types';
|
|
3
3
|
export declare const SYSTEM_ASSET_ALLOW_LIST: TransformationParams[];
|
|
4
4
|
export declare const ASSET_TRANSFORM_QUERY_KEYS: readonly ["key", "transforms", "width", "height", "format", "fit", "quality", "withoutEnlargement", "focal_point_x", "focal_point_y"];
|
|
5
5
|
export declare const FILTER_VARIABLES: string[];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEnv } from '@directus/env';
|
|
2
2
|
import { InvalidQueryError, RangeNotSatisfiableError } from '@directus/errors';
|
|
3
|
+
import { TransformationMethods } from '@directus/types';
|
|
3
4
|
import { parseJSON } from '@directus/utils';
|
|
4
5
|
import contentDisposition from 'content-disposition';
|
|
5
6
|
import { Router } from 'express';
|
|
@@ -10,7 +11,6 @@ import { useLogger } from '../logger/index.js';
|
|
|
10
11
|
import useCollection from '../middleware/use-collection.js';
|
|
11
12
|
import { AssetsService } from '../services/assets.js';
|
|
12
13
|
import { PayloadService } from '../services/payload.js';
|
|
13
|
-
import { TransformationMethods } from '../types/assets.js';
|
|
14
14
|
import asyncHandler from '../utils/async-handler.js';
|
|
15
15
|
import { getCacheControlHeader } from '../utils/get-cache-headers.js';
|
|
16
16
|
import { getConfigFromEnv } from '../utils/get-config-from-env.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useEnv } from '@directus/env';
|
|
2
2
|
import { ErrorCode, ForbiddenError, isDirectusError, RouteNotFoundError } from '@directus/errors';
|
|
3
|
-
import { EXTENSION_TYPES } from '@directus/
|
|
3
|
+
import { EXTENSION_TYPES } from '@directus/constants';
|
|
4
4
|
import { account, describe, list, } from '@directus/extensions-registry';
|
|
5
5
|
import { isIn } from '@directus/utils';
|
|
6
6
|
import express from 'express';
|
|
@@ -9,11 +9,11 @@ import * as schemaHelpers from './schema/index.js';
|
|
|
9
9
|
import * as sequenceHelpers from './sequence/index.js';
|
|
10
10
|
export declare function getHelpers(database: Knex): {
|
|
11
11
|
date: dateHelpers.postgres | dateHelpers.oracle | dateHelpers.mysql | dateHelpers.mssql | dateHelpers.sqlite;
|
|
12
|
-
st: geometryHelpers.
|
|
13
|
-
schema: schemaHelpers.
|
|
12
|
+
st: geometryHelpers.mysql | geometryHelpers.postgres | geometryHelpers.sqlite | geometryHelpers.oracle | geometryHelpers.mssql | geometryHelpers.redshift;
|
|
13
|
+
schema: schemaHelpers.mysql | schemaHelpers.postgres | schemaHelpers.cockroachdb | schemaHelpers.sqlite | schemaHelpers.oracle | schemaHelpers.mssql | schemaHelpers.redshift;
|
|
14
14
|
sequence: sequenceHelpers.mysql | sequenceHelpers.postgres;
|
|
15
|
-
number: numberHelpers.cockroachdb | numberHelpers.
|
|
15
|
+
number: numberHelpers.cockroachdb | numberHelpers.postgres | numberHelpers.sqlite | numberHelpers.oracle | numberHelpers.mssql;
|
|
16
16
|
capabilities: capabilitiesHelpers.postgres | capabilitiesHelpers.oracle | capabilitiesHelpers.mysql;
|
|
17
17
|
};
|
|
18
|
-
export declare function getFunctions(database: Knex, schema: SchemaOverview): fnHelpers.
|
|
18
|
+
export declare function getFunctions(database: Knex, schema: SchemaOverview): fnHelpers.mysql | fnHelpers.postgres | fnHelpers.sqlite | fnHelpers.oracle | fnHelpers.mssql;
|
|
19
19
|
export type Helpers = ReturnType<typeof getHelpers>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type { KNEX_TYPES } from '@directus/constants';
|
|
2
2
|
import type { Column } from '@directus/schema';
|
|
3
|
-
import type { Field, RawField, Relation, Type } from '@directus/types';
|
|
3
|
+
import type { DatabaseClient, Field, RawField, Relation, Type } from '@directus/types';
|
|
4
4
|
import type { Knex } from 'knex';
|
|
5
|
-
import type { DatabaseClient } from '../../../types/index.js';
|
|
6
5
|
import { DatabaseHelper } from '../types.js';
|
|
7
6
|
export type Options = {
|
|
8
7
|
nullable?: boolean;
|
package/dist/database/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SchemaInspector } from '@directus/schema';
|
|
2
|
+
import type { DatabaseClient } from '@directus/types';
|
|
2
3
|
import type { Knex } from 'knex';
|
|
3
|
-
import type { DatabaseClient } from '../types/index.js';
|
|
4
4
|
export default getDatabase;
|
|
5
5
|
export declare function getDatabase(): Knex;
|
|
6
6
|
export declare function getSchemaInspector(database?: Knex): SchemaInspector;
|
|
@@ -10,7 +10,7 @@ export async function up(knex) {
|
|
|
10
10
|
.from('directus_fields')
|
|
11
11
|
.whereIn('interface', ['one-to-many', 'm2a-builder', 'many-to-many']);
|
|
12
12
|
for (const field of fieldsWithSort) {
|
|
13
|
-
const options = typeof field.options === 'string' ? parseJSON(field.options) : field.options ?? {};
|
|
13
|
+
const options = typeof field.options === 'string' ? parseJSON(field.options) : (field.options ?? {});
|
|
14
14
|
if ('sortField' in options) {
|
|
15
15
|
await knex('directus_relations')
|
|
16
16
|
.update({
|
|
@@ -16,7 +16,7 @@ export async function up(knex) {
|
|
|
16
16
|
.from('directus_revisions')
|
|
17
17
|
.where('version', '=', missingDeltaVersion.id)
|
|
18
18
|
.orderBy('id');
|
|
19
|
-
const deltas = revisions.map((revision) => typeof revision.delta === 'string' ? parseJSON(revision.delta) : revision.delta ?? {});
|
|
19
|
+
const deltas = revisions.map((revision) => typeof revision.delta === 'string' ? parseJSON(revision.delta) : (revision.delta ?? {}));
|
|
20
20
|
const consolidatedDelta = assign({}, ...deltas);
|
|
21
21
|
await trx('directus_versions')
|
|
22
22
|
.update({
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { FieldOverview } from '@directus/types';
|
|
2
2
|
export declare function getFilterType(fields: Record<string, FieldOverview>, key: string, collection?: string): {
|
|
3
|
-
type: "string" | "boolean" | "json" | "
|
|
3
|
+
type: "string" | "boolean" | "json" | "text" | "integer" | "float" | "alias" | "uuid" | "binary" | "time" | "dateTime" | "timestamp" | "bigInteger" | "date" | "decimal" | "hash" | "csv" | "geometry" | "geometry.Point" | "geometry.LineString" | "geometry.Polygon" | "geometry.MultiPoint" | "geometry.MultiLineString" | "geometry.MultiPolygon" | "unknown";
|
|
4
4
|
special?: never;
|
|
5
5
|
} | {
|
|
6
|
-
type: "string" | "boolean" | "json" | "
|
|
6
|
+
type: "string" | "boolean" | "json" | "text" | "integer" | "float" | "alias" | "uuid" | "binary" | "time" | "dateTime" | "timestamp" | "bigInteger" | "date" | "decimal" | "hash" | "csv" | "geometry" | "geometry.Point" | "geometry.LineString" | "geometry.Polygon" | "geometry.MultiPoint" | "geometry.MultiLineString" | "geometry.MultiPolygon" | "unknown";
|
|
7
7
|
special: string[];
|
|
8
8
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Extension, ExtensionSettings } from '@directus/
|
|
1
|
+
import type { Extension, ExtensionSettings } from '@directus/types';
|
|
2
2
|
/**
|
|
3
3
|
* Loads stored settings for all extensions. Creates empty new rows in extensions tables for
|
|
4
4
|
* extensions that don't have settings yet, and remove any settings for extensions that are no
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ApiExtensionType, HybridExtensionType } from '@directus/
|
|
1
|
+
import type { ApiExtensionType, HybridExtensionType } from '@directus/types';
|
|
2
2
|
import type { Router } from 'express';
|
|
3
3
|
/**
|
|
4
4
|
* Generate the JS to run in the isolate to create the extension's entrypoint to the host
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Extension } from '@directus/
|
|
1
|
+
import type { Extension, ExtensionManagerOptions } from '@directus/types';
|
|
2
2
|
import { Router } from 'express';
|
|
3
|
-
import type { ExtensionManagerOptions } from './types.js';
|
|
4
3
|
import type { ReadStream } from 'node:fs';
|
|
5
4
|
export declare class ExtensionManager {
|
|
6
5
|
private options;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { useEnv } from '@directus/env';
|
|
2
|
-
import { APP_SHARED_DEPS
|
|
2
|
+
import { APP_SHARED_DEPS } from '@directus/extensions';
|
|
3
|
+
import { HYBRID_EXTENSION_TYPES } from '@directus/constants';
|
|
3
4
|
import { generateExtensionsEntrypoint } from '@directus/extensions/node';
|
|
4
5
|
import { isTypeIn, toBoolean } from '@directus/utils';
|
|
5
6
|
import { pathToRelativeUrl, processId } from '@directus/utils/node';
|
|
@@ -382,7 +383,7 @@ export class ExtensionManager {
|
|
|
382
383
|
const entrypoint = generateExtensionsEntrypoint({ module: this.moduleExtensions, registry: this.registryExtensions, local: this.localExtensions }, this.extensionsSettings);
|
|
383
384
|
try {
|
|
384
385
|
/** Opt In for now. Should be @deprecated later to always use rolldown! */
|
|
385
|
-
const rollDirection = env['EXTENSIONS_ROLLDOWN'] ?? false ? rolldown : rollup;
|
|
386
|
+
const rollDirection = (env['EXTENSIONS_ROLLDOWN'] ?? false) ? rolldown : rollup;
|
|
386
387
|
const bundle = await rollDirection({
|
|
387
388
|
input: 'entry',
|
|
388
389
|
external: Object.values(sharedDepsMapping),
|
package/dist/flows.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { OperationHandler } from '@directus/
|
|
2
|
-
import type { Accountability, SchemaOverview } from '@directus/types';
|
|
1
|
+
import type { Accountability, SchemaOverview, OperationHandler } from '@directus/types';
|
|
3
2
|
export declare function getFlowManager(): FlowManager;
|
|
4
3
|
declare class FlowManager {
|
|
5
4
|
private isLoaded;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createError, InternalServerError } from '@directus/errors';
|
|
2
|
+
import { defineOperationApi } from '@directus/extensions';
|
|
3
|
+
const FALLBACK_ERROR = new InternalServerError();
|
|
4
|
+
export default defineOperationApi({
|
|
5
|
+
id: 'throw-error',
|
|
6
|
+
handler: ({ code, status, message }) => {
|
|
7
|
+
const statusCode = parseInt(status);
|
|
8
|
+
const error = createError(code ?? FALLBACK_ERROR.code, message ?? FALLBACK_ERROR.message, isNaN(statusCode) ? FALLBACK_ERROR.status : statusCode);
|
|
9
|
+
throw new error();
|
|
10
|
+
},
|
|
11
|
+
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Item, PrimaryKey } from '@directus/types';
|
|
2
|
-
import type { AbstractServiceOptions, MutationOptions } from '../types/index.js';
|
|
1
|
+
import type { AbstractServiceOptions, Item, MutationOptions, PrimaryKey } from '@directus/types';
|
|
3
2
|
import { ItemsService } from './items.js';
|
|
4
3
|
export declare class AccessService extends ItemsService {
|
|
5
4
|
constructor(options: AbstractServiceOptions);
|
package/dist/services/access.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { UserIntegrityCheckFlag } from '@directus/types';
|
|
1
2
|
import { clearSystemCache } from '../cache.js';
|
|
2
|
-
import { UserIntegrityCheckFlag } from '../utils/validate-user-count-integrity.js';
|
|
3
3
|
import { ItemsService } from './items.js';
|
|
4
4
|
export class AccessService extends ItemsService {
|
|
5
5
|
constructor(options) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AbstractServiceOptions } from '
|
|
1
|
+
import type { AbstractServiceOptions } from '@directus/types';
|
|
2
2
|
import { ItemsService } from './items.js';
|
|
3
3
|
export declare class ActivityService extends ItemsService {
|
|
4
4
|
constructor(options: AbstractServiceOptions);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { Range, Stat } from '@directus/
|
|
2
|
-
import type { Accountability, SchemaOverview } from '@directus/types';
|
|
1
|
+
import type { AbstractServiceOptions, Accountability, Range, Stat, SchemaOverview, TransformationSet } from '@directus/types';
|
|
3
2
|
import type { Knex } from 'knex';
|
|
4
3
|
import type { Readable } from 'node:stream';
|
|
5
|
-
import type { AbstractServiceOptions, TransformationSet } from '../types/index.js';
|
|
6
4
|
import { FilesService } from './files.js';
|
|
7
5
|
export declare class AssetsService {
|
|
8
6
|
knex: Knex;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type { Accountability, SchemaOverview } from '@directus/types';
|
|
1
|
+
import type { AbstractServiceOptions, Accountability, LoginResult, SchemaOverview } from '@directus/types';
|
|
2
2
|
import type { Knex } from 'knex';
|
|
3
|
-
import type { AbstractServiceOptions, LoginResult } from '../types/index.js';
|
|
4
3
|
import { ActivityService } from './activity.js';
|
|
5
4
|
export declare class AuthenticationService {
|
|
6
5
|
knex: Knex;
|
|
@@ -1,16 +1,9 @@
|
|
|
1
|
-
import type { SchemaInspector
|
|
2
|
-
import {
|
|
3
|
-
import type { Accountability, RawField, SchemaOverview } from '@directus/types';
|
|
1
|
+
import type { SchemaInspector } from '@directus/schema';
|
|
2
|
+
import type { AbstractServiceOptions, Accountability, MutationOptions, SchemaOverview, RawCollection } from '@directus/types';
|
|
4
3
|
import type Keyv from 'keyv';
|
|
5
4
|
import type { Knex } from 'knex';
|
|
6
5
|
import type { Helpers } from '../database/helpers/index.js';
|
|
7
|
-
import type {
|
|
8
|
-
export type RawCollection = {
|
|
9
|
-
collection: string;
|
|
10
|
-
fields?: RawField[];
|
|
11
|
-
schema?: Partial<Table> | null;
|
|
12
|
-
meta?: Partial<BaseCollectionMeta> | null;
|
|
13
|
-
};
|
|
6
|
+
import type { Collection } from '../types/index.js';
|
|
14
7
|
export declare class CollectionsService {
|
|
15
8
|
knex: Knex;
|
|
16
9
|
helpers: Helpers;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { Comment, PrimaryKey } from '@directus/types';
|
|
2
|
-
import type { AbstractServiceOptions, MutationOptions } from '../types/index.js';
|
|
1
|
+
import type { AbstractServiceOptions, Comment, MutationOptions, PrimaryKey } from '@directus/types';
|
|
3
2
|
import { ItemsService } from './items.js';
|
|
4
3
|
import { NotificationsService } from './notifications.js';
|
|
5
4
|
import { UsersService } from './users.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AbstractServiceOptions } from '
|
|
1
|
+
import type { AbstractServiceOptions } from '@directus/types';
|
|
2
2
|
import { ItemsService } from './items.js';
|
|
3
3
|
export declare class DashboardsService extends ItemsService {
|
|
4
4
|
constructor(options: AbstractServiceOptions);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { ApiOutput, ExtensionSettings } from '@directus/
|
|
2
|
-
import type { Accountability, DeepPartial, SchemaOverview } from '@directus/types';
|
|
1
|
+
import type { ApiOutput, ExtensionSettings, ExtensionManager } from '@directus/types';
|
|
2
|
+
import type { AbstractServiceOptions, Accountability, DeepPartial, SchemaOverview } from '@directus/types';
|
|
3
3
|
import type { Knex } from 'knex';
|
|
4
|
-
import type { ExtensionManager } from '../extensions/manager.js';
|
|
5
|
-
import type { AbstractServiceOptions } from '../types/index.js';
|
|
6
4
|
import { ItemsService } from './items.js';
|
|
7
5
|
export declare class ExtensionReadError extends Error {
|
|
8
6
|
originalError: unknown;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { Column, SchemaInspector } from '@directus/schema';
|
|
2
|
-
import type { Accountability, Field, RawField, SchemaOverview, Type } from '@directus/types';
|
|
2
|
+
import type { AbstractServiceOptions, Accountability, Field, MutationOptions, RawField, SchemaOverview, Type } from '@directus/types';
|
|
3
3
|
import type Keyv from 'keyv';
|
|
4
4
|
import type { Knex } from 'knex';
|
|
5
5
|
import type { Helpers } from '../database/helpers/index.js';
|
|
6
|
-
import type { AbstractServiceOptions, MutationOptions } from '../types/index.js';
|
|
7
6
|
import { ItemsService } from './items.js';
|
|
8
7
|
import { PayloadService } from './payload.js';
|
|
9
8
|
export declare class FieldsService {
|
package/dist/services/files.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import type { BusboyFileStream, File, PrimaryKey, Query } from '@directus/types';
|
|
1
|
+
import type { AbstractServiceOptions, BusboyFileStream, File, MutationOptions, PrimaryKey, Query, QueryOptions } from '@directus/types';
|
|
2
2
|
import type { Readable } from 'node:stream';
|
|
3
|
-
import
|
|
4
|
-
import { ItemsService, type QueryOptions } from './items.js';
|
|
3
|
+
import { ItemsService } from './items.js';
|
|
5
4
|
export declare class FilesService extends ItemsService<File> {
|
|
6
5
|
constructor(options: AbstractServiceOptions);
|
|
7
6
|
/**
|
package/dist/services/flows.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import type { FlowRaw, Item, PrimaryKey } from '@directus/types';
|
|
2
|
-
import type { AbstractServiceOptions, MutationOptions } from '../types/index.js';
|
|
1
|
+
import type { AbstractServiceOptions, FlowRaw, Item, MutationOptions, PrimaryKey } from '@directus/types';
|
|
3
2
|
import { ItemsService } from './items.js';
|
|
4
3
|
export declare class FlowsService extends ItemsService<FlowRaw> {
|
|
5
4
|
constructor(options: AbstractServiceOptions);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AbstractServiceOptions } from '
|
|
1
|
+
import type { AbstractServiceOptions } from '@directus/types';
|
|
2
2
|
import { ItemsService } from './items.js';
|
|
3
3
|
export declare class FoldersService extends ItemsService {
|
|
4
4
|
constructor(options: AbstractServiceOptions);
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import type { Accountability, Item, Query, SchemaOverview } from '@directus/types';
|
|
1
|
+
import type { AbstractServiceOptions, Accountability, GraphQLParams, GQLScope, Item, Query, SchemaOverview } from '@directus/types';
|
|
2
2
|
import type { FormattedExecutionResult, GraphQLSchema } from 'graphql';
|
|
3
3
|
import type { Knex } from 'knex';
|
|
4
|
-
import type { AbstractServiceOptions, GraphQLParams } from '../../types/index.js';
|
|
5
|
-
export type GQLScope = 'items' | 'system';
|
|
6
4
|
export declare class GraphQLService {
|
|
7
5
|
accountability: Accountability | null;
|
|
8
6
|
knex: Knex;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { GraphQLParams } from '@directus/types';
|
|
1
2
|
import { SchemaComposer } from 'graphql-compose';
|
|
2
|
-
import type { GraphQLParams } from '../../../types/index.js';
|
|
3
3
|
import { GraphQLService } from '../index.js';
|
|
4
4
|
import type { Schema } from '../schema/index.js';
|
|
5
5
|
export declare function resolveSystemAdmin(gql: GraphQLService, schema: Schema, schemaComposer: SchemaComposer<GraphQLParams['contextValue']>): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { GraphQLParams } from '@directus/types';
|
|
1
2
|
import { SchemaComposer } from 'graphql-compose';
|
|
2
|
-
import type { GraphQLParams } from '../../../types/index.js';
|
|
3
3
|
import { GraphQLService } from '../index.js';
|
|
4
4
|
import { type CollectionTypes, type Schema } from '../schema/index.js';
|
|
5
5
|
export declare function injectSystemResolvers(gql: GraphQLService, schemaComposer: SchemaComposer<GraphQLParams['contextValue']>, { CreateCollectionTypes, ReadCollectionTypes, UpdateCollectionTypes }: CollectionTypes, schema: Schema): SchemaComposer<any>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SchemaComposer } from 'graphql-compose';
|
|
2
2
|
import { ObjectTypeComposer } from 'graphql-compose';
|
|
3
|
-
import {
|
|
3
|
+
import type { GQLScope } from '@directus/types';
|
|
4
4
|
import { type InconsistentFields, type Schema } from './index.js';
|
|
5
5
|
/**
|
|
6
6
|
* Construct an object of types for every collection, using the permitted fields per action type
|
|
@@ -3,7 +3,6 @@ import { GraphQLJSON, ObjectTypeComposer } from 'graphql-compose';
|
|
|
3
3
|
import { mapKeys, pick } from 'lodash-es';
|
|
4
4
|
import { GENERATE_SPECIAL } from '../../../constants.js';
|
|
5
5
|
import { getGraphQLType } from '../../../utils/get-graphql-type.js';
|
|
6
|
-
import {} from '../index.js';
|
|
7
6
|
import { SYSTEM_DENY_LIST } from './index.js';
|
|
8
7
|
/**
|
|
9
8
|
* Construct an object of types for every collection, using the permitted fields per action type
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { Accountability, File, Query, SchemaOverview } from '@directus/types';
|
|
1
|
+
import type { AbstractServiceOptions, Accountability, ExportFormat, File, Query, SchemaOverview } from '@directus/types';
|
|
2
2
|
import type { Knex } from 'knex';
|
|
3
3
|
import type { Readable } from 'node:stream';
|
|
4
|
-
import type {
|
|
5
|
-
type ExportFormat = 'csv' | 'json' | 'xml' | 'yaml';
|
|
4
|
+
import type { FunctionFieldNode, FieldNode, NestedCollectionNode } from '../types/index.js';
|
|
6
5
|
export declare class ImportService {
|
|
7
6
|
knex: Knex;
|
|
8
7
|
accountability: Accountability | null;
|
|
@@ -35,4 +34,3 @@ export declare class ExportService {
|
|
|
35
34
|
}): string;
|
|
36
35
|
}
|
|
37
36
|
export declare function getHeadingsForCsvExport(nodes: (NestedCollectionNode | FieldNode | FunctionFieldNode)[] | undefined, prefix?: string): string[];
|
|
38
|
-
export {};
|
package/dist/services/items.d.ts
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import type { Accountability, Item as AnyItem,
|
|
1
|
+
import type { AbstractService, AbstractServiceOptions, Accountability, Item as AnyItem, MutationTracker, MutationOptions, PrimaryKey, Query, QueryOptions, SchemaOverview } from '@directus/types';
|
|
2
2
|
import type Keyv from 'keyv';
|
|
3
3
|
import type { Knex } from 'knex';
|
|
4
|
-
|
|
5
|
-
export type QueryOptions = {
|
|
6
|
-
stripNonRequested?: boolean;
|
|
7
|
-
permissionsAction?: PermissionsAction;
|
|
8
|
-
emitEvents?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export type MutationTracker = {
|
|
11
|
-
trackMutations: (count: number) => void;
|
|
12
|
-
getCount: () => number;
|
|
13
|
-
};
|
|
14
|
-
export declare class ItemsService<Item extends AnyItem = AnyItem, Collection extends string = string> implements AbstractService {
|
|
4
|
+
export declare class ItemsService<Item extends AnyItem = AnyItem, Collection extends string = string> implements AbstractService<Item> {
|
|
15
5
|
collection: Collection;
|
|
16
6
|
knex: Knex;
|
|
17
7
|
accountability: Accountability | null;
|
package/dist/services/items.js
CHANGED
|
@@ -2,6 +2,7 @@ import { Action } from '@directus/constants';
|
|
|
2
2
|
import { useEnv } from '@directus/env';
|
|
3
3
|
import { ErrorCode, ForbiddenError, InvalidPayloadError, isDirectusError } from '@directus/errors';
|
|
4
4
|
import { isSystemCollection } from '@directus/system-data';
|
|
5
|
+
import { UserIntegrityCheckFlag } from '@directus/types';
|
|
5
6
|
import { assign, clone, cloneDeep, omit, pick, without } from 'lodash-es';
|
|
6
7
|
import { getCache } from '../cache.js';
|
|
7
8
|
import { translateDatabaseError } from '../database/errors/translate.js';
|
|
@@ -16,7 +17,7 @@ import { validateAccess } from '../permissions/modules/validate-access/validate-
|
|
|
16
17
|
import { shouldClearCache } from '../utils/should-clear-cache.js';
|
|
17
18
|
import { transaction } from '../utils/transaction.js';
|
|
18
19
|
import { validateKeys } from '../utils/validate-keys.js';
|
|
19
|
-
import {
|
|
20
|
+
import { validateUserCountIntegrity } from '../utils/validate-user-count-integrity.js';
|
|
20
21
|
import { PayloadService } from './payload.js';
|
|
21
22
|
const env = useEnv();
|
|
22
23
|
export class ItemsService {
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import type { Accountability, SchemaOverview } from '@directus/types';
|
|
1
|
+
import type { AbstractServiceOptions, Accountability, SchemaOverview } from '@directus/types';
|
|
2
2
|
import type { Knex } from 'knex';
|
|
3
3
|
import type { SendMailOptions, Transporter } from 'nodemailer';
|
|
4
|
-
|
|
5
|
-
export type EmailOptions = Omit<SendMailOptions, 'from'> & {
|
|
6
|
-
from?: string;
|
|
4
|
+
export type EmailOptions = SendMailOptions & {
|
|
7
5
|
template?: {
|
|
8
6
|
name: string;
|
|
9
7
|
data: Record<string, any>;
|