mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Fix extensions (#6377)
* Add support for npm extensions * Allow extensions to import vue from the main app * Bundle app extensions on server startup * Fix return type of useLayoutState * Add shared package * Add extension-sdk package * Add type declaration files to allow deep import of shared package * Add extension loading to shared * Refactor extension loading to use shared package * Remove app bundle newline replacement * Fix extension loading in development * Rename extension entrypoints * Update extension build instructions * Remove vite auto-replacement workaround * Update package-lock.json * Remove newline from generated extension entrypoint * Update package-lock.json * Build shared package as cjs and esm * Move useLayoutState composable to shared * Reverse vite base env check * Share useLayoutState composable through extension-sdk * Update layout docs * Update package versions * Small cleanup * Fix layout docs * Fix imports * Add nickrum to codeowners * Fix typo * Add 'em to vite config too * Fix email Co-authored-by: rijkvanzanten <rijkvanzanten@me.com>
This commit is contained in:
committed by
GitHub
parent
1644c6397c
commit
051df415df
5
.github/CODEOWNERS
vendored
5
.github/CODEOWNERS
vendored
@@ -1,6 +1,11 @@
|
||||
* @rijkvanzanten
|
||||
|
||||
/docs/*.md @benhaynes
|
||||
|
||||
/packages/cli @WoLfulus
|
||||
/packages/sdk @WoLfulus
|
||||
/packages/gatsby-source-directus @WoLfulus
|
||||
|
||||
/packages/shared @nickrum
|
||||
/packages/extension-sdk @nickrum
|
||||
/app/vite.config.js @nickrum
|
||||
|
||||
@@ -76,8 +76,11 @@
|
||||
"@directus/drive-s3": "9.0.0-rc.80",
|
||||
"@directus/format-title": "9.0.0-rc.80",
|
||||
"@directus/schema": "9.0.0-rc.80",
|
||||
"@directus/shared": "9.0.0-rc.80",
|
||||
"@directus/specs": "9.0.0-rc.80",
|
||||
"@godaddy/terminus": "^4.9.0",
|
||||
"@rollup/plugin-alias": "^3.1.2",
|
||||
"@rollup/plugin-virtual": "^2.0.3",
|
||||
"argon2": "^0.28.1",
|
||||
"async": "^3.2.0",
|
||||
"async-mutex": "^0.3.1",
|
||||
@@ -132,6 +135,7 @@
|
||||
"qs": "^6.9.4",
|
||||
"rate-limiter-flexible": "^2.2.2",
|
||||
"resolve-cwd": "^3.0.0",
|
||||
"rollup": "^2.52.1",
|
||||
"sharp": "^0.28.3",
|
||||
"stream-json": "^1.7.1",
|
||||
"uuid": "^8.3.2",
|
||||
|
||||
@@ -56,7 +56,7 @@ export default async function createApp(): Promise<express.Application> {
|
||||
|
||||
await initializeExtensions();
|
||||
|
||||
await registerExtensionHooks();
|
||||
registerExtensionHooks();
|
||||
|
||||
const app = express();
|
||||
|
||||
@@ -170,7 +170,7 @@ export default async function createApp(): Promise<express.Application> {
|
||||
|
||||
// Register custom hooks / endpoints
|
||||
await emitAsyncSafe('routes.custom.init.before', { app });
|
||||
await registerExtensionEndpoints(customRouter);
|
||||
registerExtensionEndpoints(customRouter);
|
||||
await emitAsyncSafe('routes.custom.init.after', { app });
|
||||
|
||||
app.use(notFoundHandler);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Transformation } from './types/assets';
|
||||
import { Transformation } from './types';
|
||||
|
||||
export const SYSTEM_ASSET_ALLOW_LIST: Transformation[] = [
|
||||
{
|
||||
|
||||
@@ -1,28 +1,24 @@
|
||||
import express, { Router } from 'express';
|
||||
import env from '../env';
|
||||
import { RouteNotFoundException } from '../exceptions';
|
||||
import { listExtensions } from '../extensions';
|
||||
import { respond } from '../middleware/respond';
|
||||
import { Router } from 'express';
|
||||
import asyncHandler from '../utils/async-handler';
|
||||
import { RouteNotFoundException } from '../exceptions';
|
||||
import { listExtensions, getAppExtensionSource } from '../extensions';
|
||||
import { respond } from '../middleware/respond';
|
||||
import { depluralize } from '@directus/shared/utils';
|
||||
import { AppExtensionType, Plural } from '@directus/shared/types';
|
||||
import { APP_EXTENSION_TYPES } from '@directus/shared/constants';
|
||||
|
||||
const router = Router();
|
||||
|
||||
const extensionsPath = env.EXTENSIONS_PATH as string;
|
||||
|
||||
const appExtensions = ['interfaces', 'layouts', 'displays', 'modules'];
|
||||
|
||||
router.get(
|
||||
['/:type', '/:type/*'],
|
||||
'/:type',
|
||||
asyncHandler(async (req, res, next) => {
|
||||
if (appExtensions.includes(req.params.type) === false) {
|
||||
const type = depluralize(req.params.type as Plural<AppExtensionType>);
|
||||
|
||||
if (APP_EXTENSION_TYPES.includes(type) === false) {
|
||||
throw new RouteNotFoundException(req.path);
|
||||
}
|
||||
|
||||
return next();
|
||||
}),
|
||||
express.static(extensionsPath),
|
||||
asyncHandler(async (req, res, next) => {
|
||||
const extensions = await listExtensions(req.params.type);
|
||||
const extensions = listExtensions(type);
|
||||
|
||||
res.locals.payload = {
|
||||
data: extensions,
|
||||
@@ -33,4 +29,23 @@ router.get(
|
||||
respond
|
||||
);
|
||||
|
||||
router.get(
|
||||
'/:type/index.js',
|
||||
asyncHandler(async (req, res) => {
|
||||
const type = depluralize(req.params.type as Plural<AppExtensionType>);
|
||||
|
||||
if (APP_EXTENSION_TYPES.includes(type) === false) {
|
||||
throw new RouteNotFoundException(req.path);
|
||||
}
|
||||
|
||||
const extensionSource = getAppExtensionSource(type);
|
||||
if (extensionSource === undefined) {
|
||||
throw new RouteNotFoundException(req.path);
|
||||
}
|
||||
|
||||
res.setHeader('Content-Type', 'application/javascript; charset=UTF-8');
|
||||
res.end(extensionSource);
|
||||
})
|
||||
);
|
||||
|
||||
export default router;
|
||||
|
||||
@@ -1,90 +1,138 @@
|
||||
import express, { Router } from 'express';
|
||||
import { ensureDir } from 'fs-extra';
|
||||
import path from 'path';
|
||||
import { AppExtensionType, Extension, ExtensionType } from '@directus/shared/types';
|
||||
import {
|
||||
generateExtensionsEntry,
|
||||
getLocalExtensions,
|
||||
getPackageExtensions,
|
||||
pluralize,
|
||||
resolvePackage,
|
||||
} from '@directus/shared/utils';
|
||||
import { APP_EXTENSION_TYPES, EXTENSION_TYPES, SHARED_DEPS } from '@directus/shared/constants';
|
||||
import getDatabase from './database';
|
||||
import emitter from './emitter';
|
||||
import env from './env';
|
||||
import * as exceptions from './exceptions';
|
||||
import { ServiceUnavailableException } from './exceptions';
|
||||
import logger from './logger';
|
||||
import * as services from './services';
|
||||
import { EndpointRegisterFunction, HookRegisterFunction } from './types';
|
||||
import { HookRegisterFunction, EndpointRegisterFunction } from './types';
|
||||
import fse from 'fs-extra';
|
||||
import { getSchema } from './utils/get-schema';
|
||||
import listFolders from './utils/list-folders';
|
||||
|
||||
import * as services from './services';
|
||||
import { schedule, validate } from 'node-cron';
|
||||
import { rollup } from 'rollup';
|
||||
// @TODO Remove this once a new version of @rollup/plugin-virtual has been released
|
||||
// @ts-expect-error
|
||||
import virtual from '@rollup/plugin-virtual';
|
||||
import alias from '@rollup/plugin-alias';
|
||||
|
||||
export async function ensureFoldersExist(): Promise<void> {
|
||||
const folders = ['endpoints', 'hooks', 'interfaces', 'modules', 'layouts', 'displays'];
|
||||
let extensions: Extension[] = [];
|
||||
let extensionBundles: Partial<Record<AppExtensionType, string>> = {};
|
||||
|
||||
for (const folder of folders) {
|
||||
const folderPath = path.resolve(env.EXTENSIONS_PATH, folder);
|
||||
export async function initializeExtensions(): Promise<void> {
|
||||
await ensureDirsExist();
|
||||
extensions = await getExtensions();
|
||||
extensionBundles = await generateExtensionBundles();
|
||||
|
||||
logger.info(`Loaded extensions: ${listExtensions().join(', ')}`);
|
||||
}
|
||||
|
||||
export function listExtensions(type?: ExtensionType): string[] {
|
||||
if (type === undefined) {
|
||||
return extensions.map((extension) => extension.name);
|
||||
} else {
|
||||
return extensions.filter((extension) => extension.type === type).map((extension) => extension.name);
|
||||
}
|
||||
}
|
||||
|
||||
export function getAppExtensionSource(type: AppExtensionType): string | undefined {
|
||||
return extensionBundles[type];
|
||||
}
|
||||
|
||||
export function registerExtensionEndpoints(router: Router): void {
|
||||
const endpoints = extensions.filter((extension) => extension.type === 'endpoint');
|
||||
registerEndpoints(endpoints, router);
|
||||
}
|
||||
|
||||
export function registerExtensionHooks(): void {
|
||||
const hooks = extensions.filter((extension) => extension.type === 'hook');
|
||||
registerHooks(hooks);
|
||||
}
|
||||
|
||||
async function getExtensions(): Promise<Extension[]> {
|
||||
const packageExtensions = await getPackageExtensions('.');
|
||||
const localExtensions = await getLocalExtensions(env.EXTENSIONS_PATH);
|
||||
|
||||
return [...packageExtensions, ...localExtensions];
|
||||
}
|
||||
|
||||
async function generateExtensionBundles() {
|
||||
const sharedDepsMapping = await getSharedDepsMapping(SHARED_DEPS);
|
||||
const internalImports = Object.entries(sharedDepsMapping).map(([name, path]) => ({
|
||||
find: name,
|
||||
replacement: path,
|
||||
}));
|
||||
|
||||
const bundles: Partial<Record<AppExtensionType, string>> = {};
|
||||
|
||||
for (const extensionType of APP_EXTENSION_TYPES) {
|
||||
const entry = generateExtensionsEntry(extensionType, extensions);
|
||||
|
||||
const bundle = await rollup({
|
||||
input: 'entry',
|
||||
external: SHARED_DEPS,
|
||||
plugins: [virtual({ entry }), alias({ entries: internalImports })],
|
||||
});
|
||||
const { output } = await bundle.generate({ format: 'es' });
|
||||
|
||||
bundles[extensionType] = output[0].code;
|
||||
|
||||
await bundle.close();
|
||||
}
|
||||
|
||||
return bundles;
|
||||
}
|
||||
|
||||
async function ensureDirsExist() {
|
||||
for (const extensionType of EXTENSION_TYPES) {
|
||||
const dirPath = path.resolve(env.EXTENSIONS_PATH, pluralize(extensionType));
|
||||
try {
|
||||
await ensureDir(folderPath);
|
||||
await fse.ensureDir(dirPath);
|
||||
} catch (err) {
|
||||
logger.warn(err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export async function initializeExtensions(): Promise<void> {
|
||||
await ensureFoldersExist();
|
||||
}
|
||||
async function getSharedDepsMapping(deps: string[]) {
|
||||
const appDir = await fse.readdir(path.join(resolvePackage('@directus/app'), 'dist'));
|
||||
|
||||
export async function listExtensions(type: string): Promise<string[]> {
|
||||
const extensionsPath = env.EXTENSIONS_PATH as string;
|
||||
const location = path.join(extensionsPath, type);
|
||||
const depsMapping: Record<string, string> = {};
|
||||
for (const dep of deps) {
|
||||
const depName = appDir.find((file) => dep.replace(/\//g, '_') === file.substring(0, file.indexOf('.')));
|
||||
|
||||
try {
|
||||
return await listFolders(location);
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') {
|
||||
throw new ServiceUnavailableException(`Extension folder "extensions/${type}" couldn't be opened`, {
|
||||
service: 'extensions',
|
||||
});
|
||||
if (depName) {
|
||||
depsMapping[dep] = `${env.PUBLIC_URL}/admin/${depName}`;
|
||||
} else {
|
||||
logger.warn(`Couldn't find extension internal dependency "${dep}"`);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
|
||||
return depsMapping;
|
||||
}
|
||||
|
||||
export async function registerExtensions(router: Router): Promise<void> {
|
||||
await registerExtensionHooks();
|
||||
await registerExtensionEndpoints(router);
|
||||
}
|
||||
|
||||
export async function registerExtensionEndpoints(router: Router): Promise<void> {
|
||||
let endpoints: string[] = [];
|
||||
try {
|
||||
endpoints = await listExtensions('endpoints');
|
||||
registerEndpoints(endpoints, router);
|
||||
} catch (err) {
|
||||
logger.warn(err);
|
||||
}
|
||||
}
|
||||
|
||||
export async function registerExtensionHooks(): Promise<void> {
|
||||
let hooks: string[] = [];
|
||||
try {
|
||||
hooks = await listExtensions('hooks');
|
||||
registerHooks(hooks);
|
||||
} catch (err) {
|
||||
logger.warn(err);
|
||||
}
|
||||
}
|
||||
|
||||
function registerHooks(hooks: string[]) {
|
||||
const extensionsPath = env.EXTENSIONS_PATH as string;
|
||||
|
||||
function registerHooks(hooks: Extension[]) {
|
||||
for (const hook of hooks) {
|
||||
try {
|
||||
registerHook(hook);
|
||||
} catch (error) {
|
||||
logger.warn(`Couldn't register hook "${hook}"`);
|
||||
logger.warn(`Couldn't register hook "${hook.name}"`);
|
||||
logger.warn(error);
|
||||
}
|
||||
}
|
||||
|
||||
function registerHook(hook: string) {
|
||||
const hookPath = path.resolve(extensionsPath, 'hooks', hook, 'index.js');
|
||||
function registerHook(hook: Extension) {
|
||||
const hookPath = path.resolve(hook.path, hook.entrypoint || '');
|
||||
const hookInstance: HookRegisterFunction | { default?: HookRegisterFunction } = require(hookPath);
|
||||
|
||||
let register: HookRegisterFunction = hookInstance as HookRegisterFunction;
|
||||
@@ -112,20 +160,18 @@ function registerHooks(hooks: string[]) {
|
||||
}
|
||||
}
|
||||
|
||||
function registerEndpoints(endpoints: string[], router: Router) {
|
||||
const extensionsPath = env.EXTENSIONS_PATH as string;
|
||||
|
||||
function registerEndpoints(endpoints: Extension[], router: Router) {
|
||||
for (const endpoint of endpoints) {
|
||||
try {
|
||||
registerEndpoint(endpoint);
|
||||
} catch (error) {
|
||||
logger.warn(`Couldn't register endpoint "${endpoint}"`);
|
||||
logger.warn(`Couldn't register endpoint "${endpoint.name}"`);
|
||||
logger.warn(error);
|
||||
}
|
||||
}
|
||||
|
||||
function registerEndpoint(endpoint: string) {
|
||||
const endpointPath = path.resolve(extensionsPath, 'endpoints', endpoint, 'index.js');
|
||||
function registerEndpoint(endpoint: Extension) {
|
||||
const endpointPath = path.resolve(endpoint.path, endpoint.entrypoint || '');
|
||||
const endpointInstance: EndpointRegisterFunction | { default?: EndpointRegisterFunction } = require(endpointPath);
|
||||
|
||||
let register: EndpointRegisterFunction = endpointInstance as EndpointRegisterFunction;
|
||||
@@ -136,7 +182,7 @@ function registerEndpoints(endpoints: string[], router: Router) {
|
||||
}
|
||||
|
||||
const scopedRouter = express.Router();
|
||||
router.use(`/${endpoint}/`, scopedRouter);
|
||||
router.use(`/${endpoint.name}/`, scopedRouter);
|
||||
|
||||
register(scopedRouter, { services, exceptions, env, database: getDatabase(), getSchema });
|
||||
}
|
||||
|
||||
@@ -1277,10 +1277,10 @@ export class GraphQLService {
|
||||
},
|
||||
}),
|
||||
resolve: async () => ({
|
||||
interfaces: await listExtensions('interfaces'),
|
||||
displays: await listExtensions('displays'),
|
||||
layouts: await listExtensions('layouts'),
|
||||
modules: await listExtensions('modules'),
|
||||
interfaces: listExtensions('interface'),
|
||||
displays: listExtensions('display'),
|
||||
layouts: listExtensions('layout'),
|
||||
modules: listExtensions('module'),
|
||||
}),
|
||||
},
|
||||
server_specs_oas: {
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
import { promisify } from 'util';
|
||||
|
||||
const readdir = promisify(fs.readdir);
|
||||
const stat = promisify(fs.stat);
|
||||
|
||||
export default async function listFolders(location: string): Promise<string[]> {
|
||||
const fullPath = path.resolve(location);
|
||||
const files = await readdir(fullPath);
|
||||
|
||||
const directories: string[] = [];
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = path.join(fullPath, file);
|
||||
const stats = await stat(filePath);
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
directories.push(file);
|
||||
}
|
||||
}
|
||||
|
||||
return directories;
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
"version": "9.0.0-rc.80",
|
||||
"private": false,
|
||||
"description": "Directus is an Open-Source Headless CMS & API for Managing Custom Databases",
|
||||
"author": "Rijk van Zanten <rijk@rngr.org>",
|
||||
"author": "Rijk van Zanten <rijkvanzanten@me.com>",
|
||||
"main": "dist/index.html",
|
||||
"files": [
|
||||
"dist",
|
||||
@@ -18,7 +18,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"scripts": {
|
||||
"dev": "cross-env NODE_ENV=development vite",
|
||||
"dev": "vite",
|
||||
"build": "vite build",
|
||||
"serve": "vite preview",
|
||||
"copy-docs-images": "rimraf public/img/docs && copyfiles -u 3 \"../docs/assets/**/*\" \"public/img/docs\" --verbose",
|
||||
@@ -29,7 +29,9 @@
|
||||
"gitHead": "24621f3934dc77eb23441331040ed13c676ceffd",
|
||||
"devDependencies": {
|
||||
"@directus/docs": "9.0.0-rc.80",
|
||||
"@directus/extension-sdk": "9.0.0-rc.80",
|
||||
"@directus/format-title": "9.0.0-rc.80",
|
||||
"@directus/shared": "9.0.0-rc.80",
|
||||
"@fullcalendar/core": "5.8.0",
|
||||
"@fullcalendar/daygrid": "5.8.0",
|
||||
"@fullcalendar/interaction": "5.8.0",
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Field, FilterOperator } from '@/types';
|
||||
import { Field } from '@/types';
|
||||
import { FilterOperator } from '@directus/shared/types';
|
||||
|
||||
export type FormField = DeepPartial<Field> & {
|
||||
field: string;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import api from '@/api';
|
||||
import useCollection from '@/composables/use-collection';
|
||||
import { Filter, Item } from '@/types/';
|
||||
import { Filter, Item } from '@directus/shared/types';
|
||||
import filtersToQuery from '@/utils/filters-to-query';
|
||||
import moveInArray from '@/utils/move-in-array';
|
||||
import { isEqual, orderBy, throttle } from 'lodash';
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
import { getLayouts } from '@/layouts';
|
||||
import { LayoutProps } from '@/layouts/types';
|
||||
import { computed, reactive, provide, inject, Ref, UnwrapRef } from 'vue';
|
||||
|
||||
type LayoutState<T, Options, Query> = {
|
||||
props: LayoutProps<Options, Query>;
|
||||
} & T;
|
||||
|
||||
const layoutSymbol = Symbol();
|
||||
import { computed, reactive, provide, Ref, UnwrapRef } from 'vue';
|
||||
import { LayoutProps, LayoutState } from '@directus/shared/types';
|
||||
import { LAYOUT_SYMBOL } from '@directus/shared/constants';
|
||||
|
||||
export function useLayout<Options = any, Query = any>(
|
||||
layoutName: Ref<string>,
|
||||
@@ -25,17 +20,7 @@ export function useLayout<Options = any, Query = any>(
|
||||
return reactive<LayoutState<Record<string, any>, Options, Query>>({ ...setupResult, props });
|
||||
});
|
||||
|
||||
provide(layoutSymbol, layoutState);
|
||||
|
||||
return layoutState;
|
||||
}
|
||||
|
||||
export function useLayoutState<T extends Record<string, any> = Record<string, any>, Options = any, Query = any>(): Ref<
|
||||
UnwrapRef<LayoutState<Record<string, any>, Options, Query>>
|
||||
> {
|
||||
const layoutState = inject<Ref<UnwrapRef<LayoutState<T, Options, Query>>>>(layoutSymbol);
|
||||
|
||||
if (!layoutState) throw new Error('[useLayoutState]: This function has to be used inside a layout component.');
|
||||
provide(LAYOUT_SYMBOL, layoutState);
|
||||
|
||||
return layoutState;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCollection } from '@/composables/use-collection';
|
||||
import { usePresetsStore, useUserStore } from '@/stores';
|
||||
import { Filter, Preset } from '@/types/';
|
||||
import { Filter, Preset } from '@directus/shared/types';
|
||||
import { debounce, isEqual } from 'lodash';
|
||||
import { computed, ComputedRef, ref, Ref, watch } from 'vue';
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import api from '@/api';
|
||||
import { getRootPath } from '@/utils/get-root-path';
|
||||
import { asyncPool } from '@/utils/async-pool';
|
||||
import { App } from 'vue';
|
||||
import { getDisplays } from './index';
|
||||
import { DisplayConfig } from './types';
|
||||
@@ -12,18 +10,11 @@ export async function registerDisplays(app: App): Promise<void> {
|
||||
|
||||
const displays: DisplayConfig[] = Object.values(displayModules).map((module) => module.default);
|
||||
try {
|
||||
const customResponse = await api.get('/extensions/displays/');
|
||||
const customDisplays: string[] = customResponse.data.data || [];
|
||||
const customDisplays: { default: DisplayConfig[] } = import.meta.env.DEV
|
||||
? await import('@directus-extensions-display')
|
||||
: await import(/* @vite-ignore */ `${getRootPath()}extensions/displays/index.js`);
|
||||
|
||||
await asyncPool(5, customDisplays, async (displayName) => {
|
||||
try {
|
||||
const result = await import(/* @vite-ignore */ `${getRootPath()}extensions/displays/${displayName}/index.js`);
|
||||
displays.push(result.default);
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Couldn't load custom displays "${displayName}":`, err);
|
||||
}
|
||||
});
|
||||
displays.push(...customDisplays.default);
|
||||
} catch {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Couldn't load custom displays`);
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Field } from '@/types';
|
||||
import { Field, Relation } from '@/types';
|
||||
import { defineComponent, PropType, computed } from 'vue';
|
||||
import { Relation } from '@/types/relations';
|
||||
|
||||
export default defineComponent({
|
||||
emits: ['input'],
|
||||
|
||||
@@ -30,9 +30,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Field } from '@/types';
|
||||
import { Relation, Collection, Field } from '@/types';
|
||||
import { defineComponent, PropType, computed } from 'vue';
|
||||
import { Relation, Collection } from '@/types';
|
||||
import { useCollectionsStore } from '@/stores';
|
||||
export default defineComponent({
|
||||
emits: ['input'],
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Filter } from '@/types';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import { get } from 'lodash';
|
||||
import { computed, ComputedRef, Ref, ref } from 'vue';
|
||||
import { RelationInfo } from './use-relation';
|
||||
|
||||
@@ -56,7 +56,7 @@ import api from '@/api';
|
||||
import { getFieldsFromTemplate } from '@/utils/get-fields-from-template';
|
||||
import hideDragImage from '@/utils/hide-drag-image';
|
||||
import NestedDraggable from './nested-draggable.vue';
|
||||
import { Filter } from '@/types';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import { Relation } from '@/types';
|
||||
import DrawerCollection from '@/views/private/components/drawer-collection';
|
||||
import DrawerItem from '@/views/private/components/drawer-item';
|
||||
|
||||
@@ -22,9 +22,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Field } from '@/types';
|
||||
import { Field, Relation } from '@/types';
|
||||
import { defineComponent, PropType, computed } from 'vue';
|
||||
import { Relation } from '@/types/relations';
|
||||
export default defineComponent({
|
||||
emits: ['input'],
|
||||
props: {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import api from '@/api';
|
||||
import { getRootPath } from '@/utils/get-root-path';
|
||||
import { asyncPool } from '@/utils/async-pool';
|
||||
import { App } from 'vue';
|
||||
import { getInterfaces } from './index';
|
||||
import { InterfaceConfig } from './types';
|
||||
@@ -13,20 +11,11 @@ export async function registerInterfaces(app: App): Promise<void> {
|
||||
const interfaces: InterfaceConfig[] = Object.values(interfaceModules).map((module) => module.default);
|
||||
|
||||
try {
|
||||
const customResponse = await api.get('/extensions/interfaces/');
|
||||
const customInterfaces: string[] = customResponse.data.data || [];
|
||||
const customInterfaces: { default: InterfaceConfig[] } = import.meta.env.DEV
|
||||
? await import('@directus-extensions-interface')
|
||||
: await import(/* @vite-ignore */ `${getRootPath()}extensions/interfaces/index.js`);
|
||||
|
||||
await asyncPool(5, customInterfaces, async (interfaceName) => {
|
||||
try {
|
||||
const result = await import(
|
||||
/* @vite-ignore */ `${getRootPath()}extensions/interfaces/${interfaceName}/index.js`
|
||||
);
|
||||
interfaces.push(result.default);
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Couldn't load custom interface "${interfaceName}":`, err);
|
||||
}
|
||||
});
|
||||
interfaces.push(...customInterfaces.default);
|
||||
} catch {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Couldn't load custom interfaces`);
|
||||
|
||||
@@ -12,9 +12,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Field } from '@/types';
|
||||
import { Field, Relation } from '@/types';
|
||||
import { defineComponent, PropType, computed } from 'vue';
|
||||
import { Relation } from '@/types/relations';
|
||||
|
||||
export default defineComponent({
|
||||
emits: ['input'],
|
||||
|
||||
@@ -33,9 +33,8 @@
|
||||
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { Field } from '@/types';
|
||||
import { Field, Relation } from '@/types';
|
||||
import { defineComponent, PropType, computed } from 'vue';
|
||||
import { Relation } from '@/types/relations';
|
||||
import { useCollectionsStore } from '@/stores/';
|
||||
|
||||
export default defineComponent({
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, onMounted, onUnmounted, toRefs } from 'vue';
|
||||
|
||||
import '@fullcalendar/core/vdom';
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -12,7 +12,8 @@ import listPlugin from '@fullcalendar/list';
|
||||
import interactionPlugin from '@fullcalendar/interaction';
|
||||
import { ref, watch, toRefs, computed, Ref } from 'vue';
|
||||
import { useAppStore } from '@/stores/app';
|
||||
import { Item, Filter, Field } from '@/types';
|
||||
import { Field } from '@/types';
|
||||
import { Item, Filter } from '@directus/shared/types';
|
||||
import useItems from '@/composables/use-items';
|
||||
import useCollection from '@/composables/use-collection';
|
||||
import { formatISO } from 'date-fns';
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -84,7 +84,7 @@ import { defineComponent, watch, toRefs } from 'vue';
|
||||
|
||||
import Card from './components/card.vue';
|
||||
import CardsHeader from './components/header.vue';
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
import useElementSize from '@/composables/use-element-size';
|
||||
|
||||
export default defineComponent({
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import api from '@/api';
|
||||
import { getRootPath } from '@/utils/get-root-path';
|
||||
import { asyncPool } from '@/utils/async-pool';
|
||||
import { App } from 'vue';
|
||||
import { getLayouts } from './index';
|
||||
import { LayoutConfig } from './types';
|
||||
@@ -13,18 +11,11 @@ export async function registerLayouts(app: App): Promise<void> {
|
||||
const layouts: LayoutConfig[] = Object.values(layoutModules).map((module) => module.default);
|
||||
|
||||
try {
|
||||
const customResponse = await api.get('/extensions/layouts/');
|
||||
const customLayouts: string[] = customResponse.data.data || [];
|
||||
const customLayouts: { default: LayoutConfig[] } = import.meta.env.DEV
|
||||
? await import('@directus-extensions-layout')
|
||||
: await import(/* @vite-ignore */ `${getRootPath()}extensions/layouts/index.js`);
|
||||
|
||||
await asyncPool(5, customLayouts, async (layoutName) => {
|
||||
try {
|
||||
const result = await import(/* @vite-ignore */ `${getRootPath()}extensions/layouts/${layoutName}/index.js`);
|
||||
layouts.push(result.default);
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Couldn't load custom layout "${layoutName}":`, err);
|
||||
}
|
||||
});
|
||||
layouts.push(...customLayouts.default);
|
||||
} catch {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Couldn't load custom layouts`);
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -54,7 +54,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import Draggable from 'vuedraggable';
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
components: { Draggable },
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<script lang="ts">
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, toRefs } from 'vue';
|
||||
|
||||
import { useLayoutState } from '@/composables/use-layout';
|
||||
import { useLayoutState } from '@directus/shared/composables';
|
||||
|
||||
export default defineComponent({
|
||||
setup() {
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, ComponentPublicInstance } from 'vue';
|
||||
import { Item } from '@/components/v-table/types';
|
||||
import { Filter } from '@/types';
|
||||
import { LayoutProps } from '@directus/shared/types';
|
||||
|
||||
export interface LayoutConfig<Options = any, Query = any> {
|
||||
id: string;
|
||||
@@ -15,18 +14,6 @@ export interface LayoutConfig<Options = any, Query = any> {
|
||||
setup: (LayoutOptions: LayoutProps<Options, Query>) => any;
|
||||
}
|
||||
|
||||
export interface LayoutProps<Options = any, Query = any> {
|
||||
collection: string | null;
|
||||
selection: Item[];
|
||||
layoutOptions: Options;
|
||||
layoutQuery: Query;
|
||||
filters: Filter[];
|
||||
searchQuery: string | null;
|
||||
selectMode: boolean;
|
||||
readonly: boolean;
|
||||
resetPreset?: () => Promise<void>;
|
||||
}
|
||||
|
||||
export type LayoutContext = Record<string, any>;
|
||||
|
||||
export type LayoutDefineParam<Options = any, Query = any> =
|
||||
|
||||
@@ -96,7 +96,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, computed, PropType } from 'vue';
|
||||
import { useUserStore } from '@/stores/user';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { Filter } from '@/types';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
|
||||
export default defineComponent({
|
||||
emits: ['update:filters'],
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, PropType, ref, computed } from 'vue';
|
||||
import { Preset } from '@/types';
|
||||
import { Preset } from '@directus/shared/types';
|
||||
import { useUserStore, usePresetsStore } from '@/stores';
|
||||
import { unexpectedError } from '@/utils/unexpected-error';
|
||||
import { useRoute, useRouter } from 'vue-router';
|
||||
|
||||
@@ -102,8 +102,7 @@ export default defineComponent({
|
||||
|
||||
pageClass.value = attributes?.pageClass;
|
||||
|
||||
// Un-escape zero-width characters to allow breaking up character sequences automatically replaced by vite
|
||||
const htmlString = md.render(markdown).replaceAll('\\u200b', '\u200b');
|
||||
const htmlString = md.render(markdown);
|
||||
|
||||
html.value = htmlString;
|
||||
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import api from '@/api';
|
||||
import { router } from '@/router';
|
||||
import { usePermissionsStore, useUserStore } from '@/stores';
|
||||
import { getRootPath } from '@/utils/get-root-path';
|
||||
import RouterPass from '@/utils/router-passthrough';
|
||||
import { asyncPool } from '@/utils/async-pool';
|
||||
import { getModules } from './index';
|
||||
import { ModuleConfig } from './types';
|
||||
|
||||
@@ -17,19 +15,11 @@ export async function loadModules(): Promise<void> {
|
||||
const modules: ModuleConfig[] = Object.values(moduleModules).map((module) => module.default);
|
||||
|
||||
try {
|
||||
const customResponse = await api.get('/extensions/modules/');
|
||||
const customModules: string[] = customResponse.data.data || [];
|
||||
const customModules: { default: ModuleConfig[] } = import.meta.env.DEV
|
||||
? await import('@directus-extensions-module')
|
||||
: await import(/* @vite-ignore */ `${getRootPath()}extensions/modules/index.js`);
|
||||
|
||||
await asyncPool(5, customModules, async (moduleName) => {
|
||||
try {
|
||||
const result = await import(/* @vite-ignore */ `${getRootPath()}extensions/modules/${moduleName}/index.js`);
|
||||
|
||||
modules.push(result.default);
|
||||
} catch (err) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Couldn't load custom module "${moduleName}":`, err);
|
||||
}
|
||||
});
|
||||
modules.push(...customModules.default);
|
||||
} catch {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(`Couldn't load custom modules`);
|
||||
|
||||
@@ -10,7 +10,8 @@ import { DisplayConfig } from '@/displays/types';
|
||||
import { getInterfaces } from '@/interfaces';
|
||||
import { InterfaceConfig } from '@/interfaces/types';
|
||||
import { useCollectionsStore, useFieldsStore, useRelationsStore } from '@/stores/';
|
||||
import { Collection, Field, localTypes, Relation, Item } from '@/types';
|
||||
import { Collection, Field, localTypes, Relation } from '@/types';
|
||||
import { Item } from '@directus/shared/types';
|
||||
import { clone, throttle } from 'lodash';
|
||||
import { computed, ComputedRef, nextTick, reactive, watch, WatchStopHandle } from 'vue';
|
||||
|
||||
|
||||
@@ -103,7 +103,7 @@ import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, computed, ref, reactive } from 'vue';
|
||||
|
||||
import SettingsNavigation from '../../components/navigation.vue';
|
||||
import { Preset, Filter } from '@/types';
|
||||
import { Preset, Filter } from '@directus/shared/types';
|
||||
import api from '@/api';
|
||||
import { useCollectionsStore, usePresetsStore } from '@/stores';
|
||||
import { getLayouts } from '@/layouts';
|
||||
|
||||
24
app/src/shims.d.ts
vendored
24
app/src/shims.d.ts
vendored
@@ -27,6 +27,30 @@ declare module 'jsonlint-mod' {
|
||||
export default x;
|
||||
}
|
||||
|
||||
declare module '@directus-extensions-interface' {
|
||||
import { InterfaceConfig } from '@/interfaces/types';
|
||||
const interfaces: InterfaceConfig[];
|
||||
export default interfaces;
|
||||
}
|
||||
|
||||
declare module '@directus-extensions-display' {
|
||||
import { DisplayConfig } from '@/displays/types';
|
||||
const displays: DisplayConfig[];
|
||||
export default displays;
|
||||
}
|
||||
|
||||
declare module '@directus-extensions-layout' {
|
||||
import { LayoutConfig } from '@/layouts/types';
|
||||
const layouts: LayoutConfig[];
|
||||
export default layouts;
|
||||
}
|
||||
|
||||
declare module '@directus-extensions-module' {
|
||||
import { ModuleConfig } from '@/modules/types';
|
||||
const modules: ModuleConfig[];
|
||||
export default modules;
|
||||
}
|
||||
|
||||
type Primitive = string | number | boolean | bigint | symbol | undefined | null;
|
||||
type Builtin = Primitive | Function | Date | Error | RegExp;
|
||||
type IsTuple<T> = T extends [infer A]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import api from '@/api';
|
||||
import { useUserStore } from '@/stores/';
|
||||
import { Preset } from '@/types';
|
||||
import { Preset } from '@directus/shared/types';
|
||||
import { cloneDeep, merge } from 'lodash';
|
||||
import { nanoid } from 'nanoid';
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
export * from './collections';
|
||||
export * from './error';
|
||||
export * from './fields';
|
||||
export * from './items';
|
||||
export * from './notifications';
|
||||
export * from './permissions';
|
||||
export * from './presets';
|
||||
export * from './relations';
|
||||
export * from './users';
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
export async function asyncPool<IN, OUT>(
|
||||
poolLimit: number,
|
||||
array: ReadonlyArray<IN>,
|
||||
iteratorFn: (generator: IN, array: ReadonlyArray<IN>) => Promise<OUT>
|
||||
): Promise<OUT[]> {
|
||||
const ret = [];
|
||||
const executing: any[] = [];
|
||||
|
||||
for (const item of array) {
|
||||
const p = Promise.resolve().then(() => iteratorFn(item, array));
|
||||
ret.push(p);
|
||||
|
||||
if (poolLimit <= array.length) {
|
||||
const e = p.then(() => executing.splice(executing.indexOf(e), 1));
|
||||
executing.push(e);
|
||||
if (executing.length >= poolLimit) {
|
||||
await Promise.race(executing);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Promise.all(ret);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Filter } from '@/types/';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import { clone } from 'lodash';
|
||||
|
||||
export default function filtersToQuery(filters: readonly Filter[]): { filter: Record<string, any> } {
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, PropType, ref, reactive, computed, toRefs, watch } from 'vue';
|
||||
import { Filter } from '@/types';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import usePreset from '@/composables/use-preset';
|
||||
import useCollection from '@/composables/use-collection';
|
||||
import { useLayout } from '@/composables/use-layout';
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, ref, PropType } from 'vue';
|
||||
import { Filter } from '@/types';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import api from '@/api';
|
||||
import { getRootPath } from '@/utils/get-root-path';
|
||||
import filtersToQuery from '@/utils/filters-to-query';
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, PropType, computed } from 'vue';
|
||||
import { Filter } from '@/types';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import { useFieldsStore } from '@/stores';
|
||||
import getAvailableOperatorsForType from './get-available-operators-for-type';
|
||||
import FilterInput from './filter-input.vue';
|
||||
|
||||
@@ -60,7 +60,8 @@
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, PropType, computed } from 'vue';
|
||||
import { FilterOperator, types } from '@/types';
|
||||
import { FilterOperator } from '@directus/shared/types';
|
||||
import { types } from '@/types';
|
||||
import { getDefaultInterfaceForType } from '@/utils/get-default-interface-for-type';
|
||||
|
||||
export default defineComponent({
|
||||
|
||||
@@ -43,7 +43,8 @@
|
||||
<script lang="ts">
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { defineComponent, PropType, computed, ref, watch, toRefs } from 'vue';
|
||||
import { Field, Filter } from '@/types';
|
||||
import { Field } from '@/types';
|
||||
import { Filter } from '@directus/shared/types';
|
||||
import { useFieldsStore } from '@/stores';
|
||||
import FieldFilter from './field-filter.vue';
|
||||
import { nanoid } from 'nanoid';
|
||||
|
||||
@@ -2,10 +2,13 @@ import { defineConfig } from 'vite';
|
||||
import vue from '@vitejs/plugin-vue';
|
||||
import yaml from '@rollup/plugin-yaml';
|
||||
import path from 'path';
|
||||
import { getPackageExtensions, getLocalExtensions, generateExtensionsEntry } from '@directus/shared/utils';
|
||||
import { SHARED_DEPS, APP_EXTENSION_TYPES } from '@directus/shared/constants';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
directusExtensions(),
|
||||
vue(),
|
||||
yaml({
|
||||
transform(data) {
|
||||
@@ -18,7 +21,7 @@ export default defineConfig({
|
||||
'@': path.resolve(__dirname, '/src'),
|
||||
},
|
||||
},
|
||||
base: process.env.NODE_ENV === 'development' ? '/admin/' : '',
|
||||
base: process.env.NODE_ENV === 'production' ? '' : '/admin/',
|
||||
server: {
|
||||
port: 8080,
|
||||
proxy: {
|
||||
@@ -29,3 +32,65 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
function directusExtensions() {
|
||||
const prefix = '@directus-extensions-';
|
||||
const virtualIds = APP_EXTENSION_TYPES.map((type) => `${prefix}${type}`);
|
||||
|
||||
let extensionEntrys = {};
|
||||
loadExtensions();
|
||||
|
||||
return [
|
||||
{
|
||||
name: 'directus-extensions-serve',
|
||||
apply: 'serve',
|
||||
resolveId(id) {
|
||||
if (virtualIds.includes(id)) {
|
||||
return id;
|
||||
}
|
||||
},
|
||||
load(id) {
|
||||
if (virtualIds.includes(id)) {
|
||||
const extensionType = id.substring(prefix.length);
|
||||
|
||||
return extensionEntrys[extensionType];
|
||||
}
|
||||
},
|
||||
config: () => ({
|
||||
optimizeDeps: {
|
||||
include: SHARED_DEPS,
|
||||
},
|
||||
}),
|
||||
},
|
||||
{
|
||||
name: 'directus-extensions-build',
|
||||
apply: 'build',
|
||||
config: () => ({
|
||||
build: {
|
||||
rollupOptions: {
|
||||
input: {
|
||||
index: path.resolve(__dirname, 'index.html'),
|
||||
...SHARED_DEPS.reduce((acc, dep) => ({ ...acc, [dep.replace(/\//g, '_')]: dep }), {}),
|
||||
},
|
||||
output: {
|
||||
entryFileNames: '[name].[hash].js',
|
||||
},
|
||||
external: virtualIds,
|
||||
preserveEntrySignatures: 'exports-only',
|
||||
},
|
||||
},
|
||||
}),
|
||||
},
|
||||
];
|
||||
|
||||
async function loadExtensions() {
|
||||
const packageExtensions = await getPackageExtensions(path.join('..', 'api'));
|
||||
const localExtensions = await getLocalExtensions(path.join('..', 'api', 'extensions'));
|
||||
|
||||
const extensions = [...packageExtensions, ...localExtensions];
|
||||
|
||||
for (const extensionType of APP_EXTENSION_TYPES) {
|
||||
extensionEntrys[extensionType] = generateExtensionsEntry(extensionType, extensions);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
383
changelog.md
383
changelog.md
@@ -7,34 +7,53 @@ _Changes marked with a :warning: contain potential breaking changes depending on
|
||||
### :sparkles: New Features
|
||||
|
||||
- **API**
|
||||
- :warning: [#6456](https://github.com/directus/directus/pull/6456) Add schema caching ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6437](https://github.com/directus/directus/pull/6437) Add support for starts/ends with filters ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- :warning: [#6456](https://github.com/directus/directus/pull/6456) Add schema caching
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6437](https://github.com/directus/directus/pull/6437) Add support for starts/ends with filters
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- **App**
|
||||
- [#6441](https://github.com/directus/directus/pull/6441) Add checkboxes-tree interface ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6430](https://github.com/directus/directus/pull/6430) Add Serbian (Latin) Language ([@srkinftel](https://github.com/srkinftel))
|
||||
- [#6441](https://github.com/directus/directus/pull/6441) Add checkboxes-tree interface
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6430](https://github.com/directus/directus/pull/6430) Add Serbian (Latin) Language
|
||||
([@srkinftel](https://github.com/srkinftel))
|
||||
|
||||
### :bug: Bug Fixes
|
||||
|
||||
- **App**
|
||||
- [#6455](https://github.com/directus/directus/pull/6455) Fixed issue that would prevent source code editing from staging values in wysiwyg ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6454](https://github.com/directus/directus/pull/6454) Fixed color option of the notice presentation interface ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6453](https://github.com/directus/directus/pull/6453) Fixed issue that would throw error in console when creating a new item in a collection w/ translations ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6451](https://github.com/directus/directus/pull/6451) Fix creating custom names for recommend collection fields on new collection setup drawer ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6450](https://github.com/directus/directus/pull/6450) Fixed rendering of SVGs in single file image interface ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6449](https://github.com/directus/directus/pull/6449) Fix header buttons not functioning in markdown interface ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6447](https://github.com/directus/directus/pull/6447) Don't default to `directus_files` in local store on existing relation ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6442](https://github.com/directus/directus/pull/6442) Fix display template on collection detail page ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6421](https://github.com/directus/directus/pull/6421) Update admin to use `no-store` ([@aidenfoxx](https://github.com/aidenfoxx))
|
||||
- [#6361](https://github.com/directus/directus/pull/6361) Fix spacings and icons on presentation link buttons ([@HitomiTenshi](https://github.com/HitomiTenshi))
|
||||
- [#6455](https://github.com/directus/directus/pull/6455) Fixed issue that would prevent source code editing from
|
||||
staging values in wysiwyg ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6454](https://github.com/directus/directus/pull/6454) Fixed color option of the notice presentation interface
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6453](https://github.com/directus/directus/pull/6453) Fixed issue that would throw error in console when creating
|
||||
a new item in a collection w/ translations ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6451](https://github.com/directus/directus/pull/6451) Fix creating custom names for recommend collection fields on
|
||||
new collection setup drawer ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6450](https://github.com/directus/directus/pull/6450) Fixed rendering of SVGs in single file image interface
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6449](https://github.com/directus/directus/pull/6449) Fix header buttons not functioning in markdown interface
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6447](https://github.com/directus/directus/pull/6447) Don't default to `directus_files` in local store on existing
|
||||
relation ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6442](https://github.com/directus/directus/pull/6442) Fix display template on collection detail page
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6421](https://github.com/directus/directus/pull/6421) Update admin to use `no-store`
|
||||
([@aidenfoxx](https://github.com/aidenfoxx))
|
||||
- [#6361](https://github.com/directus/directus/pull/6361) Fix spacings and icons on presentation link buttons
|
||||
([@HitomiTenshi](https://github.com/HitomiTenshi))
|
||||
- **API**
|
||||
- [#6444](https://github.com/directus/directus/pull/6444) Don't return default val for PK field in singleton ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6444](https://github.com/directus/directus/pull/6444) Don't return default val for PK field in singleton
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
|
||||
### :package: Dependency Updates
|
||||
|
||||
- [#6445](https://github.com/directus/directus/pull/6445) fix(deps): update dependency gatsby-source-filesystem to v3.8.0 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6443](https://github.com/directus/directus/pull/6443) update vue monorepo to v3.1.2 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6439](https://github.com/directus/directus/pull/6439) chore(deps): update dependency marked to v2.1.2 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6424](https://github.com/directus/directus/pull/6424) chore(deps): update dependency jest to v27.0.5 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6445](https://github.com/directus/directus/pull/6445) fix(deps): update dependency gatsby-source-filesystem to
|
||||
v3.8.0 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6443](https://github.com/directus/directus/pull/6443) update vue monorepo to v3.1.2
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6439](https://github.com/directus/directus/pull/6439) chore(deps): update dependency marked to v2.1.2
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6424](https://github.com/directus/directus/pull/6424) chore(deps): update dependency jest to v27.0.5
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
|
||||
## v9.0.0-rc.79 (June 22, 2021)
|
||||
|
||||
@@ -45,189 +64,299 @@ Nothing to see here.. (Vue's update to 3.1.2 made things go 💥)
|
||||
### :rocket: Improvements
|
||||
|
||||
- **App**
|
||||
- [#6413](https://github.com/directus/directus/pull/6413) Use correct input type for type in advanced filter sidebar ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6413](https://github.com/directus/directus/pull/6413) Use correct input type for type in advanced filter sidebar
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
|
||||
### :bug: Bug Fixes
|
||||
|
||||
- **App**
|
||||
- [#6412](https://github.com/directus/directus/pull/6412) Fixed issue that would prevent button/list-item links from functioning ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6412](https://github.com/directus/directus/pull/6412) Fixed issue that would prevent button/list-item links from
|
||||
functioning ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
|
||||
## v9.0.0-rc.77 (June 21, 2021)
|
||||
|
||||
### :sparkles: New Features
|
||||
|
||||
- **API**
|
||||
- [#6379](https://github.com/directus/directus/pull/6379) Add ability to specify what fields to clone on "Save as Copy" ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6341](https://github.com/directus/directus/pull/6341) Add support for `read` hooks on `items` ([@MoltenCoffee](https://github.com/MoltenCoffee))
|
||||
- [#6294](https://github.com/directus/directus/pull/6294) Allow overriding the s-maxage cache header ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6379](https://github.com/directus/directus/pull/6379) Add ability to specify what fields to clone on "Save as
|
||||
Copy" ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6341](https://github.com/directus/directus/pull/6341) Add support for `read` hooks on `items`
|
||||
([@MoltenCoffee](https://github.com/MoltenCoffee))
|
||||
- [#6294](https://github.com/directus/directus/pull/6294) Allow overriding the s-maxage cache header
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- **App**
|
||||
- [#6379](https://github.com/directus/directus/pull/6379) Add ability to specify what fields to clone on "Save as Copy" ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6379](https://github.com/directus/directus/pull/6379) Add ability to specify what fields to clone on "Save as
|
||||
Copy" ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
|
||||
### :rocket: Improvements
|
||||
|
||||
- **API**
|
||||
- :warning: [#6355](https://github.com/directus/directus/pull/6355) Use `no-store` instead of `no-cache` for skipping the cache ([@nachogarcia](https://github.com/nachogarcia))
|
||||
- [#6349](https://github.com/directus/directus/pull/6349) Use existing file extension as default ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6347](https://github.com/directus/directus/pull/6347) Redact tokens from logs ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- :warning: [#6355](https://github.com/directus/directus/pull/6355) Use `no-store` instead of `no-cache` for skipping
|
||||
the cache ([@nachogarcia](https://github.com/nachogarcia))
|
||||
- [#6349](https://github.com/directus/directus/pull/6349) Use existing file extension as default
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6347](https://github.com/directus/directus/pull/6347) Redact tokens from logs
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
|
||||
### :bug: Bug Fixes
|
||||
|
||||
- **API**
|
||||
- [#6350](https://github.com/directus/directus/pull/6350) Don't send sensitive data in webhooks ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6308](https://github.com/directus/directus/pull/6308) Fixed invalid onDelete constraint for OracleDB ([@aidenfoxx](https://github.com/aidenfoxx))
|
||||
- [#6350](https://github.com/directus/directus/pull/6350) Don't send sensitive data in webhooks
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6308](https://github.com/directus/directus/pull/6308) Fixed invalid onDelete constraint for OracleDB
|
||||
([@aidenfoxx](https://github.com/aidenfoxx))
|
||||
- **App**
|
||||
- [#6348](https://github.com/directus/directus/pull/6348) Fixed issue that would cause uploads to the root folder of the file library to fail ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6318](https://github.com/directus/directus/pull/6318) Fixed issue that would prevent setting the placeholder on the input interface ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6289](https://github.com/directus/directus/pull/6289) Fixed issue that would prevent the "Import from URL" functionality to work in a many to many interface ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6348](https://github.com/directus/directus/pull/6348) Fixed issue that would cause uploads to the root folder of
|
||||
the file library to fail ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6318](https://github.com/directus/directus/pull/6318) Fixed issue that would prevent setting the placeholder on
|
||||
the input interface ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6289](https://github.com/directus/directus/pull/6289) Fixed issue that would prevent the "Import from URL"
|
||||
functionality to work in a many to many interface ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- [#6360](https://github.com/directus/directus/pull/6360) Add "require('axios')" in API hooks examples ([@paescuj](https://github.com/paescuj))
|
||||
- [#6339](https://github.com/directus/directus/pull/6339) Fix broken link in quickstart ([@geertijewski](https://github.com/geertijewski))
|
||||
- [#6311](https://github.com/directus/directus/pull/6311) Update SDK doc with note on using multiple instances ([@martinemmert](https://github.com/martinemmert))
|
||||
- [#6284](https://github.com/directus/directus/pull/6284) Add workaround for vite auto-replacement in docs ([@nickrum](https://github.com/nickrum))
|
||||
- [#6360](https://github.com/directus/directus/pull/6360) Add "require('axios')" in API hooks examples
|
||||
([@paescuj](https://github.com/paescuj))
|
||||
- [#6339](https://github.com/directus/directus/pull/6339) Fix broken link in quickstart
|
||||
([@geertijewski](https://github.com/geertijewski))
|
||||
- [#6311](https://github.com/directus/directus/pull/6311) Update SDK doc with note on using multiple instances
|
||||
([@martinemmert](https://github.com/martinemmert))
|
||||
- [#6284](https://github.com/directus/directus/pull/6284) Add workaround for vite auto-replacement in docs
|
||||
([@nickrum](https://github.com/nickrum))
|
||||
|
||||
### :package: Dependency Updates
|
||||
|
||||
- [#6406](https://github.com/directus/directus/pull/6406) chore(deps): update typescript-eslint monorepo to v4.28.0 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6405](https://github.com/directus/directus/pull/6405) chore(deps): update dependency vue-router to v4.0.10 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6401](https://github.com/directus/directus/pull/6401) chore(deps): update dependency codemirror to v5.62.0 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6400](https://github.com/directus/directus/pull/6400) chore(deps): update dependency rollup to v2.52.2 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6399](https://github.com/directus/directus/pull/6399) chore(deps): update dependency swagger-ui-watcher to v2.1.12 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6392](https://github.com/directus/directus/pull/6392) chore(deps): update dependency vite to v2.3.8 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6391](https://github.com/directus/directus/pull/6391) chore(deps): update dependency @types/inquirer to v7.3.2 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6380](https://github.com/directus/directus/pull/6380) chore(deps): update dependency eslint to v7.29.0 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6371](https://github.com/directus/directus/pull/6371) chore(deps): update dependency pinia to v2.0.0-beta.3 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6363](https://github.com/directus/directus/pull/6363) chore(deps): update dependency @types/jsonwebtoken to v8.5.2 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6357](https://github.com/directus/directus/pull/6357) chore(deps): update dependency typescript to v4.3.4 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6342](https://github.com/directus/directus/pull/6342) fix(deps): update dependency chalk to v4 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6338](https://github.com/directus/directus/pull/6338) chore(deps): update postgres docker tag to v13 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6337](https://github.com/directus/directus/pull/6337) chore(deps): update dependency rollup to v2.52.1 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- :warning: [#6336](https://github.com/directus/directus/pull/6336) Use node.js v16 in Docker image ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6334](https://github.com/directus/directus/pull/6334) chore(deps): update dependency fs-extra to v10 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6333](https://github.com/directus/directus/pull/6333) chore(deps): update dependency dotenv to v10 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6332](https://github.com/directus/directus/pull/6332) chore(deps): update mariadb docker tag to v10.6 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6331](https://github.com/directus/directus/pull/6331) chore(deps): update fullcalendar monorepo to v5.8.0 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6330](https://github.com/directus/directus/pull/6330) chore(deps): update dependency marked to v2.1.1 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6329](https://github.com/directus/directus/pull/6329) chore(deps): update dependency typescript to v4.3.3 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6328](https://github.com/directus/directus/pull/6328) fix(deps): update dependency ms to v2.1.3 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6327](https://github.com/directus/directus/pull/6327) chore(deps): update dependency vue-router to v4.0.9 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6324](https://github.com/directus/directus/pull/6324) chore(deps): update dependency globby to v11.0.4 ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6323](https://github.com/directus/directus/pull/6323) fix(deps): pin dependencies ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6322](https://github.com/directus/directus/pull/6322) Configure Renovate ([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6305](https://github.com/directus/directus/pull/6305) Bump sass from 1.35.0 to 1.35.1 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6304](https://github.com/directus/directus/pull/6304) Bump inquirer from 8.1.0 to 8.1.1 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6300](https://github.com/directus/directus/pull/6300) Bump rollup from 2.51.2 to 2.52.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6275](https://github.com/directus/directus/pull/6275) Bump @typescript-eslint/eslint-plugin from 4.26.1 to 4.27.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6274](https://github.com/directus/directus/pull/6274) Bump @typescript-eslint/parser from 4.26.1 to 4.27.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6273](https://github.com/directus/directus/pull/6273) Bump sass from 1.34.1 to 1.35.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6272](https://github.com/directus/directus/pull/6272) Bump aws-sdk from 2.927.0 to 2.928.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6406](https://github.com/directus/directus/pull/6406) chore(deps): update typescript-eslint monorepo to v4.28.0
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6405](https://github.com/directus/directus/pull/6405) chore(deps): update dependency vue-router to v4.0.10
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6401](https://github.com/directus/directus/pull/6401) chore(deps): update dependency codemirror to v5.62.0
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6400](https://github.com/directus/directus/pull/6400) chore(deps): update dependency rollup to v2.52.2
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6399](https://github.com/directus/directus/pull/6399) chore(deps): update dependency swagger-ui-watcher to v2.1.12
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6392](https://github.com/directus/directus/pull/6392) chore(deps): update dependency vite to v2.3.8
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6391](https://github.com/directus/directus/pull/6391) chore(deps): update dependency @types/inquirer to v7.3.2
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6380](https://github.com/directus/directus/pull/6380) chore(deps): update dependency eslint to v7.29.0
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6371](https://github.com/directus/directus/pull/6371) chore(deps): update dependency pinia to v2.0.0-beta.3
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6363](https://github.com/directus/directus/pull/6363) chore(deps): update dependency @types/jsonwebtoken to v8.5.2
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6357](https://github.com/directus/directus/pull/6357) chore(deps): update dependency typescript to v4.3.4
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6342](https://github.com/directus/directus/pull/6342) fix(deps): update dependency chalk to v4
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6338](https://github.com/directus/directus/pull/6338) chore(deps): update postgres docker tag to v13
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6337](https://github.com/directus/directus/pull/6337) chore(deps): update dependency rollup to v2.52.1
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- :warning: [#6336](https://github.com/directus/directus/pull/6336) Use node.js v16 in Docker image
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6334](https://github.com/directus/directus/pull/6334) chore(deps): update dependency fs-extra to v10
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6333](https://github.com/directus/directus/pull/6333) chore(deps): update dependency dotenv to v10
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6332](https://github.com/directus/directus/pull/6332) chore(deps): update mariadb docker tag to v10.6
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6331](https://github.com/directus/directus/pull/6331) chore(deps): update fullcalendar monorepo to v5.8.0
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6330](https://github.com/directus/directus/pull/6330) chore(deps): update dependency marked to v2.1.1
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6329](https://github.com/directus/directus/pull/6329) chore(deps): update dependency typescript to v4.3.3
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6328](https://github.com/directus/directus/pull/6328) fix(deps): update dependency ms to v2.1.3
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6327](https://github.com/directus/directus/pull/6327) chore(deps): update dependency vue-router to v4.0.9
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6324](https://github.com/directus/directus/pull/6324) chore(deps): update dependency globby to v11.0.4
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6323](https://github.com/directus/directus/pull/6323) fix(deps): pin dependencies
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6322](https://github.com/directus/directus/pull/6322) Configure Renovate
|
||||
([@renovate[bot]](https://github.com/apps/renovate))
|
||||
- [#6305](https://github.com/directus/directus/pull/6305) Bump sass from 1.35.0 to 1.35.1
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6304](https://github.com/directus/directus/pull/6304) Bump inquirer from 8.1.0 to 8.1.1
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6300](https://github.com/directus/directus/pull/6300) Bump rollup from 2.51.2 to 2.52.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6275](https://github.com/directus/directus/pull/6275) Bump @typescript-eslint/eslint-plugin from 4.26.1 to 4.27.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6274](https://github.com/directus/directus/pull/6274) Bump @typescript-eslint/parser from 4.26.1 to 4.27.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6273](https://github.com/directus/directus/pull/6273) Bump sass from 1.34.1 to 1.35.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6272](https://github.com/directus/directus/pull/6272) Bump aws-sdk from 2.927.0 to 2.928.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
|
||||
## v9.0.0-rc.76 (June 14, 2021)
|
||||
|
||||
### :sparkles: New Features
|
||||
|
||||
- **API**
|
||||
- [#6221](https://github.com/directus/directus/pull/6221) Add support for date distance adjustment in `$NOW` filter variable ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6216](https://github.com/directus/directus/pull/6216) Added support for nodemailer ignoreTLS option ([@nichols-green](https://github.com/nichols-green))
|
||||
- [#6221](https://github.com/directus/directus/pull/6221) Add support for date distance adjustment in `$NOW` filter
|
||||
variable ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6216](https://github.com/directus/directus/pull/6216) Added support for nodemailer ignoreTLS option
|
||||
([@nichols-green](https://github.com/nichols-green))
|
||||
|
||||
### :rocket: Improvements
|
||||
|
||||
- **API**
|
||||
- [#6211](https://github.com/directus/directus/pull/6211) Optimized oracle schema overview query ([@aidenfoxx](https://github.com/aidenfoxx))
|
||||
- [#6211](https://github.com/directus/directus/pull/6211) Optimized oracle schema overview query
|
||||
([@aidenfoxx](https://github.com/aidenfoxx))
|
||||
|
||||
### :bug: Bug Fixes
|
||||
|
||||
- **API**
|
||||
- [#6267](https://github.com/directus/directus/pull/6267) Fix issue that would cause emails to be displayed incorrectly in certain email clients ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6225](https://github.com/directus/directus/pull/6225) Fix Oracle env error ([@aidenfoxx](https://github.com/aidenfoxx))
|
||||
- [#6208](https://github.com/directus/directus/pull/6208) Moved special check above localTypeMap check. ([@Oreilles](https://github.com/Oreilles))
|
||||
- [#6190](https://github.com/directus/directus/pull/6190) Fix type casting of boolean env var ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6267](https://github.com/directus/directus/pull/6267) Fix issue that would cause emails to be displayed
|
||||
incorrectly in certain email clients ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6225](https://github.com/directus/directus/pull/6225) Fix Oracle env error
|
||||
([@aidenfoxx](https://github.com/aidenfoxx))
|
||||
- [#6208](https://github.com/directus/directus/pull/6208) Moved special check above localTypeMap check.
|
||||
([@Oreilles](https://github.com/Oreilles))
|
||||
- [#6190](https://github.com/directus/directus/pull/6190) Fix type casting of boolean env var
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- **App**
|
||||
- [#6264](https://github.com/directus/directus/pull/6264) Fixed issue that could cause the HTML interface to emit a change on first load ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6263](https://github.com/directus/directus/pull/6263) Fixed issue that would prevent the m2o from working on foreign keys with no meta row ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6262](https://github.com/directus/directus/pull/6262) Fixes issue that would prevent the layout from refreshing on batch operations ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6258](https://github.com/directus/directus/pull/6258) Fix collection selection in system-collections interface ([@nickrum](https://github.com/nickrum))
|
||||
- [#6236](https://github.com/directus/directus/pull/6236) Fix missing styling for WYSIWYG ([@masterwendu](https://github.com/masterwendu))
|
||||
- [#6212](https://github.com/directus/directus/pull/6212) Fix proxying to the app from a subpath ([@nickrum](https://github.com/nickrum))
|
||||
- [#6264](https://github.com/directus/directus/pull/6264) Fixed issue that could cause the HTML interface to emit a
|
||||
change on first load ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6263](https://github.com/directus/directus/pull/6263) Fixed issue that would prevent the m2o from working on
|
||||
foreign keys with no meta row ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6262](https://github.com/directus/directus/pull/6262) Fixes issue that would prevent the layout from refreshing on
|
||||
batch operations ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6258](https://github.com/directus/directus/pull/6258) Fix collection selection in system-collections interface
|
||||
([@nickrum](https://github.com/nickrum))
|
||||
- [#6236](https://github.com/directus/directus/pull/6236) Fix missing styling for WYSIWYG
|
||||
([@masterwendu](https://github.com/masterwendu))
|
||||
- [#6212](https://github.com/directus/directus/pull/6212) Fix proxying to the app from a subpath
|
||||
([@nickrum](https://github.com/nickrum))
|
||||
- **specs**
|
||||
- [#6179](https://github.com/directus/directus/pull/6179) Fix OpenAPI specs ([@paescuj](https://github.com/paescuj))
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- [#6232](https://github.com/directus/directus/pull/6232) Update the app extension docs to work with Vue 3 ([@nickrum](https://github.com/nickrum))
|
||||
- [#6209](https://github.com/directus/directus/pull/6209) Add note on file env vars ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6232](https://github.com/directus/directus/pull/6232) Update the app extension docs to work with Vue 3
|
||||
([@nickrum](https://github.com/nickrum))
|
||||
- [#6209](https://github.com/directus/directus/pull/6209) Add note on file env vars
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
|
||||
### :package: Dependency Updates
|
||||
|
||||
- [#6240](https://github.com/directus/directus/pull/6240) Bump cropperjs from 1.5.11 to 1.5.12 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6239](https://github.com/directus/directus/pull/6239) Bump npm-watch from 0.9.0 to 0.10.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6238](https://github.com/directus/directus/pull/6238) Bump eslint-plugin-vue from 7.11.0 to 7.11.1 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6237](https://github.com/directus/directus/pull/6237) Bump aws-sdk from 2.926.0 to 2.927.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6201](https://github.com/directus/directus/pull/6201) Bump rollup from 2.51.1 to 2.51.2 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6200](https://github.com/directus/directus/pull/6200) Bump eslint-plugin-vue from 7.10.0 to 7.11.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6199](https://github.com/directus/directus/pull/6199) Bump aws-sdk from 2.925.0 to 2.926.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6198](https://github.com/directus/directus/pull/6198) Bump gatsby-source-filesystem from 3.7.0 to 3.7.1 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6240](https://github.com/directus/directus/pull/6240) Bump cropperjs from 1.5.11 to 1.5.12
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6239](https://github.com/directus/directus/pull/6239) Bump npm-watch from 0.9.0 to 0.10.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6238](https://github.com/directus/directus/pull/6238) Bump eslint-plugin-vue from 7.11.0 to 7.11.1
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6237](https://github.com/directus/directus/pull/6237) Bump aws-sdk from 2.926.0 to 2.927.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6201](https://github.com/directus/directus/pull/6201) Bump rollup from 2.51.1 to 2.51.2
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6200](https://github.com/directus/directus/pull/6200) Bump eslint-plugin-vue from 7.10.0 to 7.11.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6199](https://github.com/directus/directus/pull/6199) Bump aws-sdk from 2.925.0 to 2.926.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6198](https://github.com/directus/directus/pull/6198) Bump gatsby-source-filesystem from 3.7.0 to 3.7.1
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
|
||||
## v9.0.0-rc.75 (June 10, 2021)
|
||||
|
||||
### 🚨 App Extensions
|
||||
|
||||
This release includes the big switch from Vue 2 to Vue 3. If you have (complicated) app extensions, make sure to update the build chain of your extension and make sure you're aware of [the breaking changes you might have to account for](https://v3.vuejs.org/guide/migration/introduction.html#breaking-changes). We'll be upgrading the documentation and providing new boilerplates for Vue 3 based extensions in the coming days.
|
||||
This release includes the big switch from Vue 2 to Vue 3. If you have (complicated) app extensions, make sure to update
|
||||
the build chain of your extension and make sure you're aware of
|
||||
[the breaking changes you might have to account for](https://v3.vuejs.org/guide/migration/introduction.html#breaking-changes).
|
||||
We'll be upgrading the documentation and providing new boilerplates for Vue 3 based extensions in the coming days.
|
||||
|
||||
### :sparkles: New Features
|
||||
|
||||
- **API**
|
||||
- [#6155](https://github.com/directus/directus/pull/6155) Allow any of grant's (nested) configuration parameters (oAuth) ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6140](https://github.com/directus/directus/pull/6140) Add item duplicate fields configuration option to directus_collections ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6101](https://github.com/directus/directus/pull/6101) Add support for _FILE environment variables ([@paescuj](https://github.com/paescuj))
|
||||
- [#6155](https://github.com/directus/directus/pull/6155) Allow any of grant's (nested) configuration parameters
|
||||
(oAuth) ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6140](https://github.com/directus/directus/pull/6140) Add item duplicate fields configuration option to
|
||||
directus_collections ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6101](https://github.com/directus/directus/pull/6101) Add support for \_FILE environment variables
|
||||
([@paescuj](https://github.com/paescuj))
|
||||
- **App**
|
||||
- :warning: [#5339](https://github.com/directus/directus/pull/5339) Port the app to Vue 3 ([@nickrum](https://github.com/nickrum))
|
||||
- :warning: [#5339](https://github.com/directus/directus/pull/5339) Port the app to Vue 3
|
||||
([@nickrum](https://github.com/nickrum))
|
||||
|
||||
### :rocket: Improvements
|
||||
|
||||
- **API**
|
||||
- :warning: [#6187](https://github.com/directus/directus/pull/6187) Add additional check to Two-Factor Authentication (by @masterwendu) ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6119](https://github.com/directus/directus/pull/6119) Don't treat numbers larger than the JS max number size as number values in environment variables ([@skizer](https://github.com/skizer))
|
||||
- :warning: [#6187](https://github.com/directus/directus/pull/6187) Add additional check to Two-Factor Authentication
|
||||
(by @masterwendu) ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6119](https://github.com/directus/directus/pull/6119) Don't treat numbers larger than the JS max number size as
|
||||
number values in environment variables ([@skizer](https://github.com/skizer))
|
||||
- **App**
|
||||
- :warning: [#6187](https://github.com/directus/directus/pull/6187) Add additional check to Two-Factor Authentication (by @masterwendu) ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6186](https://github.com/directus/directus/pull/6186) Add number formatting to formatted-values display ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6171](https://github.com/directus/directus/pull/6171) Use JSON editor for JSON field type default value ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6168](https://github.com/directus/directus/pull/6168) Show better message for improperly formatted emails on login ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6118](https://github.com/directus/directus/pull/6118) Support async preRegisterCheck for custom modules ([@t7tran](https://github.com/t7tran))
|
||||
- :warning: [#6187](https://github.com/directus/directus/pull/6187) Add additional check to Two-Factor Authentication
|
||||
(by @masterwendu) ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6186](https://github.com/directus/directus/pull/6186) Add number formatting to formatted-values display
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6171](https://github.com/directus/directus/pull/6171) Use JSON editor for JSON field type default value
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6168](https://github.com/directus/directus/pull/6168) Show better message for improperly formatted emails on login
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6118](https://github.com/directus/directus/pull/6118) Support async preRegisterCheck for custom modules
|
||||
([@t7tran](https://github.com/t7tran))
|
||||
|
||||
### :bug: Bug Fixes
|
||||
|
||||
- **App**
|
||||
- [#6174](https://github.com/directus/directus/pull/6174) Fix issue that would cause sort order of fields to be corrupted on field changes ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6173](https://github.com/directus/directus/pull/6173) Prevent translation rows from being edited before existing values are loaded ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6172](https://github.com/directus/directus/pull/6172) Fix translations hint not linking to collection ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6171](https://github.com/directus/directus/pull/6171) Use JSON editor for JSON field type default value ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6174](https://github.com/directus/directus/pull/6174) Fix issue that would cause sort order of fields to be
|
||||
corrupted on field changes ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6173](https://github.com/directus/directus/pull/6173) Prevent translation rows from being edited before existing
|
||||
values are loaded ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6172](https://github.com/directus/directus/pull/6172) Fix translations hint not linking to collection
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6171](https://github.com/directus/directus/pull/6171) Use JSON editor for JSON field type default value
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- **API**
|
||||
- [#6167](https://github.com/directus/directus/pull/6167) Cleanup one_allowed_collections field on collection delete ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6163](https://github.com/directus/directus/pull/6163) Fix field update for data types with length or boolean as default value ([@paescuj](https://github.com/paescuj))
|
||||
- [#6153](https://github.com/directus/directus/pull/6153) Fixed issue that would cause foreign key constraints to be missed in pascal cased table names in postgres ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6167](https://github.com/directus/directus/pull/6167) Cleanup one_allowed_collections field on collection delete
|
||||
([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
- [#6163](https://github.com/directus/directus/pull/6163) Fix field update for data types with length or boolean as
|
||||
default value ([@paescuj](https://github.com/paescuj))
|
||||
- [#6153](https://github.com/directus/directus/pull/6153) Fixed issue that would cause foreign key constraints to be
|
||||
missed in pascal cased table names in postgres ([@rijkvanzanten](https://github.com/rijkvanzanten))
|
||||
|
||||
### :memo: Documentation
|
||||
|
||||
- [#6188](https://github.com/directus/directus/pull/6188) Adding an example to cron hook ([@juancarlosjr97](https://github.com/juancarlosjr97))
|
||||
- [#6150](https://github.com/directus/directus/pull/6150) Describe breaking change in filter syntax in v8 migration information ([@nachogarcia](https://github.com/nachogarcia))
|
||||
- [#6135](https://github.com/directus/directus/pull/6135) List cron in Event Format Options ([@benhaynes](https://github.com/benhaynes))
|
||||
- [#6188](https://github.com/directus/directus/pull/6188) Adding an example to cron hook
|
||||
([@juancarlosjr97](https://github.com/juancarlosjr97))
|
||||
- [#6150](https://github.com/directus/directus/pull/6150) Describe breaking change in filter syntax in v8 migration
|
||||
information ([@nachogarcia](https://github.com/nachogarcia))
|
||||
- [#6135](https://github.com/directus/directus/pull/6135) List cron in Event Format Options
|
||||
([@benhaynes](https://github.com/benhaynes))
|
||||
|
||||
### :package: Dependency Updates
|
||||
|
||||
- [#6177](https://github.com/directus/directus/pull/6177) Bump aws-sdk from 2.924.0 to 2.925.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6176](https://github.com/directus/directus/pull/6176) Bump @azure/storage-blob from 12.5.0 to 12.6.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6175](https://github.com/directus/directus/pull/6175) Bump jest-environment-jsdom from 26.6.2 to 27.0.3 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6147](https://github.com/directus/directus/pull/6147) Bump dotenv from 9.0.2 to 10.0.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6146](https://github.com/directus/directus/pull/6146) Bump jest-environment-jsdom from 26.6.2 to 27.0.3 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6145](https://github.com/directus/directus/pull/6145) Bump @types/codemirror from 0.0.109 to 5.60.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6144](https://github.com/directus/directus/pull/6144) Bump lint-staged from 10.5.4 to 11.0.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6126](https://github.com/directus/directus/pull/6126) Bump execa from 5.0.1 to 5.1.1 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6125](https://github.com/directus/directus/pull/6125) Bump slugify from 1.5.0 to 1.5.3 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6124](https://github.com/directus/directus/pull/6124) Bump prettier from 2.3.0 to 2.3.1 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6123](https://github.com/directus/directus/pull/6123) Bump connect-redis from 5.2.0 to 6.0.0 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6122](https://github.com/directus/directus/pull/6122) Bump @types/sharp from 0.28.1 to 0.28.3 ([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6177](https://github.com/directus/directus/pull/6177) Bump aws-sdk from 2.924.0 to 2.925.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6176](https://github.com/directus/directus/pull/6176) Bump @azure/storage-blob from 12.5.0 to 12.6.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6175](https://github.com/directus/directus/pull/6175) Bump jest-environment-jsdom from 26.6.2 to 27.0.3
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6147](https://github.com/directus/directus/pull/6147) Bump dotenv from 9.0.2 to 10.0.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6146](https://github.com/directus/directus/pull/6146) Bump jest-environment-jsdom from 26.6.2 to 27.0.3
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6145](https://github.com/directus/directus/pull/6145) Bump @types/codemirror from 0.0.109 to 5.60.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6144](https://github.com/directus/directus/pull/6144) Bump lint-staged from 10.5.4 to 11.0.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6126](https://github.com/directus/directus/pull/6126) Bump execa from 5.0.1 to 5.1.1
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6125](https://github.com/directus/directus/pull/6125) Bump slugify from 1.5.0 to 1.5.3
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6124](https://github.com/directus/directus/pull/6124) Bump prettier from 2.3.0 to 2.3.1
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6123](https://github.com/directus/directus/pull/6123) Bump connect-redis from 5.2.0 to 6.0.0
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
- [#6122](https://github.com/directus/directus/pull/6122) Bump @types/sharp from 0.28.1 to 0.28.3
|
||||
([@dependabot[bot]](https://github.com/apps/dependabot))
|
||||
|
||||
## v9.0.0-rc.74 (June 7, 2021)
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ To be read by the Admin App, your custom display's Vue component must first be b
|
||||
recommend bundling your code using Rollup. To install this and the other development dependencies, run this command:
|
||||
|
||||
```bash
|
||||
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve @rollup/plugin-replace rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
|
||||
npm i -D rollup @rollup/plugin-node-resolve @rollup/plugin-commonjs rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
|
||||
```
|
||||
|
||||
You can then use the following Rollup configuration within `rollup.config.js`:
|
||||
@@ -106,7 +106,6 @@ You can then use the following Rollup configuration within `rollup.config.js`:
|
||||
```js
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import replace from '@rollup/plugin-replace';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import vue from 'rollup-plugin-vue';
|
||||
|
||||
@@ -116,16 +115,8 @@ export default {
|
||||
format: 'es',
|
||||
file: 'dist/index.js',
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
nodeResolve(),
|
||||
commonjs(),
|
||||
replace({
|
||||
'process\u200b.env.NODE_ENV': JSON.stringify('production'),
|
||||
preventAssignment: true,
|
||||
}),
|
||||
terser(),
|
||||
],
|
||||
external: ['vue', '@directus/extension-sdk'],
|
||||
plugins: [vue(), nodeResolve(), commonjs(), terser()],
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ To be read by the Admin App, your custom interface's Vue component must first be
|
||||
We recommend bundling your code using Rollup. To install this and the other development dependencies, run this command:
|
||||
|
||||
```bash
|
||||
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve @rollup/plugin-replace rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
|
||||
npm i -D rollup @rollup/plugin-node-resolve @rollup/plugin-commonjs rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
|
||||
```
|
||||
|
||||
You can then use the following Rollup configuration within `rollup.config.js`:
|
||||
@@ -97,7 +97,6 @@ You can then use the following Rollup configuration within `rollup.config.js`:
|
||||
```js
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import replace from '@rollup/plugin-replace';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import vue from 'rollup-plugin-vue';
|
||||
|
||||
@@ -107,16 +106,8 @@ export default {
|
||||
format: 'es',
|
||||
file: 'dist/index.js',
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
nodeResolve(),
|
||||
commonjs(),
|
||||
replace({
|
||||
'process\u200b.env.NODE_ENV': JSON.stringify('production'),
|
||||
preventAssignment: true,
|
||||
}),
|
||||
terser(),
|
||||
],
|
||||
external: ['vue', '@directus/extension-sdk'],
|
||||
plugins: [vue(), nodeResolve(), commonjs(), terser()],
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
@@ -17,17 +17,30 @@ src/
|
||||
### src/index.js
|
||||
|
||||
```js
|
||||
import { ref } from 'vue';
|
||||
import LayoutComponent from './layout.vue';
|
||||
|
||||
export default {
|
||||
id: 'custom',
|
||||
name: 'Custom',
|
||||
icon: 'box',
|
||||
component: LayoutComponent,
|
||||
slots: {
|
||||
options: () => null,
|
||||
sidebar: () => null,
|
||||
actions: () => null,
|
||||
},
|
||||
setup(props) {
|
||||
const name = ref('Custom layout state');
|
||||
|
||||
return { name };
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
- `id` — The unique key for this layout. It is good practice to scope proprietary layouts with an author prefix.
|
||||
- `name` — The human-readable name for this layout.
|
||||
- `icon` — An icon name from the material icon set, or the extended list of Directus custom icons.
|
||||
- `component` — A reference to your Vue component.
|
||||
|
||||
::: tip TypeScript
|
||||
@@ -42,13 +55,19 @@ for more info on what can go into this object.
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<div>Collection: {{ collection }}</div>
|
||||
<div>{{ name }} - Collection: {{ props.collection }}</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { toRefs } from 'vue';
|
||||
import { useLayoutState } from '@directus/extension-sdk';
|
||||
|
||||
export default {
|
||||
props: {
|
||||
collection: String,
|
||||
setup() {
|
||||
const layoutState = useLayoutState();
|
||||
const { props, name } = toRefs(layoutState.value);
|
||||
|
||||
return { props, name };
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@@ -63,62 +82,6 @@ The props you can use in an layout are:
|
||||
- `filters` (sync) - The user's currently active filters.
|
||||
- `search-query` (sync) - The user's current search query.
|
||||
|
||||
#### Accessing the API from within your extension
|
||||
|
||||
The Directus App's Vue app instance provides a field called `system`, which can be injected into Vue components using
|
||||
[Vue's inject framework](https://v3.vuejs.org/guide/component-provide-inject.html). This `system` field contains
|
||||
functions to access [Pinia](https://pinia.esm.dev) stores, and more importantly, contains a property called `api`, which
|
||||
is an authenticated Axios instance. Here's an example of how to use it:
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<div>
|
||||
<div>Collection: {{ collection }}</div>
|
||||
<v-list>
|
||||
<v-list-item v-for="item in items" v-bind:key="item.id">
|
||||
{{ item }}
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
<v-button v-on:click="logToConsole">CLog items to console</v-button>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
items: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
logToConsole: function () {
|
||||
console.log(this.items);
|
||||
},
|
||||
},
|
||||
inject: ['system'],
|
||||
mounted() {
|
||||
// log the system field so you can see what attributes are available under it
|
||||
// remove this line when you're done.
|
||||
console.log(this.system);
|
||||
// Get a list of all available collections to use with this module
|
||||
this.system.api.get(`/items/${this.collection}`).then((res) => {
|
||||
this.items = res;
|
||||
});
|
||||
},
|
||||
};
|
||||
</script>
|
||||
```
|
||||
|
||||
In the above example, you can see that:
|
||||
|
||||
- The `system` field gets injected into the component and becomes available as an attribute of the component (ie
|
||||
`this.system`)
|
||||
- When the component is mounted, it uses `this.system.api.get` to request a list of all available collections
|
||||
- The names of the collections are rendered into a list in the component's template
|
||||
- a button is added with a method the logs all the data for the collections to the console
|
||||
|
||||
This is just a basic example. A more efficient way to access and work with the list of collections would be to get an
|
||||
instance of the `collectionsStore` using `system.useCollectionsStore()`, but that's beyond the scope of this guide
|
||||
|
||||
## 2. Install Dependencies and Configure the Buildchain
|
||||
|
||||
Set up a package.json file by running:
|
||||
@@ -131,7 +94,7 @@ To be read by the Admin App, your custom layouts's Vue component must first be b
|
||||
recommend bundling your code using Rollup. To install this and the other development dependencies, run this command:
|
||||
|
||||
```bash
|
||||
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve @rollup/plugin-replace rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
|
||||
npm i -D rollup @rollup/plugin-node-resolve @rollup/plugin-commonjs rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
|
||||
```
|
||||
|
||||
You can then use the following Rollup configuration within `rollup.config.js`:
|
||||
@@ -139,7 +102,6 @@ You can then use the following Rollup configuration within `rollup.config.js`:
|
||||
```js
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import replace from '@rollup/plugin-replace';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import vue from 'rollup-plugin-vue';
|
||||
|
||||
@@ -149,16 +111,8 @@ export default {
|
||||
format: 'es',
|
||||
file: 'dist/index.js',
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
nodeResolve(),
|
||||
commonjs(),
|
||||
replace({
|
||||
'process\u200b.env.NODE_ENV': JSON.stringify('production'),
|
||||
preventAssignment: true,
|
||||
}),
|
||||
terser(),
|
||||
],
|
||||
external: ['vue', '@directus/extension-sdk'],
|
||||
plugins: [vue(), nodeResolve(), commonjs(), terser()],
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
@@ -131,7 +131,7 @@ To be read by the Admin App, your custom module's Vue component must first be bu
|
||||
recommend bundling your code using Rollup. To install this and the other development dependencies, run this command:
|
||||
|
||||
```bash
|
||||
npm i -D rollup @rollup/plugin-commonjs @rollup/plugin-node-resolve @rollup/plugin-replace rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
|
||||
npm i -D rollup @rollup/plugin-node-resolve @rollup/plugin-commonjs rollup-plugin-terser rollup-plugin-vue @vue/compiler-sfc
|
||||
```
|
||||
|
||||
You can then use the following Rollup configuration within `rollup.config.js`:
|
||||
@@ -139,7 +139,6 @@ You can then use the following Rollup configuration within `rollup.config.js`:
|
||||
```js
|
||||
import { nodeResolve } from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import replace from '@rollup/plugin-replace';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
import vue from 'rollup-plugin-vue';
|
||||
|
||||
@@ -149,16 +148,8 @@ export default {
|
||||
format: 'es',
|
||||
file: 'dist/index.js',
|
||||
},
|
||||
plugins: [
|
||||
vue(),
|
||||
nodeResolve(),
|
||||
commonjs(),
|
||||
replace({
|
||||
'process\u200b.env.NODE_ENV': JSON.stringify('production'),
|
||||
preventAssignment: true,
|
||||
}),
|
||||
terser(),
|
||||
],
|
||||
external: ['vue', '@directus/extension-sdk'],
|
||||
plugins: [vue(), nodeResolve(), commonjs(), terser()],
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
@@ -68,25 +68,27 @@ The storage implementation. See [Storage](#storage) for more information.
|
||||
|
||||
Defaults to an instance of `MemoryStorage` when in node.js, and `LocalStorage` when in browsers.
|
||||
|
||||
**NOTE:**
|
||||
**NOTE:**
|
||||
|
||||
If you plan to use multiple SDK instances at once, keep in mind that they will share the Storage across them, leading to unpredictable behaviors. This scenario might be a case while writing tests.
|
||||
If you plan to use multiple SDK instances at once, keep in mind that they will share the Storage across them, leading to
|
||||
unpredictable behaviors. This scenario might be a case while writing tests.
|
||||
|
||||
For example, the SDK instance that executed last the `login()` method writes the resulting `access_token` into the Storage and **overwrites** any prior fetched `access_token` from any other SDK instance. That might mix up your test scenario by granting false access rights to your previous logged-in users.
|
||||
For example, the SDK instance that executed last the `login()` method writes the resulting `access_token` into the
|
||||
Storage and **overwrites** any prior fetched `access_token` from any other SDK instance. That might mix up your test
|
||||
scenario by granting false access rights to your previous logged-in users.
|
||||
|
||||
Adding prefixes to your Storage instances would solve this error:
|
||||
|
||||
```js
|
||||
import { Directus, MemoryStorage } from "@directus/sdk";
|
||||
import { randomBytes } from "crypto";
|
||||
import { Directus, MemoryStorage } from '@directus/sdk';
|
||||
import { randomBytes } from 'crypto';
|
||||
|
||||
// ...
|
||||
|
||||
const prefix = randomBytes(8).toString("hex");
|
||||
const prefix = randomBytes(8).toString('hex');
|
||||
const storage = new MemoryStorage(prefix);
|
||||
const url = `http://${host}:${port}`;
|
||||
const directus = new Directus(url, { storage });
|
||||
|
||||
```
|
||||
|
||||
#### `options.transport`
|
||||
|
||||
194
package-lock.json
generated
194
package-lock.json
generated
@@ -68,8 +68,11 @@
|
||||
"@directus/drive-s3": "9.0.0-rc.80",
|
||||
"@directus/format-title": "9.0.0-rc.80",
|
||||
"@directus/schema": "9.0.0-rc.80",
|
||||
"@directus/shared": "9.0.0-rc.80",
|
||||
"@directus/specs": "9.0.0-rc.80",
|
||||
"@godaddy/terminus": "^4.9.0",
|
||||
"@rollup/plugin-alias": "^3.1.2",
|
||||
"@rollup/plugin-virtual": "^2.0.3",
|
||||
"argon2": "^0.28.1",
|
||||
"async": "^3.2.0",
|
||||
"async-mutex": "^0.3.1",
|
||||
@@ -124,6 +127,7 @@
|
||||
"qs": "^6.9.4",
|
||||
"rate-limiter-flexible": "^2.2.2",
|
||||
"resolve-cwd": "^3.0.0",
|
||||
"rollup": "^2.52.1",
|
||||
"sharp": "^0.28.3",
|
||||
"stream-json": "^1.7.1",
|
||||
"uuid": "^8.3.2",
|
||||
@@ -457,7 +461,9 @@
|
||||
"version": "9.0.0-rc.80",
|
||||
"devDependencies": {
|
||||
"@directus/docs": "9.0.0-rc.80",
|
||||
"@directus/extension-sdk": "9.0.0-rc.80",
|
||||
"@directus/format-title": "9.0.0-rc.80",
|
||||
"@directus/shared": "9.0.0-rc.80",
|
||||
"@fullcalendar/core": "5.8.0",
|
||||
"@fullcalendar/daygrid": "5.8.0",
|
||||
"@fullcalendar/interaction": "5.8.0",
|
||||
@@ -2790,6 +2796,10 @@
|
||||
"resolved": "packages/drive-s3",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@directus/extension-sdk": {
|
||||
"resolved": "packages/extension-sdk",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@directus/format-title": {
|
||||
"resolved": "packages/format-title",
|
||||
"link": true
|
||||
@@ -2816,6 +2826,10 @@
|
||||
"openapi3-ts": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@directus/shared": {
|
||||
"resolved": "packages/shared",
|
||||
"link": true
|
||||
},
|
||||
"node_modules/@directus/specs": {
|
||||
"resolved": "packages/specs",
|
||||
"link": true
|
||||
@@ -7318,6 +7332,20 @@
|
||||
"react-dom": "15.x || 16.x || 16.4.0-alpha.0911da3"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/plugin-alias": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-3.1.2.tgz",
|
||||
"integrity": "sha512-wzDnQ6v7CcoRzS0qVwFPrFdYA4Qlr+ookA217Y2Z3DPZE1R8jrFNM3jvGgOf6o6DMjbnQIn5lCIJgHPe1Bt3uw==",
|
||||
"dependencies": {
|
||||
"slash": "^3.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"rollup": "^1.20.0||^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/plugin-commonjs": {
|
||||
"version": "19.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.0.tgz",
|
||||
@@ -7389,6 +7417,14 @@
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/plugin-virtual": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-virtual/-/plugin-virtual-2.0.3.tgz",
|
||||
"integrity": "sha512-pw6ziJcyjZtntQ//bkad9qXaBx665SgEL8C8KI5wO8G5iU5MPxvdWrQyVaAvjojGm9tJoS8M9Z/EEepbqieYmw==",
|
||||
"peerDependencies": {
|
||||
"rollup": "^1.20.0||^2.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@rollup/plugin-yaml": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-yaml/-/plugin-yaml-3.0.0.tgz",
|
||||
@@ -9516,7 +9552,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.1.tgz",
|
||||
"integrity": "sha512-Z1RO3T6AEtAUFf2EqqovFm3ohAeTvFzRtB0qUENW2nEerJfdlk13/LS1a0EgsqlzxmYfR/S/S/gW9PLbFZZxkA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.12.0",
|
||||
"@babel/types": "^7.12.0",
|
||||
@@ -9528,14 +9563,12 @@
|
||||
"node_modules/@vue/compiler-core/node_modules/estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||
},
|
||||
"node_modules/@vue/compiler-core/node_modules/source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
@@ -9544,7 +9577,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.1.tgz",
|
||||
"integrity": "sha512-nobRIo0t5ibzg+q8nC31m+aJhbq8FbWUoKvk6h3Vs1EqTDJaj6lBTcVTq5or8AYht7FbSpdAJ81isbJ1rWNX7A==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-core": "3.1.1",
|
||||
"@vue/shared": "3.1.1"
|
||||
@@ -9808,7 +9840,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.1.tgz",
|
||||
"integrity": "sha512-DsH5woNVCcPK1M0RRYVgJEU1GJDU2ASOKpAqW3ppHk+XjoFLCbqc/26RTCgTpJYd9z8VN+79Q1u7/QqgQPbuLQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.1.1"
|
||||
}
|
||||
@@ -9817,7 +9848,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.1.tgz",
|
||||
"integrity": "sha512-GboqR02txOtkd9F3Ysd8ltPL68vTCqIx2p/J52/gFtpgb5FG9hvOAPEwFUqxeEJRu7ResvQnmdOHiEycGPCLhQ==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.1.1",
|
||||
"@vue/shared": "3.1.1"
|
||||
@@ -9827,7 +9857,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.1.tgz",
|
||||
"integrity": "sha512-o57n/199e/BBAmLRMSXmD2r12Old/h/gf6BgL0RON1NT2pwm6MWaMY4Ul55eyq+FsDILz4jR/UgoPQ9vYB8xcw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@vue/runtime-core": "3.1.1",
|
||||
"@vue/shared": "3.1.1",
|
||||
@@ -9837,8 +9866,7 @@
|
||||
"node_modules/@vue/shared": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.1.tgz",
|
||||
"integrity": "sha512-g+4pzAw7PYSjARtLBoDq6DmcblX8i9KJHSCnyM5VDDFFifUaUT9iHbFpOF/KOizQ9f7QAqU2JH3Y6aXjzUMhVA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-g+4pzAw7PYSjARtLBoDq6DmcblX8i9KJHSCnyM5VDDFFifUaUT9iHbFpOF/KOizQ9f7QAqU2JH3Y6aXjzUMhVA=="
|
||||
},
|
||||
"node_modules/@vue/web-component-wrapper": {
|
||||
"version": "1.3.0",
|
||||
@@ -16306,8 +16334,7 @@
|
||||
"node_modules/csstype": {
|
||||
"version": "2.6.17",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.17.tgz",
|
||||
"integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==",
|
||||
"dev": true
|
||||
"integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A=="
|
||||
},
|
||||
"node_modules/csv": {
|
||||
"version": "5.5.0",
|
||||
@@ -41255,7 +41282,6 @@
|
||||
"version": "2.52.2",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.52.2.tgz",
|
||||
"integrity": "sha512-4RlFC3k2BIHlUsJ9mGd8OO+9Lm2eDF5P7+6DNQOp5sx+7N/1tFM01kELfbxlMX3MxT6owvLB1ln4S3QvvQlbUA==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"rollup": "dist/bin/rollup"
|
||||
},
|
||||
@@ -47855,7 +47881,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.1.1.tgz",
|
||||
"integrity": "sha512-j9fj3PNPMxo2eqOKYjMuss9XBS8ZtmczLY3kPvjcp9d3DbhyNqLYbaMQH18+1pDIzzVvQCQBvIf774LsjjqSKA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.1.1",
|
||||
"@vue/runtime-dom": "3.1.1",
|
||||
@@ -51623,6 +51648,18 @@
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"packages/extension-sdk": {
|
||||
"name": "@directus/extension-sdk",
|
||||
"version": "9.0.0-rc.80",
|
||||
"dependencies": {
|
||||
"@directus/shared": "9.0.0-rc.80"
|
||||
},
|
||||
"devDependencies": {
|
||||
"npm-run-all": "4.1.5",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.3.2"
|
||||
}
|
||||
},
|
||||
"packages/format-title": {
|
||||
"name": "@directus/format-title",
|
||||
"version": "9.0.0-rc.80",
|
||||
@@ -55918,6 +55955,51 @@
|
||||
"node": ">=8"
|
||||
}
|
||||
},
|
||||
"packages/shared": {
|
||||
"name": "@directus/shared",
|
||||
"version": "9.0.0-rc.80",
|
||||
"dependencies": {
|
||||
"fs-extra": "^10.0.0",
|
||||
"vue": "^3.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"npm-run-all": "4.1.5",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.3.2"
|
||||
}
|
||||
},
|
||||
"packages/shared/node_modules/fs-extra": {
|
||||
"version": "10.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
|
||||
"integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"packages/shared/node_modules/jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"dependencies": {
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"packages/shared/node_modules/universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==",
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"packages/specs": {
|
||||
"name": "@directus/specs",
|
||||
"version": "9.0.0-rc.80",
|
||||
@@ -57611,7 +57693,9 @@
|
||||
"version": "file:app",
|
||||
"requires": {
|
||||
"@directus/docs": "9.0.0-rc.80",
|
||||
"@directus/extension-sdk": "9.0.0-rc.80",
|
||||
"@directus/format-title": "9.0.0-rc.80",
|
||||
"@directus/shared": "9.0.0-rc.80",
|
||||
"@fullcalendar/core": "5.8.0",
|
||||
"@fullcalendar/daygrid": "5.8.0",
|
||||
"@fullcalendar/interaction": "5.8.0",
|
||||
@@ -58301,6 +58385,15 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@directus/extension-sdk": {
|
||||
"version": "file:packages/extension-sdk",
|
||||
"requires": {
|
||||
"@directus/shared": "9.0.0-rc.80",
|
||||
"npm-run-all": "4.1.5",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.3.2"
|
||||
}
|
||||
},
|
||||
"@directus/format-title": {
|
||||
"version": "file:packages/format-title",
|
||||
"requires": {
|
||||
@@ -61507,6 +61600,42 @@
|
||||
"openapi3-ts": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"@directus/shared": {
|
||||
"version": "file:packages/shared",
|
||||
"requires": {
|
||||
"fs-extra": "^10.0.0",
|
||||
"npm-run-all": "4.1.5",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.3.2",
|
||||
"vue": "^3.0.5"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": {
|
||||
"version": "10.0.0",
|
||||
"resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
|
||||
"integrity": "sha512-C5owb14u9eJwizKGdchcDUQeFtlSHHthBk8pbX9Vc1PFZrLombudjDnNns88aYslCyF6IY5SUw3Roz6xShcEIQ==",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"requires": {
|
||||
"graceful-fs": "^4.1.6",
|
||||
"universalify": "^2.0.0"
|
||||
}
|
||||
},
|
||||
"universalify": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
|
||||
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ=="
|
||||
}
|
||||
}
|
||||
},
|
||||
"@directus/specs": {
|
||||
"version": "file:packages/specs",
|
||||
"requires": {
|
||||
@@ -65091,6 +65220,14 @@
|
||||
"react-lifecycles-compat": "^3.0.4"
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-alias": {
|
||||
"version": "3.1.2",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-3.1.2.tgz",
|
||||
"integrity": "sha512-wzDnQ6v7CcoRzS0qVwFPrFdYA4Qlr+ookA217Y2Z3DPZE1R8jrFNM3jvGgOf6o6DMjbnQIn5lCIJgHPe1Bt3uw==",
|
||||
"requires": {
|
||||
"slash": "^3.0.0"
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-commonjs": {
|
||||
"version": "19.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-19.0.0.tgz",
|
||||
@@ -65145,6 +65282,12 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"@rollup/plugin-virtual": {
|
||||
"version": "2.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-virtual/-/plugin-virtual-2.0.3.tgz",
|
||||
"integrity": "sha512-pw6ziJcyjZtntQ//bkad9qXaBx665SgEL8C8KI5wO8G5iU5MPxvdWrQyVaAvjojGm9tJoS8M9Z/EEepbqieYmw==",
|
||||
"requires": {}
|
||||
},
|
||||
"@rollup/plugin-yaml": {
|
||||
"version": "3.0.0",
|
||||
"resolved": "https://registry.npmjs.org/@rollup/plugin-yaml/-/plugin-yaml-3.0.0.tgz",
|
||||
@@ -66978,7 +67121,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.1.1.tgz",
|
||||
"integrity": "sha512-Z1RO3T6AEtAUFf2EqqovFm3ohAeTvFzRtB0qUENW2nEerJfdlk13/LS1a0EgsqlzxmYfR/S/S/gW9PLbFZZxkA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/parser": "^7.12.0",
|
||||
"@babel/types": "^7.12.0",
|
||||
@@ -66990,14 +67132,12 @@
|
||||
"estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==",
|
||||
"dev": true
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||
},
|
||||
"source-map": {
|
||||
"version": "0.6.1",
|
||||
"resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz",
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==",
|
||||
"dev": true
|
||||
"integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -67005,7 +67145,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.1.1.tgz",
|
||||
"integrity": "sha512-nobRIo0t5ibzg+q8nC31m+aJhbq8FbWUoKvk6h3Vs1EqTDJaj6lBTcVTq5or8AYht7FbSpdAJ81isbJ1rWNX7A==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@vue/compiler-core": "3.1.1",
|
||||
"@vue/shared": "3.1.1"
|
||||
@@ -67209,7 +67348,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.1.1.tgz",
|
||||
"integrity": "sha512-DsH5woNVCcPK1M0RRYVgJEU1GJDU2ASOKpAqW3ppHk+XjoFLCbqc/26RTCgTpJYd9z8VN+79Q1u7/QqgQPbuLQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@vue/shared": "3.1.1"
|
||||
}
|
||||
@@ -67218,7 +67356,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.1.1.tgz",
|
||||
"integrity": "sha512-GboqR02txOtkd9F3Ysd8ltPL68vTCqIx2p/J52/gFtpgb5FG9hvOAPEwFUqxeEJRu7ResvQnmdOHiEycGPCLhQ==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@vue/reactivity": "3.1.1",
|
||||
"@vue/shared": "3.1.1"
|
||||
@@ -67228,7 +67365,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.1.1.tgz",
|
||||
"integrity": "sha512-o57n/199e/BBAmLRMSXmD2r12Old/h/gf6BgL0RON1NT2pwm6MWaMY4Ul55eyq+FsDILz4jR/UgoPQ9vYB8xcw==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@vue/runtime-core": "3.1.1",
|
||||
"@vue/shared": "3.1.1",
|
||||
@@ -67238,8 +67374,7 @@
|
||||
"@vue/shared": {
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.1.1.tgz",
|
||||
"integrity": "sha512-g+4pzAw7PYSjARtLBoDq6DmcblX8i9KJHSCnyM5VDDFFifUaUT9iHbFpOF/KOizQ9f7QAqU2JH3Y6aXjzUMhVA==",
|
||||
"dev": true
|
||||
"integrity": "sha512-g+4pzAw7PYSjARtLBoDq6DmcblX8i9KJHSCnyM5VDDFFifUaUT9iHbFpOF/KOizQ9f7QAqU2JH3Y6aXjzUMhVA=="
|
||||
},
|
||||
"@vue/web-component-wrapper": {
|
||||
"version": "1.3.0",
|
||||
@@ -72584,8 +72719,7 @@
|
||||
"csstype": {
|
||||
"version": "2.6.17",
|
||||
"resolved": "https://registry.npmjs.org/csstype/-/csstype-2.6.17.tgz",
|
||||
"integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A==",
|
||||
"dev": true
|
||||
"integrity": "sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A=="
|
||||
},
|
||||
"csv": {
|
||||
"version": "5.5.0",
|
||||
@@ -73269,9 +73403,12 @@
|
||||
"@directus/drive-s3": "9.0.0-rc.80",
|
||||
"@directus/format-title": "9.0.0-rc.80",
|
||||
"@directus/schema": "9.0.0-rc.80",
|
||||
"@directus/shared": "9.0.0-rc.80",
|
||||
"@directus/specs": "9.0.0-rc.80",
|
||||
"@godaddy/terminus": "^4.9.0",
|
||||
"@keyv/redis": "^2.1.2",
|
||||
"@rollup/plugin-alias": "^3.1.2",
|
||||
"@rollup/plugin-virtual": "^2.0.3",
|
||||
"@types/async": "3.2.6",
|
||||
"@types/atob": "2.1.2",
|
||||
"@types/body-parser": "1.19.0",
|
||||
@@ -73365,6 +73502,7 @@
|
||||
"qs": "^6.9.4",
|
||||
"rate-limiter-flexible": "^2.2.2",
|
||||
"resolve-cwd": "^3.0.0",
|
||||
"rollup": "^2.52.1",
|
||||
"sharp": "^0.28.3",
|
||||
"sqlite3": "^5.0.2",
|
||||
"stream-json": "^1.7.1",
|
||||
@@ -92387,7 +92525,6 @@
|
||||
"version": "2.52.2",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-2.52.2.tgz",
|
||||
"integrity": "sha512-4RlFC3k2BIHlUsJ9mGd8OO+9Lm2eDF5P7+6DNQOp5sx+7N/1tFM01kELfbxlMX3MxT6owvLB1ln4S3QvvQlbUA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
@@ -97587,7 +97724,6 @@
|
||||
"version": "3.1.1",
|
||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.1.1.tgz",
|
||||
"integrity": "sha512-j9fj3PNPMxo2eqOKYjMuss9XBS8ZtmczLY3kPvjcp9d3DbhyNqLYbaMQH18+1pDIzzVvQCQBvIf774LsjjqSKA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@vue/compiler-dom": "3.1.1",
|
||||
"@vue/runtime-dom": "3.1.1",
|
||||
|
||||
12
packages/extension-sdk/.editorconfig
Normal file
12
packages/extension-sdk/.editorconfig
Normal file
@@ -0,0 +1,12 @@
|
||||
root=true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{package.json,*.yml,*.yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
1
packages/extension-sdk/.npmrc
Normal file
1
packages/extension-sdk/.npmrc
Normal file
@@ -0,0 +1 @@
|
||||
package-lock=false
|
||||
674
packages/extension-sdk/license
Normal file
674
packages/extension-sdk/license
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
27
packages/extension-sdk/package.json
Normal file
27
packages/extension-sdk/package.json
Normal file
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"name": "@directus/extension-sdk",
|
||||
"version": "9.0.0-rc.80",
|
||||
"description": "A toolkit to develop extensions to extend Directus.",
|
||||
"main": "dist/cjs/index.js",
|
||||
"exports": {
|
||||
"import": "./dist/esm/index.js",
|
||||
"require": "./dist/cjs/index.js"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "run-p build:*",
|
||||
"build:esm": "tsc --project ./tsconfig.json --module ES2015 --outDir ./dist/esm",
|
||||
"build:cjs": "tsc --project ./tsconfig.json --module CommonJS --outDir ./dist/cjs",
|
||||
"cleanup": "rimraf ./dist",
|
||||
"dev": "npm run build -- -w --preserveWatchOutput --incremental"
|
||||
},
|
||||
"author": "Nicola Krumschmidt",
|
||||
"gitHead": "24621f3934dc77eb23441331040ed13c676ceffd",
|
||||
"dependencies": {
|
||||
"@directus/shared": "9.0.0-rc.80"
|
||||
},
|
||||
"devDependencies": {
|
||||
"npm-run-all": "4.1.5",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.3.2"
|
||||
}
|
||||
}
|
||||
1
packages/extension-sdk/src/index.ts
Normal file
1
packages/extension-sdk/src/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { useLayoutState } from '@directus/shared/composables';
|
||||
30
packages/extension-sdk/tsconfig.json
Normal file
30
packages/extension-sdk/tsconfig.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2019",
|
||||
"lib": ["ES2019"],
|
||||
"moduleResolution": "node",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"strict": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"noUnusedParameters": true,
|
||||
"alwaysStrict": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictBindCallApply": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"resolveJsonModule": false,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"isolatedModules": true,
|
||||
"rootDir": "./src",
|
||||
},
|
||||
"include": ["./src/**/*.ts"]
|
||||
}
|
||||
12
packages/shared/.editorconfig
Normal file
12
packages/shared/.editorconfig
Normal file
@@ -0,0 +1,12 @@
|
||||
root=true
|
||||
|
||||
[*]
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
charset = utf-8
|
||||
indent_style = tab
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[{package.json,*.yml,*.yaml}]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
1
packages/shared/.npmrc
Normal file
1
packages/shared/.npmrc
Normal file
@@ -0,0 +1 @@
|
||||
package-lock=false
|
||||
1
packages/shared/composables.d.ts
vendored
Normal file
1
packages/shared/composables.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/esm/composables';
|
||||
1
packages/shared/constants.d.ts
vendored
Normal file
1
packages/shared/constants.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/esm/constants';
|
||||
674
packages/shared/license
Normal file
674
packages/shared/license
Normal file
@@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
<program> Copyright (C) <year> <name of author>
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
41
packages/shared/package.json
Normal file
41
packages/shared/package.json
Normal file
@@ -0,0 +1,41 @@
|
||||
{
|
||||
"name": "@directus/shared",
|
||||
"version": "9.0.0-rc.80",
|
||||
"description": "Code shared between all directus packages.",
|
||||
"exports": {
|
||||
"./composables": {
|
||||
"import": "./dist/esm/composables/index.js",
|
||||
"require": "./dist/cjs/composables/index.js"
|
||||
},
|
||||
"./utils": {
|
||||
"import": "./dist/esm/utils/index.js",
|
||||
"require": "./dist/cjs/utils/index.js"
|
||||
},
|
||||
"./constants": {
|
||||
"import": "./dist/esm/constants/index.js",
|
||||
"require": "./dist/cjs/constants/index.js"
|
||||
},
|
||||
"./types": {
|
||||
"import": "./dist/esm/types/index.js",
|
||||
"require": "./dist/cjs/types/index.js"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "run-p build:*",
|
||||
"build:esm": "tsc --project ./tsconfig.json --module ES2015 --outDir ./dist/esm",
|
||||
"build:cjs": "tsc --project ./tsconfig.json --module CommonJS --outDir ./dist/cjs",
|
||||
"cleanup": "rimraf ./dist",
|
||||
"dev": "npm run build -- -w --preserveWatchOutput --incremental"
|
||||
},
|
||||
"author": "Nicola Krumschmidt",
|
||||
"gitHead": "24621f3934dc77eb23441331040ed13c676ceffd",
|
||||
"dependencies": {
|
||||
"fs-extra": "^10.0.0",
|
||||
"vue": "^3.0.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"npm-run-all": "4.1.5",
|
||||
"rimraf": "^3.0.2",
|
||||
"typescript": "^4.3.2"
|
||||
}
|
||||
}
|
||||
1
packages/shared/src/composables/index.ts
Normal file
1
packages/shared/src/composables/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export * from './use-layout-state';
|
||||
13
packages/shared/src/composables/use-layout-state.ts
Normal file
13
packages/shared/src/composables/use-layout-state.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { inject, Ref, UnwrapRef } from 'vue';
|
||||
import { LAYOUT_SYMBOL } from '../constants';
|
||||
import { LayoutState } from '../types';
|
||||
|
||||
export function useLayoutState<T extends Record<string, any> = Record<string, any>, Options = any, Query = any>(): Ref<
|
||||
UnwrapRef<LayoutState<T, Options, Query>>
|
||||
> {
|
||||
const layoutState = inject<Ref<UnwrapRef<LayoutState<T, Options, Query>>>>(LAYOUT_SYMBOL);
|
||||
|
||||
if (!layoutState) throw new Error('[useLayoutState]: This function has to be used inside a layout component.');
|
||||
|
||||
return layoutState;
|
||||
}
|
||||
9
packages/shared/src/constants/extensions.ts
Normal file
9
packages/shared/src/constants/extensions.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { ApiExtensionType, AppExtensionType, ExtensionType } from '../types';
|
||||
|
||||
export const SHARED_DEPS = ['@directus/extension-sdk', 'vue'];
|
||||
|
||||
export const APP_EXTENSION_TYPES: AppExtensionType[] = ['interface', 'display', 'layout', 'module'];
|
||||
export const API_EXTENSION_TYPES: ApiExtensionType[] = ['endpoint', 'hook'];
|
||||
export const EXTENSION_TYPES: ExtensionType[] = [...APP_EXTENSION_TYPES, ...API_EXTENSION_TYPES];
|
||||
|
||||
export const EXTENSION_NAME_REGEX = /^(?:(?:@[^/]+\/)?directus-extension-|@directus\/extension-).+$/;
|
||||
2
packages/shared/src/constants/index.ts
Normal file
2
packages/shared/src/constants/index.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
export * from './extensions';
|
||||
export * from './symbols';
|
||||
1
packages/shared/src/constants/symbols.ts
Normal file
1
packages/shared/src/constants/symbols.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const LAYOUT_SYMBOL = process.env.NODE_ENV === 'development' ? Symbol.for('[Directus]: Layout') : Symbol();
|
||||
18
packages/shared/src/types/extensions.ts
Normal file
18
packages/shared/src/types/extensions.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
export type ApiExtensionType = 'endpoint' | 'hook';
|
||||
export type AppExtensionType = 'interface' | 'display' | 'layout' | 'module';
|
||||
export type ExtensionType = ApiExtensionType | AppExtensionType;
|
||||
export type ExtensionPackageType = ExtensionType | 'pack';
|
||||
|
||||
export type Extension = {
|
||||
path: string;
|
||||
name: string;
|
||||
version?: string;
|
||||
|
||||
type: ExtensionPackageType;
|
||||
entrypoint?: string;
|
||||
host?: string;
|
||||
children?: string[];
|
||||
|
||||
local: boolean;
|
||||
root: boolean;
|
||||
};
|
||||
5
packages/shared/src/types/index.ts
Normal file
5
packages/shared/src/types/index.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export * from './extensions';
|
||||
export * from './items';
|
||||
export * from './layouts';
|
||||
export * from './misc';
|
||||
export * from './presets';
|
||||
18
packages/shared/src/types/layouts.ts
Normal file
18
packages/shared/src/types/layouts.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { Item } from './items';
|
||||
import { Filter } from './presets';
|
||||
|
||||
export interface LayoutProps<Options = any, Query = any> {
|
||||
collection: string | null;
|
||||
selection: Item[];
|
||||
layoutOptions: Options;
|
||||
layoutQuery: Query;
|
||||
filters: Filter[];
|
||||
searchQuery: string | null;
|
||||
selectMode: boolean;
|
||||
readonly: boolean;
|
||||
resetPreset?: () => Promise<void>;
|
||||
}
|
||||
|
||||
export type LayoutState<T, Options, Query> = {
|
||||
props: LayoutProps<Options, Query>;
|
||||
} & T;
|
||||
1
packages/shared/src/types/misc.ts
Normal file
1
packages/shared/src/types/misc.ts
Normal file
@@ -0,0 +1 @@
|
||||
export type Plural<T extends string> = `${T}s`;
|
||||
4
packages/shared/src/utils/index.ts
Normal file
4
packages/shared/src/utils/index.ts
Normal file
@@ -0,0 +1,4 @@
|
||||
export * from './list-folders';
|
||||
export * from './load-extensions';
|
||||
export * from './pluralize';
|
||||
export * from './resolve-package';
|
||||
20
packages/shared/src/utils/list-folders.ts
Normal file
20
packages/shared/src/utils/list-folders.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import path from 'path';
|
||||
import fse from 'fs-extra';
|
||||
|
||||
export async function listFolders(location: string): Promise<string[]> {
|
||||
const fullPath = path.resolve(location);
|
||||
const files = await fse.readdir(fullPath);
|
||||
|
||||
const directories: string[] = [];
|
||||
|
||||
for (const file of files) {
|
||||
const filePath = path.join(fullPath, file);
|
||||
const stats = await fse.stat(filePath);
|
||||
|
||||
if (stats.isDirectory()) {
|
||||
directories.push(file);
|
||||
}
|
||||
}
|
||||
|
||||
return directories;
|
||||
}
|
||||
95
packages/shared/src/utils/load-extensions.ts
Normal file
95
packages/shared/src/utils/load-extensions.ts
Normal file
@@ -0,0 +1,95 @@
|
||||
import path from 'path';
|
||||
import fse from 'fs-extra';
|
||||
import { AppExtensionType, Extension } from '../types';
|
||||
import { resolvePackage } from './resolve-package';
|
||||
import { listFolders } from './list-folders';
|
||||
import { EXTENSION_NAME_REGEX, EXTENSION_TYPES } from '../constants';
|
||||
import { pluralize } from './pluralize';
|
||||
|
||||
export async function getPackageExtensions(root: string): Promise<Extension[]> {
|
||||
const pkg = await fse.readJSON(path.resolve(path.join(root, 'package.json')));
|
||||
const extensionNames = Object.keys(pkg.dependencies).filter((dep) => EXTENSION_NAME_REGEX.test(dep));
|
||||
|
||||
return listExtensionsChildren(extensionNames);
|
||||
|
||||
async function listExtensionsChildren(extensionNames: string[], root?: string) {
|
||||
const extensions: Extension[] = [];
|
||||
|
||||
for (const extensionName of extensionNames) {
|
||||
const extensionPath = resolvePackage(extensionName, root);
|
||||
const extensionPkg = await fse.readJSON(path.join(extensionPath, 'package.json'));
|
||||
|
||||
if (extensionPkg['directus:extension'].type === 'pack') {
|
||||
const extensionChildren = Object.keys(extensionPkg.dependencies).filter((dep) =>
|
||||
EXTENSION_NAME_REGEX.test(dep)
|
||||
);
|
||||
|
||||
const extension: Extension = {
|
||||
path: extensionPath,
|
||||
name: extensionName,
|
||||
version: extensionPkg.version,
|
||||
type: extensionPkg['directus:extension'].type,
|
||||
host: extensionPkg['directus:extension'].host,
|
||||
children: extensionChildren,
|
||||
local: false,
|
||||
root: root === undefined,
|
||||
};
|
||||
|
||||
extensions.push(extension);
|
||||
extensions.push(...(await listExtensionsChildren(extension.children || [], extension.path)));
|
||||
} else {
|
||||
extensions.push({
|
||||
path: extensionPath,
|
||||
name: extensionName,
|
||||
version: extensionPkg.version,
|
||||
type: extensionPkg['directus:extension'].type,
|
||||
entrypoint: extensionPkg['directus:extension'].path,
|
||||
host: extensionPkg['directus:extension'].host,
|
||||
local: false,
|
||||
root: root === undefined,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
return extensions;
|
||||
}
|
||||
}
|
||||
|
||||
export async function getLocalExtensions(root: string): Promise<Extension[]> {
|
||||
const extensions: Extension[] = [];
|
||||
|
||||
for (const extensionType of EXTENSION_TYPES) {
|
||||
const typeDir = pluralize(extensionType);
|
||||
const typePath = path.resolve(path.join(root, typeDir));
|
||||
|
||||
try {
|
||||
const extensionNames = await listFolders(typePath);
|
||||
|
||||
for (const extensionName of extensionNames) {
|
||||
const extensionPath = path.join(typePath, extensionName);
|
||||
|
||||
extensions.push({
|
||||
path: extensionPath,
|
||||
name: extensionName,
|
||||
type: extensionType,
|
||||
entrypoint: 'index.js',
|
||||
local: true,
|
||||
root: true,
|
||||
});
|
||||
}
|
||||
} catch (err) {
|
||||
if (err.code === 'ENOENT') throw new Error(`Extension folder "${typePath}" couldn't be opened`);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
return extensions;
|
||||
}
|
||||
|
||||
export function generateExtensionsEntry(type: AppExtensionType, extensions: Extension[]): string {
|
||||
const filteredExtensions = extensions.filter((extension) => extension.type === type);
|
||||
|
||||
return `${filteredExtensions
|
||||
.map((extension, i) => `import e${i} from '${path.resolve(extension.path, extension.entrypoint || '')}';\n`)
|
||||
.join('')}export default [${filteredExtensions.map((_, i) => `e${i}`).join(',')}];`;
|
||||
}
|
||||
9
packages/shared/src/utils/pluralize.ts
Normal file
9
packages/shared/src/utils/pluralize.ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { Plural } from '../types';
|
||||
|
||||
export function pluralize<T extends string>(str: T): Plural<T> {
|
||||
return `${str}s`;
|
||||
}
|
||||
|
||||
export function depluralize<T extends string>(str: Plural<T>): T {
|
||||
return str.slice(0, -1) as T;
|
||||
}
|
||||
5
packages/shared/src/utils/resolve-package.ts
Normal file
5
packages/shared/src/utils/resolve-package.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import path from 'path';
|
||||
|
||||
export function resolvePackage(name: string, root?: string): string {
|
||||
return path.dirname(require.resolve(`${name}/package.json`, root !== undefined ? { paths: [root] } : undefined));
|
||||
}
|
||||
30
packages/shared/tsconfig.json
Normal file
30
packages/shared/tsconfig.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2019",
|
||||
"lib": ["ES2019"],
|
||||
"moduleResolution": "node",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"strict": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"esModuleInterop": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"noImplicitReturns": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"noUnusedParameters": true,
|
||||
"alwaysStrict": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictBindCallApply": true,
|
||||
"strictPropertyInitialization": true,
|
||||
"resolveJsonModule": false,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"isolatedModules": true,
|
||||
"rootDir": "./src",
|
||||
},
|
||||
"include": ["./src/**/*.ts"]
|
||||
}
|
||||
1
packages/shared/types.d.ts
vendored
Normal file
1
packages/shared/types.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/esm/types';
|
||||
1
packages/shared/utils.d.ts
vendored
Normal file
1
packages/shared/utils.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
||||
export * from './dist/esm/utils';
|
||||
Reference in New Issue
Block a user